bundle.js 918 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943
  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 keyForLoginInfo = "userInfo";
  52. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  53. let poolKey = {
  54. inHoleEft: "inHoleEft",
  55. d3ball: "d3ball",
  56. iceEft: "iceEft",
  57. hitEft: "hitEft",
  58. fireworksEft: "fireworksEft",
  59. };
  60. var GameMode;
  61. (function (GameMode) {
  62. GameMode[GameMode["classic"] = 0] = "classic";
  63. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  64. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  65. })(GameMode || (GameMode = {}));
  66. var SkillType;
  67. (function (SkillType) {
  68. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  69. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  70. SkillType[SkillType["ice"] = 2] = "ice";
  71. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  72. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  73. })(SkillType || (SkillType = {}));
  74. var ClassicWordsType;
  75. (function (ClassicWordsType) {
  76. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  77. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  78. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  79. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  80. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  81. })(ClassicWordsType || (ClassicWordsType = {}));
  82. var PressType;
  83. (function (PressType) {
  84. PressType[PressType["powerNode"] = 0] = "powerNode";
  85. PressType[PressType["d2Root"] = 1] = "d2Root";
  86. PressType[PressType["moveNode"] = 2] = "moveNode";
  87. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  88. })(PressType || (PressType = {}));
  89. var PlaceBallType;
  90. (function (PlaceBallType) {
  91. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  92. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  93. })(PlaceBallType || (PlaceBallType = {}));
  94. var EAdType;
  95. (function (EAdType) {
  96. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  97. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  98. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  99. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  100. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  101. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  102. EAdType[EAdType["sign"] = 6] = "sign";
  103. EAdType[EAdType["draw"] = 7] = "draw";
  104. EAdType[EAdType["triple"] = 8] = "triple";
  105. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  106. EAdType[EAdType["getPower"] = 10] = "getPower";
  107. EAdType[EAdType["box"] = 11] = "box";
  108. EAdType[EAdType["try"] = 12] = "try";
  109. EAdType[EAdType["againSign"] = 13] = "againSign";
  110. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  111. })(EAdType || (EAdType = {}));
  112. var Prop;
  113. (function (Prop) {
  114. Prop[Prop["diamond"] = 1] = "diamond";
  115. Prop[Prop["coin"] = 2] = "coin";
  116. Prop[Prop["gan1"] = 3] = "gan1";
  117. Prop[Prop["gan2"] = 4] = "gan2";
  118. Prop[Prop["gan3"] = 5] = "gan3";
  119. Prop[Prop["gan4"] = 6] = "gan4";
  120. })(Prop || (Prop = {}));
  121. var TipsType;
  122. (function (TipsType) {
  123. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  124. TipsType[TipsType["foul"] = 1] = "foul";
  125. })(TipsType || (TipsType = {}));
  126. class AwardType {
  127. constructor(type, num) {
  128. this.type = type;
  129. this.num = num;
  130. }
  131. }
  132. var define = /*#__PURE__*/Object.freeze({
  133. fguiRes: fguiRes,
  134. ballCamp: ballCamp,
  135. FoulType: FoulType,
  136. ALL_BALL_STOP: ALL_BALL_STOP,
  137. WAIT_SHOOT: WAIT_SHOOT,
  138. D3RES_LOADED: D3RES_LOADED,
  139. BALL_SHOOT: BALL_SHOOT,
  140. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  141. RESET_GAME: RESET_GAME,
  142. COIN_CHANGE: COIN_CHANGE,
  143. DIAMOND_CHANGE: DIAMOND_CHANGE,
  144. RESTART_GAME: RESTART_GAME,
  145. GET_USER_INFO: GET_USER_INFO,
  146. CHANGE_SECRETARY: CHANGE_SECRETARY,
  147. POWER_CHANGE: POWER_CHANGE,
  148. POWER_TIME: POWER_TIME,
  149. keyForLoginInfo: keyForLoginInfo,
  150. baseHeadUrl: baseHeadUrl,
  151. poolKey: poolKey,
  152. get GameMode () { return GameMode; },
  153. get SkillType () { return SkillType; },
  154. get ClassicWordsType () { return ClassicWordsType; },
  155. get PressType () { return PressType; },
  156. get PlaceBallType () { return PlaceBallType; },
  157. get EAdType () { return EAdType; },
  158. get Prop () { return Prop; },
  159. get TipsType () { return TipsType; },
  160. AwardType: AwardType
  161. });
  162. class CContext {
  163. constructor() {
  164. this.winSize = { width: 0, height: 0 };
  165. this.notchHeight = 0;
  166. this.bannerHeight = 0;
  167. }
  168. init(resList, callback) {
  169. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  170. this.notchHeight = this.getNotchHeight();
  171. this.bannerHeight = this.getBannerHeight();
  172. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  173. callback && callback();
  174. }));
  175. }
  176. getNotchHeight() {
  177. let notchHeight = 50;
  178. if (Laya.Browser.onMiniGame) {
  179. let deviceInfo = wx.getSystemInfoSync();
  180. if (Laya.Browser.onIOS) {
  181. if (deviceInfo.model.search('iPhone X') != -1) {
  182. notchHeight = deviceInfo.statusBarHeight - 10;
  183. }
  184. else {
  185. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  186. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. }
  190. }
  191. else if (Laya.Browser.onAndroid) {
  192. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  193. notchHeight = deviceInfo.statusBarHeight;
  194. }
  195. }
  196. }
  197. return notchHeight;
  198. }
  199. getBannerHeight() {
  200. return 0;
  201. }
  202. }
  203. let context = new CContext();
  204. var Handler = Laya.Handler;
  205. var Tween = Laya.Tween;
  206. function playClickEffect(btn) {
  207. if (!btn)
  208. return;
  209. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  210. if (!btn)
  211. return;
  212. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  213. if (!btn)
  214. return;
  215. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  216. }), 0, true);
  217. }), 0, true);
  218. }
  219. function getNumList(strList) {
  220. let dataList = [];
  221. if (strList) {
  222. let list = strList;
  223. let array = list.split(',');
  224. for (var v in array) {
  225. dataList.push(Number(array[v]));
  226. }
  227. }
  228. return dataList;
  229. }
  230. function getStrList(strList) {
  231. let dataList = [];
  232. if (strList) {
  233. let list = strList;
  234. let array = list.split('|');
  235. for (var v in array) {
  236. dataList.push(String(array[v]));
  237. }
  238. }
  239. return dataList;
  240. }
  241. function getRandStr(len) {
  242. 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'];
  243. let str = "";
  244. for (let i = 0; i < len; i++) {
  245. let rand = random(0, list.length);
  246. str += list[rand];
  247. }
  248. return str;
  249. }
  250. function getUserId() {
  251. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  252. return str;
  253. }
  254. function formatPos(pos, len = 2) {
  255. let v = Math.pow(10, len);
  256. pos.x = Math.floor(pos.x * v) / v;
  257. pos.y = Math.floor(pos.y * v) / v;
  258. if (pos.z)
  259. pos.z = Math.floor(pos.z * v) / v;
  260. return pos;
  261. }
  262. function setPosInt(pos) {
  263. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  264. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  265. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  266. return pos;
  267. }
  268. function random(min, max) {
  269. var rang = max - min;
  270. var rand = Math.random() * rang;
  271. return Math.floor(rand) + min;
  272. }
  273. function randomList(list, num) {
  274. if (list.length <= num)
  275. return list;
  276. let arry = [];
  277. list.forEach(item => {
  278. arry.push(item);
  279. });
  280. let nums = [];
  281. for (let i = 0; i < num; i++) {
  282. let rand = random(0, arry.length);
  283. let v = arry[rand];
  284. nums.push(v);
  285. arry.splice(rand, 1);
  286. }
  287. return nums;
  288. }
  289. function worldToScreen(camera, point, pos) {
  290. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  291. pos.x = pos.x / Laya.stage.clientScaleX;
  292. pos.y = pos.y / Laya.stage.clientScaleY;
  293. }
  294. function getStringLenght(str) {
  295. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  296. }
  297. function reviseString(str, len) {
  298. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  299. if (ld > len) {
  300. let sl = Math.floor(len / 2);
  301. let rs = str.substring(0, sl);
  302. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  303. while (d + 2 < len) {
  304. sl++;
  305. rs = str.substring(0, sl);
  306. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  307. }
  308. return rs + "...";
  309. }
  310. return str;
  311. }
  312. function getCoinString(coin) {
  313. if (coin < 10000)
  314. return coin.toString();
  315. else if (coin < 1000000) {
  316. let vh = Math.ceil(coin / 100);
  317. return (vh / 10) + "k";
  318. }
  319. else if (coin < 1000000000) {
  320. var vh = Math.ceil(coin / 100000);
  321. return (vh / 10) + "m";
  322. }
  323. else if (coin < 1000000000000) {
  324. var vh = Math.ceil(coin / 100000000);
  325. return (vh / 10) + "b";
  326. }
  327. else if (coin < 1000000000000000) {
  328. var vh = Math.ceil(coin / 100000000000);
  329. return (vh / 10) + "t";
  330. }
  331. }
  332. function getV3Dest(pos, dir, dis, dest) {
  333. dir.x *= dis;
  334. dir.y *= dis;
  335. dir.z *= dis;
  336. Laya.Vector3.add(pos, dir, dest);
  337. return dest;
  338. }
  339. function getV2Dest(x1, y1, dir, dis, dest) {
  340. dest.x = x1 + dir.x * dis;
  341. dest.y = y1 + dir.y * dis;
  342. return dest;
  343. }
  344. function getV2Dir(x1, y1, x2, y2, dir) {
  345. dir.x = x2 - x1;
  346. dir.y = y2 - y1;
  347. Laya.Vector2.normalize(dir, dir);
  348. return dir;
  349. }
  350. function getV3Dir(p1, p2, dir) {
  351. Laya.Vector3.subtract(p1, p2, dir);
  352. Laya.Vector3.normalize(dir, dir);
  353. return dir;
  354. }
  355. function copyPos(ip, op) {
  356. op.x = ip.x;
  357. op.y = ip.y;
  358. if (ip.z)
  359. op.z = ip.z;
  360. return op;
  361. }
  362. function getScreenImg() {
  363. let gl = Laya.WebGLContext.mainContext;
  364. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  365. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  366. let w = gl.drawingBufferWidth;
  367. let h = gl.drawingBufferHeight;
  368. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  369. texture2d.setPixels(pixels);
  370. return new Laya.Texture(texture2d);
  371. }
  372. function playMoveByPositions(sp, positions, v, completeCallback) {
  373. let p;
  374. let play = () => {
  375. if (positions.length == 0) {
  376. completeCallback();
  377. return;
  378. }
  379. p = positions[0];
  380. positions.splice(0, 1);
  381. 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, () => {
  382. play();
  383. }));
  384. };
  385. play();
  386. }
  387. function setStarPos(node, num, max) {
  388. for (let i = 1; i <= 5; i++) {
  389. let img = node.getChildAt(i - 1);
  390. img.width = img.height = 30;
  391. img.pivotX = img.pivotY = 0.5;
  392. img.gray = i > num;
  393. img.visible = i <= max;
  394. if (max == 3) {
  395. img.x = node.width / 2 + (i - 2) * 30 - 15;
  396. img.y = node.height - 40;
  397. if (i == 2)
  398. img.y = node.height - 30;
  399. }
  400. else if (max == 5) {
  401. let ly = Math.abs(i - 3);
  402. img.x = node.width / 2 + (i - 3) * 20 - 15;
  403. img.y = node.height - ly * 8 - 30;
  404. }
  405. }
  406. }
  407. function playLoopAnimRotate(sp, time, clockwise = true) {
  408. let rotation;
  409. sp.rotation = sp.rotation % 360;
  410. if (clockwise) {
  411. rotation = -360;
  412. }
  413. else {
  414. rotation = 360;
  415. }
  416. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  417. this.playLoopAnimRotate(sp, time, clockwise);
  418. }));
  419. }
  420. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  421. let x, y;
  422. if (isBig) {
  423. x = valueXMin;
  424. y = valueYMin;
  425. }
  426. else {
  427. x = valueXMax;
  428. y = valueYMax;
  429. }
  430. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  431. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  432. }));
  433. }
  434. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  435. let scale;
  436. if (isBig) {
  437. scale = valueMin;
  438. }
  439. else {
  440. scale = valueMax;
  441. }
  442. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  443. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  444. }));
  445. }
  446. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  447. let value;
  448. if (isBig) {
  449. value = valueMin;
  450. }
  451. else {
  452. value = valueMax;
  453. }
  454. if (count) {
  455. count--;
  456. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  457. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  458. }));
  459. }
  460. else {
  461. sp.rotation = 0;
  462. }
  463. }
  464. function inRect(rect, p) {
  465. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  466. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  467. return true;
  468. }
  469. }
  470. return false;
  471. }
  472. function getNumberK(number) {
  473. if (number < 1000) {
  474. return number.toString();
  475. }
  476. else {
  477. return (number / 1000).toFixed(1) + "k";
  478. }
  479. }
  480. function pointInsideCircle(point, circle, r) {
  481. if (r === 0)
  482. return false;
  483. var dx = circle.x - point.x;
  484. var dy = circle.y - point.y;
  485. return dx * dx + dy * dy <= r * r;
  486. }
  487. function formatString(str, data) {
  488. if (!str || data == undefined) {
  489. return str;
  490. }
  491. if (typeof data === "object") {
  492. for (var key in data) {
  493. if (data.hasOwnProperty(key)) {
  494. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  495. }
  496. }
  497. }
  498. else {
  499. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  500. return str.replace(reg, function (match, index) {
  501. return args[index - (-1)];
  502. });
  503. }
  504. return str;
  505. }
  506. function getIntersection(a, b) {
  507. let t = [];
  508. for (var i = 0; i < a.length; i++) {
  509. for (var j = 0; j < b.length; j++) {
  510. if (a[i] == b[j]) {
  511. t.push(a[i]);
  512. }
  513. }
  514. }
  515. return t;
  516. }
  517. function getComplement(a, b) {
  518. let t = [];
  519. let count = false;
  520. for (var i = 0; i < a.length; i++) {
  521. count = false;
  522. for (var j = 0; j < b.length; j++) {
  523. if (a[i] == b[j]) {
  524. count = true;
  525. break;
  526. }
  527. }
  528. if (!count) {
  529. t.push(a[i]);
  530. }
  531. }
  532. return t;
  533. }
  534. function geSpriteStageRect(sp) {
  535. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  536. let rect = {
  537. x: point.x,
  538. y: point.y,
  539. width: sp.width * sp.globalScaleX,
  540. height: sp.height * sp.globalScaleY
  541. };
  542. return rect;
  543. }
  544. function touchButton(button) {
  545. let event = new Laya.Event();
  546. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  547. }
  548. function setColor(sprite, r, g, b) {
  549. var redMat = [
  550. r / 255, 0, 0, 0, 0,
  551. g / 255, 0, 0, 0, 0,
  552. b / 255, 0, 0, 0, 0,
  553. 0, 0, 0, 1, 0,
  554. ];
  555. var filter = new Laya.ColorFilter(redMat);
  556. sprite.filters = [filter];
  557. }
  558. function clone(obj, newobj = {}) {
  559. for (var attr in obj) {
  560. if (typeof obj[attr] == "object") {
  561. newobj[attr] = clone(obj[attr], newobj[attr]);
  562. }
  563. else {
  564. newobj[attr] = obj[attr];
  565. }
  566. }
  567. return newobj;
  568. }
  569. function _ms(arr, compare, begin, end) {
  570. const size = end - begin;
  571. if (size <= 1) {
  572. return;
  573. }
  574. const middle = (end + begin) >> 1;
  575. _ms(arr, compare, begin, middle);
  576. _ms(arr, compare, middle, end);
  577. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  578. return;
  579. }
  580. const merged = [];
  581. let leftIndex = begin, rightIndex = middle;
  582. while (merged.length < size) {
  583. if (leftIndex === middle) {
  584. merged.push(arr[rightIndex++]);
  585. }
  586. else if (rightIndex === end) {
  587. merged.push(arr[leftIndex++]);
  588. }
  589. else {
  590. const c = compare(arr[leftIndex], arr[rightIndex]);
  591. if (c <= 0) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. merged.push(arr[rightIndex++]);
  596. }
  597. }
  598. }
  599. arr.splice(begin, size, ...merged);
  600. }
  601. function sort(arr, compare) {
  602. if (!Array.isArray(arr)) {
  603. throw new Error('sort的参数必须为数组');
  604. }
  605. _ms(arr, compare, 0, arr.length);
  606. return arr;
  607. }
  608. function getLanguage(id) {
  609. }
  610. function getLanguageByTip(id) {
  611. }
  612. function toWeights(array) {
  613. let max = 0;
  614. for (var i = 0; i < array.length; i++) {
  615. max = max + array[i];
  616. if (array[i] == 0) {
  617. array[i] = 0;
  618. }
  619. else {
  620. array[i] = max;
  621. }
  622. }
  623. return array;
  624. }
  625. function unique(array) {
  626. var n = {}, r = [], len = array.length, val, type;
  627. for (var i = 0; i < array.length; i++) {
  628. val = array[i];
  629. type = typeof val;
  630. if (!n[val]) {
  631. n[val] = [type];
  632. r.push(val);
  633. }
  634. else if (n[val].indexOf(type) < 0) {
  635. n[val].push(type);
  636. r.push(val);
  637. }
  638. }
  639. return r;
  640. }
  641. function unique1(array) {
  642. var r = [];
  643. for (var i = 0, l = array.length; i < l; i++) {
  644. for (var j = i + 1; j < l; j++)
  645. if (array[i] == array[j])
  646. j == ++i;
  647. r.push(array[i]);
  648. }
  649. return r;
  650. }
  651. function getDistance(x1, y1, x2, y2) {
  652. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  653. }
  654. function getV2Dis(pos1, pos2) {
  655. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  656. }
  657. function getV2SqDis(pos1, pos2) {
  658. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  659. }
  660. function getDis(x1, y1, x2, y2) {
  661. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  662. }
  663. function getDeltaxy(x1, y1, x2, y2) {
  664. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  665. }
  666. function getSymbolNumber(num) {
  667. if (num > 0) {
  668. return "+" + num;
  669. }
  670. else if (num < 0) {
  671. return num.toString();
  672. }
  673. return num.toString();
  674. }
  675. function fixNumber(num, length) {
  676. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  677. }
  678. function toThousands(num) {
  679. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  680. }
  681. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  682. function fmtMoney(money) {
  683. money = toThousands(money.replace(/^0+/, ''));
  684. if (money.length == 0) {
  685. money = "0";
  686. }
  687. let unit = 0;
  688. for (var i = 0; i < money.length; i++) {
  689. if (money.charAt(i) == ",") {
  690. unit++;
  691. }
  692. }
  693. if (unit == 0) {
  694. return money;
  695. }
  696. else {
  697. let idx = money.indexOf(",");
  698. if (idx) {
  699. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  700. }
  701. return money.replace(",", ".");
  702. }
  703. }
  704. function flatten(arr) {
  705. while (arr.some(item => Array.isArray(item))) {
  706. arr = [].concat(...arr);
  707. }
  708. return arr;
  709. }
  710. function getDistanceByPoint(p1, p2) {
  711. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  712. }
  713. function getAngleByPoint(p1, p2) {
  714. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  715. }
  716. function toIntByArray(array) {
  717. for (var index = 0; index < array.length; index++) {
  718. array[index] = parseInt(array[index]);
  719. }
  720. return array;
  721. }
  722. function getAngle0To360(angle) {
  723. while (angle < 0) {
  724. angle += 360;
  725. }
  726. while (angle >= 360) {
  727. angle -= 360;
  728. }
  729. return angle;
  730. }
  731. function toAngle(radian) {
  732. return radian * 180 / Math.PI;
  733. }
  734. function toRadian(angle) {
  735. return angle * Math.PI / 180;
  736. }
  737. function getArrayValueRandom(array) {
  738. return array[random(0, array.length - 1)];
  739. }
  740. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  741. }
  742. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  743. }
  744. function fmtTimeMMSS(time) {
  745. if (time < 0) {
  746. time = 0;
  747. }
  748. else
  749. time = Math.floor(time);
  750. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  751. }
  752. function fmtTimeMS(time) {
  753. if (time < 0) {
  754. time = 0;
  755. }
  756. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  757. }
  758. function fmtTimeHHMM(time) {
  759. if (time < 0) {
  760. time = 0;
  761. }
  762. time = Math.floor(time / 1000);
  763. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  764. }
  765. let severTime = 0;
  766. function getServerTime() {
  767. return new Date(new Date().getTime() - severTime);
  768. }
  769. function setServerTime(data) {
  770. severTime = (new Date().getTime() - data);
  771. }
  772. var tools = /*#__PURE__*/Object.freeze({
  773. playClickEffect: playClickEffect,
  774. getNumList: getNumList,
  775. getStrList: getStrList,
  776. getRandStr: getRandStr,
  777. getUserId: getUserId,
  778. formatPos: formatPos,
  779. setPosInt: setPosInt,
  780. random: random,
  781. randomList: randomList,
  782. worldToScreen: worldToScreen,
  783. getStringLenght: getStringLenght,
  784. reviseString: reviseString,
  785. getCoinString: getCoinString,
  786. getV3Dest: getV3Dest,
  787. getV2Dest: getV2Dest,
  788. getV2Dir: getV2Dir,
  789. getV3Dir: getV3Dir,
  790. copyPos: copyPos,
  791. getScreenImg: getScreenImg,
  792. playMoveByPositions: playMoveByPositions,
  793. setStarPos: setStarPos,
  794. playLoopAnimRotate: playLoopAnimRotate,
  795. playLoopAnimPosition: playLoopAnimPosition,
  796. playLoopAnimScale: playLoopAnimScale,
  797. playLoopAnimRotation: playLoopAnimRotation,
  798. inRect: inRect,
  799. getNumberK: getNumberK,
  800. pointInsideCircle: pointInsideCircle,
  801. formatString: formatString,
  802. getIntersection: getIntersection,
  803. getComplement: getComplement,
  804. geSpriteStageRect: geSpriteStageRect,
  805. touchButton: touchButton,
  806. setColor: setColor,
  807. clone: clone,
  808. sort: sort,
  809. getLanguage: getLanguage,
  810. getLanguageByTip: getLanguageByTip,
  811. toWeights: toWeights,
  812. unique: unique,
  813. unique1: unique1,
  814. getDistance: getDistance,
  815. getV2Dis: getV2Dis,
  816. getV2SqDis: getV2SqDis,
  817. getDis: getDis,
  818. getDeltaxy: getDeltaxy,
  819. getSymbolNumber: getSymbolNumber,
  820. fixNumber: fixNumber,
  821. toThousands: toThousands,
  822. fmtMoney: fmtMoney,
  823. flatten: flatten,
  824. getDistanceByPoint: getDistanceByPoint,
  825. getAngleByPoint: getAngleByPoint,
  826. toIntByArray: toIntByArray,
  827. getAngle0To360: getAngle0To360,
  828. toAngle: toAngle,
  829. toRadian: toRadian,
  830. getArrayValueRandom: getArrayValueRandom,
  831. promptByTip: promptByTip,
  832. promptByErrorCode: promptByErrorCode,
  833. fmtTimeMMSS: fmtTimeMMSS,
  834. fmtTimeMS: fmtTimeMS,
  835. fmtTimeHHMM: fmtTimeHHMM,
  836. getServerTime: getServerTime,
  837. setServerTime: setServerTime
  838. });
  839. class HttpMgr {
  840. constructor() {
  841. HttpMgr._instance = this;
  842. }
  843. static getInstance() {
  844. if (!this._instance) {
  845. this._instance = new HttpMgr();
  846. }
  847. return this._instance;
  848. }
  849. sendPost(url, data, call) {
  850. let httpObj = new Laya.HttpRequest();
  851. httpObj.http.timeout = 5000;
  852. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  853. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  854. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  855. function errorHandler(error) {
  856. console.log("errorHandler:" + error);
  857. alert("Please check your network connection.");
  858. }
  859. function completeHandler(data) {
  860. if (data && data.length > 0) {
  861. let jsonData = JSON.parse(data);
  862. if (call)
  863. call(jsonData);
  864. }
  865. }
  866. }
  867. sendPost2025(reqUrl, data, call) {
  868. let isDev = true;
  869. let urlTop = "https://api.kessongame.site/";
  870. let urlMid = urlTop + "prod-api/api/game/";
  871. if (isDev) {
  872. urlTop = "http://192.168.1.13:8090/";
  873. urlMid = urlTop + "api/game/";
  874. }
  875. let url = urlMid + reqUrl;
  876. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  877. if (isDev) {
  878. url = urlTop + reqUrl;
  879. }
  880. else {
  881. url = urlTop + "prod-api/" + reqUrl;
  882. }
  883. }
  884. let httpObj = new Laya.HttpRequest();
  885. httpObj.http.timeout = 5000;
  886. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  887. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  888. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  889. function errorHandler(error) {
  890. if (call) {
  891. call("{'msg':'Network exception','code':500}");
  892. }
  893. else {
  894. alert("Tip:Please check your network connection.");
  895. }
  896. }
  897. function completeHandler(data) {
  898. if (data && data.length > 0) {
  899. let jsonData = JSON.parse(data);
  900. if (call)
  901. call(jsonData);
  902. }
  903. }
  904. }
  905. sendGet(url, call) {
  906. let httpObj = new Laya.HttpRequest();
  907. httpObj.http.timeout = 5000;
  908. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  909. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  910. httpObj.send(url, '', 'get');
  911. function errorHandler(error) {
  912. console.log("errorHandler:" + error);
  913. }
  914. function completeHandler(data) {
  915. if (data && data.length > 0) {
  916. if (call)
  917. call(data);
  918. }
  919. }
  920. }
  921. }
  922. HttpMgr._instance = null;
  923. class LightShader extends Laya.Sprite {
  924. constructor() {
  925. super();
  926. this._time = 0;
  927. this._sin = 0;
  928. this.initShader();
  929. }
  930. initShader() {
  931. var vs = `
  932. #define FSHIGHPRECISION
  933. attribute vec4 posuv;
  934. uniform vec2 size;
  935. varying vec4 v_texcoord;
  936. void main() {
  937. vec4 pos = vec4(posuv.xy,0.,1.);
  938. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  939. gl_Position=pos1;
  940. v_texcoord.xy = posuv.xy;
  941. }
  942. `;
  943. var ps = `
  944. #define FSHIGHPRECISION
  945. precision highp float;
  946. varying vec4 v_texcoord;
  947. uniform vec2 size;
  948. uniform sampler2D texture;
  949. uniform float u_Time;
  950. void main() {
  951. vec4 color= texture2D(texture, v_texcoord.xy);
  952. float width = 0.2;
  953. float start = u_Time;
  954. float offset = 1.0;
  955. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  956. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  957. {
  958. color.r=1.1;
  959. color.g=1.1;
  960. color.b=1.1;
  961. gl_FragColor = color;
  962. } else {
  963. gl_FragColor = color;
  964. }
  965. }
  966. `;
  967. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  968. this.customRenderEnable = true;
  969. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  970. }
  971. customRender(context, x, y) {
  972. this.onUpdate();
  973. if (!this.texture)
  974. return;
  975. let xx = x - this.pivotX;
  976. let yy = y - this.pivotY;
  977. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  978. }
  979. onUpdate() {
  980. this._time += 2 * Laya.timer.delta * 0.001;
  981. this._sin = Math.sin(this._time);
  982. if (this._sin > 0.99) {
  983. this._sin = 0;
  984. this._time = 0;
  985. }
  986. this.shaderValue['u_Time'] = this._sin;
  987. }
  988. }
  989. LightShader.DissolveSurfaceSaveName = 9997;
  990. class UIBase extends fairygui.Window {
  991. constructor() {
  992. super();
  993. this.isEject = true;
  994. this.isHide = true;
  995. this.showbanner = true;
  996. this.className = "";
  997. this.isMuti = false;
  998. this.showbanner = false;
  999. this.onConstructor();
  1000. }
  1001. checkActive(show) {
  1002. }
  1003. getUIName() {
  1004. return UIBase.uiName;
  1005. }
  1006. onConstructor() {
  1007. }
  1008. onInit() {
  1009. if (!!this.contentPane) {
  1010. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1011. }
  1012. this.setPivot(0.5, 0.5, false);
  1013. }
  1014. doShowAnimation() {
  1015. if (!this.isEject)
  1016. return;
  1017. super.doShowAnimation();
  1018. Laya.Tween.clearTween(this);
  1019. this.scaleX = this.scaleY = 0.8;
  1020. let tweenFunc1 = (func) => {
  1021. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1022. };
  1023. let tweenFunc2 = (func) => {
  1024. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1025. };
  1026. tweenFunc1(tweenFunc2);
  1027. }
  1028. show(...args) {
  1029. super.show();
  1030. this._openParam = args;
  1031. this.isHide = false;
  1032. xGame.uiMgr.checkUIState();
  1033. }
  1034. moveBannerButton() {
  1035. }
  1036. showBannerButton() {
  1037. this.bannerButton.visible = true;
  1038. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1039. this.bannerButton.touchable = true;
  1040. }));
  1041. }
  1042. hide() {
  1043. super.hide();
  1044. this.isHide = true;
  1045. xGame.uiMgr.checkUIState();
  1046. }
  1047. Dispose() {
  1048. super.dispose();
  1049. }
  1050. myUpdate(delay) {
  1051. }
  1052. refresh() { }
  1053. addUIClick(obj, func, arr = null) {
  1054. obj.onClick(this, func, arr);
  1055. obj.onClick(this, this.playBtnSound);
  1056. }
  1057. offUIClick(obj, func) {
  1058. obj.offClick(this, func);
  1059. }
  1060. playBtnSound() {
  1061. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1062. }
  1063. }
  1064. UIBase.lastShowBanner = 0;
  1065. UIBase.showBannerNum = 0;
  1066. UIBase.uiName = "";
  1067. class ui_UIDraw extends fgui.GComponent {
  1068. static createInstance() {
  1069. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1070. }
  1071. onConstruct() {
  1072. this.n1 = (this.getChild("n1"));
  1073. this.extraNode = (this.getChild("extraNode"));
  1074. this.myNode = (this.getChild("myNode"));
  1075. this.closeNode = (this.getChild("closeNode"));
  1076. this.moneyNode = (this.getChild("moneyNode"));
  1077. this.n38 = (this.getChild("n38"));
  1078. this.secretary = (this.getChild("secretary"));
  1079. this.drawBtn = (this.getChild("drawBtn"));
  1080. this.talkNode = (this.getChild("talkNode"));
  1081. this.t0 = this.getTransition("t0");
  1082. }
  1083. }
  1084. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1085. class ui_UIBox extends fgui.GComponent {
  1086. static createInstance() {
  1087. return (fgui.UIPackage.createObject("game", "UIBox"));
  1088. }
  1089. onConstruct() {
  1090. this.n0 = (this.getChild("n0"));
  1091. this.n12 = (this.getChild("n12"));
  1092. this.n1 = (this.getChild("n1"));
  1093. this.n2 = (this.getChild("n2"));
  1094. this.bar = (this.getChild("bar"));
  1095. this.closeBtn = (this.getChild("closeBtn"));
  1096. this.openBtn = (this.getChild("openBtn"));
  1097. this.t0 = this.getTransition("t0");
  1098. this.t1 = this.getTransition("t1");
  1099. }
  1100. }
  1101. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1102. class GlobalManager {
  1103. constructor() {
  1104. }
  1105. registerMethod(name, method) {
  1106. console.log('zh: 注册全局方法', name);
  1107. this[name] = method;
  1108. }
  1109. callMethod(name, ...args) {
  1110. console.log('zh: 调用全局方法', name);
  1111. if (this[name]) {
  1112. return this[name](...args);
  1113. }
  1114. else {
  1115. console.error(`zh: 全局方法 Method ${name} not found`);
  1116. }
  1117. }
  1118. }
  1119. GlobalManager.instance = new GlobalManager();
  1120. class JSBridgeUtils {
  1121. constructor() { }
  1122. static get instance() {
  1123. if (!this._instance) {
  1124. this._instance = new JSBridgeUtils();
  1125. }
  1126. return this._instance;
  1127. }
  1128. initBridge() {
  1129. if (!Laya.Browser.onAndroid) {
  1130. console.log('zh:非android dev');
  1131. return;
  1132. }
  1133. let cfg = window['conchConfig'];
  1134. if (cfg) {
  1135. var os = cfg.getOS();
  1136. if (os == "Conch-android") {
  1137. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1138. if (this.bridge) {
  1139. return true;
  1140. }
  1141. else {
  1142. return false;
  1143. }
  1144. }
  1145. else {
  1146. return false;
  1147. }
  1148. }
  1149. else {
  1150. return false;
  1151. }
  1152. }
  1153. testAd1() {
  1154. if (!Laya.Browser.onAndroid) {
  1155. console.log('zh:非android dev');
  1156. return;
  1157. }
  1158. if (!this.initBridge()) {
  1159. return;
  1160. }
  1161. let rs = this.bridge.call("testString", "hello");
  1162. console.log('zh:testString rs=' + rs);
  1163. }
  1164. testAdCallBack() {
  1165. if (!this.initBridge()) {
  1166. return;
  1167. }
  1168. console.log("zh:testAdCallBack start");
  1169. const defaultObj = { code: 200, msg: "req update Ui" };
  1170. const reqObj = { code: 300, msg: "hello java ui" };
  1171. this.bridge.callWithBack((rsStr) => {
  1172. const rsObj = JSON.parse(rsStr);
  1173. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1174. }, "testAsyncCallback", JSON.stringify(reqObj));
  1175. }
  1176. showInternAd(mark) {
  1177. console.log('zh:showInternAd start');
  1178. if (!Laya.Browser.onAndroid) {
  1179. console.log('zh:showInternAd 非android dev');
  1180. return false;
  1181. }
  1182. if (!this.initBridge()) {
  1183. return false;
  1184. }
  1185. let rs = this.bridge.call("showInternAd", mark);
  1186. try {
  1187. const result = JSON.parse(rs);
  1188. if (result.code === 200) {
  1189. console.log("zh:showInternAd OK");
  1190. return true;
  1191. }
  1192. else {
  1193. console.warn("zh:showInternAd FAILL:", result.msg);
  1194. return false;
  1195. }
  1196. }
  1197. catch (e) {
  1198. console.error("zh:解析桥接返回值失败:", e);
  1199. return false;
  1200. }
  1201. }
  1202. exitAndCloseGame() {
  1203. if (!Laya.Browser.onAndroid) {
  1204. return;
  1205. }
  1206. if (!this.initBridge()) {
  1207. return;
  1208. }
  1209. console.log('zh:开始关闭游戏-');
  1210. this.bridge.call("exitAndCloseGame");
  1211. }
  1212. showRewardAd(mark) {
  1213. if (!Laya.Browser.onAndroid) {
  1214. return false;
  1215. }
  1216. if (!this.initBridge()) {
  1217. return false;
  1218. }
  1219. let rs = this.bridge.call("showRewardAd", mark);
  1220. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1221. try {
  1222. const result = JSON.parse(rs);
  1223. if (result.code === 200) {
  1224. console.log("zh:广告显示成功");
  1225. return true;
  1226. }
  1227. else {
  1228. console.warn("zh:广告显示失败:", result.msg);
  1229. return false;
  1230. }
  1231. }
  1232. catch (e) {
  1233. console.error("zh:解析桥接返回值失败:", e);
  1234. return false;
  1235. }
  1236. }
  1237. logEventForAdNoParams(eventName) {
  1238. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1239. if (!Laya.Browser.onAndroid) {
  1240. return;
  1241. }
  1242. if (!this.initBridge()) {
  1243. return;
  1244. }
  1245. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1246. this.bridge.call("logEventForAdNoParams", eventName);
  1247. }
  1248. logEventForAdHaveParams(eventName, jsonStr) {
  1249. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1250. if (!Laya.Browser.onAndroid) {
  1251. return;
  1252. }
  1253. if (!this.initBridge()) {
  1254. return;
  1255. }
  1256. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1257. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1258. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1259. }
  1260. logEventForFirebase(eventName, jsonStr) {
  1261. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1262. if (!Laya.Browser.onAndroid) {
  1263. return;
  1264. }
  1265. if (!this.initBridge()) {
  1266. return;
  1267. }
  1268. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1269. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1270. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1271. }
  1272. testNetTip() {
  1273. if (Laya.Browser.onAndroid) {
  1274. let boo = this.getNetworkAvailable();
  1275. this.showToast2("Network error, reward unavailable");
  1276. return;
  1277. }
  1278. }
  1279. getNetworkAvailable() {
  1280. if (!Laya.Browser.onAndroid) {
  1281. return;
  1282. }
  1283. if (!this.initBridge()) {
  1284. return;
  1285. }
  1286. let boo = this.bridge.call("getNetworkAvailable");
  1287. console.log("zh:getNetworkAvailable boo=" + boo);
  1288. return boo;
  1289. }
  1290. showToast2(msg) {
  1291. if (!Laya.Browser.onAndroid) {
  1292. return;
  1293. }
  1294. if (!this.initBridge()) {
  1295. return;
  1296. }
  1297. this.bridge.call("showToast2", msg);
  1298. }
  1299. nativeCallJs(msg) {
  1300. console.log("zh:nativeCallJs received data: 1111", msg);
  1301. if (msg === 'Ad1') {
  1302. GlobalManager.instance.callMethod('Ad1');
  1303. console.log("zh: Ad1 奖励发送成功");
  1304. }
  1305. else if (msg === 'Ad2') {
  1306. GlobalManager.instance.callMethod('Ad2');
  1307. console.log("zh: Ad2 奖励发送成功");
  1308. }
  1309. else if (msg === 'Ad3') {
  1310. GlobalManager.instance.callMethod('Ad3');
  1311. console.log("zh: Ad3 奖励发送成功");
  1312. }
  1313. else if (msg === 'Ad4') {
  1314. GlobalManager.instance.callMethod('Ad4');
  1315. console.log("zh: Ad4 奖励发送成功");
  1316. }
  1317. else if (msg === 'Ad5') {
  1318. console.log("zh: Ad5 奖励发送成功");
  1319. GlobalManager.instance.callMethod('Ad5');
  1320. }
  1321. }
  1322. }
  1323. class UIBox extends UIBase {
  1324. constructor() {
  1325. super();
  1326. this.boxNum = 0;
  1327. this.boxMax = 10;
  1328. this.inAd = false;
  1329. this.isClose = false;
  1330. }
  1331. onConstructor() {
  1332. this.ui = ui_UIBox.createInstance();
  1333. this.contentPane = this.ui;
  1334. this.isEject = false;
  1335. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1336. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1337. Laya.timer.loop(1000, this, this.update);
  1338. }
  1339. update() {
  1340. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1341. this.boxNum -= 1;
  1342. this.upBar();
  1343. }
  1344. }
  1345. upBar() {
  1346. if (this.boxNum > this.boxMax)
  1347. this.boxNum = this.boxMax;
  1348. this.ui.bar.value = this.boxNum * 10;
  1349. }
  1350. show() {
  1351. super.show();
  1352. this.isClose = false;
  1353. this.boxNum = 0;
  1354. this.inAd = false;
  1355. this.upBar();
  1356. this.ui.t0.play();
  1357. this.ui.closeBtn.visible = false;
  1358. Laya.timer.once(3000, this, () => {
  1359. this.ui.closeBtn.visible = true;
  1360. this.ui.bar.alpha = 1;
  1361. });
  1362. Laya.timer.once(500, this, () => {
  1363. this.ui.t1.play();
  1364. });
  1365. }
  1366. hide() {
  1367. Laya.timer.clearAll(this);
  1368. Moyu.showBannerAd(false);
  1369. super.hide();
  1370. }
  1371. onOpenBox() {
  1372. this.boxNum++;
  1373. if (this.boxNum < this.boxMax) {
  1374. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1375. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1376. }
  1377. }
  1378. else if (this.boxNum == this.boxMax) {
  1379. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1380. this.ui.openBtn.c1.selectedIndex = 13;
  1381. this.inAd = true;
  1382. }
  1383. else
  1384. this.getAward();
  1385. }
  1386. else if (this.inAd) {
  1387. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1388. if (Laya.Browser.onAndroid) {
  1389. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1390. if (!boo) {
  1391. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1392. return;
  1393. }
  1394. }
  1395. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1396. }
  1397. else {
  1398. console.log('zh:AD 失败,直接发放奖励');
  1399. this.qjff_AD_for_UIBOX_onOpenBox();
  1400. }
  1401. }
  1402. this.upBar();
  1403. }
  1404. qjff_AD_for_UIBOX_onOpenBox() {
  1405. this.getAward();
  1406. }
  1407. onCloseBox() {
  1408. if (this.isClose)
  1409. this.hide();
  1410. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1411. this.isClose = true;
  1412. PlatMgr.showBanner(true, 0, 3000);
  1413. }
  1414. else
  1415. this.hide();
  1416. }
  1417. getAward() {
  1418. let str = "";
  1419. if (Math.random() < 0.5) {
  1420. let max = Moyu.isLegal ? 500 : 2500;
  1421. let num = xGame.tools.random(max, 500 + max);
  1422. DataMgr.setCoin(num);
  1423. str = "金币x" + num;
  1424. }
  1425. else {
  1426. let max = Moyu.isLegal ? 10 : 30;
  1427. let num = xGame.tools.random(max, 30 + max);
  1428. DataMgr.setDiamond(num);
  1429. str = "钻石x" + num;
  1430. }
  1431. xGame.showTip("恭喜获得-" + str);
  1432. this.hide();
  1433. }
  1434. }
  1435. UIBox.uiName = "UIBox";
  1436. class ui_UITry extends fgui.GComponent {
  1437. static createInstance() {
  1438. return (fgui.UIPackage.createObject("game", "UITry"));
  1439. }
  1440. onConstruct() {
  1441. this.n11 = (this.getChild("n11"));
  1442. this.myNode = (this.getChild("myNode"));
  1443. this.t0 = this.getTransition("t0");
  1444. }
  1445. }
  1446. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1447. class UITry extends UIBase {
  1448. constructor() {
  1449. super();
  1450. this.closeTime = 0;
  1451. this.closeNum = 0;
  1452. this.skillUrl = xGame.common.skillIconList;
  1453. }
  1454. onConstructor() {
  1455. this.ui = ui_UITry.createInstance();
  1456. this.contentPane = this.ui;
  1457. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1458. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1459. }
  1460. show() {
  1461. super.show();
  1462. this.closeNum = 0;
  1463. this.closeTime = 15;
  1464. this.ui.t0.play();
  1465. PlatMgr.showRateBanner();
  1466. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1467. Laya.timer.loop(1000, this, this.updateTime);
  1468. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1469. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1470. xGame.common.gameMgr.gamePause = true;
  1471. }
  1472. updateTime() {
  1473. if (this.closeTime > 1) {
  1474. this.closeTime--;
  1475. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1476. }
  1477. else
  1478. this.hide();
  1479. }
  1480. hide() {
  1481. Laya.timer.clearAll(this);
  1482. Moyu.showBannerAd(false);
  1483. super.hide();
  1484. xGame.common.gameMgr.gamePause = false;
  1485. }
  1486. onTry() {
  1487. console.log('zh:qjff_AD_for_uitry');
  1488. if (Laya.Browser.onAndroid) {
  1489. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1490. if (!boo) {
  1491. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1492. return;
  1493. }
  1494. }
  1495. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1496. }
  1497. else {
  1498. console.log('zh:AD 失败,直接发放奖励');
  1499. this.qjff_AD_for_uitry();
  1500. }
  1501. }
  1502. qjff_AD_for_uitry() {
  1503. let select = xGame.common.curPlayerSkillType;
  1504. DataMgr.gameData.trySkill = select;
  1505. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1506. DataMgr.saveGameData();
  1507. DataMgr.setBigSkill(select, 1);
  1508. xGame.showTip("Trial Successful");
  1509. this.hide();
  1510. }
  1511. onCancel() {
  1512. if (this.closeNum > 0) {
  1513. this.closeNum--;
  1514. if (this.closeNum < 2)
  1515. this.hide();
  1516. return;
  1517. }
  1518. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1519. this.onTry();
  1520. }
  1521. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1522. this.closeNum = 3;
  1523. }
  1524. else
  1525. this.hide();
  1526. }
  1527. }
  1528. UITry.uiName = "UITry";
  1529. class PlatMgr {
  1530. static initConfig() {
  1531. this.lastVt = 0;
  1532. if (!Moyu.platConfig)
  1533. return;
  1534. for (let k in Moyu.platConfig) {
  1535. let pd = this[k];
  1536. let pc = Moyu.platConfig[k];
  1537. if (pd != undefined && pc != undefined)
  1538. this[k] = pc;
  1539. }
  1540. Moyu.setBannerPos(0.5, 1);
  1541. }
  1542. static rand100(num) {
  1543. return xGame.tools.random(0, 100) < num;
  1544. }
  1545. static isMisVideo() {
  1546. let dt = Laya.timer.currTimer - this.lastVt;
  1547. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1548. this.lastVt = Laya.timer.currTimer;
  1549. return true;
  1550. }
  1551. else {
  1552. if (this.rand100(this.fullVideoRate)) {
  1553. console.log('zh:插屏 ad start');
  1554. JSBridgeUtils.instance.showInternAd('platMgr');
  1555. }
  1556. return false;
  1557. }
  1558. }
  1559. static showVideo(call, type) {
  1560. Moyu.showVideoAd(() => {
  1561. this.lastVt = Laya.timer.currTimer;
  1562. call && call();
  1563. }, type);
  1564. }
  1565. static showInsert(delay = false) {
  1566. if (this.getRand() < this.insertRate) {
  1567. let dt = delay ? this.insertDelay : 0;
  1568. console.log('zh:插屏 ad start');
  1569. JSBridgeUtils.instance.showInternAd('gameInsert');
  1570. }
  1571. }
  1572. static gameInsert() {
  1573. let t = this.getRand();
  1574. let r = this.gameInsertRate;
  1575. if (t < r) {
  1576. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1577. }
  1578. }
  1579. static showRateBanner() {
  1580. if (this.getRand() < this.bannerRate)
  1581. this.showBanner(true, this.bannerDelay, 3000);
  1582. }
  1583. static showBanner(show, delay = 0, hide = 0) {
  1584. if (2 > 1) {
  1585. console.log('zh:显示showBanner广告 直接返回');
  1586. return;
  1587. }
  1588. if (!show)
  1589. Moyu.showBannerAd(false);
  1590. else {
  1591. Laya.timer.clear(this, this.bannerShow);
  1592. if (delay > 0)
  1593. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1594. else
  1595. this.bannerShow(true);
  1596. if (hide > 0)
  1597. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1598. }
  1599. }
  1600. static bannerShow(show) {
  1601. if (2 > 1) {
  1602. console.log('zh:显示showBanner广告 直接返回');
  1603. return;
  1604. }
  1605. Moyu.showBannerAd(show);
  1606. console.log("showBanner" + show);
  1607. }
  1608. static getRand() {
  1609. return xGame.tools.random(0, 100);
  1610. }
  1611. static openBox() {
  1612. if (this.getRand() < this.boxRate)
  1613. xGame.uiMgr.Show(UIBox);
  1614. }
  1615. static openTry() {
  1616. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1617. return;
  1618. if (this.getRand() < this.tryRate)
  1619. xGame.uiMgr.Show(UITry);
  1620. else if (DataMgr.gameData.gameCount == 1)
  1621. xGame.uiMgr.Show(UITry);
  1622. }
  1623. }
  1624. PlatMgr.forceShare = 0;
  1625. PlatMgr.signAdRate = 0;
  1626. PlatMgr.forceVideoRate = 0;
  1627. PlatMgr.forceVideoGap = 0;
  1628. PlatMgr.fullVideoRate = 0;
  1629. PlatMgr.gameInsertRate = 0;
  1630. PlatMgr.insertGap = 0;
  1631. PlatMgr.insertDelay = 0;
  1632. PlatMgr.insertRate = 0;
  1633. PlatMgr.boxRate = 0;
  1634. PlatMgr.boxVideoRate = 0;
  1635. PlatMgr.boxInsertRate = 0;
  1636. PlatMgr.boxBannerRate = 0;
  1637. PlatMgr.tryRate = 0;
  1638. PlatMgr.tryClose3Rate = 0;
  1639. PlatMgr.tryVideoRate = 0;
  1640. PlatMgr.bannerRate = 0;
  1641. PlatMgr.lastVt = 0;
  1642. class ui_UIAddProp extends fgui.GComponent {
  1643. static createInstance() {
  1644. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1645. }
  1646. onConstruct() {
  1647. this.n11 = (this.getChild("n11"));
  1648. this.myNode = (this.getChild("myNode"));
  1649. this.closeBtn = (this.getChild("closeBtn"));
  1650. this.t0 = this.getTransition("t0");
  1651. }
  1652. }
  1653. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1654. class SpineMgr {
  1655. constructor(name, loadCb = null) {
  1656. this.loaded = false;
  1657. this.spineName = '';
  1658. this.loadedCallback = loadCb;
  1659. this.templet = new Laya.Templet();
  1660. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1661. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1662. if (name === 'mishu') {
  1663. this.templet.loadAni('spine/nvmishu.sk');
  1664. }
  1665. else {
  1666. this.templet.loadAni(`spine/${name}.sk`);
  1667. }
  1668. this.templet.lock = true;
  1669. this.spineName = name;
  1670. }
  1671. onError() {
  1672. console.log("zh:spine加载出错");
  1673. }
  1674. parseComplete() {
  1675. this.loaded = true;
  1676. this.loadedCallback && this.loadedCallback();
  1677. }
  1678. dispose() {
  1679. if (this.templet && !this.templet.destroyed) {
  1680. this.templet.destroy();
  1681. }
  1682. this.templet = null;
  1683. }
  1684. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1685. if (!this.loaded) {
  1686. return;
  1687. }
  1688. let spine;
  1689. if (mySpine) {
  1690. spine = mySpine;
  1691. }
  1692. else {
  1693. spine = this.createSpine(data, parent);
  1694. }
  1695. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1696. if (!isLoop) {
  1697. spine.on(Laya.Event.STOPPED, this, () => {
  1698. spine.offAll(Laya.Event.STOPPED);
  1699. callback && callback(spine);
  1700. });
  1701. }
  1702. return spine;
  1703. }
  1704. createSpine(data, parent, type = 1) {
  1705. let spine;
  1706. spine = this.templet.buildArmature(type);
  1707. spine.showSkinByIndex(0);
  1708. parent.addChild(spine);
  1709. spine.pos(data.x, data.y);
  1710. spine.scale(data.scaleX, data.scaleY, true);
  1711. return spine;
  1712. }
  1713. }
  1714. var AIState;
  1715. (function (AIState) {
  1716. AIState[AIState["none"] = 0] = "none";
  1717. AIState[AIState["idle"] = 1] = "idle";
  1718. AIState[AIState["reset"] = 2] = "reset";
  1719. AIState[AIState["move"] = 3] = "move";
  1720. AIState[AIState["wait"] = 4] = "wait";
  1721. AIState[AIState["select"] = 5] = "select";
  1722. AIState[AIState["turn"] = 6] = "turn";
  1723. AIState[AIState["shoot"] = 7] = "shoot";
  1724. AIState[AIState["leave"] = 8] = "leave";
  1725. })(AIState || (AIState = {}));
  1726. class AIPlayer {
  1727. constructor() {
  1728. this.dtime = 30;
  1729. this.awayTime = 0;
  1730. this.awayNum = 0;
  1731. this.hideTime = 0;
  1732. this.rootMoveTime = 0;
  1733. this.isGuide = false;
  1734. this.state = AIState.none;
  1735. this.waitTime = 0;
  1736. this.forceNum = 0;
  1737. this.forceMax = 0;
  1738. this.ballSize = 33;
  1739. this.selectNum = 0;
  1740. this.destRot = 0;
  1741. this.aiLv = 10;
  1742. this.kickBall = [];
  1743. this.lineBall = [];
  1744. this.scoreBall = [];
  1745. this.holeBall = [];
  1746. this.turnNum = 0;
  1747. this.setNum = 0;
  1748. this.setMax = 0;
  1749. this.setRate = 0;
  1750. this.rectL = 0;
  1751. this.rectR = 0;
  1752. this.rectT = 0;
  1753. this.rectB = 0;
  1754. this.rootPos = { x: 0, y: 0 };
  1755. this.bestForce = 0;
  1756. this.bestAngle = 180;
  1757. this.bestPos = { x: 0, y: 0 };
  1758. this.bestKick = { x: 0, y: 0 };
  1759. this.posList = [];
  1760. this.posIdx = 0;
  1761. this.chatTime = 3000;
  1762. this.tempDir1 = new Laya.Vector2();
  1763. this.tempDir2 = new Laya.Vector2();
  1764. this.tempDir3 = new Laya.Vector2();
  1765. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1766. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1767. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1768. this.gameSrc = xGame.common.gameUI;
  1769. this.hideTime = Laya.timer.currTimer;
  1770. Moyu.setOnTipCall((id) => {
  1771. if (id == 20012)
  1772. this.hideTime = Laya.timer.currTimer;
  1773. else
  1774. (id == 20011);
  1775. {
  1776. let dt = Laya.timer.currTimer - this.hideTime;
  1777. console.log("onshow" + dt);
  1778. if (dt > 30000 && this.state > AIState.none)
  1779. xGame.common.gameMgr.aiGameEnd(false);
  1780. }
  1781. }, this);
  1782. }
  1783. init() {
  1784. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1785. this.awayTime = xGame.tools.random(5000, 10000);
  1786. this.awayNum = 0;
  1787. this.hideTime = Laya.timer.currTimer;
  1788. let rect = xGame.common.d2World.borderRect;
  1789. this.rectL = Math.ceil(rect.x) + 17;
  1790. this.rectT = Math.ceil(rect.y) + 17;
  1791. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1792. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1793. this.wBall = xGame.common.d2World.rootBall;
  1794. this.ballSize = this.wBall.gameObj.width - 1;
  1795. if (this.posList.length < 1) {
  1796. let dp = 40;
  1797. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1798. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1799. let dx = i < this.rectR ? i : this.rectR;
  1800. let dy = j < this.rectB ? j : this.rectB;
  1801. let order = xGame.tools.random(0, 1000);
  1802. this.posList.push({ x: dx, y: dy, order: order });
  1803. }
  1804. }
  1805. this.posList.sort(function (a, b) {
  1806. return a.order - b.order;
  1807. });
  1808. this.setMax = this.posList.length;
  1809. }
  1810. this.state = AIState.idle;
  1811. }
  1812. setAiLevel(num) {
  1813. this.aiLv = num;
  1814. }
  1815. initBall() {
  1816. this.rootPos.x = this.wBall.gameObj.x;
  1817. this.rootPos.y = this.wBall.gameObj.y;
  1818. this.initHoleBall();
  1819. }
  1820. initHoleBall() {
  1821. this.kickBall = [];
  1822. this.lineBall = [];
  1823. this.scoreBall = [];
  1824. this.holeBall = [];
  1825. this.selectNum = 0;
  1826. this.forceNum = 0;
  1827. this.forceMax = 0;
  1828. this.turnNum = 0;
  1829. let list = xGame.common.d2World.ballArr;
  1830. if (list.length < 20 && !this.isGuide) {
  1831. let holes = xGame.common.gameMgr.holePosList;
  1832. for (let i = 0; i < list.length; i++) {
  1833. let obj = list[i];
  1834. if (!obj)
  1835. continue;
  1836. obj.kickPos.x = 0;
  1837. obj.kickPos.y = 0;
  1838. obj.poleAngle = 0;
  1839. obj.hard = 0;
  1840. obj.borderDis = 0;
  1841. obj.kickAngle = 180;
  1842. if (obj.number == 0)
  1843. continue;
  1844. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1845. continue;
  1846. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1847. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1848. continue;
  1849. }
  1850. let b = obj.gameObj;
  1851. let wbp = this.rootPos;
  1852. let bx = wbp.x - b.x;
  1853. let by = wbp.y - b.y;
  1854. obj.borderDis = xGame.tools.random(0, 100);
  1855. this.kickBall.push(obj);
  1856. if (!this.isLine(wbp, obj))
  1857. continue;
  1858. obj.kickAngle = xGame.tools.random(90, 180);
  1859. obj.kickPos.x = b.x;
  1860. obj.kickPos.y = b.y;
  1861. this.lineBall.push(obj);
  1862. let minDis = 999999;
  1863. let hole = false;
  1864. for (let j = 0; j < holes.length; j++) {
  1865. let hp = holes[j];
  1866. if (bx >= 0 && hp.x > b.x + 100)
  1867. continue;
  1868. if (bx <= 0 && hp.x < b.x - 100)
  1869. continue;
  1870. if (by < -10 && hp.y < wbp.y)
  1871. continue;
  1872. if (by > 10 && hp.y > wbp.y)
  1873. continue;
  1874. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1875. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1876. if (dis < minDis) {
  1877. let dx = b.x - this.tempDir1.x * this.ballSize;
  1878. let dy = b.y - this.tempDir1.y * this.ballSize;
  1879. this.tempDir3.x = this.tempDir1.x;
  1880. this.tempDir3.y = this.tempDir1.y;
  1881. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1882. obj.kickPos.x = dx;
  1883. obj.kickPos.y = dy;
  1884. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1885. if (num > 1)
  1886. num = 1;
  1887. obj.kickAngle = Math.acos(num) * 57.3;
  1888. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1889. dis = dis * 2;
  1890. if (Math.abs(hp.x - 600) < 100)
  1891. dis += 50;
  1892. obj.hard = dis + obj.kickAngle * 3;
  1893. hole = true;
  1894. }
  1895. }
  1896. }
  1897. }
  1898. if (hole) {
  1899. this.scoreBall.push(obj);
  1900. this.holeBall.push(obj);
  1901. }
  1902. }
  1903. this.scoreBall.sort(function (a, b) {
  1904. return a.hard - b.hard;
  1905. });
  1906. this.holeBall.sort(function (a, b) {
  1907. return a.kickAngle - b.kickAngle;
  1908. });
  1909. this.kickBall.sort(function (a, b) {
  1910. return a.borderDis - b.borderDis;
  1911. });
  1912. }
  1913. else {
  1914. let max = list.length - 1;
  1915. let i = xGame.tools.random(0, max);
  1916. for (i; i <= max; i++) {
  1917. let idx = i >= max ? i -= max : i;
  1918. let obj = list[idx];
  1919. if (obj && obj.number != 0) {
  1920. obj.kickAngle = xGame.tools.random(90, 180);
  1921. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1922. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1923. this.lineBall.push(obj);
  1924. break;
  1925. }
  1926. }
  1927. }
  1928. }
  1929. selectBall() {
  1930. let ball = null;
  1931. this.destRot = 0;
  1932. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1933. let ai = 110 - this.aiLv * 10;
  1934. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1935. let score = false;
  1936. if (this.scoreBall.length < 1) {
  1937. if (this.lineBall.length < 1) {
  1938. for (let i = 0; i < this.kickBall.length; i++) {
  1939. let list = [];
  1940. let bo = this.kickBall[i];
  1941. let bobj = bo.gameObj;
  1942. let rect = xGame.common.d2World.borderRect;
  1943. let mobj = this.wBall.gameObj;
  1944. let minb = bobj.y - rect.y - 20;
  1945. let minw = mobj.y - rect.y - 50;
  1946. if (minb > 0 && minw > 0) {
  1947. let dlenx = 0;
  1948. let dleny = mobj.y - rect.y;
  1949. let spx = mobj.x;
  1950. let spy = rect.y - dleny;
  1951. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1952. }
  1953. minb = rect.y + rect.height - bobj.y - 20;
  1954. minw = rect.y + rect.height - mobj.y - 50;
  1955. if (minb > 0 && minw > 0) {
  1956. let dlenx = 0;
  1957. let dleny = rect.y + rect.height - mobj.y;
  1958. let spx = mobj.x;
  1959. let spy = rect.y + rect.height + dleny;
  1960. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1961. }
  1962. minb = bobj.x - rect.x - 20;
  1963. minw = mobj.x - rect.x - 50;
  1964. if (minb > 0 && minw > 0) {
  1965. let dlenx = mobj.x - rect.x;
  1966. let dleny = 0;
  1967. let spx = rect.x - dlenx;
  1968. let spy = mobj.y;
  1969. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1970. }
  1971. minb = rect.x + rect.width - bobj.x - 20;
  1972. minw = rect.x + rect.width - mobj.x - 50;
  1973. if (minb > 0 && minw > 0) {
  1974. let dlenx = rect.x + rect.width - mobj.x;
  1975. let dleny = 0;
  1976. let spx = rect.x + rect.width + dlenx;
  1977. let spy = mobj.y;
  1978. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1979. }
  1980. list.sort(function (a, b) {
  1981. return a.order - b.order;
  1982. });
  1983. for (let i = 0; i < list.length; i++) {
  1984. let data = list[i];
  1985. let mx = mobj.x - bobj.x;
  1986. let my = mobj.y - bobj.y;
  1987. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  1988. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  1989. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  1990. if (num > 1)
  1991. num = 1;
  1992. let cos = Math.acos(num);
  1993. if (cos > 1.57)
  1994. cos = 1.57;
  1995. else if (cos < 0.01)
  1996. cos = 0.01;
  1997. let tan = Math.tan(cos);
  1998. let dx = tan * data.dleny;
  1999. let dy = tan * data.dlenx;
  2000. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2001. if (Math.abs(bx - 667) < 40)
  2002. continue;
  2003. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2004. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2005. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2006. this.forceMax = dis * 0.08;
  2007. this.destRot += mis * 0.1;
  2008. this.setKick(bx, by);
  2009. return true;
  2010. }
  2011. }
  2012. }
  2013. }
  2014. else {
  2015. ball = xGame.common.getRandArrEle(this.lineBall);
  2016. }
  2017. }
  2018. else {
  2019. for (let i = 0; i < this.scoreBall.length; i++) {
  2020. if (i < this.scoreBall.length - 1) {
  2021. let rand = 70 + this.aiLv * 10 + i * 10;
  2022. if (xGame.tools.random(0, 100) < rand) {
  2023. ball = this.scoreBall[i];
  2024. break;
  2025. }
  2026. }
  2027. else {
  2028. ball = this.scoreBall[i];
  2029. break;
  2030. }
  2031. }
  2032. score = true;
  2033. this.selectNum++;
  2034. }
  2035. if (!ball)
  2036. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2037. if (this.selectNum >= max) {
  2038. let dx = ball.gameObj.x;
  2039. let dy = ball.gameObj.y;
  2040. let kickAngle = 0;
  2041. if (score) {
  2042. dx = ball.kickPos.x;
  2043. dy = ball.kickPos.y;
  2044. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2045. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2046. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2047. if (adot > 1)
  2048. adot = 1;
  2049. kickAngle = Math.acos(adot) * 57.3;
  2050. if (kickAngle > 45) {
  2051. let kdx = ball.kickPos.x - ball.gameObj.x;
  2052. let kdy = ball.kickPos.y - ball.gameObj.y;
  2053. dx = ball.kickPos.x - kdx * mis * 0.3;
  2054. dy = ball.kickPos.y - kdy * mis * 0.3;
  2055. }
  2056. else
  2057. this.destRot += mis;
  2058. }
  2059. else if (ball.poleAngle != 0) {
  2060. this.destRot += ball.poleAngle;
  2061. }
  2062. if (xGame.common.gameMode == 0) {
  2063. let af = kickAngle * 0.08;
  2064. this.forceMax = ball.hard * 0.1 + af * af;
  2065. }
  2066. this.setKick(dx, dy);
  2067. }
  2068. else {
  2069. let rand = this.aiLv * 5 + 40;
  2070. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2071. ball = xGame.common.getRandArrEle(this.scoreBall);
  2072. else
  2073. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2074. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2075. if (xGame.tools.random(0, 100) > rand) {
  2076. this.selectNum = max;
  2077. }
  2078. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2079. this.selectNum++;
  2080. }
  2081. ball.onClick(0, true);
  2082. }
  2083. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2084. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2085. let balls = xGame.common.d2World.ballArr;
  2086. let max = xGame.tools.getDis(hx, hy, bx, by);
  2087. for (let index = 0; index < balls.length; index++) {
  2088. let obj = balls[index];
  2089. if (obj.number == 0)
  2090. continue;
  2091. if (obj.number == bn || obj.number == dn)
  2092. continue;
  2093. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2094. if (dis * dis > max)
  2095. continue;
  2096. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2097. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2098. if (num > 1)
  2099. num = 1;
  2100. if (num < 0)
  2101. continue;
  2102. let gap = Math.sin(Math.acos(num)) * dis;
  2103. if (gap < this.ballSize)
  2104. return true;
  2105. }
  2106. return false;
  2107. }
  2108. isLine(xy, ball) {
  2109. let bx = xy.x;
  2110. let by = xy.y;
  2111. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2112. let dis = ball.getDestDis(xy);
  2113. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2114. let sin = Math.sin(angle);
  2115. let cos = Math.cos(angle);
  2116. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2117. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2118. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2119. let dx = bx + this.tempDir2.x * dis;
  2120. let dy = by + this.tempDir2.y * dis;
  2121. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2122. sin = Math.sin(-angle);
  2123. cos = Math.cos(-angle);
  2124. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2125. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2126. dx = bx + this.tempDir2.x * dis;
  2127. dy = by + this.tempDir2.y * dis;
  2128. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2129. if (isr && isl)
  2130. return false;
  2131. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2132. }
  2133. return true;
  2134. }
  2135. turnPole() {
  2136. this.turnNum++;
  2137. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2138. let dr = rot - this.destRot;
  2139. let abs = Math.abs(dr) % 360;
  2140. if (abs > 180) {
  2141. if (rot > 180)
  2142. rot -= 360;
  2143. if (this.destRot > 180)
  2144. this.destRot -= 360;
  2145. }
  2146. let max = this.turnNum * 5 + this.aiLv * 5;
  2147. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2148. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2149. let at = xGame.tools.random(1000, 2000);
  2150. if (!this.onAway(3))
  2151. at += xGame.tools.random(10000, 15000);
  2152. this.setState(AIState.shoot, at);
  2153. }
  2154. else {
  2155. let mr = 0;
  2156. if (abs > 3)
  2157. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2158. else if (Math.random() > 0.6)
  2159. mr = xGame.tools.random(1, 10) * 0.1;
  2160. mr = dr > 0 ? -mr : mr;
  2161. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2162. }
  2163. }
  2164. setKick(dx, dy) {
  2165. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2166. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2167. this.tempDir1.x = 0;
  2168. this.tempDir1.y = 1;
  2169. this.tempDir2.y = -this.tempDir2.y;
  2170. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2171. if (num > 1)
  2172. num = 1;
  2173. let rot = Math.acos(num) * 57.3;
  2174. if (this.tempDir2.x < 0)
  2175. rot = 360 - rot;
  2176. this.destRot += rot;
  2177. if (!xGame.common.gameMgr.finishOneShoot) {
  2178. this.forceMax += xGame.tools.random(10, 50);
  2179. this.forceMax -= this.aiLv * 2;
  2180. if (this.forceMax < 20)
  2181. this.forceMax = 20;
  2182. }
  2183. if (this.forceMax > 100)
  2184. this.forceMax = 101;
  2185. else if (this.forceMax < 10)
  2186. this.forceMax += xGame.tools.random(0, 10);
  2187. if (xGame.common.gameMode == 1)
  2188. this.forceMax = xGame.tools.random(80, 100);
  2189. else
  2190. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2191. let max = 2000 - this.aiLv * 100;
  2192. if (Math.random() > 0.8)
  2193. max += xGame.tools.random(100, 2000);
  2194. this.setState(AIState.turn, xGame.tools.random(500, max));
  2195. }
  2196. shoot() {
  2197. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2198. if (Math.random() > 0.8) {
  2199. this.gameSrc.aiForce(1);
  2200. this.setState(AIState.wait);
  2201. }
  2202. }
  2203. else {
  2204. let df = xGame.tools.random(3, 8);
  2205. if (this.forceNum < this.forceMax)
  2206. this.forceNum += df;
  2207. else
  2208. this.forceNum -= df;
  2209. let startY = this.gameSrc.ui.powerNode.y;
  2210. let height = this.gameSrc.ui.powerNode.height;
  2211. let force = startY + height * this.forceNum * 0.01;
  2212. this.gameSrc.aiForce(2, force);
  2213. }
  2214. }
  2215. reset() {
  2216. for (let i = 0; i < 4; i++) {
  2217. this.setRate--;
  2218. this.setNum++;
  2219. let pos = this.posList[this.posIdx];
  2220. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2221. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2222. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2223. this.rootPos.x = 387;
  2224. if (this.rootPos.x < this.rectL)
  2225. this.rootPos.x = this.rectL;
  2226. else if (this.rootPos.x > this.rectR)
  2227. this.rootPos.x = this.rectR;
  2228. if (this.rootPos.y < this.rectT)
  2229. this.rootPos.y = this.rectT;
  2230. else if (this.rootPos.y > this.rectB)
  2231. this.rootPos.y = this.rectB;
  2232. this.posIdx++;
  2233. let max = this.posList.length;
  2234. if (this.posIdx >= max)
  2235. this.posIdx -= max;
  2236. this.initHoleBall();
  2237. let ball = null;
  2238. if (this.scoreBall.length > 0)
  2239. ball = this.scoreBall[0];
  2240. else if (this.lineBall.length > 0)
  2241. ball = xGame.common.getRandArrEle(this.lineBall);
  2242. if (ball && ball.kickAngle < this.bestAngle) {
  2243. this.bestAngle = ball.kickAngle;
  2244. this.bestKick.x = ball.kickPos.x;
  2245. this.bestKick.y = ball.kickPos.y;
  2246. this.bestPos.x = this.rootPos.x;
  2247. this.bestPos.y = this.rootPos.y;
  2248. this.bestForce = ball.hard * 0.08;
  2249. }
  2250. }
  2251. if (this.setNum >= this.setMax)
  2252. this.setMax = 0;
  2253. if (this.setRate < 1) {
  2254. this.setState(AIState.move, 0);
  2255. this.rootMoveTime = Laya.timer.currTimer;
  2256. this.gameSrc.aiRootMove(true);
  2257. }
  2258. }
  2259. delayLine() {
  2260. this.gameSrc.aiRootMove(false);
  2261. }
  2262. move() {
  2263. if (this.bestPos.x < 1)
  2264. this.bestPos = this.rootPos;
  2265. let wObj = this.wBall.gameObj;
  2266. let destx = wObj.x;
  2267. let desty = wObj.y;
  2268. let dx = Math.abs(destx - this.bestPos.x);
  2269. let dy = Math.abs(desty - this.bestPos.y);
  2270. let mx = 3 + dx * 0.03;
  2271. let my = 3 + dy * 0.03;
  2272. if (dx < 4 && dy < 4) {
  2273. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2274. dt = dt < 1000 ? 1000 - dt : 0;
  2275. if (this.setMax > 0) {
  2276. let min = this.setMax * 0.3 + this.aiLv * 5;
  2277. this.setRate = xGame.tools.random(min, this.setMax);
  2278. this.setState(AIState.reset, 0);
  2279. }
  2280. else {
  2281. this.destRot = 0;
  2282. this.forceMax = this.bestForce;
  2283. this.setKick(this.bestKick.x, this.bestKick.y);
  2284. }
  2285. if (dt > 100) {
  2286. Laya.timer.clear(this, this.delayLine);
  2287. Laya.timer.once(dt, this, this.delayLine);
  2288. }
  2289. else
  2290. this.gameSrc.aiRootMove(false);
  2291. }
  2292. else {
  2293. if (dx > 4)
  2294. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2295. if (dy > 4)
  2296. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2297. this.gameSrc.onRootMove({ x: destx, y: desty });
  2298. }
  2299. }
  2300. resetRoot() {
  2301. this.bestAngle = 180;
  2302. this.bestForce = 0;
  2303. this.setMax = this.posList.length;
  2304. this.posIdx = xGame.tools.random(0, this.setMax);
  2305. let min = this.setMax * 0.3 + this.aiLv * 5;
  2306. this.setRate = xGame.tools.random(min, this.setMax);
  2307. let max = 2000 - this.aiLv * 100;
  2308. if (Math.random() > 0.8)
  2309. max += xGame.tools.random(100, 1000);
  2310. if (this.isGuide)
  2311. this.setState(AIState.select, 500);
  2312. else if (this.onAway(2))
  2313. this.setState(AIState.reset, xGame.tools.random(400, max));
  2314. else
  2315. this.setState(AIState.none);
  2316. if (xGame.common.gameMgr.finishOneShoot)
  2317. this.chat();
  2318. }
  2319. runAI() {
  2320. if (this.state > AIState.idle)
  2321. return;
  2322. this.initBall();
  2323. this.onGame(2500);
  2324. if (Math.random() > 0.6)
  2325. this.chat();
  2326. }
  2327. stopRun() {
  2328. this.setState(AIState.idle);
  2329. }
  2330. onGame(base) {
  2331. let max = base - this.aiLv * 100;
  2332. if (Math.random() > 0.8)
  2333. max += xGame.tools.random(100, 1000);
  2334. if (this.onAway(2))
  2335. this.setState(AIState.select, xGame.tools.random(500, max));
  2336. else
  2337. this.setState(AIState.none);
  2338. }
  2339. setState(sta, wt = 0) {
  2340. if (this.state == AIState.none)
  2341. return;
  2342. this.state = sta;
  2343. this.waitTime = wt;
  2344. }
  2345. onUpdate() {
  2346. if (this.state == AIState.none)
  2347. return;
  2348. this.awayTime -= this.dtime;
  2349. if (this.awayTime < 1) {
  2350. this.awayTime = xGame.tools.random(6000, 10000);
  2351. this.awayNum += (11 - this.aiLv);
  2352. this.onAway(1);
  2353. }
  2354. if (this.waitTime >= 0) {
  2355. this.waitTime -= this.dtime;
  2356. return;
  2357. }
  2358. switch (this.state) {
  2359. case AIState.idle:
  2360. this.chat();
  2361. break;
  2362. case AIState.reset:
  2363. this.reset();
  2364. break;
  2365. case AIState.move:
  2366. this.move();
  2367. break;
  2368. case AIState.leave:
  2369. this.state = AIState.none;
  2370. xGame.common.gameMgr.aiGameEnd(true);
  2371. break;
  2372. case AIState.select:
  2373. this.selectBall();
  2374. break;
  2375. case AIState.turn:
  2376. this.turnPole();
  2377. break;
  2378. case AIState.shoot:
  2379. this.shoot();
  2380. break;
  2381. }
  2382. }
  2383. onAway(type) {
  2384. if (type == 1) {
  2385. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2386. let num = this.awayNum + db * 20;
  2387. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2388. xGame.common.gameMgr.aiLeave();
  2389. this.setState(AIState.leave, 6666);
  2390. }
  2391. }
  2392. else if (type == 2) {
  2393. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2394. let num = this.awayNum + db * 30;
  2395. if (xGame.tools.random(0, 10000) < num)
  2396. return false;
  2397. }
  2398. else if (type == 3) {
  2399. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2400. let num = this.awayNum + db * 10;
  2401. if (xGame.tools.random(0, 4000) < num)
  2402. return false;
  2403. }
  2404. return true;
  2405. }
  2406. chat() {
  2407. if (this.chatTime > 0) {
  2408. this.chatTime -= this.dtime;
  2409. return;
  2410. }
  2411. this.chatTime = xGame.tools.random(2000, 10000);
  2412. let rand = xGame.tools.random(0, 100);
  2413. if (rand < 15)
  2414. this.talk();
  2415. else if (rand < 35)
  2416. this.emotion();
  2417. }
  2418. talk() {
  2419. xGame.common.talkMgr.showAITalk(0);
  2420. }
  2421. emotion() {
  2422. xGame.common.talkMgr.showAIEmotion(0);
  2423. }
  2424. resetAI() {
  2425. this.stopRun();
  2426. this.state = AIState.none;
  2427. }
  2428. }
  2429. class Partical extends Laya.Script3D {
  2430. constructor() {
  2431. super();
  2432. this.duration = 2000;
  2433. }
  2434. ;
  2435. onAwake() {
  2436. this.gameObj = this.owner;
  2437. }
  2438. onEnable() {
  2439. this.openTimer();
  2440. }
  2441. openTimer() {
  2442. Laya.timer.once(this.duration, this, this.disappear);
  2443. }
  2444. setCallback(obj, callback) {
  2445. this.obj = obj;
  2446. this.callback = callback;
  2447. Laya.timer.clearAll(this);
  2448. Laya.timer.once(this.duration, this, this.disappear);
  2449. }
  2450. disappear() {
  2451. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2452. this.callback && this.callback(this.obj);
  2453. }
  2454. }
  2455. class Ball extends Laya.Script3D {
  2456. constructor() {
  2457. super();
  2458. this.posV3 = new Laya.Vector3();
  2459. this.rotRate = 2.1;
  2460. this.rotSpeed = new Laya.Vector3();
  2461. this.myIndex = 0;
  2462. }
  2463. onAwake() {
  2464. this.gameObj = this.owner;
  2465. this.transform = this.gameObj.transform;
  2466. this.ballNode = this.gameObj.getChildByName("Ball");
  2467. this.shadowNode = this.gameObj.getChildByName("shadow");
  2468. }
  2469. initSelf(index, x, y, owner) {
  2470. this.d2BallSrc = owner;
  2471. this.myIndex = index;
  2472. this.setAlbedoTexture();
  2473. this.setTransPos(x, y);
  2474. this.setScale();
  2475. this.ballNode.transform.localRotationEulerX = 90;
  2476. if (index == 0) {
  2477. }
  2478. }
  2479. setAlbedoTexture(isIce = false) {
  2480. let url;
  2481. if (isIce) {
  2482. url = `res/d3Res/ballTexture/ice.jpg`;
  2483. }
  2484. else {
  2485. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2486. }
  2487. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2488. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2489. }));
  2490. }
  2491. runFireworks(obj, delay, callback) {
  2492. Laya.timer.clearAll(this);
  2493. Laya.timer.once(delay + 1, this, () => {
  2494. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2495. fire.transform.localPositionX = this.transform.localPositionX;
  2496. fire.transform.localPositionY = this.transform.localPositionY;
  2497. fire.transform.localPositionZ = this.transform.localPositionZ;
  2498. let src = fire.getComponent(Partical);
  2499. src.duration = 1000;
  2500. src.setCallback(obj, callback);
  2501. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2502. eft.transform.localPositionX = this.transform.localPositionX;
  2503. eft.transform.localPositionY = this.transform.localPositionY;
  2504. eft.transform.localPositionZ = this.transform.localPositionZ;
  2505. });
  2506. }
  2507. setTransPos(x, y) {
  2508. this.setRotation();
  2509. xGame.common.pos2to3Convert(x, y, this.posV3);
  2510. this.transform.localPositionX = this.posV3.x;
  2511. this.transform.localPositionY = 0;
  2512. this.transform.localPositionZ = this.posV3.z;
  2513. this.transform.localRotationEulerX = 0;
  2514. this.transform.localRotationEulerY = 0;
  2515. this.transform.localRotationEulerZ = 0;
  2516. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2517. this.shadowNode.transform.localPositionY = 0.1;
  2518. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2519. }
  2520. setRotation() {
  2521. if (this.d2BallSrc.canRot) {
  2522. let speed = this.d2BallSrc.rigy.linearVelocity;
  2523. this.rotSpeed.x = speed.x * this.rotRate;
  2524. this.rotSpeed.z = speed.y * this.rotRate;
  2525. this.rotSpeed.y = this.d2BallSrc.rotY;
  2526. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2527. }
  2528. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2529. this.rotSpeed.x = this.rotSpeed.y = 0;
  2530. this.rotSpeed.y = this.d2BallSrc.rotY;
  2531. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2532. }
  2533. }
  2534. setScale() {
  2535. let radius = xGame.common.d2World.rootBall.ui.width;
  2536. let scale = xGame.common.scale2to3Convert(radius);
  2537. this.transform.localScaleX = scale;
  2538. this.transform.localScaleY = scale;
  2539. this.transform.localScaleZ = scale;
  2540. }
  2541. playInHoleEft() {
  2542. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2543. eft.transform.position = this.transform.position;
  2544. }
  2545. playIceEft() {
  2546. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2547. eft.transform.position = this.transform.position;
  2548. }
  2549. get scaleXYZ() {
  2550. return this.transform.localScaleX;
  2551. }
  2552. set scaleXYZ(val) {
  2553. this.transform.localScaleX = val;
  2554. this.transform.localScaleY = val;
  2555. this.transform.localScaleZ = val;
  2556. }
  2557. get posX() {
  2558. return this.transform.localPositionX;
  2559. }
  2560. set posX(val) {
  2561. this.transform.localPositionX = val;
  2562. }
  2563. get posY() {
  2564. return this.transform.localPositionY;
  2565. }
  2566. set posY(val) {
  2567. this.transform.localPositionY = val;
  2568. }
  2569. get posZ() {
  2570. return this.transform.localPositionZ;
  2571. }
  2572. set posZ(val) {
  2573. this.transform.localPositionZ = val;
  2574. }
  2575. destroySelf() {
  2576. this.posV3 = null;
  2577. this.rotSpeed = null;
  2578. this.d2BallSrc = null;
  2579. this.ballNode = null;
  2580. this.gameObj.destroy(true);
  2581. this.transform = null;
  2582. this.destroy();
  2583. }
  2584. }
  2585. class ui_D2Ball extends fgui.GComponent {
  2586. static createInstance() {
  2587. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2588. }
  2589. onConstruct() {
  2590. this.myIcon = (this.getChild("myIcon"));
  2591. this.inner = (this.getChild("inner"));
  2592. this.n8 = (this.getChild("n8"));
  2593. this.n4 = (this.getChild("n4"));
  2594. this.wrongTips = (this.getChild("wrongTips"));
  2595. this.rightTips = (this.getChild("rightTips"));
  2596. this.breathAni = this.getTransition("breathAni");
  2597. }
  2598. }
  2599. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2600. class D2BallSrc extends Laya.Script {
  2601. constructor() {
  2602. super();
  2603. this.number = 0;
  2604. this.startX = 0;
  2605. this.startY = 0;
  2606. this.angleV2 = new Laya.Vector2();
  2607. this.isRootBall = false;
  2608. this.isBlackBall = false;
  2609. this.ballType = "";
  2610. this.canRot = true;
  2611. this.rotY = 0;
  2612. this.poleAngle = 0;
  2613. this.kickPos = { x: 0, y: 0 };
  2614. this.hard = 0;
  2615. this.kickAngle = 0;
  2616. this.borderDis = 0;
  2617. this.speedP10 = 5.6;
  2618. this.lastSpeed = { x: 0, y: 0 };
  2619. this.stillSpeed = 0.12;
  2620. this.ballFunc = "normal";
  2621. this.isRunSkillAni = false;
  2622. this.isInHole = false;
  2623. this.iceOwner = "";
  2624. this.forceRun = false;
  2625. this.myUNID = "";
  2626. this.rectL = 0;
  2627. this.rectR = 0;
  2628. this.rectT = 0;
  2629. this.rectB = 0;
  2630. this.forceVec = new Laya.Vector2();
  2631. this.lastDis = 0;
  2632. this.helpOut = { type: "", x: 0, y: 0 };
  2633. }
  2634. initSelf(number, x, y, d3Ball) {
  2635. if (!this.gameObj)
  2636. this.gameObj = this.owner;
  2637. this.number = number;
  2638. this.startX = x;
  2639. this.startY = y;
  2640. this.d3Ball = d3Ball;
  2641. this.isRootBall = false;
  2642. this.isBlackBall = false;
  2643. this.ballType = "";
  2644. if (number == 0) {
  2645. this.isRootBall = true;
  2646. }
  2647. else if (number == 8) {
  2648. this.isBlackBall = true;
  2649. }
  2650. else {
  2651. if (number <= 7) {
  2652. this.ballType = ballCamp.full;
  2653. }
  2654. else {
  2655. this.ballType = ballCamp.flower;
  2656. }
  2657. }
  2658. this.setInfo();
  2659. this.setD3Ball();
  2660. this.owner["mySrc"] = this;
  2661. this.rigy.linearDamping = 1;
  2662. D2BallSrc._unid++;
  2663. this.myUNID = "d2ball" + D2BallSrc._unid;
  2664. let rect = xGame.common.d2World.borderRect;
  2665. this.rectL = Math.ceil(rect.x) + 20;
  2666. this.rectT = Math.ceil(rect.y) + 20;
  2667. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2668. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2669. }
  2670. setInfo() {
  2671. this.gameObj.x = this.startX;
  2672. this.gameObj.y = this.startY;
  2673. let radius = this.ui.width / 2;
  2674. this.gameObj.width = radius * 2;
  2675. this.gameObj.height = radius * 2;
  2676. if (xGame.common.showDebug) {
  2677. this.ui.myIcon.alpha = 1;
  2678. this.ui.inner.alpha = 1;
  2679. }
  2680. else {
  2681. this.ui.myIcon.alpha = 0;
  2682. this.ui.inner.alpha = 0;
  2683. }
  2684. }
  2685. setD3Ball() {
  2686. this.d3Ball = this.d3Ball;
  2687. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2688. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2689. }
  2690. onUpdate() {
  2691. if (xGame.common.gameMgr.gamePause)
  2692. return;
  2693. if (this.isInHole)
  2694. return;
  2695. if (!xGame.common.d2World.openCheckStill)
  2696. return;
  2697. this.runBall();
  2698. }
  2699. runBall() {
  2700. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2701. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2702. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2703. this.judgeBorder();
  2704. }
  2705. getDestDis(dest) {
  2706. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2707. }
  2708. setmyXY(x, y) {
  2709. this.d3BallSrc.setTransPos(x, y);
  2710. }
  2711. getSpeed() {
  2712. let speed = this.rigy.linearVelocity;
  2713. return speed.x * speed.x + speed.y * speed.y;
  2714. }
  2715. onTriggerEnter(collider) {
  2716. if (!collider || !collider.owner)
  2717. return;
  2718. let coll = "collide";
  2719. let speed = this.getSpeed();
  2720. let sv2 = this.speedP10 * this.speedP10;
  2721. if (collider.label == "ball") {
  2722. if (speed < 9 && this.number != 0)
  2723. coll = "";
  2724. else if (speed < sv2)
  2725. coll = "collide_4";
  2726. else if (speed < sv2 * 6.2)
  2727. coll = "collide_3";
  2728. else if (speed < sv2 * 25)
  2729. coll = "collide_2";
  2730. else if (speed < sv2 * 56)
  2731. coll = "collide_1";
  2732. xGame.soundMgr.playSound(coll);
  2733. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2734. if (collider.owner) {
  2735. let rig = collider.owner.getComponent(D2BallSrc);
  2736. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2737. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2738. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2739. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2740. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2741. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2742. let rx = 0;
  2743. let ry = 0;
  2744. if (this.gameObj.x < this.rectL)
  2745. rx = vx;
  2746. else if (this.gameObj.x > this.rectR)
  2747. rx = -vx;
  2748. else if (this.gameObj.y < this.rectT)
  2749. ry = vy;
  2750. else if (this.gameObj.y > this.rectB)
  2751. ry = -vy;
  2752. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2753. }
  2754. }
  2755. if (this.number != 0) {
  2756. return;
  2757. }
  2758. else {
  2759. if (this.forceRun) {
  2760. console.log("randon force");
  2761. this.applyForce(collider);
  2762. }
  2763. }
  2764. if (xGame.common.d2World.isOnSameLine) {
  2765. xGame.common.d2World.isOnSameLine = false;
  2766. this.rigy.linearVelocity = { x: 0, y: 0 };
  2767. }
  2768. if (xGame.common.gameMgr.firstColliObj == null) {
  2769. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2770. xGame.common.gameMgr.isTouchedBall = true;
  2771. }
  2772. }
  2773. else {
  2774. xGame.common.recoverCameraView();
  2775. let wallStr = "";
  2776. if (speed < 9) { }
  2777. else if (speed < sv2) { }
  2778. else if (speed < sv2 * 6.2)
  2779. wallStr = "wall_30";
  2780. else if (speed < sv2 * 25)
  2781. wallStr = "wall_50";
  2782. else if (speed < sv2 * 56)
  2783. wallStr = "wall_80";
  2784. xGame.soundMgr.playSound(wallStr);
  2785. }
  2786. }
  2787. applyForce(collider) {
  2788. let src = collider.owner.mySrc;
  2789. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2790. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2791. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2792. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2793. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2794. }
  2795. checkWrongBall(playEft = true) {
  2796. if (this.isInHole)
  2797. return;
  2798. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2799. if (this.number != 0 && playEft)
  2800. this.d3BallSrc.playInHoleEft();
  2801. let coll = "inpocket_1";
  2802. let speed = this.getSpeed();
  2803. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2804. if (speed < 9 && this.number != 0)
  2805. coll = "";
  2806. else if (speed < sv2 * 6.2)
  2807. coll = "inpocket_4";
  2808. else if (speed < sv2 * 25)
  2809. coll = "collide_3";
  2810. else if (speed < sv2 * 56)
  2811. coll = "collide_2";
  2812. xGame.soundMgr.playSound(coll);
  2813. this.isInHole = true;
  2814. if (this.number == 0) {
  2815. console.log("白球进了。。");
  2816. this.reset();
  2817. this.rigy.linearVelocity = { x: 0, y: 0 };
  2818. this.hideSelf();
  2819. xGame.common.gameUI.ui.whiteAni.visible = true;
  2820. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2821. xGame.common.gameUI.ui.whiteAni.visible = false;
  2822. }));
  2823. }
  2824. else {
  2825. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2826. xGame.common.d2World.removeOneBall(this);
  2827. this.destroySelf();
  2828. xGame.common.playHappySound(this.number);
  2829. this.runFlyEft();
  2830. }
  2831. }
  2832. runFlyEft() {
  2833. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2834. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2835. }
  2836. }
  2837. hideSelf() {
  2838. if (this.d3Ball)
  2839. this.d3Ball.active = false;
  2840. }
  2841. showSelf() {
  2842. this.isInHole = false;
  2843. if (this.d3Ball && !this.d3Ball.active)
  2844. this.d3Ball.active = true;
  2845. }
  2846. isStill() {
  2847. let speed = this.rigy.linearVelocity;
  2848. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2849. this.rigy.linearVelocity = { x: 0, y: 0 };
  2850. return true;
  2851. }
  2852. return false;
  2853. }
  2854. reset() {
  2855. }
  2856. destroySelf() {
  2857. this.d3BallSrc.destroySelf();
  2858. if (!this.ui.isDisposed) {
  2859. this.ui.removeFromParent();
  2860. this.ui.dispose();
  2861. this.ui = null;
  2862. }
  2863. this.outColli = null;
  2864. this.innerColli = null;
  2865. this.rigy = null;
  2866. this.d3Ball = null;
  2867. this.d3BallSrc = null;
  2868. this.angleV2 = null;
  2869. this.gameObj.destroy(true);
  2870. this.destroy();
  2871. }
  2872. judgeBorder() {
  2873. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2874. return;
  2875. }
  2876. if (this.destroyed)
  2877. return;
  2878. if (xGame.common.gameMode == GameMode.classic)
  2879. return;
  2880. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2881. if (isOver) {
  2882. this.checkWrongBall();
  2883. }
  2884. }
  2885. onClick(e, force = false) {
  2886. if (this.number == 0)
  2887. return;
  2888. if (force) {
  2889. }
  2890. else {
  2891. if (xGame.common.d2World.openCheckStill)
  2892. return;
  2893. if (!xGame.common.gameMgr.selfTurn) {
  2894. return;
  2895. }
  2896. }
  2897. if (!xGame.common.gameMgr.finishOneShoot)
  2898. return;
  2899. let root = xGame.common.d2World.rootBall.gameObj;
  2900. let x = this.gameObj.x - root.x;
  2901. let y = this.gameObj.y - root.y;
  2902. let angle = xGame.common.getfguiRotation(x, y);
  2903. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2904. xGame.common.d2World.getHelpLine();
  2905. xGame.common.clickedBall = true;
  2906. this.checkGuide();
  2907. }
  2908. checkGuide() {
  2909. let guide = DataMgr.getSkillGuide();
  2910. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2911. xGame.common.guideStep++;
  2912. xGame.common.gameUI.ui.guide1.visible = false;
  2913. xGame.common.gameUI.ui.guide2.visible = true;
  2914. }
  2915. }
  2916. checkDistance(disX, disY, angle) {
  2917. let diameter = this.gameObj.width - 1;
  2918. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2919. if (!this.lastDis)
  2920. this.lastDis = dis;
  2921. else {
  2922. if (dis > this.lastDis) {
  2923. this.helpOut.type = "remove";
  2924. return this.helpOut;
  2925. }
  2926. }
  2927. if (dis <= Math.pow(diameter, 2)) {
  2928. let del = 0.01;
  2929. let offest = 0;
  2930. let realX = disX - this.gameObj.x;
  2931. let realY = disY - this.gameObj.y;
  2932. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2933. offest += del;
  2934. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2935. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2936. }
  2937. this.helpOut.type = "ok";
  2938. this.helpOut.x = realX + this.gameObj.x;
  2939. this.helpOut.y = realY + this.gameObj.y;
  2940. return this.helpOut;
  2941. }
  2942. else {
  2943. this.helpOut.type = "no";
  2944. return this.helpOut;
  2945. }
  2946. }
  2947. clearBallEft() {
  2948. this.clearBallRightEft();
  2949. this.clearBallWrongEft();
  2950. }
  2951. clearBallRightEft() {
  2952. this.ui.breathAni.stop();
  2953. this.ui.rightTips.visible = false;
  2954. }
  2955. clearBallWrongEft() {
  2956. this.ui.wrongTips.visible = false;
  2957. }
  2958. showWrongEft() {
  2959. if (!xGame.common.gameMgr.selfTurn)
  2960. return;
  2961. this.ui.wrongTips.visible = true;
  2962. }
  2963. showRightEft() {
  2964. if (!xGame.common.gameMgr.selfTurn)
  2965. return;
  2966. this.ui.rightTips.visible = true;
  2967. this.ui.rightTips.scaleX = 1;
  2968. this.ui.rightTips.scaleY = 1;
  2969. this.ui.breathAni.play();
  2970. }
  2971. setBallFunc(type, owner) {
  2972. if (type == "ice") {
  2973. this.ballFunc = type;
  2974. this.d3BallSrc.setAlbedoTexture(true);
  2975. this.rigy.type = "static";
  2976. this.iceOwner = owner;
  2977. }
  2978. else {
  2979. if (owner == this.iceOwner) {
  2980. this.ballFunc = type;
  2981. this.d3BallSrc.setAlbedoTexture(false);
  2982. this.rigy.type = "dynamic";
  2983. }
  2984. }
  2985. }
  2986. }
  2987. D2BallSrc._unid = 0;
  2988. class D2RootBallSrc extends D2BallSrc {
  2989. constructor() {
  2990. super();
  2991. this.maxSpeed = 0;
  2992. this.classicMaxSpeed = 2.2;
  2993. this.bigSkillMaxSpeed = 4;
  2994. this.angle = 0;
  2995. this.allPercent = 0;
  2996. this.linearPercent = 0;
  2997. this.anglePercent = 0;
  2998. this.maxAngleRate = 0.6;
  2999. this.baseRot = 7;
  3000. this.angleMax = 0;
  3001. this.speed = new Laya.Vector2();
  3002. this.rotSpeed = new Laya.Vector2();
  3003. }
  3004. isStill() {
  3005. let speed = this.rigy.linearVelocity;
  3006. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3007. if (this.anglePercent <= 0.1) {
  3008. this.rigy.linearVelocity = { x: 0, y: 0 };
  3009. return true;
  3010. }
  3011. }
  3012. return false;
  3013. }
  3014. reset() {
  3015. this.linearPercent = 0;
  3016. this.anglePercent = 0;
  3017. }
  3018. setSpeed(percent, angle) {
  3019. this.allPercent = percent;
  3020. this.angle = angle;
  3021. this.setAngleSpeed();
  3022. this.setLinearSpeed();
  3023. let hit = "hit";
  3024. if (percent < 25)
  3025. hit = "hit03";
  3026. else if (percent < 50)
  3027. hit = "hit02";
  3028. else if (percent < 75)
  3029. hit = "hit01";
  3030. xGame.soundMgr.playSound(hit);
  3031. }
  3032. setAngleSpeed() {
  3033. let offest = xGame.common.rodOffest;
  3034. let radius = 82;
  3035. let rate = Math.abs(offest.y / radius) * 0.5;
  3036. if (offest.y > 0)
  3037. this.angleMax = -this.baseRot * 2;
  3038. else
  3039. this.angleMax = this.baseRot;
  3040. this.rotY = -offest.x / radius * 100;
  3041. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3042. this.linearPercent = this.allPercent - this.anglePercent;
  3043. }
  3044. setLinearSpeed() {
  3045. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3046. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3047. if (!xGame.common.longHelpLine) {
  3048. let offset = -150 + xGame.common.randomNum(0, 300);
  3049. offset /= 100;
  3050. this.angle += offset;
  3051. }
  3052. }
  3053. }
  3054. let sin = Math.sin(this.angle * Math.PI / 180);
  3055. let cos = Math.cos(this.angle * Math.PI / 180);
  3056. switch (xGame.common.gameMode) {
  3057. case GameMode.classic:
  3058. this.maxSpeed = this.classicMaxSpeed;
  3059. break;
  3060. case GameMode.bigMove:
  3061. this.maxSpeed = this.bigSkillMaxSpeed;
  3062. break;
  3063. case GameMode.placeBall:
  3064. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3065. if (data.type == 1) {
  3066. this.maxSpeed = this.bigSkillMaxSpeed;
  3067. }
  3068. else {
  3069. this.maxSpeed = this.classicMaxSpeed;
  3070. }
  3071. break;
  3072. default:
  3073. break;
  3074. }
  3075. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3076. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3077. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3078. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3079. this.rigy.applyLinearImpulseToCenter(this.speed);
  3080. }
  3081. onUpdate() {
  3082. if (this.anglePercent > 0.1) {
  3083. this.anglePercent *= 0.97;
  3084. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3085. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3086. this.rigy.applyForceToCenter(this.rotSpeed);
  3087. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3088. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3089. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3090. if (num > 0.9)
  3091. this.canRot = true;
  3092. }
  3093. else
  3094. this.canRot = true;
  3095. if (Math.abs(this.rotY) > 0.1)
  3096. this.rotY *= 0.98;
  3097. super.onUpdate();
  3098. }
  3099. destroySelf() {
  3100. super.destroySelf();
  3101. this.speed = null;
  3102. }
  3103. }
  3104. class D2Ball extends Laya.Sprite {
  3105. constructor(isRootBall = false) {
  3106. super();
  3107. this.ui = ui_D2Ball.createInstance();
  3108. this.pivotX = this.ui.width / 2;
  3109. this.pivotY = this.ui.width / 2;
  3110. this.x = 0;
  3111. this.y = 0;
  3112. this.addChild(this.ui.displayObject);
  3113. this.ui.displayObject.x += this.ui.width / 2;
  3114. this.ui.displayObject.y += this.ui.width / 2;
  3115. if (isRootBall) {
  3116. this.d2Src = this.addComponent(D2RootBallSrc);
  3117. }
  3118. else {
  3119. this.d2Src = this.addComponent(D2BallSrc);
  3120. }
  3121. this.d2Src.ui = this.ui;
  3122. this.addCircleCollider();
  3123. this.addInnerCircleCollider();
  3124. this.addRigyBody();
  3125. }
  3126. addCircleCollider() {
  3127. let colli = xGame.common.getCollider("circle");
  3128. colli.radius = this.ui.width / 2;
  3129. this.addComponentIntance(colli);
  3130. this.d2Src.outColli = colli;
  3131. colli.label = "ball";
  3132. }
  3133. addInnerCircleCollider() {
  3134. let colli = xGame.common.getCollider("circle");
  3135. colli.radius = this.ui.inner.width / 2;
  3136. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3137. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3138. this.addComponentIntance(colli);
  3139. this.d2Src.innerColli = colli;
  3140. colli.label = "inner";
  3141. }
  3142. addRigyBody() {
  3143. let rigy = xGame.common.getRigbody();
  3144. rigy.type = "dynamic";
  3145. this.addComponentIntance(rigy);
  3146. this.d2Src.rigy = rigy;
  3147. }
  3148. disposeSelf() {
  3149. if (!this.ui.isDisposed) {
  3150. this.ui.dispose();
  3151. this.ui.removeFromParent();
  3152. this.ui = null;
  3153. }
  3154. }
  3155. }
  3156. class ui_D2Gan extends fgui.GComponent {
  3157. static createInstance() {
  3158. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3159. }
  3160. onConstruct() {
  3161. this.myIcon = (this.getChild("myIcon"));
  3162. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3163. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3164. this.self = (this.getChild("self"));
  3165. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3166. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3167. this.ai = (this.getChild("ai"));
  3168. }
  3169. }
  3170. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3171. class D2Gan {
  3172. constructor() {
  3173. this.offset = 0.15;
  3174. this.cell = 1.5;
  3175. this.onBallCell = 0.4;
  3176. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3177. this.moveNum = 70;
  3178. this.rulerRate = 0.1;
  3179. this.ui = ui_D2Gan.createInstance();
  3180. this.changeSelfRod();
  3181. this.changeAIRod();
  3182. }
  3183. changeSelfRod() {
  3184. let index = DataMgr.getCurBallRod();
  3185. let data = cfgTable.ballrodData[index + 1];
  3186. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3187. this.selfMySpine && this.selfMySpine.dispose();
  3188. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3189. if (data.spine) {
  3190. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3191. this.selfMySpine = new SpineMgr(data.spine, () => {
  3192. let xx = this.ui.selfEftRoot.width / 2;
  3193. let yy = this.ui.selfEftRoot.height / 2;
  3194. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3195. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3196. outSpine.rotation = -90;
  3197. });
  3198. }
  3199. }
  3200. changeAIRod() {
  3201. let length = Object.keys(cfgTable.ballrodData).length;
  3202. let rand = Math.floor(length * Math.random()) + 1;
  3203. let data = cfgTable.ballrodData[rand];
  3204. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3205. this.aiMySpine && this.aiMySpine.dispose();
  3206. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3207. if (data.spine) {
  3208. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3209. this.aiMySpine = new SpineMgr(data.spine, () => {
  3210. let xx = this.ui.aiEftRoot.width / 2;
  3211. let yy = this.ui.aiEftRoot.height / 2;
  3212. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3213. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3214. outSpine.rotation = -90;
  3215. });
  3216. }
  3217. }
  3218. setGanLastInfo() {
  3219. this.lastInfo.rotation = this.ui.rotation;
  3220. this.lastInfo.x = this.ui.x;
  3221. this.lastInfo.y = this.ui.y;
  3222. }
  3223. rotateSelf(flag, isRuler = false) {
  3224. let angle;
  3225. flag = flag * this.offset;
  3226. if (xGame.common.d2World.isHelpLineOnBall) {
  3227. angle = flag * this.onBallCell;
  3228. }
  3229. else {
  3230. angle = flag * this.cell;
  3231. }
  3232. if (isRuler) {
  3233. angle *= this.rulerRate;
  3234. }
  3235. this.ui.rotation += angle;
  3236. xGame.common.d2World.getHelpLine();
  3237. }
  3238. checkDistance() {
  3239. let target = xGame.common.d2World.targetBall;
  3240. let root = xGame.common.d2World.rootBall;
  3241. if (target == null) {
  3242. return 1;
  3243. }
  3244. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3245. if (dis <= 2500) {
  3246. return 5;
  3247. }
  3248. return 1;
  3249. }
  3250. rotDest(rot) {
  3251. this.ui.rotation = rot;
  3252. xGame.common.d2World.getHelpLine();
  3253. }
  3254. storagePower(powerNum) {
  3255. let pos = (powerNum / 100) * this.moveNum;
  3256. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3257. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3258. this.ui.x = this.lastInfo.x + xx;
  3259. this.ui.y = this.lastInfo.y + yy;
  3260. }
  3261. shoot() {
  3262. this.storagePower(0);
  3263. this.ui.visible = false;
  3264. }
  3265. destroySelf() {
  3266. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3267. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3268. this.selfMySpine && this.selfMySpine.dispose();
  3269. this.aiMySpine && this.aiMySpine.dispose();
  3270. this.lastInfo = null;
  3271. if (!this.ui.isDisposed) {
  3272. this.ui.removeFromParent();
  3273. this.ui.dispose();
  3274. }
  3275. }
  3276. }
  3277. class ui_HelpLine extends fgui.GComponent {
  3278. static createInstance() {
  3279. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3280. }
  3281. onConstruct() {
  3282. this.n10 = (this.getChild("n10"));
  3283. this.rect = (this.getChild("rect"));
  3284. this.dir11 = (this.getChild("dir11"));
  3285. this.dir = (this.getChild("dir"));
  3286. this.rootDir = (this.getChild("rootDir"));
  3287. this.dirDot = (this.getChild("dirDot"));
  3288. }
  3289. }
  3290. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3291. class D2HelpLine {
  3292. constructor() {
  3293. this.starX = 0;
  3294. this.starY = 0;
  3295. this.ui = ui_HelpLine.createInstance();
  3296. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3297. this.starX = this.ui.rect.x;
  3298. this.starY = this.ui.rect.y;
  3299. }
  3300. shoot() {
  3301. this.ui.visible = false;
  3302. }
  3303. destroySelf() {
  3304. if (this.ui.isDisposed) {
  3305. this.ui.removeFromParent();
  3306. this.ui.dispose();
  3307. }
  3308. }
  3309. }
  3310. class D2World extends Laya.Script {
  3311. constructor() {
  3312. super();
  3313. this.ballArr = [];
  3314. this.openCheckStill = false;
  3315. this.checkArr = [];
  3316. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3317. this.isHelpLineOnBall = false;
  3318. this.isOnSameLine = false;
  3319. this.reflectAngle = 0;
  3320. this.powerPercent = 0;
  3321. this.inHolesSpeed = [];
  3322. this.outDir = new Laya.Vector2();
  3323. this.rootDir = new Laya.Vector2();
  3324. this.aiLv = 0;
  3325. this.rootPos = new Laya.Vector2();
  3326. this.tempDir1 = new Laya.Vector2();
  3327. this.tempDir2 = new Laya.Vector2();
  3328. this.tempDir3 = new Laya.Vector2();
  3329. this.ballSize = 33;
  3330. this.destRot = 0;
  3331. }
  3332. initSelf() {
  3333. this.createBalls();
  3334. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3335. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3336. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3337. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3338. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3339. }
  3340. setBorderRect() {
  3341. let ui = xGame.common.gameUI.ui;
  3342. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3343. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3344. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3345. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3346. this.borderRect.x = starX;
  3347. this.borderRect.y = starY;
  3348. this.borderRect.width = width;
  3349. this.borderRect.height = height;
  3350. }
  3351. resetGame() {
  3352. this.openCheckStill = false;
  3353. let temp;
  3354. for (let index = 0; index < this.ballArr.length; index++) {
  3355. temp = this.ballArr[index];
  3356. temp.destroySelf();
  3357. }
  3358. xGame.common.d3World.ballRoot.destroyChildren();
  3359. xGame.common.gameUI.ui.ballNode.removeChildren();
  3360. console.log("进入摧毁逻辑");
  3361. this.d2Gan.destroySelf();
  3362. this.d2HelpLine.destroySelf();
  3363. this.ballArr = [];
  3364. }
  3365. setD2Gan() {
  3366. let ballNode = this.rootBall.ui;
  3367. let d2Gan = new D2Gan();
  3368. this.d2Gan = d2Gan;
  3369. let ganNode = d2Gan.ui;
  3370. ballNode.addChild(ganNode);
  3371. ganNode.pivotX = ganNode.pivotX;
  3372. ganNode.pivotY = ganNode.pivotY;
  3373. ganNode.x = ganNode.myIcon.width / 2;
  3374. ganNode.y = this.rootBall.gameObj.width;
  3375. d2Gan.setGanLastInfo();
  3376. }
  3377. setHelpLine() {
  3378. let d2Help = new D2HelpLine();
  3379. this.d2HelpLine = d2Help;
  3380. }
  3381. createBalls() {
  3382. let cfg;
  3383. switch (xGame.common.gameMode) {
  3384. case GameMode.classic:
  3385. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3386. break;
  3387. case GameMode.bigMove:
  3388. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3389. break;
  3390. case GameMode.placeBall:
  3391. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3392. break;
  3393. default:
  3394. break;
  3395. }
  3396. cfg = JSON.parse(JSON.stringify(cfg));
  3397. for (const key in cfg) {
  3398. if (cfg[key].value == 0) {
  3399. this.createRootBall(cfg[key]);
  3400. delete cfg[key];
  3401. break;
  3402. }
  3403. }
  3404. this.createOtherBalls(cfg);
  3405. }
  3406. createRootBall(data) {
  3407. let root = new D2Ball(true);
  3408. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3409. this.rootBall = root.d2Src;
  3410. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3411. let d3BallSrc = d3Ball.getComponent(Ball);
  3412. xGame.common.d3World.rootBall = d3Ball;
  3413. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3414. let xx = data.x;
  3415. let yy = data.y;
  3416. let numer = data.value;
  3417. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3418. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3419. this.ballArr.push(this.rootBall);
  3420. this.setD2Gan();
  3421. this.setHelpLine();
  3422. }
  3423. createOtherBalls(cfg) {
  3424. let temp;
  3425. let src;
  3426. let data;
  3427. for (const key in cfg) {
  3428. data = cfg[key];
  3429. temp = new D2Ball();
  3430. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3431. src = temp.d2Src;
  3432. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3433. src.initSelf(data.value, data.x, data.y, d3Ball);
  3434. this.ballArr.push(src);
  3435. }
  3436. }
  3437. shoot(percent) {
  3438. this.powerPercent = percent;
  3439. this.openCheckStill = true;
  3440. let d2Angle = this.d2Gan.ui.rotation;
  3441. this.rootBall.setSpeed(percent, d2Angle);
  3442. this.clearBallAllEft();
  3443. this.changePlayerView();
  3444. }
  3445. onUpdate() {
  3446. if (!this.openCheckStill)
  3447. return;
  3448. this.checkStill();
  3449. }
  3450. checkStill() {
  3451. for (let index = 0; index < this.ballArr.length; index++) {
  3452. if (!this.ballArr[index].isStill()) {
  3453. return;
  3454. }
  3455. }
  3456. xGame.eventMgr.event(ALL_BALL_STOP);
  3457. }
  3458. allBallStop() {
  3459. this.openCheckStill = false;
  3460. xGame.common.recoverCameraView();
  3461. }
  3462. waitShoot() {
  3463. if (!this.d2Gan.ui.isDisposed) {
  3464. this.d2Gan.ui.visible = true;
  3465. }
  3466. if (!this.d2HelpLine.ui.isDisposed) {
  3467. this.d2HelpLine.ui.visible = true;
  3468. }
  3469. this.clearBallAllEft();
  3470. this.showBallRightEft();
  3471. this.getHelpLine();
  3472. this.inHolesSpeed = [];
  3473. this.selectOneBall();
  3474. }
  3475. _getAllBallArr() {
  3476. let arr = this.ballArr;
  3477. let outArr = [];
  3478. for (let index = 0; index < arr.length; index++) {
  3479. if (arr[index] instanceof D2RootBallSrc)
  3480. continue;
  3481. if (arr[index].ballFunc == "ice")
  3482. continue;
  3483. if (arr[index].destroyed)
  3484. continue;
  3485. outArr.push(arr[index]);
  3486. }
  3487. return outArr;
  3488. }
  3489. _getBlackObj() {
  3490. let arr = this.ballArr;
  3491. for (let index = 0; index < arr.length; index++) {
  3492. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3493. return arr[index];
  3494. }
  3495. }
  3496. }
  3497. selectOneBall() {
  3498. let all = this._getAllBallArr();
  3499. let target;
  3500. switch (xGame.common.gameMode) {
  3501. case GameMode.classic:
  3502. if (xGame.common.gameMgr.selfTurn) {
  3503. let self = xGame.common.gameMgr.selfBallArr;
  3504. let black = this._getBlackObj();
  3505. if (xGame.common.gameMgr.ensureBallType) {
  3506. if (self.length > 0) {
  3507. let out = [];
  3508. for (let j = 0; j < all.length; j++) {
  3509. if (self.indexOf(all[j].number) > -1) {
  3510. out.push(all[j]);
  3511. }
  3512. }
  3513. target = this.selectBestEnterOne(out);
  3514. }
  3515. else {
  3516. target = this.selectBestEnterOne([black]);
  3517. }
  3518. }
  3519. else {
  3520. target = this.selectBestEnterOne(all);
  3521. }
  3522. }
  3523. else {
  3524. target = this.selectBestEnterOne(all);
  3525. }
  3526. break;
  3527. case GameMode.bigMove:
  3528. target = this.selectBestEnterOne(all);
  3529. break;
  3530. case GameMode.placeBall:
  3531. if (all.length > 0) {
  3532. target = this.selectBestEnterOne(all);
  3533. }
  3534. break;
  3535. default:
  3536. break;
  3537. }
  3538. if (target && !target.destroyed && target.onClick) {
  3539. target.onClick(0, true);
  3540. let num = -200 + xGame.common.randomNum(0, 400);
  3541. num /= 150;
  3542. if (xGame.common.longHelpLine) {
  3543. num = 0;
  3544. }
  3545. this.destRot += num;
  3546. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3547. }
  3548. }
  3549. removeOneBall(ball) {
  3550. for (let index = 0; index < this.ballArr.length; index++) {
  3551. if (this.ballArr[index].id == ball.id) {
  3552. this.ballArr.splice(index, 1);
  3553. break;
  3554. }
  3555. }
  3556. }
  3557. getHelpLine() {
  3558. this.d2HelpLine.ui.dirDot.visible = false;
  3559. this.isOnSameLine = false;
  3560. let startX = this.rootBall.gameObj.x;
  3561. let startY = this.rootBall.gameObj.y;
  3562. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3563. if (dis == null) {
  3564. this.d2HelpLine.ui.visible = false;
  3565. console.error("辅助线异常");
  3566. return;
  3567. }
  3568. this.d2HelpLine.ui.visible = true;
  3569. let angle = this.d2Gan.ui.rotation;
  3570. let radius = 16.5;
  3571. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3572. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3573. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3574. if (colliObj == null) {
  3575. this.getColliPos(disX, disY, radius, angle);
  3576. xGame.common.d2World.isHelpLineOnBall = false;
  3577. this.targetBall = null;
  3578. this.reflectAngle = 0;
  3579. this.showBallWrongEft();
  3580. }
  3581. else {
  3582. let target = colliObj.src;
  3583. let radius = 16.5;
  3584. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3585. dis1 = Math.sqrt(dis1);
  3586. let realDis = colliObj.disHon - dis1;
  3587. let dir = colliObj.dir;
  3588. let xx = startX + dir.x * realDis;
  3589. let yy = startY + dir.y * realDis;
  3590. this.getColliPos(xx, yy, radius, angle);
  3591. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3592. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3593. let offset = xGame.common.rodOffest;
  3594. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3595. this.isOnSameLine = true;
  3596. }
  3597. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3598. xGame.common.d2World.isHelpLineOnBall = true;
  3599. this.targetBall = target;
  3600. this.reflectAngle = reflectAngle;
  3601. this.showBallWrongEft();
  3602. if (xGame.common.longHelpLine) {
  3603. this.delayReflectLine(target, reflectAngle);
  3604. }
  3605. }
  3606. }
  3607. getBorderDot(startX, startY, angle) {
  3608. let radius = 17;
  3609. let distance;
  3610. let isDone;
  3611. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3612. isDone = this.judgeUpDown(distance, angle, startX);
  3613. if (isDone != null) {
  3614. return isDone;
  3615. }
  3616. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3617. isDone = this.judgeUpDown(distance, angle, startX);
  3618. if (isDone != null) {
  3619. return isDone;
  3620. }
  3621. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3622. isDone = this.judgeLeftRight(distance, angle, startY);
  3623. if (isDone != null) {
  3624. return isDone;
  3625. }
  3626. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3627. isDone = this.judgeLeftRight(distance, angle, startY);
  3628. if (isDone != null) {
  3629. return isDone;
  3630. }
  3631. }
  3632. judgeUpDown(distance, angle, startX) {
  3633. let flag = Math.sin(angle * Math.PI / 180);
  3634. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3635. if (distance >= 0) {
  3636. if (flag > 0) {
  3637. if (temp < this.borderRect.x + this.borderRect.width) {
  3638. return distance;
  3639. }
  3640. }
  3641. else {
  3642. if (temp > this.borderRect.x) {
  3643. return distance;
  3644. }
  3645. }
  3646. }
  3647. }
  3648. judgeLeftRight(distance, angle, starY) {
  3649. let flag = -Math.cos(angle * Math.PI / 180);
  3650. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3651. if (distance >= 0) {
  3652. if (flag > 0) {
  3653. if (temp < this.borderRect.y + this.borderRect.height) {
  3654. return distance;
  3655. }
  3656. }
  3657. else {
  3658. if (temp > this.borderRect.y) {
  3659. return distance;
  3660. }
  3661. }
  3662. }
  3663. }
  3664. clearBallAllEft() {
  3665. let temp;
  3666. for (let index = 0; index < this.ballArr.length; index++) {
  3667. temp = this.ballArr[index];
  3668. temp.clearBallEft();
  3669. }
  3670. }
  3671. showBallRightEft() {
  3672. let gameMgr = xGame.common.gameMgr;
  3673. let temp;
  3674. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3675. if (targetArr.length <= 0)
  3676. return;
  3677. for (let index = 0; index < this.ballArr.length; index++) {
  3678. temp = this.ballArr[index];
  3679. if (targetArr.indexOf(temp.number) > -1) {
  3680. temp.showRightEft();
  3681. }
  3682. }
  3683. }
  3684. showBallWrongEft() {
  3685. let gameMgr = xGame.common.gameMgr;
  3686. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3687. if (targetArr.length <= 0)
  3688. return;
  3689. let temp;
  3690. for (let index = 0; index < this.ballArr.length; index++) {
  3691. temp = this.ballArr[index];
  3692. if (this.targetBall && this.targetBall.number == temp.number) {
  3693. if (targetArr.indexOf(temp.number) <= -1) {
  3694. temp.showWrongEft();
  3695. }
  3696. else {
  3697. temp.clearBallWrongEft();
  3698. }
  3699. }
  3700. else {
  3701. temp.clearBallWrongEft();
  3702. }
  3703. }
  3704. }
  3705. getColliPos(x, y, radius, angle) {
  3706. this.d2HelpLine.ui.x = x;
  3707. this.d2HelpLine.ui.y = y;
  3708. let dirX = x - this.rootBall.gameObj.x;
  3709. let dirY = y - this.rootBall.gameObj.y;
  3710. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3711. if (rectH <= 0)
  3712. rectH = 0;
  3713. this.d2HelpLine.ui.rect.height = 0;
  3714. this.d2HelpLine.ui.rect.height = rectH;
  3715. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3716. if (rectH < this.rootBall.gameObj.width) {
  3717. this.d2HelpLine.ui.rect.visible = false;
  3718. }
  3719. else {
  3720. this.d2HelpLine.ui.rect.visible = true;
  3721. }
  3722. this.d2HelpLine.ui.dir.visible = false;
  3723. this.d2HelpLine.ui.rootDir.visible = false;
  3724. }
  3725. getReflectLine(x, y, radius, target) {
  3726. this.d2HelpLine.ui.dir.visible = true;
  3727. let dirX = target.x - x;
  3728. let dirY = target.y - y;
  3729. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3730. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3731. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3732. this.d2HelpLine.ui.dir.height = 48;
  3733. this.d2HelpLine.ui.dir.rotation = angle;
  3734. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3735. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3736. return angle;
  3737. }
  3738. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3739. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3740. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3741. let targetX = target.gameObj.x;
  3742. let targetY = target.gameObj.y;
  3743. this.outDir.setValue(targetX - xx, targetY - yy);
  3744. this.rootDir.setValue(rtX - xx, rtY - yy);
  3745. let ver = Math.PI / 2;
  3746. let sin = Math.sin(ver);
  3747. let cos = Math.cos(ver);
  3748. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3749. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3750. this.outDir.setValue(outX, outY);
  3751. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3752. Laya.Vector2.normalize(this.outDir, this.outDir);
  3753. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3754. if (Math.abs(result) <= 0.08) {
  3755. this.d2HelpLine.ui.rootDir.visible = false;
  3756. return;
  3757. }
  3758. if (result > 0) {
  3759. angle += 90;
  3760. }
  3761. else if (result < 0) {
  3762. angle -= 90;
  3763. }
  3764. this.d2HelpLine.ui.rootDir.visible = true;
  3765. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3766. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3767. this.d2HelpLine.ui.rootDir.rotation = angle;
  3768. }
  3769. delayReflectLine(obj, angle) {
  3770. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3771. return;
  3772. }
  3773. this.isOnSameLine = false;
  3774. let startX = obj.gameObj.x;
  3775. let startY = obj.gameObj.y;
  3776. let dis = this.getBorderDot(startX, startY, angle);
  3777. if (dis == null) {
  3778. this.d2HelpLine.ui.dirDot.visible = false;
  3779. return;
  3780. }
  3781. this.d2HelpLine.ui.visible = true;
  3782. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3783. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3784. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3785. if (colliObj == null) {
  3786. this.setDelayLine(disX, disY, obj, angle);
  3787. }
  3788. else {
  3789. let radius = 16;
  3790. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3791. dis1 = Math.sqrt(dis1);
  3792. let realDis = colliObj.disHon - dis1;
  3793. let dir = colliObj.dir;
  3794. let xx = startX + dir.x * realDis;
  3795. let yy = startY + dir.y * realDis;
  3796. this.setDelayLine(xx, yy, obj, angle);
  3797. }
  3798. }
  3799. setDelayLine(x, y, obj, angle) {
  3800. let dirX = x - obj.gameObj.x;
  3801. let dirY = y - obj.gameObj.y;
  3802. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3803. if (rectH <= 0)
  3804. rectH = 0;
  3805. this.d2HelpLine.ui.dir.height = rectH;
  3806. this.d2HelpLine.ui.dirDot.visible = true;
  3807. this.d2HelpLine.ui.dirDot.x = 17;
  3808. this.d2HelpLine.ui.dirDot.y = 17;
  3809. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3810. ;
  3811. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3812. }
  3813. changePlayerView() {
  3814. if (Math.random() >= 0.7)
  3815. return;
  3816. if (!this.targetBall) {
  3817. return;
  3818. }
  3819. if (!xGame.common.gameMgr.selfTurn)
  3820. return;
  3821. switch (xGame.common.gameMode) {
  3822. case GameMode.classic:
  3823. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3824. if (this.targetBall.number != 8) {
  3825. return;
  3826. }
  3827. }
  3828. break;
  3829. case GameMode.bigMove:
  3830. return;
  3831. case GameMode.placeBall:
  3832. break;
  3833. default:
  3834. break;
  3835. }
  3836. let startX = this.targetBall.gameObj.x;
  3837. let startY = this.targetBall.gameObj.y;
  3838. let angle = this.reflectAngle;
  3839. let dis = this.getBorderDot(startX, startY, angle);
  3840. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3841. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3842. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3843. if (colliObj) {
  3844. return;
  3845. }
  3846. let offset = 40;
  3847. let posObj = xGame.common.gameMgr.posObj;
  3848. let temp;
  3849. let radius;
  3850. let tarX, tarY;
  3851. for (const key in posObj) {
  3852. temp = posObj[key];
  3853. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3854. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3855. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3856. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3857. xGame.common.showOneCamera("angle" + key);
  3858. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3859. Laya.physicsTimer.scale = 0.7;
  3860. break;
  3861. }
  3862. }
  3863. }
  3864. selectBestEnterOne(arr) {
  3865. this.aiLv = xGame.tools.random(1, 11);
  3866. this.aiLv = 10;
  3867. this.wBall = xGame.common.d2World.rootBall;
  3868. this.rootPos.x = this.wBall.gameObj.x;
  3869. this.rootPos.y = this.wBall.gameObj.y;
  3870. this.initHoleBall(arr);
  3871. return this.selectBall();
  3872. }
  3873. selectBall() {
  3874. let ball = null;
  3875. this.destRot = 0;
  3876. let ai = 110 - this.aiLv * 10;
  3877. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3878. let score = false;
  3879. if (this.scoreBall.length < 1) {
  3880. if (this.lineBall.length < 1) {
  3881. for (let i = 0; i < this.kickBall.length; i++) {
  3882. let list = [];
  3883. let bo = this.kickBall[i];
  3884. let bobj = bo.gameObj;
  3885. let rect = xGame.common.d2World.borderRect;
  3886. let mobj = this.wBall.gameObj;
  3887. let minb = bobj.y - rect.y - 20;
  3888. let minw = mobj.y - rect.y - 50;
  3889. if (minb > 0 && minw > 0) {
  3890. let dlenx = 0;
  3891. let dleny = mobj.y - rect.y;
  3892. let spx = mobj.x;
  3893. let spy = rect.y - dleny;
  3894. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3895. }
  3896. minb = rect.y + rect.height - bobj.y - 20;
  3897. minw = rect.y + rect.height - mobj.y - 50;
  3898. if (minb > 0 && minw > 0) {
  3899. let dlenx = 0;
  3900. let dleny = rect.y + rect.height - mobj.y;
  3901. let spx = mobj.x;
  3902. let spy = rect.y + rect.height + dleny;
  3903. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3904. }
  3905. minb = bobj.x - rect.x - 20;
  3906. minw = mobj.x - rect.x - 50;
  3907. if (minb > 0 && minw > 0) {
  3908. let dlenx = mobj.x - rect.x;
  3909. let dleny = 0;
  3910. let spx = rect.x - dlenx;
  3911. let spy = mobj.y;
  3912. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3913. }
  3914. minb = rect.x + rect.width - bobj.x - 20;
  3915. minw = rect.x + rect.width - mobj.x - 50;
  3916. if (minb > 0 && minw > 0) {
  3917. let dlenx = rect.x + rect.width - mobj.x;
  3918. let dleny = 0;
  3919. let spx = rect.x + rect.width + dlenx;
  3920. let spy = mobj.y;
  3921. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3922. }
  3923. list.sort(function (a, b) {
  3924. return a.order - b.order;
  3925. });
  3926. for (let i = 0; i < list.length; i++) {
  3927. let data = list[i];
  3928. let mx = mobj.x - bobj.x;
  3929. let my = mobj.y - bobj.y;
  3930. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3931. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3932. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3933. if (num > 1)
  3934. num = 1;
  3935. let cos = Math.acos(num);
  3936. if (cos > 1.57)
  3937. cos = 1.57;
  3938. else if (cos < 0.01)
  3939. cos = 0.01;
  3940. let tan = Math.tan(cos);
  3941. let dx = tan * data.dleny;
  3942. let dy = tan * data.dlenx;
  3943. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3944. if (Math.abs(bx - 667) < 40)
  3945. continue;
  3946. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3947. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3948. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3949. this.forceMax = dis * 0.08;
  3950. this.destRot += mis * 0.1;
  3951. this.setKick(bx, by);
  3952. return true;
  3953. }
  3954. }
  3955. }
  3956. }
  3957. else {
  3958. ball = xGame.common.getRandArrEle(this.lineBall);
  3959. }
  3960. }
  3961. else {
  3962. for (let i = 0; i < this.scoreBall.length; i++) {
  3963. if (i < this.scoreBall.length - 1) {
  3964. let rand = 70 + this.aiLv * 10 + i * 10;
  3965. if (xGame.tools.random(0, 100) < rand) {
  3966. ball = this.scoreBall[i];
  3967. break;
  3968. }
  3969. }
  3970. else {
  3971. ball = this.scoreBall[i];
  3972. break;
  3973. }
  3974. }
  3975. score = true;
  3976. this.selectNum++;
  3977. }
  3978. if (!ball)
  3979. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  3980. let dx = ball.gameObj.x;
  3981. let dy = ball.gameObj.y;
  3982. let kickAngle = 0;
  3983. if (score) {
  3984. dx = ball.kickPos.x;
  3985. dy = ball.kickPos.y;
  3986. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  3987. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  3988. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  3989. if (adot > 1)
  3990. adot = 1;
  3991. kickAngle = Math.acos(adot) * 57.3;
  3992. if (kickAngle > 45) {
  3993. let kdx = ball.kickPos.x - ball.gameObj.x;
  3994. let kdy = ball.kickPos.y - ball.gameObj.y;
  3995. dx = ball.kickPos.x - kdx * mis * 0.3;
  3996. dy = ball.kickPos.y - kdy * mis * 0.3;
  3997. }
  3998. else
  3999. this.destRot += mis;
  4000. }
  4001. else if (ball.poleAngle != 0) {
  4002. this.destRot += ball.poleAngle;
  4003. }
  4004. if (xGame.common.gameMode == 0) {
  4005. let af = kickAngle * 0.08;
  4006. this.forceMax = ball.hard * 0.1 + af * af;
  4007. }
  4008. this.setKick(dx, dy);
  4009. return ball;
  4010. }
  4011. initHoleBall(arr) {
  4012. this.kickBall = [];
  4013. this.lineBall = [];
  4014. this.scoreBall = [];
  4015. this.holeBall = [];
  4016. this.selectNum = 0;
  4017. this.forceNum = 0;
  4018. this.forceMax = 0;
  4019. this.turnNum = 0;
  4020. let list = arr;
  4021. let holes = xGame.common.gameMgr.holePosList;
  4022. let self = xGame.common.aiPlayer;
  4023. for (let i = 0; i < list.length; i++) {
  4024. let obj = list[i];
  4025. if (!obj)
  4026. continue;
  4027. obj.kickPos.x = 0;
  4028. obj.kickPos.y = 0;
  4029. obj.poleAngle = 0;
  4030. obj.hard = 0;
  4031. obj.borderDis = 0;
  4032. obj.kickAngle = 180;
  4033. let b = obj.gameObj;
  4034. let wbp = this.rootPos;
  4035. let bx = wbp.x - b.x;
  4036. let by = wbp.y - b.y;
  4037. obj.borderDis = xGame.tools.random(0, 100);
  4038. this.kickBall.push(obj);
  4039. if (!this.isLine(wbp, obj))
  4040. continue;
  4041. obj.kickAngle = xGame.tools.random(90, 180);
  4042. obj.kickPos.x = b.x;
  4043. obj.kickPos.y = b.y;
  4044. this.lineBall.push(obj);
  4045. let minDis = 999999;
  4046. let hole = false;
  4047. for (let j = 0; j < holes.length; j++) {
  4048. let hp = holes[j];
  4049. if (bx >= 0 && hp.x > b.x + 100)
  4050. continue;
  4051. if (bx <= 0 && hp.x < b.x - 100)
  4052. continue;
  4053. if (by < -10 && hp.y < wbp.y)
  4054. continue;
  4055. if (by > 10 && hp.y > wbp.y)
  4056. continue;
  4057. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4058. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4059. if (dis < minDis) {
  4060. let dx = b.x - this.tempDir1.x * this.ballSize;
  4061. let dy = b.y - this.tempDir1.y * this.ballSize;
  4062. this.tempDir3.x = this.tempDir1.x;
  4063. this.tempDir3.y = this.tempDir1.y;
  4064. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4065. obj.kickPos.x = dx;
  4066. obj.kickPos.y = dy;
  4067. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4068. if (num > 1)
  4069. num = 1;
  4070. obj.kickAngle = Math.acos(num) * 57.3;
  4071. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4072. dis = dis * 2;
  4073. if (Math.abs(hp.x - 600) < 100)
  4074. dis += 50;
  4075. obj.hard = dis + obj.kickAngle * 3;
  4076. hole = true;
  4077. }
  4078. }
  4079. }
  4080. }
  4081. if (hole) {
  4082. this.scoreBall.push(obj);
  4083. this.holeBall.push(obj);
  4084. }
  4085. }
  4086. this.scoreBall.sort(function (a, b) {
  4087. return a.hard - b.hard;
  4088. });
  4089. this.holeBall.sort(function (a, b) {
  4090. return a.kickAngle - b.kickAngle;
  4091. });
  4092. this.kickBall.sort(function (a, b) {
  4093. return a.borderDis - b.borderDis;
  4094. });
  4095. }
  4096. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4097. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4098. let balls = xGame.common.d2World.ballArr;
  4099. let max = xGame.tools.getDis(hx, hy, bx, by);
  4100. for (let index = 0; index < balls.length; index++) {
  4101. let obj = balls[index];
  4102. if (obj.number == 0)
  4103. continue;
  4104. if (obj.number == bn || obj.number == dn)
  4105. continue;
  4106. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4107. if (dis * dis > max)
  4108. continue;
  4109. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4110. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4111. if (num > 1)
  4112. num = 1;
  4113. if (num < 0)
  4114. continue;
  4115. let gap = Math.sin(Math.acos(num)) * dis;
  4116. if (gap < this.ballSize)
  4117. return true;
  4118. }
  4119. return false;
  4120. }
  4121. isLine(xy, ball) {
  4122. let bx = xy.x;
  4123. let by = xy.y;
  4124. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4125. let dis = ball.getDestDis(xy);
  4126. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4127. let sin = Math.sin(angle);
  4128. let cos = Math.cos(angle);
  4129. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4130. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4131. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4132. let dx = bx + this.tempDir2.x * dis;
  4133. let dy = by + this.tempDir2.y * dis;
  4134. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4135. sin = Math.sin(-angle);
  4136. cos = Math.cos(-angle);
  4137. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4138. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4139. dx = bx + this.tempDir2.x * dis;
  4140. dy = by + this.tempDir2.y * dis;
  4141. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4142. if (isr && isl)
  4143. return false;
  4144. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4145. }
  4146. return true;
  4147. }
  4148. setKick(dx, dy) {
  4149. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4150. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4151. this.tempDir1.x = 0;
  4152. this.tempDir1.y = 1;
  4153. this.tempDir2.y = -this.tempDir2.y;
  4154. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4155. if (num > 1)
  4156. num = 1;
  4157. let rot = Math.acos(num) * 57.3;
  4158. if (this.tempDir2.x < 0)
  4159. rot = 360 - rot;
  4160. this.destRot += rot;
  4161. }
  4162. }
  4163. class ui_UIGame extends fgui.GComponent {
  4164. static createInstance() {
  4165. return (fgui.UIPackage.createObject("game", "UIGame"));
  4166. }
  4167. onConstruct() {
  4168. this.c1 = this.getController("c1");
  4169. this.d3Root = (this.getChild("d3Root"));
  4170. this.clickNode = (this.getChild("clickNode"));
  4171. this.d2Root = (this.getChild("d2Root"));
  4172. this.topNode = (this.getChild("topNode"));
  4173. this.n72 = (this.getChild("n72"));
  4174. this.n40 = (this.getChild("n40"));
  4175. this.rulerNode = (this.getChild("rulerNode"));
  4176. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4177. this.n50 = (this.getChild("n50"));
  4178. this.keduNode = (this.getChild("keduNode"));
  4179. this.powerTxt = (this.getChild("powerTxt"));
  4180. this.powerNode = (this.getChild("powerNode"));
  4181. this.colorNode = (this.getChild("colorNode"));
  4182. this.powerEft = (this.getChild("powerEft"));
  4183. this.myPowerNode = (this.getChild("myPowerNode"));
  4184. this.ganNode = (this.getChild("ganNode"));
  4185. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4186. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4187. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4188. this.skillRod = (this.getChild("skillRod"));
  4189. this.border = (this.getChild("border"));
  4190. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4191. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4192. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4193. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4194. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4195. this.guanyuNode = (this.getChild("guanyuNode"));
  4196. this.helpBtn = (this.getChild("helpBtn"));
  4197. this.wordsBtn = (this.getChild("wordsBtn"));
  4198. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4199. this.returnBtn = (this.getChild("returnBtn"));
  4200. this.ballNode = (this.getChild("ballNode"));
  4201. this.whiteAni = (this.getChild("whiteAni"));
  4202. this.blackAni = (this.getChild("blackAni"));
  4203. this.selfTurn = (this.getChild("selfTurn"));
  4204. this.aiTurn = (this.getChild("aiTurn"));
  4205. this.deskNode = (this.getChild("deskNode"));
  4206. this.moveNode = (this.getChild("moveNode"));
  4207. this.selfTalk = (this.getChild("selfTalk"));
  4208. this.aiTalk = (this.getChild("aiTalk"));
  4209. this.d2Node = (this.getChild("d2Node"));
  4210. this.snowNode = (this.getChild("snowNode"));
  4211. this.guide2 = (this.getChild("guide2"));
  4212. this.guide1 = (this.getChild("guide1"));
  4213. this.guide3 = (this.getChild("guide3"));
  4214. this.guideNode = (this.getChild("guideNode"));
  4215. }
  4216. }
  4217. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4218. class ui_UIGameEnd extends fgui.GComponent {
  4219. static createInstance() {
  4220. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4221. }
  4222. onConstruct() {
  4223. this.c1 = this.getController("c1");
  4224. this.n22 = (this.getChild("n22"));
  4225. this.n2 = (this.getChild("n2"));
  4226. this.n52 = (this.getChild("n52"));
  4227. this.n53 = (this.getChild("n53"));
  4228. this.coinNode = (this.getChild("coinNode"));
  4229. this.closeNode = (this.getChild("closeNode"));
  4230. this.moneyNode = (this.getChild("moneyNode"));
  4231. this.secretary = (this.getChild("secretary"));
  4232. this.n27 = (this.getChild("n27"));
  4233. this.n29 = (this.getChild("n29"));
  4234. this.talkNode = (this.getChild("talkNode"));
  4235. this.n38 = (this.getChild("n38"));
  4236. this.n39 = (this.getChild("n39"));
  4237. this.n40 = (this.getChild("n40"));
  4238. this.awardNode = (this.getChild("awardNode"));
  4239. this.starNumNode = (this.getChild("starNumNode"));
  4240. this.n47 = (this.getChild("n47"));
  4241. this.conditionNode = (this.getChild("conditionNode"));
  4242. this.isGetAward = (this.getChild("isGetAward"));
  4243. this.leftBtn = (this.getChild("leftBtn"));
  4244. this.rightBtn = (this.getChild("rightBtn"));
  4245. this.btnNode = (this.getChild("btnNode"));
  4246. }
  4247. }
  4248. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4249. class ui_UIAddCoin extends fgui.GComponent {
  4250. static createInstance() {
  4251. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4252. }
  4253. onConstruct() {
  4254. this.n11 = (this.getChild("n11"));
  4255. this.myNode = (this.getChild("myNode"));
  4256. this.t0 = this.getTransition("t0");
  4257. }
  4258. }
  4259. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4260. class UIAddCoin extends UIBase {
  4261. constructor() {
  4262. super();
  4263. this.coinNum = 2000;
  4264. }
  4265. onConstructor() {
  4266. this.ui = ui_UIAddCoin.createInstance();
  4267. this.contentPane = this.ui;
  4268. this.isEject = false;
  4269. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4270. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4271. }
  4272. show() {
  4273. super.show();
  4274. this.ui.t0.play();
  4275. }
  4276. videoAddCoin() {
  4277. console.log('zh:qjff_AD_for_UIAddCoin');
  4278. if (Laya.Browser.onAndroid) {
  4279. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4280. if (!boo) {
  4281. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4282. return;
  4283. }
  4284. }
  4285. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4286. }
  4287. else {
  4288. console.log('zh:AD 失败,直接发放奖励');
  4289. this.qjff_AD_for_UIAddCoin();
  4290. }
  4291. }
  4292. qjff_AD_for_UIAddCoin() {
  4293. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4294. this.hide();
  4295. }
  4296. }
  4297. UIAddCoin.uiName = "UIAddCoin";
  4298. class ui_UIInvitation extends fgui.GComponent {
  4299. static createInstance() {
  4300. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4301. }
  4302. onConstruct() {
  4303. this.n14 = (this.getChild("n14"));
  4304. this.myNode = (this.getChild("myNode"));
  4305. this.t0 = this.getTransition("t0");
  4306. }
  4307. }
  4308. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4309. class UIInvitation extends UIBase {
  4310. constructor() {
  4311. super();
  4312. }
  4313. onConstructor() {
  4314. this.ui = ui_UIInvitation.createInstance();
  4315. this.contentPane = this.ui;
  4316. this.isEject = false;
  4317. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4318. }
  4319. show() {
  4320. super.show();
  4321. }
  4322. enterGame() {
  4323. xGame.common.gameMode = GameMode.classic;
  4324. DataMgr.setChallengeTimes(1);
  4325. xGame.common.passAwardCoin = 2000;
  4326. let need = xGame.common.classicNiceNeddCoin;
  4327. if (DataMgr.coinEnough(need)) {
  4328. DataMgr.setCoin(-need);
  4329. xGame.eventMgr.event(RESTART_GAME, true);
  4330. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4331. }
  4332. else {
  4333. xGame.eventMgr.event(RESTART_GAME, true);
  4334. }
  4335. this.hide();
  4336. }
  4337. hide() {
  4338. super.hide();
  4339. }
  4340. }
  4341. UIInvitation.uiName = "UIInvitation";
  4342. class ui_UIMain extends fgui.GComponent {
  4343. static createInstance() {
  4344. return (fgui.UIPackage.createObject("game", "UIMain"));
  4345. }
  4346. onConstruct() {
  4347. this.n47 = (this.getChild("n47"));
  4348. this.n10 = (this.getChild("n10"));
  4349. this.secretary = (this.getChild("secretary"));
  4350. this.shopBtn = (this.getChild("shopBtn"));
  4351. this.moneyNode = (this.getChild("moneyNode"));
  4352. this.headNode = (this.getChild("headNode"));
  4353. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4354. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4355. this.classicBtn = (this.getChild("classicBtn"));
  4356. this.globalBtn = (this.getChild("globalBtn"));
  4357. this.n44 = (this.getChild("n44"));
  4358. this.signBtn = (this.getChild("signBtn"));
  4359. this.drawBtn = (this.getChild("drawBtn"));
  4360. this.settingNode = (this.getChild("settingNode"));
  4361. this.n45 = (this.getChild("n45"));
  4362. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4363. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4364. this.rankBtn = (this.getChild("rankBtn"));
  4365. this.n46 = (this.getChild("n46"));
  4366. this.liucheng1 = (this.getChild("liucheng1"));
  4367. this.rightBtn = (this.getChild("rightBtn"));
  4368. this.n75 = (this.getChild("n75"));
  4369. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4370. this.liucheng2 = (this.getChild("liucheng2"));
  4371. this.guideBtn = (this.getChild("guideBtn"));
  4372. this.n73 = (this.getChild("n73"));
  4373. this.wordsNode = (this.getChild("wordsNode"));
  4374. this.enterGuide = (this.getChild("enterGuide"));
  4375. this.talkNode = (this.getChild("talkNode"));
  4376. this.n83 = (this.getChild("n83"));
  4377. this.n84 = (this.getChild("n84"));
  4378. this.n_Logout = (this.getChild("n_Logout"));
  4379. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4380. this.n_dengLu = (this.getChild("n_dengLu"));
  4381. }
  4382. }
  4383. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4384. class ui_UIMoyu extends fgui.GComponent {
  4385. static createInstance() {
  4386. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4387. }
  4388. onConstruct() {
  4389. this.ageTip = (this.getChild("ageTip"));
  4390. this.mainBg = (this.getChild("mainBg"));
  4391. this.xyNode = (this.getChild("xyNode"));
  4392. this.rnNode = (this.getChild("rnNode"));
  4393. this.fcmNode = (this.getChild("fcmNode"));
  4394. this.ageNode = (this.getChild("ageNode"));
  4395. this.tipNode = (this.getChild("tipNode"));
  4396. this.msgNode = (this.getChild("msgNode"));
  4397. }
  4398. }
  4399. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4400. class MoyuMgr {
  4401. static initMoyu() {
  4402. this.moyuView = new MoyuView();
  4403. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4404. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4405. this.moyuView.ui.displayObject.zOrder = 1000;
  4406. this.moyuView.init();
  4407. this.moyuView.showTip(true);
  4408. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4409. window['XApk'] = this;
  4410. }
  4411. static showAge(show) {
  4412. if (this.moyuView)
  4413. this.moyuView.showAge(show);
  4414. }
  4415. static onPlatMsg(idx) {
  4416. if (!MoyuMgr.moyuView)
  4417. return;
  4418. if (idx == '0') {
  4419. MoyuMgr.moyuView.showTip(false);
  4420. }
  4421. }
  4422. static showAgree(call) {
  4423. if (this.moyuView)
  4424. this.moyuView.showAgree(call);
  4425. else
  4426. call && call();
  4427. }
  4428. static showXy(type = 1) {
  4429. if (this.moyuView)
  4430. this.moyuView.showXy(type);
  4431. }
  4432. }
  4433. MoyuMgr.isAdvise = false;
  4434. class MoyuView {
  4435. constructor() {
  4436. this.ysxyNum = 1;
  4437. this.ysJson = null;
  4438. this.ui = ui_UIMoyu.createInstance();
  4439. }
  4440. init() {
  4441. this.ui.mainBg.visible = false;
  4442. this.ui.xyNode.visible = false;
  4443. this.ui.ageNode.visible = false;
  4444. this.ui.tipNode.visible = false;
  4445. this.ui.rnNode.visible = false;
  4446. this.ui.fcmNode.visible = false;
  4447. this.ui.ageTip.visible = false;
  4448. this.ui.msgNode.visible = false;
  4449. this.ui.visible = false;
  4450. this.ui.xyNode.xyList.setVirtual();
  4451. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4452. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4453. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4454. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4455. this.ui.xyNode.btnKnown.visible = false;
  4456. this.ui.xyNode.xy1.visible = false;
  4457. this.ui.xyNode.xy2.visible = false;
  4458. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4459. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4460. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4461. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4462. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4463. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4464. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4465. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4466. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4467. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4468. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4469. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4470. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4471. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4472. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4473. this.ysxyNum = 2;
  4474. }
  4475. }
  4476. onClick(obj) {
  4477. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4478. switch (obj) {
  4479. case this.ui.ageTip:
  4480. if (Moyu.isTTApk) {
  4481. this.ui.ageNode.visible = true;
  4482. this.ui.mainBg.visible = true;
  4483. }
  4484. break;
  4485. case this.ui.tipNode:
  4486. this.showTip(false);
  4487. break;
  4488. case this.ui.ageNode.btnAge:
  4489. this.ui.ageNode.visible = false;
  4490. this.ui.mainBg.visible = false;
  4491. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4492. this.ui.visible = false;
  4493. break;
  4494. case this.ui.xyNode.btnXy3:
  4495. case this.ui.xyNode.btnXy1:
  4496. this.loadXy(1);
  4497. break;
  4498. case this.ui.xyNode.btnXy2:
  4499. this.loadXy(2);
  4500. break;
  4501. case this.ui.xyNode.btnBack:
  4502. this.ui.xyNode.xy1.visible = true;
  4503. this.ui.xyNode.xy2.visible = false;
  4504. break;
  4505. case this.ui.xyNode.btnKnown:
  4506. this.ui.xyNode.visible = false;
  4507. this.ui.mainBg.visible = false;
  4508. this.ui.visible = false;
  4509. break;
  4510. case this.ui.rnNode.btnCheck:
  4511. this.check();
  4512. break;
  4513. case this.ui.rnNode.btnExit:
  4514. case this.ui.xyNode.btnNo:
  4515. this.ysxyNum--;
  4516. if (this.ysxyNum > 0)
  4517. this.showMsg("Refuse to quit the game once again");
  4518. else {
  4519. Moyu.userAgree(false);
  4520. Moyu.exit();
  4521. }
  4522. break;
  4523. case this.ui.xyNode.btnSure:
  4524. case this.ui.xyNode.btnYes:
  4525. DataMgr.userData.isAgree = true;
  4526. DataMgr.saveUserData();
  4527. this.onAgree();
  4528. break;
  4529. case this.ui.rnNode.btnDone:
  4530. this.ui.rnNode.visible = false;
  4531. this.ui.visible = false;
  4532. break;
  4533. case this.ui.fcmNode.btnRn:
  4534. this.showRn();
  4535. break;
  4536. }
  4537. }
  4538. showTip(show) {
  4539. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4540. return;
  4541. if (show) {
  4542. MoyuMgr.isAdvise = true;
  4543. this.ui.visible = true;
  4544. this.ui.tipNode.visible = true;
  4545. this.ui.tipNode.alpha = 1;
  4546. Laya.timer.once(1000, this, this.showTip, [false]);
  4547. }
  4548. else {
  4549. this.ui.tipNode.alpha = 1;
  4550. this.ui.tipNode.visible = true;
  4551. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4552. this.ui.tipNode.visible = false;
  4553. MoyuMgr.isAdvise = false;
  4554. }), 1000);
  4555. }
  4556. }
  4557. showAge(show, px = 0, py = 0) {
  4558. if (Moyu.platType > 10 && !Moyu.isIos) {
  4559. this.ui.ageTip.x = px;
  4560. this.ui.ageTip.y = py;
  4561. this.ui.ageTip.visible = show;
  4562. if (show)
  4563. this.ui.visible = true;
  4564. }
  4565. }
  4566. showAgree(call) {
  4567. this.agreeCall = call;
  4568. this.onAgree();
  4569. return;
  4570. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4571. this.showXy(0);
  4572. }
  4573. else
  4574. this.onAgree();
  4575. }
  4576. onAgree() {
  4577. if (!this.ui.ageNode.visible)
  4578. this.ui.visible = false;
  4579. this.ui.xyNode.visible = false;
  4580. Moyu.userAgree(true);
  4581. this.showAge(false);
  4582. this.agreeCall && this.agreeCall();
  4583. this.showRn();
  4584. }
  4585. showMsg(txt) {
  4586. this.ui.msgNode.txtMsg.text = txt;
  4587. this.ui.msgNode.visible = true;
  4588. this.ui.msgNode.alpha = 1;
  4589. this.ui.visible = true;
  4590. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4591. this.ui.msgNode.visible = false;
  4592. }), 2500, true);
  4593. }
  4594. showRn() {
  4595. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4596. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4597. this.ui.rnNode.rn1.visible = true;
  4598. this.ui.rnNode.rn2.visible = false;
  4599. this.ui.rnNode.rn3.visible = false;
  4600. this.ui.rnNode.rn4.visible = false;
  4601. this.ui.rnNode.visible = true;
  4602. this.ui.mainBg.visible = true;
  4603. this.ui.rnNode.btnDone.visible = false;
  4604. this.ui.rnNode.btnExit.visible = true;
  4605. this.ui.rnNode.btnCheck.visible = true;
  4606. this.ui.fcmNode.visible = false;
  4607. this.ui.visible = true;
  4608. return;
  4609. }
  4610. }
  4611. this.showFcm();
  4612. }
  4613. showFcm() {
  4614. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4615. Moyu.initFCM(true);
  4616. if (Moyu.gameTime < 1)
  4617. this.fcmLoop();
  4618. else if (Moyu.gameTime < 999)
  4619. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4620. }
  4621. }
  4622. fcmLoop() {
  4623. if (Moyu.gameTime < 1) {
  4624. this.ui.rnNode.visible = false;
  4625. this.ui.fcmNode.visible = true;
  4626. this.ui.mainBg.visible = true;
  4627. this.ui.visible = true;
  4628. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4629. Laya.timer.clear(this.ui, this.fcmLoop);
  4630. }
  4631. }
  4632. check() {
  4633. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4634. this.ui.rnNode.rn1.visible = false;
  4635. this.ui.rnNode.rn2.visible = false;
  4636. this.ui.rnNode.rn4.visible = true;
  4637. }
  4638. else if (this.ui.rnNode.rn4.visible) {
  4639. let name = this.ui.rnNode.inputName.text;
  4640. let code = this.ui.rnNode.inputCode.text;
  4641. if (code && code.length == 18) {
  4642. this.ui.rnNode.rn1.visible = false;
  4643. this.ui.rnNode.rn4.visible = false;
  4644. Moyu.authenticate(name, code, (res) => {
  4645. this.ui.rnNode.rn2.visible = !res;
  4646. this.ui.rnNode.rn3.visible = res;
  4647. this.ui.rnNode.btnDone.visible = res;
  4648. this.ui.rnNode.btnExit.visible = !res;
  4649. this.ui.rnNode.btnCheck.visible = !res;
  4650. if (res)
  4651. this.showFcm();
  4652. });
  4653. }
  4654. else
  4655. this.showMsg("信息填写不完整");
  4656. }
  4657. }
  4658. loadXy(type = 0) {
  4659. this.ui.xyNode.xy1.visible = false;
  4660. this.ui.xyNode.xy2.visible = true;
  4661. this.ui.xyNode.xyList.scrollToView(0);
  4662. if (type == 1) {
  4663. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4664. }
  4665. else if (type == 2) {
  4666. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4667. }
  4668. }
  4669. showXy(type = 0) {
  4670. this.xyBtn();
  4671. if (type == 0) {
  4672. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4673. this.ui.xyNode.btnSure.visible = true;
  4674. }
  4675. else {
  4676. this.ui.xyNode.btnYes.visible = true;
  4677. this.ui.xyNode.btnNo.visible = true;
  4678. }
  4679. }
  4680. else {
  4681. this.ui.xyNode.btnKnown.visible = true;
  4682. this.ui.mainBg.visible = true;
  4683. }
  4684. this.ui.xyNode.xy1.visible = true;
  4685. this.ui.xyNode.xy2.visible = false;
  4686. this.ui.xyNode.visible = true;
  4687. this.ui.visible = true;
  4688. }
  4689. xyBtn() {
  4690. this.ui.xyNode.btnSure.visible = false;
  4691. this.ui.xyNode.btnYes.visible = false;
  4692. this.ui.xyNode.btnNo.visible = false;
  4693. this.ui.xyNode.btnKnown.visible = false;
  4694. {
  4695. this.ui.xyNode.btnXy3.visible = false;
  4696. this.ui.xyNode.btnXy2.visible = true;
  4697. this.ui.xyNode.btnXy1.visible = true;
  4698. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4699. }
  4700. }
  4701. createXY(json) {
  4702. this.ysJson = json.content;
  4703. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4704. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4705. this.ui.xyNode.xy2.visible = true;
  4706. }
  4707. renderListItem(idx, cell) {
  4708. let xy = this.ysJson[idx];
  4709. cell.height = xy.line * 30;
  4710. cell.xyItem.text = xy.text;
  4711. }
  4712. onDestroy() {
  4713. this.agreeCall = null;
  4714. }
  4715. }
  4716. class SettingNode {
  4717. constructor(ui) {
  4718. this.showSetting = false;
  4719. this.openSound = true;
  4720. this.openShake = true;
  4721. this.ui = ui;
  4722. this.ui.soundBtn.onClick(this, this.switchSound);
  4723. this.ui.shakeBtn.onClick(this, this.switchShake);
  4724. this.ui.xyBtn.onClick(this, this.onXy);
  4725. this.ui.clickNode.onClick(this, this.changeSetting);
  4726. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4727. this.ui.xyBtn.visible = false;
  4728. this.ui.shakeBtn.visible = false;
  4729. }
  4730. changeSetting() {
  4731. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4732. this.showSetting = !this.showSetting;
  4733. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4734. }
  4735. switchSound() {
  4736. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4737. this.openSound = !this.openSound;
  4738. Moyu.onSetting(this.openSound, this.openShake);
  4739. xGame.soundMgr.onSetting(this.openSound);
  4740. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4741. }
  4742. switchShake() {
  4743. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4744. this.openShake = !this.openShake;
  4745. Moyu.onSetting(this.openSound, this.openShake);
  4746. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4747. }
  4748. onXy() {
  4749. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4750. MoyuMgr.showXy(1);
  4751. }
  4752. }
  4753. class ui_UILevelDisplay extends fgui.GComponent {
  4754. static createInstance() {
  4755. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4756. }
  4757. onConstruct() {
  4758. this.n9 = (this.getChild("n9"));
  4759. this.myNode = (this.getChild("myNode"));
  4760. this.closeNode = (this.getChild("closeNode"));
  4761. }
  4762. }
  4763. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4764. class ui_UILevelProp extends fgui.GComponent {
  4765. static createInstance() {
  4766. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4767. }
  4768. onConstruct() {
  4769. this.n16 = (this.getChild("n16"));
  4770. this.myNode = (this.getChild("myNode"));
  4771. this.closeBtn = (this.getChild("closeBtn"));
  4772. this.moneyNode = (this.getChild("moneyNode"));
  4773. this.t1 = this.getTransition("t1");
  4774. }
  4775. }
  4776. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4777. class ui_ShowItem extends fgui.GComponent {
  4778. static createInstance() {
  4779. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4780. }
  4781. onConstruct() {
  4782. this.myImg = (this.getChild("myImg"));
  4783. }
  4784. }
  4785. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4786. class ShowItem {
  4787. constructor() {
  4788. this.ui = ui_ShowItem.createInstance();
  4789. }
  4790. destroySelf() {
  4791. if (!this.ui.isDisposed) {
  4792. this.ui.removeFromParent();
  4793. this.ui.dispose();
  4794. }
  4795. }
  4796. setParent(parent) {
  4797. parent.addChild(this.ui);
  4798. }
  4799. setPos(x, y) {
  4800. this.ui.x = x;
  4801. this.ui.y = y;
  4802. }
  4803. setUrl(index) {
  4804. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4805. }
  4806. }
  4807. class ui_UIPower extends fgui.GComponent {
  4808. static createInstance() {
  4809. return (fgui.UIPackage.createObject("game", "UIPower"));
  4810. }
  4811. onConstruct() {
  4812. this.n11 = (this.getChild("n11"));
  4813. this.myNode = (this.getChild("myNode"));
  4814. this.t0 = this.getTransition("t0");
  4815. }
  4816. }
  4817. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4818. class UIPower extends UIBase {
  4819. constructor() {
  4820. super();
  4821. }
  4822. onConstructor() {
  4823. this.ui = ui_UIPower.createInstance();
  4824. this.contentPane = this.ui;
  4825. this.isEject = false;
  4826. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4827. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4828. }
  4829. show() {
  4830. super.show();
  4831. this.ui.t0.play();
  4832. }
  4833. videoGetPower() {
  4834. console.log('zh:qjff_AD_for_uipower');
  4835. if (Laya.Browser.onAndroid) {
  4836. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4837. if (!boo) {
  4838. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4839. return;
  4840. }
  4841. }
  4842. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4843. }
  4844. else {
  4845. console.log('zh:AD 失败,直接发放奖励');
  4846. this.qjff_AD_for_uipower();
  4847. }
  4848. }
  4849. qjff_AD_for_uipower() {
  4850. DataMgr.setPower(xGame.common.videoPower, true);
  4851. xGame.eventMgr.event(POWER_TIME);
  4852. this.hide();
  4853. }
  4854. }
  4855. UIPower.uiName = "UIPower";
  4856. class LocalStorageManager {
  4857. test1() {
  4858. LocalStorageManager.setItem("playerName", "Tom");
  4859. LocalStorageManager.setItem("playerLevel", 5);
  4860. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4861. const name = LocalStorageManager.getItem("playerName");
  4862. const level = LocalStorageManager.getItem("playerLevel");
  4863. const data = LocalStorageManager.getItem("playerData");
  4864. console.log(name);
  4865. console.log(level);
  4866. console.log(data);
  4867. LocalStorageManager.removeItem("playerLevel");
  4868. }
  4869. static setItem(key, value) {
  4870. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4871. }
  4872. static getItem(key) {
  4873. const data = Laya.LocalStorage.getItem(key);
  4874. if (data === null)
  4875. return null;
  4876. try {
  4877. return JSON.parse(data);
  4878. }
  4879. catch (e) {
  4880. return data;
  4881. }
  4882. }
  4883. static removeItem(key) {
  4884. Laya.LocalStorage.removeItem(key);
  4885. }
  4886. static clear() {
  4887. Laya.LocalStorage.clear();
  4888. }
  4889. static hasJosnKey(key) {
  4890. var value = Laya.LocalStorage.getJSON(key);
  4891. if (value != null) {
  4892. return true;
  4893. }
  4894. else {
  4895. return false;
  4896. }
  4897. }
  4898. static hasKey(key) {
  4899. return Laya.LocalStorage.getItem(key) !== null;
  4900. }
  4901. }
  4902. class UILevelProp extends UIBase {
  4903. constructor() {
  4904. super();
  4905. this.firstPos = 385;
  4906. this.secondPos = 467;
  4907. this.showItemArr = [];
  4908. }
  4909. onFontLoaded() {
  4910. try {
  4911. this.ui.myNode.conditionTxt.font = "arial";
  4912. console.log("zh: onFontLoaded 设置arial字体成功");
  4913. }
  4914. catch (error) {
  4915. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4916. }
  4917. }
  4918. onConstructor() {
  4919. this.ui = ui_UILevelProp.createInstance();
  4920. this.contentPane = this.ui;
  4921. this.isEject = false;
  4922. this.addUIClick(this.ui.closeBtn, this.hide);
  4923. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4924. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4925. }
  4926. show(level) {
  4927. super.show();
  4928. this.ui.t1.play();
  4929. this.level = level;
  4930. this.data = cfgTable.placeballData[this.level];
  4931. this.updateSelf();
  4932. this.showPreView();
  4933. this.moneyNode.ui.c1.selectedIndex = 2;
  4934. this.moneyNode.checkPowerTime();
  4935. this.moneyNode.powerChange();
  4936. }
  4937. showPreView() {
  4938. let item;
  4939. let data;
  4940. for (let index = 0; index < this.showItemArr.length; index++) {
  4941. item = this.showItemArr[index];
  4942. item.destroySelf();
  4943. }
  4944. this.showItemArr = [];
  4945. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4946. for (const key in cfgData) {
  4947. data = cfgData[key];
  4948. item = new ShowItem();
  4949. item.setParent(this.ui.myNode.displayRoot);
  4950. item.setPos(data.x, data.y);
  4951. item.setUrl(data.value);
  4952. this.showItemArr.push(item);
  4953. }
  4954. }
  4955. updateSelf() {
  4956. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4957. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4958. if (this.data.ball == -1) {
  4959. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  4960. }
  4961. else {
  4962. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  4963. }
  4964. let localData = DataMgr.getPlaceBallLevel(this.level);
  4965. let getAward = localData.getAward;
  4966. let cfg = cfgTable.placeballData[this.level];
  4967. let coin = this.data.award[0];
  4968. let diamond = this.data.award[1];
  4969. if (cfg.type == PlaceBallType.challenge) {
  4970. diamond = 0;
  4971. coin = 100;
  4972. }
  4973. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  4974. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  4975. this.ui.myNode.coinNode.numTxt.text = coin + "";
  4976. if (cfg.type == PlaceBallType.challenge) {
  4977. this.ui.myNode.coinNode.numTxt.text = "";
  4978. }
  4979. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  4980. if (coin > 0 && diamond > 0) {
  4981. this.ui.myNode.diamondNode.x = 385;
  4982. this.ui.myNode.coinNode.x = 467;
  4983. }
  4984. else {
  4985. this.ui.myNode.diamondNode.x = 385;
  4986. this.ui.myNode.coinNode.x = 385;
  4987. }
  4988. if (!getAward) {
  4989. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  4990. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  4991. }
  4992. else {
  4993. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  4994. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  4995. }
  4996. }
  4997. startGame() {
  4998. if (DataMgr.powerEnough()) {
  4999. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5000. this.ui.myNode.startBtn.touchable = false;
  5001. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5002. console.log('zh:startGame ');
  5003. this.ui.myNode.startBtn.touchable = true;
  5004. DataMgr.setPower(-1);
  5005. xGame.eventMgr.event(POWER_TIME);
  5006. xGame.common.gameMode = GameMode.placeBall;
  5007. xGame.common.placeBallCurLevel = this.level;
  5008. xGame.uiMgr.Show(UIGame);
  5009. this.logEventForChallenge_level_start(this.level);
  5010. xGame.uiMgr.Hide(UILevelDisplay);
  5011. xGame.uiMgr.Hide(UIMain);
  5012. this.hide();
  5013. }));
  5014. }
  5015. else {
  5016. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5017. xGame.uiMgr.Show(UIPower);
  5018. }
  5019. }
  5020. logEventForChallenge_level_start(level) {
  5021. let keyStr = 'sjmd_challenge_level_start';
  5022. let jsonStr = {
  5023. "count": 1,
  5024. "gold_balance ": DataMgr.getCoin(),
  5025. "level": level,
  5026. "diamond_balance ": DataMgr.getDiamond()
  5027. };
  5028. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5029. const d = LocalStorageManager.getItem(keyStr);
  5030. if (level > d.level) {
  5031. jsonStr.count = d.count + 1;
  5032. LocalStorageManager.setItem(keyStr, jsonStr);
  5033. }
  5034. else {
  5035. }
  5036. }
  5037. else {
  5038. LocalStorageManager.setItem(keyStr, jsonStr);
  5039. }
  5040. const reqStr = JSON.stringify(jsonStr);
  5041. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5042. }
  5043. hide() {
  5044. super.hide();
  5045. }
  5046. }
  5047. UILevelProp.uiName = "UILevelProp";
  5048. class PutBallLevelDisplay {
  5049. constructor(ui, index) {
  5050. this.index = 0;
  5051. this.ui = ui;
  5052. this.index = index;
  5053. this.ui.onClick(this, this.clickSelf);
  5054. this.updateSelf();
  5055. this.ui.levelTxt.text = (this.index + 1) + "";
  5056. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5057. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5058. }
  5059. updateSelf() {
  5060. let level = this.index + 1;
  5061. this.data = DataMgr.getPlaceBallLevel(level);
  5062. this.ui.starNode.c1.selectedIndex = this.data.star;
  5063. let isChallenge = cfgTable.placeballData[level].type;
  5064. if (this.data.isCur) {
  5065. if (isChallenge) {
  5066. this.ui.c1.selectedIndex = 5;
  5067. }
  5068. else {
  5069. this.ui.c1.selectedIndex = 2;
  5070. }
  5071. }
  5072. else {
  5073. if (this.data.play) {
  5074. if (this.data.star == 3) {
  5075. this.ui.c1.selectedIndex = 0;
  5076. }
  5077. else {
  5078. this.ui.c1.selectedIndex = 1;
  5079. }
  5080. }
  5081. else {
  5082. if (isChallenge) {
  5083. this.ui.c1.selectedIndex = 4;
  5084. }
  5085. else {
  5086. this.ui.c1.selectedIndex = 3;
  5087. }
  5088. }
  5089. }
  5090. }
  5091. clickSelf() {
  5092. if (!this.data.play)
  5093. return;
  5094. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5095. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5096. }
  5097. }
  5098. class UILevelDisplay extends UIBase {
  5099. constructor() {
  5100. super();
  5101. }
  5102. onConstructor() {
  5103. this.ui = ui_UILevelDisplay.createInstance();
  5104. this.contentPane = this.ui;
  5105. this.isEject = false;
  5106. this.myList = this.ui.myNode.myList;
  5107. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5108. this.levelItemArr = [];
  5109. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5110. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5111. this.myList.numItems = levelNum;
  5112. if (Moyu.isKs)
  5113. this.ui.closeNode.closeBtn.x += 100;
  5114. }
  5115. levelItemRender(index, target) {
  5116. let item = new PutBallLevelDisplay(target, index);
  5117. this.levelItemArr.push(item);
  5118. }
  5119. show() {
  5120. super.show();
  5121. this.updateLevel();
  5122. this.scrollToPlace();
  5123. }
  5124. updateLevel() {
  5125. let temp;
  5126. for (let index = 0; index < this.levelItemArr.length; index++) {
  5127. temp = this.levelItemArr[index];
  5128. temp.updateSelf();
  5129. }
  5130. }
  5131. scrollToPlace() {
  5132. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5133. let passArr = DataMgr.getPlaceBallLevelList();
  5134. let offest = passArr.length;
  5135. if (offest >= maxNum - 1)
  5136. offest = maxNum - 1;
  5137. this.myList.scrollToView(offest, true, true);
  5138. }
  5139. hide() {
  5140. super.hide();
  5141. }
  5142. }
  5143. UILevelDisplay.uiName = "UILevelDisplay";
  5144. class ui_UIMatching extends fgui.GComponent {
  5145. static createInstance() {
  5146. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5147. }
  5148. onConstruct() {
  5149. this.n5 = (this.getChild("n5"));
  5150. this.n49 = (this.getChild("n49"));
  5151. this.n51 = (this.getChild("n51"));
  5152. this.n64 = (this.getChild("n64"));
  5153. this.n2 = (this.getChild("n2"));
  5154. this.n53 = (this.getChild("n53"));
  5155. this.n54 = (this.getChild("n54"));
  5156. this.n56 = (this.getChild("n56"));
  5157. this.n58 = (this.getChild("n58"));
  5158. this.n59 = (this.getChild("n59"));
  5159. this.n57 = (this.getChild("n57"));
  5160. this.n60 = (this.getChild("n60"));
  5161. this.n62 = (this.getChild("n62"));
  5162. this.awardTxt = (this.getChild("awardTxt"));
  5163. this.n61 = (this.getChild("n61"));
  5164. this.selfHead = (this.getChild("selfHead"));
  5165. this.aiHead = (this.getChild("aiHead"));
  5166. this.n82 = (this.getChild("n82"));
  5167. this.n84 = (this.getChild("n84"));
  5168. this.n83 = (this.getChild("n83"));
  5169. this.t1 = this.getTransition("t1");
  5170. this.t2 = this.getTransition("t2");
  5171. this.t3 = this.getTransition("t3");
  5172. this.t4 = this.getTransition("t4");
  5173. }
  5174. }
  5175. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5176. class UIMatching extends UIBase {
  5177. constructor() {
  5178. super();
  5179. }
  5180. onConstructor() {
  5181. this.ui = ui_UIMatching.createInstance();
  5182. this.contentPane = this.ui;
  5183. this.isEject = false;
  5184. }
  5185. show(callback) {
  5186. super.show();
  5187. PlatMgr.showBanner(true);
  5188. this.callback = callback;
  5189. let user = Moyu.getUserInfo();
  5190. if (!this.selfPot) {
  5191. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5192. }
  5193. if (!this.aiPot) {
  5194. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5195. }
  5196. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5197. this.ui.selfHead.nameTxt.text = user.nickName;
  5198. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5199. this.ui.aiHead.nameTxt.text = "???";
  5200. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5201. this.ui.selfHead.c1.selectedIndex = 0;
  5202. this.ui.aiHead.c1.selectedIndex = 0;
  5203. this.ui.selfHead.x = this.selfPot.x;
  5204. this.ui.selfHead.y = this.selfPot.y;
  5205. this.ui.aiHead.x = this.aiPot.x;
  5206. this.ui.aiHead.y = this.aiPot.y;
  5207. switch (xGame.common.gameMode) {
  5208. case GameMode.classic:
  5209. break;
  5210. case GameMode.bigMove:
  5211. this.initSkillData();
  5212. break;
  5213. default:
  5214. break;
  5215. }
  5216. this.ui.t1.play(Laya.Handler.create(this, () => {
  5217. this.ui.t2.play(Laya.Handler.create(this, () => {
  5218. switch (xGame.common.gameMode) {
  5219. case GameMode.classic:
  5220. this.waitingPeople();
  5221. break;
  5222. case GameMode.bigMove:
  5223. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5224. break;
  5225. default:
  5226. break;
  5227. }
  5228. }));
  5229. }));
  5230. }
  5231. initSkillData() {
  5232. this.skillSelectData = [];
  5233. let skillUrl = xGame.common.skillIconList;
  5234. let skillName = xGame.common.skillNameList;
  5235. let skillLevel = DataMgr.getBigSkillList();
  5236. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5237. for (let index = 0; index < 5; index++) {
  5238. let obj = {};
  5239. obj.skillImg = skillUrl[index];
  5240. obj.skillName = skillName[index];
  5241. obj.skillType = skillType[index];
  5242. obj.skillLevel = skillLevel[index];
  5243. this.skillSelectData.push(obj);
  5244. }
  5245. }
  5246. getAISkillLevel(myLevel) {
  5247. let video = xGame.common.upSkillLevel;
  5248. let aiLevel;
  5249. let temp;
  5250. if (video) {
  5251. temp = xGame.common.randomNum(-2, -1);
  5252. }
  5253. else {
  5254. if (myLevel <= 5) {
  5255. temp = xGame.common.randomNum(1, 3);
  5256. }
  5257. else if (myLevel <= 9) {
  5258. temp = xGame.common.randomNum(-2, 1);
  5259. }
  5260. else {
  5261. temp = xGame.common.randomNum(-4, 0);
  5262. }
  5263. }
  5264. aiLevel = temp + myLevel;
  5265. if (aiLevel <= 1)
  5266. aiLevel = 1;
  5267. if (aiLevel >= 10)
  5268. aiLevel = 10;
  5269. return aiLevel;
  5270. }
  5271. getAISkillType() {
  5272. return xGame.common.randomNum(1, 4);
  5273. let successTimes = DataMgr.getSkillSuccessTimes();
  5274. let info = cfgTable.aiskillData[successTimes];
  5275. if (!info) {
  5276. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5277. info = cfgTable.aiskillData[max];
  5278. }
  5279. let dataArr = info.skillselect;
  5280. let myCfg = {};
  5281. for (let index = 0; index < dataArr.length; index++) {
  5282. let temp = dataArr[index].split('-');
  5283. myCfg[temp[0]] = {};
  5284. myCfg[temp[0]].id = parseInt(temp[0]);
  5285. myCfg[temp[0]].weight = parseInt(temp[1]);
  5286. }
  5287. let aiCfg = xGame.common.initWeight(myCfg);
  5288. let curData = xGame.common.getRandomWeightData(aiCfg);
  5289. return parseInt(curData.id);
  5290. }
  5291. getAISkillData(index) {
  5292. let myLevel = this.skillSelectData[index].skillLevel;
  5293. let aiLevel = this.getAISkillLevel(myLevel);
  5294. let aiType = this.getAISkillType() - 1;
  5295. return { aiLevel, aiType } = { aiLevel, aiType };
  5296. }
  5297. skillSelectFinish(index) {
  5298. let aiInfo = this.getAISkillData(index);
  5299. xGame.common.gameMgr.selfCurSkill = index;
  5300. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5301. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5302. this.ui.selfHead.c1.selectedIndex = 1;
  5303. this.ui.aiHead.c1.selectedIndex = 1;
  5304. let myData = this.skillSelectData[index];
  5305. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5306. let guide = DataMgr.getSkillGuide();
  5307. if (guide == 0) {
  5308. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5309. }
  5310. else {
  5311. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5312. }
  5313. let aiData = this.skillSelectData[aiInfo.aiType];
  5314. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5315. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5316. this.waitingPeople();
  5317. }
  5318. waitingPeople() {
  5319. let time = xGame.common.randomNum(1000, 3000);
  5320. time += 1000;
  5321. Laya.timer.once(time, this, () => {
  5322. this.matchingSuccess();
  5323. });
  5324. }
  5325. matchingSuccess() {
  5326. let gameUI = xGame.common.gameUI;
  5327. let name = gameUI.ui.topNode.aiNameTxt.text;
  5328. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5329. this.ui.aiHead.nameTxt.text = name;
  5330. this.ui.aiHead.headImg.url = url;
  5331. name = gameUI.ui.topNode.selfNameTxt.text;
  5332. url = gameUI.ui.topNode.selfHeadLoader.url;
  5333. this.ui.selfHead.nameTxt.text = name;
  5334. this.ui.selfHead.headImg.url = url;
  5335. this.ui.t3.play(Laya.Handler.create(this, () => {
  5336. this.callback && this.callback();
  5337. this.ui.t4.play(Laya.Handler.create(this, () => {
  5338. this.destroySelf();
  5339. }));
  5340. }));
  5341. }
  5342. destroySelf() {
  5343. this.callback = null;
  5344. this.skillSelectData = null;
  5345. this.selfPot = null;
  5346. this.aiPot = null;
  5347. if (!this.ui.isDisposed) {
  5348. this.ui.removeFromParent();
  5349. this.ui.dispose();
  5350. }
  5351. xGame.uiMgr.destroyUI(this);
  5352. }
  5353. }
  5354. UIMatching.uiName = "UIMatching";
  5355. class ui_UIRanking extends fgui.GComponent {
  5356. static createInstance() {
  5357. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5358. }
  5359. onConstruct() {
  5360. this.n26 = (this.getChild("n26"));
  5361. this.myNode = (this.getChild("myNode"));
  5362. }
  5363. }
  5364. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5365. class UIRanking extends UIBase {
  5366. constructor() {
  5367. super();
  5368. this.showSelf = true;
  5369. this.rankType = 1;
  5370. this.rankList = [];
  5371. this.topX = 10;
  5372. this.myIndex = this.topX + 1;
  5373. this.myStar = 0;
  5374. }
  5375. onConstructor() {
  5376. this.ui = ui_UIRanking.createInstance();
  5377. this.contentPane = this.ui;
  5378. this.isEject = false;
  5379. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5380. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5381. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5382. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5383. this.ui.myNode.myList.setVirtual();
  5384. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5385. }
  5386. show() {
  5387. super.show();
  5388. this.getPaiHangBangDataFormJosnFile();
  5389. this.updateSelf();
  5390. let self = Moyu.getUserInfo();
  5391. if (!self.isAuth) {
  5392. Moyu.initUser(this, () => {
  5393. DataMgr.upRankData();
  5394. });
  5395. }
  5396. }
  5397. getPaiHangBangDataFormJosnFile() {
  5398. const rankingList = cfgTable.paiHangBangData.list;
  5399. this.updateItemData(rankingList);
  5400. }
  5401. updateSelfItem() {
  5402. console.log('zh:Moyu.platType =' + Moyu.platType);
  5403. let self = Moyu.getUserInfo();
  5404. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5405. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5406. if (this.myIndex > this.topX) {
  5407. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5408. }
  5409. else {
  5410. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5411. }
  5412. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5413. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5414. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5415. }
  5416. updateItemData(data) {
  5417. this.myStar = xGame.common.getAllStarNum();
  5418. if (this.rankList.length < 2) {
  5419. this.rankList = data;
  5420. let self = Moyu.getUserInfo();
  5421. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5422. self.headIcon = self.headIcon;
  5423. for (let i = 0; i < data.length; i++) {
  5424. let data = this.rankList[i];
  5425. if (data.userId == self.userId) {
  5426. this.rankList.splice(i, 1);
  5427. break;
  5428. }
  5429. }
  5430. for (let i = 0; i < data.length; i++) {
  5431. let data = this.rankList[i];
  5432. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5433. this.myIndex = i + 1;
  5434. let user = { headIcon: self.headIcon, nickName: "myself" };
  5435. let ud = { user: user, data: {} };
  5436. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5437. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5438. if (Moyu.platType < 11) {
  5439. user.headIcon = self.headIcon;
  5440. user.nickName = self.nickName;
  5441. }
  5442. this.rankList.splice(i, 0, md);
  5443. break;
  5444. }
  5445. }
  5446. }
  5447. this.updateSelfItem();
  5448. this.ui.myNode.myList.numItems = this.rankList.length;
  5449. }
  5450. updateItemUI(index, obj) {
  5451. let data = this.rankList[index];
  5452. let userData = JSON.parse(data.userData).user;
  5453. obj.nameTxt.text = userData.nickName.toString();
  5454. obj.valueTxt.text = data.rankScore;
  5455. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5456. obj.rankTxt.text = index + 1;
  5457. switch (index) {
  5458. case 0:
  5459. this.setImg(obj, 1, 0, 0);
  5460. obj.rankTxt.color = "#FFC047";
  5461. break;
  5462. case 1:
  5463. this.setImg(obj, 0, 1, 0);
  5464. obj.rankTxt.color = "#ACACAC";
  5465. break;
  5466. case 2:
  5467. this.setImg(obj, 0, 0, 1);
  5468. obj.rankTxt.color = "#D09672";
  5469. break;
  5470. default:
  5471. this.setImg(obj, 0, 0, 0);
  5472. obj.rankTxt.color = "#496FAB";
  5473. break;
  5474. }
  5475. }
  5476. setImg(obj, a, b, c) {
  5477. obj.img1.visible = a ? true : false;
  5478. obj.img2.visible = b ? true : false;
  5479. obj.img3.visible = c ? true : false;
  5480. }
  5481. changeList(type) {
  5482. this.rankType = type;
  5483. this.updateSelf();
  5484. }
  5485. changeSelfNode() {
  5486. this.showSelf = !this.showSelf;
  5487. this.updateSelf();
  5488. }
  5489. updateSelf() {
  5490. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5491. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5492. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5493. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5494. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5495. }
  5496. }
  5497. UIRanking.uiName = "UIRanking";
  5498. class ui_UISecretary extends fgui.GComponent {
  5499. static createInstance() {
  5500. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5501. }
  5502. onConstruct() {
  5503. this.n0 = (this.getChild("n0"));
  5504. this.myNode = (this.getChild("myNode"));
  5505. this.closeBtn = (this.getChild("closeBtn"));
  5506. this.t0 = this.getTransition("t0");
  5507. }
  5508. }
  5509. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5510. class UISecretary extends UIBase {
  5511. constructor() {
  5512. super();
  5513. this.curIndex = 1;
  5514. }
  5515. onConstructor() {
  5516. this.ui = ui_UISecretary.createInstance();
  5517. this.contentPane = this.ui;
  5518. this.isEject = false;
  5519. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5520. this.nodeObj = { left: null, right: null, cur: null };
  5521. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5522. }
  5523. show() {
  5524. super.show();
  5525. this.ui.t0.play();
  5526. this.updateData();
  5527. }
  5528. addSecretarySpine(node, spineName) {
  5529. if (spineName == "mishu") {
  5530. if (this.secretarySpine1) {
  5531. node.displayObject.destroyChildren();
  5532. this.playWoman(this.secretarySpine1, node.displayObject);
  5533. }
  5534. else {
  5535. let spine1 = new SpineMgr("mishu", () => {
  5536. this.secretarySpine1 = spine1;
  5537. this.playWoman(this.secretarySpine1, node.displayObject);
  5538. });
  5539. }
  5540. }
  5541. else {
  5542. if (this.secretarySpine2) {
  5543. node.displayObject.destroyChildren();
  5544. this.playWoman(this.secretarySpine2, node.displayObject);
  5545. }
  5546. else {
  5547. let spine2 = new SpineMgr("xiaomishu2", () => {
  5548. this.secretarySpine2 = spine2;
  5549. this.playWoman(this.secretarySpine2, node.displayObject);
  5550. });
  5551. }
  5552. }
  5553. }
  5554. playWoman(node, parent) {
  5555. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5556. let yy = this.ui.myNode.gameNode3.secretary.height;
  5557. let scale = 1.5;
  5558. if (node == this.secretarySpine2) {
  5559. scale = 1.2;
  5560. }
  5561. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5562. node.play(data, 0, true, parent);
  5563. }
  5564. turnLeft() {
  5565. this.curIndex--;
  5566. if (this.curIndex < 1) {
  5567. this.curIndex = 2;
  5568. }
  5569. let left = this.nodeObj.left;
  5570. let right = this.nodeObj.right;
  5571. let cur = this.nodeObj.cur;
  5572. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5573. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5574. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5575. this.updateData();
  5576. }));
  5577. this.ui.myNode.setChildIndex(right, 2);
  5578. this.nodeObj.left = cur;
  5579. this.nodeObj.right = left;
  5580. this.nodeObj.cur = right;
  5581. }
  5582. turnRight() {
  5583. this.curIndex++;
  5584. if (this.curIndex > 2) {
  5585. this.curIndex = 1;
  5586. }
  5587. let left = this.nodeObj.left;
  5588. let right = this.nodeObj.right;
  5589. let cur = this.nodeObj.cur;
  5590. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5591. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5592. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5593. this.updateData();
  5594. }));
  5595. this.ui.myNode.setChildIndex(left, 2);
  5596. this.nodeObj.left = right;
  5597. this.nodeObj.right = cur;
  5598. this.nodeObj.cur = left;
  5599. }
  5600. updateData() {
  5601. console.log('zh: updateData FFFFFFFFFF');
  5602. let data = cfgTable.secretaryshopData;
  5603. let children = this.ui.myNode._children;
  5604. let temp;
  5605. let curData;
  5606. for (let index = 0; index < children.length; index++) {
  5607. temp = children[index];
  5608. curData = data[1];
  5609. temp.heightTxt.text = curData.height;
  5610. temp.foodTxt.text = curData.food;
  5611. temp.historyTxt.text = curData.history;
  5612. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5613. this.addSecretarySpine(temp.secretary, curData.spine);
  5614. let womanIndex = curData.id - 1;
  5615. let getWoman = DataMgr.getSecretary(womanIndex);
  5616. let curUse = DataMgr.getCurSecretary();
  5617. if (getWoman) {
  5618. if (curUse == womanIndex) {
  5619. temp.purchaseBtn.c1.selectedIndex = 1;
  5620. }
  5621. else {
  5622. temp.purchaseBtn.c1.selectedIndex = 2;
  5623. }
  5624. }
  5625. else {
  5626. temp.purchaseBtn.c1.selectedIndex = 0;
  5627. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5628. }
  5629. temp.purchaseBtn.visible = false;
  5630. }
  5631. }
  5632. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5633. console.log('zh: 点击了clickSecretary ');
  5634. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5635. if (getWoman) {
  5636. if (curUse != womanIndex) {
  5637. console.log();
  5638. DataMgr.setCurSecretary(womanIndex);
  5639. this.updateData();
  5640. }
  5641. }
  5642. else {
  5643. console.log('zh:点击购买了');
  5644. let need = needDiamond;
  5645. if (DataMgr.diamondEnough(need)) {
  5646. DataMgr.setDiamond(-need);
  5647. DataMgr.setSecretary(womanIndex, 1);
  5648. DataMgr.setCurSecretary(womanIndex);
  5649. this.updateData();
  5650. }
  5651. else {
  5652. xGame.uiMgr.Show(UIAddProp, 1);
  5653. }
  5654. }
  5655. }
  5656. closeSelf() {
  5657. this.hide();
  5658. }
  5659. }
  5660. UISecretary.uiName = "UISecretary";
  5661. class ui_UIShop extends fgui.GComponent {
  5662. static createInstance() {
  5663. return (fgui.UIPackage.createObject("game", "UIShop"));
  5664. }
  5665. onConstruct() {
  5666. this.n48 = (this.getChild("n48"));
  5667. this.n0 = (this.getChild("n0"));
  5668. this.secretary = (this.getChild("secretary"));
  5669. this.talkNode = (this.getChild("talkNode"));
  5670. this.closeNode = (this.getChild("closeNode"));
  5671. this.moneyNode = (this.getChild("moneyNode"));
  5672. this.myNode = (this.getChild("myNode"));
  5673. }
  5674. }
  5675. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5676. class BallRodDisplay {
  5677. constructor(ui, index) {
  5678. this.index = 0;
  5679. this.uiIndex = 0;
  5680. this.ui = ui;
  5681. this.index = index;
  5682. this.initData();
  5683. }
  5684. initData() {
  5685. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5686. let data = cfgTable.ballrodData[this.index + 1];
  5687. this.ui.nameTxt.text = data.name;
  5688. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5689. this.ui.levelNode.c1.selectedIndex = data.quality;
  5690. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5691. if (data.spine) {
  5692. this.mySpine = new SpineMgr(data.spine, () => {
  5693. let xx = 150;
  5694. let yy = 70;
  5695. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5696. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5697. });
  5698. }
  5699. }
  5700. updateSelf() {
  5701. console.log('zh:updateSelf -------------- ');
  5702. let get = DataMgr.getBallRod(this.index);
  5703. if (get == null)
  5704. get = 1;
  5705. let curUse = DataMgr.getCurBallRod();
  5706. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5707. if (get) {
  5708. if (curUse == this.index) {
  5709. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5710. }
  5711. else {
  5712. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5713. }
  5714. }
  5715. else {
  5716. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5717. }
  5718. }
  5719. buyBallRod() {
  5720. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5721. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5722. switch (selectedIndex) {
  5723. case 0:
  5724. break;
  5725. case 1:
  5726. console.log('zh:点击了 USE THIS');
  5727. DataMgr.setCurBallRod(this.index);
  5728. let curUse = DataMgr.getCurBallRod();
  5729. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5730. let ui = xGame.uiMgr.getUI(UIShop);
  5731. ui.updateBallRod();
  5732. break;
  5733. case 2:
  5734. let data = cfgTable.ballrodData[this.index + 1];
  5735. let need = data.price;
  5736. if (DataMgr.diamondEnough(need)) {
  5737. DataMgr.setDiamond(-need);
  5738. DataMgr.setBallRod(this.index, 1);
  5739. DataMgr.setCurBallRod(this.index);
  5740. let ui = xGame.uiMgr.getUI(UIShop);
  5741. ui.updateBallRod();
  5742. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5743. }
  5744. else {
  5745. xGame.uiMgr.Show(UIAddProp, 1);
  5746. }
  5747. break;
  5748. default:
  5749. break;
  5750. }
  5751. }
  5752. logEventForGouMaiGan(qiuGanName) {
  5753. const ev = {
  5754. value: qiuGanName
  5755. };
  5756. const jsonStr = JSON.stringify(ev);
  5757. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5758. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5759. }
  5760. }
  5761. class DaoJuDisplay {
  5762. constructor(ui, index) {
  5763. this.index = 0;
  5764. this.uiIndex = 0;
  5765. this.ui = ui;
  5766. this.index = index;
  5767. this.initData();
  5768. }
  5769. initData() {
  5770. this.ui.btn_buy.onClick(this, this.buySp);
  5771. this.ui.btn_buy.onClick(this, this.buyDj);
  5772. let data = cfgTable.daoJuData[this.index + 1];
  5773. console.log('zh:' + JSON.stringify(data));
  5774. this.ui.nameTxt.text = data.spbt;
  5775. this.ui.n_jiaGe.text = data.spjg + "";
  5776. this.ui.n_zuanShi.text = data.spjg + "";
  5777. let baseUrl = "asset/sound/ogg/";
  5778. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5779. }
  5780. buyDj() {
  5781. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5782. }
  5783. buySp() {
  5784. let data = cfgTable.daoJuData[this.index + 1];
  5785. console.log('zh:点击购买 data =' + JSON.stringify(data));
  5786. }
  5787. }
  5788. class UIShop extends UIBase {
  5789. constructor() {
  5790. super();
  5791. this.itemNums = 0;
  5792. this.itemNumsForDj = 0;
  5793. this.curType = "";
  5794. }
  5795. onConstructor() {
  5796. this.ui = ui_UIShop.createInstance();
  5797. this.contentPane = this.ui;
  5798. this.isEject = false;
  5799. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5800. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5801. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5802. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5803. this.addUIClick(this.ui, this.interuptSecretary);
  5804. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5805. this.ballRodArr = [];
  5806. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5807. this.ui.myNode.myList.numItems = this.itemNums;
  5808. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  5809. console.log('zh:obj=' + this.ui.myNode.djList);
  5810. this.daoJuArr = [];
  5811. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  5812. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  5813. console.log('zh:999=' + this.itemNumsForDj);
  5814. }
  5815. show(type) {
  5816. super.show();
  5817. this.curType = type == 0 ? "qiugan" : "daoju";
  5818. this.switchBtn("qiugan");
  5819. this.playSecretaryIdle();
  5820. this.updateBallRod();
  5821. }
  5822. test123() {
  5823. console.log('zh:test123 ');
  5824. }
  5825. switchBtn(type) {
  5826. console.log('zh:1111切換 sel type=' + type);
  5827. if (type == "") {
  5828. type = this.curType;
  5829. }
  5830. else {
  5831. if (this.curType == type) {
  5832. return;
  5833. }
  5834. else {
  5835. this.curType = type;
  5836. }
  5837. }
  5838. if (type == "qiugan") {
  5839. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  5840. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  5841. this.ui.myNode.c1.selectedIndex = 0;
  5842. this.ui.myNode.myList.visible = true;
  5843. this.ui.myNode.djList.visible = false;
  5844. }
  5845. else {
  5846. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  5847. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  5848. this.ui.myNode.c1.selectedIndex = 1;
  5849. this.ui.myNode.myList.visible = false;
  5850. this.ui.myNode.djList.visible = true;
  5851. }
  5852. }
  5853. updateBallRod() {
  5854. for (let index = 0; index < this.ballRodArr.length; index++) {
  5855. this.ballRodArr[index].updateSelf();
  5856. }
  5857. }
  5858. renderBallRod(sort, obj) {
  5859. let index = this.getIndexBySort(sort + 1) - 1;
  5860. let ballRod = new BallRodDisplay(obj, index);
  5861. this.ballRodArr.push(ballRod);
  5862. }
  5863. renderDaoJu(sort, obj) {
  5864. let index = this.getIndexBySortForDj(sort + 1) - 1;
  5865. let b = new DaoJuDisplay(obj, index);
  5866. this.daoJuArr.push(b);
  5867. }
  5868. getIndexBySort(sort) {
  5869. let object = cfgTable.ballrodData;
  5870. for (const key in object) {
  5871. if (object[key].sort == sort) {
  5872. return parseInt(key);
  5873. }
  5874. }
  5875. }
  5876. getIndexBySortForDj(sort) {
  5877. let object = cfgTable.daoJuData;
  5878. for (const key in object) {
  5879. if (object[key].sort == sort) {
  5880. return parseInt(key);
  5881. }
  5882. }
  5883. }
  5884. playSecretaryIdle() {
  5885. let parent = this.ui.secretary.displayObject;
  5886. parent.destroyChildren();
  5887. let xx = this.ui.secretary.width / 2;
  5888. let yy = this.ui.secretary.height;
  5889. let scale = xGame.common.getSecretaryScale();
  5890. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5891. xGame.common.secretary.play(data, 0, true, parent);
  5892. }
  5893. interuptSecretary() {
  5894. Laya.timer.clearAll(this);
  5895. this.playSecretaryRandomSound();
  5896. }
  5897. playSecretaryRandomSound() {
  5898. if (this.isHide)
  5899. return;
  5900. let time = xGame.common.randomNum(45000, 60000);
  5901. Laya.timer.once(time, this, () => {
  5902. if (this.isHide)
  5903. return;
  5904. let index = xGame.common.randomNum(4, 7);
  5905. xGame.soundMgr.playSound("s_main0" + index);
  5906. let words = 1;
  5907. switch (index) {
  5908. case 4:
  5909. words = 5;
  5910. break;
  5911. case 5:
  5912. words = 3;
  5913. break;
  5914. case 6:
  5915. words = 6;
  5916. break;
  5917. case 7:
  5918. words = 7;
  5919. break;
  5920. default:
  5921. break;
  5922. }
  5923. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  5924. this.playSecretaryRandomSound();
  5925. });
  5926. }
  5927. closeSelf() {
  5928. this.hide();
  5929. }
  5930. }
  5931. UIShop.uiName = "UIShop";
  5932. class ui_UISign extends fgui.GComponent {
  5933. static createInstance() {
  5934. return (fgui.UIPackage.createObject("game", "UISign"));
  5935. }
  5936. onConstruct() {
  5937. this.n6 = (this.getChild("n6"));
  5938. this.closeNode = (this.getChild("closeNode"));
  5939. this.myNode = (this.getChild("myNode"));
  5940. this.moneyNode = (this.getChild("moneyNode"));
  5941. this.secretary = (this.getChild("secretary"));
  5942. this.talkNode = (this.getChild("talkNode"));
  5943. this.tripleBtn = (this.getChild("tripleBtn"));
  5944. this.normalBtn = (this.getChild("normalBtn"));
  5945. this.tipsNode = (this.getChild("tipsNode"));
  5946. this.againBtn = (this.getChild("againBtn"));
  5947. this.t0 = this.getTransition("t0");
  5948. }
  5949. }
  5950. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  5951. class SignMax {
  5952. constructor(ui) {
  5953. this.ui = ui;
  5954. }
  5955. updateSelf(index, sameDay, curDayIndex) {
  5956. let data = cfgTable.signData[index + 1];
  5957. this.ui.titleTxt.text = data.title;
  5958. let arr1 = data.award[0].split('-');
  5959. let arr2 = data.award[1].split('-');
  5960. let num1 = parseInt(arr1[1]);
  5961. let num2 = parseInt(arr2[1]);
  5962. this.ui.numTxt1.text = num1 + "";
  5963. this.ui.numTxt2.text = num2 + "";
  5964. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  5965. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  5966. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  5967. this.ui.numTxt1.visible = false;
  5968. }
  5969. else {
  5970. this.ui.numTxt1.visible = true;
  5971. }
  5972. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  5973. this.ui.numTxt2.visible = false;
  5974. }
  5975. else {
  5976. this.ui.numTxt2.visible = true;
  5977. }
  5978. if (index < curDayIndex) {
  5979. this.ui.c1.selectedIndex = 1;
  5980. }
  5981. else if (index == curDayIndex) {
  5982. if (sameDay) {
  5983. this.ui.c1.selectedIndex = 2;
  5984. }
  5985. else {
  5986. this.ui.c1.selectedIndex = 2;
  5987. }
  5988. }
  5989. else {
  5990. this.ui.c1.selectedIndex = 0;
  5991. }
  5992. }
  5993. }
  5994. class SignNormal {
  5995. constructor(ui) {
  5996. this.ui = ui;
  5997. }
  5998. updateSelf(index, sameDay, curDayIndex) {
  5999. let data = cfgTable.signData[index + 1];
  6000. this.ui.titleTxt.text = data.title;
  6001. let arr = data.award[0].split('-');
  6002. let type = parseInt(arr[0]);
  6003. let num = parseInt(arr[1]);
  6004. this.ui.numTxt.text = num + "";
  6005. if (type > 2) {
  6006. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6007. this.ui.myIcon.rotation = 0;
  6008. }
  6009. else {
  6010. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6011. this.ui.myIcon.rotation = 0;
  6012. }
  6013. if (xGame.common.signAwardContainsRod(data.award)) {
  6014. this.ui.numTxt.visible = false;
  6015. }
  6016. else {
  6017. this.ui.numTxt.visible = true;
  6018. }
  6019. if (index < curDayIndex) {
  6020. this.ui.c1.selectedIndex = 1;
  6021. }
  6022. else if (index == curDayIndex) {
  6023. if (sameDay) {
  6024. this.ui.c1.selectedIndex = 2;
  6025. }
  6026. else {
  6027. this.ui.c1.selectedIndex = 2;
  6028. }
  6029. }
  6030. else {
  6031. this.ui.c1.selectedIndex = 0;
  6032. }
  6033. }
  6034. }
  6035. class UISign extends UIBase {
  6036. constructor() {
  6037. super();
  6038. this.curDayIndex = 0;
  6039. this.starX = 0;
  6040. }
  6041. onConstructor() {
  6042. this.ui = ui_UISign.createInstance();
  6043. this.contentPane = this.ui;
  6044. this.isEject = false;
  6045. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6046. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6047. this.initSignItem();
  6048. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6049. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6050. }
  6051. show() {
  6052. super.show();
  6053. this.ui.t0.play();
  6054. this.playSecretaryIdle();
  6055. this.updateSign();
  6056. }
  6057. initSignItem() {
  6058. this.signArr = [];
  6059. for (let index = 0; index < 6; index++) {
  6060. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6061. this.signArr.push(temp);
  6062. }
  6063. this.signMax = new SignMax(this.ui.myNode.day7);
  6064. if (Moyu.isKs)
  6065. this.ui.closeNode.closeBtn.x += 100;
  6066. }
  6067. updateSign() {
  6068. let sameDay = xGame.common.judgeSameDay();
  6069. let max = 7;
  6070. this.curDayIndex = DataMgr.getSignData();
  6071. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6072. this.curDayIndex = 0;
  6073. if (!sameDay) {
  6074. this.ui.normalBtn.visible = true;
  6075. this.ui.tipsNode.visible = false;
  6076. this.ui.againBtn.visible = false;
  6077. }
  6078. else {
  6079. this.ui.normalBtn.visible = false;
  6080. let again = DataMgr.getExtraSign();
  6081. let isCurrency = false;
  6082. let index = this.curDayIndex;
  6083. if (index == 0)
  6084. index = 7;
  6085. let award = cfgTable.signData[index].award;
  6086. let num = award[0].split("-")[0];
  6087. if (num == "1" || num == "2")
  6088. isCurrency = true;
  6089. let showAgain = again == 0 && isCurrency;
  6090. this.ui.againBtn.visible = showAgain;
  6091. this.ui.tipsNode.visible = !showAgain;
  6092. }
  6093. for (let index = 0; index < this.signArr.length; index++) {
  6094. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6095. }
  6096. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6097. }
  6098. playSecretaryIdle() {
  6099. let parent = this.ui.secretary.displayObject;
  6100. parent.destroyChildren();
  6101. let xx = this.ui.secretary.width / 2;
  6102. let yy = this.ui.secretary.height;
  6103. let scale = xGame.common.getSecretaryScale();
  6104. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6105. xGame.common.secretary.play(data, 0, true, parent);
  6106. }
  6107. closeSelf() {
  6108. this.hide();
  6109. }
  6110. normalGetAward() {
  6111. let sameDay = xGame.common.judgeSameDay();
  6112. if (!sameDay) {
  6113. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6114. let temp;
  6115. let type;
  6116. let num;
  6117. let arr = [];
  6118. for (let index = 0; index < award.length; index++) {
  6119. temp = award[index].split("-");
  6120. type = parseInt(temp[0]);
  6121. num = parseInt(temp[1]);
  6122. let awardType = new AwardType();
  6123. awardType.num = num;
  6124. awardType.type = type;
  6125. arr.push(awardType);
  6126. }
  6127. xGame.common.getAward(arr, (watchVideo) => {
  6128. this.curDayIndex++;
  6129. if (this.curDayIndex > 7)
  6130. this.curDayIndex = 0;
  6131. DataMgr.setSignData(this.curDayIndex);
  6132. DataMgr.setSignTime(new Date().getTime());
  6133. if (watchVideo) {
  6134. DataMgr.setExtraSign(1);
  6135. Moyu.sendDataEvent("signIn1");
  6136. }
  6137. this.updateSign();
  6138. });
  6139. }
  6140. }
  6141. againGetAward() {
  6142. Moyu.sendDataEvent("signIn2");
  6143. console.log('zh:qjff_AD_for_uisign');
  6144. if (Laya.Browser.onAndroid) {
  6145. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6146. if (!boo) {
  6147. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6148. return;
  6149. }
  6150. }
  6151. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6152. }
  6153. else {
  6154. console.log('zh:AD 失败,直接发放奖励');
  6155. this.qjff_AD_for_uisign();
  6156. }
  6157. }
  6158. qjff_AD_for_uisign() {
  6159. let index = this.curDayIndex;
  6160. if (index == 0)
  6161. index = 7;
  6162. let award = cfgTable.signData[index].award;
  6163. let temp;
  6164. let type;
  6165. let num;
  6166. for (let index = 0; index < award.length; index++) {
  6167. temp = award[index].split("-");
  6168. type = parseInt(temp[0]);
  6169. num = parseInt(temp[1]) * 3;
  6170. xGame.common.playObjFlyAnim(num, type);
  6171. }
  6172. DataMgr.setExtraSign(1);
  6173. this.updateSign();
  6174. }
  6175. }
  6176. UISign.uiName = "UISign";
  6177. class ui_UISkill extends fgui.GComponent {
  6178. static createInstance() {
  6179. return (fgui.UIPackage.createObject("game", "UISkill"));
  6180. }
  6181. onConstruct() {
  6182. this.n48 = (this.getChild("n48"));
  6183. this.n0 = (this.getChild("n0"));
  6184. this.secretary = (this.getChild("secretary"));
  6185. this.talkNode = (this.getChild("talkNode"));
  6186. this.closeNode = (this.getChild("closeNode"));
  6187. this.moneyNode = (this.getChild("moneyNode"));
  6188. this.skillNode = (this.getChild("skillNode"));
  6189. this.guideNode = (this.getChild("guideNode"));
  6190. }
  6191. }
  6192. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6193. class SkillDisplay {
  6194. constructor(ui, data, uiIndex) {
  6195. this.starX = 0;
  6196. this.starY = 0;
  6197. this.index = 0;
  6198. this.ui = ui;
  6199. this.data = data;
  6200. this.index = uiIndex;
  6201. this.initSelf();
  6202. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6203. }
  6204. initSelf() {
  6205. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6206. this.ui.nameTxt.text = this.data.name;
  6207. this.ui.describeTxt.text = this.data.describe;
  6208. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6209. this.ui.startBtn.onClick(this, this.startGame);
  6210. this.updateSelf();
  6211. }
  6212. updateSelf() {
  6213. this.checkTry();
  6214. let level = DataMgr.getBigSkillByIndex(this.index);
  6215. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6216. }
  6217. checkTry() {
  6218. let index = this.index;
  6219. let level = DataMgr.getBigSkillByIndex(index);
  6220. if (level == null) {
  6221. DataMgr.setBigSkill(index, 1, false);
  6222. level = 1;
  6223. }
  6224. this.ui.levelTxt.text = "LV." + level;
  6225. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6226. this.ui.tryNode.visible = true;
  6227. else
  6228. this.ui.tryNode.visible = false;
  6229. }
  6230. clickAddLevel() {
  6231. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6232. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6233. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6234. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6235. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6236. }
  6237. else {
  6238. console.log('zh:AD 失败,直接发放奖励');
  6239. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6240. }
  6241. }
  6242. qjff_AD_for_skilldisplay_clickAddLevel() {
  6243. DataMgr.setBigSkill(this.data.index, 1);
  6244. this.updateSelf();
  6245. xGame.common.upSkillLevel = true;
  6246. }
  6247. startGame() {
  6248. console.log('zh:rod skill startgame');
  6249. if (this.data.index == 3) {
  6250. alert('Coming soon!');
  6251. return;
  6252. }
  6253. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6254. let needCoin = xGame.common.bigMoveNeedCoin;
  6255. xGame.common.passAwardCoin = 2000;
  6256. let guide = DataMgr.getSkillGuide();
  6257. console.log('zh:startGame guide=' + guide);
  6258. xGame.common.temSelfLevel = 0;
  6259. if (guide == 0) {
  6260. needCoin = 0;
  6261. xGame.common.temSelfLevel = 100;
  6262. }
  6263. if (DataMgr.coinEnough(needCoin)) {
  6264. DataMgr.setCoin(-needCoin);
  6265. xGame.common.curPlayerSkillType = this.index;
  6266. if (guide == 0)
  6267. xGame.common.curPlayerSkillType = 0;
  6268. console.log('zh: skilldisplay 1');
  6269. xGame.uiMgr.Show(UIGame);
  6270. xGame.uiMgr.Hide(UIMain);
  6271. xGame.uiMgr.Show(UIMatching, () => {
  6272. xGame.common.gameUI.ui.alpha = 1;
  6273. xGame.common.gameUI.startGame();
  6274. xGame.uiMgr.Hide(UISkill);
  6275. });
  6276. this.logEventForRod_start();
  6277. }
  6278. else {
  6279. console.log('zh: skilldisplay 2');
  6280. xGame.uiMgr.Show(UIAddProp, 0);
  6281. Moyu.sendDataEvent("AddCoinVideo");
  6282. }
  6283. }
  6284. logEventForRod_start() {
  6285. let gfmsIdx = xGame.common.curPlayerSkillType;
  6286. console.log('zh:选择的技能=' + gfmsIdx);
  6287. let gfmc = 'Skyfall Shot';
  6288. if (gfmsIdx == 0) {
  6289. gfmc = 'Skyfall Shot';
  6290. }
  6291. if (gfmsIdx == 1) {
  6292. gfmc = 'Surging break';
  6293. }
  6294. if (gfmsIdx == 2) {
  6295. gfmc = 'Frost Lock';
  6296. }
  6297. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6298. let jsonStr = {
  6299. "count": 0,
  6300. "name": gfmc
  6301. };
  6302. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6303. const d = LocalStorageManager.getItem(keyStr);
  6304. jsonStr.count = d.count + 1;
  6305. LocalStorageManager.setItem(keyStr, jsonStr);
  6306. }
  6307. else {
  6308. LocalStorageManager.setItem(keyStr, jsonStr);
  6309. }
  6310. const reqStr = JSON.stringify(jsonStr);
  6311. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6312. }
  6313. }
  6314. class UISkill extends UIBase {
  6315. constructor() {
  6316. super();
  6317. this.skillData = [];
  6318. }
  6319. onConstructor() {
  6320. this.ui = ui_UISkill.createInstance();
  6321. this.contentPane = this.ui;
  6322. this.isEject = false;
  6323. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6324. this.initSkillData();
  6325. console.log('zh:aaaaaa1111111111');
  6326. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6327. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6328. console.log('zh:aaaaaa22222222');
  6329. this.displayList = [];
  6330. this.ui.skillNode.skillList.numItems = 3;
  6331. this.addUIClick(this.ui, this.interuptSecretary);
  6332. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6333. this.ui.talkNode.visible = false;
  6334. if (Moyu.isKs)
  6335. this.ui.closeNode.closeBtn.x += 100;
  6336. }
  6337. show() {
  6338. super.show();
  6339. this.playSecretaryIdle();
  6340. this.moneyNode.ui.c1.selectedIndex = 1;
  6341. Laya.timer.clearAll(this);
  6342. xGame.soundMgr.playSound("s_start");
  6343. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6344. let guide = DataMgr.getSkillGuide();
  6345. this.ui.guideNode.visible = guide == 0;
  6346. let item = this.getSkillItemByUIIndex(0);
  6347. if (guide == 0) {
  6348. item.ui.c1.selectedIndex = 1;
  6349. }
  6350. else {
  6351. item.ui.c1.selectedIndex = 0;
  6352. }
  6353. this.ui.guideNode.guideBtn.visible = guide == 0;
  6354. for (let index = 0; index < this.displayList.length; index++) {
  6355. this.displayList[index].checkTry();
  6356. }
  6357. }
  6358. getSkillItemByUIIndex(cur) {
  6359. for (let index = 0; index < this.displayList.length; index++) {
  6360. if (this.displayList[index].index == cur) {
  6361. return this.displayList[index];
  6362. }
  6363. }
  6364. }
  6365. enterGuideLevel() {
  6366. let item = this.getSkillItemByUIIndex(0);
  6367. item.startGame();
  6368. if (DataMgr.getNewUser())
  6369. Moyu.sendDataEvent("gameStart1");
  6370. }
  6371. initSkillData() {
  6372. this.skillData = [];
  6373. let nameList = xGame.common.skillNameList;
  6374. let iconList = xGame.common.skillIconList;
  6375. let describeList = [
  6376. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6377. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6378. "The power of frost descends—freezing the flow and taking full control of the game!"
  6379. ];
  6380. console.log('zh:initSkillData 111111111');
  6381. let data;
  6382. for (let index = 0; index < nameList.length; index++) {
  6383. data = {};
  6384. data.name = nameList[index];
  6385. data.icon = iconList[index];
  6386. data.describe = describeList[index];
  6387. data.index = index;
  6388. this.skillData.push(data);
  6389. }
  6390. }
  6391. updateSkillItem(index, target) {
  6392. if (this.displayList[index] == null) {
  6393. let uiIndex;
  6394. switch (index) {
  6395. case 0:
  6396. uiIndex = 1;
  6397. break;
  6398. case 1:
  6399. uiIndex = 0;
  6400. break;
  6401. case 2:
  6402. uiIndex = 2;
  6403. break;
  6404. case 3:
  6405. uiIndex = 3;
  6406. break;
  6407. default:
  6408. break;
  6409. }
  6410. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6411. this.displayList.push(temp);
  6412. }
  6413. }
  6414. playSecretaryIdle() {
  6415. let parent = this.ui.secretary.displayObject;
  6416. parent.destroyChildren();
  6417. let xx = this.ui.secretary.width / 2;
  6418. let yy = this.ui.secretary.height;
  6419. let scale = xGame.common.getSecretaryScale();
  6420. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6421. xGame.common.secretary.play(data, 0, true, parent);
  6422. }
  6423. returnUIMain() {
  6424. this.hide();
  6425. xGame.common.stopGirlPop(this.ui.talkNode);
  6426. xGame.uiMgr.Show(UIMain);
  6427. }
  6428. interuptSecretary() {
  6429. Laya.timer.clearAll(this);
  6430. this.playSecretaryRandomSound();
  6431. }
  6432. playSecretaryRandomSound() {
  6433. if (this.isHide)
  6434. return;
  6435. let time = xGame.common.randomNum(45000, 60000);
  6436. Laya.timer.once(time, this, () => {
  6437. if (this.isHide)
  6438. return;
  6439. let index = xGame.common.randomNum(4, 7);
  6440. xGame.soundMgr.playSound("s_main0" + index);
  6441. let words = 1;
  6442. switch (index) {
  6443. case 4:
  6444. words = 5;
  6445. break;
  6446. case 5:
  6447. words = 3;
  6448. break;
  6449. case 6:
  6450. words = 6;
  6451. break;
  6452. case 7:
  6453. words = 7;
  6454. break;
  6455. default:
  6456. break;
  6457. }
  6458. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6459. this.playSecretaryRandomSound();
  6460. });
  6461. }
  6462. }
  6463. UISkill.uiName = "UISkill";
  6464. class ui_UIMsg extends fgui.GComponent {
  6465. static createInstance() {
  6466. return (fgui.UIPackage.createObject("game", "UIMsg"));
  6467. }
  6468. onConstruct() {
  6469. this.tipsNode = (this.getChild("tipsNode"));
  6470. }
  6471. }
  6472. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  6473. class UIMsg extends UIBase {
  6474. constructor() {
  6475. super();
  6476. }
  6477. onConstructor() {
  6478. this.ui = ui_UIMsg.createInstance();
  6479. this.contentPane = this.ui;
  6480. this.isEject = false;
  6481. this.isMuti = true;
  6482. }
  6483. show(msg, callback) {
  6484. super.show();
  6485. this.ui.tipsNode.msgTxt.text = msg;
  6486. this.ui.alpha = 1;
  6487. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  6488. this.hide();
  6489. callback && callback();
  6490. }), 1000);
  6491. }
  6492. }
  6493. UIMsg.uiName = "UIMsg";
  6494. class ui_UIModeSelection extends fgui.GComponent {
  6495. static createInstance() {
  6496. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6497. }
  6498. onConstruct() {
  6499. this.n19 = (this.getChild("n19"));
  6500. this.closeBtn = (this.getChild("closeBtn"));
  6501. this.myNode = (this.getChild("myNode"));
  6502. this.t0 = this.getTransition("t0");
  6503. }
  6504. }
  6505. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6506. class UIModeSelection extends UIBase {
  6507. constructor() {
  6508. super();
  6509. }
  6510. onConstructor() {
  6511. this.ui = ui_UIModeSelection.createInstance();
  6512. this.contentPane = this.ui;
  6513. this.isEject = false;
  6514. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6515. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6516. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6517. this.addUIClick(this.ui.closeBtn, this.hide);
  6518. this.peopleArr = [65, 990, 580];
  6519. this.peopleOffest = [5, 10, 10];
  6520. }
  6521. show(callback) {
  6522. this.updateSelf();
  6523. super.show();
  6524. this.ui.t0.play();
  6525. this.callback = callback;
  6526. }
  6527. updateSelf() {
  6528. let cfg = cfgTable.modeselectData;
  6529. for (let index = 1; index <= 3; index++) {
  6530. let node = this.ui.myNode["type" + index];
  6531. node.need.text = cfg[index].need;
  6532. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6533. node.peopleTxt.text = this.getRandPeople(index - 1);
  6534. }
  6535. }
  6536. enterGame(type) {
  6537. console.log('zh: 进入经典模式 type: ' + type);
  6538. xGame.common.classicRoomType = type;
  6539. let cfg = cfgTable.modeselectData[type];
  6540. let need = cfg.need;
  6541. xGame.common.passAwardCoin = cfg.award;
  6542. if (DataMgr.coinEnough(need)) {
  6543. DataMgr.setCoin(-need);
  6544. this.ui.myNode["type" + type].t0.play();
  6545. Laya.timer.once(200, this, () => {
  6546. this.callback && this.callback();
  6547. });
  6548. this.logEventForClassic_start();
  6549. }
  6550. else {
  6551. Moyu.sendDataEvent("AddCoinVideo");
  6552. xGame.uiMgr.Show(UIAddProp, 0);
  6553. }
  6554. }
  6555. getRandPeople(index) {
  6556. let rand = this.peopleOffest[index];
  6557. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6558. }
  6559. logEventForClassic_start() {
  6560. let rtype = xGame.common.classicRoomType;
  6561. let msmc = '';
  6562. if (rtype == 1) {
  6563. msmc = 'beginner';
  6564. }
  6565. if (rtype == 2) {
  6566. msmc = 'expert';
  6567. }
  6568. if (rtype == 3) {
  6569. msmc = 'master';
  6570. }
  6571. let keyStr = 'sjmd_classic_start_' + rtype;
  6572. let jsonStr = {
  6573. "difficulty": msmc,
  6574. "classic_count": 1,
  6575. "difficulty_count": 1
  6576. };
  6577. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6578. const d = LocalStorageManager.getItem(keyStr);
  6579. jsonStr.classic_count = d.classic_count + 1;
  6580. jsonStr.difficulty_count = d.difficulty_count + 1;
  6581. LocalStorageManager.setItem(keyStr, jsonStr);
  6582. }
  6583. else {
  6584. LocalStorageManager.setItem(keyStr, jsonStr);
  6585. }
  6586. const reqStr = JSON.stringify(jsonStr);
  6587. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6588. }
  6589. }
  6590. UIModeSelection.uiName = "UIModeSelection";
  6591. class ui_UIReg extends fgui.GComponent {
  6592. static createInstance() {
  6593. return (fgui.UIPackage.createObject("game", "UIReg"));
  6594. }
  6595. onConstruct() {
  6596. this.n38 = (this.getChild("n38"));
  6597. this.n9 = (this.getChild("n9"));
  6598. this.n14 = (this.getChild("n14"));
  6599. this.n15 = (this.getChild("n15"));
  6600. this.n34 = (this.getChild("n34"));
  6601. this.closeBtn = (this.getChild("closeBtn"));
  6602. this.lab_tip = (this.getChild("lab_tip"));
  6603. this.n43 = (this.getChild("n43"));
  6604. this.txt_ua = (this.getChild("txt_ua"));
  6605. this.n44 = (this.getChild("n44"));
  6606. this.txt_up1 = (this.getChild("txt_up1"));
  6607. this.n45 = (this.getChild("n45"));
  6608. this.txt_up2 = (this.getChild("txt_up2"));
  6609. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6610. this.btn_reg = (this.getChild("btn_reg"));
  6611. this.n50 = (this.getChild("n50"));
  6612. }
  6613. }
  6614. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6615. class ui_UILogin extends fgui.GComponent {
  6616. static createInstance() {
  6617. return (fgui.UIPackage.createObject("game", "UILogin"));
  6618. }
  6619. onConstruct() {
  6620. this.c1 = this.getController("c1");
  6621. this.n18 = (this.getChild("n18"));
  6622. this.n7 = (this.getChild("n7"));
  6623. this.n5 = (this.getChild("n5"));
  6624. this.n6 = (this.getChild("n6"));
  6625. this.closeBtn = (this.getChild("closeBtn"));
  6626. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6627. this.btn_login = (this.getChild("btn_login"));
  6628. this.n30 = (this.getChild("n30"));
  6629. this.n31 = (this.getChild("n31"));
  6630. this.txt_up = (this.getChild("txt_up"));
  6631. this.n32 = (this.getChild("n32"));
  6632. this.txt_ua = (this.getChild("txt_ua"));
  6633. }
  6634. }
  6635. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6636. class UILogin extends UIBase {
  6637. constructor() {
  6638. super();
  6639. }
  6640. onConstructor() {
  6641. this.ui = ui_UILogin.createInstance();
  6642. this.contentPane = this.ui;
  6643. this.isEject = false;
  6644. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6645. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6646. this.addUIClick(this.ui.btn_login, this.userLogin);
  6647. }
  6648. show() {
  6649. super.show();
  6650. this.x = (Laya.stage.width - this.width) / 2;
  6651. this.y = (Laya.stage.height - this.height) / 2;
  6652. }
  6653. closeSelf() {
  6654. this.hide();
  6655. }
  6656. userLogin() {
  6657. let ua = this.ui.txt_ua.text;
  6658. let up = this.ui.txt_up.text;
  6659. if (ua && up) {
  6660. let reqData = JSON.stringify({
  6661. username: ua.trim(),
  6662. password: up.trim(),
  6663. fromMark: 'app_game'
  6664. });
  6665. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6666. try {
  6667. console.log('zh:res = ' + JSON.stringify(res));
  6668. let code = res.code;
  6669. let msg = res.msg;
  6670. if (code == 200) {
  6671. let keyStr = 'userInfo';
  6672. let jsonStr = {
  6673. "username": res.username,
  6674. "token": res.token
  6675. };
  6676. LocalStorageManager.setItem(keyStr, jsonStr);
  6677. xGame.uiMgr.Show(UIMsg, msg);
  6678. this.closeSelf();
  6679. }
  6680. else {
  6681. xGame.uiMgr.Show(UIMsg, msg);
  6682. }
  6683. }
  6684. catch (error) {
  6685. console.log('error=' + error);
  6686. alert(error);
  6687. }
  6688. finally {
  6689. }
  6690. });
  6691. }
  6692. else {
  6693. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6694. }
  6695. }
  6696. gotoRegPage() {
  6697. this.closeSelf();
  6698. xGame.uiMgr.Show(UIReg);
  6699. }
  6700. }
  6701. UILogin.uiName = "UILogin";
  6702. class UIReg extends UIBase {
  6703. constructor() {
  6704. super();
  6705. }
  6706. onConstructor() {
  6707. this.ui = ui_UIReg.createInstance();
  6708. this.contentPane = this.ui;
  6709. this.isEject = false;
  6710. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6711. this.addUIClick(this.ui.btn_reg, this.regUser);
  6712. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6713. }
  6714. show() {
  6715. super.show();
  6716. this.x = (Laya.stage.width - this.width) / 2;
  6717. this.y = (Laya.stage.height - this.height) / 2;
  6718. }
  6719. closeSelf() {
  6720. this.hide();
  6721. }
  6722. regUser() {
  6723. this.ui.lab_tip.visible = false;
  6724. let ua = this.ui.txt_ua.text;
  6725. let up1 = this.ui.txt_up1.text;
  6726. let up2 = this.ui.txt_up2.text;
  6727. if (ua && up1 && up2 && up1 == up2) {
  6728. let reqData = JSON.stringify({
  6729. username: ua.trim(),
  6730. password: up1.trim(),
  6731. fromMark: 'app_game'
  6732. });
  6733. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6734. try {
  6735. console.log('zh:res = ' + JSON.stringify(res));
  6736. let code = res.code;
  6737. let msg = res.msg;
  6738. xGame.uiMgr.Show(UIMsg, msg);
  6739. if (code == 200) {
  6740. this.ui.lab_tip.color = "#FFFFFF";
  6741. xGame.uiMgr.Show(UIMsg, msg);
  6742. this.closeSelf();
  6743. }
  6744. else {
  6745. this.ui.lab_tip.color = "#FF0000";
  6746. xGame.uiMgr.Show(UIMsg, msg);
  6747. }
  6748. }
  6749. catch (error) {
  6750. console.log('error=' + error);
  6751. alert(error);
  6752. }
  6753. finally {
  6754. }
  6755. });
  6756. }
  6757. else {
  6758. if (up1 != up2) {
  6759. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6760. }
  6761. else {
  6762. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6763. }
  6764. }
  6765. }
  6766. gotoLogin() {
  6767. this.closeSelf();
  6768. xGame.uiMgr.Show(UILogin);
  6769. }
  6770. }
  6771. UIReg.uiName = "UIReg";
  6772. class ui_UIGetAward extends fgui.GComponent {
  6773. static createInstance() {
  6774. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  6775. }
  6776. onConstruct() {
  6777. this.n4 = (this.getChild("n4"));
  6778. this.n0 = (this.getChild("n0"));
  6779. this.myList = (this.getChild("myList"));
  6780. this.n1 = (this.getChild("n1"));
  6781. this.eftNode = (this.getChild("eftNode"));
  6782. this.btnNode = (this.getChild("btnNode"));
  6783. this.t0 = this.getTransition("t0");
  6784. }
  6785. }
  6786. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  6787. class UIGetAward extends UIBase {
  6788. constructor() {
  6789. super();
  6790. this.showTriple = true;
  6791. }
  6792. onConstructor() {
  6793. this.ui = ui_UIGetAward.createInstance();
  6794. this.contentPane = this.ui;
  6795. this.isEject = false;
  6796. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  6797. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  6798. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  6799. }
  6800. show(arr, showTriple, callback) {
  6801. super.show();
  6802. this.ui.t0.play();
  6803. this.ui.eftNode.visible = true;
  6804. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  6805. this.ui.eftNode.visible = false;
  6806. }), 1, 0, 0, 0.9);
  6807. this.awardArr = arr;
  6808. this.showTriple = showTriple;
  6809. this.callback = callback;
  6810. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  6811. this.ui.myList.numItems = arr.length;
  6812. xGame.soundMgr.playSound("getaward");
  6813. }
  6814. updateSelf(index, obj) {
  6815. let temp = this.awardArr[index];
  6816. let icon = this.getIcon(temp.type);
  6817. let str = icon;
  6818. if (temp.type > 2) {
  6819. str = "s" + icon;
  6820. }
  6821. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  6822. obj.myIcon.rotation = 0;
  6823. obj.numTxt.text = temp.num + "";
  6824. obj.numTxt.visible = temp.type > 2 ? false : true;
  6825. obj.nameTxt.text = this.getNameStr(temp.type);
  6826. }
  6827. renderItem(index, obj) {
  6828. this.updateSelf(index, obj);
  6829. }
  6830. tripleGetAward() {
  6831. console.log('zh:qjff_AD_for_uigetAward');
  6832. if (Laya.Browser.onAndroid) {
  6833. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6834. if (!boo) {
  6835. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6836. return;
  6837. }
  6838. }
  6839. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  6840. }
  6841. else {
  6842. console.log('zh:AD 失败,直接发放奖励');
  6843. this.qjff_AD_for_uigetAward();
  6844. }
  6845. }
  6846. qjff_AD_for_uigetAward() {
  6847. this.getAward(3);
  6848. }
  6849. normalGetAward() {
  6850. if (PlatMgr.isMisVideo())
  6851. this.tripleGetAward();
  6852. else
  6853. this.getAward();
  6854. }
  6855. getAward(times = 1) {
  6856. this.hide();
  6857. for (let index = 0; index < this.awardArr.length; index++) {
  6858. this.awardArr[index].num *= times;
  6859. }
  6860. this.callback && this.callback(times != 1);
  6861. }
  6862. getIcon(type) {
  6863. switch (type) {
  6864. case Prop.diamond:
  6865. return "ty_zs";
  6866. case Prop.coin:
  6867. return "ty_jb";
  6868. case Prop.gan1:
  6869. return "qg1";
  6870. case Prop.gan2:
  6871. return "qg2";
  6872. case Prop.gan3:
  6873. return "qg3";
  6874. case Prop.gan4:
  6875. return "qg4";
  6876. default:
  6877. break;
  6878. }
  6879. }
  6880. getNameStr(type) {
  6881. switch (type) {
  6882. case Prop.diamond:
  6883. return "Diamond";
  6884. case Prop.coin:
  6885. return "Coins";
  6886. case Prop.gan1:
  6887. case Prop.gan2:
  6888. case Prop.gan3:
  6889. case Prop.gan4:
  6890. return cfgTable.ballrodData[type - 1].name;
  6891. default:
  6892. break;
  6893. }
  6894. }
  6895. }
  6896. UIGetAward.uiName = "UIGetAward";
  6897. class ui_UIRepentProp extends fgui.GComponent {
  6898. static createInstance() {
  6899. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  6900. }
  6901. onConstruct() {
  6902. this.c1 = this.getController("c1");
  6903. this.n11 = (this.getChild("n11"));
  6904. this.regretNode = (this.getChild("regretNode"));
  6905. this.helpLineNode = (this.getChild("helpLineNode"));
  6906. this.t0 = this.getTransition("t0");
  6907. }
  6908. }
  6909. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  6910. class UIRepentProp extends UIBase {
  6911. constructor() {
  6912. super();
  6913. this.viewType = 0;
  6914. this.regretType = 0;
  6915. }
  6916. onConstructor() {
  6917. this.ui = ui_UIRepentProp.createInstance();
  6918. this.contentPane = this.ui;
  6919. this.isEject = false;
  6920. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  6921. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  6922. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  6923. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  6924. }
  6925. show(viewType, regretType, callback) {
  6926. PlatMgr.showInsert(true);
  6927. this.viewType = viewType;
  6928. this.regretType = regretType;
  6929. this.callback = callback;
  6930. super.show();
  6931. this.ui.t0.play();
  6932. this.ui.c1.selectedIndex = this.viewType;
  6933. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  6934. if (this.viewType == 0) {
  6935. let guide = DataMgr.getGuideHelpLine();
  6936. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  6937. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  6938. }
  6939. xGame.common.gameMgr.gamePause = true;
  6940. }
  6941. hideSelf() {
  6942. xGame.common.gameMgr.gamePause = false;
  6943. this.callback && this.callback(false);
  6944. this.hide();
  6945. }
  6946. videoRegret() {
  6947. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  6948. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  6949. }
  6950. else {
  6951. console.log('zh:AD 失败,直接发放奖励');
  6952. this.qjff_AD_for_UIrepentProp_videoRegret();
  6953. }
  6954. }
  6955. qjff_AD_for_UIrepentProp_videoRegret() {
  6956. this.callback && this.callback(true);
  6957. this.hideSelf();
  6958. }
  6959. videoAddHelpLine() {
  6960. let guide = DataMgr.getGuideHelpLine();
  6961. if (guide == 0) {
  6962. this.callback && this.callback(true);
  6963. this.hideSelf();
  6964. DataMgr.setGuideHelpLine();
  6965. xGame.common.gameUI.ui.guideNode.visible = false;
  6966. }
  6967. else {
  6968. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  6969. if (Laya.Browser.onAndroid) {
  6970. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6971. if (!boo) {
  6972. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6973. return;
  6974. }
  6975. }
  6976. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  6977. }
  6978. else {
  6979. console.log('zh:AD 失败,直接发放奖励');
  6980. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  6981. }
  6982. }
  6983. }
  6984. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  6985. this.callback && this.callback(true);
  6986. this.hideSelf();
  6987. }
  6988. }
  6989. UIRepentProp.uiName = "UIRepentProp";
  6990. class UIMain extends UIBase {
  6991. constructor() {
  6992. super();
  6993. this.firstEnter = true;
  6994. }
  6995. nativeCallJs(msg) {
  6996. let t = msg;
  6997. console.log("zh: nativeCallJs 奖励开始发放:", t);
  6998. switch (t) {
  6999. case 'qjff_chouJiang':
  7000. let dui = xGame.uiMgr.getUI(UIDraw);
  7001. dui.qjff_chouJiang();
  7002. break;
  7003. case 'qjff_AD_for_uisign':
  7004. let dui2 = xGame.uiMgr.getUI(UISign);
  7005. dui2.qjff_AD_for_uisign();
  7006. break;
  7007. case 'qjff_AD_for_uitry':
  7008. let dui3 = xGame.uiMgr.getUI(UITry);
  7009. dui3.qjff_AD_for_uitry();
  7010. break;
  7011. case 'qjff_AD_for_uipower':
  7012. let dui4 = xGame.uiMgr.getUI(UIPower);
  7013. dui4.qjff_AD_for_uipower();
  7014. break;
  7015. case 'qjff_AD_for_uigetAward':
  7016. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7017. dui5.qjff_AD_for_uigetAward();
  7018. break;
  7019. case 'qjff_AD_for_uiGameEnd':
  7020. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7021. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7022. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7023. break;
  7024. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7025. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7026. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7027. break;
  7028. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7029. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7030. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7031. break;
  7032. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7033. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7034. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7035. break;
  7036. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7037. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7038. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7039. break;
  7040. case 'qjff_AD_for_UIBOX_onOpenBox':
  7041. let dui11 = xGame.uiMgr.getUI(UIBox);
  7042. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7043. break;
  7044. case 'qjff_AD_for_UIAddCoin':
  7045. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7046. dui12.qjff_AD_for_UIAddCoin();
  7047. break;
  7048. case '111a':
  7049. let dui14 = xGame.uiMgr.getUI(UISign);
  7050. dui14.qjff_AD_for_uisign();
  7051. break;
  7052. case '222a':
  7053. let dui15 = xGame.uiMgr.getUI(UISign);
  7054. dui15.qjff_AD_for_uisign();
  7055. break;
  7056. case '333a':
  7057. let dui16 = xGame.uiMgr.getUI(UISign);
  7058. dui16.qjff_AD_for_uisign();
  7059. break;
  7060. default:
  7061. console.log('zh:未知的方法名字' + t);
  7062. break;
  7063. }
  7064. }
  7065. onConstructor() {
  7066. console.log('zh: UIMain onConstructor');
  7067. this.ui = ui_UIMain.createInstance();
  7068. this.contentPane = this.ui;
  7069. this.isEject = false;
  7070. this.addEvent();
  7071. this.addClickSpine();
  7072. this.settingNode = new SettingNode(this.ui.settingNode);
  7073. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7074. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7075. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7076. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7077. let curUse = DataMgr.getCurSecretary();
  7078. this.changeSecretary(curUse);
  7079. this.ui.talkNode.visible = false;
  7080. let guide = DataMgr.getSkillGuide();
  7081. if (xGame.common.isNewDay && guide == 1) {
  7082. xGame.common.isNewDay = false;
  7083. xGame.soundMgr.playSound("s_main01");
  7084. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7085. console.log("zh:播放小秘书每天语音");
  7086. }
  7087. this.onGetUserInfo();
  7088. this.ui.n83.visible = false;
  7089. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7090. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7091. let ua = d.username;
  7092. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7093. }
  7094. this.c_btn_for_user();
  7095. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7096. }
  7097. Logout() {
  7098. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7099. LocalStorageManager.removeItem(keyForLoginInfo);
  7100. this.freshUser();
  7101. }
  7102. }
  7103. gotoLogin() {
  7104. xGame.uiMgr.Show(UILogin);
  7105. }
  7106. gotoRegUser() {
  7107. xGame.uiMgr.Show(UIReg);
  7108. }
  7109. c_btn_for_user() {
  7110. this.ui.n_Logout.visible = false;
  7111. this.ui.n_dengLu.visible = false;
  7112. this.ui.n_zhuCe.visible = false;
  7113. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7114. this.ui.n_Logout.visible = true;
  7115. }
  7116. else {
  7117. this.ui.n_dengLu.visible = true;
  7118. }
  7119. }
  7120. changeSecretary(curUse) {
  7121. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7122. xGame.common.secretary && xGame.common.secretary.dispose();
  7123. this.addSecretarySpine(name);
  7124. }
  7125. addSecretarySpine(name) {
  7126. let spine = new SpineMgr(name, () => {
  7127. this.playSecretaryIdle();
  7128. });
  7129. xGame.common.secretary = spine;
  7130. }
  7131. addClickSpine() {
  7132. let clickSpine = new SpineMgr("dianji", () => {
  7133. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7134. let parent = Laya.stage;
  7135. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7136. clickSpine.play(data, 0, false, parent, (spine) => {
  7137. spine.destroy(true);
  7138. });
  7139. });
  7140. });
  7141. }
  7142. addEvent() {
  7143. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7144. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7145. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7146. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7147. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7148. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7149. this.addUIClick(this.ui, this.interuptSecretary);
  7150. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7151. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7152. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7153. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7154. this.addUIClick(this.ui.signBtn, this.openSignView);
  7155. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7156. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7157. this.addUIClick(this.ui.n_Logout, this.Logout);
  7158. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7159. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7160. }
  7161. show(showFailWords) {
  7162. super.show();
  7163. this.moneyNode.ui.c1.selectedIndex = 1;
  7164. this.playSecretaryIdle();
  7165. xGame.soundMgr.playMusic("caromhall01", 0);
  7166. Laya.timer.clearAll(this);
  7167. this.playSecretaryRandomSound();
  7168. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7169. if (showFailWords) {
  7170. console.log('zh:uimain.ts ');
  7171. setTimeout(() => {
  7172. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7173. let words = -1;
  7174. if (str == "s_main02") {
  7175. words = 2;
  7176. }
  7177. else {
  7178. words = 3;
  7179. }
  7180. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7181. xGame.soundMgr.playSound(str);
  7182. }, 300);
  7183. }
  7184. this.showGuide();
  7185. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7186. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7187. let guide = DataMgr.getSkillGuide();
  7188. if (guide == 1) {
  7189. let randTime = xGame.common.randomNum(300, 800);
  7190. if (this.firstEnter) {
  7191. console.log("zh: firstEnter");
  7192. this.firstEnter = false;
  7193. randTime += 900;
  7194. }
  7195. else {
  7196. console.log("zh: no firstEnter");
  7197. }
  7198. Laya.timer.once(randTime, this, () => {
  7199. xGame.common.autoPopUIView();
  7200. });
  7201. }
  7202. }
  7203. checkActive(show) {
  7204. }
  7205. showGuide() {
  7206. let guide = DataMgr.getSkillGuide();
  7207. this.ui.guideBtn.visible = guide == 0;
  7208. this.ui.enterGuide.visible = false;
  7209. this.ui.secretaryGuide.visible = guide == 0;
  7210. if (guide == 0) {
  7211. console.log("zh:显示引导");
  7212. xGame.soundMgr.playSound("s_guide");
  7213. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7214. }
  7215. else {
  7216. console.log("zh:不需要显示引导");
  7217. }
  7218. }
  7219. ensureSecretary() {
  7220. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7221. this.ui.secretaryGuide.visible = false;
  7222. this.ui.enterGuide.visible = true;
  7223. this.ui.wordsNode.t0.play();
  7224. if (DataMgr.getNewUser())
  7225. Moyu.sendDataEvent("gameReady");
  7226. }
  7227. playSecretaryIdle() {
  7228. let parent = this.ui.secretary.displayObject;
  7229. parent.destroyChildren();
  7230. let xx = this.ui.secretary.width / 2;
  7231. let yy = this.ui.secretary.height;
  7232. let scale = xGame.common.getSecretaryScale();
  7233. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7234. xGame.common.secretary.play(data, 0, true, parent);
  7235. }
  7236. startGame(type) {
  7237. if (!this.isReadyForLoadNetSource()) {
  7238. return;
  7239. }
  7240. xGame.common.gameMode = type;
  7241. Moyu.sendDataEvent("PlayGame", { type: type });
  7242. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7243. switch (xGame.common.gameMode) {
  7244. case GameMode.classic:
  7245. console.log('zh:进入经典模式111111111');
  7246. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7247. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7248. console.log('zh:classic db_over_lev=', db_over_lev);
  7249. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7250. console.log('zh:判断是否可以玩该模式classic =NO');
  7251. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7252. xGame.uiMgr.Show(UIMsg, tipStr);
  7253. return;
  7254. }
  7255. else {
  7256. console.log('zh:可以玩该模式classic 66666666666666');
  7257. this.beginGame();
  7258. }
  7259. }
  7260. else {
  7261. console.log('zh:不需要判断是否可以玩该classic');
  7262. let challengeTimes = DataMgr.getChallengeTimes();
  7263. if (challengeTimes == 0) {
  7264. xGame.uiMgr.Show(UIInvitation);
  7265. }
  7266. else {
  7267. this.beginGame();
  7268. }
  7269. break;
  7270. }
  7271. case GameMode.bigMove:
  7272. console.error('zh:bigMove check');
  7273. let guide = DataMgr.getSkillGuide();
  7274. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7275. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7276. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7277. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7278. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7279. xGame.uiMgr.Show(UIMsg, tipStr);
  7280. return;
  7281. }
  7282. else {
  7283. console.log('zh:可以玩该模式 bigMove');
  7284. this.beginGame();
  7285. if (DataMgr.getNewUser())
  7286. Moyu.sendDataEvent("gameStart0");
  7287. }
  7288. }
  7289. else {
  7290. this.beginGame();
  7291. if (DataMgr.getNewUser())
  7292. Moyu.sendDataEvent("gameStart0");
  7293. }
  7294. break;
  7295. default:
  7296. console.error('zh:未知错误!!!!');
  7297. break;
  7298. }
  7299. }
  7300. beginGame(isNice = false) {
  7301. console.log('zh:beginGame ');
  7302. let guide = DataMgr.getSkillGuide();
  7303. if (guide == 1) {
  7304. console.log('zh:非新手引导,showInternAd ');
  7305. JSBridgeUtils.instance.showInternAd('beginGame');
  7306. }
  7307. else {
  7308. console.log('zh:新手引导,不显示AD ');
  7309. }
  7310. console.log('zh:beginGame 2 go');
  7311. if (xGame.common.gameMode == GameMode.classic) {
  7312. if (isNice) {
  7313. this.enterClassic();
  7314. }
  7315. else {
  7316. xGame.uiMgr.Show(UIModeSelection, () => {
  7317. console.log('zh:BBBBBBBBBBBBBBB');
  7318. this.enterClassic();
  7319. });
  7320. }
  7321. }
  7322. else if (xGame.common.gameMode == GameMode.bigMove) {
  7323. this.ui.enterGuide.visible = false;
  7324. xGame.uiMgr.Show(UISkill);
  7325. }
  7326. }
  7327. enterClassic() {
  7328. xGame.uiMgr.Show(UIGame);
  7329. xGame.uiMgr.Show(UIMatching, () => {
  7330. if (!this.isHide)
  7331. this.hide();
  7332. xGame.common.gameUI.ui.alpha = 1;
  7333. xGame.common.gameUI.startGame();
  7334. xGame.uiMgr.Hide(UIGameEnd);
  7335. });
  7336. }
  7337. startGlobal() {
  7338. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7339. }
  7340. startWeekly() {
  7341. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7342. }
  7343. zhouSaiMonth() {
  7344. console.log('zh: zhouSaiMonth 被调用');
  7345. }
  7346. isReadyForLoadNetSource() {
  7347. let reqCount = xGame.cfgMgr.httpReqCount;
  7348. let ok = xGame.cfgMgr.httpReqOkCount;
  7349. if (reqCount > ok) {
  7350. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7351. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7352. Laya.timer.once(5000, this, () => {
  7353. xGame.cfgMgr.getConfigFromServer();
  7354. });
  7355. return false;
  7356. }
  7357. return true;
  7358. }
  7359. startPlaceBall() {
  7360. if (!this.isReadyForLoadNetSource()) {
  7361. return;
  7362. }
  7363. xGame.uiMgr.Show(UILevelDisplay);
  7364. }
  7365. hide() {
  7366. console.log('zh:uimain hide ...');
  7367. super.hide();
  7368. xGame.common.stopGirlPop(this.ui.talkNode);
  7369. }
  7370. onGetUserInfo(force = false) {
  7371. if (Moyu.isWx) {
  7372. let info = Moyu.getSystemInfo();
  7373. if (info)
  7374. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7375. }
  7376. else {
  7377. Moyu.initUser(this, this.freshUser, force);
  7378. }
  7379. this.freshUser();
  7380. }
  7381. freshUser() {
  7382. let user = Moyu.getUserInfo();
  7383. if (!user.isAuth) {
  7384. user.headIcon = 'res/ty_touxiang.png';
  7385. }
  7386. else {
  7387. DataMgr.upRankData();
  7388. }
  7389. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7390. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7391. let keyStr = keyForLoginInfo;
  7392. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7393. const d = LocalStorageManager.getItem(keyStr);
  7394. let ua = d.username;
  7395. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7396. }
  7397. else {
  7398. }
  7399. this.c_btn_for_user();
  7400. }
  7401. interuptSecretary() {
  7402. Laya.timer.clearAll(this);
  7403. this.playSecretaryRandomSound();
  7404. }
  7405. playSecretaryRandomSound() {
  7406. if (this.isHide)
  7407. return;
  7408. let time = xGame.common.randomNum(45000, 60000);
  7409. Laya.timer.once(time, this, () => {
  7410. if (this.isHide)
  7411. return;
  7412. let index = xGame.common.randomNum(4, 7);
  7413. xGame.soundMgr.playSound("s_main0" + index);
  7414. let words = 1;
  7415. switch (index) {
  7416. case 4:
  7417. words = 5;
  7418. break;
  7419. case 5:
  7420. words = 3;
  7421. break;
  7422. case 6:
  7423. words = 6;
  7424. break;
  7425. case 7:
  7426. words = 7;
  7427. break;
  7428. default:
  7429. break;
  7430. }
  7431. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7432. this.playSecretaryRandomSound();
  7433. });
  7434. }
  7435. openSecretaryView() {
  7436. xGame.uiMgr.Show(UISecretary);
  7437. Moyu.sendDataEvent("secretary");
  7438. }
  7439. openShopView() {
  7440. xGame.uiMgr.Show(UIShop, 0);
  7441. }
  7442. openSignView() {
  7443. xGame.uiMgr.Show(UISign);
  7444. }
  7445. openDrawView() {
  7446. xGame.uiMgr.Show(UIDraw);
  7447. }
  7448. openRanking() {
  7449. console.log('zh:phb openRanking');
  7450. xGame.uiMgr.Show(UIRanking);
  7451. Moyu.sendDataEvent("rankingList");
  7452. }
  7453. }
  7454. UIMain.uiName = "UIMain";
  7455. class UIGameEnd extends UIBase {
  7456. constructor() {
  7457. super();
  7458. this.success = false;
  7459. this.awardCoinNum = 1000;
  7460. this.awardDiamondNum = 10;
  7461. }
  7462. onConstructor() {
  7463. this.ui = ui_UIGameEnd.createInstance();
  7464. this.contentPane = this.ui;
  7465. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7466. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7467. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7468. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7469. this.ui.talkNode.visible = false;
  7470. if (Moyu.isKs)
  7471. this.ui.closeNode.closeBtn.x += 100;
  7472. }
  7473. updateType() {
  7474. switch (xGame.common.gameMode) {
  7475. case GameMode.classic:
  7476. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7477. this.ui.coinNode.visible = this.success;
  7478. if (!this.success) {
  7479. Laya.timer.once(500, this, () => {
  7480. xGame.uiMgr.Show(UIAddCoin);
  7481. });
  7482. }
  7483. else {
  7484. this.logEventForClassic_win();
  7485. }
  7486. this.logEventForClassic_complete();
  7487. this.ui.isGetAward.visible = false;
  7488. this.ui.leftBtn.c1.selectedIndex = 3;
  7489. this.ui.rightBtn.c1.selectedIndex = 0;
  7490. this.moneyNode.ui.c1.selectedIndex = 1;
  7491. break;
  7492. case GameMode.bigMove:
  7493. console.log('zh:招法模式 aaaaaa bigMove');
  7494. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7495. this.ui.coinNode.visible = this.success;
  7496. if (xGame.common.gameMode == GameMode.bigMove) {
  7497. if (this.success) {
  7498. DataMgr.setSkillSuccessTimes(1, true);
  7499. DataMgr.setSkillAccTimes(1);
  7500. }
  7501. else {
  7502. DataMgr.setSkillSuccessTimes(0, false);
  7503. }
  7504. }
  7505. this.logEventForRod_complete_N();
  7506. if (!this.success) {
  7507. Laya.timer.once(500, this, () => {
  7508. xGame.uiMgr.Show(UIAddCoin);
  7509. });
  7510. }
  7511. else {
  7512. this.logEventForRod_win();
  7513. }
  7514. this.ui.isGetAward.visible = false;
  7515. this.ui.leftBtn.c1.selectedIndex = 3;
  7516. this.ui.rightBtn.c1.selectedIndex = 0;
  7517. this.moneyNode.ui.c1.selectedIndex = 1;
  7518. break;
  7519. case GameMode.placeBall:
  7520. this.ui.coinNode.visible = false;
  7521. if (this.success) {
  7522. if (xGame.common.placeBallStarNum == 3) {
  7523. this.ui.c1.selectedIndex = 2;
  7524. }
  7525. else {
  7526. this.ui.c1.selectedIndex = 3;
  7527. }
  7528. let level = xGame.common.placeBallCurLevel;
  7529. if (level > 59) {
  7530. this.logEventForChallenge_level_complete(level);
  7531. }
  7532. else {
  7533. this.logEventForChallenge_level_N(level);
  7534. }
  7535. }
  7536. else {
  7537. this.ui.c1.selectedIndex = 4;
  7538. }
  7539. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7540. if (cfg.type == PlaceBallType.challenge) {
  7541. this.ui.c1.selectedIndex = 2;
  7542. }
  7543. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7544. this.updatePlaceBallBtn();
  7545. this.updatePlaceBallStarNum();
  7546. this.updatePlaceBallAwardState();
  7547. this.moneyNode.ui.c1.selectedIndex = 2;
  7548. this.moneyNode.checkPowerTime();
  7549. this.moneyNode.powerChange();
  7550. DataMgr.upRankData();
  7551. break;
  7552. default:
  7553. break;
  7554. }
  7555. }
  7556. logEventForRod_complete_N() {
  7557. let gfmsIdx = xGame.common.curPlayerSkillType;
  7558. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7559. let gfmc = 'Skyfall Shot';
  7560. if (gfmsIdx == 0) {
  7561. gfmc = 'Skyfall Shot';
  7562. }
  7563. if (gfmsIdx == 1) {
  7564. gfmc = 'Surging break';
  7565. }
  7566. if (gfmsIdx == 2) {
  7567. gfmc = 'Frost Lock';
  7568. }
  7569. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7570. console.log('zh:logEventForRod_complete_N level = ' + level);
  7571. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7572. let jsonStr = {
  7573. "count": 0,
  7574. "name": gfmc
  7575. };
  7576. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7577. const d = LocalStorageManager.getItem(keyStr);
  7578. jsonStr.count = d.count + 1;
  7579. LocalStorageManager.setItem(keyStr, jsonStr);
  7580. }
  7581. else {
  7582. LocalStorageManager.setItem(keyStr, jsonStr);
  7583. }
  7584. const d2 = LocalStorageManager.getItem(keyStr);
  7585. let count = d2.count;
  7586. console.log('zh:logEventForRod_complete_N count = ' + count);
  7587. if (count % 5 == 0) {
  7588. const reqStr = JSON.stringify(jsonStr);
  7589. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7590. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7591. }
  7592. }
  7593. logEventForRod_win() {
  7594. console.log('zh:logEventForRod_win,胜利');
  7595. let gfmsIdx = xGame.common.curPlayerSkillType;
  7596. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7597. let gfmc = 'Skyfall Shot';
  7598. if (gfmsIdx == 0) {
  7599. gfmc = 'Skyfall Shot';
  7600. }
  7601. if (gfmsIdx == 1) {
  7602. gfmc = 'Surging break';
  7603. }
  7604. if (gfmsIdx == 2) {
  7605. gfmc = 'Frost Lock';
  7606. }
  7607. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7608. console.log('zh:logEventForRod_win level = ' + level);
  7609. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7610. let jsonStr = {
  7611. "count": 1,
  7612. "name": gfmc + ' Lev' + level
  7613. };
  7614. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7615. const d = LocalStorageManager.getItem(keyStr);
  7616. jsonStr.count = d.count + 1;
  7617. LocalStorageManager.setItem(keyStr, jsonStr);
  7618. }
  7619. else {
  7620. LocalStorageManager.setItem(keyStr, jsonStr);
  7621. }
  7622. const reqStr = JSON.stringify(jsonStr);
  7623. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7624. }
  7625. logEventForClassic_win() {
  7626. console.log('zh:logEventForClassic_win,胜利');
  7627. let rtype = xGame.common.classicRoomType;
  7628. let msmc = '';
  7629. if (rtype == 1) {
  7630. msmc = 'beginner';
  7631. }
  7632. if (rtype == 2) {
  7633. msmc = 'expert';
  7634. }
  7635. if (rtype == 3) {
  7636. msmc = 'master';
  7637. }
  7638. let keyStr = 'sjmd_classic_win_' + rtype;
  7639. let jsonStr = {
  7640. "difficulty": msmc,
  7641. "classic_count": 1,
  7642. "difficulty_count": 1
  7643. };
  7644. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7645. const d = LocalStorageManager.getItem(keyStr);
  7646. jsonStr.classic_count = d.classic_count + 1;
  7647. jsonStr.difficulty_count = d.difficulty_count + 1;
  7648. LocalStorageManager.setItem(keyStr, jsonStr);
  7649. }
  7650. else {
  7651. LocalStorageManager.setItem(keyStr, jsonStr);
  7652. }
  7653. const reqStr = JSON.stringify(jsonStr);
  7654. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7655. }
  7656. logEventForClassic_complete() {
  7657. console.log('zh:logEventForClassic_complete,胜利');
  7658. let rtype = xGame.common.classicRoomType;
  7659. let msmc = '';
  7660. if (rtype == 1) {
  7661. msmc = 'beginner';
  7662. }
  7663. if (rtype == 2) {
  7664. msmc = 'expert';
  7665. }
  7666. if (rtype == 3) {
  7667. msmc = 'master';
  7668. }
  7669. let keyStr = 'sjmd_classic_complete_' + rtype;
  7670. let jsonStr = {
  7671. "msmc": msmc,
  7672. "count": 0
  7673. };
  7674. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7675. const d = LocalStorageManager.getItem(keyStr);
  7676. jsonStr.count = d.count + 1;
  7677. LocalStorageManager.setItem(keyStr, jsonStr);
  7678. }
  7679. else {
  7680. LocalStorageManager.setItem(keyStr, jsonStr);
  7681. }
  7682. if (jsonStr.count % 5 == 0) {
  7683. const reqStr = JSON.stringify(jsonStr);
  7684. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7685. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  7686. }
  7687. }
  7688. updatePlaceBallBtn() {
  7689. this.ui.leftBtn.c1.selectedIndex = 5;
  7690. if (this.success) {
  7691. this.ui.rightBtn.c1.selectedIndex = 14;
  7692. }
  7693. else {
  7694. if (xGame.common.placeBallStarNum == 3) {
  7695. this.ui.rightBtn.c1.selectedIndex = 14;
  7696. }
  7697. else {
  7698. this.ui.rightBtn.c1.selectedIndex = 1;
  7699. }
  7700. }
  7701. }
  7702. updatePlaceBallStarNum() {
  7703. let starNum = xGame.common.placeBallStarNum;
  7704. if (starNum == 0)
  7705. this.ui.starNumNode.c1.selectedIndex = 3;
  7706. else {
  7707. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  7708. }
  7709. }
  7710. updatePlaceBallAwardState() {
  7711. let level = xGame.common.placeBallCurLevel;
  7712. let starNum = xGame.common.placeBallStarNum;
  7713. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7714. let data = cfgTable.placeballData[level].award;
  7715. let cfg = cfgTable.placeballData[level];
  7716. this.awardDiamondNum = data[1];
  7717. this.awardCoinNum = data[0];
  7718. if (cfg.type == PlaceBallType.challenge) {
  7719. this.awardDiamondNum = 0;
  7720. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7721. }
  7722. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  7723. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  7724. if (cfg.type == PlaceBallType.challenge) {
  7725. this.ui.awardNode.coinNode.visible = true;
  7726. }
  7727. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  7728. this.ui.awardNode.diamondNode.x = 265;
  7729. this.ui.awardNode.coinNode.x = 354;
  7730. }
  7731. else {
  7732. this.ui.awardNode.diamondNode.x = 291;
  7733. this.ui.awardNode.coinNode.x = 291;
  7734. }
  7735. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  7736. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  7737. if (this.awardCoinNum == 0) {
  7738. this.ui.awardNode.coinNode.numTxt.text = "";
  7739. }
  7740. if (getAward) {
  7741. this.ui.isGetAward.visible = true;
  7742. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  7743. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  7744. }
  7745. else {
  7746. this.ui.isGetAward.visible = false;
  7747. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  7748. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  7749. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  7750. }
  7751. else {
  7752. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  7753. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  7754. }
  7755. }
  7756. }
  7757. show(success) {
  7758. super.show();
  7759. xGame.eventMgr.event(RESET_GAME);
  7760. this.success = success;
  7761. Laya.timer.clearAll(this);
  7762. this.playSecretaryAni();
  7763. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  7764. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  7765. offsetTime = Math.floor(offsetTime / 1000);
  7766. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  7767. this.updateType();
  7768. Laya.timer.once(200, this, () => {
  7769. this.addAward(() => {
  7770. this.updateType();
  7771. Laya.timer.once(500, this, () => {
  7772. this.showChallengeLevel();
  7773. });
  7774. });
  7775. });
  7776. if (this.success) {
  7777. JSBridgeUtils.instance.showInternAd('gameend_success');
  7778. console.log('zh:game end 成功');
  7779. xGame.soundMgr.playSound('slots_roll01');
  7780. xGame.soundMgr.playSound("s_win");
  7781. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7782. this.diyGameDataUtilForGameWin();
  7783. }
  7784. else {
  7785. JSBridgeUtils.instance.showInternAd('gameend_faill');
  7786. console.log('zh:game end失败');
  7787. xGame.soundMgr.playSound('matchwin01');
  7788. xGame.soundMgr.playSound("s_lose");
  7789. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7790. }
  7791. let challengeNum = DataMgr.getChallengeTimes();
  7792. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  7793. DataMgr.setChallengeTimes(1);
  7794. }
  7795. if (this.success && xGame.common.gameMode == GameMode.classic) {
  7796. DataMgr.setClassicTimes();
  7797. }
  7798. }
  7799. diyGameDataUtilForGameWin() {
  7800. console.log('zh: DiyGameDataUtilForGameWin diy ');
  7801. switch (xGame.common.gameMode) {
  7802. case GameMode.classic:
  7803. console.log('zh:DiyGameDataUtilForGameWin 111');
  7804. case GameMode.bigMove:
  7805. console.log('zh:DiyGameDataUtilForGameWin 222');
  7806. this.restartGame();
  7807. break;
  7808. case GameMode.placeBall:
  7809. console.log('zh:DiyGameDataUtilForGameWin 333');
  7810. var level = xGame.common.placeBallCurLevel;
  7811. console.log('zh:练习模式 联系了多少LEV=' + level);
  7812. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7813. if (level > db_over_lev) {
  7814. DataMgr.setChallengeMode_overLev(level);
  7815. }
  7816. break;
  7817. default:
  7818. console.log('zh:DiyGameDataUtilForGameWin 444');
  7819. break;
  7820. }
  7821. }
  7822. showChallengeLevel() {
  7823. if (DataMgr.getChallengeTimes() != 0)
  7824. return;
  7825. let skill = DataMgr.getSkillAccTimes();
  7826. let put = DataMgr.getPlaceBallLevelList().length;
  7827. if (skill >= 3 || put >= 5) {
  7828. xGame.uiMgr.Show(UIInvitation);
  7829. this.hide();
  7830. }
  7831. }
  7832. addAward(callback) {
  7833. if (!this.success) {
  7834. callback && callback();
  7835. return;
  7836. }
  7837. switch (xGame.common.gameMode) {
  7838. case GameMode.classic:
  7839. this.awardCoinNum = xGame.common.passAwardCoin;
  7840. this.awardDiamondNum = 0;
  7841. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7842. break;
  7843. case GameMode.bigMove:
  7844. this.awardCoinNum = xGame.common.passAwardCoin;
  7845. this.awardDiamondNum = 0;
  7846. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  7847. callback && callback();
  7848. break;
  7849. case GameMode.placeBall:
  7850. let level = xGame.common.placeBallCurLevel;
  7851. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  7852. if (xGame.common.placeBallStarNum != 3) {
  7853. callback && callback();
  7854. return;
  7855. }
  7856. else {
  7857. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  7858. if (getAward) {
  7859. callback && callback();
  7860. return;
  7861. }
  7862. }
  7863. let cfg = cfgTable.placeballData[level];
  7864. let data = cfgTable.placeballData[level].award;
  7865. this.awardCoinNum = data[0];
  7866. this.awardDiamondNum = data[1];
  7867. if (cfg.type == PlaceBallType.challenge) {
  7868. this.awardDiamondNum = 0;
  7869. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  7870. }
  7871. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  7872. let diamondAward;
  7873. if (this.awardDiamondNum > 0) {
  7874. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  7875. xGame.common.getAward([diamondAward, coinAward], callback);
  7876. }
  7877. else {
  7878. xGame.common.getAward([coinAward], callback);
  7879. }
  7880. if (cfg.type == PlaceBallType.normal) {
  7881. DataMgr.setPlaceBallAward(level);
  7882. }
  7883. break;
  7884. default:
  7885. break;
  7886. }
  7887. }
  7888. playSecretaryAni_old() {
  7889. let parent = this.ui.secretary.displayObject;
  7890. parent.destroyChildren();
  7891. let xx = this.ui.secretary.width / 2;
  7892. let yy = this.ui.secretary.height;
  7893. let scale = xGame.common.getSecretaryScale();
  7894. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7895. if (this.success) {
  7896. let rand = Math.random() <= 0.5 ? 2 : 3;
  7897. xGame.common.secretary.play(data, rand, false, parent, () => {
  7898. xGame.common.secretary.play(data, 1, true, parent);
  7899. });
  7900. }
  7901. else {
  7902. xGame.common.secretary.play(data, 0, true, parent);
  7903. }
  7904. }
  7905. playSecretaryAni() {
  7906. let parent = this.ui.secretary.displayObject;
  7907. parent.destroyChildren();
  7908. let xx = this.ui.secretary.width / 2;
  7909. let yy = this.ui.secretary.height;
  7910. let scale = xGame.common.getSecretaryScale();
  7911. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7912. if (this.success) {
  7913. let rand = 0;
  7914. xGame.common.secretary.play(data, 0, true, parent);
  7915. }
  7916. else {
  7917. xGame.common.secretary.play(data, 0, true, parent);
  7918. }
  7919. }
  7920. restartGame() {
  7921. switch (xGame.common.gameMode) {
  7922. case GameMode.classic:
  7923. xGame.eventMgr.event(RESTART_GAME);
  7924. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7925. break;
  7926. case GameMode.bigMove:
  7927. this.hide();
  7928. xGame.eventMgr.event(RESTART_GAME);
  7929. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7930. break;
  7931. default:
  7932. break;
  7933. }
  7934. }
  7935. hide() {
  7936. super.hide();
  7937. xGame.common.stopGirlPop(this.ui.talkNode);
  7938. PlatMgr.showBanner(false);
  7939. }
  7940. returnHome() {
  7941. this.hide();
  7942. let showFailWords = !this.success;
  7943. xGame.uiMgr.Show(UIMain, showFailWords);
  7944. }
  7945. clickLeftBtn() {
  7946. switch (xGame.common.gameMode) {
  7947. case GameMode.classic:
  7948. case GameMode.bigMove:
  7949. this.returnHome();
  7950. break;
  7951. case GameMode.placeBall:
  7952. let level = xGame.common.placeBallCurLevel;
  7953. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  7954. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  7955. break;
  7956. default:
  7957. break;
  7958. }
  7959. }
  7960. powerStartPlaceBallLevel(level, btn) {
  7961. if (DataMgr.powerEnough()) {
  7962. btn.touchable = false;
  7963. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  7964. btn.touchable = true;
  7965. DataMgr.setPower(-1);
  7966. xGame.eventMgr.event(POWER_TIME);
  7967. this.startPlaceBallLevel(level);
  7968. this.logEventForChallenge_level_start(level);
  7969. }));
  7970. }
  7971. else {
  7972. xGame.uiMgr.Show(UIPower, 0);
  7973. }
  7974. }
  7975. clickRightBtn() {
  7976. switch (xGame.common.gameMode) {
  7977. case GameMode.classic:
  7978. console.log('zh:clickRightBtn 111');
  7979. case GameMode.bigMove:
  7980. console.log('zh:clickRightBtn 222');
  7981. this.restartGame();
  7982. break;
  7983. case GameMode.placeBall:
  7984. console.log('zh:clickRightBtn 333');
  7985. let level = xGame.common.placeBallCurLevel;
  7986. let data = DataMgr.getPlaceBallLevel(level);
  7987. let curPss = data.play && !data.isCur;
  7988. if (curPss) {
  7989. console.log('zh:clickRightBtn 333-111');
  7990. console.log('zh:当前LV=' + level);
  7991. if (level == 60) {
  7992. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  7993. Laya.timer.once(3000, this, () => {
  7994. this.returnHome();
  7995. });
  7996. }
  7997. else {
  7998. let lev = level + 1;
  7999. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8000. }
  8001. }
  8002. else {
  8003. console.log('zh:clickRightBtn 333-000');
  8004. Moyu.sendDataEvent("placeBallNextLevel");
  8005. console.log('zh:qjff_AD_for_uiGameEnd');
  8006. if (Laya.Browser.onAndroid) {
  8007. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8008. if (!boo) {
  8009. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8010. return;
  8011. }
  8012. }
  8013. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8014. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8015. }
  8016. else {
  8017. console.log('zh:AD 失败,直接发放奖励');
  8018. this.qjff_AD_for_uiGameEnd(level);
  8019. }
  8020. }
  8021. break;
  8022. default:
  8023. console.log('zh:clickRightBtn 444');
  8024. break;
  8025. }
  8026. }
  8027. logEventForChallenge_level_start(level) {
  8028. let keyStr = 'sjmd_challenge_level_start';
  8029. let jsonStr = {
  8030. "count": 0,
  8031. "gold_balance ": DataMgr.getCoin(),
  8032. "level": level,
  8033. "diamond_balance ": DataMgr.getDiamond()
  8034. };
  8035. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8036. const d = LocalStorageManager.getItem(keyStr);
  8037. if (level > d.level) {
  8038. jsonStr.count = d.count + 1;
  8039. LocalStorageManager.setItem(keyStr, jsonStr);
  8040. }
  8041. else {
  8042. }
  8043. }
  8044. else {
  8045. LocalStorageManager.setItem(keyStr, jsonStr);
  8046. }
  8047. const reqStr = JSON.stringify(jsonStr);
  8048. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8049. }
  8050. qjff_AD_for_uiGameEnd(level) {
  8051. DataMgr.setPlaceBallLevel(level, 1);
  8052. this.startPlaceBallLevel(level + 1);
  8053. }
  8054. startPlaceBallLevel(level) {
  8055. xGame.common.gameMode = GameMode.placeBall;
  8056. xGame.common.placeBallCurLevel = level;
  8057. xGame.uiMgr.Show(UIGame);
  8058. this.hide();
  8059. }
  8060. logEventForChallenge_level_complete(level) {
  8061. let keyStr = 'sjmd_challenge_level_complete';
  8062. let jsonStr = {
  8063. "count": 1,
  8064. "gold_balance ": DataMgr.getCoin(),
  8065. "level": level,
  8066. "diamond_balance ": DataMgr.getDiamond()
  8067. };
  8068. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8069. const d = LocalStorageManager.getItem(keyStr);
  8070. jsonStr.count = d.count + 1;
  8071. LocalStorageManager.setItem(keyStr, jsonStr);
  8072. }
  8073. else {
  8074. LocalStorageManager.setItem(keyStr, jsonStr);
  8075. }
  8076. const reqStr = JSON.stringify(jsonStr);
  8077. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8078. }
  8079. logEventForChallenge_level_N(level) {
  8080. console.log('zh:logEventForChallenge_level_N ' + level);
  8081. let keyStr = 'sjmd_challenge_level_N';
  8082. if (LocalStorageManager.hasKey(keyStr)) {
  8083. let lev = LocalStorageManager.getItem(keyStr);
  8084. if (level > lev) {
  8085. LocalStorageManager.setItem(keyStr, level);
  8086. }
  8087. if ((level) % 5 == 0) {
  8088. console.log('zh:每5关上报1次');
  8089. let sjmc = 'challenge_level_' + level;
  8090. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8091. let sjmcForFirebase = 'challenge_level_' + level;
  8092. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8093. }
  8094. else {
  8095. console.log('zh:5 no 上报');
  8096. }
  8097. }
  8098. else {
  8099. LocalStorageManager.setItem(keyStr, level);
  8100. }
  8101. }
  8102. }
  8103. UIGameEnd.uiName = "UIGameEnd";
  8104. class ui_UIVideoShare extends fgui.GComponent {
  8105. static createInstance() {
  8106. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8107. }
  8108. onConstruct() {
  8109. this.n10 = (this.getChild("n10"));
  8110. this.myNode = (this.getChild("myNode"));
  8111. this.t0 = this.getTransition("t0");
  8112. }
  8113. }
  8114. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8115. class UIVideoShare extends UIBase {
  8116. constructor() {
  8117. super();
  8118. this.success = false;
  8119. this.awardNum = 0;
  8120. this.isShared = true;
  8121. }
  8122. onConstructor() {
  8123. this.ui = ui_UIVideoShare.createInstance();
  8124. this.contentPane = this.ui;
  8125. this.isEject = false;
  8126. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8127. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8128. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8129. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8130. }
  8131. show(success) {
  8132. super.show();
  8133. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8134. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8135. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8136. this.success = success;
  8137. let time = xGame.common.randomNum(600, 1500);
  8138. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8139. if (success)
  8140. xGame.soundMgr.playSound("applause");
  8141. this.ui.t0.play();
  8142. this.checkShareState();
  8143. let times = DataMgr.getDailyVideoShareTimes();
  8144. this.awardNum = times == 0 ? 2000 : 200;
  8145. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8146. }
  8147. checkShareState() {
  8148. if (PlatMgr.forceShare == 0) {
  8149. this.ui.myNode.closeBtn.visible = true;
  8150. this.ui.myNode.tipsNode.visible = false;
  8151. this.ui.myNode.closeBtn.x = 90;
  8152. this.ui.myNode.shareBtn.x = 342;
  8153. }
  8154. else if (PlatMgr.forceShare == 1) {
  8155. this.ui.myNode.closeBtn.visible = false;
  8156. this.ui.myNode.tipsNode.visible = true;
  8157. this.ui.myNode.shareBtn.x = 218;
  8158. this.isShared = true;
  8159. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8160. }
  8161. }
  8162. checkForceShare() {
  8163. this.isShared = !this.isShared;
  8164. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8165. }
  8166. videoShare() {
  8167. if (PlatMgr.forceShare == 1) {
  8168. if (this.isShared) {
  8169. this.shareGame();
  8170. }
  8171. else {
  8172. this.hideSelf();
  8173. }
  8174. }
  8175. else {
  8176. this.shareGame();
  8177. }
  8178. }
  8179. shareGame() {
  8180. Moyu.sendDataEvent("VideoShare");
  8181. if (Moyu.canShare() > 100) {
  8182. Moyu.shareGame((success) => {
  8183. if (success) {
  8184. DataMgr.setDailyVideoShareTimes(1);
  8185. DataMgr.setCoin(this.awardNum);
  8186. }
  8187. this.hideSelf();
  8188. }, this);
  8189. }
  8190. else {
  8191. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8192. this.hideSelf();
  8193. }
  8194. }
  8195. hideSelf() {
  8196. this.hide();
  8197. xGame.uiMgr.Show(UIGameEnd, this.success);
  8198. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8199. xGame.common.screenImg.destroy();
  8200. xGame.common.screenImg = null;
  8201. }
  8202. }
  8203. }
  8204. UIVideoShare.uiName = "UIVideoShare";
  8205. class ui_UITips extends fgui.GComponent {
  8206. static createInstance() {
  8207. return (fgui.UIPackage.createObject("game", "UITips"));
  8208. }
  8209. onConstruct() {
  8210. this.n0 = (this.getChild("n0"));
  8211. this.myNode = (this.getChild("myNode"));
  8212. this.t0 = this.getTransition("t0");
  8213. }
  8214. }
  8215. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8216. class UITips extends UIBase {
  8217. constructor() {
  8218. super();
  8219. this.type = 0;
  8220. }
  8221. onConstructor() {
  8222. this.ui = ui_UITips.createInstance();
  8223. this.contentPane = this.ui;
  8224. this.isEject = false;
  8225. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8226. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8227. }
  8228. show(tipsTxt, womanTxt, type) {
  8229. super.show();
  8230. this.ui.t0.play();
  8231. this.ui.myNode.tipsTxt.text = tipsTxt;
  8232. this.ui.myNode.womanTxt.text = womanTxt;
  8233. PlatMgr.showInsert(true);
  8234. this.ui.myNode.c1.selectedIndex = type;
  8235. this.type = type;
  8236. switch (this.type) {
  8237. case TipsType.exitGame:
  8238. xGame.common.gameMgr.gamePause = true;
  8239. break;
  8240. case TipsType.foul:
  8241. Laya.timer.once(200, this, () => {
  8242. xGame.common.gameMgr.gamePause = true;
  8243. });
  8244. break;
  8245. default:
  8246. break;
  8247. }
  8248. }
  8249. clickLeftBtn() {
  8250. this.hide();
  8251. xGame.common.gameMgr.gamePause = false;
  8252. switch (this.type) {
  8253. case TipsType.exitGame:
  8254. break;
  8255. case TipsType.foul:
  8256. break;
  8257. default:
  8258. break;
  8259. }
  8260. }
  8261. clickRightBtn() {
  8262. this.hide();
  8263. switch (this.type) {
  8264. case TipsType.exitGame:
  8265. xGame.eventMgr.event(RESET_GAME);
  8266. xGame.uiMgr.Show(UIMain);
  8267. Moyu.recordEnd(this, null);
  8268. xGame.common.longHelpLine = false;
  8269. break;
  8270. case TipsType.foul:
  8271. xGame.common.gameMgr.gamePause = false;
  8272. Laya.timer.clearAll(this);
  8273. break;
  8274. default:
  8275. break;
  8276. }
  8277. }
  8278. }
  8279. UITips.uiName = "UITips";
  8280. class GameMgr {
  8281. constructor() {
  8282. this.selfCamp = "";
  8283. this.selfFoulNum = 0;
  8284. this.selfBallArr = [];
  8285. this.selfTimer = 0;
  8286. this.selfScore = 0;
  8287. this.aiCamp = "";
  8288. this.aiFoulNum = 0;
  8289. this.aiBallArr = [];
  8290. this.aiTimer = 0;
  8291. this.aiScore = 0;
  8292. this.aiSkillLevelNum = 1;
  8293. this.targertScore = 0;
  8294. this.setTime = 30;
  8295. this.selfTurnRate = 0.5;
  8296. this.accTime = 0;
  8297. this.curFoul = "";
  8298. this.maxFoulTimes = 3;
  8299. this.isFirstInGame = true;
  8300. this.firstColliObj = null;
  8301. this.inHoleBalls = [];
  8302. this.blackNum = 8;
  8303. this.success = false;
  8304. this.holePosList = [];
  8305. this.posObj = {};
  8306. this._selfTurn = false;
  8307. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8308. this.ensureBallType = false;
  8309. this.isOpenBall = true;
  8310. this.finishOneShoot = true;
  8311. this.isEnd = false;
  8312. this.isChangeTurn = false;
  8313. this.isInterrupt = false;
  8314. this.aiPlayedBreakArmy = false;
  8315. this.isTouchedBall = false;
  8316. this.finishBalls = 0;
  8317. this.needBalls = 0;
  8318. this.allBallNum = 0;
  8319. this.placeBallPosData = {};
  8320. this.curHP = 0;
  8321. this.showLongView = false;
  8322. this.firstShoot = true;
  8323. this._gamePause = false;
  8324. this.trunCount = 0;
  8325. this.isBlackInHole = false;
  8326. this.isEnter = true;
  8327. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8328. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8329. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8330. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8331. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8332. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8333. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8334. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8335. }
  8336. get gamePause() {
  8337. return this._gamePause;
  8338. }
  8339. set gamePause(v) {
  8340. if (v) {
  8341. Laya.physicsTimer.pause();
  8342. }
  8343. else {
  8344. Laya.physicsTimer.resume();
  8345. }
  8346. this._gamePause = v;
  8347. }
  8348. get selfTurn() {
  8349. return this._selfTurn;
  8350. }
  8351. set selfTurn(val) {
  8352. this.trunCount++;
  8353. this._selfTurn = val;
  8354. if (val) {
  8355. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8356. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8357. }
  8358. else {
  8359. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8360. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8361. if (this.trunCount > 1)
  8362. PlatMgr.openBox();
  8363. }
  8364. }
  8365. resetGame() {
  8366. this.inHoleBalls = [];
  8367. this.isFirstInGame = true;
  8368. this.firstColliObj = null;
  8369. this.aiCamp = "";
  8370. this.selfCamp = "";
  8371. this.aiFoulNum = 0;
  8372. this.selfFoulNum = 0;
  8373. this.selfBallArr = [];
  8374. this.aiBallArr = [];
  8375. this.gamePause = false;
  8376. this.ensureBallType = false;
  8377. this.isInterrupt = false;
  8378. this.updateLeftBall();
  8379. this.clearTime();
  8380. this.aiPlayedBreakArmy = false;
  8381. this.isBlackInHole = false;
  8382. this.placeBallPosData = {};
  8383. if (xGame.common.d3World.knifeRoot) {
  8384. xGame.common.d3World.knifeRoot.destroyChildren();
  8385. }
  8386. }
  8387. gameReady() {
  8388. this.trunCount = 0;
  8389. this.firstColliObj = null;
  8390. this.isFirstInGame = true;
  8391. this.selfTurn = Math.random() <= this.selfTurnRate;
  8392. let challengeNum = DataMgr.getChallengeTimes();
  8393. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8394. this.selfTurn = true;
  8395. }
  8396. if (xGame.common.gameMode == GameMode.placeBall)
  8397. this.selfTurn = true;
  8398. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8399. this.selfTurn = true;
  8400. }
  8401. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8402. this.checkGuide();
  8403. if (xGame.common.uiRodMethod)
  8404. xGame.common.uiRodMethod.resetRod();
  8405. xGame.common.d2World.getHelpLine();
  8406. this.isOpenBall = true;
  8407. this.isTouchedBall = false;
  8408. xGame.common.aiPlayer.stopRun();
  8409. this.setTime = 30;
  8410. let ui = xGame.common.gameUI.ui;
  8411. switch (xGame.common.gameMode) {
  8412. case GameMode.classic:
  8413. xGame.common.aiPlayer.init();
  8414. this.blackNum = 8;
  8415. this.placeRootBall();
  8416. this.peoplePlay(9, 10);
  8417. ui.wordsBtn.visible = true;
  8418. ui.aiWordsBtn.visible = true;
  8419. xGame.common.talkMgr.changeAIState(true);
  8420. DataMgr.gameData.gameCount++;
  8421. DataMgr.saveGameData();
  8422. break;
  8423. case GameMode.bigMove:
  8424. this.blackNum = -1;
  8425. this.selfScore = 0;
  8426. this.aiScore = 0;
  8427. xGame.common.aiPlayer.init();
  8428. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8429. this.updateSelfScore();
  8430. this.updateAIScore();
  8431. this.updateTargetSroce();
  8432. this.placeRootBall();
  8433. this.peoplePlay(9, 10);
  8434. ui.wordsBtn.visible = true;
  8435. ui.aiWordsBtn.visible = true;
  8436. xGame.common.talkMgr.changeAIState(true);
  8437. if (DataMgr.getSkillGuide() < 1)
  8438. DataMgr.gameData.gameCount = 0;
  8439. else {
  8440. DataMgr.gameData.gameCount++;
  8441. DataMgr.saveGameData();
  8442. PlatMgr.openTry();
  8443. }
  8444. if (xGame.common.d3World.knifeRoot) {
  8445. xGame.common.d3World.knifeRoot.destroyChildren();
  8446. }
  8447. break;
  8448. case GameMode.placeBall:
  8449. this.blackNum = -1;
  8450. this.selfTurn = true;
  8451. this.setTime = 10000;
  8452. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8453. this.curHP = this.placeBallData.hp;
  8454. if (this.placeBallData.ball == -1)
  8455. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8456. else
  8457. this.needBalls = this.placeBallData.ball;
  8458. console.log("需要的进球数目", this.needBalls);
  8459. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8460. this.finishBalls = 0;
  8461. this.placeBallPosData = {};
  8462. this.updatePlaceBallPos();
  8463. this.updatePlaceBallState();
  8464. this.finishOneShoot = true;
  8465. xGame.common.gameUI.ui.moveNode.visible = false;
  8466. this.isOpenBall = false;
  8467. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8468. ui.wordsBtn.visible = false;
  8469. ui.aiWordsBtn.visible = false;
  8470. xGame.common.talkMgr.changeAIState(false);
  8471. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8472. PlatMgr.openBox();
  8473. });
  8474. break;
  8475. default:
  8476. break;
  8477. }
  8478. this.showLongView = false;
  8479. xGame.common.wordsMgr.comboTimes = 1;
  8480. let guide = DataMgr.getSkillGuide();
  8481. if (guide)
  8482. xGame.eventMgr.event(WAIT_SHOOT);
  8483. xGame.common.upSkillLevel = false;
  8484. xGame.common.gameStartTime = new Date().getTime();
  8485. this.firstShoot = true;
  8486. }
  8487. checkGuide() {
  8488. let guide = DataMgr.getSkillGuide();
  8489. let gameUI = xGame.common.gameUI.ui;
  8490. gameUI.guide1.visible = false;
  8491. gameUI.guide2.visible = false;
  8492. gameUI.guide3.visible = false;
  8493. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8494. this.selfTurn = true;
  8495. }
  8496. else {
  8497. return;
  8498. }
  8499. let oneBall = this.getOneBall();
  8500. gameUI.guide1.visible = true;
  8501. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8502. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8503. }
  8504. getOneBall() {
  8505. let arr = xGame.common.d2World.ballArr;
  8506. for (let index = 0; index < arr.length; index++) {
  8507. if (arr[index].number == 0)
  8508. continue;
  8509. return arr[index];
  8510. }
  8511. }
  8512. updateSelfScore() {
  8513. let ui = xGame.common.gameUI.ui.topNode;
  8514. ui.selfScoreTxt.text = this.selfScore + "";
  8515. }
  8516. updateAIScore() {
  8517. let ui = xGame.common.gameUI.ui.topNode;
  8518. ui.aiScoreTxt.text = this.aiScore + "";
  8519. }
  8520. updateTargetSroce() {
  8521. let ui = xGame.common.gameUI.ui.topNode;
  8522. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8523. }
  8524. updateLeftBall() {
  8525. let topUI = xGame.common.gameUI.ui.topNode;
  8526. topUI.selfBallList.numItems = this.selfBallArr.length;
  8527. topUI.aiBallList.numItems = this.aiBallArr.length;
  8528. }
  8529. ballShoot() {
  8530. this.clearTime();
  8531. this.finishOneShoot = false;
  8532. xGame.common.gameUI.ui.moveNode.visible = false;
  8533. if (xGame.common.gameUI.ui.guideNode.visible) {
  8534. xGame.common.gameUI.ui.guideNode.visible = false;
  8535. }
  8536. if (this.firstShoot) {
  8537. this.firstShoot = false;
  8538. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8539. }
  8540. }
  8541. ensureCamp(number) {
  8542. this.ensureBallType = true;
  8543. this.isOpenBall = false;
  8544. if (xGame.common.gameMode != GameMode.classic)
  8545. return;
  8546. let full = [1, 2, 3, 4, 5, 6, 7];
  8547. let flower = [9, 10, 11, 12, 13, 14, 15];
  8548. let sayWords = "";
  8549. if (this.selfTurn) {
  8550. if (number <= 7) {
  8551. this.selfCamp = ballCamp.full;
  8552. this.selfBallArr = full;
  8553. this.aiCamp = ballCamp.flower;
  8554. this.aiBallArr = flower;
  8555. sayWords = cfgTable.wordsData[3].msg;
  8556. }
  8557. else {
  8558. this.selfCamp = ballCamp.flower;
  8559. this.selfBallArr = flower;
  8560. this.aiCamp = ballCamp.full;
  8561. this.aiBallArr = full;
  8562. sayWords = cfgTable.wordsData[4].msg;
  8563. }
  8564. }
  8565. else {
  8566. if (number <= 7) {
  8567. this.selfCamp = ballCamp.flower;
  8568. this.selfBallArr = flower;
  8569. this.aiCamp = ballCamp.full;
  8570. this.aiBallArr = full;
  8571. sayWords = cfgTable.wordsData[2].msg;
  8572. }
  8573. else {
  8574. this.selfCamp = ballCamp.full;
  8575. this.selfBallArr = full;
  8576. this.aiCamp = ballCamp.flower;
  8577. this.aiBallArr = flower;
  8578. sayWords = cfgTable.wordsData[1].msg;
  8579. }
  8580. }
  8581. this.updateLeftBall();
  8582. xGame.uiMgr.Show(UIMsg, sayWords);
  8583. }
  8584. updatePlaceBallState() {
  8585. let ui = xGame.common.gameUI.ui;
  8586. switch (this.placeBallData.type) {
  8587. case PlaceBallType.normal:
  8588. let normal = ui.placeNormalNode;
  8589. normal.hpTxt.text = this.curHP + "";
  8590. this.updatePlaceBallStar(normal);
  8591. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8592. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8593. break;
  8594. case PlaceBallType.challenge:
  8595. let challenge = ui.placeChallengeNode;
  8596. challenge.hpTxt.text = "Shots:" + this.curHP;
  8597. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8598. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8599. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8600. break;
  8601. default:
  8602. break;
  8603. }
  8604. }
  8605. playSubHpAni() {
  8606. let ui = xGame.common.gameUI.ui;
  8607. switch (this.placeBallData.type) {
  8608. case PlaceBallType.normal:
  8609. let normal = ui.placeNormalNode;
  8610. normal.hpTxt.visible = false;
  8611. normal.starAni.c1.selectedIndex = 1;
  8612. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8613. normal.hpTxt.visible = true;
  8614. normal.starAni.c1.selectedIndex = 0;
  8615. }));
  8616. break;
  8617. default:
  8618. break;
  8619. }
  8620. }
  8621. getEndStarNum() {
  8622. let num;
  8623. let level = xGame.common.placeBallCurLevel;
  8624. if (this.curHP == this.placeBallData.hp) {
  8625. num = 3;
  8626. }
  8627. else if (this.curHP <= 1) {
  8628. num = 1;
  8629. }
  8630. else {
  8631. num = 2;
  8632. }
  8633. if (!this.success) {
  8634. num = 0;
  8635. }
  8636. else {
  8637. DataMgr.setPlaceBallLevel(level, num);
  8638. }
  8639. let myType = cfgTable.placeballData[level].type;
  8640. if (this.success && myType == 1) {
  8641. num = 3;
  8642. }
  8643. xGame.common.placeBallStarNum = num;
  8644. }
  8645. updatePlaceBallStar(node) {
  8646. let star = 0;
  8647. if (this.curHP == this.placeBallData.hp) {
  8648. star = 3;
  8649. }
  8650. else if (this.curHP >= 2) {
  8651. star = 2;
  8652. }
  8653. else if (this.curHP == 1) {
  8654. star = 1;
  8655. }
  8656. else {
  8657. star = 0;
  8658. }
  8659. let temp;
  8660. for (let index = 1; index <= 3; index++) {
  8661. temp = node["star" + index];
  8662. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8663. }
  8664. node.myProgress.value = (star / 3) * 100;
  8665. }
  8666. openRegretView(isFoul, GoalNum, challenge = false) {
  8667. let regretType = -1;
  8668. if (isFoul) {
  8669. regretType = 1;
  8670. }
  8671. else {
  8672. if (GoalNum <= 0) {
  8673. regretType = 0;
  8674. }
  8675. }
  8676. if (challenge) {
  8677. regretType = 1;
  8678. }
  8679. if (regretType != -1) {
  8680. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8681. if (success) {
  8682. this.curHP++;
  8683. this.updatePlaceBallState();
  8684. this.setPlaceBallAllPos();
  8685. xGame.common.gameUI.ui.moveNode.visible = false;
  8686. }
  8687. else {
  8688. if (this.curHP <= 0) {
  8689. this.success = false;
  8690. this.gameEnd();
  8691. }
  8692. this.playSubHpAni();
  8693. }
  8694. this.updatePlaceBallState();
  8695. this.updatePlaceBallPos();
  8696. });
  8697. }
  8698. }
  8699. setPlaceBallAllPos() {
  8700. let allBall = xGame.common.d2World.ballArr;
  8701. let cfgArr = this.placeBallPosData;
  8702. let temp;
  8703. let obj;
  8704. for (let index = 0; index < allBall.length; index++) {
  8705. temp = allBall[index];
  8706. if (temp.destroyed)
  8707. continue;
  8708. obj = cfgArr[temp.myUNID];
  8709. if (obj && obj.src && !obj.src.destroyed) {
  8710. temp.gameObj.x = obj.posX;
  8711. temp.gameObj.y = obj.posY;
  8712. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  8713. }
  8714. }
  8715. xGame.common.d2World.getHelpLine();
  8716. }
  8717. updatePlaceBallPos() {
  8718. let arr = xGame.common.d2World.ballArr;
  8719. let temp;
  8720. for (let index = 0; index < arr.length; index++) {
  8721. temp = arr[index];
  8722. if (!this.placeBallPosData[temp.myUNID]) {
  8723. this.placeBallPosData[temp.myUNID] = {
  8724. src: temp,
  8725. posX: temp.gameObj.x,
  8726. posY: temp.gameObj.y
  8727. };
  8728. }
  8729. else {
  8730. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  8731. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  8732. }
  8733. }
  8734. let check;
  8735. for (const key in this.placeBallPosData) {
  8736. check = this.placeBallPosData[key];
  8737. if (check.src.destroyed) {
  8738. delete this.placeBallPosData[key];
  8739. }
  8740. }
  8741. }
  8742. gameRun(type) {
  8743. if (this.gamePause)
  8744. return;
  8745. this.curFoul = this.getFoulType();
  8746. if (type) {
  8747. xGame.common.d2World.d2Gan.shoot();
  8748. xGame.common.gameUI.forceCancel();
  8749. this.curFoul = type;
  8750. }
  8751. this.isEnd = false;
  8752. this.isChangeTurn = true;
  8753. if (xGame.common.gameMode == GameMode.classic) {
  8754. this.judgeClassic(this.curFoul);
  8755. this.checkClassicWords(() => {
  8756. xGame.common.destroyClassicEmotion();
  8757. if (this.isEnd) {
  8758. if (this.isBlackInHole) {
  8759. xGame.common.gameUI.ui.blackAni.visible = true;
  8760. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  8761. xGame.common.gameUI.ui.blackAni.visible = false;
  8762. this.gameEnd();
  8763. }));
  8764. }
  8765. else {
  8766. this.gameEnd();
  8767. }
  8768. }
  8769. else {
  8770. this.waitShoot();
  8771. xGame.eventMgr.event(WAIT_SHOOT);
  8772. }
  8773. });
  8774. }
  8775. else if (xGame.common.gameMode == GameMode.bigMove) {
  8776. xGame.common.aiPlayer.stopRun();
  8777. let scoreArr = this.getScore(this.curFoul);
  8778. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  8779. this.isEnd = true;
  8780. }
  8781. this.checkBigSkillWords(() => {
  8782. if (this.isEnd) {
  8783. this.gameEnd();
  8784. }
  8785. else {
  8786. this.waitShoot();
  8787. xGame.eventMgr.event(WAIT_SHOOT);
  8788. }
  8789. });
  8790. }
  8791. else if (xGame.common.gameMode == GameMode.placeBall) {
  8792. xGame.common.destroyAwardSpine();
  8793. let isFoul = this.curFoul == FoulType.rootHole;
  8794. let GoalNum = this.inHoleBalls.length;
  8795. if (this.inHoleBalls.indexOf(0) > -1)
  8796. GoalNum -= 1;
  8797. if (isFoul) {
  8798. this.placeRootBall();
  8799. }
  8800. console.log("neeballs", this.needBalls);
  8801. console.log("当前完成的goalNum", GoalNum);
  8802. this.finishBalls += GoalNum;
  8803. console.log("当前完成的finishballs", this.finishBalls);
  8804. let need = this.needBalls;
  8805. if (this.placeBallData.type == PlaceBallType.challenge) {
  8806. need += 100;
  8807. }
  8808. if (this.finishBalls >= need) {
  8809. this.success = true;
  8810. this.gameEnd();
  8811. }
  8812. else {
  8813. switch (this.placeBallData.type) {
  8814. case PlaceBallType.normal:
  8815. if (!isFoul && GoalNum > 0) {
  8816. this.updatePlaceBallPos();
  8817. this.updatePlaceBallState();
  8818. }
  8819. else {
  8820. this.curHP--;
  8821. this.openRegretView(isFoul, GoalNum);
  8822. }
  8823. this.waitShoot();
  8824. xGame.eventMgr.event(WAIT_SHOOT);
  8825. break;
  8826. case PlaceBallType.challenge:
  8827. this.curHP--;
  8828. this.updatePlaceBallState();
  8829. if (isFoul) {
  8830. this.openRegretView(isFoul, GoalNum, true);
  8831. }
  8832. else {
  8833. this.updatePlaceBallPos();
  8834. if (this.curHP <= 0) {
  8835. this.success = true;
  8836. this.gameEnd();
  8837. }
  8838. }
  8839. this.waitShoot();
  8840. xGame.eventMgr.event(WAIT_SHOOT);
  8841. break;
  8842. default:
  8843. break;
  8844. }
  8845. }
  8846. }
  8847. }
  8848. checkClassicWords(callback) {
  8849. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  8850. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  8851. let type = this.getClassicWordsType();
  8852. if (condition && type != -1) {
  8853. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  8854. xGame.soundMgr.playSound(str);
  8855. xGame.common.wordsMgr.playClassicWords(type, callback);
  8856. }
  8857. else {
  8858. Laya.timer.once(300, this, () => {
  8859. callback && callback();
  8860. });
  8861. }
  8862. }
  8863. getClassicWordsType() {
  8864. let d2world = xGame.common.d2World;
  8865. let type = -1;
  8866. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  8867. type = ClassicWordsType.perfectShow;
  8868. return type;
  8869. }
  8870. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  8871. type = ClassicWordsType.directShoot;
  8872. return type;
  8873. }
  8874. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  8875. type = ClassicWordsType.anotherShoot;
  8876. return type;
  8877. }
  8878. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  8879. type = ClassicWordsType.bigPower;
  8880. return type;
  8881. }
  8882. let minSpeed = 1;
  8883. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  8884. type = ClassicWordsType.hardShoot;
  8885. return type;
  8886. }
  8887. if (this.inHoleBalls.length > 0) {
  8888. type = ClassicWordsType.directShoot;
  8889. return type;
  8890. }
  8891. return type;
  8892. }
  8893. checkBigSkillWords(callback) {
  8894. if (this.curFoul == FoulType.timeOut) {
  8895. callback && callback();
  8896. }
  8897. else {
  8898. let playSkill = false;
  8899. if (this.selfTurn) {
  8900. playSkill = true;
  8901. }
  8902. else {
  8903. if (!this.aiPlayedBreakArmy) {
  8904. this.aiPlayedBreakArmy = true;
  8905. playSkill = true;
  8906. }
  8907. if (this.aiCurSkill != SkillType.breakArmy) {
  8908. playSkill = true;
  8909. }
  8910. }
  8911. if (xGame.common.skillMgr.playedLastSkill) {
  8912. xGame.common.skillMgr.playedLastSkill = false;
  8913. playSkill = false;
  8914. }
  8915. if (playSkill) {
  8916. xGame.common.skillMgr.runBigSkill((extraScore) => {
  8917. let selfExtra = 0;
  8918. let aiExtra = 0;
  8919. if (this.selfTurn)
  8920. selfExtra += extraScore;
  8921. else
  8922. aiExtra += extraScore;
  8923. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  8924. this.isEnd = true;
  8925. }
  8926. this.playBigSkillTimes(callback);
  8927. });
  8928. }
  8929. else {
  8930. this.playBigSkillTimes(callback);
  8931. }
  8932. }
  8933. }
  8934. playBigSkillTimes(callback) {
  8935. let length = this.inHoleBalls.length;
  8936. if (this.inHoleBalls.indexOf(0) > -1) {
  8937. length = this.inHoleBalls.length - 1;
  8938. }
  8939. if (length <= 0) {
  8940. callback && callback();
  8941. return;
  8942. }
  8943. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  8944. callback && callback();
  8945. });
  8946. }
  8947. playSkillTips() {
  8948. let levelNum = 0;
  8949. let curType;
  8950. if (this.selfTurn) {
  8951. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  8952. curType = this.selfCurSkill;
  8953. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  8954. levelNum += 5;
  8955. }
  8956. }
  8957. else {
  8958. levelNum = this.aiSkillLevelNum;
  8959. curType = this.aiCurSkill;
  8960. }
  8961. let str = ``;
  8962. switch (curType) {
  8963. case SkillType.highSpace:
  8964. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  8965. break;
  8966. case SkillType.breakArmy:
  8967. str = `You pocketed ${levelNum} extra balls`;
  8968. break;
  8969. case SkillType.ice:
  8970. str = `${levelNum * 2} extra balls were frozen`;
  8971. break;
  8972. case SkillType.fireworks:
  8973. str = `${levelNum} extra balls exploded `;
  8974. break;
  8975. case SkillType.GuanYu:
  8976. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  8977. break;
  8978. default:
  8979. break;
  8980. }
  8981. xGame.uiMgr.Show(UIMsg, str);
  8982. }
  8983. getFoulType() {
  8984. let foulType = "";
  8985. if (this.firstColliObj == null) {
  8986. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  8987. return FoulType.rootHole;
  8988. }
  8989. return FoulType.notTouch;
  8990. }
  8991. else {
  8992. if (this.selfTurn) {
  8993. if (this.selfBallArr.length > 0) {
  8994. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  8995. foulType = FoulType.wrongTouch;
  8996. }
  8997. }
  8998. else {
  8999. if (this.ensureBallType) {
  9000. }
  9001. else {
  9002. if (this.firstColliObj == this.blackNum) {
  9003. foulType = FoulType.wrongTouch;
  9004. }
  9005. }
  9006. }
  9007. }
  9008. else {
  9009. if (this.aiBallArr.length > 0) {
  9010. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9011. foulType = FoulType.wrongTouch;
  9012. }
  9013. }
  9014. else {
  9015. if (this.ensureBallType) {
  9016. }
  9017. else {
  9018. if (this.firstColliObj == this.blackNum) {
  9019. foulType = FoulType.wrongTouch;
  9020. }
  9021. }
  9022. }
  9023. }
  9024. if (this.inHoleBalls.length <= 0) {
  9025. return foulType;
  9026. }
  9027. let temp;
  9028. if (this.inHoleBalls.indexOf(0) > -1) {
  9029. foulType = FoulType.rootHole;
  9030. }
  9031. else {
  9032. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9033. temp = this.inHoleBalls[index];
  9034. if (this.selfTurn) {
  9035. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9036. foulType = FoulType.wrongHole;
  9037. break;
  9038. }
  9039. }
  9040. else {
  9041. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9042. foulType = FoulType.wrongHole;
  9043. break;
  9044. }
  9045. }
  9046. }
  9047. }
  9048. let foo;
  9049. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9050. temp = this.inHoleBalls[index];
  9051. foo = this.selfBallArr.indexOf(temp);
  9052. if (foo > -1) {
  9053. this.selfBallArr.splice(foo, 1);
  9054. }
  9055. foo = this.aiBallArr.indexOf(temp);
  9056. if (foo > -1) {
  9057. this.aiBallArr.splice(foo, 1);
  9058. }
  9059. }
  9060. this.updateLeftBall();
  9061. }
  9062. return foulType;
  9063. }
  9064. judgeGameEndByBlack(arr) {
  9065. if (this.selfTurn) {
  9066. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9067. this.selfFoulNum = this.maxFoulTimes;
  9068. return true;
  9069. }
  9070. }
  9071. else {
  9072. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9073. this.aiFoulNum = this.maxFoulTimes;
  9074. return true;
  9075. }
  9076. }
  9077. }
  9078. judgeClassic(type) {
  9079. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9080. xGame.common.aiPlayer.stopRun();
  9081. if (this.judgeNormalSuccess()) {
  9082. this.isEnd = true;
  9083. return;
  9084. }
  9085. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9086. if (this.selfTurn) {
  9087. if (isFoul) {
  9088. this.selfFoulNum++;
  9089. }
  9090. if (this.selfFoulNum >= this.maxFoulTimes) {
  9091. this.success = false;
  9092. this.isEnd = true;
  9093. return;
  9094. }
  9095. }
  9096. else {
  9097. if (isFoul)
  9098. this.aiFoulNum++;
  9099. if (this.aiFoulNum >= this.maxFoulTimes) {
  9100. this.success = true;
  9101. this.isEnd = true;
  9102. return;
  9103. }
  9104. }
  9105. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9106. this.isChangeTurn = false;
  9107. }
  9108. else {
  9109. this.isInterrupt = true;
  9110. }
  9111. }
  9112. waitShoot() {
  9113. if (xGame.common.gameMode == GameMode.classic) {
  9114. switch (this.curFoul) {
  9115. case FoulType.timeOut:
  9116. case FoulType.rootHole:
  9117. this.selfTurn = !this.selfTurn;
  9118. this.peoplePlay(5, 6, true);
  9119. break;
  9120. case FoulType.notTouch:
  9121. this.selfTurn = !this.selfTurn;
  9122. this.peoplePlay(7, 7);
  9123. break;
  9124. case FoulType.wrongHole:
  9125. this.selfTurn = !this.selfTurn;
  9126. this.peoplePlay(11, 11);
  9127. break;
  9128. default:
  9129. if (this.inHoleBalls.length > 0) {
  9130. this.peoplePlay(0, 0, false, false);
  9131. }
  9132. else {
  9133. this.selfTurn = !this.selfTurn;
  9134. this.peoplePlay(7, 7);
  9135. }
  9136. break;
  9137. }
  9138. }
  9139. else if (xGame.common.gameMode == GameMode.bigMove) {
  9140. if (this.curFoul == FoulType.timeOut) {
  9141. this.selfTurn = !this.selfTurn;
  9142. this.peoplePlay(14, 15);
  9143. this.placeRootBall();
  9144. }
  9145. else {
  9146. this.selfTurn = !this.selfTurn;
  9147. if (this.curFoul == FoulType.rootHole) {
  9148. this.peoplePlay(12, 13);
  9149. this.placeRootBall();
  9150. }
  9151. else {
  9152. this.peoplePlay(0, 0, false, false);
  9153. }
  9154. }
  9155. }
  9156. else if (xGame.common.gameMode == GameMode.placeBall) {
  9157. this.finishOneShoot = true;
  9158. }
  9159. this.gameResult();
  9160. }
  9161. gameResult() {
  9162. this.firstColliObj = null;
  9163. this.inHoleBalls = [];
  9164. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9165. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9166. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9167. if (xGame.common.uiRodMethod)
  9168. xGame.common.uiRodMethod.resetRod();
  9169. xGame.common.d2World.rootBall.showSelf();
  9170. this.clearIceSkill();
  9171. if (this.selfTurn) {
  9172. PlatMgr.gameInsert();
  9173. }
  9174. xGame.common.d3World.knifeRoot.destroyChildren();
  9175. if (this.selfTurn) {
  9176. xGame.common.gameUI.showHelpLineGuide();
  9177. xGame.common.gameUI.setTurnAlpha(true);
  9178. }
  9179. else {
  9180. xGame.common.gameUI.setTurnAlpha(false);
  9181. }
  9182. }
  9183. getScore(type) {
  9184. let selfAdd = 0;
  9185. let aiAdd = 0;
  9186. if (type == FoulType.timeOut) {
  9187. if (this.selfTurn)
  9188. aiAdd += 3;
  9189. else
  9190. selfAdd += 3;
  9191. }
  9192. else {
  9193. if (this.inHoleBalls.length > 0) {
  9194. if (this.selfTurn) {
  9195. if (type == FoulType.rootHole) {
  9196. aiAdd += 3;
  9197. if (this.inHoleBalls.length - 1 > 0) {
  9198. selfAdd += this.inHoleBalls.length - 1;
  9199. }
  9200. }
  9201. else {
  9202. selfAdd += this.inHoleBalls.length;
  9203. }
  9204. }
  9205. else {
  9206. if (type == FoulType.rootHole) {
  9207. selfAdd += 3;
  9208. if (this.inHoleBalls.length - 1 > 0) {
  9209. aiAdd += this.inHoleBalls.length - 1;
  9210. }
  9211. }
  9212. else {
  9213. aiAdd += this.inHoleBalls.length;
  9214. }
  9215. }
  9216. }
  9217. }
  9218. return [selfAdd, aiAdd];
  9219. }
  9220. judgeScoreEnd(selfAdd, aiAdd) {
  9221. this.selfScore += selfAdd;
  9222. this.aiScore += aiAdd;
  9223. this.updateAIScore();
  9224. this.updateSelfScore();
  9225. if (this.selfScore >= this.targertScore) {
  9226. this.success = true;
  9227. return true;
  9228. }
  9229. if (this.aiScore >= this.targertScore) {
  9230. this.success = false;
  9231. return true;
  9232. }
  9233. let ballArr = xGame.common.d2World.ballArr;
  9234. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9235. if (this.selfScore > this.aiScore) {
  9236. this.success = true;
  9237. return true;
  9238. }
  9239. else if (this.selfScore < this.aiScore) {
  9240. this.success = false;
  9241. return true;
  9242. }
  9243. else {
  9244. if (this.selfTurn) {
  9245. this.success = false;
  9246. }
  9247. else {
  9248. this.success = true;
  9249. }
  9250. return true;
  9251. }
  9252. }
  9253. }
  9254. clearIceSkill() {
  9255. let arr = xGame.common.d2World.ballArr;
  9256. let temp;
  9257. if (this.selfTurn) {
  9258. if (this.selfCurSkill == SkillType.ice) {
  9259. for (let index = 0; index < arr.length; index++) {
  9260. temp = arr[index];
  9261. if (temp.ballFunc == "ice") {
  9262. temp.setBallFunc("normal", "self");
  9263. }
  9264. }
  9265. }
  9266. }
  9267. else {
  9268. if (this.aiCurSkill == SkillType.ice) {
  9269. for (let index = 0; index < arr.length; index++) {
  9270. temp = arr[index];
  9271. if (temp.ballFunc == "ice") {
  9272. temp.setBallFunc("normal", "ai");
  9273. }
  9274. }
  9275. }
  9276. }
  9277. }
  9278. judgeNormalSuccess() {
  9279. if (this.selfTurn) {
  9280. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9281. this.success = true;
  9282. return true;
  9283. }
  9284. }
  9285. else {
  9286. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9287. this.success = false;
  9288. return true;
  9289. }
  9290. }
  9291. }
  9292. gameEnd() {
  9293. if (Moyu.isTT) {
  9294. xGame.common.screenImg = getScreenImg();
  9295. }
  9296. console.log("游戏结束", this.success);
  9297. xGame.common.aiPlayer.stopRun();
  9298. if (xGame.common.gameMode == GameMode.placeBall) {
  9299. this.getEndStarNum();
  9300. this.updatePlaceBallState();
  9301. }
  9302. this.isEnter = false;
  9303. Moyu.recordEnd(this, () => {
  9304. if (this.isEnter)
  9305. return;
  9306. this.isEnter = true;
  9307. console.log("进入录结束回调");
  9308. this.enterNext();
  9309. });
  9310. Laya.timer.once(1000, this, () => {
  9311. if (this.isEnter)
  9312. return;
  9313. this.isEnter = true;
  9314. this.enterNext();
  9315. });
  9316. xGame.common.longHelpLine = false;
  9317. }
  9318. enterNext() {
  9319. Laya.timer.clearAll(this);
  9320. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9321. xGame.uiMgr.Show(UIVideoShare, this.success);
  9322. }
  9323. else {
  9324. xGame.uiMgr.Show(UIGameEnd, this.success);
  9325. }
  9326. }
  9327. aiLeave() {
  9328. let ui = xGame.common.gameUI.ui;
  9329. ui.topNode.aiNameTxt.text = "offline";
  9330. }
  9331. aiGameEnd(suc) {
  9332. this.success = suc;
  9333. xGame.common.aiPlayer.stopRun();
  9334. if (this.success) {
  9335. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9336. Laya.timer.once(1000, this, () => {
  9337. this.clearTime();
  9338. this.gameEnd();
  9339. });
  9340. }
  9341. }
  9342. openTimer() {
  9343. let src = xGame.common.gameUI;
  9344. if (this.selfTurn) {
  9345. src.ui.topNode.selfProgress.visible = true;
  9346. src.ui.topNode.aiProgress.visible = false;
  9347. this.curTimer = src.ui.topNode.selfProgress;
  9348. }
  9349. else {
  9350. src.ui.topNode.selfProgress.visible = false;
  9351. src.ui.topNode.aiProgress.visible = true;
  9352. this.curTimer = src.ui.topNode.aiProgress;
  9353. }
  9354. this.accTime = 0;
  9355. Laya.timer.clearAll(this);
  9356. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9357. this.curTimer.value = 100;
  9358. }
  9359. updateTime(dt) {
  9360. if (this.gamePause)
  9361. return;
  9362. this.accTime += dt;
  9363. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9364. if (this.accTime >= this.setTime) {
  9365. this.clearTime();
  9366. console.log("时钟进入了gameRun");
  9367. this.gameRun(FoulType.timeOut);
  9368. }
  9369. }
  9370. clearTime() {
  9371. let src = xGame.common.gameUI;
  9372. src.ui.topNode.selfProgress.visible = false;
  9373. src.ui.topNode.aiProgress.visible = false;
  9374. Laya.timer.clearAll(this);
  9375. }
  9376. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9377. let ui = xGame.common.gameUI.ui;
  9378. let selfMsg, aiMsg;
  9379. if (sayWords) {
  9380. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9381. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9382. if (Foul) {
  9383. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9384. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9385. this.placeRootBall();
  9386. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9387. if (this.curFoul == FoulType.rootHole) {
  9388. if (!DataMgr.getRootBallFoul()) {
  9389. DataMgr.setRootBallFoul();
  9390. aiMsg = "";
  9391. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9392. let woman = "Boss, pay attention next time~";
  9393. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9394. }
  9395. }
  9396. else if (this.curFoul == FoulType.timeOut) {
  9397. if (!DataMgr.getTimeoutFoul()) {
  9398. DataMgr.setTimeoutFoul();
  9399. aiMsg = "";
  9400. let tips = "Game timeout, 3 fouls, this game failed.";
  9401. let woman = "Boss, pay attention to the timeline~";
  9402. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9403. }
  9404. }
  9405. }
  9406. }
  9407. }
  9408. if (this.selfTurn) {
  9409. if (sayWords) {
  9410. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9411. ui.selfTurn.visible = true;
  9412. ui.aiTurn.visible = false;
  9413. ui.selfTurn.t0.play();
  9414. Moyu.vibration();
  9415. });
  9416. }
  9417. }
  9418. else {
  9419. let aiNum = xGame.tools.random(1, 11);
  9420. let challengeNum = DataMgr.getChallengeTimes();
  9421. let delay = false;
  9422. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9423. aiNum = 9;
  9424. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9425. aiNum = 3;
  9426. if (challengeNum == 3) {
  9427. if (!this.showLongView) {
  9428. this.showLongView = true;
  9429. delay = true;
  9430. }
  9431. }
  9432. }
  9433. }
  9434. if (delay) {
  9435. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9436. if (success) {
  9437. xGame.common.longHelpLine = true;
  9438. xGame.common.d2World.getHelpLine();
  9439. }
  9440. else {
  9441. aiNum = 10;
  9442. }
  9443. xGame.common.aiPlayer.setAiLevel(aiNum);
  9444. if (sayWords) {
  9445. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9446. xGame.common.aiPlayer.runAI();
  9447. ui.selfTurn.visible = false;
  9448. ui.aiTurn.visible = true;
  9449. ui.aiTurn.t0.play();
  9450. });
  9451. }
  9452. else {
  9453. xGame.common.aiPlayer.runAI();
  9454. }
  9455. this.openTimer();
  9456. this.finishOneShoot = true;
  9457. if (this.selfTurn) {
  9458. ui.topNode.selfKuang.visible = true;
  9459. ui.topNode.aiKuang.visible = false;
  9460. ui.topNode.selfTips.visible = true;
  9461. ui.topNode.aiTips.visible = false;
  9462. }
  9463. else {
  9464. ui.topNode.selfKuang.visible = false;
  9465. ui.topNode.aiKuang.visible = true;
  9466. ui.topNode.selfTips.visible = false;
  9467. ui.topNode.aiTips.visible = true;
  9468. }
  9469. });
  9470. return;
  9471. }
  9472. if (xGame.common.gameMode == GameMode.classic) {
  9473. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9474. if (cfg) {
  9475. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9476. aiNum = aiLevel;
  9477. }
  9478. }
  9479. xGame.common.aiPlayer.setAiLevel(aiNum);
  9480. if (sayWords) {
  9481. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9482. xGame.common.aiPlayer.runAI();
  9483. ui.selfTurn.visible = false;
  9484. ui.aiTurn.visible = true;
  9485. ui.aiTurn.t0.play();
  9486. });
  9487. }
  9488. else {
  9489. xGame.common.aiPlayer.runAI();
  9490. }
  9491. }
  9492. this.openTimer();
  9493. this.finishOneShoot = true;
  9494. if (this.selfTurn) {
  9495. ui.topNode.selfKuang.visible = true;
  9496. ui.topNode.aiKuang.visible = false;
  9497. ui.topNode.selfTips.visible = true;
  9498. ui.topNode.aiTips.visible = false;
  9499. }
  9500. else {
  9501. ui.topNode.selfKuang.visible = false;
  9502. ui.topNode.aiKuang.visible = true;
  9503. ui.topNode.selfTips.visible = false;
  9504. ui.topNode.aiTips.visible = true;
  9505. }
  9506. }
  9507. placeRootBall() {
  9508. let rootBall = xGame.common.d2World.rootBall;
  9509. if (!rootBall)
  9510. return;
  9511. rootBall.gameObj.x = this.lastRootBallPos.x;
  9512. rootBall.gameObj.y = this.lastRootBallPos.y;
  9513. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9514. let moveNode = xGame.common.gameUI.ui.moveNode;
  9515. moveNode.visible = true;
  9516. moveNode.x = this.lastRootBallPos.x;
  9517. moveNode.y = this.lastRootBallPos.y;
  9518. if (!this.selfTurn) {
  9519. xGame.common.aiPlayer.resetRoot();
  9520. }
  9521. }
  9522. }
  9523. class ui_guanyuAni extends fgui.GComponent {
  9524. static createInstance() {
  9525. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9526. }
  9527. onConstruct() {
  9528. this.n0 = (this.getChild("n0"));
  9529. }
  9530. }
  9531. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9532. class UIFireworks extends UIBase {
  9533. constructor() {
  9534. super();
  9535. }
  9536. onConstructor() {
  9537. this.isEject = false;
  9538. }
  9539. show(callback) {
  9540. super.show();
  9541. }
  9542. }
  9543. UIFireworks.uiName = "UIFireworks";
  9544. class ui_UIGuanYu extends fgui.GComponent {
  9545. static createInstance() {
  9546. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9547. }
  9548. onConstruct() {
  9549. this.n2 = (this.getChild("n2"));
  9550. this.n1 = (this.getChild("n1"));
  9551. this.n3 = (this.getChild("n3"));
  9552. this.n4 = (this.getChild("n4"));
  9553. this.n5 = (this.getChild("n5"));
  9554. this.n6 = (this.getChild("n6"));
  9555. this.n8 = (this.getChild("n8"));
  9556. this.n7 = (this.getChild("n7"));
  9557. this.t0 = this.getTransition("t0");
  9558. }
  9559. }
  9560. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9561. class UIGuanYu extends UIBase {
  9562. constructor() {
  9563. super();
  9564. }
  9565. onConstructor() {
  9566. this.ui = ui_UIGuanYu.createInstance();
  9567. this.contentPane = this.ui;
  9568. this.isEject = false;
  9569. }
  9570. show(callback) {
  9571. super.show();
  9572. this.ui.t0.play(Laya.Handler.create(this, () => {
  9573. callback && callback();
  9574. this.hide();
  9575. }));
  9576. }
  9577. }
  9578. UIGuanYu.uiName = "UIGuanYu";
  9579. class SkillMgr {
  9580. constructor() {
  9581. this.leveNum = 0;
  9582. this.extraScore = 0;
  9583. this.selfTurn = false;
  9584. this.playedLastSkill = false;
  9585. this.tweenArr = [];
  9586. this._finishNum = 0;
  9587. this._curFinish = 0;
  9588. this._rootX = 0;
  9589. this._rootY = 0;
  9590. this.knifeTimes = 0;
  9591. this.knifeV2 = new Laya.Vector2();
  9592. this.knifeV3 = new Laya.Vector3();
  9593. this.rtStarX = 0;
  9594. this.rtStarY = 0;
  9595. this.addBigSkillSpine();
  9596. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9597. }
  9598. addBigSkillSpine() {
  9599. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9600. console.log("extra2 success");
  9601. });
  9602. }
  9603. runBigSkill(callback) {
  9604. this.tweenArr = [];
  9605. this.callback = callback;
  9606. this.judgeSkill();
  9607. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9608. let guide = DataMgr.getSkillGuide();
  9609. if (!xGame.common.gameMgr.selfTurn) {
  9610. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9611. }
  9612. else {
  9613. if (xGame.common.temSelfLevel != 0) {
  9614. this.leveNum = xGame.common.temSelfLevel;
  9615. }
  9616. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9617. this.leveNum += 5;
  9618. }
  9619. }
  9620. if (guide == 0) {
  9621. DataMgr.setSkillGuide(1);
  9622. if (DataMgr.getNewUser()) {
  9623. Moyu.sendDataEvent("gameFirstPlay");
  9624. DataMgr.setNewUser();
  9625. }
  9626. }
  9627. this.playSpineAni(() => {
  9628. switch (this.curSkill) {
  9629. case SkillType.highSpace:
  9630. this.runHighSpace();
  9631. break;
  9632. case SkillType.breakArmy:
  9633. this.runBreakArmy();
  9634. break;
  9635. case SkillType.ice:
  9636. this.runIce();
  9637. break;
  9638. case SkillType.fireworks:
  9639. this.runFireworks();
  9640. break;
  9641. case SkillType.GuanYu:
  9642. this.runGuanYu();
  9643. break;
  9644. default:
  9645. break;
  9646. }
  9647. });
  9648. }
  9649. judgeSkill() {
  9650. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9651. let gameMgr = xGame.common.gameMgr;
  9652. let type;
  9653. for (let index = 0; index < typeArr.length; index++) {
  9654. type = typeArr[index];
  9655. if (gameMgr.selfTurn) {
  9656. if (gameMgr.selfCurSkill == type) {
  9657. this.selfTurn = true;
  9658. this.curSkill = type;
  9659. return;
  9660. }
  9661. }
  9662. else {
  9663. if (gameMgr.aiCurSkill == type) {
  9664. this.selfTurn = false;
  9665. this.curSkill = type;
  9666. return;
  9667. }
  9668. }
  9669. }
  9670. }
  9671. playSpineAni(callback) {
  9672. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9673. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9674. parent.destroyChildren();
  9675. let aniIndex = 0;
  9676. let skillSpine;
  9677. switch (this.curSkill) {
  9678. case SkillType.highSpace:
  9679. aniIndex = 1;
  9680. xGame.soundMgr.playSound("skill01");
  9681. skillSpine = this.skillSpine2;
  9682. data.scaleX = 0.5;
  9683. data.scaleY = 0.5;
  9684. skillSpine.play(data, 1, false, parent, () => {
  9685. callback && callback();
  9686. });
  9687. break;
  9688. case SkillType.breakArmy:
  9689. aniIndex = 2;
  9690. xGame.soundMgr.playSound("skill02");
  9691. skillSpine = this.skillSpine2;
  9692. data.scaleX = 0.5;
  9693. data.scaleY = 0.5;
  9694. skillSpine.play(data, 2, false, parent, () => {
  9695. callback && callback();
  9696. });
  9697. break;
  9698. case SkillType.ice:
  9699. aniIndex = 0;
  9700. xGame.soundMgr.playSound("skill03");
  9701. skillSpine = this.skillSpine2;
  9702. data.scaleX = 0.5;
  9703. data.scaleY = 0.5;
  9704. skillSpine.play(data, 0, false, parent, () => {
  9705. callback && callback();
  9706. });
  9707. break;
  9708. case SkillType.fireworks:
  9709. xGame.soundMgr.playSound("skill_04_01");
  9710. xGame.soundMgr.playSound("skill04");
  9711. xGame.uiMgr.Show(UIFireworks, callback);
  9712. break;
  9713. case SkillType.GuanYu:
  9714. xGame.soundMgr.playSound("skill05_1");
  9715. xGame.soundMgr.playSound("skill05");
  9716. xGame.uiMgr.Show(UIGuanYu, callback);
  9717. break;
  9718. default:
  9719. break;
  9720. }
  9721. }
  9722. getAllBallArr() {
  9723. let arr = xGame.common.d2World.ballArr;
  9724. let outArr = [];
  9725. for (let index = 0; index < arr.length; index++) {
  9726. if (arr[index] instanceof D2RootBallSrc)
  9727. continue;
  9728. if (arr[index].ballFunc == "ice")
  9729. continue;
  9730. if (arr[index].destroyed)
  9731. continue;
  9732. outArr.push(arr[index]);
  9733. }
  9734. return outArr;
  9735. }
  9736. getOneArr(deletObj) {
  9737. let allArr = this.getAllBallArr();
  9738. let temp;
  9739. for (let index = 0; index < allArr.length; index++) {
  9740. temp = allArr[index];
  9741. if (temp.id == deletObj.id) {
  9742. allArr.splice(index, 1);
  9743. break;
  9744. }
  9745. }
  9746. return allArr;
  9747. }
  9748. getNearBallBag(ball) {
  9749. let ui = xGame.common.gameUI.ui;
  9750. let circleArr = [];
  9751. for (let index = 1; index <= 6; index++) {
  9752. circleArr.push(ui.border["circle" + index]);
  9753. }
  9754. let outIndex = 0;
  9755. let temp;
  9756. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  9757. ;
  9758. let dis = 0;
  9759. for (let index = 1; index < circleArr.length; index++) {
  9760. temp = circleArr[index];
  9761. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  9762. if (dis < min) {
  9763. min = dis;
  9764. outIndex = index;
  9765. }
  9766. }
  9767. return [circleArr[outIndex], outIndex];
  9768. }
  9769. ballFlyToBag(ballArr, time = 300) {
  9770. let temp;
  9771. let hole;
  9772. this._finishNum = ballArr.length;
  9773. this._curFinish = 0;
  9774. let holeObj = {};
  9775. let holeCfg = {
  9776. "1": 0,
  9777. "2": 0,
  9778. "3": 0,
  9779. "4": 0,
  9780. "5": 0,
  9781. "6": 0
  9782. };
  9783. for (let index = 0; index < ballArr.length; index++) {
  9784. temp = ballArr[index];
  9785. temp.outColli.isSensor = true;
  9786. temp.innerColli.isSensor = true;
  9787. temp.isRunSkillAni = true;
  9788. let holeArr = this.getNearBallBag(temp);
  9789. hole = holeArr[0];
  9790. holeObj[index] = holeArr[1];
  9791. temp.d3BallSrc.scaleXYZ = 0.5;
  9792. this.tweenArr.push(temp.d3BallSrc, temp);
  9793. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9794. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  9795. }));
  9796. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  9797. let mIndex = holeObj[this._curFinish];
  9798. let isDone = holeCfg[mIndex];
  9799. if (isDone) {
  9800. ballArr[this._curFinish].checkWrongBall(false);
  9801. }
  9802. else {
  9803. holeCfg[mIndex] = 1;
  9804. ballArr[this._curFinish].checkWrongBall();
  9805. }
  9806. this._curFinish++;
  9807. if (this._curFinish >= this._finishNum) {
  9808. if (this.curSkill == SkillType.highSpace) {
  9809. }
  9810. else if (this.curSkill == SkillType.breakArmy) {
  9811. let rootBall = xGame.common.d2World.rootBall;
  9812. rootBall.gameObj.x = this._rootX;
  9813. rootBall.gameObj.y = this._rootY;
  9814. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9815. xGame.common.d2World.d2Gan.ui.visible = true;
  9816. xGame.common.d2World.d2HelpLine.ui.visible = true;
  9817. xGame.common.d2World.getHelpLine();
  9818. this.callback && this.callback(this.extraScore);
  9819. }
  9820. }
  9821. }));
  9822. }
  9823. }
  9824. runHighSpace() {
  9825. let rootBall = xGame.common.d2World.rootBall;
  9826. rootBall.showSelf();
  9827. let d3Src = rootBall.d3BallSrc;
  9828. let allArr = this.getAllBallArr();
  9829. if (allArr.length <= 0) {
  9830. this.callback && this.callback(0);
  9831. return;
  9832. }
  9833. let selectBall = xGame.common.d2World.targetBall;
  9834. let wrong = selectBall && selectBall.destroyed;
  9835. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  9836. selectBall = xGame.common.getRandArrEle(allArr);
  9837. }
  9838. let targetD3Src = selectBall.d3BallSrc;
  9839. xGame.common.d2World.d2Gan.ui.visible = false;
  9840. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9841. d3Src.scaleXYZ = 0.5;
  9842. this.tweenArr.push(d3Src);
  9843. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  9844. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9845. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  9846. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  9847. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  9848. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  9849. let outArr = [selectBall];
  9850. let other = this.leveNum - 1;
  9851. if (other > 0) {
  9852. let nearArr = this.getOneArr(selectBall);
  9853. if (nearArr.length > 0) {
  9854. xGame.common.botherArr(nearArr);
  9855. if (other >= nearArr.length)
  9856. other = nearArr.length;
  9857. for (let index = 0; index < other; index++) {
  9858. outArr.push(nearArr[index]);
  9859. }
  9860. }
  9861. }
  9862. xGame.common.extraMoveNum = other + 1;
  9863. this.extraScore = other + 1;
  9864. this._rootX = selectBall.gameObj.x;
  9865. this._rootY = selectBall.gameObj.y;
  9866. rootBall.gameObj.x = this._rootX;
  9867. rootBall.gameObj.y = this._rootY;
  9868. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  9869. Laya.Tween.clearAll(d3Src);
  9870. this.addRandomForce(outArr);
  9871. }));
  9872. }));
  9873. }
  9874. addRandomForce(outArr) {
  9875. if (outArr.length > 0) {
  9876. xGame.common.d2World.openCheckStill = true;
  9877. this.playedLastSkill = true;
  9878. }
  9879. let temp;
  9880. for (let index = 0; index < outArr.length; index++) {
  9881. let angle = xGame.common.randomNum(0, 360);
  9882. let linearPercent = xGame.common.randomNum(65, 100);
  9883. temp = outArr[index];
  9884. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  9885. }
  9886. }
  9887. setLinearSpeed(angle, rigy, linearPercent) {
  9888. let sin = Math.sin(angle * Math.PI / 180);
  9889. let cos = Math.cos(angle * Math.PI / 180);
  9890. let maxSpeed = 4;
  9891. let speed = new Laya.Vector2();
  9892. speed.x = maxSpeed * linearPercent * sin;
  9893. speed.y = -maxSpeed * linearPercent * cos;
  9894. rigy.applyLinearImpulseToCenter(speed);
  9895. }
  9896. runBreakArmy() {
  9897. xGame.common.d2World.d2Gan.ui.visible = false;
  9898. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9899. let gameUI = xGame.common.gameUI.ui;
  9900. gameUI.skillRod.visible = true;
  9901. gameUI.skillRod.rotation = 110;
  9902. let outArr = this.getAllBallArr();
  9903. if (outArr.length <= 0) {
  9904. gameUI.skillRod.visible = false;
  9905. this.callback && this.callback(0);
  9906. return;
  9907. }
  9908. xGame.common.botherArr(outArr);
  9909. if (this.leveNum >= outArr.length)
  9910. this.leveNum = outArr.length;
  9911. let deleteNum = outArr.length - this.leveNum;
  9912. outArr.splice(0, deleteNum);
  9913. this.extraScore = this.leveNum;
  9914. let potX = gameUI.skillRod.x;
  9915. let potY = gameUI.skillRod.y;
  9916. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  9917. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  9918. let disArr = [];
  9919. for (let index = 0; index < outArr.length; index++) {
  9920. let obj = outArr[index];
  9921. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  9922. dis = Math.pow(dis, 0.5);
  9923. disArr.push(dis);
  9924. }
  9925. this.tweenArr.push(gameUI.skillRod);
  9926. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  9927. })).update = Laya.Handler.create(this, (e, t, c) => {
  9928. let angle = gameUI.skillRod.rotation;
  9929. let xx;
  9930. let yy;
  9931. let temp;
  9932. for (let index = 0; index < outArr.length; index++) {
  9933. temp = outArr[index];
  9934. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  9935. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  9936. yy -= 20;
  9937. temp.gameObj.x = xx;
  9938. temp.gameObj.y = yy;
  9939. temp.d3BallSrc.setTransPos(xx, yy);
  9940. }
  9941. if (angle <= 60) {
  9942. Laya.Tween.clearAll(gameUI.skillRod);
  9943. this.ballFlyToBag(outArr, 150);
  9944. gameUI.skillRod.visible = false;
  9945. }
  9946. }, null, false);
  9947. }
  9948. runIce() {
  9949. let ballArr = xGame.common.d2World.ballArr;
  9950. this.leveNum *= 2;
  9951. if (this.leveNum >= ballArr.length - 1)
  9952. this.leveNum = ballArr.length - 1;
  9953. let tempArr = [];
  9954. let outArr = [];
  9955. for (let index = 0; index < ballArr.length; index++) {
  9956. if (ballArr[index] instanceof D2RootBallSrc)
  9957. continue;
  9958. tempArr.push(ballArr[index]);
  9959. }
  9960. if (tempArr.length <= 0) {
  9961. this.callback && this.callback(0);
  9962. return;
  9963. }
  9964. xGame.common.botherArr(tempArr);
  9965. for (let index = 0; index < this.leveNum; index++) {
  9966. outArr.push(tempArr[index]);
  9967. }
  9968. this.extraScore = this.leveNum;
  9969. let temp;
  9970. for (let index = 0; index < outArr.length; index++) {
  9971. temp = outArr[index];
  9972. temp.d3BallSrc.playIceEft();
  9973. }
  9974. Laya.timer.once(2000, this, () => {
  9975. for (let index = 0; index < outArr.length; index++) {
  9976. temp = outArr[index];
  9977. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  9978. temp.setBallFunc("ice", str);
  9979. }
  9980. this.callback && this.callback(0);
  9981. });
  9982. }
  9983. runFireworks() {
  9984. let allArr = this.getAllBallArr();
  9985. if (allArr.length <= 0) {
  9986. this.callback && this.callback(0);
  9987. return;
  9988. }
  9989. xGame.common.d2World.d2Gan.ui.visible = false;
  9990. xGame.common.d2World.d2HelpLine.ui.visible = false;
  9991. let outArr = [];
  9992. let other = this.leveNum;
  9993. if (other > 0) {
  9994. if (allArr.length > 0) {
  9995. xGame.common.botherArr(allArr);
  9996. if (other >= allArr.length)
  9997. other = allArr.length;
  9998. for (let index = 0; index < other; index++) {
  9999. outArr.push(allArr[index]);
  10000. }
  10001. }
  10002. }
  10003. xGame.common.extraMoveNum = other;
  10004. this.extraScore = other;
  10005. this.addRandmomFireworks(outArr);
  10006. }
  10007. addRandmomFireworks(outArr) {
  10008. Laya.timer.once(1100, this, () => {
  10009. if (outArr.length > 0) {
  10010. xGame.common.d2World.openCheckStill = true;
  10011. this.playedLastSkill = true;
  10012. }
  10013. });
  10014. xGame.soundMgr.playSound("skill_04_02");
  10015. let temp;
  10016. let delay = -200;
  10017. for (let index = 0; index < outArr.length; index++) {
  10018. temp = outArr[index];
  10019. delay += 200;
  10020. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10021. let angle = xGame.common.randomNum(0, 360);
  10022. angle = this.getFireworksAngle(obj);
  10023. let linearPercent = xGame.common.randomNum(45, 80);
  10024. if (!obj.destroyed)
  10025. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10026. });
  10027. }
  10028. }
  10029. getFireworksAngle(obj) {
  10030. let rootBall = xGame.common.d2World.rootBall;
  10031. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10032. }
  10033. resetGame() {
  10034. Laya.timer.clearAll(this);
  10035. if (this.tweenArr) {
  10036. for (let index = 0; index < this.tweenArr.length; index++) {
  10037. Laya.Tween.clearAll(this.tweenArr[index]);
  10038. }
  10039. }
  10040. this.tweenArr = null;
  10041. }
  10042. runGuanYu() {
  10043. xGame.common.d2World.d2Gan.ui.visible = false;
  10044. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10045. let rootBall = xGame.common.d2World.rootBall;
  10046. if (rootBall.isInHole) {
  10047. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10048. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10049. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10050. rootBall.showSelf();
  10051. }
  10052. this.rtStarX = rootBall.gameObj.x;
  10053. this.rtStarY = rootBall.gameObj.y;
  10054. this.knifeTimes = 0;
  10055. this.playedLastSkill = true;
  10056. rootBall.forceRun = true;
  10057. rootBall.rigy.type = "static";
  10058. xGame.common.d2World.openCheckStill = true;
  10059. this.guanyuRandomKnife();
  10060. }
  10061. guanyuRandomKnife() {
  10062. let rootBall = xGame.common.d2World.rootBall;
  10063. let dir = this.getRandDir();
  10064. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10065. console.log("当前angle", angle);
  10066. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10067. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10068. let dis = 324;
  10069. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10070. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10071. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10072. this.rtStarX = rootBall.gameObj.x;
  10073. this.rtStarY = rootBall.gameObj.y;
  10074. this.knifeTimes++;
  10075. let skillLevel;
  10076. if (xGame.common.gameMgr.selfTurn) {
  10077. skillLevel = DataMgr.getBigSkillByIndex(4);
  10078. }
  10079. else {
  10080. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10081. }
  10082. if (!skillLevel)
  10083. skillLevel = 1;
  10084. skillLevel += 2;
  10085. if (this.knifeTimes < skillLevel) {
  10086. Laya.timer.once(400, this, () => {
  10087. this.guanyuRandomKnife();
  10088. });
  10089. }
  10090. else {
  10091. rootBall.forceRun = false;
  10092. rootBall.rigy.type = "dynamic";
  10093. xGame.common.extraMoveNum = skillLevel;
  10094. }
  10095. }));
  10096. }
  10097. getRandDir() {
  10098. let rootBall = xGame.common.d2World.rootBall;
  10099. let allBall = this.getAllBallArr();
  10100. let target = xGame.common.getRandArrEle(allBall);
  10101. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10102. return this.knifeV2;
  10103. }
  10104. cloneKnife(x, y, rotation) {
  10105. let parent = xGame.common.d3World.knifeRoot;
  10106. let prefab = xGame.common.d3World.knife;
  10107. let clone = prefab.clone();
  10108. parent.addChild(clone);
  10109. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10110. clone.transform.localPositionX = this.knifeV3.x;
  10111. clone.transform.localPositionY = 0;
  10112. clone.transform.localPositionZ = this.knifeV3.z;
  10113. clone.transform.localRotationEulerX = 0;
  10114. clone.transform.localRotationEulerY = rotation;
  10115. clone.transform.localRotationEulerZ = 0;
  10116. clone.active = true;
  10117. return clone;
  10118. }
  10119. cloneGuanYuEft(x, y, angle) {
  10120. return;
  10121. let parent = xGame.common.gameUI.ui.guanyuNode;
  10122. let eft = new ui_guanyuAni();
  10123. eft.parent = parent;
  10124. eft.x = x;
  10125. eft.y = y;
  10126. eft.rotation = angle;
  10127. }
  10128. }
  10129. class ui_UIWordsList extends fgui.GComponent {
  10130. static createInstance() {
  10131. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10132. }
  10133. onConstruct() {
  10134. this.c1 = this.getController("c1");
  10135. this.n74 = (this.getChild("n74"));
  10136. this.clickNode = (this.getChild("clickNode"));
  10137. this.myNode = (this.getChild("myNode"));
  10138. this.n68 = (this.getChild("n68"));
  10139. this.n66 = (this.getChild("n66"));
  10140. this.n55 = (this.getChild("n55"));
  10141. this.wordsBtn = (this.getChild("wordsBtn"));
  10142. this.emotionBtn = (this.getChild("emotionBtn"));
  10143. this.mybggg = (this.getChild("mybggg"));
  10144. this.wordsList = (this.getChild("wordsList"));
  10145. this.emotionList = (this.getChild("emotionList"));
  10146. this.myRoot = (this.getChild("myRoot"));
  10147. }
  10148. }
  10149. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10150. class EmotionDisplay {
  10151. constructor(index, ui) {
  10152. this.ui = ui;
  10153. this.index = index;
  10154. this.ui.onClick(this, this.clickSelf);
  10155. this.updateSelf();
  10156. }
  10157. updateSelf() {
  10158. let data = cfgTable.emotionData[this.index + 1];
  10159. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10160. }
  10161. clickSelf() {
  10162. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10163. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10164. xGame.common.talkMgr.closeTalkView();
  10165. }
  10166. }
  10167. class WordsDisplay {
  10168. constructor(index, ui) {
  10169. this.ui = ui;
  10170. this.index = index;
  10171. this.ui.onClick(this, this.clickSelf);
  10172. this.updateSelf();
  10173. }
  10174. updateSelf() {
  10175. let data = cfgTable.talkwordsData[this.index + 1];
  10176. this.ui.txt.text = data.msg;
  10177. }
  10178. clickSelf() {
  10179. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10180. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10181. xGame.common.talkMgr.closeTalkView();
  10182. }
  10183. }
  10184. class UIWordsList extends UIBase {
  10185. constructor() {
  10186. super();
  10187. }
  10188. onConstructor() {
  10189. this.ui = ui_UIWordsList.createInstance();
  10190. this.contentPane = this.ui;
  10191. this.isEject = false;
  10192. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10193. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10194. this.addUIClick(this.ui.clickNode, this.hide);
  10195. this.initTalkList();
  10196. this.initEmotionList();
  10197. }
  10198. show() {
  10199. super.show();
  10200. }
  10201. initTalkList() {
  10202. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10203. let data = cfgTable.talkwordsData;
  10204. let length = Object.keys(data).length;
  10205. this.ui.wordsList.numItems = length;
  10206. }
  10207. initEmotionList() {
  10208. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10209. let data = cfgTable.emotionData;
  10210. let length = Object.keys(data).length;
  10211. this.ui.emotionList.numItems = length;
  10212. }
  10213. renderTalkItem(index, obj) {
  10214. let temp = new WordsDisplay(index, obj);
  10215. }
  10216. renderEmotionItem(index, obj) {
  10217. let temp = new EmotionDisplay(index, obj);
  10218. }
  10219. openTalkList() {
  10220. this.ui.c1.selectedIndex = 0;
  10221. }
  10222. openEmotionList() {
  10223. this.ui.c1.selectedIndex = 1;
  10224. }
  10225. }
  10226. UIWordsList.uiName = "UIWordsList";
  10227. class TalkMgr {
  10228. constructor() {
  10229. this.aiSpeak = true;
  10230. this.emotionList = [];
  10231. this.talkList = [];
  10232. this.addEvent();
  10233. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10234. this.emotionList = [];
  10235. this.talkList = [];
  10236. for (let k in cfgTable.emotionData) {
  10237. this.emotionList.push(cfgTable.emotionData[k].id);
  10238. }
  10239. for (let k in cfgTable.talkwordsData) {
  10240. this.talkList.push(cfgTable.talkwordsData[k].id);
  10241. }
  10242. }
  10243. addEvent() {
  10244. let ui = xGame.common.gameUI.ui;
  10245. ui.wordsBtn.visible = true;
  10246. ui.wordsBtn.onClick(this, this.openTalkView);
  10247. ui.aiWordsBtn.visible = true;
  10248. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10249. }
  10250. openTalkView() {
  10251. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10252. xGame.uiMgr.Show(UIWordsList);
  10253. }
  10254. closeTalkView() {
  10255. xGame.uiMgr.Hide(UIWordsList);
  10256. }
  10257. clickAIState() {
  10258. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10259. this.aiSpeak = !this.aiSpeak;
  10260. this.changeAIState(this.aiSpeak);
  10261. }
  10262. changeAIState(speak) {
  10263. this.aiSpeak = speak;
  10264. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10265. if (speak) {
  10266. btn.c1.selectedIndex = 0;
  10267. }
  10268. else {
  10269. btn.c1.selectedIndex = 1;
  10270. }
  10271. }
  10272. showSelfTalk(wordsId) {
  10273. let ui = xGame.common.gameUI.ui;
  10274. ui.selfTalk.visible = true;
  10275. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10276. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10277. ui.selfTalk.t0.play();
  10278. }
  10279. showSelfEmotion(emotionId) {
  10280. let ui = xGame.common.gameUI.ui;
  10281. ui.selfTalk.visible = true;
  10282. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10283. this.selfSpine && this.selfSpine.dispose();
  10284. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10285. let spineData = cfgTable.emotionData[emotionId].spine;
  10286. this.selfSpine = new SpineMgr(spineData, () => {
  10287. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10288. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10289. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10290. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10291. });
  10292. ui.selfTalk.t0.play();
  10293. }
  10294. showAITalk(wordsId) {
  10295. if (!this.aiSpeak)
  10296. return;
  10297. if (DataMgr.gameData.gameCount < 2)
  10298. return;
  10299. if (wordsId < 1)
  10300. wordsId = this.getRandTalk();
  10301. let ui = xGame.common.gameUI.ui;
  10302. ui.aiTalk.visible = true;
  10303. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10304. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10305. ui.aiTalk.t0.play();
  10306. }
  10307. getRandTalk() {
  10308. let rand = xGame.tools.random(0, this.talkList.length);
  10309. return this.emotionList[rand];
  10310. }
  10311. getRandEmotion() {
  10312. let rand = xGame.tools.random(0, this.emotionList.length);
  10313. return this.emotionList[rand];
  10314. }
  10315. showAIEmotion(emotionId) {
  10316. if (!this.aiSpeak)
  10317. return;
  10318. if (DataMgr.gameData.gameCount < 2)
  10319. return;
  10320. if (emotionId < 1)
  10321. emotionId = this.getRandEmotion();
  10322. let ui = xGame.common.gameUI.ui;
  10323. ui.aiTalk.visible = true;
  10324. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10325. this.aiSpine && this.aiSpine.dispose();
  10326. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10327. let spineData = cfgTable.emotionData[emotionId].spine;
  10328. this.aiSpine = new SpineMgr(spineData, () => {
  10329. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10330. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10331. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10332. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10333. });
  10334. ui.aiTalk.t0.play();
  10335. }
  10336. resetGame() {
  10337. let ui = xGame.common.gameUI.ui;
  10338. ui.aiTalk.visible = false;
  10339. ui.selfTalk.visible = false;
  10340. this.aiSpine && this.aiSpine.dispose();
  10341. this.selfSpine && this.selfSpine.dispose();
  10342. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10343. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10344. this.closeTalkView();
  10345. }
  10346. }
  10347. class WordsMgr {
  10348. constructor() {
  10349. this.comboTimes = 1;
  10350. this.skillTimes = 0;
  10351. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10352. this.comboSpine = new SpineMgr("yxz_liangan");
  10353. this.skillSpine = new SpineMgr("yiganxqiu");
  10354. this.scoreSpine = new SpineMgr("defen");
  10355. }
  10356. setClassicCombo(isInterrupt) {
  10357. if (isInterrupt) {
  10358. this.comboTimes = 0;
  10359. }
  10360. }
  10361. playClassicWords(type, callback) {
  10362. this.callback = callback;
  10363. let aniIndex = type;
  10364. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10365. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10366. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10367. mySpine.destroy(true);
  10368. this.playClassicTimes();
  10369. });
  10370. }
  10371. playClassicTimes() {
  10372. this.comboTimes++;
  10373. if (this.comboTimes <= 1) {
  10374. this.callback && this.callback();
  10375. }
  10376. else {
  10377. let aniIndex = this.comboTimes - 1;
  10378. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10379. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10380. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10381. mySpine.destroy(true);
  10382. this.callback && this.callback();
  10383. });
  10384. }
  10385. }
  10386. playBigSkillTimes(times, callback) {
  10387. if (times <= 0) {
  10388. callback && callback();
  10389. return;
  10390. }
  10391. this.callback = callback;
  10392. let pre = "sz_0";
  10393. let aniIndex = 0;
  10394. this.getWordsImg(times, pre, () => {
  10395. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10396. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10397. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10398. let r1 = ``;
  10399. let r2 = ``;
  10400. if (times <= 9) {
  10401. r1 = `res/d2Res/${pre}${times}.png`;
  10402. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10403. aniIndex = 0;
  10404. }
  10405. else {
  10406. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10407. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10408. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10409. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10410. aniIndex = 1;
  10411. }
  10412. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10413. mySpine.destroy(true);
  10414. xGame.common.gameMgr.playSkillTips();
  10415. this.playScore(times);
  10416. xGame.common.playRandomMutiBallBigSkillSound();
  10417. }, mySpine);
  10418. });
  10419. }
  10420. playScore(score) {
  10421. let pre = "sz_";
  10422. let aniIndex = 0;
  10423. this.getWordsImg(score, pre, () => {
  10424. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10425. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10426. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10427. let r1 = ``;
  10428. let r2 = ``;
  10429. if (score <= 9) {
  10430. r1 = `res/d2Res/${pre}${score}.png`;
  10431. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10432. aniIndex = 0;
  10433. }
  10434. else {
  10435. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10436. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10437. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10438. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10439. aniIndex = 1;
  10440. }
  10441. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10442. mySpine.destroy(true);
  10443. this.callback && this.callback();
  10444. }, mySpine);
  10445. });
  10446. }
  10447. getWordsImg(number, pre = "", callback) {
  10448. let arr = [];
  10449. if (number <= 9) {
  10450. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10451. }
  10452. else {
  10453. 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 });
  10454. }
  10455. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10456. callback && callback();
  10457. }));
  10458. }
  10459. }
  10460. class ui_UIRodMethod extends fgui.GComponent {
  10461. static createInstance() {
  10462. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10463. }
  10464. onConstruct() {
  10465. this.n24 = (this.getChild("n24"));
  10466. this.white = (this.getChild("white"));
  10467. this.dot = (this.getChild("dot"));
  10468. this.sureBtn = (this.getChild("sureBtn"));
  10469. this.n20 = (this.getChild("n20"));
  10470. this.n21 = (this.getChild("n21"));
  10471. this.n22 = (this.getChild("n22"));
  10472. this.n23 = (this.getChild("n23"));
  10473. this.n5 = (this.getChild("n5"));
  10474. this.n14 = (this.getChild("n14"));
  10475. this.t0 = this.getTransition("t0");
  10476. }
  10477. }
  10478. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10479. class UIRodMethod extends UIBase {
  10480. constructor() {
  10481. super();
  10482. this.isPressd = false;
  10483. }
  10484. onConstructor() {
  10485. this.ui = ui_UIRodMethod.createInstance();
  10486. this.contentPane = this.ui;
  10487. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10488. this.moveDir = new Laya.Vector2();
  10489. this.moveDest = new Laya.Vector2();
  10490. this.centerPos = new Laya.Vector2();
  10491. xGame.common.uiRodMethod = this;
  10492. }
  10493. show() {
  10494. super.show();
  10495. xGame.common.gameMgr.gamePause = true;
  10496. this.openPressDotEvent();
  10497. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10498. this.centerPos.x = this.ui.white.x;
  10499. this.centerPos.y = this.ui.white.y;
  10500. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10501. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10502. this.setDot();
  10503. }
  10504. setDot() {
  10505. this.ui.dot.x = this.moveDest.x;
  10506. this.ui.dot.y = this.moveDest.y;
  10507. }
  10508. closeSelf() {
  10509. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10510. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10511. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10512. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10513. xGame.common.gameMgr.gamePause = false;
  10514. this.hide();
  10515. }
  10516. openPressDotEvent() {
  10517. this.closePressDotEvent();
  10518. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10519. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10520. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10521. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10522. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10523. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10524. }
  10525. closePressDotEvent() {
  10526. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10527. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10528. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10529. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10530. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10531. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10532. }
  10533. onDown(e) {
  10534. if (e.type == Laya.Event.MOUSE_DOWN)
  10535. this.isPressd = true;
  10536. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10537. this.isPressd = false;
  10538. if (!this.isPressd)
  10539. return;
  10540. this.moveDest.x = e.stageX;
  10541. this.moveDest.y = e.stageY;
  10542. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10543. if (dis > 6724) {
  10544. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10545. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10546. }
  10547. this.setDot();
  10548. }
  10549. resetRod() {
  10550. this.ui.dot.x = this.ui.white.x;
  10551. this.ui.dot.y = this.ui.white.y;
  10552. this.gameRod.dot.x = this.gameRod.bg.x;
  10553. this.gameRod.dot.y = this.gameRod.bg.y;
  10554. xGame.common.rodOffest.x = 0;
  10555. xGame.common.rodOffest.y = 0;
  10556. }
  10557. }
  10558. UIRodMethod.uiName = "UIRodMethod";
  10559. class UIGame extends UIBase {
  10560. constructor() {
  10561. super();
  10562. this.powerNum = 0;
  10563. this.isD3Inited = false;
  10564. this.isPrePlay = false;
  10565. this.isMoveRod = false;
  10566. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10567. this.rulerDis = 20;
  10568. this.rulerOffset = 0;
  10569. }
  10570. onConstructor() {
  10571. this.ui = ui_UIGame.createInstance();
  10572. this.contentPane = this.ui;
  10573. this.ui.x += xGame.common.sysOffestNum;
  10574. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10575. this.isEject = false;
  10576. xGame.common.gameUI = this;
  10577. this.initSelf();
  10578. }
  10579. isTurnSelf() {
  10580. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10581. return true;
  10582. }
  10583. }
  10584. initSelf() {
  10585. let topUI = this.ui.topNode;
  10586. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10587. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10588. this.barInfo = {};
  10589. this.barInfo.curY = 0;
  10590. this.barInfo.height = this.ui.powerNode.height;
  10591. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10592. this.barInfo.powerStartY = this.ui.powerNode.y;
  10593. xGame.common.aiPlayer = new AIPlayer();
  10594. xGame.common.gameMgr = new GameMgr();
  10595. xGame.common.skillMgr = new SkillMgr();
  10596. xGame.common.wordsMgr = new WordsMgr();
  10597. xGame.common.talkMgr = new TalkMgr();
  10598. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10599. console.log("加载经典模式表情文件chenggon !");
  10600. });
  10601. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10602. console.log("挑战模式奖励模式spine加载成功!");
  10603. });
  10604. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10605. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10606. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10607. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10608. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10609. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10610. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10611. }
  10612. getGanZiImg() {
  10613. let index = DataMgr.getCurBallRod();
  10614. let data = cfgTable.ballrodData[index + 1];
  10615. let gan_url = xGame.common.getGameIconUrl(data.img);
  10616. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10617. this.ui.powerNode.showImg.url = gan_url;
  10618. console.log('zh:修改杆子图标O K');
  10619. }
  10620. returnHome() {
  10621. let tips = "Are you sure to exit the game?";
  10622. let woman = "Boss, why don't you play for a while longer?";
  10623. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10624. }
  10625. addRodMethodClick() {
  10626. if (this.isTurnSelf()) {
  10627. xGame.uiMgr.Show(UIRodMethod);
  10628. }
  10629. }
  10630. clickHelpLineBtn(force = false) {
  10631. if (!this.isTurnSelf())
  10632. return;
  10633. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10634. if (success) {
  10635. xGame.common.longHelpLine = true;
  10636. xGame.common.d2World.getHelpLine();
  10637. Moyu.sendDataEvent("guideNum");
  10638. }
  10639. else {
  10640. }
  10641. });
  10642. }
  10643. renderSelfDisplayBalls(index, target) {
  10644. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10645. target.myImg.url = xGame.common.getGameIconUrl(str);
  10646. }
  10647. renderAIDisplayBalls(index, target) {
  10648. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10649. target.myImg.url = xGame.common.getGameIconUrl(str);
  10650. ;
  10651. }
  10652. updateMode() {
  10653. if (xGame.common.gameMode == GameMode.classic) {
  10654. this.ui.topNode.scoreNode.visible = false;
  10655. }
  10656. else if (xGame.common.gameMode == GameMode.bigMove) {
  10657. this.ui.topNode.scoreNode.visible = true;
  10658. }
  10659. }
  10660. show() {
  10661. super.show();
  10662. console.log("zh:uigame show AADD");
  10663. this.ui.alpha = 0;
  10664. this.updateSelf();
  10665. xGame.common.gameMgr.gamePause = false;
  10666. xGame.common.gameUI.ui.blackAni.visible = false;
  10667. xGame.common.gameUI.ui.whiteAni.visible = false;
  10668. this.ui.powerEft.visible = false;
  10669. this.ui.colorNode.visible = false;
  10670. this.updateHead();
  10671. let curUse = DataMgr.getCurBallRod();
  10672. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10673. this.getGanZiImg();
  10674. }
  10675. updateSelf() {
  10676. if (xGame.common.gameMode == GameMode.classic) {
  10677. this.ui.c1.selectedIndex = 0;
  10678. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10679. this.ui.topNode.middleNode.visible = true;
  10680. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10681. }
  10682. else if (xGame.common.gameMode == GameMode.bigMove) {
  10683. this.ui.c1.selectedIndex = 0;
  10684. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10685. this.ui.topNode.middleNode.visible = false;
  10686. let max = xGame.cfgMgr.getMaxBigMoveLength();
  10687. let rand = xGame.common.randomNum(1, max);
  10688. let guide = DataMgr.getSkillGuide();
  10689. if (guide == 0)
  10690. rand = 1;
  10691. xGame.common.bigMoveLevelIndex = rand;
  10692. }
  10693. else if (xGame.common.gameMode == GameMode.placeBall) {
  10694. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  10695. this.ui.c1.selectedIndex = 1 + data.type;
  10696. this.ui.alpha = 1;
  10697. this.startGame();
  10698. }
  10699. this.updateMode();
  10700. this.initD3world();
  10701. this.initD2world();
  10702. }
  10703. startGame() {
  10704. this.ui.snowNode.visible = Math.random() <= 0.1;
  10705. this.ui.d2Node.visible = false;
  10706. xGame.common.d3World.d3Hand.gameObj.active = false;
  10707. xGame.common.d3World.tableSrc.init();
  10708. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10709. this.cameraViewChange(() => {
  10710. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  10711. switch (xGame.common.gameMode) {
  10712. case GameMode.classic:
  10713. xGame.common.d3World.d3Hand.gameObj.active = true;
  10714. this.playPutBallD3Ani();
  10715. break;
  10716. case GameMode.bigMove:
  10717. this.enterGame();
  10718. Laya.timer.once(500, this, () => {
  10719. this.ui.topNode.middleNode.visible = true;
  10720. this.ui.topNode.middleNode.t0.play();
  10721. });
  10722. break;
  10723. case GameMode.placeBall:
  10724. this.enterGame();
  10725. break;
  10726. default:
  10727. break;
  10728. }
  10729. });
  10730. PlatMgr.showBanner(false);
  10731. }
  10732. enterGame() {
  10733. this.ui.d2Node.visible = true;
  10734. xGame.common.d3World.d3Hand.gameObj.active = false;
  10735. xGame.common.showOneCamera("mainCamera");
  10736. Moyu.recordGame(30, true);
  10737. if (!this.isPrePlay) {
  10738. this.isPrePlay = true;
  10739. xGame.common.d3World.prePlayEft();
  10740. }
  10741. xGame.common.gameMgr.gameReady();
  10742. this.openAllEvent();
  10743. this.ui.snowNode.visible = false;
  10744. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  10745. this.ui.helpBtn.visible = condition;
  10746. }
  10747. showHelpLineGuide() {
  10748. let longGuide = DataMgr.getGuideHelpLine();
  10749. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  10750. this.ui.helpBtn.visible = true;
  10751. this.ui.guideNode.visible = true;
  10752. }
  10753. }
  10754. setTurnAlpha(alpha) {
  10755. this.ui.keduNode.alpha = alpha;
  10756. this.ui.ganNode.alpha = alpha;
  10757. this.ui.rodMethodNode.alpha = alpha;
  10758. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  10759. }
  10760. cameraViewChange(callback) {
  10761. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  10762. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  10763. xGame.common.showOneCamera("visitAngle");
  10764. cameraSrc.localRotationEulerY = 180;
  10765. cameraSrc.localRotationEulerZ = 0;
  10766. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  10767. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  10768. callback && callback();
  10769. }));
  10770. }));
  10771. }
  10772. playPutBallD3Ani() {
  10773. xGame.common.showOneCamera("mainCamera");
  10774. let handSrc = xGame.common.d3World.d3Hand;
  10775. handSrc.gameObj.active = true;
  10776. handSrc.transform.localPositionZ = 3;
  10777. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10778. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  10779. handSrc.gameObj.active = false;
  10780. this.enterGame();
  10781. }), 400);
  10782. }));
  10783. }
  10784. updateHead() {
  10785. let user = Moyu.getUserInfo();
  10786. this.ui.topNode.selfNameTxt.text = user.nickName;
  10787. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  10788. let aiData = xGame.cfgMgr.getRandomUserInfo();
  10789. if (DataMgr.getSkillGuide() < 1) {
  10790. this.ui.topNode.aiNameTxt.text = 'billiards';
  10791. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  10792. }
  10793. else {
  10794. this.ui.topNode.aiNameTxt.text = aiData.name;
  10795. let randNo = Math.floor(Math.random() * 10) + 1;
  10796. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  10797. }
  10798. }
  10799. initD2world() {
  10800. let node = this.ui.d2Root.displayObject;
  10801. let src = node.getComponent(D2World);
  10802. if (!src) {
  10803. xGame.common.d2World = node.addComponent(D2World);
  10804. }
  10805. xGame.common.d2World.initSelf();
  10806. }
  10807. initD3world() {
  10808. if (this.isD3Inited)
  10809. return;
  10810. this.isD3Inited = true;
  10811. let scene3D = xGame.common.d3Scene;
  10812. this.ui.d3Root.displayObject.addChild(scene3D);
  10813. scene3D.active = true;
  10814. xGame.common.d3World.tableSrc.setBorderPos();
  10815. }
  10816. onRootMove(e) {
  10817. let rootBall = xGame.common.d2World.rootBall;
  10818. this.ui.moveNode.x = e.x;
  10819. this.ui.moveNode.y = e.y;
  10820. rootBall.gameObj.x = e.x;
  10821. rootBall.gameObj.y = e.y;
  10822. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  10823. }
  10824. aiRootMove(move) {
  10825. if (move)
  10826. this.hideBallUI();
  10827. else {
  10828. this.showBallUI();
  10829. xGame.common.d2World.getHelpLine();
  10830. }
  10831. }
  10832. aiForce(type, force = 0) {
  10833. this.pressTarget = PressType.powerNode;
  10834. if (type == 1)
  10835. this.onEventUp({ force: true });
  10836. else if (type == 2)
  10837. this.onEventMove({ stageY: force, force: true });
  10838. }
  10839. onEventPress(e) {
  10840. if (e.stopPropagation)
  10841. e.stopPropagation();
  10842. if (!this.isTurnSelf())
  10843. return;
  10844. let target = e.target;
  10845. switch (target) {
  10846. case this.ui.myPowerNode.displayObject:
  10847. this.pressTarget = PressType.powerNode;
  10848. this.barInfo.curY = e.stageY;
  10849. this.updateBarInfo();
  10850. break;
  10851. case this.ui.moveNode.displayObject:
  10852. this.pressTarget = PressType.moveNode;
  10853. this.hideBallUI();
  10854. this.eventObj.curX = this.ui.moveNode.x;
  10855. this.eventObj.curY = this.ui.moveNode.y;
  10856. this.ui.moveNode.finger.visible = false;
  10857. this.eventObj.lastX = e.stageX;
  10858. this.eventObj.lastY = e.stageY;
  10859. break;
  10860. case this.ui.rulerClickNode.displayObject:
  10861. this.pressTarget = PressType.rulerNode;
  10862. this.eventObj.lastY = e.stageY;
  10863. break;
  10864. case this.ui.d2Root.displayObject:
  10865. this.pressTarget = PressType.d2Root;
  10866. this.eventObj.lastX = e.stageX;
  10867. this.eventObj.lastY = e.stageY;
  10868. this.eventObj.starX = e.stageX;
  10869. this.eventObj.starY = e.stageY;
  10870. this.eventObj.curX = 0;
  10871. this.eventObj.curY = 0;
  10872. xGame.common.d2World.d2Gan.setGanLastInfo();
  10873. this.rulerOffset = 0;
  10874. break;
  10875. default:
  10876. break;
  10877. }
  10878. }
  10879. onEventMove(e) {
  10880. if (e.stopPropagation)
  10881. e.stopPropagation();
  10882. if (e && e.force) {
  10883. }
  10884. else {
  10885. if (!this.isTurnSelf())
  10886. return;
  10887. }
  10888. switch (this.pressTarget) {
  10889. case PressType.powerNode:
  10890. this.barInfo.curY = e.stageY;
  10891. this.updateBarInfo();
  10892. this.isMoveRod = true;
  10893. break;
  10894. case PressType.moveNode:
  10895. let rootBall = xGame.common.d2World.rootBall;
  10896. let radius = rootBall.gameObj.width / 2;
  10897. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  10898. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  10899. let border = xGame.common.d2World.borderRect;
  10900. if (curX <= border.x + radius)
  10901. curX = border.x + radius;
  10902. else if (curX >= border.x + border.width - radius)
  10903. curX = border.x + border.width - radius;
  10904. if (curY <= border.y + radius)
  10905. curY = border.y + radius;
  10906. else if (curY >= border.y + border.height - radius)
  10907. curY = border.y + border.height - radius;
  10908. if (xGame.common.gameMgr.isOpenBall) {
  10909. if (curX >= border.x + border.openBallW - radius)
  10910. curX = border.x + border.openBallW - radius;
  10911. }
  10912. this.ui.moveNode.x = curX;
  10913. this.ui.moveNode.y = curY;
  10914. rootBall.gameObj.x = curX;
  10915. rootBall.gameObj.y = curY;
  10916. rootBall.d3BallSrc.setTransPos(curX, curY);
  10917. this.isMoveRod = true;
  10918. break;
  10919. case PressType.rulerNode:
  10920. let yy = e.stageY - this.eventObj.lastY;
  10921. this.eventObj.lastY = e.stageY;
  10922. let ruler1 = this.ui.rulerNode.img1;
  10923. let ruler2 = this.ui.rulerNode.img2;
  10924. ruler1.y += yy;
  10925. ruler2.y += yy;
  10926. this.rulerOffset += yy;
  10927. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  10928. this.rulerOffset = 0;
  10929. xGame.soundMgr.playSound("inch", 1, 10);
  10930. }
  10931. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  10932. let h = ruler1.height;
  10933. this.checkGuide();
  10934. this.isMoveRod = true;
  10935. if (ruler1.y >= h) {
  10936. ruler1.y = -h;
  10937. ruler2.y = 0;
  10938. return;
  10939. }
  10940. else if (ruler1.y <= -h) {
  10941. ruler1.y = h;
  10942. ruler2.y = 0;
  10943. return;
  10944. }
  10945. if (ruler2.y >= h) {
  10946. ruler2.y = -h;
  10947. ruler1.y = 0;
  10948. return;
  10949. }
  10950. else if (ruler2.y <= -h) {
  10951. ruler2.y = h;
  10952. ruler1.y = 0;
  10953. return;
  10954. }
  10955. break;
  10956. case PressType.d2Root:
  10957. this.eventObj.curX = e.stageX;
  10958. this.eventObj.curY = e.stageY;
  10959. let offset = this.checkRodMoveDir();
  10960. xGame.common.d2World.d2Gan.rotateSelf(offset);
  10961. this.eventObj.lastX = e.stageX;
  10962. this.eventObj.lastY = e.stageY;
  10963. break;
  10964. default:
  10965. break;
  10966. }
  10967. }
  10968. onEventUp(e) {
  10969. if (e.stopPropagation)
  10970. e.stopPropagation();
  10971. if (e && e.force) {
  10972. }
  10973. else {
  10974. if (!this.isTurnSelf())
  10975. return;
  10976. }
  10977. switch (this.pressTarget) {
  10978. case PressType.powerNode:
  10979. this.ui.powerNode.value = 0;
  10980. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  10981. this.ui.powerTxt.text = "";
  10982. if (this.powerNum > 0) {
  10983. xGame.eventMgr.event(BALL_SHOOT);
  10984. xGame.common.d2World.shoot(this.powerNum);
  10985. xGame.common.d2World.d2Gan.shoot();
  10986. xGame.common.d2World.d2HelpLine.shoot();
  10987. this.finishGuide();
  10988. this.ui.powerEft.visible = false;
  10989. this.ui.colorNode.visible = false;
  10990. let ganStr = "";
  10991. if (this.powerNum <= 30) {
  10992. ganStr = "gan_30";
  10993. }
  10994. else if (this.powerNum <= 60) {
  10995. ganStr = "gan_50";
  10996. }
  10997. else {
  10998. ganStr = "gan_80";
  10999. }
  11000. xGame.soundMgr.playSound(ganStr);
  11001. }
  11002. break;
  11003. case PressType.moveNode:
  11004. let rootBall = xGame.common.d2World.rootBall;
  11005. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11006. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11007. let isIntersect = this.judgeBallIntersect();
  11008. if (isIntersect) {
  11009. this.ui.moveNode.x = lastX;
  11010. this.ui.moveNode.y = lastY;
  11011. rootBall.gameObj.x = lastX;
  11012. rootBall.gameObj.y = lastY;
  11013. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11014. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11015. }
  11016. else {
  11017. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11018. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11019. }
  11020. this.showBallUI();
  11021. this.ui.moveNode.finger.visible = true;
  11022. xGame.common.d2World.getHelpLine();
  11023. break;
  11024. case PressType.rulerNode:
  11025. break;
  11026. case PressType.d2Root:
  11027. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11028. if (dis <= 25) {
  11029. this.moveToClickDot(e);
  11030. }
  11031. break;
  11032. default:
  11033. break;
  11034. }
  11035. this.pressTarget = -1;
  11036. }
  11037. checkGuide() {
  11038. let guide = DataMgr.getSkillGuide();
  11039. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11040. xGame.common.guideStep++;
  11041. xGame.common.gameUI.ui.guide2.visible = false;
  11042. xGame.common.gameUI.ui.guide3.visible = true;
  11043. }
  11044. }
  11045. finishGuide() {
  11046. let guide = DataMgr.getSkillGuide();
  11047. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11048. xGame.common.guideStep = 10;
  11049. this.closeAllGuide();
  11050. console.log('zh: 新手引导完毕');
  11051. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11052. }
  11053. }
  11054. closeAllGuide() {
  11055. xGame.common.gameUI.ui.guide1.visible = false;
  11056. xGame.common.gameUI.ui.guide2.visible = false;
  11057. xGame.common.gameUI.ui.guide3.visible = false;
  11058. }
  11059. updateBarInfo() {
  11060. let star = this.ui.powerNode.y;
  11061. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11062. if (rate >= 1)
  11063. rate = 1;
  11064. if (rate <= 0)
  11065. rate = 0;
  11066. this.powerNum = Math.ceil(rate * 100);
  11067. this.ui.powerNode.value = this.powerNum;
  11068. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11069. this.ui.colorNode.value = this.powerNum;
  11070. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11071. this.ui.powerEft.visible = this.powerNum != 0;
  11072. this.ui.colorNode.visible = this.powerNum != 0;
  11073. this.ui.powerTxt.text = this.powerNum + "";
  11074. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11075. }
  11076. forceCancel() {
  11077. this.ui.powerNode.value = 0;
  11078. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11079. this.ui.powerTxt.text = "";
  11080. }
  11081. checkRodMoveDir() {
  11082. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11083. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11084. if (tempX >= 0 && tempY <= 0) {
  11085. return this.checkDir();
  11086. }
  11087. else if (tempX < 0 && tempY < 0) {
  11088. return this.checkDir(1, -1);
  11089. }
  11090. else if (tempX < 0 && tempY > 0) {
  11091. return this.checkDir(-1, -1);
  11092. }
  11093. else {
  11094. return this.checkDir(-1, 1);
  11095. }
  11096. }
  11097. checkDir(flagX = 1, flagY = 1) {
  11098. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11099. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11100. if (offsetY == 0) {
  11101. return offsetX * flagX;
  11102. }
  11103. if (offsetX == 0) {
  11104. return offsetY * flagY;
  11105. }
  11106. let angle = offsetY / offsetX;
  11107. if (Math.abs(angle) >= 1) {
  11108. return offsetY * flagY;
  11109. }
  11110. else {
  11111. return offsetX * flagX;
  11112. }
  11113. }
  11114. judgeBallIntersect() {
  11115. let rootBall = xGame.common.d2World.rootBall;
  11116. let ballArr = xGame.common.d2World.ballArr;
  11117. let radius = rootBall.gameObj.width / 2;
  11118. let temp;
  11119. let isIntersect = false;
  11120. for (let index = 0; index < ballArr.length; index++) {
  11121. temp = ballArr[index];
  11122. if (temp.number == rootBall.number)
  11123. continue;
  11124. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11125. if (isIntersect) {
  11126. break;
  11127. }
  11128. }
  11129. return isIntersect;
  11130. }
  11131. hideBallUI() {
  11132. let d2Gan = xGame.common.d2World.d2Gan;
  11133. if (!d2Gan.ui.isDisposed)
  11134. d2Gan.ui.visible = false;
  11135. let d2Help = xGame.common.d2World.d2HelpLine;
  11136. if (!d2Help.ui.isDisposed)
  11137. d2Help.ui.visible = false;
  11138. let rootBall = xGame.common.d2World.rootBall;
  11139. if (!rootBall.destroyed) {
  11140. rootBall.gameObj.active = false;
  11141. }
  11142. }
  11143. showBallUI() {
  11144. let d2Gan = xGame.common.d2World.d2Gan;
  11145. if (!d2Gan.ui.isDisposed)
  11146. d2Gan.ui.visible = true;
  11147. let d2Help = xGame.common.d2World.d2HelpLine;
  11148. if (!d2Help.ui.isDisposed)
  11149. d2Help.ui.visible = true;
  11150. let rootBall = xGame.common.d2World.rootBall;
  11151. if (!rootBall.destroyed) {
  11152. rootBall.gameObj.active = true;
  11153. }
  11154. }
  11155. moveToClickDot(e) {
  11156. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11157. let root = xGame.common.d2World.rootBall.gameObj;
  11158. let xx = e.stageX - xGame.common.sysOffestNum;
  11159. let yy = e.stageY;
  11160. let x = xx - root.x;
  11161. let y = yy - root.y;
  11162. let angle = xGame.common.getfguiRotation(x, y);
  11163. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11164. xGame.common.d2World.getHelpLine();
  11165. }
  11166. this.isMoveRod = false;
  11167. xGame.common.clickedBall = false;
  11168. }
  11169. openAllEvent() {
  11170. this.closeAllEvent();
  11171. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11172. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11173. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11174. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11175. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11176. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11177. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11178. }
  11179. closeAllEvent() {
  11180. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11181. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11182. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11183. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11184. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11185. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11186. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11187. }
  11188. resetGame() {
  11189. this.closeAllEvent();
  11190. this.hideBallUI();
  11191. xGame.common.gameMgr.gamePause = true;
  11192. }
  11193. }
  11194. UIGame.uiName = "UIGame";
  11195. class UIAddProp extends UIBase {
  11196. constructor() {
  11197. super();
  11198. this.curType = "";
  11199. }
  11200. onConstructor() {
  11201. this.ui = ui_UIAddProp.createInstance();
  11202. this.contentPane = this.ui;
  11203. this.isEject = false;
  11204. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11205. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11206. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11207. this.updateUI();
  11208. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11209. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11210. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11211. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11212. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11213. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11214. }
  11215. show(type) {
  11216. super.show();
  11217. this.curType = type == 0 ? "coin" : "diamond";
  11218. this.switchBtn("");
  11219. this.ui.t0.play();
  11220. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11221. PlatMgr.showInsert(true);
  11222. }
  11223. closeSelf() {
  11224. this.hide();
  11225. }
  11226. updateUI() {
  11227. let data = cfgTable.moneyData;
  11228. let temp;
  11229. let obj;
  11230. for (const key in data) {
  11231. temp = data[key];
  11232. obj = this.ui.myNode["node" + key];
  11233. if (parseInt(key) <= 2) {
  11234. obj.diamondTxt.text = "+" + temp.num;
  11235. }
  11236. else {
  11237. obj.coinTxt.text = temp.num;
  11238. obj.diamondTxt.text = temp.get.split('_')[1];
  11239. }
  11240. }
  11241. this.updateDiamondShare();
  11242. }
  11243. updateDiamondShare() {
  11244. let data = DataMgr.getShareDiamondTimes();
  11245. if (data >= xGame.common.maxShareDiamondTimes) {
  11246. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11247. this.ui.myNode.node1.touchable = false;
  11248. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11249. }
  11250. else {
  11251. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11252. this.ui.myNode.node1.touchable = true;
  11253. }
  11254. }
  11255. switchBtn(type) {
  11256. if (type == "")
  11257. type = this.curType;
  11258. else {
  11259. if (this.curType == type) {
  11260. return;
  11261. }
  11262. else {
  11263. this.curType = type;
  11264. }
  11265. }
  11266. if (type == "coin") {
  11267. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11268. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11269. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11270. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11271. this.ui.myNode.c1.selectedIndex = 0;
  11272. }
  11273. else {
  11274. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11275. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11276. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11277. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11278. this.ui.myNode.c1.selectedIndex = 1;
  11279. }
  11280. }
  11281. convertCoin(index) {
  11282. let data = cfgTable.moneyData[index];
  11283. let coinNum = data.num;
  11284. let str = data.get.split('_')[1];
  11285. let needDiamond = parseInt(str);
  11286. if (DataMgr.diamondEnough(needDiamond)) {
  11287. DataMgr.setDiamond(-needDiamond);
  11288. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11289. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11290. }
  11291. else {
  11292. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11293. this.switchBtn("diamond");
  11294. }
  11295. }
  11296. videoGetDiamond() {
  11297. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11298. if (Laya.Browser.onAndroid) {
  11299. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11300. if (!boo) {
  11301. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11302. return;
  11303. }
  11304. }
  11305. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11306. }
  11307. else {
  11308. console.log('zh:AD 失败,直接发放奖励');
  11309. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11310. }
  11311. }
  11312. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11313. let num = cfgTable.moneyData[2].num;
  11314. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11315. this.closeSelf();
  11316. }
  11317. videoGetCoin() {
  11318. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11319. if (Laya.Browser.onAndroid) {
  11320. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11321. if (!boo) {
  11322. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11323. return;
  11324. }
  11325. }
  11326. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11327. }
  11328. else {
  11329. console.log('zh:AD 失败,直接发放奖励');
  11330. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11331. }
  11332. }
  11333. qjff_AD_for_uiAddProp_videoGetCoin() {
  11334. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11335. this.closeSelf();
  11336. }
  11337. shareGetDiamond() {
  11338. let times = DataMgr.getShareDiamondTimes();
  11339. if (times >= xGame.common.maxShareDiamondTimes) {
  11340. console.log('zh: 233333333333 maxShareDiamondTimes');
  11341. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11342. }
  11343. else {
  11344. console.log('zh:33333333333333ad');
  11345. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11346. if (Laya.Browser.onAndroid) {
  11347. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11348. if (!boo) {
  11349. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11350. return;
  11351. }
  11352. }
  11353. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11354. }
  11355. else {
  11356. console.log('zh:AD 失败,直接发放奖励');
  11357. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11358. }
  11359. }
  11360. }
  11361. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11362. let diamond = xGame.common.randomNum(50, 100);
  11363. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11364. DataMgr.setShareDiamondTimes(1);
  11365. this.updateDiamondShare();
  11366. }
  11367. openPutBallView() {
  11368. let end = xGame.uiMgr.getUI(UIGameEnd);
  11369. let skill = xGame.uiMgr.getUI(UISkill);
  11370. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11371. let uigame = xGame.uiMgr.getUI(UIGame);
  11372. if (end && !end.isHide) {
  11373. xGame.uiMgr.Hide(UIGameEnd);
  11374. xGame.uiMgr.Show(UIMain);
  11375. }
  11376. if (skill && !skill.isHide)
  11377. xGame.uiMgr.Hide(UISkill);
  11378. if (uigame && !uigame.isHide)
  11379. xGame.uiMgr.Hide(UIGame);
  11380. if (level && !level.isHide) {
  11381. }
  11382. else {
  11383. xGame.uiMgr.Show(UILevelDisplay);
  11384. }
  11385. this.closeSelf();
  11386. }
  11387. }
  11388. UIAddProp.uiName = "UIAddProp";
  11389. class MoneyNode {
  11390. constructor(ui) {
  11391. this.leftTime = 0;
  11392. this.ui = ui;
  11393. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11394. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11395. this.ui.addPowerBtn.onClick(this, this.addPower);
  11396. this.ui.c1.selectedIndex = 1;
  11397. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11398. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11399. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11400. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11401. this.coinChange();
  11402. this.diamondChange();
  11403. this.powerChange();
  11404. }
  11405. addPower() {
  11406. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11407. xGame.uiMgr.Show(UIPower);
  11408. }
  11409. powerChange() {
  11410. let powerNum = DataMgr.getPower();
  11411. this.ui.powerTxt.text = powerNum + "";
  11412. }
  11413. checkPowerTime() {
  11414. let cur = new Date().getTime();
  11415. let last = DataMgr.getPowerTime();
  11416. if (last == 0) {
  11417. last = cur;
  11418. DataMgr.setPowerTime(cur);
  11419. }
  11420. let power = DataMgr.getPower();
  11421. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11422. Laya.timer.clearAll(this);
  11423. if (power >= xGame.common.natureMaxPower) {
  11424. this.ui.powerTimeTxt.text = "";
  11425. DataMgr.setPowerTime(cur);
  11426. return;
  11427. }
  11428. if (power + offset >= xGame.common.natureMaxPower) {
  11429. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11430. this.ui.powerTimeTxt.text = "";
  11431. DataMgr.setPowerTime(cur);
  11432. }
  11433. else {
  11434. if (offset > 0) {
  11435. DataMgr.setPower(offset);
  11436. DataMgr.setPowerTime(cur);
  11437. }
  11438. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11439. this.leftTime = xGame.common.powerRecoverNum - time;
  11440. if (this.leftTime <= 0)
  11441. this.leftTime = 0;
  11442. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11443. Laya.timer.loop(1000, this, this.updatePowerTime);
  11444. }
  11445. }
  11446. updatePowerTime() {
  11447. this.leftTime -= 1;
  11448. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11449. if (this.leftTime <= 0) {
  11450. this.checkPowerTime();
  11451. }
  11452. }
  11453. coinChange() {
  11454. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11455. }
  11456. diamondChange() {
  11457. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11458. }
  11459. addCoin() {
  11460. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11461. Moyu.sendDataEvent("AddCoinBtn");
  11462. xGame.uiMgr.Show(UIAddProp, 0);
  11463. }
  11464. addDiamond() {
  11465. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11466. Moyu.sendDataEvent("AddDiamondBtn");
  11467. xGame.uiMgr.Show(UIAddProp, 1);
  11468. }
  11469. }
  11470. class UIDraw extends UIBase {
  11471. constructor() {
  11472. super();
  11473. this.curKey = 0;
  11474. }
  11475. onConstructor() {
  11476. this.ui = ui_UIDraw.createInstance();
  11477. this.contentPane = this.ui;
  11478. this.isEject = false;
  11479. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11480. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11481. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11482. this.initDraw();
  11483. this.initUI();
  11484. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11485. if (Moyu.isKs)
  11486. this.ui.closeNode.closeBtn.x += 100;
  11487. }
  11488. show() {
  11489. super.show();
  11490. this.ui.t0.play();
  11491. this.playSecretaryIdle();
  11492. this.updateDraw();
  11493. this.checkFree();
  11494. if (PlatMgr.bannerDelay > 0) {
  11495. this.ui.closeNode.closeBtn.visible = false;
  11496. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11497. this.ui.closeNode.closeBtn.visible = true;
  11498. });
  11499. }
  11500. PlatMgr.showRateBanner();
  11501. }
  11502. hide() {
  11503. Laya.timer.clearAll(this);
  11504. super.hide();
  11505. }
  11506. checkFree() {
  11507. let isFree = DataMgr.getDailyfreeDrawTimes();
  11508. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11509. }
  11510. initDraw() {
  11511. this.drawObj = [];
  11512. let data = cfgTable.drawData;
  11513. let temp;
  11514. let weight = 0;
  11515. for (const key in data) {
  11516. temp = data[key];
  11517. weight += temp.weight;
  11518. this.drawObj.push(weight);
  11519. }
  11520. this.allWeight = weight;
  11521. }
  11522. initUI() {
  11523. let data = cfgTable.drawData;
  11524. let temp;
  11525. let img;
  11526. let txt;
  11527. for (const key in data) {
  11528. temp = data[key];
  11529. img = this.ui.myNode.rotNode["img" + key];
  11530. txt = this.ui.myNode.rotNode["txt" + key];
  11531. img.url = xGame.common.getGameIconUrl(temp.icon);
  11532. txt.visible = true;
  11533. if (temp.award > 2) {
  11534. img.rotation = 0;
  11535. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11536. }
  11537. else {
  11538. img.rotation = temp.rotation;
  11539. txt.text = temp.num;
  11540. }
  11541. }
  11542. }
  11543. getCurkey() {
  11544. let rand = Math.random() * this.allWeight;
  11545. let temp;
  11546. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11547. temp = this.drawObj[index];
  11548. if (index == 0) {
  11549. if (rand < temp) {
  11550. return index + 1;
  11551. }
  11552. }
  11553. else {
  11554. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11555. return index + 1;
  11556. }
  11557. }
  11558. }
  11559. return 2;
  11560. }
  11561. startDraw() {
  11562. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11563. if (freeTimes > 0) {
  11564. this.beginDraw();
  11565. DataMgr.setDailyfreeDrawTimes(0);
  11566. this.checkFree();
  11567. }
  11568. else {
  11569. if (Laya.Browser.onAndroid) {
  11570. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11571. if (!boo) {
  11572. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11573. return;
  11574. }
  11575. }
  11576. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11577. }
  11578. else {
  11579. console.log('zh:AD 失败,直接发放奖励');
  11580. this.qjff_chouJiang();
  11581. }
  11582. }
  11583. }
  11584. qjff_chouJiang() {
  11585. this.beginDraw();
  11586. }
  11587. beginDraw() {
  11588. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11589. this.ui.drawBtn.touchable = false;
  11590. this.curKey = this.getCurkey();
  11591. console.log("当前key", this.curKey);
  11592. let cell = 60;
  11593. let lap = 3;
  11594. let angle = cell * (this.curKey - 1) + lap * 360;
  11595. let target = this.ui.myNode.rotNode;
  11596. target.rotation = 0;
  11597. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11598. console.log("旋转完成");
  11599. this.ui.drawBtn.touchable = true;
  11600. this.getAward();
  11601. }));
  11602. }
  11603. getAward() {
  11604. let data = cfgTable.drawData[this.curKey];
  11605. let temp = new AwardType();
  11606. temp.type = data.award;
  11607. temp.num = data.num;
  11608. xGame.common.getAward([temp], () => {
  11609. DataMgr.setDrawTimes(1);
  11610. this.updateDraw();
  11611. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11612. });
  11613. }
  11614. updateDraw() {
  11615. let drawTimes = DataMgr.getDrawTimes();
  11616. let awardTimes = DataMgr.getDrawAwardTimes();
  11617. if (Math.floor(drawTimes / 3) > awardTimes) {
  11618. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11619. this.ui.extraNode.boxBtn.touchable = true;
  11620. this.ui.extraNode.tipsTxt.text = "3/3";
  11621. this.ui.extraNode.barNode.width = 265;
  11622. this.getExtraAward();
  11623. }
  11624. else {
  11625. this.ui.extraNode.boxBtn.t0.stop();
  11626. this.ui.extraNode.boxBtn.touchable = false;
  11627. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11628. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11629. }
  11630. let data = cfgTable.drawData[1];
  11631. if (awardTimes == 0) {
  11632. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11633. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11634. this.ui.myNode.rotNode.img1.rotation = 0;
  11635. }
  11636. else {
  11637. let award = data.nextid;
  11638. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11639. this.ui.myNode.rotNode.txt1.text = award[1];
  11640. this.ui.myNode.rotNode.img1.rotation = 0;
  11641. }
  11642. }
  11643. getExtraAward() {
  11644. let drawTimes = DataMgr.getDrawTimes();
  11645. let awardTimes = DataMgr.getDrawAwardTimes();
  11646. let data = cfgTable.drawData[1];
  11647. let award = new AwardType();
  11648. if (awardTimes == 0) {
  11649. award.num = data.num;
  11650. award.type = data.award;
  11651. xGame.common.getAward([award], () => {
  11652. let all = Math.floor(drawTimes / 3);
  11653. DataMgr.setDrawAwardTimes(all);
  11654. this.updateDraw();
  11655. });
  11656. }
  11657. else {
  11658. award.num = parseInt(data.nextid[1]);
  11659. award.type = parseInt(data.nextid[0]);
  11660. xGame.common.getAward([award], () => {
  11661. let all = Math.floor(drawTimes / 3);
  11662. DataMgr.setDrawAwardTimes(all);
  11663. this.updateDraw();
  11664. });
  11665. }
  11666. }
  11667. closeSelf() {
  11668. this.hide();
  11669. }
  11670. playSecretaryIdle() {
  11671. let parent = this.ui.secretary.displayObject;
  11672. parent.destroyChildren();
  11673. let xx = this.ui.secretary.width / 2;
  11674. let yy = this.ui.secretary.height;
  11675. let scale = xGame.common.getSecretaryScale();
  11676. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11677. xGame.common.secretary.play(data, 0, true, parent);
  11678. }
  11679. }
  11680. UIDraw.uiName = "UIDraw";
  11681. class ui_UIFlyEft extends fgui.GComponent {
  11682. static createInstance() {
  11683. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11684. }
  11685. onConstruct() {
  11686. this.n0 = (this.getChild("n0"));
  11687. this.n1 = (this.getChild("n1"));
  11688. this.n2 = (this.getChild("n2"));
  11689. this.n3 = (this.getChild("n3"));
  11690. this.n4 = (this.getChild("n4"));
  11691. this.n5 = (this.getChild("n5"));
  11692. this.n6 = (this.getChild("n6"));
  11693. this.n7 = (this.getChild("n7"));
  11694. this.iconNode = (this.getChild("iconNode"));
  11695. this.txt = (this.getChild("txt"));
  11696. this.txtNode = (this.getChild("txtNode"));
  11697. }
  11698. }
  11699. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  11700. class UIFlyEft extends UIBase {
  11701. constructor() {
  11702. super();
  11703. this.max = 8;
  11704. this.delay = 0;
  11705. }
  11706. onConstructor() {
  11707. this.ui = ui_UIFlyEft.createInstance();
  11708. this.contentPane = this.ui;
  11709. this.isEject = false;
  11710. this.isMuti = true;
  11711. this.ui.x += xGame.common.sysOffestNum;
  11712. }
  11713. getArrPos() {
  11714. if (this.iconPos && this.iconPos.length > 0)
  11715. return;
  11716. this.iconPos = [];
  11717. let temp;
  11718. for (let index = 0; index < this.max; index++) {
  11719. temp = this.ui["n" + index];
  11720. this.iconPos.push([temp.x, temp.y]);
  11721. }
  11722. }
  11723. show(stPos, edPos, num, type, callback) {
  11724. super.show();
  11725. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  11726. this.getArrPos();
  11727. this.updateUI(type);
  11728. this.updatePos();
  11729. this.runFly(edPos, callback);
  11730. this.runWorlds(stPos, num);
  11731. }
  11732. updateUI(type) {
  11733. let temp;
  11734. let str;
  11735. for (let index = 0; index < this.max; index++) {
  11736. temp = this.ui["n" + index];
  11737. str = this.getIconStr(type);
  11738. temp.url = xGame.common.getGameIconUrl(str);
  11739. }
  11740. }
  11741. getIconStr(type) {
  11742. switch (type) {
  11743. case Prop.diamond:
  11744. return "ty_zs";
  11745. case Prop.coin:
  11746. return "ty_jb";
  11747. default:
  11748. break;
  11749. }
  11750. }
  11751. updatePos() {
  11752. let temp;
  11753. for (let index = 0; index < this.max; index++) {
  11754. temp = this.ui["n" + index];
  11755. temp.x = this.iconPos[index][0];
  11756. temp.y = this.iconPos[index][1];
  11757. }
  11758. }
  11759. runFly(endPos, callback) {
  11760. let all = 0;
  11761. let temp;
  11762. for (let index = 0; index < this.max; index++) {
  11763. temp = this.ui["n" + index];
  11764. temp.visible = true;
  11765. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  11766. temp.visible = false;
  11767. all++;
  11768. if (all >= this.max) {
  11769. callback && callback();
  11770. }
  11771. }), 20 * index);
  11772. }
  11773. }
  11774. runWorlds(stPos, num) {
  11775. let str = "+" + num;
  11776. this.ui.txt.text = str;
  11777. let starX = stPos.x;
  11778. let starY = stPos.y + 50;
  11779. this.ui.txt.x = starX;
  11780. this.ui.txt.y = starY;
  11781. this.ui.txt.visible = true;
  11782. this.ui.txt.alpha = 1;
  11783. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  11784. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  11785. this.ui.txt.visible = false;
  11786. this.hide();
  11787. }));
  11788. }));
  11789. }
  11790. }
  11791. UIFlyEft.uiName = "UIFlyEft";
  11792. class Common {
  11793. constructor() {
  11794. this.convertNum = 0.025;
  11795. this.VectorUp = new Laya.Vector3(0, 1, 0);
  11796. this.scaleV3One = new Laya.Vector3();
  11797. this.scaleV3Two = new Laya.Vector3();
  11798. this.posV4 = new Laya.Vector4();
  11799. this.showDebug = false;
  11800. this.openGuide = true;
  11801. this.rodOffest = new Laya.Vector2(0, 0);
  11802. this.rodAngle = 0;
  11803. this.gameMode = GameMode.classic;
  11804. this.bigMoveLevelIndex = 1;
  11805. this.bigMoveNeedCoin = 1000;
  11806. this.classicNiceNeddCoin = 1000;
  11807. this.passAwardCoin = 2000;
  11808. this.classicRoomType = 1;
  11809. this.maxPower = 20;
  11810. this.natureMaxPower = 5;
  11811. this.videoPower = 2;
  11812. this.powerRecoverNum = 900;
  11813. this.curPlayerSkillType = 0;
  11814. this.isNewDay = false;
  11815. this.clickedBall = false;
  11816. this.placeBallCurLevel = 0;
  11817. this.placeBallStarNum = 0;
  11818. this.longHelpLine = false;
  11819. this.maxShareDiamondTimes = 3;
  11820. this.guideStep = 0;
  11821. this.temSelfLevel = 0;
  11822. this.extraMoveNum = 0;
  11823. this.curRankID = 0;
  11824. this.rankID = {
  11825. normalStar: 12000,
  11826. wxStar: 12001
  11827. };
  11828. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  11829. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  11830. this.btnClickStr = "buttonclick";
  11831. this.maxSkillLevel = 10;
  11832. this.upSkillLevel = false;
  11833. this.gameStartTime = 0;
  11834. this._sysOffestNum = 0;
  11835. this.angleV2 = new Laya.Vector2();
  11836. this.rootV = new Laya.Vector2(0, 1);
  11837. this.tempDir1 = new Laya.Vector2();
  11838. this.tempDir2 = new Laya.Vector2();
  11839. this.ballSize = 33;
  11840. this.stPos = new Laya.Point();
  11841. this.edPos = new Laya.Point();
  11842. Common._instance = this;
  11843. window["common"] = this;
  11844. }
  11845. static getInstance() {
  11846. if (!this._instance) {
  11847. this._instance = new Common();
  11848. }
  11849. return this._instance;
  11850. }
  11851. get sysOffestNum() {
  11852. if (this._sysOffestNum == 0) {
  11853. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  11854. }
  11855. return this._sysOffestNum;
  11856. }
  11857. testShader() {
  11858. let test = new LightShader();
  11859. test.texture = "res/d3Res/ballTexture/ball1.png";
  11860. Laya.stage.addChild(test);
  11861. }
  11862. playScale(node) {
  11863. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  11864. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  11865. }));
  11866. }));
  11867. }
  11868. setGroup(colli, ...group) {
  11869. let out = 0;
  11870. for (let index = 0; index < group.length; index++) {
  11871. if (index == 0) {
  11872. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11873. }
  11874. else {
  11875. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11876. }
  11877. }
  11878. colli.collisionGroup = out;
  11879. }
  11880. setCanGroupWith(colli, ...group) {
  11881. let out = 0;
  11882. for (let index = 0; index < group.length; index++) {
  11883. if (index == 0) {
  11884. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11885. }
  11886. else {
  11887. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  11888. }
  11889. }
  11890. colli.canCollideWith = out;
  11891. }
  11892. loadPrefab(name, callback) {
  11893. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  11894. let prefab = new Laya.Prefab();
  11895. prefab.json = obj;
  11896. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  11897. callback && callback(img);
  11898. }));
  11899. }
  11900. pos2to3Convert(x, y, d3Pos) {
  11901. x = x + this.sysOffestNum;
  11902. d3Pos.setValue(x, y, 0);
  11903. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  11904. if (success) {
  11905. }
  11906. else {
  11907. console.error("转换出错了。。。。。。。。");
  11908. }
  11909. }
  11910. scale2to3Convert(num) {
  11911. this.scaleV3One.setValue(0, 0, 0);
  11912. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  11913. this.scaleV3Two.setValue(0, num, 0);
  11914. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  11915. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  11916. return outNum;
  11917. }
  11918. pos3to2Convert(d3Pos) {
  11919. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  11920. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  11921. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  11922. d3Pos.x -= this.sysOffestNum;
  11923. }
  11924. scale3to2Convert(num) {
  11925. let scale = this.scale2to3Convert(1);
  11926. let d2Out = num / scale;
  11927. return d2Out;
  11928. }
  11929. getCollider(type, restitution = 0.9, density = 10) {
  11930. let colli;
  11931. if (type == "box")
  11932. colli = new Laya.BoxCollider();
  11933. else
  11934. colli = new Laya.CircleCollider();
  11935. colli.friction = 0;
  11936. colli.restitution = restitution;
  11937. colli.density = density;
  11938. return colli;
  11939. }
  11940. getRigbody() {
  11941. let rigy = new Laya.RigidBody();
  11942. rigy.bullet = true;
  11943. rigy.allowRotation = false;
  11944. rigy.allowSleep = false;
  11945. rigy.gravityScale = 0;
  11946. return rigy;
  11947. }
  11948. getfguiRotation(x, y) {
  11949. this.angleV2.setValue(x, y);
  11950. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11951. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11952. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  11953. angle = -angle;
  11954. }
  11955. return 180 + angle;
  11956. }
  11957. getAngle(x, y) {
  11958. this.angleV2.setValue(x, y);
  11959. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  11960. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  11961. return angle;
  11962. }
  11963. randomNum(a, b) {
  11964. return a + Math.floor((b - a + 1) * Math.random());
  11965. }
  11966. getRandArrEle(arr) {
  11967. return arr[Math.floor(arr.length * Math.random())];
  11968. }
  11969. getSign(val) {
  11970. return val >= 0 ? 1 : -1;
  11971. }
  11972. botherArr(arr) {
  11973. let times = arr.length + 2;
  11974. let length = arr.length;
  11975. let a;
  11976. let b;
  11977. let temp;
  11978. for (let index = 0; index < times; index++) {
  11979. a = Math.floor(Math.random() * length);
  11980. b = Math.floor(Math.random() * length);
  11981. temp = arr[a];
  11982. arr[a] = arr[b];
  11983. arr[b] = temp;
  11984. }
  11985. }
  11986. getGameIconUrl(id) {
  11987. return "ui://game/" + id;
  11988. }
  11989. getComponentUrl(id) {
  11990. return "ui://game/" + id;
  11991. }
  11992. getAnimation() {
  11993. }
  11994. judgeSkillType(type = SkillType.highSpace) {
  11995. if (this.gameMode == GameMode.classic)
  11996. return;
  11997. let gameMgr = this.gameMgr;
  11998. if (gameMgr.selfTurn) {
  11999. if (gameMgr.selfCurSkill == type) {
  12000. return true;
  12001. }
  12002. }
  12003. else {
  12004. if (gameMgr.aiCurSkill == type) {
  12005. return true;
  12006. }
  12007. }
  12008. }
  12009. ballColliHole(collider) {
  12010. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12011. xGame.common.gameMgr.isFirstInGame = false;
  12012. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12013. }
  12014. collider.owner.mySrc.checkWrongBall();
  12015. }
  12016. getArrMaxEle(arr) {
  12017. let max = -Infinity;
  12018. for (let index = 0; index < arr.length; index++) {
  12019. max = Math.max(arr[index], max);
  12020. }
  12021. return max;
  12022. }
  12023. getArrMinEle(arr) {
  12024. let min = Infinity;
  12025. for (let index = 0; index < arr.length; index++) {
  12026. min = Math.min(arr[index], min);
  12027. }
  12028. return min;
  12029. }
  12030. playRandomMutiBallBigSkillSound() {
  12031. if (Math.random() <= 0.5)
  12032. return;
  12033. let rand = this.randomNum(1, 6);
  12034. let str = "ganfa0" + rand;
  12035. xGame.soundMgr.playSound(str);
  12036. }
  12037. showOneCamera(type) {
  12038. let object = xGame.common.d3World.cameraObj;
  12039. for (const key in object) {
  12040. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12041. object[key].init();
  12042. object[key].owner.active = key == type;
  12043. }
  12044. }
  12045. }
  12046. checkBallOverBorder(x, y) {
  12047. let radius = 17;
  12048. let condition = this._checkBorder(x + radius, y) ||
  12049. this._checkBorder(x - radius, y) ||
  12050. this._checkBorder(x, y + radius) ||
  12051. this._checkBorder(x, y - radius);
  12052. if (condition) {
  12053. return true;
  12054. }
  12055. }
  12056. _checkBorder(x, y) {
  12057. let borderRect = this.d2World.borderRect;
  12058. let xOffest = 20;
  12059. let yOffest = 20;
  12060. if (y <= borderRect.y - yOffest) {
  12061. return true;
  12062. }
  12063. if (y >= borderRect.y + borderRect.height + yOffest) {
  12064. return true;
  12065. }
  12066. if (x <= borderRect.x - xOffest) {
  12067. return true;
  12068. }
  12069. if (x >= borderRect.x + borderRect.width + xOffest) {
  12070. return true;
  12071. }
  12072. }
  12073. initWeight(cfg) {
  12074. let allCfgData = { data: {}, allWeightNum: 0 };
  12075. let weightCfg = allCfgData.data;
  12076. let weight = 0;
  12077. for (const key in cfg) {
  12078. weightCfg[key] = {};
  12079. weightCfg[key].id = cfg[key].id;
  12080. weightCfg[key].minWeight = weight;
  12081. weight += cfg[key].weight;
  12082. weightCfg[key].maxWeight = weight;
  12083. }
  12084. allCfgData.allWeightNum = weight;
  12085. return allCfgData;
  12086. }
  12087. getRandomWeightData(cfg) {
  12088. let weightCfg = cfg.data;
  12089. let allWeightNum = cfg.allWeightNum;
  12090. let rand = Math.floor(Math.random() * allWeightNum);
  12091. for (const key in weightCfg) {
  12092. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12093. return weightCfg[key];
  12094. }
  12095. }
  12096. return weightCfg[1];
  12097. }
  12098. showGirlTalkPop(wordsIndex, node, msgNode) {
  12099. node.visible = true;
  12100. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12101. node.t0.play(Laya.Handler.create(this, () => {
  12102. node.visible = false;
  12103. }));
  12104. }
  12105. stopGirlPop(node) {
  12106. node.t0.stop();
  12107. node.visible = false;
  12108. }
  12109. createHead(loader, url, size = 107) {
  12110. if (Laya.Browser.name == "Browser") {
  12111. loader.url = url;
  12112. return;
  12113. }
  12114. else {
  12115. console.log('zh:url=', url);
  12116. loader.url = url;
  12117. }
  12118. }
  12119. addTestCoin(num) {
  12120. DataMgr.setCoin(num);
  12121. }
  12122. addTestDiamond(num) {
  12123. DataMgr.setDiamond(num);
  12124. }
  12125. addTestSkill() {
  12126. DataMgr.setBigSkill(0, 99);
  12127. DataMgr.setBigSkill(1, 99);
  12128. DataMgr.setBigSkill(2, 99);
  12129. }
  12130. playClassicEmotion(number, x, y) {
  12131. if (this.gameMode == GameMode.bigMove)
  12132. return;
  12133. let randIndex = this.randomNum(0, 2);
  12134. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12135. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12136. if (this.gameMgr.selfTurn) {
  12137. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12138. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12139. }
  12140. else {
  12141. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12142. }
  12143. else {
  12144. if (number == this.gameMgr.blackNum) {
  12145. if (this.gameMgr.selfBallArr.length == 0) {
  12146. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12147. }
  12148. else {
  12149. }
  12150. }
  12151. else {
  12152. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12153. }
  12154. }
  12155. }
  12156. }
  12157. else {
  12158. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12159. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12160. }
  12161. else {
  12162. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12163. }
  12164. else {
  12165. if (number == this.gameMgr.blackNum) {
  12166. if (this.gameMgr.aiBallArr.length == 0) {
  12167. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12168. }
  12169. else {
  12170. }
  12171. }
  12172. else {
  12173. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12174. }
  12175. }
  12176. }
  12177. }
  12178. }
  12179. playHappySound(number) {
  12180. if (this.gameMode != GameMode.classic)
  12181. return;
  12182. if (number == 8)
  12183. return;
  12184. let play = false;
  12185. if (this.gameMgr.selfTurn) {
  12186. if (this.gameMgr.ensureBallType) {
  12187. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12188. play = true;
  12189. }
  12190. }
  12191. else {
  12192. play = true;
  12193. }
  12194. }
  12195. else {
  12196. if (this.gameMgr.ensureBallType) {
  12197. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12198. play = true;
  12199. }
  12200. }
  12201. else {
  12202. play = true;
  12203. }
  12204. }
  12205. if (play)
  12206. xGame.soundMgr.playSound("applause");
  12207. }
  12208. destroyClassicEmotion() {
  12209. if (this.gameMode == GameMode.bigMove)
  12210. return;
  12211. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12212. parent.destroyChildren();
  12213. }
  12214. playAwardSpine(x, y) {
  12215. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12216. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12217. this.awardSpine.play(data, 0, false, parent);
  12218. }
  12219. destroyAwardSpine() {
  12220. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12221. parent.destroyChildren();
  12222. }
  12223. isBlock(bx, by, hx, hy, except = null) {
  12224. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12225. let balls = xGame.common.d2World.ballArr;
  12226. let outArr = [];
  12227. for (let index = 0; index < balls.length; index++) {
  12228. let obj = balls[index];
  12229. if (obj.number == 0)
  12230. continue;
  12231. if (obj == except)
  12232. continue;
  12233. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12234. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12235. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12236. if (num >= 1)
  12237. num = 1;
  12238. if (num < 0)
  12239. continue;
  12240. let gap = Math.sin(Math.acos(num)) * dis;
  12241. if (gap < this.ballSize) {
  12242. outArr.push({
  12243. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12244. disHon: Math.cos(Math.acos(num)) * dis,
  12245. disVer: Math.sin(Math.acos(num)) * dis,
  12246. src: balls[index],
  12247. dir: this.tempDir1
  12248. });
  12249. }
  12250. }
  12251. if (outArr.length > 0) {
  12252. outArr.sort((a, b) => { return a.dis - b.dis; });
  12253. return outArr[0];
  12254. }
  12255. }
  12256. AngleBetween(vector1, vector2) {
  12257. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12258. return rad * (180 / Math.PI);
  12259. }
  12260. getSecretaryScale() {
  12261. if (this.secretary.spineName == "mishu") {
  12262. return 1.28;
  12263. }
  12264. else {
  12265. return 1.024;
  12266. }
  12267. }
  12268. signAwardContainsRod(arr) {
  12269. let temp;
  12270. for (let index = 0; index < arr.length; index++) {
  12271. temp = arr[index].split('-')[0];
  12272. if (parseInt(temp) > 2) {
  12273. return true;
  12274. }
  12275. }
  12276. }
  12277. judgeSameDay() {
  12278. let lastTime = DataMgr.getSignTime();
  12279. let curTime = new Date().getTime();
  12280. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12281. return true;
  12282. }
  12283. return false;
  12284. }
  12285. getAward(arr, callback) {
  12286. let showTriple = arr[0].type <= 2;
  12287. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12288. let temp;
  12289. for (let index = 0; index < arr.length; index++) {
  12290. temp = arr[index];
  12291. switch (temp.type) {
  12292. case 1:
  12293. this.playObjFlyAnim(temp.num, temp.type);
  12294. break;
  12295. case 2:
  12296. this.playObjFlyAnim(temp.num, temp.type);
  12297. break;
  12298. case 3:
  12299. case 4:
  12300. case 5:
  12301. case 6:
  12302. DataMgr.setBallRod(temp.type - 2, 1);
  12303. DataMgr.setCurBallRod(temp.type - 2);
  12304. break;
  12305. default:
  12306. break;
  12307. }
  12308. }
  12309. callback && callback(watchVideo);
  12310. });
  12311. }
  12312. getMoneyNode() {
  12313. let moneyNode;
  12314. let sign = xGame.uiMgr.getUI(UISign);
  12315. let draw = xGame.uiMgr.getUI(UIDraw);
  12316. let end = xGame.uiMgr.getUI(UIGameEnd);
  12317. let skill = xGame.uiMgr.getUI(UISkill);
  12318. if (sign && !sign.isHide)
  12319. moneyNode = sign.ui.moneyNode;
  12320. if (draw && !draw.isHide)
  12321. moneyNode = draw.ui.moneyNode;
  12322. if (end && !end.isHide)
  12323. moneyNode = end.ui.moneyNode;
  12324. if (skill && !skill.isHide)
  12325. moneyNode = skill.ui.moneyNode;
  12326. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12327. let main = xGame.uiMgr.getUI(UIMain);
  12328. if (condition1 && main && !main.isHide) {
  12329. moneyNode = main.ui.moneyNode;
  12330. }
  12331. return moneyNode;
  12332. }
  12333. playObjFlyAnim(num, type, callback = null) {
  12334. this.stPos.x = Laya.stage.width / 2;
  12335. this.stPos.y = Laya.stage.height / 2;
  12336. let moneyNode = this.getMoneyNode();
  12337. switch (type) {
  12338. case Prop.diamond:
  12339. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12340. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12341. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12342. this.edPos.x /= 2;
  12343. this.edPos.y /= 2;
  12344. break;
  12345. case Prop.coin:
  12346. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12347. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12348. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12349. this.edPos.x /= 2;
  12350. this.edPos.y /= 2;
  12351. break;
  12352. default:
  12353. break;
  12354. }
  12355. xGame.soundMgr.playSound("coinbag");
  12356. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12357. switch (type) {
  12358. case Prop.diamond:
  12359. DataMgr.setDiamond(num);
  12360. break;
  12361. case Prop.coin:
  12362. DataMgr.setCoin(num);
  12363. break;
  12364. default:
  12365. break;
  12366. }
  12367. callback && callback();
  12368. });
  12369. }
  12370. autoPopUIView() {
  12371. let arr = [];
  12372. let sign = this.judgeSameDay() ? false : true;
  12373. if (sign)
  12374. arr.push("sign");
  12375. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12376. if (draw)
  12377. arr.push("draw");
  12378. if (arr.length <= 0)
  12379. return;
  12380. let str = this.getRandArrEle(arr);
  12381. switch (str) {
  12382. case "sign":
  12383. xGame.uiMgr.Show(UISign);
  12384. break;
  12385. case "draw":
  12386. xGame.uiMgr.Show(UIDraw);
  12387. break;
  12388. default:
  12389. break;
  12390. }
  12391. }
  12392. getMSTime(time) {
  12393. let min = Math.floor(time / 60);
  12394. let sec = Math.floor((time - min * 60));
  12395. if (sec < 10)
  12396. sec = "0" + sec;
  12397. if (min < 10)
  12398. min = "0" + min;
  12399. return `${min}:${sec}`;
  12400. }
  12401. testPower() {
  12402. DataMgr.setPower(0, false);
  12403. }
  12404. getAllStarNum() {
  12405. let data = DataMgr.getPlaceBallLevelList();
  12406. let out = 0;
  12407. for (let index = 0; index < data.length; index++) {
  12408. out += data[index].star;
  12409. }
  12410. return out;
  12411. }
  12412. recoverCameraView() {
  12413. Laya.timer.once(900, this, () => {
  12414. xGame.common.showOneCamera("mainCamera");
  12415. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12416. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12417. xGame.common.gameUI.ui.border.alpha = 0;
  12418. if (Laya.physicsTimer.scale < 1) {
  12419. Laya.physicsTimer.scale = 1;
  12420. }
  12421. }
  12422. });
  12423. }
  12424. getClassicLevel() {
  12425. let successTimes = DataMgr.getClassicTimes();
  12426. let needKey = "";
  12427. let lastKey = "";
  12428. let cfg = cfgTable.classictimesData;
  12429. let data;
  12430. for (const key in cfg) {
  12431. data = cfg[key];
  12432. if (successTimes <= data.times) {
  12433. needKey = key;
  12434. }
  12435. lastKey = key;
  12436. }
  12437. if (needKey == "")
  12438. needKey = lastKey;
  12439. return cfg[needKey];
  12440. }
  12441. }
  12442. Common._instance = null;
  12443. class ui_Component92 extends fgui.GComponent {
  12444. static createInstance() {
  12445. return (fgui.UIPackage.createObject("game", "Component92"));
  12446. }
  12447. onConstruct() {
  12448. this.n0 = (this.getChild("n0"));
  12449. }
  12450. }
  12451. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12452. class ui_Component129 extends fgui.GProgressBar {
  12453. static createInstance() {
  12454. return (fgui.UIPackage.createObject("game", "Component129"));
  12455. }
  12456. onConstruct() {
  12457. this.bar_v = (this.getChild("bar_v"));
  12458. this.n84 = (this.getChild("n84"));
  12459. }
  12460. }
  12461. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12462. class ui_Component130 extends fgui.GComponent {
  12463. static createInstance() {
  12464. return (fgui.UIPackage.createObject("game", "Component130"));
  12465. }
  12466. onConstruct() {
  12467. this.ani = (this.getChild("ani"));
  12468. this.t0 = this.getTransition("t0");
  12469. }
  12470. }
  12471. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12472. class ui_powerEft extends fgui.GComponent {
  12473. static createInstance() {
  12474. return (fgui.UIPackage.createObject("game", "powerEft"));
  12475. }
  12476. onConstruct() {
  12477. this.ani = (this.getChild("ani"));
  12478. this.n88 = (this.getChild("n88"));
  12479. this.n89 = (this.getChild("n89"));
  12480. }
  12481. }
  12482. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12483. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12484. static createInstance() {
  12485. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12486. }
  12487. onConstruct() {
  12488. this.c1 = this.getController("c1");
  12489. this.n2 = (this.getChild("n2"));
  12490. this.n22 = (this.getChild("n22"));
  12491. this.n23 = (this.getChild("n23"));
  12492. this.n15 = (this.getChild("n15"));
  12493. this.challenge = (this.getChild("challenge"));
  12494. this.n17 = (this.getChild("n17"));
  12495. this.n3 = (this.getChild("n3"));
  12496. this.starNode = (this.getChild("starNode"));
  12497. this.levelTxt = (this.getChild("levelTxt"));
  12498. this.n14 = (this.getChild("n14"));
  12499. this.n19 = (this.getChild("n19"));
  12500. this.n20 = (this.getChild("n20"));
  12501. this.n21 = (this.getChild("n21"));
  12502. this.special = (this.getChild("special"));
  12503. }
  12504. }
  12505. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12506. class ui_Component79 extends fgui.GComponent {
  12507. static createInstance() {
  12508. return (fgui.UIPackage.createObject("game", "Component79"));
  12509. }
  12510. onConstruct() {
  12511. this.c1 = this.getController("c1");
  12512. this.n7 = (this.getChild("n7"));
  12513. this.n8 = (this.getChild("n8"));
  12514. this.n9 = (this.getChild("n9"));
  12515. this.n10 = (this.getChild("n10"));
  12516. this.n11 = (this.getChild("n11"));
  12517. this.n12 = (this.getChild("n12"));
  12518. }
  12519. }
  12520. ui_Component79.URL = "ui://isxx5ak7avag477";
  12521. class ui_Component80 extends fgui.GComponent {
  12522. static createInstance() {
  12523. return (fgui.UIPackage.createObject("game", "Component80"));
  12524. }
  12525. onConstruct() {
  12526. this.n0 = (this.getChild("n0"));
  12527. this.n1 = (this.getChild("n1"));
  12528. this.myList = (this.getChild("myList"));
  12529. this.t0 = this.getTransition("t0");
  12530. }
  12531. }
  12532. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12533. class ui_SignNormal extends fgui.GComponent {
  12534. static createInstance() {
  12535. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12536. }
  12537. onConstruct() {
  12538. this.c1 = this.getController("c1");
  12539. this.n7 = (this.getChild("n7"));
  12540. this.n15 = (this.getChild("n15"));
  12541. this.titleTxt = (this.getChild("titleTxt"));
  12542. this.n8 = (this.getChild("n8"));
  12543. this.myIcon = (this.getChild("myIcon"));
  12544. this.numTxt = (this.getChild("numTxt"));
  12545. this.n12 = (this.getChild("n12"));
  12546. this.n13 = (this.getChild("n13"));
  12547. this.n17 = (this.getChild("n17"));
  12548. this.n14 = (this.getChild("n14"));
  12549. }
  12550. }
  12551. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12552. class ui_Button_reg extends fgui.GButton {
  12553. static createInstance() {
  12554. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12555. }
  12556. onConstruct() {
  12557. this.button = this.getController("button");
  12558. this.n6 = (this.getChild("n6"));
  12559. this.n4 = (this.getChild("n4"));
  12560. }
  12561. }
  12562. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12563. class ui_screenNode extends fgui.GComponent {
  12564. static createInstance() {
  12565. return (fgui.UIPackage.createObject("game", "screenNode"));
  12566. }
  12567. onConstruct() {
  12568. this.n9 = (this.getChild("n9"));
  12569. this.screenImg = (this.getChild("screenImg"));
  12570. }
  12571. }
  12572. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12573. class ui_GetAwrad_com1 extends fgui.GComponent {
  12574. static createInstance() {
  12575. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12576. }
  12577. onConstruct() {
  12578. this.n38 = (this.getChild("n38"));
  12579. this.n39 = (this.getChild("n39"));
  12580. this.n40 = (this.getChild("n40"));
  12581. this.t0 = this.getTransition("t0");
  12582. this.t1 = this.getTransition("t1");
  12583. }
  12584. }
  12585. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12586. class ui_GetAwrad_com2 extends fgui.GComponent {
  12587. static createInstance() {
  12588. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12589. }
  12590. onConstruct() {
  12591. this.n39 = (this.getChild("n39"));
  12592. this.n40 = (this.getChild("n40"));
  12593. this.t0 = this.getTransition("t0");
  12594. }
  12595. }
  12596. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12597. class ui_Component128 extends fgui.GComponent {
  12598. static createInstance() {
  12599. return (fgui.UIPackage.createObject("game", "Component128"));
  12600. }
  12601. onConstruct() {
  12602. this.n38 = (this.getChild("n38"));
  12603. this.n40 = (this.getChild("n40"));
  12604. }
  12605. }
  12606. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12607. class ui_Component100_1 extends fgui.GComponent {
  12608. static createInstance() {
  12609. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12610. }
  12611. onConstruct() {
  12612. this.myNode = (this.getChild("myNode"));
  12613. this.t0 = this.getTransition("t0");
  12614. }
  12615. }
  12616. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12617. class ui_Component142 extends fgui.GComponent {
  12618. static createInstance() {
  12619. return (fgui.UIPackage.createObject("game", "Component142"));
  12620. }
  12621. onConstruct() {
  12622. this.n41 = (this.getChild("n41"));
  12623. this.n42 = (this.getChild("n42"));
  12624. }
  12625. }
  12626. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12627. class ui_main_guang extends fgui.GComponent {
  12628. static createInstance() {
  12629. return (fgui.UIPackage.createObject("game", "main_guang"));
  12630. }
  12631. onConstruct() {
  12632. this.n1 = (this.getChild("n1"));
  12633. this.n2 = (this.getChild("n2"));
  12634. this.n3 = (this.getChild("n3"));
  12635. this.n4 = (this.getChild("n4"));
  12636. this.n5 = (this.getChild("n5"));
  12637. this.n6 = (this.getChild("n6"));
  12638. this.n8 = (this.getChild("n8"));
  12639. this.t0 = this.getTransition("t0");
  12640. }
  12641. }
  12642. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12643. class ui_try_com1 extends fgui.GComponent {
  12644. static createInstance() {
  12645. return (fgui.UIPackage.createObject("game", "try_com1"));
  12646. }
  12647. onConstruct() {
  12648. this.c1 = this.getController("c1");
  12649. this.n0 = (this.getChild("n0"));
  12650. this.n2 = (this.getChild("n2"));
  12651. this.cancelBtn = (this.getChild("cancelBtn"));
  12652. this.videoBtn = (this.getChild("videoBtn"));
  12653. this.n9 = (this.getChild("n9"));
  12654. this.n24 = (this.getChild("n24"));
  12655. this.titleTxt = (this.getChild("titleTxt"));
  12656. this.n32 = (this.getChild("n32"));
  12657. this.n29 = (this.getChild("n29"));
  12658. this.n36 = (this.getChild("n36"));
  12659. this.txtTime = (this.getChild("txtTime"));
  12660. this.t0 = this.getTransition("t0");
  12661. }
  12662. }
  12663. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12664. class ui_try_com2 extends fgui.GComponent {
  12665. static createInstance() {
  12666. return (fgui.UIPackage.createObject("game", "try_com2"));
  12667. }
  12668. onConstruct() {
  12669. this.skillicon = (this.getChild("skillicon"));
  12670. this.n35 = (this.getChild("n35"));
  12671. this.n31 = (this.getChild("n31"));
  12672. this.n32 = (this.getChild("n32"));
  12673. this.n33 = (this.getChild("n33"));
  12674. this.n34 = (this.getChild("n34"));
  12675. }
  12676. }
  12677. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12678. class ui_try_com3 extends fgui.GComponent {
  12679. static createInstance() {
  12680. return (fgui.UIPackage.createObject("game", "try_com3"));
  12681. }
  12682. onConstruct() {
  12683. this.n33 = (this.getChild("n33"));
  12684. this.n34 = (this.getChild("n34"));
  12685. this.n35 = (this.getChild("n35"));
  12686. this.t0 = this.getTransition("t0");
  12687. }
  12688. }
  12689. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  12690. class ui_huihe1 extends fgui.GComponent {
  12691. static createInstance() {
  12692. return (fgui.UIPackage.createObject("game", "huihe1"));
  12693. }
  12694. onConstruct() {
  12695. this.n0 = (this.getChild("n0"));
  12696. this.n1 = (this.getChild("n1"));
  12697. this.t0 = this.getTransition("t0");
  12698. }
  12699. }
  12700. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  12701. class ui_huihe2 extends fgui.GComponent {
  12702. static createInstance() {
  12703. return (fgui.UIPackage.createObject("game", "huihe2"));
  12704. }
  12705. onConstruct() {
  12706. this.n0 = (this.getChild("n0"));
  12707. this.n1 = (this.getChild("n1"));
  12708. this.t0 = this.getTransition("t0");
  12709. }
  12710. }
  12711. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  12712. class ui_Component143 extends fgui.GComponent {
  12713. static createInstance() {
  12714. return (fgui.UIPackage.createObject("game", "Component143"));
  12715. }
  12716. onConstruct() {
  12717. this.n3 = (this.getChild("n3"));
  12718. this.n4 = (this.getChild("n4"));
  12719. this.n5 = (this.getChild("n5"));
  12720. this.n6 = (this.getChild("n6"));
  12721. this.n7 = (this.getChild("n7"));
  12722. this.n8 = (this.getChild("n8"));
  12723. this.n9 = (this.getChild("n9"));
  12724. this.n10 = (this.getChild("n10"));
  12725. this.t0 = this.getTransition("t0");
  12726. }
  12727. }
  12728. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  12729. class ui_dh_jingbi2 extends fgui.GComponent {
  12730. static createInstance() {
  12731. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  12732. }
  12733. onConstruct() {
  12734. this.n0 = (this.getChild("n0"));
  12735. this.n1 = (this.getChild("n1"));
  12736. this.n2 = (this.getChild("n2"));
  12737. this.n3 = (this.getChild("n3"));
  12738. this.n4 = (this.getChild("n4"));
  12739. this.n5 = (this.getChild("n5"));
  12740. this.n6 = (this.getChild("n6"));
  12741. this.n8 = (this.getChild("n8"));
  12742. this.n10 = (this.getChild("n10"));
  12743. this.t0 = this.getTransition("t0");
  12744. }
  12745. }
  12746. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  12747. class ui_dh_jingbi2_1 extends fgui.GComponent {
  12748. static createInstance() {
  12749. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  12750. }
  12751. onConstruct() {
  12752. this.n1 = (this.getChild("n1"));
  12753. this.n4 = (this.getChild("n4"));
  12754. this.t0 = this.getTransition("t0");
  12755. }
  12756. }
  12757. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  12758. class ui_dh_jingbi3 extends fgui.GComponent {
  12759. static createInstance() {
  12760. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  12761. }
  12762. onConstruct() {
  12763. this.n0 = (this.getChild("n0"));
  12764. this.n1 = (this.getChild("n1"));
  12765. this.n2 = (this.getChild("n2"));
  12766. this.n3 = (this.getChild("n3"));
  12767. this.n4 = (this.getChild("n4"));
  12768. this.n5 = (this.getChild("n5"));
  12769. this.n6 = (this.getChild("n6"));
  12770. this.n8 = (this.getChild("n8"));
  12771. this.n10 = (this.getChild("n10"));
  12772. this.t0 = this.getTransition("t0");
  12773. }
  12774. }
  12775. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  12776. class ui_dh_jingbi3_1 extends fgui.GComponent {
  12777. static createInstance() {
  12778. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  12779. }
  12780. onConstruct() {
  12781. this.n3 = (this.getChild("n3"));
  12782. this.n1 = (this.getChild("n1"));
  12783. this.t0 = this.getTransition("t0");
  12784. }
  12785. }
  12786. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  12787. class ui_hb_jinbi1 extends fgui.GButton {
  12788. static createInstance() {
  12789. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  12790. }
  12791. onConstruct() {
  12792. this.n20 = (this.getChild("n20"));
  12793. this.n25 = (this.getChild("n25"));
  12794. this.coinTxt = (this.getChild("coinTxt"));
  12795. this.n28 = (this.getChild("n28"));
  12796. this.n32 = (this.getChild("n32"));
  12797. this.n38 = (this.getChild("n38"));
  12798. this.n45 = (this.getChild("n45"));
  12799. this.getTips = (this.getChild("getTips"));
  12800. this.n39 = (this.getChild("n39"));
  12801. this.diamondTxt = (this.getChild("diamondTxt"));
  12802. this.n41 = (this.getChild("n41"));
  12803. this.n42 = (this.getChild("n42"));
  12804. this.n46 = (this.getChild("n46"));
  12805. this.n47 = (this.getChild("n47"));
  12806. this.n48 = (this.getChild("n48"));
  12807. this.t0 = this.getTransition("t0");
  12808. }
  12809. }
  12810. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  12811. class ui_hb_jinbi2 extends fgui.GButton {
  12812. static createInstance() {
  12813. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  12814. }
  12815. onConstruct() {
  12816. this.n20 = (this.getChild("n20"));
  12817. this.n25 = (this.getChild("n25"));
  12818. this.coinTxt = (this.getChild("coinTxt"));
  12819. this.n28 = (this.getChild("n28"));
  12820. this.n32 = (this.getChild("n32"));
  12821. this.n38 = (this.getChild("n38"));
  12822. this.n39 = (this.getChild("n39"));
  12823. this.diamondTxt = (this.getChild("diamondTxt"));
  12824. this.n41 = (this.getChild("n41"));
  12825. this.n42 = (this.getChild("n42"));
  12826. this.n43 = (this.getChild("n43"));
  12827. this.n44 = (this.getChild("n44"));
  12828. this.n45 = (this.getChild("n45"));
  12829. this.t0 = this.getTransition("t0");
  12830. }
  12831. }
  12832. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  12833. class ui_hb_jinbi3 extends fgui.GButton {
  12834. static createInstance() {
  12835. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  12836. }
  12837. onConstruct() {
  12838. this.n20 = (this.getChild("n20"));
  12839. this.n25 = (this.getChild("n25"));
  12840. this.coinTxt = (this.getChild("coinTxt"));
  12841. this.n28 = (this.getChild("n28"));
  12842. this.n32 = (this.getChild("n32"));
  12843. this.n38 = (this.getChild("n38"));
  12844. this.n39 = (this.getChild("n39"));
  12845. this.diamondTxt = (this.getChild("diamondTxt"));
  12846. this.n41 = (this.getChild("n41"));
  12847. this.n42 = (this.getChild("n42"));
  12848. this.n43 = (this.getChild("n43"));
  12849. this.n44 = (this.getChild("n44"));
  12850. this.n45 = (this.getChild("n45"));
  12851. this.t0 = this.getTransition("t0");
  12852. }
  12853. }
  12854. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  12855. class ui_Component104 extends fgui.GComponent {
  12856. static createInstance() {
  12857. return (fgui.UIPackage.createObject("game", "Component104"));
  12858. }
  12859. onConstruct() {
  12860. this.c1 = this.getController("c1");
  12861. this.n12 = (this.getChild("n12"));
  12862. this.coinBtn = (this.getChild("coinBtn"));
  12863. this.diamondBtn = (this.getChild("diamondBtn"));
  12864. this.node3 = (this.getChild("node3"));
  12865. this.node4 = (this.getChild("node4"));
  12866. this.node5 = (this.getChild("node5"));
  12867. this.node1 = (this.getChild("node1"));
  12868. this.node2 = (this.getChild("node2"));
  12869. this.node6 = (this.getChild("node6"));
  12870. this.t0 = this.getTransition("t0");
  12871. }
  12872. }
  12873. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  12874. class ui_Component105 extends fgui.GButton {
  12875. static createInstance() {
  12876. return (fgui.UIPackage.createObject("game", "Component105"));
  12877. }
  12878. onConstruct() {
  12879. this.c1 = this.getController("c1");
  12880. this.n49 = (this.getChild("n49"));
  12881. this.n18 = (this.getChild("n18"));
  12882. this.n46 = (this.getChild("n46"));
  12883. this.n48 = (this.getChild("n48"));
  12884. }
  12885. }
  12886. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  12887. class ui_Component106 extends fgui.GButton {
  12888. static createInstance() {
  12889. return (fgui.UIPackage.createObject("game", "Component106"));
  12890. }
  12891. onConstruct() {
  12892. this.c1 = this.getController("c1");
  12893. this.n49 = (this.getChild("n49"));
  12894. this.n18 = (this.getChild("n18"));
  12895. this.n46 = (this.getChild("n46"));
  12896. this.n48 = (this.getChild("n48"));
  12897. }
  12898. }
  12899. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  12900. class ui_hb_zs1 extends fgui.GButton {
  12901. static createInstance() {
  12902. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  12903. }
  12904. onConstruct() {
  12905. this.c1 = this.getController("c1");
  12906. this.n20 = (this.getChild("n20"));
  12907. this.n21 = (this.getChild("n21"));
  12908. this.n26 = (this.getChild("n26"));
  12909. this.n27 = (this.getChild("n27"));
  12910. this.shareTxt = (this.getChild("shareTxt"));
  12911. this.n32 = (this.getChild("n32"));
  12912. this.n38 = (this.getChild("n38"));
  12913. this.n39 = (this.getChild("n39"));
  12914. this.n44 = (this.getChild("n44"));
  12915. this.diamondTxt = (this.getChild("diamondTxt"));
  12916. this.n41 = (this.getChild("n41"));
  12917. this.n45 = (this.getChild("n45"));
  12918. this.n47 = (this.getChild("n47"));
  12919. this.n48 = (this.getChild("n48"));
  12920. this.randTxt = (this.getChild("randTxt"));
  12921. this.n50 = (this.getChild("n50"));
  12922. this.t0 = this.getTransition("t0");
  12923. }
  12924. }
  12925. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  12926. class ui_dh_zs1 extends fgui.GComponent {
  12927. static createInstance() {
  12928. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  12929. }
  12930. onConstruct() {
  12931. this.n10 = (this.getChild("n10"));
  12932. this.n9 = (this.getChild("n9"));
  12933. this.n1 = (this.getChild("n1"));
  12934. this.n2 = (this.getChild("n2"));
  12935. this.n3 = (this.getChild("n3"));
  12936. this.n4 = (this.getChild("n4"));
  12937. this.n5 = (this.getChild("n5"));
  12938. this.n6 = (this.getChild("n6"));
  12939. this.n8 = (this.getChild("n8"));
  12940. this.n11 = (this.getChild("n11"));
  12941. this.t0 = this.getTransition("t0");
  12942. }
  12943. }
  12944. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  12945. class ui_dh_zs1_1 extends fgui.GComponent {
  12946. static createInstance() {
  12947. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  12948. }
  12949. onConstruct() {
  12950. this.n3 = (this.getChild("n3"));
  12951. this.n1 = (this.getChild("n1"));
  12952. this.t0 = this.getTransition("t0");
  12953. }
  12954. }
  12955. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  12956. class ui_hb_zs2 extends fgui.GButton {
  12957. static createInstance() {
  12958. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  12959. }
  12960. onConstruct() {
  12961. this.n20 = (this.getChild("n20"));
  12962. this.n21 = (this.getChild("n21"));
  12963. this.n26 = (this.getChild("n26"));
  12964. this.n27 = (this.getChild("n27"));
  12965. this.n32 = (this.getChild("n32"));
  12966. this.n38 = (this.getChild("n38"));
  12967. this.n39 = (this.getChild("n39"));
  12968. this.n44 = (this.getChild("n44"));
  12969. this.diamondTxt = (this.getChild("diamondTxt"));
  12970. this.n41 = (this.getChild("n41"));
  12971. this.n45 = (this.getChild("n45"));
  12972. this.t0 = this.getTransition("t0");
  12973. }
  12974. }
  12975. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  12976. class ui_hb_zs3 extends fgui.GButton {
  12977. static createInstance() {
  12978. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  12979. }
  12980. onConstruct() {
  12981. this.n20 = (this.getChild("n20"));
  12982. this.n21 = (this.getChild("n21"));
  12983. this.n26 = (this.getChild("n26"));
  12984. this.n27 = (this.getChild("n27"));
  12985. this.n32 = (this.getChild("n32"));
  12986. this.n38 = (this.getChild("n38"));
  12987. this.n47 = (this.getChild("n47"));
  12988. this.t0 = this.getTransition("t0");
  12989. }
  12990. }
  12991. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  12992. class ui_dh_zs2 extends fgui.GComponent {
  12993. static createInstance() {
  12994. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  12995. }
  12996. onConstruct() {
  12997. this.n10 = (this.getChild("n10"));
  12998. this.n9 = (this.getChild("n9"));
  12999. this.n1 = (this.getChild("n1"));
  13000. this.n2 = (this.getChild("n2"));
  13001. this.n3 = (this.getChild("n3"));
  13002. this.n4 = (this.getChild("n4"));
  13003. this.n5 = (this.getChild("n5"));
  13004. this.n6 = (this.getChild("n6"));
  13005. this.n8 = (this.getChild("n8"));
  13006. this.n11 = (this.getChild("n11"));
  13007. this.t0 = this.getTransition("t0");
  13008. }
  13009. }
  13010. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13011. class ui_dh_zs2_1 extends fgui.GComponent {
  13012. static createInstance() {
  13013. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13014. }
  13015. onConstruct() {
  13016. this.n3 = (this.getChild("n3"));
  13017. this.n1 = (this.getChild("n1"));
  13018. this.t0 = this.getTransition("t0");
  13019. }
  13020. }
  13021. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13022. class ui_dh_zs3 extends fgui.GComponent {
  13023. static createInstance() {
  13024. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13025. }
  13026. onConstruct() {
  13027. this.n10 = (this.getChild("n10"));
  13028. this.n9 = (this.getChild("n9"));
  13029. this.n1 = (this.getChild("n1"));
  13030. this.n2 = (this.getChild("n2"));
  13031. this.n3 = (this.getChild("n3"));
  13032. this.n4 = (this.getChild("n4"));
  13033. this.n5 = (this.getChild("n5"));
  13034. this.n6 = (this.getChild("n6"));
  13035. this.n8 = (this.getChild("n8"));
  13036. this.n11 = (this.getChild("n11"));
  13037. this.t0 = this.getTransition("t0");
  13038. }
  13039. }
  13040. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13041. class ui_dh_zs3_1 extends fgui.GComponent {
  13042. static createInstance() {
  13043. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13044. }
  13045. onConstruct() {
  13046. this.n3 = (this.getChild("n3"));
  13047. this.n1 = (this.getChild("n1"));
  13048. this.t0 = this.getTransition("t0");
  13049. }
  13050. }
  13051. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13052. class ui_Component107 extends fgui.GComponent {
  13053. static createInstance() {
  13054. return (fgui.UIPackage.createObject("game", "Component107"));
  13055. }
  13056. onConstruct() {
  13057. this.n18 = (this.getChild("n18"));
  13058. this.n19 = (this.getChild("n19"));
  13059. this.n20 = (this.getChild("n20"));
  13060. this.n21 = (this.getChild("n21"));
  13061. this.n22 = (this.getChild("n22"));
  13062. this.levelTxt = (this.getChild("levelTxt"));
  13063. this.t0 = this.getTransition("t0");
  13064. }
  13065. }
  13066. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13067. class ui_box_com1 extends fgui.GComponent {
  13068. static createInstance() {
  13069. return (fgui.UIPackage.createObject("game", "box_com1"));
  13070. }
  13071. onConstruct() {
  13072. this.n14 = (this.getChild("n14"));
  13073. this.n6 = (this.getChild("n6"));
  13074. this.t0 = this.getTransition("t0");
  13075. }
  13076. }
  13077. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13078. class ui_box_com2 extends fgui.GProgressBar {
  13079. static createInstance() {
  13080. return (fgui.UIPackage.createObject("game", "box_com2"));
  13081. }
  13082. onConstruct() {
  13083. this.bg0 = (this.getChild("bg0"));
  13084. this.bg = (this.getChild("bg"));
  13085. this.bar = (this.getChild("bar"));
  13086. this.n7 = (this.getChild("n7"));
  13087. this.n8 = (this.getChild("n8"));
  13088. this.n10 = (this.getChild("n10"));
  13089. this.n11 = (this.getChild("n11"));
  13090. this.n12 = (this.getChild("n12"));
  13091. }
  13092. }
  13093. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13094. class ui_box_com4 extends fgui.GComponent {
  13095. static createInstance() {
  13096. return (fgui.UIPackage.createObject("game", "box_com4"));
  13097. }
  13098. onConstruct() {
  13099. this.n8 = (this.getChild("n8"));
  13100. this.t0 = this.getTransition("t0");
  13101. }
  13102. }
  13103. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13104. class ui_box_com3 extends fgui.GComponent {
  13105. static createInstance() {
  13106. return (fgui.UIPackage.createObject("game", "box_com3"));
  13107. }
  13108. onConstruct() {
  13109. this.n2 = (this.getChild("n2"));
  13110. this.n3 = (this.getChild("n3"));
  13111. this.n4 = (this.getChild("n4"));
  13112. this.n5 = (this.getChild("n5"));
  13113. this.t0 = this.getTransition("t0");
  13114. this.t1 = this.getTransition("t1");
  13115. }
  13116. }
  13117. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13118. class ui_Component97 extends fgui.GComponent {
  13119. static createInstance() {
  13120. return (fgui.UIPackage.createObject("game", "Component97"));
  13121. }
  13122. onConstruct() {
  13123. this.c1 = this.getController("c1");
  13124. this.n46 = (this.getChild("n46"));
  13125. this.diamondNode = (this.getChild("diamondNode"));
  13126. this.coinNode = (this.getChild("coinNode"));
  13127. this.t0 = this.getTransition("t0");
  13128. }
  13129. }
  13130. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13131. class ui_Component98 extends fgui.GButton {
  13132. static createInstance() {
  13133. return (fgui.UIPackage.createObject("game", "Component98"));
  13134. }
  13135. onConstruct() {
  13136. this.n8 = (this.getChild("n8"));
  13137. this.n40 = (this.getChild("n40"));
  13138. }
  13139. }
  13140. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13141. class ui_Component28_11 extends fgui.GButton {
  13142. static createInstance() {
  13143. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13144. }
  13145. onConstruct() {
  13146. this.c1 = this.getController("c1");
  13147. this.n12 = (this.getChild("n12"));
  13148. this.n17 = (this.getChild("n17"));
  13149. this.n13 = (this.getChild("n13"));
  13150. this.diamondTxt = (this.getChild("diamondTxt"));
  13151. this.n15 = (this.getChild("n15"));
  13152. this.n16 = (this.getChild("n16"));
  13153. }
  13154. }
  13155. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13156. class ui_Component58_11 extends fgui.GComponent {
  13157. static createInstance() {
  13158. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13159. }
  13160. onConstruct() {
  13161. this.c1 = this.getController("c1");
  13162. this.n23 = (this.getChild("n23"));
  13163. this.n41 = (this.getChild("n41"));
  13164. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13165. this.n_daoju = (this.getChild("n_daoju"));
  13166. this.myList = (this.getChild("myList"));
  13167. this.djList = (this.getChild("djList"));
  13168. this.t0 = this.getTransition("t0");
  13169. }
  13170. }
  13171. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13172. class ui_Component100 extends fgui.GComponent {
  13173. static createInstance() {
  13174. return (fgui.UIPackage.createObject("game", "Component100"));
  13175. }
  13176. onConstruct() {
  13177. this.c1 = this.getController("c1");
  13178. this.n75 = (this.getChild("n75"));
  13179. this.n76 = (this.getChild("n76"));
  13180. this.n80 = (this.getChild("n80"));
  13181. this.txt = (this.getChild("txt"));
  13182. this.spineRoot = (this.getChild("spineRoot"));
  13183. }
  13184. }
  13185. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13186. class ui_Component101 extends fgui.GComponent {
  13187. static createInstance() {
  13188. return (fgui.UIPackage.createObject("game", "Component101"));
  13189. }
  13190. onConstruct() {
  13191. this.c1 = this.getController("c1");
  13192. this.n36 = (this.getChild("n36"));
  13193. this.n35 = (this.getChild("n35"));
  13194. this.n33 = (this.getChild("n33"));
  13195. this.n34 = (this.getChild("n34"));
  13196. }
  13197. }
  13198. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13199. class ui_Component53 extends fgui.GComponent {
  13200. static createInstance() {
  13201. return (fgui.UIPackage.createObject("game", "Component53"));
  13202. }
  13203. onConstruct() {
  13204. this.n0 = (this.getChild("n0"));
  13205. this.n1 = (this.getChild("n1"));
  13206. this.n2 = (this.getChild("n2"));
  13207. this.n3 = (this.getChild("n3"));
  13208. this.n4 = (this.getChild("n4"));
  13209. this.n5 = (this.getChild("n5"));
  13210. this.n6 = (this.getChild("n6"));
  13211. this.n7 = (this.getChild("n7"));
  13212. this.n8 = (this.getChild("n8"));
  13213. this.n9 = (this.getChild("n9"));
  13214. this.n10 = (this.getChild("n10"));
  13215. this.n11 = (this.getChild("n11"));
  13216. this.n12 = (this.getChild("n12"));
  13217. this.n13 = (this.getChild("n13"));
  13218. this.n14 = (this.getChild("n14"));
  13219. this.n15 = (this.getChild("n15"));
  13220. this.n16 = (this.getChild("n16"));
  13221. this.n19 = (this.getChild("n19"));
  13222. this.n20 = (this.getChild("n20"));
  13223. this.n21 = (this.getChild("n21"));
  13224. this.n22 = (this.getChild("n22"));
  13225. this.n23 = (this.getChild("n23"));
  13226. this.n24 = (this.getChild("n24"));
  13227. this.n25 = (this.getChild("n25"));
  13228. this.n26 = (this.getChild("n26"));
  13229. this.n27 = (this.getChild("n27"));
  13230. this.n28 = (this.getChild("n28"));
  13231. this.n29 = (this.getChild("n29"));
  13232. this.n30 = (this.getChild("n30"));
  13233. this.n31 = (this.getChild("n31"));
  13234. this.n32 = (this.getChild("n32"));
  13235. this.n33 = (this.getChild("n33"));
  13236. this.n34 = (this.getChild("n34"));
  13237. this.n35 = (this.getChild("n35"));
  13238. this.t0 = this.getTransition("t0");
  13239. }
  13240. }
  13241. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13242. class ui_Component58 extends fgui.GComponent {
  13243. static createInstance() {
  13244. return (fgui.UIPackage.createObject("game", "Component58"));
  13245. }
  13246. onConstruct() {
  13247. this.n23 = (this.getChild("n23"));
  13248. this.n41 = (this.getChild("n41"));
  13249. this.n8 = (this.getChild("n8"));
  13250. this.skillList = (this.getChild("skillList"));
  13251. this.t0 = this.getTransition("t0");
  13252. }
  13253. }
  13254. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13255. class ui_Component59 extends fgui.GComponent {
  13256. static createInstance() {
  13257. return (fgui.UIPackage.createObject("game", "Component59"));
  13258. }
  13259. onConstruct() {
  13260. this.n3 = (this.getChild("n3"));
  13261. this.msgTxt = (this.getChild("msgTxt"));
  13262. this.t0 = this.getTransition("t0");
  13263. }
  13264. }
  13265. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13266. class ui_RulerNode extends fgui.GComponent {
  13267. static createInstance() {
  13268. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13269. }
  13270. onConstruct() {
  13271. this.n6 = (this.getChild("n6"));
  13272. this.n4 = (this.getChild("n4"));
  13273. this.img1 = (this.getChild("img1"));
  13274. this.img2 = (this.getChild("img2"));
  13275. }
  13276. }
  13277. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13278. class ui_Component108 extends fgui.GComponent {
  13279. static createInstance() {
  13280. return (fgui.UIPackage.createObject("game", "Component108"));
  13281. }
  13282. onConstruct() {
  13283. this.n19 = (this.getChild("n19"));
  13284. this.t0 = this.getTransition("t0");
  13285. }
  13286. }
  13287. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13288. class ui_Component63 extends fgui.GComponent {
  13289. static createInstance() {
  13290. return (fgui.UIPackage.createObject("game", "Component63"));
  13291. }
  13292. onConstruct() {
  13293. this.n66 = (this.getChild("n66"));
  13294. this.n56 = (this.getChild("n56"));
  13295. this.n63 = (this.getChild("n63"));
  13296. this.n65 = (this.getChild("n65"));
  13297. this.t0 = this.getTransition("t0");
  13298. }
  13299. }
  13300. ui_Component63.URL = "ui://isxx5ak7h657452";
  13301. class ui_topNode extends fgui.GComponent {
  13302. static createInstance() {
  13303. return (fgui.UIPackage.createObject("game", "topNode"));
  13304. }
  13305. onConstruct() {
  13306. this.selfProgress = (this.getChild("selfProgress"));
  13307. this.aiProgress = (this.getChild("aiProgress"));
  13308. this.selfKuang = (this.getChild("selfKuang"));
  13309. this.aiKuang = (this.getChild("aiKuang"));
  13310. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13311. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13312. this.n33 = (this.getChild("n33"));
  13313. this.n34 = (this.getChild("n34"));
  13314. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13315. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13316. this.selfBallList = (this.getChild("selfBallList"));
  13317. this.aiBallList = (this.getChild("aiBallList"));
  13318. this.middleNode = (this.getChild("middleNode"));
  13319. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13320. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13321. this.scoreNode = (this.getChild("scoreNode"));
  13322. this.selfTips = (this.getChild("selfTips"));
  13323. this.aiTips = (this.getChild("aiTips"));
  13324. }
  13325. }
  13326. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13327. class ui_selfProgress extends fgui.GProgressBar {
  13328. static createInstance() {
  13329. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13330. }
  13331. onConstruct() {
  13332. this.n3 = (this.getChild("n3"));
  13333. this.bar = (this.getChild("bar"));
  13334. }
  13335. }
  13336. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13337. class ui_aiProgress extends fgui.GProgressBar {
  13338. static createInstance() {
  13339. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13340. }
  13341. onConstruct() {
  13342. this.n3 = (this.getChild("n3"));
  13343. this.bar = (this.getChild("bar"));
  13344. }
  13345. }
  13346. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13347. class ui_ballDisplay extends fgui.GComponent {
  13348. static createInstance() {
  13349. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13350. }
  13351. onConstruct() {
  13352. this.myImg = (this.getChild("myImg"));
  13353. }
  13354. }
  13355. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13356. class ui_moveNode extends fgui.GComponent {
  13357. static createInstance() {
  13358. return (fgui.UIPackage.createObject("game", "moveNode"));
  13359. }
  13360. onConstruct() {
  13361. this.n8 = (this.getChild("n8"));
  13362. this.finger = (this.getChild("finger"));
  13363. }
  13364. }
  13365. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13366. class ui_cancelBtn extends fgui.GButton {
  13367. static createInstance() {
  13368. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13369. }
  13370. onConstruct() {
  13371. this.c1 = this.getController("c1");
  13372. this.n0 = (this.getChild("n0"));
  13373. this.n1 = (this.getChild("n1"));
  13374. }
  13375. }
  13376. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13377. class ui_shareBtn extends fgui.GButton {
  13378. static createInstance() {
  13379. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13380. }
  13381. onConstruct() {
  13382. this.c1 = this.getController("c1");
  13383. this.n2 = (this.getChild("n2"));
  13384. this.n1 = (this.getChild("n1"));
  13385. this.n3 = (this.getChild("n3"));
  13386. this.n4 = (this.getChild("n4"));
  13387. this.n5 = (this.getChild("n5"));
  13388. this.n6 = (this.getChild("n6"));
  13389. }
  13390. }
  13391. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13392. class ui_share2Btn extends fgui.GButton {
  13393. static createInstance() {
  13394. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13395. }
  13396. onConstruct() {
  13397. this.n3 = (this.getChild("n3"));
  13398. }
  13399. }
  13400. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13401. class ui_rodMethodNode extends fgui.GComponent {
  13402. static createInstance() {
  13403. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13404. }
  13405. onConstruct() {
  13406. this.bg = (this.getChild("bg"));
  13407. this.dot = (this.getChild("dot"));
  13408. }
  13409. }
  13410. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13411. class ui_sureBtn extends fgui.GButton {
  13412. static createInstance() {
  13413. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13414. }
  13415. onConstruct() {
  13416. this.n2 = (this.getChild("n2"));
  13417. this.n1 = (this.getChild("n1"));
  13418. }
  13419. }
  13420. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13421. class ui_Component18 extends fgui.GComponent {
  13422. static createInstance() {
  13423. return (fgui.UIPackage.createObject("game", "Component18"));
  13424. }
  13425. onConstruct() {
  13426. this.c1 = this.getController("c1");
  13427. this.nameTxt = (this.getChild("nameTxt"));
  13428. this.headImg = (this.getChild("headImg"));
  13429. this.n24 = (this.getChild("n24"));
  13430. this.skillImg = (this.getChild("skillImg"));
  13431. this.skillTxt = (this.getChild("skillTxt"));
  13432. }
  13433. }
  13434. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13435. class ui_Component45 extends fgui.GComponent {
  13436. static createInstance() {
  13437. return (fgui.UIPackage.createObject("game", "Component45"));
  13438. }
  13439. onConstruct() {
  13440. this.c1 = this.getController("c1");
  13441. this.n40 = (this.getChild("n40"));
  13442. this.n41 = (this.getChild("n41"));
  13443. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13444. this.n42 = (this.getChild("n42"));
  13445. this.awardTxt = (this.getChild("awardTxt"));
  13446. this.n44 = (this.getChild("n44"));
  13447. this.t0 = this.getTransition("t0");
  13448. }
  13449. }
  13450. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13451. class ui_emotionDisplay extends fgui.GButton {
  13452. static createInstance() {
  13453. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13454. }
  13455. onConstruct() {
  13456. this.myIcon = (this.getChild("myIcon"));
  13457. }
  13458. }
  13459. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13460. class ui_Component49 extends fgui.GButton {
  13461. static createInstance() {
  13462. return (fgui.UIPackage.createObject("game", "Component49"));
  13463. }
  13464. onConstruct() {
  13465. this.n69 = (this.getChild("n69"));
  13466. this.n56 = (this.getChild("n56"));
  13467. }
  13468. }
  13469. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13470. class ui_Component50 extends fgui.GButton {
  13471. static createInstance() {
  13472. return (fgui.UIPackage.createObject("game", "Component50"));
  13473. }
  13474. onConstruct() {
  13475. this.n54 = (this.getChild("n54"));
  13476. this.n65 = (this.getChild("n65"));
  13477. }
  13478. }
  13479. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13480. class ui_Component51 extends fgui.GButton {
  13481. static createInstance() {
  13482. return (fgui.UIPackage.createObject("game", "Component51"));
  13483. }
  13484. onConstruct() {
  13485. this.c1 = this.getController("c1");
  13486. this.n51 = (this.getChild("n51"));
  13487. this.n54 = (this.getChild("n54"));
  13488. }
  13489. }
  13490. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13491. class ui_Button5 extends fgui.GButton {
  13492. static createInstance() {
  13493. return (fgui.UIPackage.createObject("game", "Button5"));
  13494. }
  13495. onConstruct() {
  13496. this.c1 = this.getController("c1");
  13497. this.n0 = (this.getChild("n0"));
  13498. this.n2 = (this.getChild("n2"));
  13499. }
  13500. }
  13501. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13502. class ui_Component124 extends fgui.GComponent {
  13503. static createInstance() {
  13504. return (fgui.UIPackage.createObject("game", "Component124"));
  13505. }
  13506. onConstruct() {
  13507. this.n22 = (this.getChild("n22"));
  13508. this.shareNode = (this.getChild("shareNode"));
  13509. }
  13510. }
  13511. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13512. class ui_Component125 extends fgui.GComponent {
  13513. static createInstance() {
  13514. return (fgui.UIPackage.createObject("game", "Component125"));
  13515. }
  13516. onConstruct() {
  13517. this.n29 = (this.getChild("n29"));
  13518. this.coinTxt = (this.getChild("coinTxt"));
  13519. }
  13520. }
  13521. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13522. class ui_Component52 extends fgui.GButton {
  13523. static createInstance() {
  13524. return (fgui.UIPackage.createObject("game", "Component52"));
  13525. }
  13526. onConstruct() {
  13527. this.n35 = (this.getChild("n35"));
  13528. this.n36 = (this.getChild("n36"));
  13529. }
  13530. }
  13531. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13532. class ui_drawBtn extends fgui.GButton {
  13533. static createInstance() {
  13534. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13535. }
  13536. onConstruct() {
  13537. this.c1 = this.getController("c1");
  13538. this.n2 = (this.getChild("n2"));
  13539. this.n1 = (this.getChild("n1"));
  13540. this.n5 = (this.getChild("n5"));
  13541. }
  13542. }
  13543. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13544. class ui_Component43 extends fgui.GButton {
  13545. static createInstance() {
  13546. return (fgui.UIPackage.createObject("game", "Component43"));
  13547. }
  13548. onConstruct() {
  13549. this.n49 = (this.getChild("n49"));
  13550. }
  13551. }
  13552. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13553. class ui_wordsDisplay extends fgui.GComponent {
  13554. static createInstance() {
  13555. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13556. }
  13557. onConstruct() {
  13558. this.txt = (this.getChild("txt"));
  13559. this.n63 = (this.getChild("n63"));
  13560. }
  13561. }
  13562. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13563. class ui_Component_phb extends fgui.GComponent {
  13564. static createInstance() {
  13565. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13566. }
  13567. onConstruct() {
  13568. this.n3 = (this.getChild("n3"));
  13569. this.n4 = (this.getChild("n4"));
  13570. }
  13571. }
  13572. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13573. class ui_Component3 extends fgui.GComponent {
  13574. static createInstance() {
  13575. return (fgui.UIPackage.createObject("game", "Component3"));
  13576. }
  13577. onConstruct() {
  13578. this.n26 = (this.getChild("n26"));
  13579. this.n24 = (this.getChild("n24"));
  13580. this.nameTxt = (this.getChild("nameTxt"));
  13581. this.headRoot = (this.getChild("headRoot"));
  13582. }
  13583. }
  13584. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13585. class ui_Component4 extends fgui.GComponent {
  13586. static createInstance() {
  13587. return (fgui.UIPackage.createObject("game", "Component4"));
  13588. }
  13589. onConstruct() {
  13590. this.headImg = (this.getChild("headImg"));
  13591. }
  13592. }
  13593. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13594. class ui_Component7 extends fgui.GButton {
  13595. static createInstance() {
  13596. return (fgui.UIPackage.createObject("game", "Component7"));
  13597. }
  13598. onConstruct() {
  13599. this.n17 = (this.getChild("n17"));
  13600. }
  13601. }
  13602. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13603. class ui_Component8 extends fgui.GButton {
  13604. static createInstance() {
  13605. return (fgui.UIPackage.createObject("game", "Component8"));
  13606. }
  13607. onConstruct() {
  13608. this.n19 = (this.getChild("n19"));
  13609. }
  13610. }
  13611. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13612. class ui_Component10 extends fgui.GButton {
  13613. static createInstance() {
  13614. return (fgui.UIPackage.createObject("game", "Component10"));
  13615. }
  13616. onConstruct() {
  13617. this.c1 = this.getController("c1");
  13618. this.n40 = (this.getChild("n40"));
  13619. }
  13620. }
  13621. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13622. class ui_Component11 extends fgui.GButton {
  13623. static createInstance() {
  13624. return (fgui.UIPackage.createObject("game", "Component11"));
  13625. }
  13626. onConstruct() {
  13627. this.n34 = (this.getChild("n34"));
  13628. }
  13629. }
  13630. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13631. class ui_Component12 extends fgui.GButton {
  13632. static createInstance() {
  13633. return (fgui.UIPackage.createObject("game", "Component12"));
  13634. }
  13635. onConstruct() {
  13636. this.n35 = (this.getChild("n35"));
  13637. }
  13638. }
  13639. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13640. class ui_Component13 extends fgui.GButton {
  13641. static createInstance() {
  13642. return (fgui.UIPackage.createObject("game", "Component13"));
  13643. }
  13644. onConstruct() {
  13645. this.n27 = (this.getChild("n27"));
  13646. this.n36 = (this.getChild("n36"));
  13647. }
  13648. }
  13649. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  13650. class ui_dh_js_tuowei extends fgui.GComponent {
  13651. static createInstance() {
  13652. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  13653. }
  13654. onConstruct() {
  13655. this.n19 = (this.getChild("n19"));
  13656. this.n18 = (this.getChild("n18"));
  13657. this.n0 = (this.getChild("n0"));
  13658. this.n3 = (this.getChild("n3"));
  13659. this.n4 = (this.getChild("n4"));
  13660. this.n5 = (this.getChild("n5"));
  13661. this.n6 = (this.getChild("n6"));
  13662. this.n8 = (this.getChild("n8"));
  13663. this.n9 = (this.getChild("n9"));
  13664. this.n10 = (this.getChild("n10"));
  13665. this.n11 = (this.getChild("n11"));
  13666. this.n12 = (this.getChild("n12"));
  13667. this.n13 = (this.getChild("n13"));
  13668. this.n14 = (this.getChild("n14"));
  13669. this.n15 = (this.getChild("n15"));
  13670. this.n20 = (this.getChild("n20"));
  13671. this.t0 = this.getTransition("t0");
  13672. this.t1 = this.getTransition("t1");
  13673. }
  13674. }
  13675. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  13676. class ui_dh_js_tw_g extends fgui.GComponent {
  13677. static createInstance() {
  13678. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  13679. }
  13680. onConstruct() {
  13681. this.n0 = (this.getChild("n0"));
  13682. this.n1 = (this.getChild("n1"));
  13683. this.t0 = this.getTransition("t0");
  13684. }
  13685. }
  13686. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  13687. class ui_dh_js_xingxing extends fgui.GComponent {
  13688. static createInstance() {
  13689. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  13690. }
  13691. onConstruct() {
  13692. this.n1 = (this.getChild("n1"));
  13693. this.n2 = (this.getChild("n2"));
  13694. this.n3 = (this.getChild("n3"));
  13695. this.n4 = (this.getChild("n4"));
  13696. this.n0 = (this.getChild("n0"));
  13697. this.t2 = this.getTransition("t2");
  13698. this.t1 = this.getTransition("t1");
  13699. }
  13700. }
  13701. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  13702. class ui_dh_zy_jiazai extends fgui.GComponent {
  13703. static createInstance() {
  13704. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  13705. }
  13706. onConstruct() {
  13707. this.c1 = this.getController("c1");
  13708. this.n0 = (this.getChild("n0"));
  13709. this.n1 = (this.getChild("n1"));
  13710. this.n2 = (this.getChild("n2"));
  13711. this.n4 = (this.getChild("n4"));
  13712. this.n5 = (this.getChild("n5"));
  13713. this.n6 = (this.getChild("n6"));
  13714. this.n8 = (this.getChild("n8"));
  13715. this.n7 = (this.getChild("n7"));
  13716. this.t0 = this.getTransition("t0");
  13717. }
  13718. }
  13719. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  13720. class ui_dh_js_xingxing2 extends fgui.GComponent {
  13721. static createInstance() {
  13722. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  13723. }
  13724. onConstruct() {
  13725. this.c1 = this.getController("c1");
  13726. this.n3 = (this.getChild("n3"));
  13727. this.n5 = (this.getChild("n5"));
  13728. this.n4 = (this.getChild("n4"));
  13729. this.n0 = (this.getChild("n0"));
  13730. this.n1 = (this.getChild("n1"));
  13731. this.n2 = (this.getChild("n2"));
  13732. }
  13733. }
  13734. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  13735. class ui_dh_js_tuowei2 extends fgui.GComponent {
  13736. static createInstance() {
  13737. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  13738. }
  13739. onConstruct() {
  13740. this.n19 = (this.getChild("n19"));
  13741. this.n21 = (this.getChild("n21"));
  13742. this.n0 = (this.getChild("n0"));
  13743. this.n3 = (this.getChild("n3"));
  13744. this.n4 = (this.getChild("n4"));
  13745. this.n5 = (this.getChild("n5"));
  13746. this.n6 = (this.getChild("n6"));
  13747. this.n8 = (this.getChild("n8"));
  13748. this.n9 = (this.getChild("n9"));
  13749. this.n10 = (this.getChild("n10"));
  13750. this.n11 = (this.getChild("n11"));
  13751. this.n12 = (this.getChild("n12"));
  13752. this.n13 = (this.getChild("n13"));
  13753. this.n14 = (this.getChild("n14"));
  13754. this.n15 = (this.getChild("n15"));
  13755. this.n23 = (this.getChild("n23"));
  13756. this.t0 = this.getTransition("t0");
  13757. this.t1 = this.getTransition("t1");
  13758. }
  13759. }
  13760. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  13761. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  13762. static createInstance() {
  13763. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  13764. }
  13765. onConstruct() {
  13766. this.n1 = (this.getChild("n1"));
  13767. this.n2 = (this.getChild("n2"));
  13768. this.t0 = this.getTransition("t0");
  13769. }
  13770. }
  13771. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  13772. class ui_dh_js_shibai_1 extends fgui.GComponent {
  13773. static createInstance() {
  13774. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  13775. }
  13776. onConstruct() {
  13777. this.n4 = (this.getChild("n4"));
  13778. this.n2 = (this.getChild("n2"));
  13779. this.n3 = (this.getChild("n3"));
  13780. this.idle = this.getTransition("idle");
  13781. this.attack = this.getTransition("attack");
  13782. }
  13783. }
  13784. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  13785. class ui_special extends fgui.GComponent {
  13786. static createInstance() {
  13787. return (fgui.UIPackage.createObject("game", "special"));
  13788. }
  13789. onConstruct() {
  13790. this.n18 = (this.getChild("n18"));
  13791. this.n19 = (this.getChild("n19"));
  13792. this.n20 = (this.getChild("n20"));
  13793. this.n21 = (this.getChild("n21"));
  13794. this.n22 = (this.getChild("n22"));
  13795. this.levelTxt = (this.getChild("levelTxt"));
  13796. this.n24 = (this.getChild("n24"));
  13797. this.n25 = (this.getChild("n25"));
  13798. this.t0 = this.getTransition("t0");
  13799. }
  13800. }
  13801. ui_special.URL = "ui://isxx5ak7j979v4i6";
  13802. class ui_Component145 extends fgui.GComponent {
  13803. static createInstance() {
  13804. return (fgui.UIPackage.createObject("game", "Component145"));
  13805. }
  13806. onConstruct() {
  13807. this.guanyuNode = (this.getChild("guanyuNode"));
  13808. }
  13809. }
  13810. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  13811. class ui_longBtn extends fgui.GButton {
  13812. static createInstance() {
  13813. return (fgui.UIPackage.createObject("game", "longBtn"));
  13814. }
  13815. onConstruct() {
  13816. this.c1 = this.getController("c1");
  13817. this.n2 = (this.getChild("n2"));
  13818. this.n1 = (this.getChild("n1"));
  13819. this.n4 = (this.getChild("n4"));
  13820. }
  13821. }
  13822. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  13823. class ui_Component146 extends fgui.GComponent {
  13824. static createInstance() {
  13825. return (fgui.UIPackage.createObject("game", "Component146"));
  13826. }
  13827. onConstruct() {
  13828. this.n89 = (this.getChild("n89"));
  13829. this.n90 = (this.getChild("n90"));
  13830. this.guideBtn = (this.getChild("guideBtn"));
  13831. }
  13832. }
  13833. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  13834. class ui_Component146_11 extends fgui.GComponent {
  13835. static createInstance() {
  13836. return (fgui.UIPackage.createObject("game", "Component146_11"));
  13837. }
  13838. onConstruct() {
  13839. this.n89 = (this.getChild("n89"));
  13840. this.n90 = (this.getChild("n90"));
  13841. this.guideBtn = (this.getChild("guideBtn"));
  13842. }
  13843. }
  13844. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  13845. class ui_Component111_1 extends fgui.GComponent {
  13846. static createInstance() {
  13847. return (fgui.UIPackage.createObject("game", "Component111_1"));
  13848. }
  13849. onConstruct() {
  13850. this.n68 = (this.getChild("n68"));
  13851. this.myMask = (this.getChild("myMask"));
  13852. }
  13853. }
  13854. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  13855. class ui_Component64_1 extends fgui.GComponent {
  13856. static createInstance() {
  13857. return (fgui.UIPackage.createObject("game", "Component64_1"));
  13858. }
  13859. onConstruct() {
  13860. this.n57 = (this.getChild("n57"));
  13861. this.n54 = (this.getChild("n54"));
  13862. this.n55 = (this.getChild("n55"));
  13863. this.n56 = (this.getChild("n56"));
  13864. this.t1 = this.getTransition("t1");
  13865. }
  13866. }
  13867. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  13868. class ui_ModeSelection_com123 extends fgui.GComponent {
  13869. static createInstance() {
  13870. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  13871. }
  13872. onConstruct() {
  13873. this.type1 = (this.getChild("type1"));
  13874. this.type2 = (this.getChild("type2"));
  13875. this.type3 = (this.getChild("type3"));
  13876. this.n38 = (this.getChild("n38"));
  13877. this.t0 = this.getTransition("t0");
  13878. }
  13879. }
  13880. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  13881. class ui_Component132_2 extends fgui.GComponent {
  13882. static createInstance() {
  13883. return (fgui.UIPackage.createObject("game", "Component132_2"));
  13884. }
  13885. onConstruct() {
  13886. this.n25 = (this.getChild("n25"));
  13887. this.n26 = (this.getChild("n26"));
  13888. this.n27 = (this.getChild("n27"));
  13889. this.t0 = this.getTransition("t0");
  13890. }
  13891. }
  13892. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  13893. class ui_UIPower$1 extends fgui.GComponent {
  13894. static createInstance() {
  13895. return (fgui.UIPackage.createObject("game", "UIPower"));
  13896. }
  13897. onConstruct() {
  13898. this.n11 = (this.getChild("n11"));
  13899. this.myNode = (this.getChild("myNode"));
  13900. this.t0 = this.getTransition("t0");
  13901. }
  13902. }
  13903. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  13904. class ui_Component133 extends fgui.GComponent {
  13905. static createInstance() {
  13906. return (fgui.UIPackage.createObject("game", "Component133"));
  13907. }
  13908. onConstruct() {
  13909. this.n29 = (this.getChild("n29"));
  13910. this.n30 = (this.getChild("n30"));
  13911. }
  13912. }
  13913. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  13914. class ui_Component134 extends fgui.GComponent {
  13915. static createInstance() {
  13916. return (fgui.UIPackage.createObject("game", "Component134"));
  13917. }
  13918. onConstruct() {
  13919. this.n30 = (this.getChild("n30"));
  13920. this.n31 = (this.getChild("n31"));
  13921. this.t0 = this.getTransition("t0");
  13922. }
  13923. }
  13924. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  13925. class ui_Component135 extends fgui.GComponent {
  13926. static createInstance() {
  13927. return (fgui.UIPackage.createObject("game", "Component135"));
  13928. }
  13929. onConstruct() {
  13930. this.n30 = (this.getChild("n30"));
  13931. this.t0 = this.getTransition("t0");
  13932. }
  13933. }
  13934. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  13935. class ui_Component137 extends fgui.GComponent {
  13936. static createInstance() {
  13937. return (fgui.UIPackage.createObject("game", "Component137"));
  13938. }
  13939. onConstruct() {
  13940. this.n28 = (this.getChild("n28"));
  13941. this.n29 = (this.getChild("n29"));
  13942. this.n30 = (this.getChild("n30"));
  13943. this.n32 = (this.getChild("n32"));
  13944. }
  13945. }
  13946. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  13947. class ui_dh_zuanshi extends fgui.GButton {
  13948. static createInstance() {
  13949. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  13950. }
  13951. onConstruct() {
  13952. this.n1 = (this.getChild("n1"));
  13953. this.n2 = (this.getChild("n2"));
  13954. this.n0 = (this.getChild("n0"));
  13955. this.n3 = (this.getChild("n3"));
  13956. this.n4 = (this.getChild("n4"));
  13957. }
  13958. }
  13959. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  13960. class ui_Component138 extends fgui.GComponent {
  13961. static createInstance() {
  13962. return (fgui.UIPackage.createObject("game", "Component138"));
  13963. }
  13964. onConstruct() {
  13965. this.n1 = (this.getChild("n1"));
  13966. this.n2 = (this.getChild("n2"));
  13967. this.t0 = this.getTransition("t0");
  13968. }
  13969. }
  13970. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  13971. class ui_Component139 extends fgui.GComponent {
  13972. static createInstance() {
  13973. return (fgui.UIPackage.createObject("game", "Component139"));
  13974. }
  13975. onConstruct() {
  13976. this.n0 = (this.getChild("n0"));
  13977. this.t0 = this.getTransition("t0");
  13978. }
  13979. }
  13980. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  13981. class ui_Component140 extends fgui.GComponent {
  13982. static createInstance() {
  13983. return (fgui.UIPackage.createObject("game", "Component140"));
  13984. }
  13985. onConstruct() {
  13986. this.n2 = (this.getChild("n2"));
  13987. this.n3 = (this.getChild("n3"));
  13988. this.t0 = this.getTransition("t0");
  13989. }
  13990. }
  13991. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  13992. class ui_Component141 extends fgui.GComponent {
  13993. static createInstance() {
  13994. return (fgui.UIPackage.createObject("game", "Component141"));
  13995. }
  13996. onConstruct() {
  13997. this.n0 = (this.getChild("n0"));
  13998. this.t0 = this.getTransition("t0");
  13999. }
  14000. }
  14001. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14002. class ui_powerNode extends fgui.GProgressBar {
  14003. static createInstance() {
  14004. return (fgui.UIPackage.createObject("game", "powerNode"));
  14005. }
  14006. onConstruct() {
  14007. this.n2 = (this.getChild("n2"));
  14008. this.bar_v = (this.getChild("bar_v"));
  14009. this.showImg = (this.getChild("showImg"));
  14010. this.n12 = (this.getChild("n12"));
  14011. }
  14012. }
  14013. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14014. class ui_dh_jingbi1 extends fgui.GComponent {
  14015. static createInstance() {
  14016. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14017. }
  14018. onConstruct() {
  14019. this.n0 = (this.getChild("n0"));
  14020. this.n1 = (this.getChild("n1"));
  14021. this.n2 = (this.getChild("n2"));
  14022. this.n3 = (this.getChild("n3"));
  14023. this.n4 = (this.getChild("n4"));
  14024. this.n5 = (this.getChild("n5"));
  14025. this.n6 = (this.getChild("n6"));
  14026. this.n8 = (this.getChild("n8"));
  14027. this.t0 = this.getTransition("t0");
  14028. }
  14029. }
  14030. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14031. class ui_Component94 extends fgui.GButton {
  14032. static createInstance() {
  14033. return (fgui.UIPackage.createObject("game", "Component94"));
  14034. }
  14035. onConstruct() {
  14036. this.n77 = (this.getChild("n77"));
  14037. }
  14038. }
  14039. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14040. class ui_Component95 extends fgui.GButton {
  14041. static createInstance() {
  14042. return (fgui.UIPackage.createObject("game", "Component95"));
  14043. }
  14044. onConstruct() {
  14045. this.n77 = (this.getChild("n77"));
  14046. }
  14047. }
  14048. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14049. class ui_Component126 extends fgui.GComponent {
  14050. static createInstance() {
  14051. return (fgui.UIPackage.createObject("game", "Component126"));
  14052. }
  14053. onConstruct() {
  14054. this.c1 = this.getController("c1");
  14055. this.normalBtn = (this.getChild("normalBtn"));
  14056. this.tripleBtn = (this.getChild("tripleBtn"));
  14057. }
  14058. }
  14059. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14060. class ui_Component60 extends fgui.GComponent {
  14061. static createInstance() {
  14062. return (fgui.UIPackage.createObject("game", "Component60"));
  14063. }
  14064. onConstruct() {
  14065. this.c1 = this.getController("c1");
  14066. this.n48 = (this.getChild("n48"));
  14067. this.womanTxt = (this.getChild("womanTxt"));
  14068. this.t0 = this.getTransition("t0");
  14069. }
  14070. }
  14071. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14072. class ui_Component98_3 extends fgui.GButton {
  14073. static createInstance() {
  14074. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14075. }
  14076. onConstruct() {
  14077. this.c1 = this.getController("c1");
  14078. this.n8 = (this.getChild("n8"));
  14079. this.n41 = (this.getChild("n41"));
  14080. this.n40 = (this.getChild("n40"));
  14081. }
  14082. }
  14083. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14084. class ui_ModeSelection_com1 extends fgui.GButton {
  14085. static createInstance() {
  14086. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14087. }
  14088. onConstruct() {
  14089. this.n34 = (this.getChild("n34"));
  14090. this.n36 = (this.getChild("n36"));
  14091. this.n22 = (this.getChild("n22"));
  14092. this.n20 = (this.getChild("n20"));
  14093. this.n23 = (this.getChild("n23"));
  14094. this.n24 = (this.getChild("n24"));
  14095. this.n26 = (this.getChild("n26"));
  14096. this.n33 = (this.getChild("n33"));
  14097. this.coinImg = (this.getChild("coinImg"));
  14098. this.need = (this.getChild("need"));
  14099. this.n35 = (this.getChild("n35"));
  14100. this.n29 = (this.getChild("n29"));
  14101. this.tipsTxt = (this.getChild("tipsTxt"));
  14102. this.n30 = (this.getChild("n30"));
  14103. this.peopleTxt = (this.getChild("peopleTxt"));
  14104. this.t0 = this.getTransition("t0");
  14105. }
  14106. }
  14107. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14108. class ui_ModeSelection_com2 extends fgui.GButton {
  14109. static createInstance() {
  14110. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14111. }
  14112. onConstruct() {
  14113. this.n36 = (this.getChild("n36"));
  14114. this.n34 = (this.getChild("n34"));
  14115. this.n22 = (this.getChild("n22"));
  14116. this.n20 = (this.getChild("n20"));
  14117. this.n23 = (this.getChild("n23"));
  14118. this.n24 = (this.getChild("n24"));
  14119. this.n26 = (this.getChild("n26"));
  14120. this.n33 = (this.getChild("n33"));
  14121. this.coinImg = (this.getChild("coinImg"));
  14122. this.need = (this.getChild("need"));
  14123. this.n35 = (this.getChild("n35"));
  14124. this.n29 = (this.getChild("n29"));
  14125. this.tipsTxt = (this.getChild("tipsTxt"));
  14126. this.n30 = (this.getChild("n30"));
  14127. this.peopleTxt = (this.getChild("peopleTxt"));
  14128. this.t0 = this.getTransition("t0");
  14129. }
  14130. }
  14131. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14132. class ui_ModeSelection_com3 extends fgui.GButton {
  14133. static createInstance() {
  14134. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14135. }
  14136. onConstruct() {
  14137. this.n34 = (this.getChild("n34"));
  14138. this.n36 = (this.getChild("n36"));
  14139. this.n22 = (this.getChild("n22"));
  14140. this.n20 = (this.getChild("n20"));
  14141. this.n23 = (this.getChild("n23"));
  14142. this.n24 = (this.getChild("n24"));
  14143. this.n26 = (this.getChild("n26"));
  14144. this.n33 = (this.getChild("n33"));
  14145. this.coinImg = (this.getChild("coinImg"));
  14146. this.need = (this.getChild("need"));
  14147. this.n35 = (this.getChild("n35"));
  14148. this.n29 = (this.getChild("n29"));
  14149. this.tipsTxt = (this.getChild("tipsTxt"));
  14150. this.n30 = (this.getChild("n30"));
  14151. this.peopleTxt = (this.getChild("peopleTxt"));
  14152. this.t0 = this.getTransition("t0");
  14153. }
  14154. }
  14155. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14156. class ui_Invitation_com1 extends fgui.GComponent {
  14157. static createInstance() {
  14158. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14159. }
  14160. onConstruct() {
  14161. this.n14 = (this.getChild("n14"));
  14162. this.n13 = (this.getChild("n13"));
  14163. this.n3 = (this.getChild("n3"));
  14164. this.n1 = (this.getChild("n1"));
  14165. this.n6 = (this.getChild("n6"));
  14166. this.n7 = (this.getChild("n7"));
  14167. this.enterBtn = (this.getChild("enterBtn"));
  14168. this.n11 = (this.getChild("n11"));
  14169. this.n12 = (this.getChild("n12"));
  14170. this.n15 = (this.getChild("n15"));
  14171. this.t0 = this.getTransition("t0");
  14172. this.t1 = this.getTransition("t1");
  14173. }
  14174. }
  14175. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14176. class ui_Component87_1 extends fgui.GComponent {
  14177. static createInstance() {
  14178. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14179. }
  14180. onConstruct() {
  14181. this.n74 = (this.getChild("n74"));
  14182. this.n73 = (this.getChild("n73"));
  14183. this.ballTxt = (this.getChild("ballTxt"));
  14184. this.n76 = (this.getChild("n76"));
  14185. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14186. this.levelTxt = (this.getChild("levelTxt"));
  14187. this.n87 = (this.getChild("n87"));
  14188. this.n84 = (this.getChild("n84"));
  14189. this.hpTxt = (this.getChild("hpTxt"));
  14190. this.n89 = (this.getChild("n89"));
  14191. this.tipsTxt = (this.getChild("tipsTxt"));
  14192. }
  14193. }
  14194. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14195. class ui_sqg1 extends fgui.GComponent {
  14196. static createInstance() {
  14197. return (fgui.UIPackage.createObject("game", "sqg1"));
  14198. }
  14199. onConstruct() {
  14200. this.n1 = (this.getChild("n1"));
  14201. this.n0 = (this.getChild("n0"));
  14202. }
  14203. }
  14204. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14205. class ui_sqg2 extends fgui.GComponent {
  14206. static createInstance() {
  14207. return (fgui.UIPackage.createObject("game", "sqg2"));
  14208. }
  14209. onConstruct() {
  14210. this.n1 = (this.getChild("n1"));
  14211. this.n0 = (this.getChild("n0"));
  14212. }
  14213. }
  14214. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14215. class ui_sqg3 extends fgui.GComponent {
  14216. static createInstance() {
  14217. return (fgui.UIPackage.createObject("game", "sqg3"));
  14218. }
  14219. onConstruct() {
  14220. this.n1 = (this.getChild("n1"));
  14221. this.n0 = (this.getChild("n0"));
  14222. }
  14223. }
  14224. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14225. class ui_sqg4 extends fgui.GComponent {
  14226. static createInstance() {
  14227. return (fgui.UIPackage.createObject("game", "sqg4"));
  14228. }
  14229. onConstruct() {
  14230. this.n1 = (this.getChild("n1"));
  14231. this.n0 = (this.getChild("n0"));
  14232. }
  14233. }
  14234. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14235. class ui_Component36 extends fgui.GButton {
  14236. static createInstance() {
  14237. return (fgui.UIPackage.createObject("game", "Component36"));
  14238. }
  14239. onConstruct() {
  14240. this.c1 = this.getController("c1");
  14241. this.n53 = (this.getChild("n53"));
  14242. this.n56 = (this.getChild("n56"));
  14243. }
  14244. }
  14245. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14246. class ui_Component37 extends fgui.GButton {
  14247. static createInstance() {
  14248. return (fgui.UIPackage.createObject("game", "Component37"));
  14249. }
  14250. onConstruct() {
  14251. this.c1 = this.getController("c1");
  14252. this.n52 = (this.getChild("n52"));
  14253. this.n54 = (this.getChild("n54"));
  14254. }
  14255. }
  14256. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14257. class ui_UISetting extends fgui.GComponent {
  14258. static createInstance() {
  14259. return (fgui.UIPackage.createObject("game", "UISetting"));
  14260. }
  14261. onConstruct() {
  14262. this.c1 = this.getController("c1");
  14263. this.n4 = (this.getChild("n4"));
  14264. this.soundBtn = (this.getChild("soundBtn"));
  14265. this.shakeBtn = (this.getChild("shakeBtn"));
  14266. this.clickNode = (this.getChild("clickNode"));
  14267. this.xyBtn = (this.getChild("xyBtn"));
  14268. }
  14269. }
  14270. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14271. class ui_Component39 extends fgui.GComponent {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "Component39"));
  14274. }
  14275. onConstruct() {
  14276. this.n5 = (this.getChild("n5"));
  14277. this.n6 = (this.getChild("n6"));
  14278. this.n7 = (this.getChild("n7"));
  14279. this.t0 = this.getTransition("t0");
  14280. }
  14281. }
  14282. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14283. class ui_Component40 extends fgui.GButton {
  14284. static createInstance() {
  14285. return (fgui.UIPackage.createObject("game", "Component40"));
  14286. }
  14287. onConstruct() {
  14288. this.n46 = (this.getChild("n46"));
  14289. this.n47 = (this.getChild("n47"));
  14290. }
  14291. }
  14292. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14293. class ui_Component41 extends fgui.GComponent {
  14294. static createInstance() {
  14295. return (fgui.UIPackage.createObject("game", "Component41"));
  14296. }
  14297. onConstruct() {
  14298. this.c1 = this.getController("c1");
  14299. this.n0 = (this.getChild("n0"));
  14300. this.titleTxt = (this.getChild("titleTxt"));
  14301. this.n2 = (this.getChild("n2"));
  14302. this.msgTips = (this.getChild("msgTips"));
  14303. this.numTxt = (this.getChild("numTxt"));
  14304. this.n18 = (this.getChild("n18"));
  14305. this.cancelBtn = (this.getChild("cancelBtn"));
  14306. this.videoBtn = (this.getChild("videoBtn"));
  14307. this.n10 = (this.getChild("n10"));
  14308. }
  14309. }
  14310. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14311. class ui_Component42 extends fgui.GComponent {
  14312. static createInstance() {
  14313. return (fgui.UIPackage.createObject("game", "Component42"));
  14314. }
  14315. onConstruct() {
  14316. this.c1 = this.getController("c1");
  14317. this.n1 = (this.getChild("n1"));
  14318. this.n2 = (this.getChild("n2"));
  14319. this.n3 = (this.getChild("n3"));
  14320. this.tipsTxt = (this.getChild("tipsTxt"));
  14321. this.cancelBtn = (this.getChild("cancelBtn"));
  14322. this.sureBtn = (this.getChild("sureBtn"));
  14323. this.n11 = (this.getChild("n11"));
  14324. this.n13 = (this.getChild("n13"));
  14325. this.n14 = (this.getChild("n14"));
  14326. this.womanTxt = (this.getChild("womanTxt"));
  14327. this.t0 = this.getTransition("t0");
  14328. }
  14329. }
  14330. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14331. class ui_dh_js_shengli extends fgui.GComponent {
  14332. static createInstance() {
  14333. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14334. }
  14335. onConstruct() {
  14336. this.n3 = (this.getChild("n3"));
  14337. this.n4 = (this.getChild("n4"));
  14338. this.n1 = (this.getChild("n1"));
  14339. this.n2 = (this.getChild("n2"));
  14340. this.n5 = (this.getChild("n5"));
  14341. this.n6 = (this.getChild("n6"));
  14342. this.n7 = (this.getChild("n7"));
  14343. this.n8 = (this.getChild("n8"));
  14344. this.attack = this.getTransition("attack");
  14345. this.idle = this.getTransition("idle");
  14346. }
  14347. }
  14348. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14349. class ui_dh_js_shengli_g extends fgui.GComponent {
  14350. static createInstance() {
  14351. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14352. }
  14353. onConstruct() {
  14354. this.n3 = (this.getChild("n3"));
  14355. this.n1 = (this.getChild("n1"));
  14356. this.t0 = this.getTransition("t0");
  14357. }
  14358. }
  14359. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14360. class ui_dh_js_shibai extends fgui.GComponent {
  14361. static createInstance() {
  14362. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14363. }
  14364. onConstruct() {
  14365. this.n0 = (this.getChild("n0"));
  14366. this.n1 = (this.getChild("n1"));
  14367. this.n2 = (this.getChild("n2"));
  14368. this.n3 = (this.getChild("n3"));
  14369. this.idle = this.getTransition("idle");
  14370. this.attack = this.getTransition("attack");
  14371. }
  14372. }
  14373. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14374. class ui_dh_zy_ganfa extends fgui.GButton {
  14375. static createInstance() {
  14376. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14377. }
  14378. onConstruct() {
  14379. this.n0 = (this.getChild("n0"));
  14380. }
  14381. }
  14382. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14383. class ui_dh_zy_sc_guang extends fgui.GButton {
  14384. static createInstance() {
  14385. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14386. }
  14387. onConstruct() {
  14388. this.n0 = (this.getChild("n0"));
  14389. this.n2 = (this.getChild("n2"));
  14390. }
  14391. }
  14392. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14393. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14394. static createInstance() {
  14395. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14396. }
  14397. onConstruct() {
  14398. this.n0 = (this.getChild("n0"));
  14399. this.n3 = (this.getChild("n3"));
  14400. this.t0 = this.getTransition("t0");
  14401. }
  14402. }
  14403. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14404. class ui_dh_zy_wanfa extends fgui.GButton {
  14405. static createInstance() {
  14406. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14407. }
  14408. onConstruct() {
  14409. this.n0 = (this.getChild("n0"));
  14410. }
  14411. }
  14412. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14413. class ui_Button_login extends fgui.GButton {
  14414. static createInstance() {
  14415. return (fgui.UIPackage.createObject("game", "Button_login"));
  14416. }
  14417. onConstruct() {
  14418. this.button = this.getController("button");
  14419. this.n5 = (this.getChild("n5"));
  14420. this.n3 = (this.getChild("n3"));
  14421. }
  14422. }
  14423. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14424. class ui_Component53_1 extends fgui.GComponent {
  14425. static createInstance() {
  14426. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14427. }
  14428. onConstruct() {
  14429. this.n0 = (this.getChild("n0"));
  14430. this.n1 = (this.getChild("n1"));
  14431. this.n2 = (this.getChild("n2"));
  14432. this.n3 = (this.getChild("n3"));
  14433. this.n4 = (this.getChild("n4"));
  14434. this.n5 = (this.getChild("n5"));
  14435. this.n6 = (this.getChild("n6"));
  14436. this.n7 = (this.getChild("n7"));
  14437. this.n8 = (this.getChild("n8"));
  14438. this.n9 = (this.getChild("n9"));
  14439. this.n10 = (this.getChild("n10"));
  14440. this.n11 = (this.getChild("n11"));
  14441. this.n12 = (this.getChild("n12"));
  14442. this.n13 = (this.getChild("n13"));
  14443. this.n14 = (this.getChild("n14"));
  14444. this.n15 = (this.getChild("n15"));
  14445. this.n16 = (this.getChild("n16"));
  14446. this.n19 = (this.getChild("n19"));
  14447. this.n20 = (this.getChild("n20"));
  14448. this.n21 = (this.getChild("n21"));
  14449. this.n22 = (this.getChild("n22"));
  14450. this.n23 = (this.getChild("n23"));
  14451. this.n24 = (this.getChild("n24"));
  14452. this.n25 = (this.getChild("n25"));
  14453. this.n26 = (this.getChild("n26"));
  14454. this.n27 = (this.getChild("n27"));
  14455. this.n28 = (this.getChild("n28"));
  14456. this.n29 = (this.getChild("n29"));
  14457. this.n30 = (this.getChild("n30"));
  14458. this.n31 = (this.getChild("n31"));
  14459. this.n32 = (this.getChild("n32"));
  14460. this.n33 = (this.getChild("n33"));
  14461. this.n34 = (this.getChild("n34"));
  14462. this.n35 = (this.getChild("n35"));
  14463. this.t0 = this.getTransition("t0");
  14464. }
  14465. }
  14466. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14467. class ui_Component30 extends fgui.GComponent {
  14468. static createInstance() {
  14469. return (fgui.UIPackage.createObject("game", "Component30"));
  14470. }
  14471. onConstruct() {
  14472. this.c1 = this.getController("c1");
  14473. this.n46 = (this.getChild("n46"));
  14474. this.n47 = (this.getChild("n47"));
  14475. this.numTxt = (this.getChild("numTxt"));
  14476. this.n50 = (this.getChild("n50"));
  14477. this.n53 = (this.getChild("n53"));
  14478. this.n54 = (this.getChild("n54"));
  14479. this.n55 = (this.getChild("n55"));
  14480. this.n56 = (this.getChild("n56"));
  14481. }
  14482. }
  14483. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14484. class ui_Component30_1 extends fgui.GComponent {
  14485. static createInstance() {
  14486. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14487. }
  14488. onConstruct() {
  14489. this.c1 = this.getController("c1");
  14490. this.n46 = (this.getChild("n46"));
  14491. this.n47 = (this.getChild("n47"));
  14492. this.numTxt = (this.getChild("numTxt"));
  14493. this.n50 = (this.getChild("n50"));
  14494. this.n51 = (this.getChild("n51"));
  14495. this.n52 = (this.getChild("n52"));
  14496. this.n53 = (this.getChild("n53"));
  14497. this.n54 = (this.getChild("n54"));
  14498. }
  14499. }
  14500. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14501. class ui_Component31 extends fgui.GComponent {
  14502. static createInstance() {
  14503. return (fgui.UIPackage.createObject("game", "Component31"));
  14504. }
  14505. onConstruct() {
  14506. this.n55 = (this.getChild("n55"));
  14507. this.n54 = (this.getChild("n54"));
  14508. this.conditionTxt = (this.getChild("conditionTxt"));
  14509. this.n57 = (this.getChild("n57"));
  14510. this.t0 = this.getTransition("t0");
  14511. }
  14512. }
  14513. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14514. class ui_Component32 extends fgui.GComponent {
  14515. static createInstance() {
  14516. return (fgui.UIPackage.createObject("game", "Component32"));
  14517. }
  14518. onConstruct() {
  14519. this.n5 = (this.getChild("n5"));
  14520. this.n6 = (this.getChild("n6"));
  14521. this.n7 = (this.getChild("n7"));
  14522. this.t0 = this.getTransition("t0");
  14523. }
  14524. }
  14525. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14526. class ui_AwardItem extends fgui.GComponent {
  14527. static createInstance() {
  14528. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14529. }
  14530. onConstruct() {
  14531. this.n9 = (this.getChild("n9"));
  14532. this.myIcon = (this.getChild("myIcon"));
  14533. this.numTxt = (this.getChild("numTxt"));
  14534. this.nameTxt = (this.getChild("nameTxt"));
  14535. this.n16 = (this.getChild("n16"));
  14536. this.n17 = (this.getChild("n17"));
  14537. }
  14538. }
  14539. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14540. class ui_ranking_com1 extends fgui.GButton {
  14541. static createInstance() {
  14542. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14543. }
  14544. onConstruct() {
  14545. this.c1 = this.getController("c1");
  14546. this.n49 = (this.getChild("n49"));
  14547. this.n18 = (this.getChild("n18"));
  14548. this.n46 = (this.getChild("n46"));
  14549. this.n48 = (this.getChild("n48"));
  14550. this.n50 = (this.getChild("n50"));
  14551. }
  14552. }
  14553. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14554. class ui_ranking_com2 extends fgui.GButton {
  14555. static createInstance() {
  14556. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14557. }
  14558. onConstruct() {
  14559. this.c1 = this.getController("c1");
  14560. this.n49 = (this.getChild("n49"));
  14561. this.n18 = (this.getChild("n18"));
  14562. this.n46 = (this.getChild("n46"));
  14563. this.n48 = (this.getChild("n48"));
  14564. this.n50 = (this.getChild("n50"));
  14565. }
  14566. }
  14567. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14568. class ui_ranking_com3 extends fgui.GComponent {
  14569. static createInstance() {
  14570. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14571. }
  14572. onConstruct() {
  14573. this.n17 = (this.getChild("n17"));
  14574. this.myIcon = (this.getChild("myIcon"));
  14575. }
  14576. }
  14577. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14578. class ui_ranking_com4 extends fgui.GComponent {
  14579. static createInstance() {
  14580. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14581. }
  14582. onConstruct() {
  14583. this.n16 = (this.getChild("n16"));
  14584. this.head = (this.getChild("head"));
  14585. }
  14586. }
  14587. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14588. class ui_ranking_com5 extends fgui.GComponent {
  14589. static createInstance() {
  14590. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14591. }
  14592. onConstruct() {
  14593. this.c1 = this.getController("c1");
  14594. this.c2 = this.getController("c2");
  14595. this.n2 = (this.getChild("n2"));
  14596. this.n3 = (this.getChild("n3"));
  14597. this.levelBtn = (this.getChild("levelBtn"));
  14598. this.starBtn = (this.getChild("starBtn"));
  14599. this.n23 = (this.getChild("n23"));
  14600. this.n24 = (this.getChild("n24"));
  14601. this.n25 = (this.getChild("n25"));
  14602. this.myList = (this.getChild("myList"));
  14603. this.selfNode = (this.getChild("selfNode"));
  14604. this.n9 = (this.getChild("n9"));
  14605. this.n12 = (this.getChild("n12"));
  14606. this.n13 = (this.getChild("n13"));
  14607. this.n14 = (this.getChild("n14"));
  14608. this.n39 = (this.getChild("n39"));
  14609. this.n41 = (this.getChild("n41"));
  14610. this.n42 = (this.getChild("n42"));
  14611. this.n45 = (this.getChild("n45"));
  14612. this.changeBtn = (this.getChild("changeBtn"));
  14613. this.closeBtn = (this.getChild("closeBtn"));
  14614. this.t0 = this.getTransition("t0");
  14615. }
  14616. }
  14617. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14618. class ui_RankItem extends fgui.GComponent {
  14619. static createInstance() {
  14620. return (fgui.UIPackage.createObject("game", "RankItem"));
  14621. }
  14622. onConstruct() {
  14623. this.n10 = (this.getChild("n10"));
  14624. this.n11 = (this.getChild("n11"));
  14625. this.rankTxt = (this.getChild("rankTxt"));
  14626. this.headNode = (this.getChild("headNode"));
  14627. this.nameTxt = (this.getChild("nameTxt"));
  14628. this.n19 = (this.getChild("n19"));
  14629. this.valueTxt = (this.getChild("valueTxt"));
  14630. this.img1 = (this.getChild("img1"));
  14631. this.img2 = (this.getChild("img2"));
  14632. this.img3 = (this.getChild("img3"));
  14633. }
  14634. }
  14635. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  14636. class ui_ranking_com9 extends fgui.GComponent {
  14637. static createInstance() {
  14638. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  14639. }
  14640. onConstruct() {
  14641. this.c1 = this.getController("c1");
  14642. this.n27 = (this.getChild("n27"));
  14643. this.n28 = (this.getChild("n28"));
  14644. this.headNode = (this.getChild("headNode"));
  14645. this.rankTxt = (this.getChild("rankTxt"));
  14646. this.nameTxt = (this.getChild("nameTxt"));
  14647. this.n34 = (this.getChild("n34"));
  14648. this.valueTxt = (this.getChild("valueTxt"));
  14649. this.n36 = (this.getChild("n36"));
  14650. this.n37 = (this.getChild("n37"));
  14651. this.n38 = (this.getChild("n38"));
  14652. this.n39 = (this.getChild("n39"));
  14653. this.n40 = (this.getChild("n40"));
  14654. }
  14655. }
  14656. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  14657. class ui_ranking_com10 extends fgui.GComponent {
  14658. static createInstance() {
  14659. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  14660. }
  14661. onConstruct() {
  14662. this.n23 = (this.getChild("n23"));
  14663. this.n24 = (this.getChild("n24"));
  14664. }
  14665. }
  14666. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  14667. class ui_ranking_com11 extends fgui.GComponent {
  14668. static createInstance() {
  14669. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  14670. }
  14671. onConstruct() {
  14672. this.n24 = (this.getChild("n24"));
  14673. this.n25 = (this.getChild("n25"));
  14674. this.t0 = this.getTransition("t0");
  14675. }
  14676. }
  14677. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  14678. class ui_ranking_com13 extends fgui.GButton {
  14679. static createInstance() {
  14680. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  14681. }
  14682. onConstruct() {
  14683. this.c1 = this.getController("c1");
  14684. this.n44 = (this.getChild("n44"));
  14685. this.n45 = (this.getChild("n45"));
  14686. this.n46 = (this.getChild("n46"));
  14687. }
  14688. }
  14689. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  14690. class ui_Component_dl_zc extends fgui.GButton {
  14691. static createInstance() {
  14692. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  14693. }
  14694. onConstruct() {
  14695. this.c1 = this.getController("c1");
  14696. this.n0 = (this.getChild("n0"));
  14697. }
  14698. }
  14699. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  14700. class ui_Component122 extends fgui.GComponent {
  14701. static createInstance() {
  14702. return (fgui.UIPackage.createObject("game", "Component122"));
  14703. }
  14704. onConstruct() {
  14705. this.gameNode3 = (this.getChild("gameNode3"));
  14706. }
  14707. }
  14708. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  14709. class ui_skillItem extends fgui.GComponent {
  14710. static createInstance() {
  14711. return (fgui.UIPackage.createObject("game", "skillItem"));
  14712. }
  14713. onConstruct() {
  14714. this.c1 = this.getController("c1");
  14715. this.n31 = (this.getChild("n31"));
  14716. this.n6 = (this.getChild("n6"));
  14717. this.skillImg = (this.getChild("skillImg"));
  14718. this.nameTxt = (this.getChild("nameTxt"));
  14719. this.levelTxt = (this.getChild("levelTxt"));
  14720. this.n28 = (this.getChild("n28"));
  14721. this.describeTxt = (this.getChild("describeTxt"));
  14722. this.n32 = (this.getChild("n32"));
  14723. this.mutiBtn = (this.getChild("mutiBtn"));
  14724. this.tryNode = (this.getChild("tryNode"));
  14725. this.normalBtn = (this.getChild("normalBtn"));
  14726. this.startBtn = (this.getChild("startBtn"));
  14727. this.n42 = (this.getChild("n42"));
  14728. this.n43 = (this.getChild("n43"));
  14729. this.n44 = (this.getChild("n44"));
  14730. }
  14731. }
  14732. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  14733. class ui_Component26 extends fgui.GButton {
  14734. static createInstance() {
  14735. return (fgui.UIPackage.createObject("game", "Component26"));
  14736. }
  14737. onConstruct() {
  14738. this.n11 = (this.getChild("n11"));
  14739. this.n30 = (this.getChild("n30"));
  14740. this.n34 = (this.getChild("n34"));
  14741. }
  14742. }
  14743. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  14744. class ui_Component28 extends fgui.GButton {
  14745. static createInstance() {
  14746. return (fgui.UIPackage.createObject("game", "Component28"));
  14747. }
  14748. onConstruct() {
  14749. this.n12 = (this.getChild("n12"));
  14750. this.n31 = (this.getChild("n31"));
  14751. this.curTxt = (this.getChild("curTxt"));
  14752. this.n33 = (this.getChild("n33"));
  14753. }
  14754. }
  14755. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  14756. class ui_Component1302 extends fgui.GComponent {
  14757. static createInstance() {
  14758. return (fgui.UIPackage.createObject("game", "Component1302"));
  14759. }
  14760. onConstruct() {
  14761. this.n2 = (this.getChild("n2"));
  14762. this.n3 = (this.getChild("n3"));
  14763. }
  14764. }
  14765. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  14766. class ui_Component113 extends fgui.GComponent {
  14767. static createInstance() {
  14768. return (fgui.UIPackage.createObject("game", "Component113"));
  14769. }
  14770. onConstruct() {
  14771. this.n85 = (this.getChild("n85"));
  14772. this.n86 = (this.getChild("n86"));
  14773. this.n77 = (this.getChild("n77"));
  14774. this.n79 = (this.getChild("n79"));
  14775. this.n80 = (this.getChild("n80"));
  14776. this.n81 = (this.getChild("n81"));
  14777. this.n82 = (this.getChild("n82"));
  14778. this.n84 = (this.getChild("n84"));
  14779. this.n87 = (this.getChild("n87"));
  14780. this.t0 = this.getTransition("t0");
  14781. }
  14782. }
  14783. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  14784. class ui_Component114 extends fgui.GComponent {
  14785. static createInstance() {
  14786. return (fgui.UIPackage.createObject("game", "Component114"));
  14787. }
  14788. onConstruct() {
  14789. this.n77 = (this.getChild("n77"));
  14790. this.t0 = this.getTransition("t0");
  14791. }
  14792. }
  14793. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  14794. class ui_Component115 extends fgui.GComponent {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("game", "Component115"));
  14797. }
  14798. onConstruct() {
  14799. this.n83 = (this.getChild("n83"));
  14800. this.fingerNode = (this.getChild("fingerNode"));
  14801. this.n84 = (this.getChild("n84"));
  14802. }
  14803. }
  14804. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  14805. class ui_Component117 extends fgui.GComponent {
  14806. static createInstance() {
  14807. return (fgui.UIPackage.createObject("game", "Component117"));
  14808. }
  14809. onConstruct() {
  14810. this.n87 = (this.getChild("n87"));
  14811. this.n88 = (this.getChild("n88"));
  14812. this.n84 = (this.getChild("n84"));
  14813. this.n85 = (this.getChild("n85"));
  14814. this.n86 = (this.getChild("n86"));
  14815. this.t0 = this.getTransition("t0");
  14816. }
  14817. }
  14818. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  14819. class ui_Component98_1 extends fgui.GButton {
  14820. static createInstance() {
  14821. return (fgui.UIPackage.createObject("game", "Component98_1"));
  14822. }
  14823. onConstruct() {
  14824. this.c1 = this.getController("c1");
  14825. this.n8 = (this.getChild("n8"));
  14826. this.n41 = (this.getChild("n41"));
  14827. this.n40 = (this.getChild("n40"));
  14828. }
  14829. }
  14830. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  14831. class ui_Component61 extends fgui.GComponent {
  14832. static createInstance() {
  14833. return (fgui.UIPackage.createObject("game", "Component61"));
  14834. }
  14835. onConstruct() {
  14836. this.n14 = (this.getChild("n14"));
  14837. this.n6 = (this.getChild("n6"));
  14838. this.t0 = this.getTransition("t0");
  14839. }
  14840. }
  14841. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  14842. class ui_Component62 extends fgui.GComponent {
  14843. static createInstance() {
  14844. return (fgui.UIPackage.createObject("game", "Component62"));
  14845. }
  14846. onConstruct() {
  14847. this.n66 = (this.getChild("n66"));
  14848. this.n56 = (this.getChild("n56"));
  14849. this.n63 = (this.getChild("n63"));
  14850. this.n65 = (this.getChild("n65"));
  14851. this.t0 = this.getTransition("t0");
  14852. }
  14853. }
  14854. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  14855. class ui_d3Root extends fgui.GComponent {
  14856. static createInstance() {
  14857. return (fgui.UIPackage.createObject("game", "d3Root"));
  14858. }
  14859. onConstruct() {
  14860. }
  14861. }
  14862. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  14863. class ui_d2Root extends fgui.GComponent {
  14864. static createInstance() {
  14865. return (fgui.UIPackage.createObject("game", "d2Root"));
  14866. }
  14867. onConstruct() {
  14868. }
  14869. }
  14870. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  14871. class ui_ballNode extends fgui.GComponent {
  14872. static createInstance() {
  14873. return (fgui.UIPackage.createObject("game", "ballNode"));
  14874. }
  14875. onConstruct() {
  14876. }
  14877. }
  14878. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  14879. class ui_border extends fgui.GComponent {
  14880. static createInstance() {
  14881. return (fgui.UIPackage.createObject("game", "border"));
  14882. }
  14883. onConstruct() {
  14884. this.bar1 = (this.getChild("bar1"));
  14885. this.bar2 = (this.getChild("bar2"));
  14886. this.bar3 = (this.getChild("bar3"));
  14887. this.bar4 = (this.getChild("bar4"));
  14888. this.bar5 = (this.getChild("bar5"));
  14889. this.bar6 = (this.getChild("bar6"));
  14890. this.circle1 = (this.getChild("circle1"));
  14891. this.circle2 = (this.getChild("circle2"));
  14892. this.circle3 = (this.getChild("circle3"));
  14893. this.circle4 = (this.getChild("circle4"));
  14894. this.circle5 = (this.getChild("circle5"));
  14895. this.circle6 = (this.getChild("circle6"));
  14896. this.n28 = (this.getChild("n28"));
  14897. }
  14898. }
  14899. ui_border.URL = "ui://isxx5ak7sdh33qq";
  14900. class ui_btn_buy extends fgui.GButton {
  14901. static createInstance() {
  14902. return (fgui.UIPackage.createObject("game", "btn_buy"));
  14903. }
  14904. onConstruct() {
  14905. this.button = this.getController("button");
  14906. this.n0 = (this.getChild("n0"));
  14907. this.n1 = (this.getChild("n1"));
  14908. this.n2 = (this.getChild("n2"));
  14909. }
  14910. }
  14911. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  14912. class ui_Component41_2 extends fgui.GComponent {
  14913. static createInstance() {
  14914. return (fgui.UIPackage.createObject("game", "Component41_2"));
  14915. }
  14916. onConstruct() {
  14917. this.c1 = this.getController("c1");
  14918. this.n0 = (this.getChild("n0"));
  14919. this.n2 = (this.getChild("n2"));
  14920. this.n19 = (this.getChild("n19"));
  14921. this.cancelBtn = (this.getChild("cancelBtn"));
  14922. this.videoBtn = (this.getChild("videoBtn"));
  14923. this.n9 = (this.getChild("n9"));
  14924. this.n22 = (this.getChild("n22"));
  14925. this.tipsTxt = (this.getChild("tipsTxt"));
  14926. this.n23 = (this.getChild("n23"));
  14927. this.n24 = (this.getChild("n24"));
  14928. this.n26 = (this.getChild("n26"));
  14929. this.n27 = (this.getChild("n27"));
  14930. this.titleTxt = (this.getChild("titleTxt"));
  14931. }
  14932. }
  14933. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  14934. class ui_Component41_1 extends fgui.GComponent {
  14935. static createInstance() {
  14936. return (fgui.UIPackage.createObject("game", "Component41_1"));
  14937. }
  14938. onConstruct() {
  14939. this.c1 = this.getController("c1");
  14940. this.n0 = (this.getChild("n0"));
  14941. this.n2 = (this.getChild("n2"));
  14942. this.cancelBtn = (this.getChild("cancelBtn"));
  14943. this.videoBtn = (this.getChild("videoBtn"));
  14944. this.n27 = (this.getChild("n27"));
  14945. this.n30 = (this.getChild("n30"));
  14946. this.n31 = (this.getChild("n31"));
  14947. this.n32 = (this.getChild("n32"));
  14948. this.n33 = (this.getChild("n33"));
  14949. this.n34 = (this.getChild("n34"));
  14950. this.n35 = (this.getChild("n35"));
  14951. this.n36 = (this.getChild("n36"));
  14952. this.n1 = (this.getChild("n1"));
  14953. this.n37 = (this.getChild("n37"));
  14954. this.t0 = this.getTransition("t0");
  14955. this.t1 = this.getTransition("t1");
  14956. this.t2 = this.getTransition("t2");
  14957. this.t3 = this.getTransition("t3");
  14958. }
  14959. }
  14960. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  14961. class ui_againBtn extends fgui.GButton {
  14962. static createInstance() {
  14963. return (fgui.UIPackage.createObject("game", "againBtn"));
  14964. }
  14965. onConstruct() {
  14966. this.n2 = (this.getChild("n2"));
  14967. this.n1 = (this.getChild("n1"));
  14968. this.n5 = (this.getChild("n5"));
  14969. }
  14970. }
  14971. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  14972. class ui_Component118 extends fgui.GButton {
  14973. static createInstance() {
  14974. return (fgui.UIPackage.createObject("game", "Component118"));
  14975. }
  14976. onConstruct() {
  14977. this.c1 = this.getController("c1");
  14978. this.n14 = (this.getChild("n14"));
  14979. this.n9 = (this.getChild("n9"));
  14980. this.n10 = (this.getChild("n10"));
  14981. this.diamondTxt = (this.getChild("diamondTxt"));
  14982. this.n13 = (this.getChild("n13"));
  14983. this.n15 = (this.getChild("n15"));
  14984. }
  14985. }
  14986. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  14987. class ui_Component119 extends fgui.GComponent {
  14988. static createInstance() {
  14989. return (fgui.UIPackage.createObject("game", "Component119"));
  14990. }
  14991. onConstruct() {
  14992. this.n1 = (this.getChild("n1"));
  14993. this.n2 = (this.getChild("n2"));
  14994. this.n13 = (this.getChild("n13"));
  14995. this.n6 = (this.getChild("n6"));
  14996. this.screenNode = (this.getChild("screenNode"));
  14997. this.n15 = (this.getChild("n15"));
  14998. this.closeBtn = (this.getChild("closeBtn"));
  14999. this.share2Btn = (this.getChild("share2Btn"));
  15000. this.shareBtn = (this.getChild("shareBtn"));
  15001. this.tipsNode = (this.getChild("tipsNode"));
  15002. this.awardNode = (this.getChild("awardNode"));
  15003. }
  15004. }
  15005. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15006. class ui_daoJuDisplay extends fgui.GComponent {
  15007. static createInstance() {
  15008. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15009. }
  15010. onConstruct() {
  15011. this.n6 = (this.getChild("n6"));
  15012. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15013. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15014. this.btn_buy = (this.getChild("btn_buy"));
  15015. this.nameTxt = (this.getChild("nameTxt"));
  15016. this.zsImg = (this.getChild("zsImg"));
  15017. }
  15018. }
  15019. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15020. class ui_Component132_1 extends fgui.GComponent {
  15021. static createInstance() {
  15022. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15023. }
  15024. onConstruct() {
  15025. this.n25 = (this.getChild("n25"));
  15026. this.n26 = (this.getChild("n26"));
  15027. this.n27 = (this.getChild("n27"));
  15028. this.t0 = this.getTransition("t0");
  15029. }
  15030. }
  15031. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15032. class ui_SecretaryDisplay extends fgui.GComponent {
  15033. static createInstance() {
  15034. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15035. }
  15036. onConstruct() {
  15037. this.n2 = (this.getChild("n2"));
  15038. this.levelTxt = (this.getChild("levelTxt"));
  15039. this.n4 = (this.getChild("n4"));
  15040. this.secretary = (this.getChild("secretary"));
  15041. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15042. this.n16 = (this.getChild("n16"));
  15043. this.n37 = (this.getChild("n37"));
  15044. this.n41 = (this.getChild("n41"));
  15045. this.n14 = (this.getChild("n14"));
  15046. this.n17 = (this.getChild("n17"));
  15047. this.heightTxt = (this.getChild("heightTxt"));
  15048. this.n46 = (this.getChild("n46"));
  15049. this.n36 = (this.getChild("n36"));
  15050. this.n38 = (this.getChild("n38"));
  15051. this.foodTxt = (this.getChild("foodTxt"));
  15052. this.n47 = (this.getChild("n47"));
  15053. this.n40 = (this.getChild("n40"));
  15054. this.n42 = (this.getChild("n42"));
  15055. this.historyTxt = (this.getChild("historyTxt"));
  15056. this.n48 = (this.getChild("n48"));
  15057. this.nameImg = (this.getChild("nameImg"));
  15058. this.n12 = (this.getChild("n12"));
  15059. this.n49 = (this.getChild("n49"));
  15060. this.t0 = this.getTransition("t0");
  15061. }
  15062. }
  15063. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15064. class ui_BallRodDisplay extends fgui.GComponent {
  15065. static createInstance() {
  15066. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15067. }
  15068. onConstruct() {
  15069. this.c1 = this.getController("c1");
  15070. this.n31 = (this.getChild("n31"));
  15071. this.n6 = (this.getChild("n6"));
  15072. this.nameTxt = (this.getChild("nameTxt"));
  15073. this.rodImg = (this.getChild("rodImg"));
  15074. this.eftRod = (this.getChild("eftRod"));
  15075. this.levelNode = (this.getChild("levelNode"));
  15076. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15077. }
  15078. }
  15079. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15080. class ui_Component111_11 extends fgui.GComponent {
  15081. static createInstance() {
  15082. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15083. }
  15084. onConstruct() {
  15085. this.n68 = (this.getChild("n68"));
  15086. this.n69 = (this.getChild("n69"));
  15087. }
  15088. }
  15089. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15090. class ui_Component112 extends fgui.GComponent {
  15091. static createInstance() {
  15092. return (fgui.UIPackage.createObject("game", "Component112"));
  15093. }
  15094. onConstruct() {
  15095. this.n68 = (this.getChild("n68"));
  15096. this.n70 = (this.getChild("n70"));
  15097. this.myMask = (this.getChild("myMask"));
  15098. }
  15099. }
  15100. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15101. class ui_Component111 extends fgui.GComponent {
  15102. static createInstance() {
  15103. return (fgui.UIPackage.createObject("game", "Component111"));
  15104. }
  15105. onConstruct() {
  15106. this.n68 = (this.getChild("n68"));
  15107. this.myMask = (this.getChild("myMask"));
  15108. }
  15109. }
  15110. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15111. class ui_Component144 extends fgui.GButton {
  15112. static createInstance() {
  15113. return (fgui.UIPackage.createObject("game", "Component144"));
  15114. }
  15115. onConstruct() {
  15116. this.n8 = (this.getChild("n8"));
  15117. }
  15118. }
  15119. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15120. class ui_Sign_com2 extends fgui.GComponent {
  15121. static createInstance() {
  15122. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15123. }
  15124. onConstruct() {
  15125. this.n0 = (this.getChild("n0"));
  15126. this.n1 = (this.getChild("n1"));
  15127. this.t0 = this.getTransition("t0");
  15128. }
  15129. }
  15130. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15131. class ui_Sign_guang extends fgui.GComponent {
  15132. static createInstance() {
  15133. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15134. }
  15135. onConstruct() {
  15136. this.n1 = (this.getChild("n1"));
  15137. this.n2 = (this.getChild("n2"));
  15138. this.n3 = (this.getChild("n3"));
  15139. this.n4 = (this.getChild("n4"));
  15140. this.n5 = (this.getChild("n5"));
  15141. this.n6 = (this.getChild("n6"));
  15142. this.n8 = (this.getChild("n8"));
  15143. }
  15144. }
  15145. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15146. class ui_SignMax extends fgui.GComponent {
  15147. static createInstance() {
  15148. return (fgui.UIPackage.createObject("game", "SignMax"));
  15149. }
  15150. onConstruct() {
  15151. this.c1 = this.getController("c1");
  15152. this.n7 = (this.getChild("n7"));
  15153. this.n15 = (this.getChild("n15"));
  15154. this.n8 = (this.getChild("n8"));
  15155. this.titleTxt = (this.getChild("titleTxt"));
  15156. this.myIcon1 = (this.getChild("myIcon1"));
  15157. this.numTxt1 = (this.getChild("numTxt1"));
  15158. this.myIcon2 = (this.getChild("myIcon2"));
  15159. this.n20 = (this.getChild("n20"));
  15160. this.n17 = (this.getChild("n17"));
  15161. this.numTxt2 = (this.getChild("numTxt2"));
  15162. this.n12 = (this.getChild("n12"));
  15163. this.n13 = (this.getChild("n13"));
  15164. this.n21 = (this.getChild("n21"));
  15165. this.n14 = (this.getChild("n14"));
  15166. }
  15167. }
  15168. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15169. class ui_Sign_com2_1 extends fgui.GComponent {
  15170. static createInstance() {
  15171. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15172. }
  15173. onConstruct() {
  15174. this.n0 = (this.getChild("n0"));
  15175. this.n1 = (this.getChild("n1"));
  15176. this.t0 = this.getTransition("t0");
  15177. }
  15178. }
  15179. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15180. class ui_Sign_com5 extends fgui.GComponent {
  15181. static createInstance() {
  15182. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15183. }
  15184. onConstruct() {
  15185. this.n3 = (this.getChild("n3"));
  15186. this.n29 = (this.getChild("n29"));
  15187. this.n4 = (this.getChild("n4"));
  15188. this.day1 = (this.getChild("day1"));
  15189. this.day2 = (this.getChild("day2"));
  15190. this.day3 = (this.getChild("day3"));
  15191. this.day4 = (this.getChild("day4"));
  15192. this.day5 = (this.getChild("day5"));
  15193. this.day6 = (this.getChild("day6"));
  15194. this.day7 = (this.getChild("day7"));
  15195. this.t0 = this.getTransition("t0");
  15196. }
  15197. }
  15198. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15199. class ui_Sign_com8 extends fgui.GComponent {
  15200. static createInstance() {
  15201. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15202. }
  15203. onConstruct() {
  15204. this.n48 = (this.getChild("n48"));
  15205. this.womanTxt = (this.getChild("womanTxt"));
  15206. this.t0 = this.getTransition("t0");
  15207. }
  15208. }
  15209. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15210. class ui_Sign_com6 extends fgui.GComponent {
  15211. static createInstance() {
  15212. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15213. }
  15214. onConstruct() {
  15215. this.n2 = (this.getChild("n2"));
  15216. this.n3 = (this.getChild("n3"));
  15217. this.t0 = this.getTransition("t0");
  15218. }
  15219. }
  15220. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15221. class ui_Sign_com7 extends fgui.GComponent {
  15222. static createInstance() {
  15223. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15224. }
  15225. onConstruct() {
  15226. this.n29 = (this.getChild("n29"));
  15227. this.n2 = (this.getChild("n2"));
  15228. }
  15229. }
  15230. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15231. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15232. static createInstance() {
  15233. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15234. }
  15235. onConstruct() {
  15236. this.n5 = (this.getChild("n5"));
  15237. this.n4 = (this.getChild("n4"));
  15238. this.t0 = this.getTransition("t0");
  15239. }
  15240. }
  15241. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15242. class ui_UITurntable_com2 extends fgui.GComponent {
  15243. static createInstance() {
  15244. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15245. }
  15246. onConstruct() {
  15247. this.c1 = this.getController("c1");
  15248. this.n4 = (this.getChild("n4"));
  15249. this.n6 = (this.getChild("n6"));
  15250. this.n10 = (this.getChild("n10"));
  15251. this.n11 = (this.getChild("n11"));
  15252. this.n12 = (this.getChild("n12"));
  15253. this.n13 = (this.getChild("n13"));
  15254. this.n14 = (this.getChild("n14"));
  15255. this.n15 = (this.getChild("n15"));
  15256. this.n16 = (this.getChild("n16"));
  15257. this.n17 = (this.getChild("n17"));
  15258. this.n18 = (this.getChild("n18"));
  15259. this.n19 = (this.getChild("n19"));
  15260. this.n20 = (this.getChild("n20"));
  15261. this.n21 = (this.getChild("n21"));
  15262. this.n22 = (this.getChild("n22"));
  15263. this.n23 = (this.getChild("n23"));
  15264. this.n24 = (this.getChild("n24"));
  15265. this.n25 = (this.getChild("n25"));
  15266. this.n26 = (this.getChild("n26"));
  15267. this.n27 = (this.getChild("n27"));
  15268. this.n28 = (this.getChild("n28"));
  15269. this.n29 = (this.getChild("n29"));
  15270. this.n30 = (this.getChild("n30"));
  15271. this.n31 = (this.getChild("n31"));
  15272. this.n32 = (this.getChild("n32"));
  15273. this.n33 = (this.getChild("n33"));
  15274. }
  15275. }
  15276. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15277. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15278. static createInstance() {
  15279. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15280. }
  15281. onConstruct() {
  15282. this.n5 = (this.getChild("n5"));
  15283. this.n4 = (this.getChild("n4"));
  15284. this.t0 = this.getTransition("t0");
  15285. }
  15286. }
  15287. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15288. class ui_UITurntable_com5 extends fgui.GComponent {
  15289. static createInstance() {
  15290. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15291. }
  15292. onConstruct() {
  15293. this.flashNode = (this.getChild("flashNode"));
  15294. this.rotNode = (this.getChild("rotNode"));
  15295. this.n3 = (this.getChild("n3"));
  15296. this.n21 = (this.getChild("n21"));
  15297. this.t0 = this.getTransition("t0");
  15298. }
  15299. }
  15300. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15301. class ui_UITurntable_com7 extends fgui.GComponent {
  15302. static createInstance() {
  15303. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15304. }
  15305. onConstruct() {
  15306. this.n2 = (this.getChild("n2"));
  15307. this.n35 = (this.getChild("n35"));
  15308. this.img1 = (this.getChild("img1"));
  15309. this.img2 = (this.getChild("img2"));
  15310. this.img3 = (this.getChild("img3"));
  15311. this.img4 = (this.getChild("img4"));
  15312. this.img6 = (this.getChild("img6"));
  15313. this.img5 = (this.getChild("img5"));
  15314. this.txt1 = (this.getChild("txt1"));
  15315. this.txt2 = (this.getChild("txt2"));
  15316. this.txt3 = (this.getChild("txt3"));
  15317. this.txt4 = (this.getChild("txt4"));
  15318. this.txt5 = (this.getChild("txt5"));
  15319. this.txt6 = (this.getChild("txt6"));
  15320. }
  15321. }
  15322. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15323. class ui_UITurntable_com9 extends fgui.GComponent {
  15324. static createInstance() {
  15325. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15326. }
  15327. onConstruct() {
  15328. this.n38 = (this.getChild("n38"));
  15329. this.n39 = (this.getChild("n39"));
  15330. }
  15331. }
  15332. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15333. class ui_UITurntable_com10 extends fgui.GComponent {
  15334. static createInstance() {
  15335. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15336. }
  15337. onConstruct() {
  15338. this.n39 = (this.getChild("n39"));
  15339. this.n40 = (this.getChild("n40"));
  15340. this.t0 = this.getTransition("t0");
  15341. }
  15342. }
  15343. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15344. class ui_UITurntable_com11 extends fgui.GComponent {
  15345. static createInstance() {
  15346. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15347. }
  15348. onConstruct() {
  15349. this.n38 = (this.getChild("n38"));
  15350. this.n39 = (this.getChild("n39"));
  15351. this.n40 = (this.getChild("n40"));
  15352. this.t0 = this.getTransition("t0");
  15353. }
  15354. }
  15355. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15356. class ui_UITurntable_com12 extends fgui.GComponent {
  15357. static createInstance() {
  15358. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15359. }
  15360. onConstruct() {
  15361. this.n43 = (this.getChild("n43"));
  15362. this.barNode = (this.getChild("barNode"));
  15363. this.tipsTxt = (this.getChild("tipsTxt"));
  15364. this.n45 = (this.getChild("n45"));
  15365. this.boxBtn = (this.getChild("boxBtn"));
  15366. }
  15367. }
  15368. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15369. class ui_UITurntable_com1 extends fgui.GButton {
  15370. static createInstance() {
  15371. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15372. }
  15373. onConstruct() {
  15374. this.n41 = (this.getChild("n41"));
  15375. this.n42 = (this.getChild("n42"));
  15376. this.t0 = this.getTransition("t0");
  15377. }
  15378. }
  15379. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15380. class ui_UITurntable_com3 extends fgui.GComponent {
  15381. static createInstance() {
  15382. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15383. }
  15384. onConstruct() {
  15385. this.n48 = (this.getChild("n48"));
  15386. this.womanTxt = (this.getChild("womanTxt"));
  15387. this.t0 = this.getTransition("t0");
  15388. }
  15389. }
  15390. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15391. class ui_cancelBtn2 extends fgui.GButton {
  15392. static createInstance() {
  15393. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15394. }
  15395. onConstruct() {
  15396. this.c1 = this.getController("c1");
  15397. this.n0 = (this.getChild("n0"));
  15398. this.n1 = (this.getChild("n1"));
  15399. this.n2 = (this.getChild("n2"));
  15400. this.n3 = (this.getChild("n3"));
  15401. this.n4 = (this.getChild("n4"));
  15402. this.n5 = (this.getChild("n5"));
  15403. this.n6 = (this.getChild("n6"));
  15404. this.n7 = (this.getChild("n7"));
  15405. this.n8 = (this.getChild("n8"));
  15406. this.powerEft = (this.getChild("powerEft"));
  15407. }
  15408. }
  15409. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15410. class ui_shareBtn2 extends fgui.GButton {
  15411. static createInstance() {
  15412. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15413. }
  15414. onConstruct() {
  15415. this.c1 = this.getController("c1");
  15416. this.n2 = (this.getChild("n2"));
  15417. this.n24 = (this.getChild("n24"));
  15418. this.n1 = (this.getChild("n1"));
  15419. this.n3 = (this.getChild("n3"));
  15420. this.n23 = (this.getChild("n23"));
  15421. this.n4 = (this.getChild("n4"));
  15422. this.n5 = (this.getChild("n5"));
  15423. this.n6 = (this.getChild("n6"));
  15424. this.n20 = (this.getChild("n20"));
  15425. this.n21 = (this.getChild("n21"));
  15426. this.n22 = (this.getChild("n22"));
  15427. this.powerEft = (this.getChild("powerEft"));
  15428. }
  15429. }
  15430. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15431. class ui_UIMoney extends fgui.GComponent {
  15432. static createInstance() {
  15433. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15434. }
  15435. onConstruct() {
  15436. this.c1 = this.getController("c1");
  15437. this.n4 = (this.getChild("n4"));
  15438. this.coinImg = (this.getChild("coinImg"));
  15439. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15440. this.coinTxt = (this.getChild("coinTxt"));
  15441. this.n7 = (this.getChild("n7"));
  15442. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15443. this.diamondTxt = (this.getChild("diamondTxt"));
  15444. this.diamondImg = (this.getChild("diamondImg"));
  15445. this.n12 = (this.getChild("n12"));
  15446. this.powerImg = (this.getChild("powerImg"));
  15447. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15448. this.powerTxt = (this.getChild("powerTxt"));
  15449. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15450. }
  15451. }
  15452. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15453. class ui_backBtn extends fgui.GButton {
  15454. static createInstance() {
  15455. return (fgui.UIPackage.createObject("game", "backBtn"));
  15456. }
  15457. onConstruct() {
  15458. this.n0 = (this.getChild("n0"));
  15459. this.t0 = this.getTransition("t0");
  15460. this.t1 = this.getTransition("t1");
  15461. }
  15462. }
  15463. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15464. class ui_MoneyBtn extends fgui.GButton {
  15465. static createInstance() {
  15466. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15467. }
  15468. onConstruct() {
  15469. this.button = this.getController("button");
  15470. this.n0 = (this.getChild("n0"));
  15471. }
  15472. }
  15473. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15474. class ui_UIMoneyBtn extends fgui.GComponent {
  15475. static createInstance() {
  15476. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15477. }
  15478. onConstruct() {
  15479. this.n1 = (this.getChild("n1"));
  15480. this.closeBtn = (this.getChild("closeBtn"));
  15481. }
  15482. }
  15483. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15484. class ui_Component64 extends fgui.GComponent {
  15485. static createInstance() {
  15486. return (fgui.UIPackage.createObject("game", "Component64"));
  15487. }
  15488. onConstruct() {
  15489. this.n57 = (this.getChild("n57"));
  15490. this.n54 = (this.getChild("n54"));
  15491. this.n55 = (this.getChild("n55"));
  15492. this.n56 = (this.getChild("n56"));
  15493. this.t1 = this.getTransition("t1");
  15494. }
  15495. }
  15496. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15497. class ui_Component41_3 extends fgui.GComponent {
  15498. static createInstance() {
  15499. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15500. }
  15501. onConstruct() {
  15502. this.c1 = this.getController("c1");
  15503. this.n0 = (this.getChild("n0"));
  15504. this.n2 = (this.getChild("n2"));
  15505. this.cancelBtn = (this.getChild("cancelBtn"));
  15506. this.videoBtn = (this.getChild("videoBtn"));
  15507. this.n9 = (this.getChild("n9"));
  15508. this.n24 = (this.getChild("n24"));
  15509. this.n27 = (this.getChild("n27"));
  15510. this.titleTxt = (this.getChild("titleTxt"));
  15511. this.n28 = (this.getChild("n28"));
  15512. this.t0 = this.getTransition("t0");
  15513. }
  15514. }
  15515. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15516. class ui_dh_zs_4 extends fgui.GComponent {
  15517. static createInstance() {
  15518. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15519. }
  15520. onConstruct() {
  15521. this.n1 = (this.getChild("n1"));
  15522. this.n2 = (this.getChild("n2"));
  15523. this.n3 = (this.getChild("n3"));
  15524. this.n4 = (this.getChild("n4"));
  15525. this.n5 = (this.getChild("n5"));
  15526. this.n6 = (this.getChild("n6"));
  15527. this.n8 = (this.getChild("n8"));
  15528. this.t0 = this.getTransition("t0");
  15529. }
  15530. }
  15531. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15532. class ui_Component71_1 extends fgui.GButton {
  15533. static createInstance() {
  15534. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15535. }
  15536. onConstruct() {
  15537. this.n17 = (this.getChild("n17"));
  15538. this.t0 = this.getTransition("t0");
  15539. }
  15540. }
  15541. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15542. class ui_Component83 extends fgui.GComponent {
  15543. static createInstance() {
  15544. return (fgui.UIPackage.createObject("game", "Component83"));
  15545. }
  15546. onConstruct() {
  15547. this.c1 = this.getController("c1");
  15548. this.n17 = (this.getChild("n17"));
  15549. this.n19 = (this.getChild("n19"));
  15550. this.n20 = (this.getChild("n20"));
  15551. }
  15552. }
  15553. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15554. class ui_Component84 extends fgui.GComponent {
  15555. static createInstance() {
  15556. return (fgui.UIPackage.createObject("game", "Component84"));
  15557. }
  15558. onConstruct() {
  15559. this.c1 = this.getController("c1");
  15560. this.n4 = (this.getChild("n4"));
  15561. this.n22 = (this.getChild("n22"));
  15562. this.n23 = (this.getChild("n23"));
  15563. this.numTxt = (this.getChild("numTxt"));
  15564. this.n25 = (this.getChild("n25"));
  15565. this.n26 = (this.getChild("n26"));
  15566. }
  15567. }
  15568. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15569. class ui_Component84_1 extends fgui.GComponent {
  15570. static createInstance() {
  15571. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15572. }
  15573. onConstruct() {
  15574. this.c1 = this.getController("c1");
  15575. this.n4 = (this.getChild("n4"));
  15576. this.n22 = (this.getChild("n22"));
  15577. this.n23 = (this.getChild("n23"));
  15578. this.numTxt = (this.getChild("numTxt"));
  15579. this.n25 = (this.getChild("n25"));
  15580. this.n26 = (this.getChild("n26"));
  15581. }
  15582. }
  15583. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15584. class ui_Component85 extends fgui.GComponent {
  15585. static createInstance() {
  15586. return (fgui.UIPackage.createObject("game", "Component85"));
  15587. }
  15588. onConstruct() {
  15589. this.n1 = (this.getChild("n1"));
  15590. this.n6 = (this.getChild("n6"));
  15591. this.n2 = (this.getChild("n2"));
  15592. this.n3 = (this.getChild("n3"));
  15593. this.levelTxt = (this.getChild("levelTxt"));
  15594. this.n10 = (this.getChild("n10"));
  15595. this.n11 = (this.getChild("n11"));
  15596. this.n12 = (this.getChild("n12"));
  15597. this.n13 = (this.getChild("n13"));
  15598. this.n14 = (this.getChild("n14"));
  15599. this.modeNode = (this.getChild("modeNode"));
  15600. this.n18 = (this.getChild("n18"));
  15601. this.conditionTxt = (this.getChild("conditionTxt"));
  15602. this.diamondNode = (this.getChild("diamondNode"));
  15603. this.coinNode = (this.getChild("coinNode"));
  15604. this.startBtn = (this.getChild("startBtn"));
  15605. this.n28 = (this.getChild("n28"));
  15606. this.displayRoot = (this.getChild("displayRoot"));
  15607. this.t0 = this.getTransition("t0");
  15608. }
  15609. }
  15610. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15611. class ui_Component86 extends fgui.GButton {
  15612. static createInstance() {
  15613. return (fgui.UIPackage.createObject("game", "Component86"));
  15614. }
  15615. onConstruct() {
  15616. this.n15 = (this.getChild("n15"));
  15617. this.t0 = this.getTransition("t0");
  15618. }
  15619. }
  15620. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  15621. class ui_Component87 extends fgui.GComponent {
  15622. static createInstance() {
  15623. return (fgui.UIPackage.createObject("game", "Component87"));
  15624. }
  15625. onConstruct() {
  15626. this.n66 = (this.getChild("n66"));
  15627. this.myProgress = (this.getChild("myProgress"));
  15628. this.starAni = (this.getChild("starAni"));
  15629. this.hpTxt = (this.getChild("hpTxt"));
  15630. this.n74 = (this.getChild("n74"));
  15631. this.n73 = (this.getChild("n73"));
  15632. this.ballTxt = (this.getChild("ballTxt"));
  15633. this.n76 = (this.getChild("n76"));
  15634. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15635. this.levelTxt = (this.getChild("levelTxt"));
  15636. this.star1 = (this.getChild("star1"));
  15637. this.star2 = (this.getChild("star2"));
  15638. this.star3 = (this.getChild("star3"));
  15639. }
  15640. }
  15641. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  15642. class ui_Component88 extends fgui.GProgressBar {
  15643. static createInstance() {
  15644. return (fgui.UIPackage.createObject("game", "Component88"));
  15645. }
  15646. onConstruct() {
  15647. this.n68 = (this.getChild("n68"));
  15648. this.bar = (this.getChild("bar"));
  15649. }
  15650. }
  15651. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  15652. class ui_Component89 extends fgui.GComponent {
  15653. static createInstance() {
  15654. return (fgui.UIPackage.createObject("game", "Component89"));
  15655. }
  15656. onConstruct() {
  15657. this.c1 = this.getController("c1");
  15658. this.n71 = (this.getChild("n71"));
  15659. this.n72 = (this.getChild("n72"));
  15660. }
  15661. }
  15662. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  15663. class ui_Component90 extends fgui.GComponent {
  15664. static createInstance() {
  15665. return (fgui.UIPackage.createObject("game", "Component90"));
  15666. }
  15667. onConstruct() {
  15668. this.c1 = this.getController("c1");
  15669. this.n64 = (this.getChild("n64"));
  15670. this.n65 = (this.getChild("n65"));
  15671. this.n66 = (this.getChild("n66"));
  15672. this.t0 = this.getTransition("t0");
  15673. }
  15674. }
  15675. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  15676. class ui_Component127 extends fgui.GButton {
  15677. static createInstance() {
  15678. return (fgui.UIPackage.createObject("game", "Component127"));
  15679. }
  15680. onConstruct() {
  15681. this.n5 = (this.getChild("n5"));
  15682. }
  15683. }
  15684. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  15685. class gameBinder {
  15686. static bindAll() {
  15687. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  15688. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  15689. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  15690. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  15691. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  15692. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  15693. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  15694. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  15695. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  15696. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  15697. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  15698. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  15699. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  15700. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  15701. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  15702. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  15703. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  15704. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  15705. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  15706. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  15707. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  15708. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  15709. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  15710. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  15711. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  15712. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  15713. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  15714. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  15715. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  15716. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  15717. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  15718. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  15719. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  15720. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  15721. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  15722. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  15723. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  15724. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  15725. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  15726. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  15727. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  15728. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  15729. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  15730. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  15731. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  15732. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  15733. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  15734. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  15735. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  15736. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  15737. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  15738. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  15739. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  15740. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  15741. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  15742. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  15743. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  15744. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  15745. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  15746. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  15747. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  15748. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  15749. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  15750. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  15751. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  15752. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  15753. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  15754. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  15755. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  15756. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  15757. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  15758. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  15759. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  15760. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  15761. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  15762. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  15763. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  15764. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  15765. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  15766. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  15767. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  15768. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  15769. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  15770. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  15771. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  15772. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  15773. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  15774. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  15775. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  15776. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  15777. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  15778. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  15779. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  15780. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  15781. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  15782. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  15783. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  15784. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  15785. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  15786. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  15787. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  15788. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  15789. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  15790. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  15791. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  15792. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  15793. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  15794. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  15795. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  15796. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  15797. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  15798. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  15799. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  15800. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  15801. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  15802. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  15803. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  15804. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  15805. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  15806. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  15807. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  15808. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  15809. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  15810. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  15811. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  15812. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  15813. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  15814. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  15815. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  15816. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  15817. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  15818. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  15819. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  15820. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  15821. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  15822. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  15823. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  15824. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  15825. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  15826. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  15827. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  15828. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  15829. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  15830. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  15831. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  15832. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  15833. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  15834. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  15835. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  15836. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  15837. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  15838. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  15839. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  15840. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  15841. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  15842. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  15843. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  15844. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  15845. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  15846. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  15847. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  15848. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  15849. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  15850. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  15851. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  15852. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  15853. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  15854. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  15855. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  15856. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  15857. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  15858. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  15859. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  15860. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  15861. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  15862. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  15863. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  15864. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  15865. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  15866. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  15867. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  15868. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  15869. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  15870. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  15871. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  15872. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  15873. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  15874. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  15875. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  15876. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  15877. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  15878. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  15879. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  15880. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  15881. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  15882. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  15883. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  15884. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  15885. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  15886. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  15887. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  15888. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  15889. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  15890. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  15891. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  15892. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  15893. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  15894. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  15895. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  15896. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  15897. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  15898. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  15899. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  15900. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  15901. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  15902. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  15903. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  15904. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  15905. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  15906. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  15907. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  15908. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  15909. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  15910. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  15911. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  15912. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  15913. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  15914. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  15915. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  15916. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  15917. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  15918. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  15919. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  15920. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  15921. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  15922. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  15923. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  15924. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  15925. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  15926. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  15927. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  15928. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  15929. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  15930. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  15931. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  15932. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  15933. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  15934. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  15935. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  15936. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  15937. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  15938. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  15939. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  15940. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  15941. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  15942. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  15943. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  15944. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  15945. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  15946. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  15947. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  15948. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  15949. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  15950. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  15951. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  15952. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  15953. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  15954. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  15955. }
  15956. }
  15957. class ui_btn6 extends fgui.GButton {
  15958. static createInstance() {
  15959. return (fgui.UIPackage.createObject("loading", "btn6"));
  15960. }
  15961. onConstruct() {
  15962. this.n6 = (this.getChild("n6"));
  15963. this.n1 = (this.getChild("n1"));
  15964. }
  15965. }
  15966. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  15967. class ui_xyItem extends fgui.GComponent {
  15968. static createInstance() {
  15969. return (fgui.UIPackage.createObject("loading", "xyItem"));
  15970. }
  15971. onConstruct() {
  15972. this.xyItem = (this.getChild("xyItem"));
  15973. }
  15974. }
  15975. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  15976. class ui_loadinfo extends fgui.GProgressBar {
  15977. static createInstance() {
  15978. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  15979. }
  15980. onConstruct() {
  15981. this.bg = (this.getChild("bg"));
  15982. this.bar = (this.getChild("bar"));
  15983. this.title = (this.getChild("title"));
  15984. this.ani = (this.getChild("ani"));
  15985. }
  15986. }
  15987. ui_loadinfo.URL = "ui://37nctnhwis36c";
  15988. class ui_xyNode extends fgui.GComponent {
  15989. static createInstance() {
  15990. return (fgui.UIPackage.createObject("loading", "xyNode"));
  15991. }
  15992. onConstruct() {
  15993. this.n0 = (this.getChild("n0"));
  15994. this.btnYes = (this.getChild("btnYes"));
  15995. this.btnNo = (this.getChild("btnNo"));
  15996. this.btnKnown = (this.getChild("btnKnown"));
  15997. this.btnSure = (this.getChild("btnSure"));
  15998. this.txtWelcom = (this.getChild("txtWelcom"));
  15999. this.txtXy = (this.getChild("txtXy"));
  16000. this.n75 = (this.getChild("n75"));
  16001. this.btnXy1 = (this.getChild("btnXy1"));
  16002. this.btnXy3 = (this.getChild("btnXy3"));
  16003. this.btnXy2 = (this.getChild("btnXy2"));
  16004. this.n74 = (this.getChild("n74"));
  16005. this.xy1 = (this.getChild("xy1"));
  16006. this.txtTitle = (this.getChild("txtTitle"));
  16007. this.btnBack = (this.getChild("btnBack"));
  16008. this.xyList = (this.getChild("xyList"));
  16009. this.xy2 = (this.getChild("xy2"));
  16010. this.xyNode = (this.getChild("xyNode"));
  16011. }
  16012. }
  16013. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16014. class ui_ageNode extends fgui.GComponent {
  16015. static createInstance() {
  16016. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16017. }
  16018. onConstruct() {
  16019. this.n3 = (this.getChild("n3"));
  16020. this.n7 = (this.getChild("n7"));
  16021. this.n4 = (this.getChild("n4"));
  16022. this.btnAge = (this.getChild("btnAge"));
  16023. this.ageNode = (this.getChild("ageNode"));
  16024. }
  16025. }
  16026. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16027. class ui_rnNode extends fgui.GComponent {
  16028. static createInstance() {
  16029. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16030. }
  16031. onConstruct() {
  16032. this.n28 = (this.getChild("n28"));
  16033. this.n30 = (this.getChild("n30"));
  16034. this.n33 = (this.getChild("n33"));
  16035. this.rn1 = (this.getChild("rn1"));
  16036. this.n40 = (this.getChild("n40"));
  16037. this.n41 = (this.getChild("n41"));
  16038. this.rn3 = (this.getChild("rn3"));
  16039. this.n37 = (this.getChild("n37"));
  16040. this.n39 = (this.getChild("n39"));
  16041. this.rn2 = (this.getChild("rn2"));
  16042. this.n47 = (this.getChild("n47"));
  16043. this.n49 = (this.getChild("n49"));
  16044. this.n44 = (this.getChild("n44"));
  16045. this.inputCode = (this.getChild("inputCode"));
  16046. this.inputName = (this.getChild("inputName"));
  16047. this.n48 = (this.getChild("n48"));
  16048. this.n50 = (this.getChild("n50"));
  16049. this.rn4 = (this.getChild("rn4"));
  16050. this.btnCheck = (this.getChild("btnCheck"));
  16051. this.btnExit = (this.getChild("btnExit"));
  16052. this.btnDone = (this.getChild("btnDone"));
  16053. this.rnNode = (this.getChild("rnNode"));
  16054. }
  16055. }
  16056. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16057. class ui_tipNode extends fgui.GComponent {
  16058. static createInstance() {
  16059. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16060. }
  16061. onConstruct() {
  16062. this.bg = (this.getChild("bg"));
  16063. this.n55 = (this.getChild("n55"));
  16064. this.n56 = (this.getChild("n56"));
  16065. this.tipNode = (this.getChild("tipNode"));
  16066. }
  16067. }
  16068. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16069. class ui_fcmNode extends fgui.GComponent {
  16070. static createInstance() {
  16071. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16072. }
  16073. onConstruct() {
  16074. this.n63 = (this.getChild("n63"));
  16075. this.n62 = (this.getChild("n62"));
  16076. this.btnRn = (this.getChild("btnRn"));
  16077. this.n61 = (this.getChild("n61"));
  16078. this.n58 = (this.getChild("n58"));
  16079. this.fcmNode = (this.getChild("fcmNode"));
  16080. }
  16081. }
  16082. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16083. class ui_msgNode extends fgui.GComponent {
  16084. static createInstance() {
  16085. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16086. }
  16087. onConstruct() {
  16088. this.n69 = (this.getChild("n69"));
  16089. this.txtMsg = (this.getChild("txtMsg"));
  16090. this.msgNode = (this.getChild("msgNode"));
  16091. }
  16092. }
  16093. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16094. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16095. static createInstance() {
  16096. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16097. }
  16098. onConstruct() {
  16099. this.n1 = (this.getChild("n1"));
  16100. this.n13 = (this.getChild("n13"));
  16101. this.n14 = (this.getChild("n14"));
  16102. this.n15 = (this.getChild("n15"));
  16103. this.n3 = (this.getChild("n3"));
  16104. this.n4 = (this.getChild("n4"));
  16105. this.n5 = (this.getChild("n5"));
  16106. this.n6 = (this.getChild("n6"));
  16107. this.n7 = (this.getChild("n7"));
  16108. this.n8 = (this.getChild("n8"));
  16109. this.n9 = (this.getChild("n9"));
  16110. this.n10 = (this.getChild("n10"));
  16111. this.n12 = (this.getChild("n12"));
  16112. this.n11 = (this.getChild("n11"));
  16113. this.n16 = (this.getChild("n16"));
  16114. this.n17 = (this.getChild("n17"));
  16115. this.n18 = (this.getChild("n18"));
  16116. this.n20 = (this.getChild("n20"));
  16117. this.n21 = (this.getChild("n21"));
  16118. this.t0 = this.getTransition("t0");
  16119. }
  16120. }
  16121. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16122. class ui_btn5 extends fgui.GButton {
  16123. static createInstance() {
  16124. return (fgui.UIPackage.createObject("loading", "btn5"));
  16125. }
  16126. onConstruct() {
  16127. this.n9 = (this.getChild("n9"));
  16128. this.n1 = (this.getChild("n1"));
  16129. }
  16130. }
  16131. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16132. class ui_UILoading extends fgui.GComponent {
  16133. static createInstance() {
  16134. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16135. }
  16136. onConstruct() {
  16137. this.n12 = (this.getChild("n12"));
  16138. this.loadinfo = (this.getChild("loadinfo"));
  16139. this.n13 = (this.getChild("n13"));
  16140. this.txtLoad = (this.getChild("txtLoad"));
  16141. this.n18 = (this.getChild("n18"));
  16142. }
  16143. }
  16144. ui_UILoading.URL = "ui://37nctnhwphc33";
  16145. class ui_AgeItem extends fgui.GComponent {
  16146. static createInstance() {
  16147. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16148. }
  16149. onConstruct() {
  16150. this.txtAge = (this.getChild("txtAge"));
  16151. }
  16152. }
  16153. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16154. class ui_btn1 extends fgui.GButton {
  16155. static createInstance() {
  16156. return (fgui.UIPackage.createObject("loading", "btn1"));
  16157. }
  16158. onConstruct() {
  16159. this.n6 = (this.getChild("n6"));
  16160. this.n1 = (this.getChild("n1"));
  16161. }
  16162. }
  16163. ui_btn1.URL = "ui://37nctnhwxe622p";
  16164. class ui_btn3 extends fgui.GButton {
  16165. static createInstance() {
  16166. return (fgui.UIPackage.createObject("loading", "btn3"));
  16167. }
  16168. onConstruct() {
  16169. this.n9 = (this.getChild("n9"));
  16170. this.n1 = (this.getChild("n1"));
  16171. }
  16172. }
  16173. ui_btn3.URL = "ui://37nctnhwxe622s";
  16174. class ui_btn2 extends fgui.GButton {
  16175. static createInstance() {
  16176. return (fgui.UIPackage.createObject("loading", "btn2"));
  16177. }
  16178. onConstruct() {
  16179. this.n6 = (this.getChild("n6"));
  16180. this.n1 = (this.getChild("n1"));
  16181. }
  16182. }
  16183. ui_btn2.URL = "ui://37nctnhwxe622t";
  16184. class ui_btnBack extends fgui.GButton {
  16185. static createInstance() {
  16186. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16187. }
  16188. onConstruct() {
  16189. this.n6 = (this.getChild("n6"));
  16190. this.n7 = (this.getChild("n7"));
  16191. }
  16192. }
  16193. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16194. class ui_btnXy1 extends fgui.GButton {
  16195. static createInstance() {
  16196. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16197. }
  16198. onConstruct() {
  16199. this.n1 = (this.getChild("n1"));
  16200. }
  16201. }
  16202. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16203. class ui_btnXy2 extends fgui.GButton {
  16204. static createInstance() {
  16205. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16206. }
  16207. onConstruct() {
  16208. this.n1 = (this.getChild("n1"));
  16209. }
  16210. }
  16211. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16212. class ui_btnXy3 extends fgui.GButton {
  16213. static createInstance() {
  16214. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16215. }
  16216. onConstruct() {
  16217. this.n1 = (this.getChild("n1"));
  16218. }
  16219. }
  16220. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16221. class ui_btn4 extends fgui.GButton {
  16222. static createInstance() {
  16223. return (fgui.UIPackage.createObject("loading", "btn4"));
  16224. }
  16225. onConstruct() {
  16226. this.n9 = (this.getChild("n9"));
  16227. this.n1 = (this.getChild("n1"));
  16228. }
  16229. }
  16230. ui_btn4.URL = "ui://37nctnhwxe622z";
  16231. class loadingBinder {
  16232. static bindAll() {
  16233. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16234. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16235. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16236. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16237. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16238. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16239. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16240. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16241. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16242. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16243. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16244. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16245. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16246. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16247. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16248. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16249. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16250. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16251. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16252. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16253. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16254. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16255. }
  16256. }
  16257. class UIMgr {
  16258. constructor() {
  16259. this._stage = null;
  16260. this._uiList = [];
  16261. this._showList = [];
  16262. this._bindPkgList = [];
  16263. this.uiIndex = 0;
  16264. }
  16265. static get inst() {
  16266. if (UIMgr._inst == null) {
  16267. UIMgr._inst = new UIMgr();
  16268. }
  16269. return UIMgr._inst;
  16270. }
  16271. setStage(s) {
  16272. if (this._stage) {
  16273. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16274. return;
  16275. }
  16276. this._stage = s;
  16277. }
  16278. clearTempData() {
  16279. console.log('zh:clearTempData start');
  16280. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16281. console.log('zh:clearTempData end');
  16282. }
  16283. init() {
  16284. this.setStage(Laya.stage);
  16285. fairygui.UIConfig.defaultFont = "微软雅黑";
  16286. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16287. fairygui.UIConfig.packageFileExtension = "obj";
  16288. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16289. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16290. fairygui.GRoot.inst.width = Laya.stage.width;
  16291. fairygui.GRoot.inst.height = Laya.stage.height;
  16292. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16293. }
  16294. addAllUpdate() {
  16295. this.uiIndex = 0;
  16296. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16297. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16298. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16299. }
  16300. }
  16301. }
  16302. bindFUI(pkgname) {
  16303. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16304. return;
  16305. }
  16306. switch (pkgname) {
  16307. case fguiRes.loading:
  16308. fairygui.UIPackage.addPackage(pkgname);
  16309. loadingBinder.bindAll();
  16310. this._bindPkgList.push(pkgname);
  16311. break;
  16312. case fguiRes.game:
  16313. fairygui.UIPackage.addPackage(pkgname);
  16314. gameBinder.bindAll();
  16315. this._bindPkgList.push(pkgname);
  16316. break;
  16317. default:
  16318. break;
  16319. }
  16320. }
  16321. Show(cls, ...param) {
  16322. let nameStr = cls.uiName;
  16323. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16324. let temp = this._uiList[i];
  16325. let str = temp.className;
  16326. if (str == nameStr) {
  16327. if (temp.isMuti) {
  16328. if (temp.isHide) {
  16329. temp.show(...param);
  16330. this._uiList.splice(i, 1);
  16331. this._uiList.push(temp);
  16332. return temp;
  16333. }
  16334. }
  16335. else {
  16336. temp.show(...param);
  16337. this._uiList.splice(i, 1);
  16338. this._uiList.push(temp);
  16339. return temp;
  16340. }
  16341. }
  16342. }
  16343. let ui = new cls();
  16344. ui.className = nameStr;
  16345. this._showUI(ui, param);
  16346. return ui;
  16347. }
  16348. destroyUI(ui) {
  16349. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16350. let temp = this._uiList[i].className;
  16351. if (temp == ui.className) {
  16352. this._uiList.splice(i, 1);
  16353. break;
  16354. }
  16355. }
  16356. this.checkUIState();
  16357. }
  16358. _showUI(ui, param) {
  16359. this._uiList.push(ui);
  16360. ui.show(...param);
  16361. }
  16362. Hide(uiClass) {
  16363. let ui = this.getUI(uiClass);
  16364. if (ui && !ui.isHide) {
  16365. ui.hide();
  16366. }
  16367. }
  16368. getUI(ui) {
  16369. let nameStr = ui.uiName;
  16370. for (let index = 0; index < this._uiList.length; index++) {
  16371. let temp = this._uiList[index];
  16372. if (temp.className == nameStr) {
  16373. return temp;
  16374. }
  16375. }
  16376. return null;
  16377. }
  16378. isShow(cls) {
  16379. for (var i of this._uiList) {
  16380. if (i instanceof cls) {
  16381. return i.isShowing;
  16382. }
  16383. }
  16384. return false;
  16385. }
  16386. showUINum() {
  16387. let num = 0;
  16388. for (var i of this._uiList) {
  16389. if (i.isShowing) {
  16390. num++;
  16391. }
  16392. }
  16393. return num;
  16394. }
  16395. checkUIState() {
  16396. Laya.timer.clear(this, this._uiCheck);
  16397. Laya.timer.once(400, this, this._uiCheck);
  16398. }
  16399. _uiCheck() {
  16400. let showList = [];
  16401. for (var i of this._uiList) {
  16402. if (!i.isHide) {
  16403. showList.push(i);
  16404. }
  16405. }
  16406. for (let index = 0; index < showList.length; index++) {
  16407. if (index == showList.length - 1) {
  16408. showList[index].checkActive(true);
  16409. }
  16410. else {
  16411. showList[index].checkActive(false);
  16412. }
  16413. }
  16414. }
  16415. showTip(msg, time = 600, size = 30) {
  16416. }
  16417. }
  16418. class UIShowList {
  16419. }
  16420. class SoundMgr {
  16421. constructor() {
  16422. this.soundMax = 4;
  16423. this.isLoad = false;
  16424. this.soundMap = {};
  16425. this.isSound = true;
  16426. this.openShake = true;
  16427. SoundMgr._instance = this;
  16428. }
  16429. static getInstance() {
  16430. if (!this._instance) {
  16431. this._instance = new SoundMgr();
  16432. }
  16433. return this._instance;
  16434. }
  16435. init() {
  16436. console.log('zh:sm init 1');
  16437. Laya.SoundManager.autoReleaseSound = true;
  16438. Laya.SoundManager.autoStopMusic = true;
  16439. Laya.SoundManager.musicVolume = 0.3;
  16440. Laya.SoundManager.soundVolume = 0.5;
  16441. this.musicPlayed = false;
  16442. this.audioUrl = "asset/sound/ogg/";
  16443. console.log('zh:sm init 2');
  16444. console.log('zh:dev type ');
  16445. if (Laya.Browser.onAndroid) {
  16446. console.log('zh:dev type android');
  16447. this.audioUrl = "asset/sound/ogg/";
  16448. this.isLoad = true;
  16449. }
  16450. else {
  16451. console.log('zh:dev type not android');
  16452. this.audioUrl = "asset/sound/mp3/";
  16453. this.isLoad = true;
  16454. }
  16455. }
  16456. onSetting(isS) {
  16457. this.isSound = isS;
  16458. this.mute(!this.isSound);
  16459. }
  16460. clearCount() {
  16461. for (var key in this.soundMap) {
  16462. delete this.soundMap[key];
  16463. }
  16464. }
  16465. playMusic(path, loop = 0) {
  16466. console.log('zh:playMusic 1 PATH=' + path);
  16467. this.musicPath = path;
  16468. if (!this.isLoad) {
  16469. return;
  16470. }
  16471. if (!path || path == "") {
  16472. return;
  16473. }
  16474. if (!this.isSound) {
  16475. return;
  16476. }
  16477. this.musicPlayed = true;
  16478. let url = this.getUrl(path);
  16479. if (!Laya.Browser.onAndroid) {
  16480. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16481. this.play(url, loop);
  16482. }));
  16483. }
  16484. else {
  16485. this.play(url, loop);
  16486. }
  16487. }
  16488. play(url, loop) {
  16489. Laya.SoundManager.playMusic(url, loop);
  16490. }
  16491. getUrl(path) {
  16492. let url = this.audioUrl + path;
  16493. if (Laya.Browser.onAndroid) {
  16494. url += ".ogg";
  16495. }
  16496. else {
  16497. url += ".mp3";
  16498. }
  16499. return url;
  16500. }
  16501. pauseMusic(pause) {
  16502. if (pause) {
  16503. this.mute(true);
  16504. }
  16505. else if (this.isSound)
  16506. this.mute(false);
  16507. }
  16508. stopMusic() {
  16509. Laya.SoundManager.stopMusic();
  16510. if (Moyu.isNeedPlatAudio) {
  16511. Moyu.stopMusic();
  16512. }
  16513. }
  16514. mute(mute) {
  16515. if (Moyu.isNeedPlatAudio) {
  16516. Moyu.pauseMusic(mute);
  16517. }
  16518. else {
  16519. Laya.SoundManager.musicMuted = mute;
  16520. if (!mute && !this.musicPlayed && this.musicPath) {
  16521. this.playMusic(this.musicPath);
  16522. }
  16523. }
  16524. }
  16525. stopSound(path) {
  16526. let url = this.getUrl(path);
  16527. Laya.SoundManager.stopSound(url);
  16528. }
  16529. playSound(path, loop = 1, soundMax = this.soundMax) {
  16530. if (!this.isLoad)
  16531. return;
  16532. if (!this.isSound)
  16533. return;
  16534. if (!path || path == "")
  16535. return;
  16536. let url = this.getUrl(path);
  16537. if (Moyu.isNeedPlatAudio) {
  16538. Moyu.playSound(path, loop == 0);
  16539. }
  16540. else {
  16541. let count = 1;
  16542. if (this.soundMap[path])
  16543. count = this.soundMap[path] + 1;
  16544. if (count > soundMax)
  16545. return;
  16546. this.soundMap[path] = count;
  16547. Laya.SoundManager.playSound(url, loop);
  16548. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16549. }
  16550. }
  16551. removePath(path) {
  16552. if (this.soundMap[path]) {
  16553. let count = this.soundMap[path];
  16554. count--;
  16555. if (count < 1)
  16556. delete this.soundMap[path];
  16557. else
  16558. this.soundMap[path] = count;
  16559. }
  16560. }
  16561. playBtnSound() {
  16562. this.playSound("btn");
  16563. }
  16564. playGetSound() {
  16565. }
  16566. playCloseUISound() {
  16567. }
  16568. }
  16569. SoundMgr._instance = null;
  16570. var Handler$1 = Laya.Handler;
  16571. var EResType;
  16572. (function (EResType) {
  16573. EResType[EResType["none"] = 0] = "none";
  16574. EResType[EResType["nromal"] = 1] = "nromal";
  16575. EResType[EResType["td"] = 2] = "td";
  16576. EResType[EResType["sk"] = 3] = "sk";
  16577. })(EResType || (EResType = {}));
  16578. class CResLoader {
  16579. constructor(doneCall, proCall) {
  16580. this.completrCall = doneCall;
  16581. this.progressCall = proCall;
  16582. this.progressHander = new Handler$1(this, this.onProgress);
  16583. this.tdResMap = {};
  16584. }
  16585. load(resList) {
  16586. this.resCount = 0;
  16587. this.loadCount = 0;
  16588. for (let i = 0; i < resList.length; i++) {
  16589. let path = resList[i];
  16590. if (!path)
  16591. continue;
  16592. this.resCount++;
  16593. let type = this.getResType(path);
  16594. if (type == EResType.nromal)
  16595. this.loadNromal(path);
  16596. else if (type == EResType.td)
  16597. this.loadTd(path);
  16598. }
  16599. }
  16600. getRes(path) {
  16601. let type = this.getResType(path);
  16602. if (type == EResType.nromal)
  16603. return Laya.loader.getRes(path);
  16604. else if (type == EResType.td) {
  16605. let res = this.tdResMap[path];
  16606. if (res)
  16607. return res.clone();
  16608. return null;
  16609. }
  16610. }
  16611. destroy() {
  16612. this.progressHander.clear();
  16613. this.progressHander = null;
  16614. }
  16615. clearRes(path) {
  16616. let type = this.getResType(path);
  16617. if (type == EResType.nromal)
  16618. Laya.loader.clearRes(path);
  16619. else if (type == EResType.td) {
  16620. let obj = this.tdResMap[path];
  16621. if (obj)
  16622. obj.destroy();
  16623. delete this.tdResMap[path];
  16624. }
  16625. }
  16626. getResType(path) {
  16627. let exs = this.getExtension(path);
  16628. if (exs == "sk")
  16629. return EResType.sk;
  16630. if (exs == "ls" || exs == "lh" || exs == "lm")
  16631. return EResType.td;
  16632. else
  16633. return EResType.nromal;
  16634. }
  16635. getExtension(res) {
  16636. var index = res.lastIndexOf(".");
  16637. return res.substr(index + 1);
  16638. }
  16639. loadNromal(path) {
  16640. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  16641. if (res) {
  16642. this.onLoad();
  16643. }
  16644. else
  16645. console.log("load res fail:" + path);
  16646. }), this.progressHander);
  16647. }
  16648. loadSk() {
  16649. }
  16650. loadTd(path) {
  16651. if (this.tdResMap[path]) {
  16652. this.onLoad();
  16653. return;
  16654. }
  16655. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  16656. if (res) {
  16657. this.tdResMap[path] = res;
  16658. this.onLoad();
  16659. }
  16660. else
  16661. console.log("load res fail:" + path);
  16662. }));
  16663. }
  16664. onLoad() {
  16665. this.loadCount++;
  16666. this.onProgress(1);
  16667. if (this.loadCount >= this.resCount) {
  16668. this.completrCall.run();
  16669. }
  16670. }
  16671. onProgress(pro) {
  16672. let progress = (this.loadCount + pro) / this.resCount;
  16673. this.progressCall.runWith(progress);
  16674. }
  16675. }
  16676. var Handler$2 = Laya.Handler;
  16677. class ResInfo {
  16678. constructor() {
  16679. this.index = 0;
  16680. }
  16681. }
  16682. class ResMgr {
  16683. constructor() {
  16684. this.resList = [];
  16685. this.doneList = [];
  16686. this.resMap = {};
  16687. this.currentLoad = null;
  16688. this.completeHandler = new Handler$2(this, this.onComplete);
  16689. this.progressHandler = new Handler$2(this, this.onProgress);
  16690. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  16691. }
  16692. static getInstance() {
  16693. if (ResMgr._instance == null) {
  16694. ResMgr._instance = new ResMgr();
  16695. }
  16696. return ResMgr._instance;
  16697. }
  16698. loadList(list, completeHandler, progressHandler) {
  16699. if (list.length < 1) {
  16700. completeHandler.run();
  16701. return;
  16702. }
  16703. let info = this.getResInfo();
  16704. info.resList = list;
  16705. info.completeHandler = completeHandler;
  16706. info.progressHandler = progressHandler;
  16707. this.resList.push(info);
  16708. this.startLoad();
  16709. }
  16710. loadFguiRes(list, completeHandler, progressHandler) {
  16711. Laya.loader.load(list, completeHandler, progressHandler);
  16712. }
  16713. loadAny(list, completeHandler, progressHandler) {
  16714. Laya.loader.load(list, completeHandler, progressHandler);
  16715. }
  16716. load(path, completeHandler, progressHandler) {
  16717. let count = this.resMap[path];
  16718. if (count && count > 0) {
  16719. if (completeHandler)
  16720. completeHandler.run();
  16721. }
  16722. else
  16723. this.loadList([path], completeHandler, progressHandler);
  16724. }
  16725. getRes(path) {
  16726. let res = this.resMap[path];
  16727. if (!res)
  16728. this.showLog("资源不存在:" + path);
  16729. else
  16730. return this.loader.getRes(path);
  16731. }
  16732. clearList(list, force = false) {
  16733. if (!list || list.length < 1)
  16734. return;
  16735. let cr = () => {
  16736. for (const k in list) {
  16737. let v = list[k];
  16738. if (!v)
  16739. continue;
  16740. if (force) {
  16741. this.loader.clearRes(v);
  16742. delete this.resMap[v];
  16743. }
  16744. else {
  16745. let count = this.resMap[v];
  16746. if (count && count > 1) {
  16747. count--;
  16748. this.resMap[v] = count;
  16749. }
  16750. else {
  16751. this.loader.clearRes(v);
  16752. delete this.resMap[v];
  16753. }
  16754. }
  16755. }
  16756. if (!window.hasOwnProperty("ks"))
  16757. Laya.Resource.destroyUnusedResources();
  16758. };
  16759. Laya.timer.clearAll(this);
  16760. Laya.timer.once(2000, this, cr);
  16761. }
  16762. clear3D() {
  16763. for (const k in this.loader.tdResMap) {
  16764. this.loader.clearRes(k);
  16765. if (this.resMap[k])
  16766. delete this.resMap[k];
  16767. }
  16768. if (!window.hasOwnProperty("ks"))
  16769. Laya.Resource.destroyUnusedResources();
  16770. }
  16771. clear(path, force = false) {
  16772. this.clearList([path], force);
  16773. }
  16774. getResInfo() {
  16775. if (this.doneList.length > 0)
  16776. return this.doneList.pop();
  16777. else
  16778. return new ResInfo();
  16779. }
  16780. startLoad() {
  16781. if (this.currentLoad)
  16782. return;
  16783. this.currentLoad = this.resList.pop();
  16784. if (this.currentLoad) {
  16785. this.loader.load(this.currentLoad.resList);
  16786. }
  16787. }
  16788. onComplete() {
  16789. if (!this.currentLoad)
  16790. return;
  16791. for (const k in this.currentLoad.resList) {
  16792. let v = this.currentLoad.resList[k];
  16793. let count = this.resMap[v];
  16794. if (count)
  16795. count++;
  16796. else
  16797. count = 1;
  16798. this.resMap[v] = count;
  16799. }
  16800. if (this.currentLoad.completeHandler)
  16801. this.currentLoad.completeHandler.run();
  16802. this.doneList.push(this.currentLoad);
  16803. this.currentLoad = null;
  16804. this.startLoad();
  16805. }
  16806. onProgress(pro) {
  16807. if (!this.currentLoad)
  16808. return;
  16809. if (this.currentLoad.progressHandler)
  16810. this.currentLoad.progressHandler.runWith(pro);
  16811. }
  16812. showLog(str, ...args) {
  16813. console.log("[ResLoader] " + str);
  16814. }
  16815. }
  16816. ResMgr._instance = null;
  16817. class EventMgr extends Laya.EventDispatcher {
  16818. }
  16819. let eventMgr = new EventMgr();
  16820. /*! *****************************************************************************
  16821. Copyright (c) Microsoft Corporation. All rights reserved.
  16822. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  16823. this file except in compliance with the License. You may obtain a copy of the
  16824. License at http://www.apache.org/licenses/LICENSE-2.0
  16825. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  16826. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  16827. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  16828. MERCHANTABLITY OR NON-INFRINGEMENT.
  16829. See the Apache Version 2.0 License for specific language governing permissions
  16830. and limitations under the License.
  16831. ***************************************************************************** */
  16832. /* global Reflect, Promise */
  16833. var extendStatics = function(d, b) {
  16834. extendStatics = Object.setPrototypeOf ||
  16835. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  16836. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  16837. return extendStatics(d, b);
  16838. };
  16839. function __extends(d, b) {
  16840. extendStatics(d, b);
  16841. function __() { this.constructor = d; }
  16842. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  16843. }
  16844. var __assign = function() {
  16845. __assign = Object.assign || function __assign(t) {
  16846. for (var s, i = 1, n = arguments.length; i < n; i++) {
  16847. s = arguments[i];
  16848. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  16849. }
  16850. return t;
  16851. };
  16852. return __assign.apply(this, arguments);
  16853. };
  16854. function __rest(s, e) {
  16855. var t = {};
  16856. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  16857. t[p] = s[p];
  16858. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  16859. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  16860. t[p[i]] = s[p[i]];
  16861. return t;
  16862. }
  16863. function __decorate(decorators, target, key, desc) {
  16864. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  16865. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  16866. 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;
  16867. return c > 3 && r && Object.defineProperty(target, key, r), r;
  16868. }
  16869. function __param(paramIndex, decorator) {
  16870. return function (target, key) { decorator(target, key, paramIndex); }
  16871. }
  16872. function __metadata(metadataKey, metadataValue) {
  16873. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  16874. }
  16875. function __awaiter(thisArg, _arguments, P, generator) {
  16876. return new (P || (P = Promise))(function (resolve, reject) {
  16877. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  16878. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  16879. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  16880. step((generator = generator.apply(thisArg, _arguments || [])).next());
  16881. });
  16882. }
  16883. function __generator(thisArg, body) {
  16884. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  16885. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  16886. function verb(n) { return function (v) { return step([n, v]); }; }
  16887. function step(op) {
  16888. if (f) throw new TypeError("Generator is already executing.");
  16889. while (_) try {
  16890. 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;
  16891. if (y = 0, t) op = [op[0] & 2, t.value];
  16892. switch (op[0]) {
  16893. case 0: case 1: t = op; break;
  16894. case 4: _.label++; return { value: op[1], done: false };
  16895. case 5: _.label++; y = op[1]; op = [0]; continue;
  16896. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  16897. default:
  16898. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  16899. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  16900. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  16901. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  16902. if (t[2]) _.ops.pop();
  16903. _.trys.pop(); continue;
  16904. }
  16905. op = body.call(thisArg, _);
  16906. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  16907. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  16908. }
  16909. }
  16910. function __exportStar(m, exports) {
  16911. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  16912. }
  16913. function __values(o) {
  16914. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  16915. if (m) return m.call(o);
  16916. return {
  16917. next: function () {
  16918. if (o && i >= o.length) o = void 0;
  16919. return { value: o && o[i++], done: !o };
  16920. }
  16921. };
  16922. }
  16923. function __read(o, n) {
  16924. var m = typeof Symbol === "function" && o[Symbol.iterator];
  16925. if (!m) return o;
  16926. var i = m.call(o), r, ar = [], e;
  16927. try {
  16928. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  16929. }
  16930. catch (error) { e = { error: error }; }
  16931. finally {
  16932. try {
  16933. if (r && !r.done && (m = i["return"])) m.call(i);
  16934. }
  16935. finally { if (e) throw e.error; }
  16936. }
  16937. return ar;
  16938. }
  16939. function __spread() {
  16940. for (var ar = [], i = 0; i < arguments.length; i++)
  16941. ar = ar.concat(__read(arguments[i]));
  16942. return ar;
  16943. }
  16944. function __await(v) {
  16945. return this instanceof __await ? (this.v = v, this) : new __await(v);
  16946. }
  16947. function __asyncGenerator(thisArg, _arguments, generator) {
  16948. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16949. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  16950. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  16951. 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); }); }; }
  16952. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  16953. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  16954. function fulfill(value) { resume("next", value); }
  16955. function reject(value) { resume("throw", value); }
  16956. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  16957. }
  16958. function __asyncDelegator(o) {
  16959. var i, p;
  16960. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  16961. 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; }
  16962. }
  16963. function __asyncValues(o) {
  16964. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  16965. var m = o[Symbol.asyncIterator], i;
  16966. 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);
  16967. 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); }); }; }
  16968. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  16969. }
  16970. function __makeTemplateObject(cooked, raw) {
  16971. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  16972. return cooked;
  16973. };
  16974. function __importStar(mod) {
  16975. if (mod && mod.__esModule) return mod;
  16976. var result = {};
  16977. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  16978. result.default = mod;
  16979. return result;
  16980. }
  16981. function __importDefault(mod) {
  16982. return (mod && mod.__esModule) ? mod : { default: mod };
  16983. }
  16984. class CustomAlert {
  16985. static show(title, content, buttons) {
  16986. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  16987. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  16988. return;
  16989. }
  16990. const bg = new Laya.Box();
  16991. bg.alpha = 0;
  16992. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  16993. Laya.stage.addChild(bg);
  16994. Laya.Tween.to(bg, { alpha: 1 }, 200);
  16995. const panel = new Laya.Box();
  16996. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  16997. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  16998. bg.addChild(panel);
  16999. const titleText = new Laya.Text();
  17000. titleText.text = title;
  17001. titleText.fontSize = 32;
  17002. titleText.color = "#333333";
  17003. titleText.bold = true;
  17004. titleText.pos(20, 20);
  17005. titleText.width = 360;
  17006. titleText.align = "center";
  17007. panel.addChild(titleText);
  17008. const contentText = new Laya.Text();
  17009. contentText.text = content;
  17010. contentText.fontSize = 21;
  17011. contentText.color = "#555555";
  17012. contentText.pos(20, 70);
  17013. contentText.width = 360;
  17014. contentText.wordWrap = true;
  17015. contentText.align = "center";
  17016. panel.addChild(contentText);
  17017. const buttonContainer = new Laya.Box();
  17018. buttonContainer.pos(20, 160);
  17019. panel.addChild(buttonContainer);
  17020. const btnWidth = 120;
  17021. const spacing = 30;
  17022. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17023. buttons.forEach((btn, index) => {
  17024. const button = new Laya.Button();
  17025. button.label = btn.label;
  17026. button.size(btnWidth, 40);
  17027. button.labelSize = 22;
  17028. button.pos(index * (btnWidth + spacing), 0);
  17029. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17030. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17031. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17032. button.alpha = 0.9;
  17033. });
  17034. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17035. button.alpha = 1;
  17036. });
  17037. button.on(Laya.Event.CLICK, this, () => {
  17038. btn.handler();
  17039. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17040. bg.removeSelf();
  17041. }));
  17042. });
  17043. buttonContainer.addChild(button);
  17044. });
  17045. buttonContainer.x = (panel.width - totalWidth) / 2;
  17046. }
  17047. }
  17048. class ConfigMgr {
  17049. constructor() {
  17050. this.httpReqCount = 4;
  17051. this.httpReqOkCount = 0;
  17052. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17053. try {
  17054. this.httpReqOkCount = 0;
  17055. let reqData = JSON.stringify({
  17056. gameName: "TQ",
  17057. gameUserName: "zhangSan"
  17058. });
  17059. console.log('zh:第1个请求getClassicCfg');
  17060. const classicCfg = yield this.sendPostAsync('getClassicCfg', reqData);
  17061. this.classicCfg = classicCfg;
  17062. this.httpReqOkCount++;
  17063. console.log('zh:第2个请求getLevelCfg');
  17064. const levelCfg = yield this.sendPostAsync('getLevelCfg', reqData);
  17065. this.levelCfg = levelCfg;
  17066. this.httpReqOkCount++;
  17067. console.log('zh:第3个请求 getPlaceBallCfg');
  17068. const placeBallCfg = yield this.sendPostAsync('getPlaceBallCfg', reqData);
  17069. this.placeBallCfg = placeBallCfg;
  17070. this.httpReqOkCount++;
  17071. console.log('zh:第4个请求 npc');
  17072. const npc = yield this.sendPostAsync('getNpc', reqData);
  17073. this.npcJson = npc.Data;
  17074. this.httpReqOkCount++;
  17075. console.log('zh:所有配置加载完成');
  17076. }
  17077. catch (error) {
  17078. console.error('❌请求失败:', error);
  17079. Laya.timer.once(500, this, () => {
  17080. console.log('zh:✅重新尝试加载网络资源');
  17081. xGame.cfgMgr.getConfigFromServer();
  17082. });
  17083. }
  17084. finally {
  17085. if (this.httpReqCount > this.httpReqOkCount) {
  17086. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17087. {
  17088. label: "Okay", handler: () => {
  17089. console.log("zh:好的知道了");
  17090. JSBridgeUtils.instance.exitAndCloseGame();
  17091. }
  17092. }
  17093. ]);
  17094. }
  17095. }
  17096. });
  17097. this.sendPostAsync = (action, reqData) => {
  17098. return new Promise((resolve, reject) => {
  17099. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17100. try {
  17101. let code = res.code;
  17102. if (code == 200) {
  17103. const parsedData = JSON.parse(res.msg);
  17104. resolve(parsedData);
  17105. }
  17106. else {
  17107. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17108. reject(new Error(`Request failed with code: ${code}`));
  17109. }
  17110. }
  17111. catch (error) {
  17112. console.error(`ERROR=${error}`);
  17113. alert("Please check your network connection.");
  17114. reject(error);
  17115. }
  17116. finally {
  17117. console.log(`zh:${action}的请求处理完毕`);
  17118. }
  17119. });
  17120. });
  17121. };
  17122. }
  17123. static getInstance() {
  17124. if (!this._instance) {
  17125. this._instance = new ConfigMgr();
  17126. }
  17127. return this._instance;
  17128. }
  17129. init() {
  17130. this.getConfigFromServer();
  17131. }
  17132. test() {
  17133. let reqData = JSON.stringify({
  17134. gameName: "TQ",
  17135. gameUserName: "zhangSan"
  17136. });
  17137. xGame.httpMgr.sendPost2025('getClassicCfg', reqData, (res) => {
  17138. console.log('zh:1s');
  17139. try {
  17140. let code = res.code;
  17141. let data = res.data;
  17142. if (code == 200) {
  17143. const parsedData = JSON.parse(data);
  17144. this.classicCfg = parsedData;
  17145. }
  17146. else {
  17147. console.log('zh:res = ' + JSON.stringify(res));
  17148. }
  17149. }
  17150. catch (error) {
  17151. console.log('error=' + error);
  17152. alert("Please check your network connection.");
  17153. }
  17154. finally {
  17155. console.log('zh:1');
  17156. }
  17157. });
  17158. }
  17159. getUserInfoByIndex(index) {
  17160. return this.npcJson[index];
  17161. }
  17162. getRandomUserInfo() {
  17163. let index = xGame.tools.random(0, this.npcJson.length);
  17164. let rs = this.npcJson[index];
  17165. return rs;
  17166. }
  17167. getMaxBigMoveLength() {
  17168. return Object.keys(this.levelCfg).length;
  17169. }
  17170. getBigMoveLevelByIndex(index) {
  17171. let cfg = this.levelCfg;
  17172. cfg = cfg[index];
  17173. return cfg;
  17174. }
  17175. getRandomClassicLevel() {
  17176. let cfg = this.classicCfg;
  17177. let num = Object.keys(cfg).length;
  17178. let rand = xGame.common.randomNum(1, num);
  17179. return cfg[rand];
  17180. }
  17181. getPlaceBallByLevel(level) {
  17182. return this.placeBallCfg[level];
  17183. }
  17184. getMaxPlaceBall() {
  17185. return Object.keys(this.placeBallCfg).length;
  17186. }
  17187. }
  17188. class PoolD3Mgr {
  17189. constructor() {
  17190. this.pool = {};
  17191. }
  17192. static get ins() {
  17193. return this._ins || (this._ins = new PoolD3Mgr);
  17194. }
  17195. createList(key, prefab, parent) {
  17196. if (!this.pool[key]) {
  17197. this.pool[key] = {};
  17198. this.pool[key].prefab = prefab;
  17199. this.pool[key].list = [];
  17200. this.pool[key].parent = parent;
  17201. }
  17202. }
  17203. getItem(key) {
  17204. if (!this.pool[key]) {
  17205. return;
  17206. }
  17207. let temp;
  17208. if (this.pool[key].list.length > 0) {
  17209. temp = this.pool[key].list.pop();
  17210. }
  17211. else {
  17212. temp = this.pool[key].prefab.clone();
  17213. if (this.pool[key].parent) {
  17214. this.pool[key].parent.addChild(temp);
  17215. }
  17216. }
  17217. temp.active = true;
  17218. return temp;
  17219. }
  17220. putItem(key, obj) {
  17221. if (!this.pool[key]) {
  17222. return;
  17223. }
  17224. obj.active = false;
  17225. this.pool[key].list.push(obj);
  17226. }
  17227. }
  17228. let context$1 = context;
  17229. let uiMgr = UIMgr.inst;
  17230. let soundMgr = SoundMgr.getInstance();
  17231. let resMgr = ResMgr.getInstance();
  17232. let httpMgr = HttpMgr.getInstance();
  17233. let common = Common.getInstance();
  17234. let cfgMgr = ConfigMgr.getInstance();
  17235. let poolD3Mgr = PoolD3Mgr.ins;
  17236. let d3TexUrl = "res/d3Res/";
  17237. let d3ModeUrl = "res/unityRes/";
  17238. function setStageSize(view) {
  17239. if (view.width) {
  17240. view.width = Laya.stage.width;
  17241. view.height = Laya.stage.height;
  17242. }
  17243. }
  17244. function filledBg(view) {
  17245. let wh = Laya.stage.height / Laya.stage.width;
  17246. if (wh > 16 / 9) {
  17247. view.height = Laya.stage.height;
  17248. view.width = Laya.stage.height / 1334 * 750;
  17249. }
  17250. else {
  17251. view.width = Laya.stage.width;
  17252. view.height = Laya.stage.width / 750 * 1334;
  17253. }
  17254. }
  17255. function setNotch(view) {
  17256. if (view.height) {
  17257. view.y += context$1.notchHeight;
  17258. }
  17259. }
  17260. function showTip(str) {
  17261. uiMgr.Show(UIMsg, str);
  17262. }
  17263. function log(...args) {
  17264. console.log(args);
  17265. }
  17266. let xGame = {
  17267. context: context$1,
  17268. eventMgr,
  17269. resMgr,
  17270. uiMgr,
  17271. soundMgr,
  17272. define,
  17273. tools,
  17274. httpMgr,
  17275. d3TexUrl,
  17276. d3ModeUrl,
  17277. common,
  17278. cfgMgr,
  17279. poolD3Mgr,
  17280. setStageSize,
  17281. filledBg,
  17282. setNotch,
  17283. showTip,
  17284. log,
  17285. };
  17286. window["xGame"] = xGame;
  17287. let dataName = 'tBall_';
  17288. class UserData {
  17289. constructor() {
  17290. this.userId = "";
  17291. this.isAgree = false;
  17292. this.coinNum = 0;
  17293. this.gemNum = 0;
  17294. this.sound = true;
  17295. this.vibration = true;
  17296. this.currentDate = 0;
  17297. this.createTime = 0;
  17298. this.awardTime = 0;
  17299. this.roleId = 1;
  17300. this.roleList = [];
  17301. this.roleAds = [];
  17302. this.dressId = 101;
  17303. this.itemId = 201;
  17304. this.bigSkills = [1, 1, 1, 1, 1];
  17305. this.coin = 4000;
  17306. this.diamond = 0;
  17307. this.skillSuccessTimes = 0;
  17308. this.skillGuide = 0;
  17309. this.skillAccTimes = 0;
  17310. this.placeBallData = [];
  17311. this.shareDiamondTimes = 0;
  17312. this.dailyVideoShareTimes = 0;
  17313. this.secretary = [1, 0];
  17314. this.curSecretary = 0;
  17315. this.ballRod = [1, 0, 0, 0, 0, 1];
  17316. this.curBallRod = 5;
  17317. this.signData = 0;
  17318. this.signTime = 0;
  17319. this.drawTimes = 0;
  17320. this.drawAwardTimes = 0;
  17321. this.dailyfreeDrawTimes = 1;
  17322. this.power = 5;
  17323. this.powerTime = 0;
  17324. this.challengeTimes = 0;
  17325. this.extraSign = 0;
  17326. this.classicTimes = 0;
  17327. this.guideHelpLine = 0;
  17328. this.newUser = true;
  17329. this.rootBallFoul = 0;
  17330. this.timeoutFoul = 0;
  17331. this.roleList = [1];
  17332. }
  17333. saveData() {
  17334. let data = {};
  17335. for (let k in this) {
  17336. data[k.toString()] = this[k];
  17337. }
  17338. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17339. }
  17340. getData() {
  17341. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17342. if (ld) {
  17343. let localData = JSON.parse(ld);
  17344. if (localData) {
  17345. for (let k in this) {
  17346. let key = k.toString();
  17347. let data = localData[key];
  17348. if (data != undefined) {
  17349. this[k] = data;
  17350. }
  17351. }
  17352. }
  17353. }
  17354. }
  17355. }
  17356. class ItemData {
  17357. constructor() {
  17358. this.itemList = {};
  17359. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17360. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17361. }
  17362. saveData() {
  17363. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17364. }
  17365. getData() {
  17366. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17367. if (ld) {
  17368. let localData = JSON.parse(ld);
  17369. if (localData) {
  17370. this.itemList = localData;
  17371. }
  17372. }
  17373. }
  17374. }
  17375. class GameData {
  17376. constructor() {
  17377. this.curLevel = 0;
  17378. this.gameType = 1;
  17379. this.signIdx = 0;
  17380. this.signMax = 0;
  17381. this.rotaryTime = 0;
  17382. this.rotaryCount = 0;
  17383. this.rotaryList = [];
  17384. this.diyCount = 3;
  17385. this.awardIdx = 0;
  17386. this.shareNum = 2;
  17387. this.rankWeek = 0;
  17388. this.rankScore = 0;
  17389. this.gameCount = 0;
  17390. this.trySkill = -1;
  17391. this.tryTime = 0;
  17392. }
  17393. saveData() {
  17394. let data = {};
  17395. for (let k in this) {
  17396. data[k.toString()] = this[k];
  17397. }
  17398. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17399. }
  17400. getData() {
  17401. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17402. if (ld) {
  17403. let localData = JSON.parse(ld);
  17404. if (localData) {
  17405. for (let k in this) {
  17406. let key = k.toString();
  17407. let data = localData[key];
  17408. if (data != undefined) {
  17409. this[k] = data;
  17410. }
  17411. }
  17412. }
  17413. }
  17414. }
  17415. }
  17416. class Diy2025GameData {
  17417. constructor() {
  17418. this.challengeMode_overLev = 0;
  17419. this.xszyForClassic = false;
  17420. this.xszyForChallenge = false;
  17421. }
  17422. saveData() {
  17423. let data = {};
  17424. for (let k in this) {
  17425. data[k.toString()] = this[k];
  17426. }
  17427. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17428. }
  17429. getData() {
  17430. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17431. if (ld) {
  17432. let localData = JSON.parse(ld);
  17433. if (localData) {
  17434. for (let k in this) {
  17435. let key = k.toString();
  17436. let data = localData[key];
  17437. if (data != undefined) {
  17438. this[k] = data;
  17439. }
  17440. }
  17441. }
  17442. }
  17443. }
  17444. }
  17445. class DataMgr {
  17446. static Init() {
  17447. this.userData = new UserData();
  17448. this.gameData = new GameData();
  17449. this.itemData = new ItemData();
  17450. this.diyGameData = new Diy2025GameData();
  17451. this.userData.getData();
  17452. this.gameData.getData();
  17453. this.itemData.getData();
  17454. this.diyGameData.getData();
  17455. this.roleId = this.userData.roleId;
  17456. this.resetUse();
  17457. }
  17458. static isNewDay() {
  17459. Moyu.isNewDay(this, (isnew) => {
  17460. xGame.common.isNewDay = isnew;
  17461. if (!isnew)
  17462. return;
  17463. DataMgr.setShareDiamondTimes(0, false);
  17464. DataMgr.setDailyVideoShareTimes(0, false);
  17465. DataMgr.setDailyfreeDrawTimes(1);
  17466. DataMgr.setExtraSign(0);
  17467. });
  17468. }
  17469. static deletData() {
  17470. Laya.LocalStorage.clear();
  17471. }
  17472. static upRankData() {
  17473. let num = xGame.common.getAllStarNum();
  17474. if (num > 0)
  17475. Moyu.upRankData(xGame.common.curRankID, num);
  17476. }
  17477. static addItem(id, count = 1) {
  17478. let v = this.itemData.itemList[id];
  17479. if (!v)
  17480. v = { id: id, count: count, adnum: 0, active: true };
  17481. else {
  17482. if (v.active) {
  17483. v.count += count;
  17484. }
  17485. else {
  17486. v.count = count;
  17487. v.active = true;
  17488. }
  17489. }
  17490. this.itemData.itemList[id] = v;
  17491. xGame.soundMgr.playGetSound();
  17492. this.saveItemData();
  17493. }
  17494. static hasItem(id) {
  17495. let v = this.itemData.itemList[id];
  17496. if (v && v.active)
  17497. return true;
  17498. return false;
  17499. }
  17500. static getItem(id) {
  17501. let v = this.itemData.itemList[id];
  17502. return v;
  17503. }
  17504. static getItemCount(id) {
  17505. let v = this.itemData.itemList[id];
  17506. if (v && v.active)
  17507. return v.count;
  17508. return 0;
  17509. }
  17510. static getItemAd(id) {
  17511. let v = this.itemData.itemList[id];
  17512. if (v) {
  17513. return v.adnum;
  17514. }
  17515. return 0;
  17516. }
  17517. static onItemAd(id, num = 1) {
  17518. let v = this.itemData.itemList[id];
  17519. if (!v)
  17520. v = { id: id, count: 1, adnum: num, active: false };
  17521. else
  17522. v.adnum += num;
  17523. this.itemData.itemList[id] = v;
  17524. this.saveItemData();
  17525. }
  17526. static costItem(id, count) {
  17527. let v = this.itemData.itemList[id];
  17528. if (v && v.active) {
  17529. if (v.count < count)
  17530. return false;
  17531. else {
  17532. v.count -= count;
  17533. this.itemData.itemList[id] = v;
  17534. return true;
  17535. }
  17536. }
  17537. return false;
  17538. }
  17539. static resetUse() {
  17540. this.dressId = this.userData.dressId;
  17541. this.itemId = this.userData.itemId;
  17542. }
  17543. static passLevel() {
  17544. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17545. this.gameData.curLevel++;
  17546. this.curLevel = this.gameData.curLevel;
  17547. this.saveGameData();
  17548. }
  17549. static useRole(id) {
  17550. this.roleId = id;
  17551. if (this.hasRole(id)) {
  17552. this.userData.roleId = id;
  17553. this.saveUserData();
  17554. }
  17555. }
  17556. static addRole(id) {
  17557. if (this.hasRole(id))
  17558. return;
  17559. this.userData.roleList.push(id);
  17560. this.saveUserData();
  17561. }
  17562. static hasRole(id) {
  17563. return this.userData.roleList.indexOf(id) >= 0;
  17564. }
  17565. static gemEnough(num) {
  17566. return this.userData.gemNum >= num;
  17567. }
  17568. static roleHasAd(id) {
  17569. let count = this.userData.roleAds[id];
  17570. if (count != undefined && count >= 0)
  17571. return true;
  17572. else
  17573. return false;
  17574. }
  17575. static saveUserData(time = 500, event, arg) {
  17576. if (this.userSaving)
  17577. return;
  17578. this.userSaving = true;
  17579. Laya.timer.once(time, this, () => {
  17580. this.userSaving = false;
  17581. this.userData.saveData();
  17582. if (event)
  17583. xGame.eventMgr.event(event, arg);
  17584. });
  17585. }
  17586. static saveGameData() {
  17587. if (this.gameSaving)
  17588. return;
  17589. this.gameSaving = true;
  17590. Laya.timer.once(1000, this, () => {
  17591. this.gameSaving = false;
  17592. this.gameData.saveData();
  17593. });
  17594. }
  17595. static saveItemData() {
  17596. let fun = () => {
  17597. this.itemData.saveData();
  17598. };
  17599. Laya.timer.clear(this, fun);
  17600. Laya.timer.once(500, this, fun);
  17601. }
  17602. static saveData() {
  17603. this.saveUserData();
  17604. this.saveGameData();
  17605. }
  17606. static getBigSkillList() {
  17607. return this.userData.bigSkills;
  17608. }
  17609. static getBigSkillByIndex(index) {
  17610. return this.userData.bigSkills[index];
  17611. }
  17612. static setBigSkill(index, val, addUp = true) {
  17613. if (addUp) {
  17614. this.userData.bigSkills[index] += val;
  17615. }
  17616. else {
  17617. this.userData.bigSkills[index] = val;
  17618. }
  17619. this.saveUserData();
  17620. }
  17621. static coinEnough(need) {
  17622. if (typeof need != "number") {
  17623. console.error("金币格式错误");
  17624. return;
  17625. }
  17626. return this.userData.coin >= need;
  17627. }
  17628. static setCoin(val) {
  17629. if (typeof val != "number") {
  17630. return;
  17631. }
  17632. this.userData.coin += val;
  17633. this.saveUserData();
  17634. xGame.eventMgr.event(COIN_CHANGE);
  17635. }
  17636. static getCoin() {
  17637. return this.userData.coin;
  17638. }
  17639. static diamondEnough(need) {
  17640. if (typeof need != "number") {
  17641. console.error("金币格式错误");
  17642. return;
  17643. }
  17644. return this.userData.diamond >= need;
  17645. }
  17646. static setDiamond(val) {
  17647. if (typeof val != "number") {
  17648. return;
  17649. }
  17650. this.userData.diamond += val;
  17651. this.saveUserData();
  17652. xGame.eventMgr.event(DIAMOND_CHANGE);
  17653. }
  17654. static getDiamond() {
  17655. return this.userData.diamond;
  17656. }
  17657. static getSkillSuccessTimes() {
  17658. return this.userData.skillSuccessTimes;
  17659. }
  17660. static setSkillSuccessTimes(val, addUp = true) {
  17661. if (addUp)
  17662. this.userData.skillSuccessTimes += val;
  17663. else
  17664. this.userData.skillSuccessTimes = val;
  17665. this.saveUserData();
  17666. }
  17667. static getSkillAccTimes() {
  17668. return this.userData.skillAccTimes;
  17669. }
  17670. static setSkillAccTimes(val) {
  17671. this.userData.skillAccTimes += val;
  17672. this.saveUserData();
  17673. }
  17674. static getSkillGuide() {
  17675. if (!xGame.common.openGuide) {
  17676. return 1;
  17677. }
  17678. return this.userData.skillGuide;
  17679. }
  17680. static setSkillGuide(val) {
  17681. this.userData.skillGuide = val;
  17682. this.saveUserData();
  17683. }
  17684. static getPlaceBallLevelList() {
  17685. return this.userData.placeBallData;
  17686. }
  17687. static getPlaceBallLevel(level) {
  17688. let arr = this.userData.placeBallData;
  17689. let index = level - 1;
  17690. let out;
  17691. if (arr[index]) {
  17692. out = arr[index];
  17693. }
  17694. else {
  17695. let max = arr.length;
  17696. if (max == index) {
  17697. out = {
  17698. star: 0,
  17699. play: true,
  17700. isCur: true,
  17701. getAward: false
  17702. };
  17703. }
  17704. else {
  17705. out = {
  17706. star: 0,
  17707. play: false,
  17708. getAward: false
  17709. };
  17710. }
  17711. }
  17712. return out;
  17713. }
  17714. static setPlaceBallLevel(level, star) {
  17715. let arr = this.userData.placeBallData;
  17716. let index = level - 1;
  17717. if (arr[index]) {
  17718. arr[index].star = Math.max(arr[index].star, star);
  17719. }
  17720. else {
  17721. let max = arr.length;
  17722. if (max == index) {
  17723. arr.push({
  17724. star: star,
  17725. play: true,
  17726. getAward: false
  17727. });
  17728. }
  17729. else {
  17730. console.error("关卡存储出错");
  17731. }
  17732. }
  17733. this.saveUserData();
  17734. }
  17735. static setPlaceBallAward(level) {
  17736. let arr = this.userData.placeBallData;
  17737. let index = level - 1;
  17738. if (arr[index]) {
  17739. arr[index].getAward = true;
  17740. }
  17741. this.saveUserData();
  17742. }
  17743. static getShareDiamondTimes() {
  17744. return this.userData.shareDiamondTimes;
  17745. }
  17746. static setShareDiamondTimes(val, addUp = true) {
  17747. if (addUp) {
  17748. this.userData.shareDiamondTimes += val;
  17749. }
  17750. else {
  17751. this.userData.shareDiamondTimes = val;
  17752. }
  17753. this.saveUserData();
  17754. }
  17755. static getDailyVideoShareTimes() {
  17756. return this.userData.dailyVideoShareTimes;
  17757. }
  17758. static setDailyVideoShareTimes(val, addUp = true) {
  17759. if (addUp) {
  17760. this.userData.dailyVideoShareTimes += val;
  17761. }
  17762. else {
  17763. this.userData.dailyVideoShareTimes = val;
  17764. }
  17765. this.saveUserData();
  17766. }
  17767. static getSecretary(index) {
  17768. return this.userData.secretary[index];
  17769. }
  17770. static setSecretary(index, val) {
  17771. this.userData.secretary[index] = val;
  17772. this.saveUserData();
  17773. }
  17774. static getCurSecretary() {
  17775. return this.userData.curSecretary;
  17776. }
  17777. static setCurSecretary(index) {
  17778. this.userData.curSecretary = index;
  17779. this.saveUserData();
  17780. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  17781. }
  17782. static getBallRod(index) {
  17783. return this.userData.ballRod[index];
  17784. }
  17785. static setBallRod(index, val) {
  17786. this.userData.ballRod[index] = val;
  17787. this.saveUserData();
  17788. }
  17789. static getCurBallRod() {
  17790. return this.userData.curBallRod;
  17791. }
  17792. static setCurBallRod(index) {
  17793. this.userData.curBallRod = index;
  17794. this.saveUserData();
  17795. }
  17796. static setSignData(val) {
  17797. this.userData.signData = val;
  17798. this.saveUserData();
  17799. }
  17800. static getSignData() {
  17801. return this.userData.signData;
  17802. }
  17803. static setSignTime(val) {
  17804. this.userData.signTime = val;
  17805. this.saveUserData();
  17806. }
  17807. static getSignTime() {
  17808. return this.userData.signTime;
  17809. }
  17810. static getDrawTimes() {
  17811. return this.userData.drawTimes;
  17812. }
  17813. static setDrawTimes(val, addUp = true) {
  17814. if (addUp) {
  17815. this.userData.drawTimes += val;
  17816. }
  17817. else {
  17818. this.userData.drawTimes = val;
  17819. }
  17820. this.saveUserData();
  17821. }
  17822. static getDrawAwardTimes() {
  17823. return this.userData.drawAwardTimes;
  17824. }
  17825. static setDrawAwardTimes(val) {
  17826. this.userData.drawAwardTimes = val;
  17827. this.saveUserData();
  17828. }
  17829. static getDailyfreeDrawTimes() {
  17830. return this.userData.dailyfreeDrawTimes;
  17831. }
  17832. static setDailyfreeDrawTimes(val) {
  17833. this.userData.dailyfreeDrawTimes = val;
  17834. this.saveUserData();
  17835. }
  17836. static setPower(val, addUp = true) {
  17837. if (addUp)
  17838. this.userData.power += val;
  17839. else
  17840. this.userData.power = val;
  17841. if (this.userData.power >= xGame.common.maxPower) {
  17842. this.userData.power = xGame.common.maxPower;
  17843. }
  17844. xGame.eventMgr.event(POWER_CHANGE, val);
  17845. this.saveUserData();
  17846. }
  17847. static getPower() {
  17848. return this.userData.power;
  17849. }
  17850. static setPowerTime(val) {
  17851. this.userData.powerTime = val;
  17852. this.saveUserData();
  17853. }
  17854. static getPowerTime() {
  17855. return this.userData.powerTime;
  17856. }
  17857. static powerEnough() {
  17858. return this.getPower() > 0;
  17859. }
  17860. static getChallengeTimes() {
  17861. return this.userData.challengeTimes;
  17862. }
  17863. static setChallengeTimes(val) {
  17864. this.userData.challengeTimes += val;
  17865. this.saveUserData();
  17866. }
  17867. static getExtraSign() {
  17868. return this.userData.extraSign;
  17869. }
  17870. static setExtraSign(val) {
  17871. this.userData.extraSign = val;
  17872. this.saveUserData();
  17873. }
  17874. static getClassicTimes() {
  17875. return this.userData.classicTimes;
  17876. }
  17877. static setClassicTimes() {
  17878. this.userData.classicTimes += 1;
  17879. this.saveUserData();
  17880. }
  17881. static getGuideHelpLine() {
  17882. return this.userData.guideHelpLine;
  17883. }
  17884. static setGuideHelpLine() {
  17885. this.userData.guideHelpLine = 1;
  17886. this.saveUserData();
  17887. }
  17888. static getNewUser() {
  17889. return this.userData.newUser;
  17890. }
  17891. static setNewUser() {
  17892. this.userData.newUser = false;
  17893. this.saveUserData();
  17894. }
  17895. static getRootBallFoul() {
  17896. return this.userData.rootBallFoul;
  17897. }
  17898. static setRootBallFoul() {
  17899. this.userData.rootBallFoul = 1;
  17900. this.saveUserData();
  17901. }
  17902. static getTimeoutFoul() {
  17903. return this.userData.timeoutFoul;
  17904. }
  17905. static setTimeoutFoul() {
  17906. this.userData.timeoutFoul = 1;
  17907. this.saveUserData();
  17908. }
  17909. static saveDiyGameData() {
  17910. if (this.diyGameSaving)
  17911. return;
  17912. this.diyGameSaving = true;
  17913. Laya.timer.once(500, this, () => {
  17914. this.diyGameSaving = false;
  17915. this.diyGameData.saveData();
  17916. });
  17917. }
  17918. static getChallengeMode_overLev() {
  17919. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  17920. return this.challengeMode_overLev;
  17921. }
  17922. static setChallengeMode_overLev(levNum) {
  17923. this.diyGameData.challengeMode_overLev = levNum;
  17924. this.saveDiyGameData();
  17925. }
  17926. }
  17927. DataMgr.isNewUser = false;
  17928. DataMgr.fristEnter = true;
  17929. DataMgr.levelType = 0;
  17930. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  17931. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  17932. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  17933. DataMgr.challengeMode_overLev = 0;
  17934. DataMgr.xszyForClassic = false;
  17935. DataMgr.xszyForChallenge = false;
  17936. DataMgr.awardId = 0;
  17937. DataMgr.awardCoin = 0;
  17938. DataMgr.sceneId = -1;
  17939. DataMgr.tryId = 0;
  17940. DataMgr.curLevel = 1;
  17941. DataMgr.vipLevel = 0;
  17942. DataMgr.maxLevel = 0;
  17943. DataMgr.awardRatio = 1;
  17944. DataMgr.gameList = [];
  17945. DataMgr.rankList = [];
  17946. DataMgr.recoverTime = 480000;
  17947. DataMgr.minScore = 0;
  17948. DataMgr.rankDis = 0;
  17949. DataMgr.userSaving = false;
  17950. DataMgr.gameSaving = false;
  17951. DataMgr.diyGameSaving = false;
  17952. class D3Tween extends Laya.Script3D {
  17953. constructor() {
  17954. super();
  17955. this.isInited = false;
  17956. }
  17957. ;
  17958. init() {
  17959. if (this.isInited)
  17960. return;
  17961. this.isInited = true;
  17962. this.gameObj = this.owner;
  17963. this.transform = this.gameObj.transform;
  17964. }
  17965. get rotX() {
  17966. return this.transform.localRotationEulerX;
  17967. }
  17968. set rotX(v) {
  17969. this.transform.localRotationEulerX = v;
  17970. }
  17971. get rotY() {
  17972. return this.transform.localRotationEulerY;
  17973. }
  17974. set rotY(v) {
  17975. this.transform.localRotationEulerY = v;
  17976. }
  17977. get rotZ() {
  17978. return this.transform.localRotationEulerZ;
  17979. }
  17980. set rotZ(v) {
  17981. this.transform.localRotationEulerZ = v;
  17982. }
  17983. get posX() {
  17984. return this.transform.localPositionX;
  17985. }
  17986. set posX(v) {
  17987. this.transform.localPositionX = v;
  17988. }
  17989. get posY() {
  17990. return this.transform.localPositionY;
  17991. }
  17992. set posY(v) {
  17993. this.transform.localPositionY = v;
  17994. }
  17995. get posZ() {
  17996. return this.transform.localPositionZ;
  17997. }
  17998. set posZ(v) {
  17999. this.transform.localPositionZ = v;
  18000. }
  18001. get rotation() {
  18002. return this.transform.localRotation;
  18003. }
  18004. set rotation(v) {
  18005. this.transform.localRotation = v;
  18006. }
  18007. }
  18008. class D2Hole extends Laya.Script {
  18009. constructor() { super(); }
  18010. onTriggerEnter(collider) {
  18011. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18012. return;
  18013. }
  18014. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18015. if (collider.owner["mySrc"].isRunSkillAni) {
  18016. return;
  18017. }
  18018. if (collider.owner["mySrc"].number != 0) {
  18019. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18020. }
  18021. xGame.common.ballColliHole(collider);
  18022. xGame.common.recoverCameraView();
  18023. }
  18024. }
  18025. }
  18026. class Table extends Laya.Script3D {
  18027. constructor() {
  18028. super();
  18029. this.isSetBorder = false;
  18030. this.inited = false;
  18031. }
  18032. ;
  18033. onAwake() {
  18034. this.init();
  18035. }
  18036. init() {
  18037. if (this.inited)
  18038. return;
  18039. this.inited = true;
  18040. this.gameObj = this.owner;
  18041. this.border = this.gameObj.getChildByName("border");
  18042. }
  18043. setBorderPos() {
  18044. if (this.isSetBorder)
  18045. return;
  18046. this.isSetBorder = true;
  18047. let ui = xGame.common.gameUI.ui;
  18048. let bar1 = this.border.getChildByName("bar1");
  18049. let bar2 = this.border.getChildByName("bar2");
  18050. let bar3 = this.border.getChildByName("bar3");
  18051. let bar4 = this.border.getChildByName("bar4");
  18052. let bar5 = this.border.getChildByName("bar5");
  18053. let bar6 = this.border.getChildByName("bar6");
  18054. this.setInfo(bar1, ui.border.bar1, "box");
  18055. this.setInfo(bar2, ui.border.bar2, "box");
  18056. this.setInfo(bar3, ui.border.bar3, "box");
  18057. this.setInfo(bar4, ui.border.bar4, "box");
  18058. this.setInfo(bar5, ui.border.bar5, "box");
  18059. this.setInfo(bar6, ui.border.bar6, "box");
  18060. let circle1 = this.border.getChildByName("circle1");
  18061. let circle2 = this.border.getChildByName("circle2");
  18062. let circle3 = this.border.getChildByName("circle3");
  18063. let circle4 = this.border.getChildByName("circle4");
  18064. let circle5 = this.border.getChildByName("circle5");
  18065. let circle6 = this.border.getChildByName("circle6");
  18066. this.setInfo(circle1, ui.border.circle1, "circle");
  18067. this.setInfo(circle2, ui.border.circle2, "circle");
  18068. this.setInfo(circle3, ui.border.circle3, "circle");
  18069. this.setInfo(circle4, ui.border.circle4, "circle");
  18070. this.setInfo(circle5, ui.border.circle5, "circle");
  18071. this.setInfo(circle6, ui.border.circle6, "circle");
  18072. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18073. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18074. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18075. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18076. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18077. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18078. let arr = xGame.common.gameMgr.holePosList;
  18079. xGame.common.gameMgr.posObj = {
  18080. "1": arr[0],
  18081. "3": arr[2],
  18082. "4": arr[3],
  18083. "6": arr[5]
  18084. };
  18085. }
  18086. initHolePos(x, y) {
  18087. if (x < 300)
  18088. x += 25;
  18089. else if (x > 1000)
  18090. x -= 25;
  18091. else if (y > 200)
  18092. y -= 10;
  18093. else
  18094. y += 10;
  18095. if (y < 200)
  18096. y += 30;
  18097. else if (y > 500)
  18098. y -= 30;
  18099. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18100. }
  18101. setInfo(d3Obj, d2Obj, type) {
  18102. let ui = xGame.common.gameUI.ui;
  18103. let sprite = new Laya.Sprite();
  18104. ui.border.displayObject.addChild(sprite);
  18105. let colli = xGame.common.getCollider(type);
  18106. sprite.addComponentIntance(colli);
  18107. let rigy = xGame.common.getRigbody();
  18108. rigy.type = "static";
  18109. sprite.addComponentIntance(rigy);
  18110. let d3Pos = d3Obj.transform.position;
  18111. xGame.common.pos3to2Convert(d3Pos);
  18112. let scaleX = d3Obj.transform.localScaleX;
  18113. let scaleZ = d3Obj.transform.localScaleZ;
  18114. let width = xGame.common.scale3to2Convert(scaleZ);
  18115. let height = xGame.common.scale3to2Convert(scaleX);
  18116. sprite.pivotX = width / 2;
  18117. sprite.pivotY = height / 2;
  18118. sprite.x = d3Pos.x;
  18119. sprite.y = d3Pos.y;
  18120. sprite.width = width;
  18121. sprite.height = height;
  18122. d2Obj.x = d3Pos.x;
  18123. d2Obj.y = d3Pos.y;
  18124. d2Obj.width = width;
  18125. d2Obj.height = height;
  18126. if (type == "box") {
  18127. colli.width = width;
  18128. colli.height = height;
  18129. colli.isSensor = false;
  18130. colli.label = "border";
  18131. }
  18132. else {
  18133. colli.radius = width / 2;
  18134. colli.isSensor = true;
  18135. colli.label = "hole";
  18136. sprite.addComponent(D2Hole);
  18137. }
  18138. }
  18139. }
  18140. class D3World extends Laya.Script3D {
  18141. constructor() {
  18142. super();
  18143. this.loadNum = 0;
  18144. this.setLoadNum = 7;
  18145. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18146. }
  18147. onAwake() {
  18148. }
  18149. loadScene() {
  18150. this.scene = this.owner;
  18151. let url = `res/unityRes/root.lh`;
  18152. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18153. this.scene.addChild(prefab);
  18154. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18155. this.putCameraInfo();
  18156. this.camera.enableHDR = false;
  18157. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18158. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18159. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18160. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18161. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18162. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18163. this.knife.active = false;
  18164. this.loadD3Obj();
  18165. }));
  18166. }
  18167. putCameraInfo() {
  18168. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18169. this.cameraObj = new cameraType();
  18170. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18171. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18172. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18173. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18174. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18175. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18176. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18177. this.visitAngleChild.init();
  18178. this.visitRootObj.posX = this.visitAngleChild.posX;
  18179. this.visitRootObj.posY = this.visitAngleChild.posY;
  18180. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18181. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18182. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18183. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18184. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18185. xGame.common.showOneCamera("mainCamera");
  18186. }
  18187. loadD3Obj() {
  18188. this.loadTable();
  18189. this.loadRoom();
  18190. this.loadInHoleParticial();
  18191. this.loadIceParticial();
  18192. this.loadHitParticial();
  18193. this.loadFireworksParticial();
  18194. this.loadBall();
  18195. }
  18196. loadInHoleParticial() {
  18197. this.loadD3Res("inHoleEft", "", (prefab) => {
  18198. prefab.addComponent(Partical);
  18199. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18200. });
  18201. }
  18202. loadIceParticial() {
  18203. this.loadD3Res("iceEft", "", (prefab) => {
  18204. prefab.addComponent(Partical);
  18205. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18206. });
  18207. }
  18208. loadHitParticial() {
  18209. this.loadD3Res("hitEft", "", (prefab) => {
  18210. prefab.addComponent(Partical);
  18211. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18212. });
  18213. }
  18214. loadFireworksParticial() {
  18215. this.loadD3Res("fireworksEft", "", (prefab) => {
  18216. prefab.addComponent(Partical);
  18217. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18218. });
  18219. }
  18220. loadBall(index = 1) {
  18221. this.loadD3Res("ball", index, (prefab) => {
  18222. this.ballPrefab = prefab;
  18223. this.ballPrefab.addComponent(Ball);
  18224. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18225. });
  18226. }
  18227. loadTable(index = 1) {
  18228. this.loadD3Res("table", index, (prefab) => {
  18229. this.tableSrc = prefab.addComponent(Table);
  18230. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18231. this.d3Hand.init();
  18232. this.tableRoot.addChild(prefab);
  18233. });
  18234. }
  18235. loadRoom(index = 1) {
  18236. this.loadD3Res("room", index, (prefab) => {
  18237. this.roomRoot.addChild(prefab);
  18238. });
  18239. }
  18240. loadD3Res(type, index, callback) {
  18241. let url = `res/unityRes/${type}${index}.lh`;
  18242. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18243. callback && callback(prefab);
  18244. this.checkResLoad();
  18245. }));
  18246. }
  18247. checkResLoad() {
  18248. this.loadNum++;
  18249. if (this.loadNum >= this.setLoadNum) {
  18250. xGame.eventMgr.event(D3RES_LOADED);
  18251. }
  18252. }
  18253. prePlayEft() {
  18254. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18255. eft.transform.localPositionX = 0;
  18256. eft.transform.localPositionY = -5;
  18257. eft.transform.localPositionZ = 0;
  18258. eft.active = true;
  18259. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18260. ice.transform.localPositionX = 0;
  18261. ice.transform.localPositionY = -5;
  18262. ice.transform.localPositionZ = 0;
  18263. ice.active = true;
  18264. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18265. hit.transform.localPositionX = 0;
  18266. hit.transform.localPositionY = -5;
  18267. hit.transform.localPositionZ = 0;
  18268. hit.active = true;
  18269. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18270. fireworks.transform.localPositionX = 0;
  18271. fireworks.transform.localPositionY = -5;
  18272. fireworks.transform.localPositionZ = 0;
  18273. fireworks.active = true;
  18274. }
  18275. }
  18276. class cameraType {
  18277. }
  18278. class MoyuMgr$1 {
  18279. static initMoyu() {
  18280. this.moyuView = new MoyuView$1();
  18281. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18282. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18283. this.moyuView.ui.displayObject.zOrder = 1000;
  18284. this.moyuView.init();
  18285. this.moyuView.showTip(true);
  18286. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18287. window['XApk'] = this;
  18288. }
  18289. static showAge(show) {
  18290. if (this.moyuView)
  18291. this.moyuView.showAge(show);
  18292. }
  18293. static onPlatMsg(idx) {
  18294. if (!MoyuMgr$1.moyuView)
  18295. return;
  18296. if (idx == '0') {
  18297. MoyuMgr$1.moyuView.showTip(false);
  18298. }
  18299. }
  18300. static showAgree(call) {
  18301. if (this.moyuView)
  18302. this.moyuView.showAgree(call);
  18303. else
  18304. call && call();
  18305. }
  18306. static showXy(type = 1) {
  18307. if (this.moyuView)
  18308. this.moyuView.showXy(type);
  18309. }
  18310. }
  18311. MoyuMgr$1.isAdvise = false;
  18312. class MoyuView$1 {
  18313. constructor() {
  18314. this.ysxyNum = 1;
  18315. this.ysJson = null;
  18316. this.ui = ui_UIMoyu.createInstance();
  18317. }
  18318. init() {
  18319. this.ui.mainBg.visible = false;
  18320. this.ui.xyNode.visible = false;
  18321. this.ui.ageNode.visible = false;
  18322. this.ui.tipNode.visible = false;
  18323. this.ui.rnNode.visible = false;
  18324. this.ui.fcmNode.visible = false;
  18325. this.ui.ageTip.visible = false;
  18326. this.ui.msgNode.visible = false;
  18327. this.ui.visible = false;
  18328. this.ui.xyNode.xyList.setVirtual();
  18329. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18330. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18331. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18332. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18333. this.ui.xyNode.btnKnown.visible = false;
  18334. this.ui.xyNode.xy1.visible = false;
  18335. this.ui.xyNode.xy2.visible = false;
  18336. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18337. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18338. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18339. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18340. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18341. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18342. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18343. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18344. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18345. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18346. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18347. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18348. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18349. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18350. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18351. this.ysxyNum = 2;
  18352. }
  18353. }
  18354. onClick(obj) {
  18355. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18356. switch (obj) {
  18357. case this.ui.ageTip:
  18358. if (Moyu.isTTApk) {
  18359. this.ui.ageNode.visible = true;
  18360. this.ui.mainBg.visible = true;
  18361. }
  18362. break;
  18363. case this.ui.tipNode:
  18364. this.showTip(false);
  18365. break;
  18366. case this.ui.ageNode.btnAge:
  18367. this.ui.ageNode.visible = false;
  18368. this.ui.mainBg.visible = false;
  18369. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18370. this.ui.visible = false;
  18371. break;
  18372. case this.ui.xyNode.btnXy3:
  18373. case this.ui.xyNode.btnXy1:
  18374. this.loadXy(1);
  18375. break;
  18376. case this.ui.xyNode.btnXy2:
  18377. this.loadXy(2);
  18378. break;
  18379. case this.ui.xyNode.btnBack:
  18380. this.ui.xyNode.xy1.visible = true;
  18381. this.ui.xyNode.xy2.visible = false;
  18382. break;
  18383. case this.ui.xyNode.btnKnown:
  18384. this.ui.xyNode.visible = false;
  18385. this.ui.mainBg.visible = false;
  18386. this.ui.visible = false;
  18387. break;
  18388. case this.ui.rnNode.btnCheck:
  18389. this.check();
  18390. break;
  18391. case this.ui.rnNode.btnExit:
  18392. case this.ui.xyNode.btnNo:
  18393. this.ysxyNum--;
  18394. if (this.ysxyNum > 0)
  18395. this.showMsg("Refuse to quit the game once again");
  18396. else {
  18397. Moyu.userAgree(false);
  18398. Moyu.exit();
  18399. }
  18400. break;
  18401. case this.ui.xyNode.btnSure:
  18402. case this.ui.xyNode.btnYes:
  18403. DataMgr.userData.isAgree = true;
  18404. DataMgr.saveUserData();
  18405. this.onAgree();
  18406. break;
  18407. case this.ui.rnNode.btnDone:
  18408. this.ui.rnNode.visible = false;
  18409. this.ui.visible = false;
  18410. break;
  18411. case this.ui.fcmNode.btnRn:
  18412. this.showRn();
  18413. break;
  18414. }
  18415. }
  18416. showTip(show) {
  18417. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18418. return;
  18419. if (show) {
  18420. MoyuMgr$1.isAdvise = true;
  18421. this.ui.visible = true;
  18422. this.ui.tipNode.visible = true;
  18423. this.ui.tipNode.alpha = 1;
  18424. Laya.timer.once(1000, this, this.showTip, [false]);
  18425. }
  18426. else {
  18427. this.ui.tipNode.alpha = 1;
  18428. this.ui.tipNode.visible = true;
  18429. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18430. this.ui.tipNode.visible = false;
  18431. MoyuMgr$1.isAdvise = false;
  18432. }), 1000);
  18433. }
  18434. }
  18435. showAge(show, px = 0, py = 0) {
  18436. if (Moyu.platType > 10 && !Moyu.isIos) {
  18437. this.ui.ageTip.x = px;
  18438. this.ui.ageTip.y = py;
  18439. this.ui.ageTip.visible = show;
  18440. if (show)
  18441. this.ui.visible = true;
  18442. }
  18443. }
  18444. showAgree(call) {
  18445. this.agreeCall = call;
  18446. this.onAgree();
  18447. return;
  18448. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18449. this.showXy(0);
  18450. }
  18451. else
  18452. this.onAgree();
  18453. }
  18454. onAgree() {
  18455. if (!this.ui.ageNode.visible)
  18456. this.ui.visible = false;
  18457. this.ui.xyNode.visible = false;
  18458. Moyu.userAgree(true);
  18459. this.showAge(false);
  18460. this.agreeCall && this.agreeCall();
  18461. this.showRn();
  18462. }
  18463. showMsg(txt) {
  18464. this.ui.msgNode.txtMsg.text = txt;
  18465. this.ui.msgNode.visible = true;
  18466. this.ui.msgNode.alpha = 1;
  18467. this.ui.visible = true;
  18468. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18469. this.ui.msgNode.visible = false;
  18470. }), 2500, true);
  18471. }
  18472. showRn() {
  18473. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18474. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18475. this.ui.rnNode.rn1.visible = true;
  18476. this.ui.rnNode.rn2.visible = false;
  18477. this.ui.rnNode.rn3.visible = false;
  18478. this.ui.rnNode.rn4.visible = false;
  18479. this.ui.rnNode.visible = true;
  18480. this.ui.mainBg.visible = true;
  18481. this.ui.rnNode.btnDone.visible = false;
  18482. this.ui.rnNode.btnExit.visible = true;
  18483. this.ui.rnNode.btnCheck.visible = true;
  18484. this.ui.fcmNode.visible = false;
  18485. this.ui.visible = true;
  18486. return;
  18487. }
  18488. }
  18489. this.showFcm();
  18490. }
  18491. showFcm() {
  18492. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18493. Moyu.initFCM(true);
  18494. if (Moyu.gameTime < 1)
  18495. this.fcmLoop();
  18496. else if (Moyu.gameTime < 999)
  18497. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  18498. }
  18499. }
  18500. fcmLoop() {
  18501. if (Moyu.gameTime < 1) {
  18502. this.ui.rnNode.visible = false;
  18503. this.ui.fcmNode.visible = true;
  18504. this.ui.mainBg.visible = true;
  18505. this.ui.visible = true;
  18506. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  18507. Laya.timer.clear(this.ui, this.fcmLoop);
  18508. }
  18509. }
  18510. check() {
  18511. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  18512. this.ui.rnNode.rn1.visible = false;
  18513. this.ui.rnNode.rn2.visible = false;
  18514. this.ui.rnNode.rn4.visible = true;
  18515. }
  18516. else if (this.ui.rnNode.rn4.visible) {
  18517. let name = this.ui.rnNode.inputName.text;
  18518. let code = this.ui.rnNode.inputCode.text;
  18519. if (code && code.length == 18) {
  18520. this.ui.rnNode.rn1.visible = false;
  18521. this.ui.rnNode.rn4.visible = false;
  18522. Moyu.authenticate(name, code, (res) => {
  18523. this.ui.rnNode.rn2.visible = !res;
  18524. this.ui.rnNode.rn3.visible = res;
  18525. this.ui.rnNode.btnDone.visible = res;
  18526. this.ui.rnNode.btnExit.visible = !res;
  18527. this.ui.rnNode.btnCheck.visible = !res;
  18528. if (res)
  18529. this.showFcm();
  18530. });
  18531. }
  18532. else
  18533. this.showMsg("信息填写不完整");
  18534. }
  18535. }
  18536. loadXy(type = 0) {
  18537. this.ui.xyNode.xy1.visible = false;
  18538. this.ui.xyNode.xy2.visible = true;
  18539. this.ui.xyNode.xyList.scrollToView(0);
  18540. if (type == 1) {
  18541. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  18542. }
  18543. else if (type == 2) {
  18544. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  18545. }
  18546. }
  18547. showXy(type = 0) {
  18548. this.xyBtn();
  18549. if (type == 0) {
  18550. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  18551. this.ui.xyNode.btnSure.visible = true;
  18552. }
  18553. else {
  18554. this.ui.xyNode.btnYes.visible = true;
  18555. this.ui.xyNode.btnNo.visible = true;
  18556. }
  18557. }
  18558. else {
  18559. this.ui.xyNode.btnKnown.visible = true;
  18560. this.ui.mainBg.visible = true;
  18561. }
  18562. this.ui.xyNode.xy1.visible = true;
  18563. this.ui.xyNode.xy2.visible = false;
  18564. this.ui.xyNode.visible = true;
  18565. this.ui.visible = true;
  18566. }
  18567. xyBtn() {
  18568. this.ui.xyNode.btnSure.visible = false;
  18569. this.ui.xyNode.btnYes.visible = false;
  18570. this.ui.xyNode.btnNo.visible = false;
  18571. this.ui.xyNode.btnKnown.visible = false;
  18572. {
  18573. this.ui.xyNode.btnXy3.visible = false;
  18574. this.ui.xyNode.btnXy2.visible = true;
  18575. this.ui.xyNode.btnXy1.visible = true;
  18576. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  18577. }
  18578. }
  18579. createXY(json) {
  18580. this.ysJson = json.content;
  18581. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  18582. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  18583. this.ui.xyNode.xy2.visible = true;
  18584. }
  18585. renderListItem(idx, cell) {
  18586. let xy = this.ysJson[idx];
  18587. cell.height = xy.line * 30;
  18588. cell.xyItem.text = xy.text;
  18589. }
  18590. onDestroy() {
  18591. this.agreeCall = null;
  18592. }
  18593. }
  18594. class UILoading extends UIBase {
  18595. constructor() {
  18596. super();
  18597. this.accTime = 0;
  18598. this.curNum = 0;
  18599. this.rate = 1;
  18600. this.loadSubOk = false;
  18601. this.loadResOK = false;
  18602. this.openLoading = true;
  18603. this.beginLoadRes = false;
  18604. this.finishD2 = false;
  18605. this.finishD3 = false;
  18606. }
  18607. onConstructor() {
  18608. this.ui = ui_UILoading.createInstance();
  18609. this.contentPane = this.ui;
  18610. this.isEject = false;
  18611. this._initUI();
  18612. this._addEvent();
  18613. }
  18614. _initUI() {
  18615. MoyuMgr$1.initMoyu();
  18616. }
  18617. _addEvent() {
  18618. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  18619. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  18620. }
  18621. show() {
  18622. super.show();
  18623. console.log('zh:加载分包资源');
  18624. loadSubRes(this.subResProgress.bind(this));
  18625. this.ui.txtLoad.text = "Loading...";
  18626. }
  18627. subResProgress(pro, finish) {
  18628. this.curNum = pro;
  18629. if (finish) {
  18630. this.curNum = 1;
  18631. this.loadSubOk = true;
  18632. }
  18633. }
  18634. laodD3Res() {
  18635. let scene3D = new Laya.Scene3D();
  18636. xGame.common.d3Scene = scene3D;
  18637. xGame.common.d3World = scene3D.addComponent(D3World);
  18638. xGame.common.d3World.loadScene();
  18639. }
  18640. loadD2Res() {
  18641. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  18642. this.finishD2 = true;
  18643. this.checkLoadAll();
  18644. this.curNum = 1;
  18645. }), Laya.Handler.create(this, (pro) => {
  18646. this.curNum = pro;
  18647. }, null, false));
  18648. }
  18649. d3ResFinish() {
  18650. this.finishD3 = true;
  18651. this.checkLoadAll();
  18652. }
  18653. checkLoadAll() {
  18654. if (this.finishD2 && this.finishD3) {
  18655. this.loadResOK = true;
  18656. }
  18657. }
  18658. loadRes() {
  18659. this.laodD3Res();
  18660. this.loadD2Res();
  18661. }
  18662. myUpdate(dt) {
  18663. if (!this.openLoading)
  18664. return;
  18665. this.accTime += dt * this.rate;
  18666. if (this.accTime >= this.curNum)
  18667. this.accTime = this.curNum;
  18668. this.ui.loadinfo.value = this.accTime * 100;
  18669. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  18670. if (!this.beginLoadRes) {
  18671. this.beginLoadRes = true;
  18672. this.ui.txtLoad.text = "Loading...";
  18673. this.curNum = 0;
  18674. this.accTime = 0;
  18675. this.loadRes();
  18676. }
  18677. if (this.loadResOK) {
  18678. this.openLoading = false;
  18679. Laya.timer.once(300, this, () => {
  18680. xGame.common.d3Scene.active = false;
  18681. MoyuMgr$1.showAgree(enterGame);
  18682. });
  18683. }
  18684. }
  18685. }
  18686. release() {
  18687. }
  18688. hide() {
  18689. super.hide();
  18690. this.release();
  18691. }
  18692. onClose() {
  18693. this.hide();
  18694. }
  18695. }
  18696. UILoading.uiName = "UILoading";
  18697. class UIRepentProp$1 extends UIBase {
  18698. constructor() {
  18699. super();
  18700. this.viewType = 0;
  18701. this.regretType = 0;
  18702. }
  18703. onConstructor() {
  18704. this.ui = ui_UIRepentProp.createInstance();
  18705. this.contentPane = this.ui;
  18706. this.isEject = false;
  18707. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  18708. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  18709. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  18710. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  18711. }
  18712. show(viewType, regretType, callback) {
  18713. PlatMgr.showInsert(true);
  18714. this.viewType = viewType;
  18715. this.regretType = regretType;
  18716. this.callback = callback;
  18717. super.show();
  18718. this.ui.t0.play();
  18719. this.ui.c1.selectedIndex = this.viewType;
  18720. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  18721. if (this.viewType == 0) {
  18722. let guide = DataMgr.getGuideHelpLine();
  18723. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  18724. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  18725. }
  18726. xGame.common.gameMgr.gamePause = true;
  18727. }
  18728. hideSelf() {
  18729. xGame.common.gameMgr.gamePause = false;
  18730. this.callback && this.callback(false);
  18731. this.hide();
  18732. }
  18733. videoRegret() {
  18734. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  18735. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  18736. }
  18737. else {
  18738. console.log('zh:AD 失败,直接发放奖励');
  18739. this.qjff_AD_for_UIrepentProp_videoRegret();
  18740. }
  18741. }
  18742. qjff_AD_for_UIrepentProp_videoRegret() {
  18743. this.callback && this.callback(true);
  18744. this.hideSelf();
  18745. }
  18746. videoAddHelpLine() {
  18747. let guide = DataMgr.getGuideHelpLine();
  18748. if (guide == 0) {
  18749. this.callback && this.callback(true);
  18750. this.hideSelf();
  18751. DataMgr.setGuideHelpLine();
  18752. xGame.common.gameUI.ui.guideNode.visible = false;
  18753. }
  18754. else {
  18755. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  18756. if (Laya.Browser.onAndroid) {
  18757. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  18758. if (!boo) {
  18759. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  18760. return;
  18761. }
  18762. }
  18763. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  18764. }
  18765. else {
  18766. console.log('zh:AD 失败,直接发放奖励');
  18767. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  18768. }
  18769. }
  18770. }
  18771. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  18772. this.callback && this.callback(true);
  18773. this.hideSelf();
  18774. }
  18775. }
  18776. UIRepentProp$1.uiName = "UIRepentProp";
  18777. class UIRodMethod$1 extends UIBase {
  18778. constructor() {
  18779. super();
  18780. this.isPressd = false;
  18781. }
  18782. onConstructor() {
  18783. this.ui = ui_UIRodMethod.createInstance();
  18784. this.contentPane = this.ui;
  18785. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  18786. this.moveDir = new Laya.Vector2();
  18787. this.moveDest = new Laya.Vector2();
  18788. this.centerPos = new Laya.Vector2();
  18789. xGame.common.uiRodMethod = this;
  18790. }
  18791. show() {
  18792. super.show();
  18793. xGame.common.gameMgr.gamePause = true;
  18794. this.openPressDotEvent();
  18795. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  18796. this.centerPos.x = this.ui.white.x;
  18797. this.centerPos.y = this.ui.white.y;
  18798. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  18799. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  18800. this.setDot();
  18801. }
  18802. setDot() {
  18803. this.ui.dot.x = this.moveDest.x;
  18804. this.ui.dot.y = this.moveDest.y;
  18805. }
  18806. closeSelf() {
  18807. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  18808. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  18809. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  18810. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  18811. xGame.common.gameMgr.gamePause = false;
  18812. this.hide();
  18813. }
  18814. openPressDotEvent() {
  18815. this.closePressDotEvent();
  18816. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18817. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18818. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18819. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18820. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  18821. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18822. }
  18823. closePressDotEvent() {
  18824. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18825. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  18826. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18827. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18828. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  18829. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  18830. }
  18831. onDown(e) {
  18832. if (e.type == Laya.Event.MOUSE_DOWN)
  18833. this.isPressd = true;
  18834. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  18835. this.isPressd = false;
  18836. if (!this.isPressd)
  18837. return;
  18838. this.moveDest.x = e.stageX;
  18839. this.moveDest.y = e.stageY;
  18840. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  18841. if (dis > 6724) {
  18842. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  18843. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  18844. }
  18845. this.setDot();
  18846. }
  18847. resetRod() {
  18848. this.ui.dot.x = this.ui.white.x;
  18849. this.ui.dot.y = this.ui.white.y;
  18850. this.gameRod.dot.x = this.gameRod.bg.x;
  18851. this.gameRod.dot.y = this.gameRod.bg.y;
  18852. xGame.common.rodOffest.x = 0;
  18853. xGame.common.rodOffest.y = 0;
  18854. }
  18855. }
  18856. UIRodMethod$1.uiName = "UIRodMethod";
  18857. class UIMsg$1 extends UIBase {
  18858. constructor() {
  18859. super();
  18860. }
  18861. onConstructor() {
  18862. this.ui = ui_UIMsg.createInstance();
  18863. this.contentPane = this.ui;
  18864. this.isEject = false;
  18865. this.isMuti = true;
  18866. }
  18867. show(msg, callback) {
  18868. super.show();
  18869. this.ui.tipsNode.msgTxt.text = msg;
  18870. this.ui.alpha = 1;
  18871. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  18872. this.hide();
  18873. callback && callback();
  18874. }), 1000);
  18875. }
  18876. }
  18877. UIMsg$1.uiName = "UIMsg";
  18878. class UITips$1 extends UIBase {
  18879. constructor() {
  18880. super();
  18881. this.type = 0;
  18882. }
  18883. onConstructor() {
  18884. this.ui = ui_UITips.createInstance();
  18885. this.contentPane = this.ui;
  18886. this.isEject = false;
  18887. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  18888. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  18889. }
  18890. show(tipsTxt, womanTxt, type) {
  18891. super.show();
  18892. this.ui.t0.play();
  18893. this.ui.myNode.tipsTxt.text = tipsTxt;
  18894. this.ui.myNode.womanTxt.text = womanTxt;
  18895. PlatMgr.showInsert(true);
  18896. this.ui.myNode.c1.selectedIndex = type;
  18897. this.type = type;
  18898. switch (this.type) {
  18899. case TipsType.exitGame:
  18900. xGame.common.gameMgr.gamePause = true;
  18901. break;
  18902. case TipsType.foul:
  18903. Laya.timer.once(200, this, () => {
  18904. xGame.common.gameMgr.gamePause = true;
  18905. });
  18906. break;
  18907. default:
  18908. break;
  18909. }
  18910. }
  18911. clickLeftBtn() {
  18912. this.hide();
  18913. xGame.common.gameMgr.gamePause = false;
  18914. switch (this.type) {
  18915. case TipsType.exitGame:
  18916. break;
  18917. case TipsType.foul:
  18918. break;
  18919. default:
  18920. break;
  18921. }
  18922. }
  18923. clickRightBtn() {
  18924. this.hide();
  18925. switch (this.type) {
  18926. case TipsType.exitGame:
  18927. xGame.eventMgr.event(RESET_GAME);
  18928. xGame.uiMgr.Show(UIMain$1);
  18929. Moyu.recordEnd(this, null);
  18930. xGame.common.longHelpLine = false;
  18931. break;
  18932. case TipsType.foul:
  18933. xGame.common.gameMgr.gamePause = false;
  18934. Laya.timer.clearAll(this);
  18935. break;
  18936. default:
  18937. break;
  18938. }
  18939. }
  18940. }
  18941. UITips$1.uiName = "UITips";
  18942. class UIGame$1 extends UIBase {
  18943. constructor() {
  18944. super();
  18945. this.powerNum = 0;
  18946. this.isD3Inited = false;
  18947. this.isPrePlay = false;
  18948. this.isMoveRod = false;
  18949. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  18950. this.rulerDis = 20;
  18951. this.rulerOffset = 0;
  18952. }
  18953. onConstructor() {
  18954. this.ui = ui_UIGame.createInstance();
  18955. this.contentPane = this.ui;
  18956. this.ui.x += xGame.common.sysOffestNum;
  18957. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  18958. this.isEject = false;
  18959. xGame.common.gameUI = this;
  18960. this.initSelf();
  18961. }
  18962. isTurnSelf() {
  18963. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  18964. return true;
  18965. }
  18966. }
  18967. initSelf() {
  18968. let topUI = this.ui.topNode;
  18969. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  18970. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  18971. this.barInfo = {};
  18972. this.barInfo.curY = 0;
  18973. this.barInfo.height = this.ui.powerNode.height;
  18974. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  18975. this.barInfo.powerStartY = this.ui.powerNode.y;
  18976. xGame.common.aiPlayer = new AIPlayer();
  18977. xGame.common.gameMgr = new GameMgr();
  18978. xGame.common.skillMgr = new SkillMgr();
  18979. xGame.common.wordsMgr = new WordsMgr();
  18980. xGame.common.talkMgr = new TalkMgr();
  18981. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  18982. console.log("加载经典模式表情文件chenggon !");
  18983. });
  18984. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  18985. console.log("挑战模式奖励模式spine加载成功!");
  18986. });
  18987. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  18988. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  18989. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  18990. this.addUIClick(this.ui.returnBtn, this.returnHome);
  18991. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  18992. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  18993. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  18994. }
  18995. getGanZiImg() {
  18996. let index = DataMgr.getCurBallRod();
  18997. let data = cfgTable.ballrodData[index + 1];
  18998. let gan_url = xGame.common.getGameIconUrl(data.img);
  18999. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19000. this.ui.powerNode.showImg.url = gan_url;
  19001. console.log('zh:修改杆子图标O K');
  19002. }
  19003. returnHome() {
  19004. let tips = "Are you sure to exit the game?";
  19005. let woman = "Boss, why don't you play for a while longer?";
  19006. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19007. }
  19008. addRodMethodClick() {
  19009. if (this.isTurnSelf()) {
  19010. xGame.uiMgr.Show(UIRodMethod$1);
  19011. }
  19012. }
  19013. clickHelpLineBtn(force = false) {
  19014. if (!this.isTurnSelf())
  19015. return;
  19016. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19017. if (success) {
  19018. xGame.common.longHelpLine = true;
  19019. xGame.common.d2World.getHelpLine();
  19020. Moyu.sendDataEvent("guideNum");
  19021. }
  19022. else {
  19023. }
  19024. });
  19025. }
  19026. renderSelfDisplayBalls(index, target) {
  19027. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19028. target.myImg.url = xGame.common.getGameIconUrl(str);
  19029. }
  19030. renderAIDisplayBalls(index, target) {
  19031. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19032. target.myImg.url = xGame.common.getGameIconUrl(str);
  19033. ;
  19034. }
  19035. updateMode() {
  19036. if (xGame.common.gameMode == GameMode.classic) {
  19037. this.ui.topNode.scoreNode.visible = false;
  19038. }
  19039. else if (xGame.common.gameMode == GameMode.bigMove) {
  19040. this.ui.topNode.scoreNode.visible = true;
  19041. }
  19042. }
  19043. show() {
  19044. super.show();
  19045. console.log("zh:uigame show AADD");
  19046. this.ui.alpha = 0;
  19047. this.updateSelf();
  19048. xGame.common.gameMgr.gamePause = false;
  19049. xGame.common.gameUI.ui.blackAni.visible = false;
  19050. xGame.common.gameUI.ui.whiteAni.visible = false;
  19051. this.ui.powerEft.visible = false;
  19052. this.ui.colorNode.visible = false;
  19053. this.updateHead();
  19054. let curUse = DataMgr.getCurBallRod();
  19055. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19056. this.getGanZiImg();
  19057. }
  19058. updateSelf() {
  19059. if (xGame.common.gameMode == GameMode.classic) {
  19060. this.ui.c1.selectedIndex = 0;
  19061. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19062. this.ui.topNode.middleNode.visible = true;
  19063. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19064. }
  19065. else if (xGame.common.gameMode == GameMode.bigMove) {
  19066. this.ui.c1.selectedIndex = 0;
  19067. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19068. this.ui.topNode.middleNode.visible = false;
  19069. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19070. let rand = xGame.common.randomNum(1, max);
  19071. let guide = DataMgr.getSkillGuide();
  19072. if (guide == 0)
  19073. rand = 1;
  19074. xGame.common.bigMoveLevelIndex = rand;
  19075. }
  19076. else if (xGame.common.gameMode == GameMode.placeBall) {
  19077. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19078. this.ui.c1.selectedIndex = 1 + data.type;
  19079. this.ui.alpha = 1;
  19080. this.startGame();
  19081. }
  19082. this.updateMode();
  19083. this.initD3world();
  19084. this.initD2world();
  19085. }
  19086. startGame() {
  19087. this.ui.snowNode.visible = Math.random() <= 0.1;
  19088. this.ui.d2Node.visible = false;
  19089. xGame.common.d3World.d3Hand.gameObj.active = false;
  19090. xGame.common.d3World.tableSrc.init();
  19091. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19092. this.cameraViewChange(() => {
  19093. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19094. switch (xGame.common.gameMode) {
  19095. case GameMode.classic:
  19096. xGame.common.d3World.d3Hand.gameObj.active = true;
  19097. this.playPutBallD3Ani();
  19098. break;
  19099. case GameMode.bigMove:
  19100. this.enterGame();
  19101. Laya.timer.once(500, this, () => {
  19102. this.ui.topNode.middleNode.visible = true;
  19103. this.ui.topNode.middleNode.t0.play();
  19104. });
  19105. break;
  19106. case GameMode.placeBall:
  19107. this.enterGame();
  19108. break;
  19109. default:
  19110. break;
  19111. }
  19112. });
  19113. PlatMgr.showBanner(false);
  19114. }
  19115. enterGame() {
  19116. this.ui.d2Node.visible = true;
  19117. xGame.common.d3World.d3Hand.gameObj.active = false;
  19118. xGame.common.showOneCamera("mainCamera");
  19119. Moyu.recordGame(30, true);
  19120. if (!this.isPrePlay) {
  19121. this.isPrePlay = true;
  19122. xGame.common.d3World.prePlayEft();
  19123. }
  19124. xGame.common.gameMgr.gameReady();
  19125. this.openAllEvent();
  19126. this.ui.snowNode.visible = false;
  19127. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19128. this.ui.helpBtn.visible = condition;
  19129. }
  19130. showHelpLineGuide() {
  19131. let longGuide = DataMgr.getGuideHelpLine();
  19132. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19133. this.ui.helpBtn.visible = true;
  19134. this.ui.guideNode.visible = true;
  19135. }
  19136. }
  19137. setTurnAlpha(alpha) {
  19138. this.ui.keduNode.alpha = alpha;
  19139. this.ui.ganNode.alpha = alpha;
  19140. this.ui.rodMethodNode.alpha = alpha;
  19141. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19142. }
  19143. cameraViewChange(callback) {
  19144. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19145. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19146. xGame.common.showOneCamera("visitAngle");
  19147. cameraSrc.localRotationEulerY = 180;
  19148. cameraSrc.localRotationEulerZ = 0;
  19149. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19150. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19151. callback && callback();
  19152. }));
  19153. }));
  19154. }
  19155. playPutBallD3Ani() {
  19156. xGame.common.showOneCamera("mainCamera");
  19157. let handSrc = xGame.common.d3World.d3Hand;
  19158. handSrc.gameObj.active = true;
  19159. handSrc.transform.localPositionZ = 3;
  19160. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19161. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19162. handSrc.gameObj.active = false;
  19163. this.enterGame();
  19164. }), 400);
  19165. }));
  19166. }
  19167. updateHead() {
  19168. let user = Moyu.getUserInfo();
  19169. this.ui.topNode.selfNameTxt.text = user.nickName;
  19170. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19171. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19172. if (DataMgr.getSkillGuide() < 1) {
  19173. this.ui.topNode.aiNameTxt.text = 'billiards';
  19174. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19175. }
  19176. else {
  19177. this.ui.topNode.aiNameTxt.text = aiData.name;
  19178. let randNo = Math.floor(Math.random() * 10) + 1;
  19179. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19180. }
  19181. }
  19182. initD2world() {
  19183. let node = this.ui.d2Root.displayObject;
  19184. let src = node.getComponent(D2World);
  19185. if (!src) {
  19186. xGame.common.d2World = node.addComponent(D2World);
  19187. }
  19188. xGame.common.d2World.initSelf();
  19189. }
  19190. initD3world() {
  19191. if (this.isD3Inited)
  19192. return;
  19193. this.isD3Inited = true;
  19194. let scene3D = xGame.common.d3Scene;
  19195. this.ui.d3Root.displayObject.addChild(scene3D);
  19196. scene3D.active = true;
  19197. xGame.common.d3World.tableSrc.setBorderPos();
  19198. }
  19199. onRootMove(e) {
  19200. let rootBall = xGame.common.d2World.rootBall;
  19201. this.ui.moveNode.x = e.x;
  19202. this.ui.moveNode.y = e.y;
  19203. rootBall.gameObj.x = e.x;
  19204. rootBall.gameObj.y = e.y;
  19205. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19206. }
  19207. aiRootMove(move) {
  19208. if (move)
  19209. this.hideBallUI();
  19210. else {
  19211. this.showBallUI();
  19212. xGame.common.d2World.getHelpLine();
  19213. }
  19214. }
  19215. aiForce(type, force = 0) {
  19216. this.pressTarget = PressType.powerNode;
  19217. if (type == 1)
  19218. this.onEventUp({ force: true });
  19219. else if (type == 2)
  19220. this.onEventMove({ stageY: force, force: true });
  19221. }
  19222. onEventPress(e) {
  19223. if (e.stopPropagation)
  19224. e.stopPropagation();
  19225. if (!this.isTurnSelf())
  19226. return;
  19227. let target = e.target;
  19228. switch (target) {
  19229. case this.ui.myPowerNode.displayObject:
  19230. this.pressTarget = PressType.powerNode;
  19231. this.barInfo.curY = e.stageY;
  19232. this.updateBarInfo();
  19233. break;
  19234. case this.ui.moveNode.displayObject:
  19235. this.pressTarget = PressType.moveNode;
  19236. this.hideBallUI();
  19237. this.eventObj.curX = this.ui.moveNode.x;
  19238. this.eventObj.curY = this.ui.moveNode.y;
  19239. this.ui.moveNode.finger.visible = false;
  19240. this.eventObj.lastX = e.stageX;
  19241. this.eventObj.lastY = e.stageY;
  19242. break;
  19243. case this.ui.rulerClickNode.displayObject:
  19244. this.pressTarget = PressType.rulerNode;
  19245. this.eventObj.lastY = e.stageY;
  19246. break;
  19247. case this.ui.d2Root.displayObject:
  19248. this.pressTarget = PressType.d2Root;
  19249. this.eventObj.lastX = e.stageX;
  19250. this.eventObj.lastY = e.stageY;
  19251. this.eventObj.starX = e.stageX;
  19252. this.eventObj.starY = e.stageY;
  19253. this.eventObj.curX = 0;
  19254. this.eventObj.curY = 0;
  19255. xGame.common.d2World.d2Gan.setGanLastInfo();
  19256. this.rulerOffset = 0;
  19257. break;
  19258. default:
  19259. break;
  19260. }
  19261. }
  19262. onEventMove(e) {
  19263. if (e.stopPropagation)
  19264. e.stopPropagation();
  19265. if (e && e.force) {
  19266. }
  19267. else {
  19268. if (!this.isTurnSelf())
  19269. return;
  19270. }
  19271. switch (this.pressTarget) {
  19272. case PressType.powerNode:
  19273. this.barInfo.curY = e.stageY;
  19274. this.updateBarInfo();
  19275. this.isMoveRod = true;
  19276. break;
  19277. case PressType.moveNode:
  19278. let rootBall = xGame.common.d2World.rootBall;
  19279. let radius = rootBall.gameObj.width / 2;
  19280. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19281. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19282. let border = xGame.common.d2World.borderRect;
  19283. if (curX <= border.x + radius)
  19284. curX = border.x + radius;
  19285. else if (curX >= border.x + border.width - radius)
  19286. curX = border.x + border.width - radius;
  19287. if (curY <= border.y + radius)
  19288. curY = border.y + radius;
  19289. else if (curY >= border.y + border.height - radius)
  19290. curY = border.y + border.height - radius;
  19291. if (xGame.common.gameMgr.isOpenBall) {
  19292. if (curX >= border.x + border.openBallW - radius)
  19293. curX = border.x + border.openBallW - radius;
  19294. }
  19295. this.ui.moveNode.x = curX;
  19296. this.ui.moveNode.y = curY;
  19297. rootBall.gameObj.x = curX;
  19298. rootBall.gameObj.y = curY;
  19299. rootBall.d3BallSrc.setTransPos(curX, curY);
  19300. this.isMoveRod = true;
  19301. break;
  19302. case PressType.rulerNode:
  19303. let yy = e.stageY - this.eventObj.lastY;
  19304. this.eventObj.lastY = e.stageY;
  19305. let ruler1 = this.ui.rulerNode.img1;
  19306. let ruler2 = this.ui.rulerNode.img2;
  19307. ruler1.y += yy;
  19308. ruler2.y += yy;
  19309. this.rulerOffset += yy;
  19310. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19311. this.rulerOffset = 0;
  19312. xGame.soundMgr.playSound("inch", 1, 10);
  19313. }
  19314. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19315. let h = ruler1.height;
  19316. this.checkGuide();
  19317. this.isMoveRod = true;
  19318. if (ruler1.y >= h) {
  19319. ruler1.y = -h;
  19320. ruler2.y = 0;
  19321. return;
  19322. }
  19323. else if (ruler1.y <= -h) {
  19324. ruler1.y = h;
  19325. ruler2.y = 0;
  19326. return;
  19327. }
  19328. if (ruler2.y >= h) {
  19329. ruler2.y = -h;
  19330. ruler1.y = 0;
  19331. return;
  19332. }
  19333. else if (ruler2.y <= -h) {
  19334. ruler2.y = h;
  19335. ruler1.y = 0;
  19336. return;
  19337. }
  19338. break;
  19339. case PressType.d2Root:
  19340. this.eventObj.curX = e.stageX;
  19341. this.eventObj.curY = e.stageY;
  19342. let offset = this.checkRodMoveDir();
  19343. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19344. this.eventObj.lastX = e.stageX;
  19345. this.eventObj.lastY = e.stageY;
  19346. break;
  19347. default:
  19348. break;
  19349. }
  19350. }
  19351. onEventUp(e) {
  19352. if (e.stopPropagation)
  19353. e.stopPropagation();
  19354. if (e && e.force) {
  19355. }
  19356. else {
  19357. if (!this.isTurnSelf())
  19358. return;
  19359. }
  19360. switch (this.pressTarget) {
  19361. case PressType.powerNode:
  19362. this.ui.powerNode.value = 0;
  19363. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19364. this.ui.powerTxt.text = "";
  19365. if (this.powerNum > 0) {
  19366. xGame.eventMgr.event(BALL_SHOOT);
  19367. xGame.common.d2World.shoot(this.powerNum);
  19368. xGame.common.d2World.d2Gan.shoot();
  19369. xGame.common.d2World.d2HelpLine.shoot();
  19370. this.finishGuide();
  19371. this.ui.powerEft.visible = false;
  19372. this.ui.colorNode.visible = false;
  19373. let ganStr = "";
  19374. if (this.powerNum <= 30) {
  19375. ganStr = "gan_30";
  19376. }
  19377. else if (this.powerNum <= 60) {
  19378. ganStr = "gan_50";
  19379. }
  19380. else {
  19381. ganStr = "gan_80";
  19382. }
  19383. xGame.soundMgr.playSound(ganStr);
  19384. }
  19385. break;
  19386. case PressType.moveNode:
  19387. let rootBall = xGame.common.d2World.rootBall;
  19388. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19389. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19390. let isIntersect = this.judgeBallIntersect();
  19391. if (isIntersect) {
  19392. this.ui.moveNode.x = lastX;
  19393. this.ui.moveNode.y = lastY;
  19394. rootBall.gameObj.x = lastX;
  19395. rootBall.gameObj.y = lastY;
  19396. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19397. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19398. }
  19399. else {
  19400. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19401. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19402. }
  19403. this.showBallUI();
  19404. this.ui.moveNode.finger.visible = true;
  19405. xGame.common.d2World.getHelpLine();
  19406. break;
  19407. case PressType.rulerNode:
  19408. break;
  19409. case PressType.d2Root:
  19410. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19411. if (dis <= 25) {
  19412. this.moveToClickDot(e);
  19413. }
  19414. break;
  19415. default:
  19416. break;
  19417. }
  19418. this.pressTarget = -1;
  19419. }
  19420. checkGuide() {
  19421. let guide = DataMgr.getSkillGuide();
  19422. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19423. xGame.common.guideStep++;
  19424. xGame.common.gameUI.ui.guide2.visible = false;
  19425. xGame.common.gameUI.ui.guide3.visible = true;
  19426. }
  19427. }
  19428. finishGuide() {
  19429. let guide = DataMgr.getSkillGuide();
  19430. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19431. xGame.common.guideStep = 10;
  19432. this.closeAllGuide();
  19433. console.log('zh: 新手引导完毕');
  19434. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19435. }
  19436. }
  19437. closeAllGuide() {
  19438. xGame.common.gameUI.ui.guide1.visible = false;
  19439. xGame.common.gameUI.ui.guide2.visible = false;
  19440. xGame.common.gameUI.ui.guide3.visible = false;
  19441. }
  19442. updateBarInfo() {
  19443. let star = this.ui.powerNode.y;
  19444. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19445. if (rate >= 1)
  19446. rate = 1;
  19447. if (rate <= 0)
  19448. rate = 0;
  19449. this.powerNum = Math.ceil(rate * 100);
  19450. this.ui.powerNode.value = this.powerNum;
  19451. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19452. this.ui.colorNode.value = this.powerNum;
  19453. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19454. this.ui.powerEft.visible = this.powerNum != 0;
  19455. this.ui.colorNode.visible = this.powerNum != 0;
  19456. this.ui.powerTxt.text = this.powerNum + "";
  19457. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19458. }
  19459. forceCancel() {
  19460. this.ui.powerNode.value = 0;
  19461. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19462. this.ui.powerTxt.text = "";
  19463. }
  19464. checkRodMoveDir() {
  19465. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19466. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19467. if (tempX >= 0 && tempY <= 0) {
  19468. return this.checkDir();
  19469. }
  19470. else if (tempX < 0 && tempY < 0) {
  19471. return this.checkDir(1, -1);
  19472. }
  19473. else if (tempX < 0 && tempY > 0) {
  19474. return this.checkDir(-1, -1);
  19475. }
  19476. else {
  19477. return this.checkDir(-1, 1);
  19478. }
  19479. }
  19480. checkDir(flagX = 1, flagY = 1) {
  19481. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19482. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19483. if (offsetY == 0) {
  19484. return offsetX * flagX;
  19485. }
  19486. if (offsetX == 0) {
  19487. return offsetY * flagY;
  19488. }
  19489. let angle = offsetY / offsetX;
  19490. if (Math.abs(angle) >= 1) {
  19491. return offsetY * flagY;
  19492. }
  19493. else {
  19494. return offsetX * flagX;
  19495. }
  19496. }
  19497. judgeBallIntersect() {
  19498. let rootBall = xGame.common.d2World.rootBall;
  19499. let ballArr = xGame.common.d2World.ballArr;
  19500. let radius = rootBall.gameObj.width / 2;
  19501. let temp;
  19502. let isIntersect = false;
  19503. for (let index = 0; index < ballArr.length; index++) {
  19504. temp = ballArr[index];
  19505. if (temp.number == rootBall.number)
  19506. continue;
  19507. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  19508. if (isIntersect) {
  19509. break;
  19510. }
  19511. }
  19512. return isIntersect;
  19513. }
  19514. hideBallUI() {
  19515. let d2Gan = xGame.common.d2World.d2Gan;
  19516. if (!d2Gan.ui.isDisposed)
  19517. d2Gan.ui.visible = false;
  19518. let d2Help = xGame.common.d2World.d2HelpLine;
  19519. if (!d2Help.ui.isDisposed)
  19520. d2Help.ui.visible = false;
  19521. let rootBall = xGame.common.d2World.rootBall;
  19522. if (!rootBall.destroyed) {
  19523. rootBall.gameObj.active = false;
  19524. }
  19525. }
  19526. showBallUI() {
  19527. let d2Gan = xGame.common.d2World.d2Gan;
  19528. if (!d2Gan.ui.isDisposed)
  19529. d2Gan.ui.visible = true;
  19530. let d2Help = xGame.common.d2World.d2HelpLine;
  19531. if (!d2Help.ui.isDisposed)
  19532. d2Help.ui.visible = true;
  19533. let rootBall = xGame.common.d2World.rootBall;
  19534. if (!rootBall.destroyed) {
  19535. rootBall.gameObj.active = true;
  19536. }
  19537. }
  19538. moveToClickDot(e) {
  19539. if (!this.isMoveRod && !xGame.common.clickedBall) {
  19540. let root = xGame.common.d2World.rootBall.gameObj;
  19541. let xx = e.stageX - xGame.common.sysOffestNum;
  19542. let yy = e.stageY;
  19543. let x = xx - root.x;
  19544. let y = yy - root.y;
  19545. let angle = xGame.common.getfguiRotation(x, y);
  19546. xGame.common.d2World.d2Gan.ui.rotation = angle;
  19547. xGame.common.d2World.getHelpLine();
  19548. }
  19549. this.isMoveRod = false;
  19550. xGame.common.clickedBall = false;
  19551. }
  19552. openAllEvent() {
  19553. this.closeAllEvent();
  19554. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19555. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19556. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19557. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19558. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19559. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19560. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19561. }
  19562. closeAllEvent() {
  19563. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19564. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19565. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19566. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  19567. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  19568. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  19569. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  19570. }
  19571. resetGame() {
  19572. this.closeAllEvent();
  19573. this.hideBallUI();
  19574. xGame.common.gameMgr.gamePause = true;
  19575. }
  19576. }
  19577. UIGame$1.uiName = "UIGame";
  19578. class UIAddCoin$1 extends UIBase {
  19579. constructor() {
  19580. super();
  19581. this.coinNum = 2000;
  19582. }
  19583. onConstructor() {
  19584. this.ui = ui_UIAddCoin.createInstance();
  19585. this.contentPane = this.ui;
  19586. this.isEject = false;
  19587. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19588. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  19589. }
  19590. show() {
  19591. super.show();
  19592. this.ui.t0.play();
  19593. }
  19594. videoAddCoin() {
  19595. console.log('zh:qjff_AD_for_UIAddCoin');
  19596. if (Laya.Browser.onAndroid) {
  19597. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19598. if (!boo) {
  19599. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19600. return;
  19601. }
  19602. }
  19603. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  19604. }
  19605. else {
  19606. console.log('zh:AD 失败,直接发放奖励');
  19607. this.qjff_AD_for_UIAddCoin();
  19608. }
  19609. }
  19610. qjff_AD_for_UIAddCoin() {
  19611. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  19612. this.hide();
  19613. }
  19614. }
  19615. UIAddCoin$1.uiName = "UIAddCoin";
  19616. class UIInvitation$1 extends UIBase {
  19617. constructor() {
  19618. super();
  19619. }
  19620. onConstructor() {
  19621. this.ui = ui_UIInvitation.createInstance();
  19622. this.contentPane = this.ui;
  19623. this.isEject = false;
  19624. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  19625. }
  19626. show() {
  19627. super.show();
  19628. }
  19629. enterGame() {
  19630. xGame.common.gameMode = GameMode.classic;
  19631. DataMgr.setChallengeTimes(1);
  19632. xGame.common.passAwardCoin = 2000;
  19633. let need = xGame.common.classicNiceNeddCoin;
  19634. if (DataMgr.coinEnough(need)) {
  19635. DataMgr.setCoin(-need);
  19636. xGame.eventMgr.event(RESTART_GAME, true);
  19637. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  19638. }
  19639. else {
  19640. xGame.eventMgr.event(RESTART_GAME, true);
  19641. }
  19642. this.hide();
  19643. }
  19644. hide() {
  19645. super.hide();
  19646. }
  19647. }
  19648. UIInvitation$1.uiName = "UIInvitation";
  19649. class UIPower$1 extends UIBase {
  19650. constructor() {
  19651. super();
  19652. }
  19653. onConstructor() {
  19654. this.ui = ui_UIPower.createInstance();
  19655. this.contentPane = this.ui;
  19656. this.isEject = false;
  19657. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  19658. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  19659. }
  19660. show() {
  19661. super.show();
  19662. this.ui.t0.play();
  19663. }
  19664. videoGetPower() {
  19665. console.log('zh:qjff_AD_for_uipower');
  19666. if (Laya.Browser.onAndroid) {
  19667. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19668. if (!boo) {
  19669. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19670. return;
  19671. }
  19672. }
  19673. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  19674. }
  19675. else {
  19676. console.log('zh:AD 失败,直接发放奖励');
  19677. this.qjff_AD_for_uipower();
  19678. }
  19679. }
  19680. qjff_AD_for_uipower() {
  19681. DataMgr.setPower(xGame.common.videoPower, true);
  19682. xGame.eventMgr.event(POWER_TIME);
  19683. this.hide();
  19684. }
  19685. }
  19686. UIPower$1.uiName = "UIPower";
  19687. class UIGameEnd$1 extends UIBase {
  19688. constructor() {
  19689. super();
  19690. this.success = false;
  19691. this.awardCoinNum = 1000;
  19692. this.awardDiamondNum = 10;
  19693. }
  19694. onConstructor() {
  19695. this.ui = ui_UIGameEnd.createInstance();
  19696. this.contentPane = this.ui;
  19697. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  19698. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  19699. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  19700. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  19701. this.ui.talkNode.visible = false;
  19702. if (Moyu.isKs)
  19703. this.ui.closeNode.closeBtn.x += 100;
  19704. }
  19705. updateType() {
  19706. switch (xGame.common.gameMode) {
  19707. case GameMode.classic:
  19708. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19709. this.ui.coinNode.visible = this.success;
  19710. if (!this.success) {
  19711. Laya.timer.once(500, this, () => {
  19712. xGame.uiMgr.Show(UIAddCoin$1);
  19713. });
  19714. }
  19715. else {
  19716. this.logEventForClassic_win();
  19717. }
  19718. this.logEventForClassic_complete();
  19719. this.ui.isGetAward.visible = false;
  19720. this.ui.leftBtn.c1.selectedIndex = 3;
  19721. this.ui.rightBtn.c1.selectedIndex = 0;
  19722. this.moneyNode.ui.c1.selectedIndex = 1;
  19723. break;
  19724. case GameMode.bigMove:
  19725. console.log('zh:招法模式 aaaaaa bigMove');
  19726. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  19727. this.ui.coinNode.visible = this.success;
  19728. if (xGame.common.gameMode == GameMode.bigMove) {
  19729. if (this.success) {
  19730. DataMgr.setSkillSuccessTimes(1, true);
  19731. DataMgr.setSkillAccTimes(1);
  19732. }
  19733. else {
  19734. DataMgr.setSkillSuccessTimes(0, false);
  19735. }
  19736. }
  19737. this.logEventForRod_complete_N();
  19738. if (!this.success) {
  19739. Laya.timer.once(500, this, () => {
  19740. xGame.uiMgr.Show(UIAddCoin$1);
  19741. });
  19742. }
  19743. else {
  19744. this.logEventForRod_win();
  19745. }
  19746. this.ui.isGetAward.visible = false;
  19747. this.ui.leftBtn.c1.selectedIndex = 3;
  19748. this.ui.rightBtn.c1.selectedIndex = 0;
  19749. this.moneyNode.ui.c1.selectedIndex = 1;
  19750. break;
  19751. case GameMode.placeBall:
  19752. this.ui.coinNode.visible = false;
  19753. if (this.success) {
  19754. if (xGame.common.placeBallStarNum == 3) {
  19755. this.ui.c1.selectedIndex = 2;
  19756. }
  19757. else {
  19758. this.ui.c1.selectedIndex = 3;
  19759. }
  19760. let level = xGame.common.placeBallCurLevel;
  19761. if (level > 59) {
  19762. this.logEventForChallenge_level_complete(level);
  19763. }
  19764. else {
  19765. this.logEventForChallenge_level_N(level);
  19766. }
  19767. }
  19768. else {
  19769. this.ui.c1.selectedIndex = 4;
  19770. }
  19771. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19772. if (cfg.type == PlaceBallType.challenge) {
  19773. this.ui.c1.selectedIndex = 2;
  19774. }
  19775. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  19776. this.updatePlaceBallBtn();
  19777. this.updatePlaceBallStarNum();
  19778. this.updatePlaceBallAwardState();
  19779. this.moneyNode.ui.c1.selectedIndex = 2;
  19780. this.moneyNode.checkPowerTime();
  19781. this.moneyNode.powerChange();
  19782. DataMgr.upRankData();
  19783. break;
  19784. default:
  19785. break;
  19786. }
  19787. }
  19788. logEventForRod_complete_N() {
  19789. let gfmsIdx = xGame.common.curPlayerSkillType;
  19790. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  19791. let gfmc = 'Skyfall Shot';
  19792. if (gfmsIdx == 0) {
  19793. gfmc = 'Skyfall Shot';
  19794. }
  19795. if (gfmsIdx == 1) {
  19796. gfmc = 'Surging break';
  19797. }
  19798. if (gfmsIdx == 2) {
  19799. gfmc = 'Frost Lock';
  19800. }
  19801. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19802. console.log('zh:logEventForRod_complete_N level = ' + level);
  19803. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  19804. let jsonStr = {
  19805. "count": 0,
  19806. "name": gfmc
  19807. };
  19808. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19809. const d = LocalStorageManager.getItem(keyStr);
  19810. jsonStr.count = d.count + 1;
  19811. LocalStorageManager.setItem(keyStr, jsonStr);
  19812. }
  19813. else {
  19814. LocalStorageManager.setItem(keyStr, jsonStr);
  19815. }
  19816. const d2 = LocalStorageManager.getItem(keyStr);
  19817. let count = d2.count;
  19818. console.log('zh:logEventForRod_complete_N count = ' + count);
  19819. if (count % 5 == 0) {
  19820. const reqStr = JSON.stringify(jsonStr);
  19821. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  19822. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  19823. }
  19824. }
  19825. logEventForRod_win() {
  19826. console.log('zh:logEventForRod_win,胜利');
  19827. let gfmsIdx = xGame.common.curPlayerSkillType;
  19828. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  19829. let gfmc = 'Skyfall Shot';
  19830. if (gfmsIdx == 0) {
  19831. gfmc = 'Skyfall Shot';
  19832. }
  19833. if (gfmsIdx == 1) {
  19834. gfmc = 'Surging break';
  19835. }
  19836. if (gfmsIdx == 2) {
  19837. gfmc = 'Frost Lock';
  19838. }
  19839. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  19840. console.log('zh:logEventForRod_win level = ' + level);
  19841. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  19842. let jsonStr = {
  19843. "count": 1,
  19844. "name": gfmc + ' Lev' + level
  19845. };
  19846. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19847. const d = LocalStorageManager.getItem(keyStr);
  19848. jsonStr.count = d.count + 1;
  19849. LocalStorageManager.setItem(keyStr, jsonStr);
  19850. }
  19851. else {
  19852. LocalStorageManager.setItem(keyStr, jsonStr);
  19853. }
  19854. const reqStr = JSON.stringify(jsonStr);
  19855. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  19856. }
  19857. logEventForClassic_win() {
  19858. console.log('zh:logEventForClassic_win,胜利');
  19859. let rtype = xGame.common.classicRoomType;
  19860. let msmc = '';
  19861. if (rtype == 1) {
  19862. msmc = 'beginner';
  19863. }
  19864. if (rtype == 2) {
  19865. msmc = 'expert';
  19866. }
  19867. if (rtype == 3) {
  19868. msmc = 'master';
  19869. }
  19870. let keyStr = 'sjmd_classic_win_' + rtype;
  19871. let jsonStr = {
  19872. "difficulty": msmc,
  19873. "classic_count": 1,
  19874. "difficulty_count": 1
  19875. };
  19876. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19877. const d = LocalStorageManager.getItem(keyStr);
  19878. jsonStr.classic_count = d.classic_count + 1;
  19879. jsonStr.difficulty_count = d.difficulty_count + 1;
  19880. LocalStorageManager.setItem(keyStr, jsonStr);
  19881. }
  19882. else {
  19883. LocalStorageManager.setItem(keyStr, jsonStr);
  19884. }
  19885. const reqStr = JSON.stringify(jsonStr);
  19886. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  19887. }
  19888. logEventForClassic_complete() {
  19889. console.log('zh:logEventForClassic_complete,胜利');
  19890. let rtype = xGame.common.classicRoomType;
  19891. let msmc = '';
  19892. if (rtype == 1) {
  19893. msmc = 'beginner';
  19894. }
  19895. if (rtype == 2) {
  19896. msmc = 'expert';
  19897. }
  19898. if (rtype == 3) {
  19899. msmc = 'master';
  19900. }
  19901. let keyStr = 'sjmd_classic_complete_' + rtype;
  19902. let jsonStr = {
  19903. "msmc": msmc,
  19904. "count": 0
  19905. };
  19906. if (LocalStorageManager.hasJosnKey(keyStr)) {
  19907. const d = LocalStorageManager.getItem(keyStr);
  19908. jsonStr.count = d.count + 1;
  19909. LocalStorageManager.setItem(keyStr, jsonStr);
  19910. }
  19911. else {
  19912. LocalStorageManager.setItem(keyStr, jsonStr);
  19913. }
  19914. if (jsonStr.count % 5 == 0) {
  19915. const reqStr = JSON.stringify(jsonStr);
  19916. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  19917. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  19918. }
  19919. }
  19920. updatePlaceBallBtn() {
  19921. this.ui.leftBtn.c1.selectedIndex = 5;
  19922. if (this.success) {
  19923. this.ui.rightBtn.c1.selectedIndex = 14;
  19924. }
  19925. else {
  19926. if (xGame.common.placeBallStarNum == 3) {
  19927. this.ui.rightBtn.c1.selectedIndex = 14;
  19928. }
  19929. else {
  19930. this.ui.rightBtn.c1.selectedIndex = 1;
  19931. }
  19932. }
  19933. }
  19934. updatePlaceBallStarNum() {
  19935. let starNum = xGame.common.placeBallStarNum;
  19936. if (starNum == 0)
  19937. this.ui.starNumNode.c1.selectedIndex = 3;
  19938. else {
  19939. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  19940. }
  19941. }
  19942. updatePlaceBallAwardState() {
  19943. let level = xGame.common.placeBallCurLevel;
  19944. let starNum = xGame.common.placeBallStarNum;
  19945. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  19946. let data = cfgTable.placeballData[level].award;
  19947. let cfg = cfgTable.placeballData[level];
  19948. this.awardDiamondNum = data[1];
  19949. this.awardCoinNum = data[0];
  19950. if (cfg.type == PlaceBallType.challenge) {
  19951. this.awardDiamondNum = 0;
  19952. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  19953. }
  19954. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  19955. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  19956. if (cfg.type == PlaceBallType.challenge) {
  19957. this.ui.awardNode.coinNode.visible = true;
  19958. }
  19959. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  19960. this.ui.awardNode.diamondNode.x = 265;
  19961. this.ui.awardNode.coinNode.x = 354;
  19962. }
  19963. else {
  19964. this.ui.awardNode.diamondNode.x = 291;
  19965. this.ui.awardNode.coinNode.x = 291;
  19966. }
  19967. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  19968. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  19969. if (this.awardCoinNum == 0) {
  19970. this.ui.awardNode.coinNode.numTxt.text = "";
  19971. }
  19972. if (getAward) {
  19973. this.ui.isGetAward.visible = true;
  19974. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  19975. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  19976. }
  19977. else {
  19978. this.ui.isGetAward.visible = false;
  19979. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  19980. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  19981. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  19982. }
  19983. else {
  19984. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  19985. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  19986. }
  19987. }
  19988. }
  19989. show(success) {
  19990. super.show();
  19991. xGame.eventMgr.event(RESET_GAME);
  19992. this.success = success;
  19993. Laya.timer.clearAll(this);
  19994. this.playSecretaryAni();
  19995. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  19996. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  19997. offsetTime = Math.floor(offsetTime / 1000);
  19998. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  19999. this.updateType();
  20000. Laya.timer.once(200, this, () => {
  20001. this.addAward(() => {
  20002. this.updateType();
  20003. Laya.timer.once(500, this, () => {
  20004. this.showChallengeLevel();
  20005. });
  20006. });
  20007. });
  20008. if (this.success) {
  20009. JSBridgeUtils.instance.showInternAd('gameend_success');
  20010. console.log('zh:game end 成功');
  20011. xGame.soundMgr.playSound('slots_roll01');
  20012. xGame.soundMgr.playSound("s_win");
  20013. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20014. this.diyGameDataUtilForGameWin();
  20015. }
  20016. else {
  20017. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20018. console.log('zh:game end失败');
  20019. xGame.soundMgr.playSound('matchwin01');
  20020. xGame.soundMgr.playSound("s_lose");
  20021. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20022. }
  20023. let challengeNum = DataMgr.getChallengeTimes();
  20024. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20025. DataMgr.setChallengeTimes(1);
  20026. }
  20027. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20028. DataMgr.setClassicTimes();
  20029. }
  20030. }
  20031. diyGameDataUtilForGameWin() {
  20032. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20033. switch (xGame.common.gameMode) {
  20034. case GameMode.classic:
  20035. console.log('zh:DiyGameDataUtilForGameWin 111');
  20036. case GameMode.bigMove:
  20037. console.log('zh:DiyGameDataUtilForGameWin 222');
  20038. this.restartGame();
  20039. break;
  20040. case GameMode.placeBall:
  20041. console.log('zh:DiyGameDataUtilForGameWin 333');
  20042. var level = xGame.common.placeBallCurLevel;
  20043. console.log('zh:练习模式 联系了多少LEV=' + level);
  20044. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20045. if (level > db_over_lev) {
  20046. DataMgr.setChallengeMode_overLev(level);
  20047. }
  20048. break;
  20049. default:
  20050. console.log('zh:DiyGameDataUtilForGameWin 444');
  20051. break;
  20052. }
  20053. }
  20054. showChallengeLevel() {
  20055. if (DataMgr.getChallengeTimes() != 0)
  20056. return;
  20057. let skill = DataMgr.getSkillAccTimes();
  20058. let put = DataMgr.getPlaceBallLevelList().length;
  20059. if (skill >= 3 || put >= 5) {
  20060. xGame.uiMgr.Show(UIInvitation$1);
  20061. this.hide();
  20062. }
  20063. }
  20064. addAward(callback) {
  20065. if (!this.success) {
  20066. callback && callback();
  20067. return;
  20068. }
  20069. switch (xGame.common.gameMode) {
  20070. case GameMode.classic:
  20071. this.awardCoinNum = xGame.common.passAwardCoin;
  20072. this.awardDiamondNum = 0;
  20073. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20074. break;
  20075. case GameMode.bigMove:
  20076. this.awardCoinNum = xGame.common.passAwardCoin;
  20077. this.awardDiamondNum = 0;
  20078. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20079. callback && callback();
  20080. break;
  20081. case GameMode.placeBall:
  20082. let level = xGame.common.placeBallCurLevel;
  20083. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20084. if (xGame.common.placeBallStarNum != 3) {
  20085. callback && callback();
  20086. return;
  20087. }
  20088. else {
  20089. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20090. if (getAward) {
  20091. callback && callback();
  20092. return;
  20093. }
  20094. }
  20095. let cfg = cfgTable.placeballData[level];
  20096. let data = cfgTable.placeballData[level].award;
  20097. this.awardCoinNum = data[0];
  20098. this.awardDiamondNum = data[1];
  20099. if (cfg.type == PlaceBallType.challenge) {
  20100. this.awardDiamondNum = 0;
  20101. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20102. }
  20103. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20104. let diamondAward;
  20105. if (this.awardDiamondNum > 0) {
  20106. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20107. xGame.common.getAward([diamondAward, coinAward], callback);
  20108. }
  20109. else {
  20110. xGame.common.getAward([coinAward], callback);
  20111. }
  20112. if (cfg.type == PlaceBallType.normal) {
  20113. DataMgr.setPlaceBallAward(level);
  20114. }
  20115. break;
  20116. default:
  20117. break;
  20118. }
  20119. }
  20120. playSecretaryAni_old() {
  20121. let parent = this.ui.secretary.displayObject;
  20122. parent.destroyChildren();
  20123. let xx = this.ui.secretary.width / 2;
  20124. let yy = this.ui.secretary.height;
  20125. let scale = xGame.common.getSecretaryScale();
  20126. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20127. if (this.success) {
  20128. let rand = Math.random() <= 0.5 ? 2 : 3;
  20129. xGame.common.secretary.play(data, rand, false, parent, () => {
  20130. xGame.common.secretary.play(data, 1, true, parent);
  20131. });
  20132. }
  20133. else {
  20134. xGame.common.secretary.play(data, 0, true, parent);
  20135. }
  20136. }
  20137. playSecretaryAni() {
  20138. let parent = this.ui.secretary.displayObject;
  20139. parent.destroyChildren();
  20140. let xx = this.ui.secretary.width / 2;
  20141. let yy = this.ui.secretary.height;
  20142. let scale = xGame.common.getSecretaryScale();
  20143. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20144. if (this.success) {
  20145. let rand = 0;
  20146. xGame.common.secretary.play(data, 0, true, parent);
  20147. }
  20148. else {
  20149. xGame.common.secretary.play(data, 0, true, parent);
  20150. }
  20151. }
  20152. restartGame() {
  20153. switch (xGame.common.gameMode) {
  20154. case GameMode.classic:
  20155. xGame.eventMgr.event(RESTART_GAME);
  20156. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20157. break;
  20158. case GameMode.bigMove:
  20159. this.hide();
  20160. xGame.eventMgr.event(RESTART_GAME);
  20161. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20162. break;
  20163. default:
  20164. break;
  20165. }
  20166. }
  20167. hide() {
  20168. super.hide();
  20169. xGame.common.stopGirlPop(this.ui.talkNode);
  20170. PlatMgr.showBanner(false);
  20171. }
  20172. returnHome() {
  20173. this.hide();
  20174. let showFailWords = !this.success;
  20175. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20176. }
  20177. clickLeftBtn() {
  20178. switch (xGame.common.gameMode) {
  20179. case GameMode.classic:
  20180. case GameMode.bigMove:
  20181. this.returnHome();
  20182. break;
  20183. case GameMode.placeBall:
  20184. let level = xGame.common.placeBallCurLevel;
  20185. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20186. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20187. break;
  20188. default:
  20189. break;
  20190. }
  20191. }
  20192. powerStartPlaceBallLevel(level, btn) {
  20193. if (DataMgr.powerEnough()) {
  20194. btn.touchable = false;
  20195. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20196. btn.touchable = true;
  20197. DataMgr.setPower(-1);
  20198. xGame.eventMgr.event(POWER_TIME);
  20199. this.startPlaceBallLevel(level);
  20200. this.logEventForChallenge_level_start(level);
  20201. }));
  20202. }
  20203. else {
  20204. xGame.uiMgr.Show(UIPower$1, 0);
  20205. }
  20206. }
  20207. clickRightBtn() {
  20208. switch (xGame.common.gameMode) {
  20209. case GameMode.classic:
  20210. console.log('zh:clickRightBtn 111');
  20211. case GameMode.bigMove:
  20212. console.log('zh:clickRightBtn 222');
  20213. this.restartGame();
  20214. break;
  20215. case GameMode.placeBall:
  20216. console.log('zh:clickRightBtn 333');
  20217. let level = xGame.common.placeBallCurLevel;
  20218. let data = DataMgr.getPlaceBallLevel(level);
  20219. let curPss = data.play && !data.isCur;
  20220. if (curPss) {
  20221. console.log('zh:clickRightBtn 333-111');
  20222. console.log('zh:当前LV=' + level);
  20223. if (level == 60) {
  20224. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20225. Laya.timer.once(3000, this, () => {
  20226. this.returnHome();
  20227. });
  20228. }
  20229. else {
  20230. let lev = level + 1;
  20231. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20232. }
  20233. }
  20234. else {
  20235. console.log('zh:clickRightBtn 333-000');
  20236. Moyu.sendDataEvent("placeBallNextLevel");
  20237. console.log('zh:qjff_AD_for_uiGameEnd');
  20238. if (Laya.Browser.onAndroid) {
  20239. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20240. if (!boo) {
  20241. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20242. return;
  20243. }
  20244. }
  20245. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20246. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20247. }
  20248. else {
  20249. console.log('zh:AD 失败,直接发放奖励');
  20250. this.qjff_AD_for_uiGameEnd(level);
  20251. }
  20252. }
  20253. break;
  20254. default:
  20255. console.log('zh:clickRightBtn 444');
  20256. break;
  20257. }
  20258. }
  20259. logEventForChallenge_level_start(level) {
  20260. let keyStr = 'sjmd_challenge_level_start';
  20261. let jsonStr = {
  20262. "count": 0,
  20263. "gold_balance ": DataMgr.getCoin(),
  20264. "level": level,
  20265. "diamond_balance ": DataMgr.getDiamond()
  20266. };
  20267. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20268. const d = LocalStorageManager.getItem(keyStr);
  20269. if (level > d.level) {
  20270. jsonStr.count = d.count + 1;
  20271. LocalStorageManager.setItem(keyStr, jsonStr);
  20272. }
  20273. else {
  20274. }
  20275. }
  20276. else {
  20277. LocalStorageManager.setItem(keyStr, jsonStr);
  20278. }
  20279. const reqStr = JSON.stringify(jsonStr);
  20280. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20281. }
  20282. qjff_AD_for_uiGameEnd(level) {
  20283. DataMgr.setPlaceBallLevel(level, 1);
  20284. this.startPlaceBallLevel(level + 1);
  20285. }
  20286. startPlaceBallLevel(level) {
  20287. xGame.common.gameMode = GameMode.placeBall;
  20288. xGame.common.placeBallCurLevel = level;
  20289. xGame.uiMgr.Show(UIGame$1);
  20290. this.hide();
  20291. }
  20292. logEventForChallenge_level_complete(level) {
  20293. let keyStr = 'sjmd_challenge_level_complete';
  20294. let jsonStr = {
  20295. "count": 1,
  20296. "gold_balance ": DataMgr.getCoin(),
  20297. "level": level,
  20298. "diamond_balance ": DataMgr.getDiamond()
  20299. };
  20300. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20301. const d = LocalStorageManager.getItem(keyStr);
  20302. jsonStr.count = d.count + 1;
  20303. LocalStorageManager.setItem(keyStr, jsonStr);
  20304. }
  20305. else {
  20306. LocalStorageManager.setItem(keyStr, jsonStr);
  20307. }
  20308. const reqStr = JSON.stringify(jsonStr);
  20309. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20310. }
  20311. logEventForChallenge_level_N(level) {
  20312. console.log('zh:logEventForChallenge_level_N ' + level);
  20313. let keyStr = 'sjmd_challenge_level_N';
  20314. if (LocalStorageManager.hasKey(keyStr)) {
  20315. let lev = LocalStorageManager.getItem(keyStr);
  20316. if (level > lev) {
  20317. LocalStorageManager.setItem(keyStr, level);
  20318. }
  20319. if ((level) % 5 == 0) {
  20320. console.log('zh:每5关上报1次');
  20321. let sjmc = 'challenge_level_' + level;
  20322. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20323. let sjmcForFirebase = 'challenge_level_' + level;
  20324. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20325. }
  20326. else {
  20327. console.log('zh:5 no 上报');
  20328. }
  20329. }
  20330. else {
  20331. LocalStorageManager.setItem(keyStr, level);
  20332. }
  20333. }
  20334. }
  20335. UIGameEnd$1.uiName = "UIGameEnd";
  20336. class ShowItem$1 {
  20337. constructor() {
  20338. this.ui = ui_ShowItem.createInstance();
  20339. }
  20340. destroySelf() {
  20341. if (!this.ui.isDisposed) {
  20342. this.ui.removeFromParent();
  20343. this.ui.dispose();
  20344. }
  20345. }
  20346. setParent(parent) {
  20347. parent.addChild(this.ui);
  20348. }
  20349. setPos(x, y) {
  20350. this.ui.x = x;
  20351. this.ui.y = y;
  20352. }
  20353. setUrl(index) {
  20354. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20355. }
  20356. }
  20357. class UILevelProp$1 extends UIBase {
  20358. constructor() {
  20359. super();
  20360. this.firstPos = 385;
  20361. this.secondPos = 467;
  20362. this.showItemArr = [];
  20363. }
  20364. onFontLoaded() {
  20365. try {
  20366. this.ui.myNode.conditionTxt.font = "arial";
  20367. console.log("zh: onFontLoaded 设置arial字体成功");
  20368. }
  20369. catch (error) {
  20370. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20371. }
  20372. }
  20373. onConstructor() {
  20374. this.ui = ui_UILevelProp.createInstance();
  20375. this.contentPane = this.ui;
  20376. this.isEject = false;
  20377. this.addUIClick(this.ui.closeBtn, this.hide);
  20378. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20379. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20380. }
  20381. show(level) {
  20382. super.show();
  20383. this.ui.t1.play();
  20384. this.level = level;
  20385. this.data = cfgTable.placeballData[this.level];
  20386. this.updateSelf();
  20387. this.showPreView();
  20388. this.moneyNode.ui.c1.selectedIndex = 2;
  20389. this.moneyNode.checkPowerTime();
  20390. this.moneyNode.powerChange();
  20391. }
  20392. showPreView() {
  20393. let item;
  20394. let data;
  20395. for (let index = 0; index < this.showItemArr.length; index++) {
  20396. item = this.showItemArr[index];
  20397. item.destroySelf();
  20398. }
  20399. this.showItemArr = [];
  20400. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20401. for (const key in cfgData) {
  20402. data = cfgData[key];
  20403. item = new ShowItem$1();
  20404. item.setParent(this.ui.myNode.displayRoot);
  20405. item.setPos(data.x, data.y);
  20406. item.setUrl(data.value);
  20407. this.showItemArr.push(item);
  20408. }
  20409. }
  20410. updateSelf() {
  20411. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20412. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20413. if (this.data.ball == -1) {
  20414. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20415. }
  20416. else {
  20417. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20418. }
  20419. let localData = DataMgr.getPlaceBallLevel(this.level);
  20420. let getAward = localData.getAward;
  20421. let cfg = cfgTable.placeballData[this.level];
  20422. let coin = this.data.award[0];
  20423. let diamond = this.data.award[1];
  20424. if (cfg.type == PlaceBallType.challenge) {
  20425. diamond = 0;
  20426. coin = 100;
  20427. }
  20428. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20429. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20430. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20431. if (cfg.type == PlaceBallType.challenge) {
  20432. this.ui.myNode.coinNode.numTxt.text = "";
  20433. }
  20434. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20435. if (coin > 0 && diamond > 0) {
  20436. this.ui.myNode.diamondNode.x = 385;
  20437. this.ui.myNode.coinNode.x = 467;
  20438. }
  20439. else {
  20440. this.ui.myNode.diamondNode.x = 385;
  20441. this.ui.myNode.coinNode.x = 385;
  20442. }
  20443. if (!getAward) {
  20444. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20445. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20446. }
  20447. else {
  20448. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20449. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20450. }
  20451. }
  20452. startGame() {
  20453. if (DataMgr.powerEnough()) {
  20454. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20455. this.ui.myNode.startBtn.touchable = false;
  20456. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20457. console.log('zh:startGame ');
  20458. this.ui.myNode.startBtn.touchable = true;
  20459. DataMgr.setPower(-1);
  20460. xGame.eventMgr.event(POWER_TIME);
  20461. xGame.common.gameMode = GameMode.placeBall;
  20462. xGame.common.placeBallCurLevel = this.level;
  20463. xGame.uiMgr.Show(UIGame$1);
  20464. this.logEventForChallenge_level_start(this.level);
  20465. xGame.uiMgr.Hide(UILevelDisplay$1);
  20466. xGame.uiMgr.Hide(UIMain$1);
  20467. this.hide();
  20468. }));
  20469. }
  20470. else {
  20471. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20472. xGame.uiMgr.Show(UIPower$1);
  20473. }
  20474. }
  20475. logEventForChallenge_level_start(level) {
  20476. let keyStr = 'sjmd_challenge_level_start';
  20477. let jsonStr = {
  20478. "count": 1,
  20479. "gold_balance ": DataMgr.getCoin(),
  20480. "level": level,
  20481. "diamond_balance ": DataMgr.getDiamond()
  20482. };
  20483. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20484. const d = LocalStorageManager.getItem(keyStr);
  20485. if (level > d.level) {
  20486. jsonStr.count = d.count + 1;
  20487. LocalStorageManager.setItem(keyStr, jsonStr);
  20488. }
  20489. else {
  20490. }
  20491. }
  20492. else {
  20493. LocalStorageManager.setItem(keyStr, jsonStr);
  20494. }
  20495. const reqStr = JSON.stringify(jsonStr);
  20496. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20497. }
  20498. hide() {
  20499. super.hide();
  20500. }
  20501. }
  20502. UILevelProp$1.uiName = "UILevelProp";
  20503. class PutBallLevelDisplay$1 {
  20504. constructor(ui, index) {
  20505. this.index = 0;
  20506. this.ui = ui;
  20507. this.index = index;
  20508. this.ui.onClick(this, this.clickSelf);
  20509. this.updateSelf();
  20510. this.ui.levelTxt.text = (this.index + 1) + "";
  20511. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  20512. this.ui.special.levelTxt.text = (this.index + 1) + "";
  20513. }
  20514. updateSelf() {
  20515. let level = this.index + 1;
  20516. this.data = DataMgr.getPlaceBallLevel(level);
  20517. this.ui.starNode.c1.selectedIndex = this.data.star;
  20518. let isChallenge = cfgTable.placeballData[level].type;
  20519. if (this.data.isCur) {
  20520. if (isChallenge) {
  20521. this.ui.c1.selectedIndex = 5;
  20522. }
  20523. else {
  20524. this.ui.c1.selectedIndex = 2;
  20525. }
  20526. }
  20527. else {
  20528. if (this.data.play) {
  20529. if (this.data.star == 3) {
  20530. this.ui.c1.selectedIndex = 0;
  20531. }
  20532. else {
  20533. this.ui.c1.selectedIndex = 1;
  20534. }
  20535. }
  20536. else {
  20537. if (isChallenge) {
  20538. this.ui.c1.selectedIndex = 4;
  20539. }
  20540. else {
  20541. this.ui.c1.selectedIndex = 3;
  20542. }
  20543. }
  20544. }
  20545. }
  20546. clickSelf() {
  20547. if (!this.data.play)
  20548. return;
  20549. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20550. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  20551. }
  20552. }
  20553. class UILevelDisplay$1 extends UIBase {
  20554. constructor() {
  20555. super();
  20556. }
  20557. onConstructor() {
  20558. this.ui = ui_UILevelDisplay.createInstance();
  20559. this.contentPane = this.ui;
  20560. this.isEject = false;
  20561. this.myList = this.ui.myNode.myList;
  20562. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  20563. this.levelItemArr = [];
  20564. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  20565. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  20566. this.myList.numItems = levelNum;
  20567. if (Moyu.isKs)
  20568. this.ui.closeNode.closeBtn.x += 100;
  20569. }
  20570. levelItemRender(index, target) {
  20571. let item = new PutBallLevelDisplay$1(target, index);
  20572. this.levelItemArr.push(item);
  20573. }
  20574. show() {
  20575. super.show();
  20576. this.updateLevel();
  20577. this.scrollToPlace();
  20578. }
  20579. updateLevel() {
  20580. let temp;
  20581. for (let index = 0; index < this.levelItemArr.length; index++) {
  20582. temp = this.levelItemArr[index];
  20583. temp.updateSelf();
  20584. }
  20585. }
  20586. scrollToPlace() {
  20587. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  20588. let passArr = DataMgr.getPlaceBallLevelList();
  20589. let offest = passArr.length;
  20590. if (offest >= maxNum - 1)
  20591. offest = maxNum - 1;
  20592. this.myList.scrollToView(offest, true, true);
  20593. }
  20594. hide() {
  20595. super.hide();
  20596. }
  20597. }
  20598. UILevelDisplay$1.uiName = "UILevelDisplay";
  20599. class UIMatching$1 extends UIBase {
  20600. constructor() {
  20601. super();
  20602. }
  20603. onConstructor() {
  20604. this.ui = ui_UIMatching.createInstance();
  20605. this.contentPane = this.ui;
  20606. this.isEject = false;
  20607. }
  20608. show(callback) {
  20609. super.show();
  20610. PlatMgr.showBanner(true);
  20611. this.callback = callback;
  20612. let user = Moyu.getUserInfo();
  20613. if (!this.selfPot) {
  20614. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  20615. }
  20616. if (!this.aiPot) {
  20617. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  20618. }
  20619. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  20620. this.ui.selfHead.nameTxt.text = user.nickName;
  20621. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  20622. this.ui.aiHead.nameTxt.text = "???";
  20623. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  20624. this.ui.selfHead.c1.selectedIndex = 0;
  20625. this.ui.aiHead.c1.selectedIndex = 0;
  20626. this.ui.selfHead.x = this.selfPot.x;
  20627. this.ui.selfHead.y = this.selfPot.y;
  20628. this.ui.aiHead.x = this.aiPot.x;
  20629. this.ui.aiHead.y = this.aiPot.y;
  20630. switch (xGame.common.gameMode) {
  20631. case GameMode.classic:
  20632. break;
  20633. case GameMode.bigMove:
  20634. this.initSkillData();
  20635. break;
  20636. default:
  20637. break;
  20638. }
  20639. this.ui.t1.play(Laya.Handler.create(this, () => {
  20640. this.ui.t2.play(Laya.Handler.create(this, () => {
  20641. switch (xGame.common.gameMode) {
  20642. case GameMode.classic:
  20643. this.waitingPeople();
  20644. break;
  20645. case GameMode.bigMove:
  20646. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  20647. break;
  20648. default:
  20649. break;
  20650. }
  20651. }));
  20652. }));
  20653. }
  20654. initSkillData() {
  20655. this.skillSelectData = [];
  20656. let skillUrl = xGame.common.skillIconList;
  20657. let skillName = xGame.common.skillNameList;
  20658. let skillLevel = DataMgr.getBigSkillList();
  20659. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  20660. for (let index = 0; index < 5; index++) {
  20661. let obj = {};
  20662. obj.skillImg = skillUrl[index];
  20663. obj.skillName = skillName[index];
  20664. obj.skillType = skillType[index];
  20665. obj.skillLevel = skillLevel[index];
  20666. this.skillSelectData.push(obj);
  20667. }
  20668. }
  20669. getAISkillLevel(myLevel) {
  20670. let video = xGame.common.upSkillLevel;
  20671. let aiLevel;
  20672. let temp;
  20673. if (video) {
  20674. temp = xGame.common.randomNum(-2, -1);
  20675. }
  20676. else {
  20677. if (myLevel <= 5) {
  20678. temp = xGame.common.randomNum(1, 3);
  20679. }
  20680. else if (myLevel <= 9) {
  20681. temp = xGame.common.randomNum(-2, 1);
  20682. }
  20683. else {
  20684. temp = xGame.common.randomNum(-4, 0);
  20685. }
  20686. }
  20687. aiLevel = temp + myLevel;
  20688. if (aiLevel <= 1)
  20689. aiLevel = 1;
  20690. if (aiLevel >= 10)
  20691. aiLevel = 10;
  20692. return aiLevel;
  20693. }
  20694. getAISkillType() {
  20695. return xGame.common.randomNum(1, 4);
  20696. let successTimes = DataMgr.getSkillSuccessTimes();
  20697. let info = cfgTable.aiskillData[successTimes];
  20698. if (!info) {
  20699. let max = Object.keys(cfgTable.aiskillData).length - 1;
  20700. info = cfgTable.aiskillData[max];
  20701. }
  20702. let dataArr = info.skillselect;
  20703. let myCfg = {};
  20704. for (let index = 0; index < dataArr.length; index++) {
  20705. let temp = dataArr[index].split('-');
  20706. myCfg[temp[0]] = {};
  20707. myCfg[temp[0]].id = parseInt(temp[0]);
  20708. myCfg[temp[0]].weight = parseInt(temp[1]);
  20709. }
  20710. let aiCfg = xGame.common.initWeight(myCfg);
  20711. let curData = xGame.common.getRandomWeightData(aiCfg);
  20712. return parseInt(curData.id);
  20713. }
  20714. getAISkillData(index) {
  20715. let myLevel = this.skillSelectData[index].skillLevel;
  20716. let aiLevel = this.getAISkillLevel(myLevel);
  20717. let aiType = this.getAISkillType() - 1;
  20718. return { aiLevel, aiType } = { aiLevel, aiType };
  20719. }
  20720. skillSelectFinish(index) {
  20721. let aiInfo = this.getAISkillData(index);
  20722. xGame.common.gameMgr.selfCurSkill = index;
  20723. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  20724. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  20725. this.ui.selfHead.c1.selectedIndex = 1;
  20726. this.ui.aiHead.c1.selectedIndex = 1;
  20727. let myData = this.skillSelectData[index];
  20728. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  20729. let guide = DataMgr.getSkillGuide();
  20730. if (guide == 0) {
  20731. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  20732. }
  20733. else {
  20734. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  20735. }
  20736. let aiData = this.skillSelectData[aiInfo.aiType];
  20737. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  20738. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  20739. this.waitingPeople();
  20740. }
  20741. waitingPeople() {
  20742. let time = xGame.common.randomNum(1000, 3000);
  20743. time += 1000;
  20744. Laya.timer.once(time, this, () => {
  20745. this.matchingSuccess();
  20746. });
  20747. }
  20748. matchingSuccess() {
  20749. let gameUI = xGame.common.gameUI;
  20750. let name = gameUI.ui.topNode.aiNameTxt.text;
  20751. let url = gameUI.ui.topNode.aiHeadLoader.url;
  20752. this.ui.aiHead.nameTxt.text = name;
  20753. this.ui.aiHead.headImg.url = url;
  20754. name = gameUI.ui.topNode.selfNameTxt.text;
  20755. url = gameUI.ui.topNode.selfHeadLoader.url;
  20756. this.ui.selfHead.nameTxt.text = name;
  20757. this.ui.selfHead.headImg.url = url;
  20758. this.ui.t3.play(Laya.Handler.create(this, () => {
  20759. this.callback && this.callback();
  20760. this.ui.t4.play(Laya.Handler.create(this, () => {
  20761. this.destroySelf();
  20762. }));
  20763. }));
  20764. }
  20765. destroySelf() {
  20766. this.callback = null;
  20767. this.skillSelectData = null;
  20768. this.selfPot = null;
  20769. this.aiPot = null;
  20770. if (!this.ui.isDisposed) {
  20771. this.ui.removeFromParent();
  20772. this.ui.dispose();
  20773. }
  20774. xGame.uiMgr.destroyUI(this);
  20775. }
  20776. }
  20777. UIMatching$1.uiName = "UIMatching";
  20778. class SkillDisplay$1 {
  20779. constructor(ui, data, uiIndex) {
  20780. this.starX = 0;
  20781. this.starY = 0;
  20782. this.index = 0;
  20783. this.ui = ui;
  20784. this.data = data;
  20785. this.index = uiIndex;
  20786. this.initSelf();
  20787. console.log('zh:SkillDisplay constructor this.skillData=', data);
  20788. }
  20789. initSelf() {
  20790. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  20791. this.ui.nameTxt.text = this.data.name;
  20792. this.ui.describeTxt.text = this.data.describe;
  20793. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  20794. this.ui.startBtn.onClick(this, this.startGame);
  20795. this.updateSelf();
  20796. }
  20797. updateSelf() {
  20798. this.checkTry();
  20799. let level = DataMgr.getBigSkillByIndex(this.index);
  20800. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  20801. }
  20802. checkTry() {
  20803. let index = this.index;
  20804. let level = DataMgr.getBigSkillByIndex(index);
  20805. if (level == null) {
  20806. DataMgr.setBigSkill(index, 1, false);
  20807. level = 1;
  20808. }
  20809. this.ui.levelTxt.text = "LV." + level;
  20810. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  20811. this.ui.tryNode.visible = true;
  20812. else
  20813. this.ui.tryNode.visible = false;
  20814. }
  20815. clickAddLevel() {
  20816. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20817. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  20818. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  20819. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  20820. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20821. }
  20822. else {
  20823. console.log('zh:AD 失败,直接发放奖励');
  20824. this.qjff_AD_for_skilldisplay_clickAddLevel();
  20825. }
  20826. }
  20827. qjff_AD_for_skilldisplay_clickAddLevel() {
  20828. DataMgr.setBigSkill(this.data.index, 1);
  20829. this.updateSelf();
  20830. xGame.common.upSkillLevel = true;
  20831. }
  20832. startGame() {
  20833. console.log('zh:rod skill startgame');
  20834. if (this.data.index == 3) {
  20835. alert('Coming soon!');
  20836. return;
  20837. }
  20838. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  20839. let needCoin = xGame.common.bigMoveNeedCoin;
  20840. xGame.common.passAwardCoin = 2000;
  20841. let guide = DataMgr.getSkillGuide();
  20842. console.log('zh:startGame guide=' + guide);
  20843. xGame.common.temSelfLevel = 0;
  20844. if (guide == 0) {
  20845. needCoin = 0;
  20846. xGame.common.temSelfLevel = 100;
  20847. }
  20848. if (DataMgr.coinEnough(needCoin)) {
  20849. DataMgr.setCoin(-needCoin);
  20850. xGame.common.curPlayerSkillType = this.index;
  20851. if (guide == 0)
  20852. xGame.common.curPlayerSkillType = 0;
  20853. console.log('zh: skilldisplay 1');
  20854. xGame.uiMgr.Show(UIGame$1);
  20855. xGame.uiMgr.Hide(UIMain$1);
  20856. xGame.uiMgr.Show(UIMatching$1, () => {
  20857. xGame.common.gameUI.ui.alpha = 1;
  20858. xGame.common.gameUI.startGame();
  20859. xGame.uiMgr.Hide(UISkill$1);
  20860. });
  20861. this.logEventForRod_start();
  20862. }
  20863. else {
  20864. console.log('zh: skilldisplay 2');
  20865. xGame.uiMgr.Show(UIAddProp$1, 0);
  20866. Moyu.sendDataEvent("AddCoinVideo");
  20867. }
  20868. }
  20869. logEventForRod_start() {
  20870. let gfmsIdx = xGame.common.curPlayerSkillType;
  20871. console.log('zh:选择的技能=' + gfmsIdx);
  20872. let gfmc = 'Skyfall Shot';
  20873. if (gfmsIdx == 0) {
  20874. gfmc = 'Skyfall Shot';
  20875. }
  20876. if (gfmsIdx == 1) {
  20877. gfmc = 'Surging break';
  20878. }
  20879. if (gfmsIdx == 2) {
  20880. gfmc = 'Frost Lock';
  20881. }
  20882. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20883. let jsonStr = {
  20884. "count": 0,
  20885. "name": gfmc
  20886. };
  20887. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20888. const d = LocalStorageManager.getItem(keyStr);
  20889. jsonStr.count = d.count + 1;
  20890. LocalStorageManager.setItem(keyStr, jsonStr);
  20891. }
  20892. else {
  20893. LocalStorageManager.setItem(keyStr, jsonStr);
  20894. }
  20895. const reqStr = JSON.stringify(jsonStr);
  20896. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  20897. }
  20898. }
  20899. class UISkill$1 extends UIBase {
  20900. constructor() {
  20901. super();
  20902. this.skillData = [];
  20903. }
  20904. onConstructor() {
  20905. this.ui = ui_UISkill.createInstance();
  20906. this.contentPane = this.ui;
  20907. this.isEject = false;
  20908. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20909. this.initSkillData();
  20910. console.log('zh:aaaaaa1111111111');
  20911. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  20912. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  20913. console.log('zh:aaaaaa22222222');
  20914. this.displayList = [];
  20915. this.ui.skillNode.skillList.numItems = 3;
  20916. this.addUIClick(this.ui, this.interuptSecretary);
  20917. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  20918. this.ui.talkNode.visible = false;
  20919. if (Moyu.isKs)
  20920. this.ui.closeNode.closeBtn.x += 100;
  20921. }
  20922. show() {
  20923. super.show();
  20924. this.playSecretaryIdle();
  20925. this.moneyNode.ui.c1.selectedIndex = 1;
  20926. Laya.timer.clearAll(this);
  20927. xGame.soundMgr.playSound("s_start");
  20928. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20929. let guide = DataMgr.getSkillGuide();
  20930. this.ui.guideNode.visible = guide == 0;
  20931. let item = this.getSkillItemByUIIndex(0);
  20932. if (guide == 0) {
  20933. item.ui.c1.selectedIndex = 1;
  20934. }
  20935. else {
  20936. item.ui.c1.selectedIndex = 0;
  20937. }
  20938. this.ui.guideNode.guideBtn.visible = guide == 0;
  20939. for (let index = 0; index < this.displayList.length; index++) {
  20940. this.displayList[index].checkTry();
  20941. }
  20942. }
  20943. getSkillItemByUIIndex(cur) {
  20944. for (let index = 0; index < this.displayList.length; index++) {
  20945. if (this.displayList[index].index == cur) {
  20946. return this.displayList[index];
  20947. }
  20948. }
  20949. }
  20950. enterGuideLevel() {
  20951. let item = this.getSkillItemByUIIndex(0);
  20952. item.startGame();
  20953. if (DataMgr.getNewUser())
  20954. Moyu.sendDataEvent("gameStart1");
  20955. }
  20956. initSkillData() {
  20957. this.skillData = [];
  20958. let nameList = xGame.common.skillNameList;
  20959. let iconList = xGame.common.skillIconList;
  20960. let describeList = [
  20961. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  20962. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  20963. "The power of frost descends—freezing the flow and taking full control of the game!"
  20964. ];
  20965. console.log('zh:initSkillData 111111111');
  20966. let data;
  20967. for (let index = 0; index < nameList.length; index++) {
  20968. data = {};
  20969. data.name = nameList[index];
  20970. data.icon = iconList[index];
  20971. data.describe = describeList[index];
  20972. data.index = index;
  20973. this.skillData.push(data);
  20974. }
  20975. }
  20976. updateSkillItem(index, target) {
  20977. if (this.displayList[index] == null) {
  20978. let uiIndex;
  20979. switch (index) {
  20980. case 0:
  20981. uiIndex = 1;
  20982. break;
  20983. case 1:
  20984. uiIndex = 0;
  20985. break;
  20986. case 2:
  20987. uiIndex = 2;
  20988. break;
  20989. case 3:
  20990. uiIndex = 3;
  20991. break;
  20992. default:
  20993. break;
  20994. }
  20995. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  20996. this.displayList.push(temp);
  20997. }
  20998. }
  20999. playSecretaryIdle() {
  21000. let parent = this.ui.secretary.displayObject;
  21001. parent.destroyChildren();
  21002. let xx = this.ui.secretary.width / 2;
  21003. let yy = this.ui.secretary.height;
  21004. let scale = xGame.common.getSecretaryScale();
  21005. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21006. xGame.common.secretary.play(data, 0, true, parent);
  21007. }
  21008. returnUIMain() {
  21009. this.hide();
  21010. xGame.common.stopGirlPop(this.ui.talkNode);
  21011. xGame.uiMgr.Show(UIMain$1);
  21012. }
  21013. interuptSecretary() {
  21014. Laya.timer.clearAll(this);
  21015. this.playSecretaryRandomSound();
  21016. }
  21017. playSecretaryRandomSound() {
  21018. if (this.isHide)
  21019. return;
  21020. let time = xGame.common.randomNum(45000, 60000);
  21021. Laya.timer.once(time, this, () => {
  21022. if (this.isHide)
  21023. return;
  21024. let index = xGame.common.randomNum(4, 7);
  21025. xGame.soundMgr.playSound("s_main0" + index);
  21026. let words = 1;
  21027. switch (index) {
  21028. case 4:
  21029. words = 5;
  21030. break;
  21031. case 5:
  21032. words = 3;
  21033. break;
  21034. case 6:
  21035. words = 6;
  21036. break;
  21037. case 7:
  21038. words = 7;
  21039. break;
  21040. default:
  21041. break;
  21042. }
  21043. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21044. this.playSecretaryRandomSound();
  21045. });
  21046. }
  21047. }
  21048. UISkill$1.uiName = "UISkill";
  21049. class UIAddProp$1 extends UIBase {
  21050. constructor() {
  21051. super();
  21052. this.curType = "";
  21053. }
  21054. onConstructor() {
  21055. this.ui = ui_UIAddProp.createInstance();
  21056. this.contentPane = this.ui;
  21057. this.isEject = false;
  21058. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21059. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21060. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21061. this.updateUI();
  21062. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21063. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21064. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21065. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21066. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21067. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21068. }
  21069. show(type) {
  21070. super.show();
  21071. this.curType = type == 0 ? "coin" : "diamond";
  21072. this.switchBtn("");
  21073. this.ui.t0.play();
  21074. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21075. PlatMgr.showInsert(true);
  21076. }
  21077. closeSelf() {
  21078. this.hide();
  21079. }
  21080. updateUI() {
  21081. let data = cfgTable.moneyData;
  21082. let temp;
  21083. let obj;
  21084. for (const key in data) {
  21085. temp = data[key];
  21086. obj = this.ui.myNode["node" + key];
  21087. if (parseInt(key) <= 2) {
  21088. obj.diamondTxt.text = "+" + temp.num;
  21089. }
  21090. else {
  21091. obj.coinTxt.text = temp.num;
  21092. obj.diamondTxt.text = temp.get.split('_')[1];
  21093. }
  21094. }
  21095. this.updateDiamondShare();
  21096. }
  21097. updateDiamondShare() {
  21098. let data = DataMgr.getShareDiamondTimes();
  21099. if (data >= xGame.common.maxShareDiamondTimes) {
  21100. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21101. this.ui.myNode.node1.touchable = false;
  21102. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21103. }
  21104. else {
  21105. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21106. this.ui.myNode.node1.touchable = true;
  21107. }
  21108. }
  21109. switchBtn(type) {
  21110. if (type == "")
  21111. type = this.curType;
  21112. else {
  21113. if (this.curType == type) {
  21114. return;
  21115. }
  21116. else {
  21117. this.curType = type;
  21118. }
  21119. }
  21120. if (type == "coin") {
  21121. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21122. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21123. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21124. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21125. this.ui.myNode.c1.selectedIndex = 0;
  21126. }
  21127. else {
  21128. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21129. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21130. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21131. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21132. this.ui.myNode.c1.selectedIndex = 1;
  21133. }
  21134. }
  21135. convertCoin(index) {
  21136. let data = cfgTable.moneyData[index];
  21137. let coinNum = data.num;
  21138. let str = data.get.split('_')[1];
  21139. let needDiamond = parseInt(str);
  21140. if (DataMgr.diamondEnough(needDiamond)) {
  21141. DataMgr.setDiamond(-needDiamond);
  21142. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21143. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21144. }
  21145. else {
  21146. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21147. this.switchBtn("diamond");
  21148. }
  21149. }
  21150. videoGetDiamond() {
  21151. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21152. if (Laya.Browser.onAndroid) {
  21153. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21154. if (!boo) {
  21155. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21156. return;
  21157. }
  21158. }
  21159. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21160. }
  21161. else {
  21162. console.log('zh:AD 失败,直接发放奖励');
  21163. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21164. }
  21165. }
  21166. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21167. let num = cfgTable.moneyData[2].num;
  21168. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21169. this.closeSelf();
  21170. }
  21171. videoGetCoin() {
  21172. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21173. if (Laya.Browser.onAndroid) {
  21174. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21175. if (!boo) {
  21176. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21177. return;
  21178. }
  21179. }
  21180. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21181. }
  21182. else {
  21183. console.log('zh:AD 失败,直接发放奖励');
  21184. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21185. }
  21186. }
  21187. qjff_AD_for_uiAddProp_videoGetCoin() {
  21188. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21189. this.closeSelf();
  21190. }
  21191. shareGetDiamond() {
  21192. let times = DataMgr.getShareDiamondTimes();
  21193. if (times >= xGame.common.maxShareDiamondTimes) {
  21194. console.log('zh: 233333333333 maxShareDiamondTimes');
  21195. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21196. }
  21197. else {
  21198. console.log('zh:33333333333333ad');
  21199. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21200. if (Laya.Browser.onAndroid) {
  21201. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21202. if (!boo) {
  21203. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21204. return;
  21205. }
  21206. }
  21207. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21208. }
  21209. else {
  21210. console.log('zh:AD 失败,直接发放奖励');
  21211. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21212. }
  21213. }
  21214. }
  21215. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21216. let diamond = xGame.common.randomNum(50, 100);
  21217. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21218. DataMgr.setShareDiamondTimes(1);
  21219. this.updateDiamondShare();
  21220. }
  21221. openPutBallView() {
  21222. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21223. let skill = xGame.uiMgr.getUI(UISkill$1);
  21224. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21225. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21226. if (end && !end.isHide) {
  21227. xGame.uiMgr.Hide(UIGameEnd$1);
  21228. xGame.uiMgr.Show(UIMain$1);
  21229. }
  21230. if (skill && !skill.isHide)
  21231. xGame.uiMgr.Hide(UISkill$1);
  21232. if (uigame && !uigame.isHide)
  21233. xGame.uiMgr.Hide(UIGame$1);
  21234. if (level && !level.isHide) {
  21235. }
  21236. else {
  21237. xGame.uiMgr.Show(UILevelDisplay$1);
  21238. }
  21239. this.closeSelf();
  21240. }
  21241. }
  21242. UIAddProp$1.uiName = "UIAddProp";
  21243. class MoneyNode$1 {
  21244. constructor(ui) {
  21245. this.leftTime = 0;
  21246. this.ui = ui;
  21247. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21248. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21249. this.ui.addPowerBtn.onClick(this, this.addPower);
  21250. this.ui.c1.selectedIndex = 1;
  21251. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21252. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21253. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21254. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21255. this.coinChange();
  21256. this.diamondChange();
  21257. this.powerChange();
  21258. }
  21259. addPower() {
  21260. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21261. xGame.uiMgr.Show(UIPower$1);
  21262. }
  21263. powerChange() {
  21264. let powerNum = DataMgr.getPower();
  21265. this.ui.powerTxt.text = powerNum + "";
  21266. }
  21267. checkPowerTime() {
  21268. let cur = new Date().getTime();
  21269. let last = DataMgr.getPowerTime();
  21270. if (last == 0) {
  21271. last = cur;
  21272. DataMgr.setPowerTime(cur);
  21273. }
  21274. let power = DataMgr.getPower();
  21275. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21276. Laya.timer.clearAll(this);
  21277. if (power >= xGame.common.natureMaxPower) {
  21278. this.ui.powerTimeTxt.text = "";
  21279. DataMgr.setPowerTime(cur);
  21280. return;
  21281. }
  21282. if (power + offset >= xGame.common.natureMaxPower) {
  21283. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21284. this.ui.powerTimeTxt.text = "";
  21285. DataMgr.setPowerTime(cur);
  21286. }
  21287. else {
  21288. if (offset > 0) {
  21289. DataMgr.setPower(offset);
  21290. DataMgr.setPowerTime(cur);
  21291. }
  21292. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21293. this.leftTime = xGame.common.powerRecoverNum - time;
  21294. if (this.leftTime <= 0)
  21295. this.leftTime = 0;
  21296. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21297. Laya.timer.loop(1000, this, this.updatePowerTime);
  21298. }
  21299. }
  21300. updatePowerTime() {
  21301. this.leftTime -= 1;
  21302. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21303. if (this.leftTime <= 0) {
  21304. this.checkPowerTime();
  21305. }
  21306. }
  21307. coinChange() {
  21308. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21309. }
  21310. diamondChange() {
  21311. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21312. }
  21313. addCoin() {
  21314. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21315. Moyu.sendDataEvent("AddCoinBtn");
  21316. xGame.uiMgr.Show(UIAddProp$1, 0);
  21317. }
  21318. addDiamond() {
  21319. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21320. Moyu.sendDataEvent("AddDiamondBtn");
  21321. xGame.uiMgr.Show(UIAddProp$1, 1);
  21322. }
  21323. }
  21324. class SettingNode$1 {
  21325. constructor(ui) {
  21326. this.showSetting = false;
  21327. this.openSound = true;
  21328. this.openShake = true;
  21329. this.ui = ui;
  21330. this.ui.soundBtn.onClick(this, this.switchSound);
  21331. this.ui.shakeBtn.onClick(this, this.switchShake);
  21332. this.ui.xyBtn.onClick(this, this.onXy);
  21333. this.ui.clickNode.onClick(this, this.changeSetting);
  21334. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21335. this.ui.xyBtn.visible = false;
  21336. this.ui.shakeBtn.visible = false;
  21337. }
  21338. changeSetting() {
  21339. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21340. this.showSetting = !this.showSetting;
  21341. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21342. }
  21343. switchSound() {
  21344. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21345. this.openSound = !this.openSound;
  21346. Moyu.onSetting(this.openSound, this.openShake);
  21347. xGame.soundMgr.onSetting(this.openSound);
  21348. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21349. }
  21350. switchShake() {
  21351. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21352. this.openShake = !this.openShake;
  21353. Moyu.onSetting(this.openSound, this.openShake);
  21354. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21355. }
  21356. onXy() {
  21357. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21358. MoyuMgr$1.showXy(1);
  21359. }
  21360. }
  21361. class UIDraw$1 extends UIBase {
  21362. constructor() {
  21363. super();
  21364. this.curKey = 0;
  21365. }
  21366. onConstructor() {
  21367. this.ui = ui_UIDraw.createInstance();
  21368. this.contentPane = this.ui;
  21369. this.isEject = false;
  21370. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21371. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21372. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21373. this.initDraw();
  21374. this.initUI();
  21375. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21376. if (Moyu.isKs)
  21377. this.ui.closeNode.closeBtn.x += 100;
  21378. }
  21379. show() {
  21380. super.show();
  21381. this.ui.t0.play();
  21382. this.playSecretaryIdle();
  21383. this.updateDraw();
  21384. this.checkFree();
  21385. if (PlatMgr.bannerDelay > 0) {
  21386. this.ui.closeNode.closeBtn.visible = false;
  21387. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21388. this.ui.closeNode.closeBtn.visible = true;
  21389. });
  21390. }
  21391. PlatMgr.showRateBanner();
  21392. }
  21393. hide() {
  21394. Laya.timer.clearAll(this);
  21395. super.hide();
  21396. }
  21397. checkFree() {
  21398. let isFree = DataMgr.getDailyfreeDrawTimes();
  21399. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21400. }
  21401. initDraw() {
  21402. this.drawObj = [];
  21403. let data = cfgTable.drawData;
  21404. let temp;
  21405. let weight = 0;
  21406. for (const key in data) {
  21407. temp = data[key];
  21408. weight += temp.weight;
  21409. this.drawObj.push(weight);
  21410. }
  21411. this.allWeight = weight;
  21412. }
  21413. initUI() {
  21414. let data = cfgTable.drawData;
  21415. let temp;
  21416. let img;
  21417. let txt;
  21418. for (const key in data) {
  21419. temp = data[key];
  21420. img = this.ui.myNode.rotNode["img" + key];
  21421. txt = this.ui.myNode.rotNode["txt" + key];
  21422. img.url = xGame.common.getGameIconUrl(temp.icon);
  21423. txt.visible = true;
  21424. if (temp.award > 2) {
  21425. img.rotation = 0;
  21426. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21427. }
  21428. else {
  21429. img.rotation = temp.rotation;
  21430. txt.text = temp.num;
  21431. }
  21432. }
  21433. }
  21434. getCurkey() {
  21435. let rand = Math.random() * this.allWeight;
  21436. let temp;
  21437. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21438. temp = this.drawObj[index];
  21439. if (index == 0) {
  21440. if (rand < temp) {
  21441. return index + 1;
  21442. }
  21443. }
  21444. else {
  21445. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21446. return index + 1;
  21447. }
  21448. }
  21449. }
  21450. return 2;
  21451. }
  21452. startDraw() {
  21453. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21454. if (freeTimes > 0) {
  21455. this.beginDraw();
  21456. DataMgr.setDailyfreeDrawTimes(0);
  21457. this.checkFree();
  21458. }
  21459. else {
  21460. if (Laya.Browser.onAndroid) {
  21461. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21462. if (!boo) {
  21463. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21464. return;
  21465. }
  21466. }
  21467. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21468. }
  21469. else {
  21470. console.log('zh:AD 失败,直接发放奖励');
  21471. this.qjff_chouJiang();
  21472. }
  21473. }
  21474. }
  21475. qjff_chouJiang() {
  21476. this.beginDraw();
  21477. }
  21478. beginDraw() {
  21479. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21480. this.ui.drawBtn.touchable = false;
  21481. this.curKey = this.getCurkey();
  21482. console.log("当前key", this.curKey);
  21483. let cell = 60;
  21484. let lap = 3;
  21485. let angle = cell * (this.curKey - 1) + lap * 360;
  21486. let target = this.ui.myNode.rotNode;
  21487. target.rotation = 0;
  21488. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  21489. console.log("旋转完成");
  21490. this.ui.drawBtn.touchable = true;
  21491. this.getAward();
  21492. }));
  21493. }
  21494. getAward() {
  21495. let data = cfgTable.drawData[this.curKey];
  21496. let temp = new AwardType();
  21497. temp.type = data.award;
  21498. temp.num = data.num;
  21499. xGame.common.getAward([temp], () => {
  21500. DataMgr.setDrawTimes(1);
  21501. this.updateDraw();
  21502. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21503. });
  21504. }
  21505. updateDraw() {
  21506. let drawTimes = DataMgr.getDrawTimes();
  21507. let awardTimes = DataMgr.getDrawAwardTimes();
  21508. if (Math.floor(drawTimes / 3) > awardTimes) {
  21509. this.ui.extraNode.boxBtn.t0.play(null, -1);
  21510. this.ui.extraNode.boxBtn.touchable = true;
  21511. this.ui.extraNode.tipsTxt.text = "3/3";
  21512. this.ui.extraNode.barNode.width = 265;
  21513. this.getExtraAward();
  21514. }
  21515. else {
  21516. this.ui.extraNode.boxBtn.t0.stop();
  21517. this.ui.extraNode.boxBtn.touchable = false;
  21518. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  21519. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  21520. }
  21521. let data = cfgTable.drawData[1];
  21522. if (awardTimes == 0) {
  21523. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  21524. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  21525. this.ui.myNode.rotNode.img1.rotation = 0;
  21526. }
  21527. else {
  21528. let award = data.nextid;
  21529. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  21530. this.ui.myNode.rotNode.txt1.text = award[1];
  21531. this.ui.myNode.rotNode.img1.rotation = 0;
  21532. }
  21533. }
  21534. getExtraAward() {
  21535. let drawTimes = DataMgr.getDrawTimes();
  21536. let awardTimes = DataMgr.getDrawAwardTimes();
  21537. let data = cfgTable.drawData[1];
  21538. let award = new AwardType();
  21539. if (awardTimes == 0) {
  21540. award.num = data.num;
  21541. award.type = data.award;
  21542. xGame.common.getAward([award], () => {
  21543. let all = Math.floor(drawTimes / 3);
  21544. DataMgr.setDrawAwardTimes(all);
  21545. this.updateDraw();
  21546. });
  21547. }
  21548. else {
  21549. award.num = parseInt(data.nextid[1]);
  21550. award.type = parseInt(data.nextid[0]);
  21551. xGame.common.getAward([award], () => {
  21552. let all = Math.floor(drawTimes / 3);
  21553. DataMgr.setDrawAwardTimes(all);
  21554. this.updateDraw();
  21555. });
  21556. }
  21557. }
  21558. closeSelf() {
  21559. this.hide();
  21560. }
  21561. playSecretaryIdle() {
  21562. let parent = this.ui.secretary.displayObject;
  21563. parent.destroyChildren();
  21564. let xx = this.ui.secretary.width / 2;
  21565. let yy = this.ui.secretary.height;
  21566. let scale = xGame.common.getSecretaryScale();
  21567. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21568. xGame.common.secretary.play(data, 0, true, parent);
  21569. }
  21570. }
  21571. UIDraw$1.uiName = "UIDraw";
  21572. class UIRanking$1 extends UIBase {
  21573. constructor() {
  21574. super();
  21575. this.showSelf = true;
  21576. this.rankType = 1;
  21577. this.rankList = [];
  21578. this.topX = 10;
  21579. this.myIndex = this.topX + 1;
  21580. this.myStar = 0;
  21581. }
  21582. onConstructor() {
  21583. this.ui = ui_UIRanking.createInstance();
  21584. this.contentPane = this.ui;
  21585. this.isEject = false;
  21586. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  21587. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  21588. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  21589. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  21590. this.ui.myNode.myList.setVirtual();
  21591. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  21592. }
  21593. show() {
  21594. super.show();
  21595. this.getPaiHangBangDataFormJosnFile();
  21596. this.updateSelf();
  21597. let self = Moyu.getUserInfo();
  21598. if (!self.isAuth) {
  21599. Moyu.initUser(this, () => {
  21600. DataMgr.upRankData();
  21601. });
  21602. }
  21603. }
  21604. getPaiHangBangDataFormJosnFile() {
  21605. const rankingList = cfgTable.paiHangBangData.list;
  21606. this.updateItemData(rankingList);
  21607. }
  21608. updateSelfItem() {
  21609. console.log('zh:Moyu.platType =' + Moyu.platType);
  21610. let self = Moyu.getUserInfo();
  21611. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  21612. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  21613. if (this.myIndex > this.topX) {
  21614. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  21615. }
  21616. else {
  21617. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  21618. }
  21619. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  21620. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  21621. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  21622. }
  21623. updateItemData(data) {
  21624. this.myStar = xGame.common.getAllStarNum();
  21625. if (this.rankList.length < 2) {
  21626. this.rankList = data;
  21627. let self = Moyu.getUserInfo();
  21628. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  21629. self.headIcon = self.headIcon;
  21630. for (let i = 0; i < data.length; i++) {
  21631. let data = this.rankList[i];
  21632. if (data.userId == self.userId) {
  21633. this.rankList.splice(i, 1);
  21634. break;
  21635. }
  21636. }
  21637. for (let i = 0; i < data.length; i++) {
  21638. let data = this.rankList[i];
  21639. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  21640. this.myIndex = i + 1;
  21641. let user = { headIcon: self.headIcon, nickName: "myself" };
  21642. let ud = { user: user, data: {} };
  21643. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  21644. console.log('zh:Moyu.platType = ' + Moyu.platType);
  21645. if (Moyu.platType < 11) {
  21646. user.headIcon = self.headIcon;
  21647. user.nickName = self.nickName;
  21648. }
  21649. this.rankList.splice(i, 0, md);
  21650. break;
  21651. }
  21652. }
  21653. }
  21654. this.updateSelfItem();
  21655. this.ui.myNode.myList.numItems = this.rankList.length;
  21656. }
  21657. updateItemUI(index, obj) {
  21658. let data = this.rankList[index];
  21659. let userData = JSON.parse(data.userData).user;
  21660. obj.nameTxt.text = userData.nickName.toString();
  21661. obj.valueTxt.text = data.rankScore;
  21662. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  21663. obj.rankTxt.text = index + 1;
  21664. switch (index) {
  21665. case 0:
  21666. this.setImg(obj, 1, 0, 0);
  21667. obj.rankTxt.color = "#FFC047";
  21668. break;
  21669. case 1:
  21670. this.setImg(obj, 0, 1, 0);
  21671. obj.rankTxt.color = "#ACACAC";
  21672. break;
  21673. case 2:
  21674. this.setImg(obj, 0, 0, 1);
  21675. obj.rankTxt.color = "#D09672";
  21676. break;
  21677. default:
  21678. this.setImg(obj, 0, 0, 0);
  21679. obj.rankTxt.color = "#496FAB";
  21680. break;
  21681. }
  21682. }
  21683. setImg(obj, a, b, c) {
  21684. obj.img1.visible = a ? true : false;
  21685. obj.img2.visible = b ? true : false;
  21686. obj.img3.visible = c ? true : false;
  21687. }
  21688. changeList(type) {
  21689. this.rankType = type;
  21690. this.updateSelf();
  21691. }
  21692. changeSelfNode() {
  21693. this.showSelf = !this.showSelf;
  21694. this.updateSelf();
  21695. }
  21696. updateSelf() {
  21697. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  21698. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  21699. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21700. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  21701. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  21702. }
  21703. }
  21704. UIRanking$1.uiName = "UIRanking";
  21705. class UISecretary$1 extends UIBase {
  21706. constructor() {
  21707. super();
  21708. this.curIndex = 1;
  21709. }
  21710. onConstructor() {
  21711. this.ui = ui_UISecretary.createInstance();
  21712. this.contentPane = this.ui;
  21713. this.isEject = false;
  21714. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21715. this.nodeObj = { left: null, right: null, cur: null };
  21716. this.nodeObj.cur = this.ui.myNode.gameNode3;
  21717. }
  21718. show() {
  21719. super.show();
  21720. this.ui.t0.play();
  21721. this.updateData();
  21722. }
  21723. addSecretarySpine(node, spineName) {
  21724. if (spineName == "mishu") {
  21725. if (this.secretarySpine1) {
  21726. node.displayObject.destroyChildren();
  21727. this.playWoman(this.secretarySpine1, node.displayObject);
  21728. }
  21729. else {
  21730. let spine1 = new SpineMgr("mishu", () => {
  21731. this.secretarySpine1 = spine1;
  21732. this.playWoman(this.secretarySpine1, node.displayObject);
  21733. });
  21734. }
  21735. }
  21736. else {
  21737. if (this.secretarySpine2) {
  21738. node.displayObject.destroyChildren();
  21739. this.playWoman(this.secretarySpine2, node.displayObject);
  21740. }
  21741. else {
  21742. let spine2 = new SpineMgr("xiaomishu2", () => {
  21743. this.secretarySpine2 = spine2;
  21744. this.playWoman(this.secretarySpine2, node.displayObject);
  21745. });
  21746. }
  21747. }
  21748. }
  21749. playWoman(node, parent) {
  21750. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  21751. let yy = this.ui.myNode.gameNode3.secretary.height;
  21752. let scale = 1.5;
  21753. if (node == this.secretarySpine2) {
  21754. scale = 1.2;
  21755. }
  21756. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21757. node.play(data, 0, true, parent);
  21758. }
  21759. turnLeft() {
  21760. this.curIndex--;
  21761. if (this.curIndex < 1) {
  21762. this.curIndex = 2;
  21763. }
  21764. let left = this.nodeObj.left;
  21765. let right = this.nodeObj.right;
  21766. let cur = this.nodeObj.cur;
  21767. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21768. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21769. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21770. this.updateData();
  21771. }));
  21772. this.ui.myNode.setChildIndex(right, 2);
  21773. this.nodeObj.left = cur;
  21774. this.nodeObj.right = left;
  21775. this.nodeObj.cur = right;
  21776. }
  21777. turnRight() {
  21778. this.curIndex++;
  21779. if (this.curIndex > 2) {
  21780. this.curIndex = 1;
  21781. }
  21782. let left = this.nodeObj.left;
  21783. let right = this.nodeObj.right;
  21784. let cur = this.nodeObj.cur;
  21785. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  21786. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  21787. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  21788. this.updateData();
  21789. }));
  21790. this.ui.myNode.setChildIndex(left, 2);
  21791. this.nodeObj.left = right;
  21792. this.nodeObj.right = cur;
  21793. this.nodeObj.cur = left;
  21794. }
  21795. updateData() {
  21796. console.log('zh: updateData FFFFFFFFFF');
  21797. let data = cfgTable.secretaryshopData;
  21798. let children = this.ui.myNode._children;
  21799. let temp;
  21800. let curData;
  21801. for (let index = 0; index < children.length; index++) {
  21802. temp = children[index];
  21803. curData = data[1];
  21804. temp.heightTxt.text = curData.height;
  21805. temp.foodTxt.text = curData.food;
  21806. temp.historyTxt.text = curData.history;
  21807. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  21808. this.addSecretarySpine(temp.secretary, curData.spine);
  21809. let womanIndex = curData.id - 1;
  21810. let getWoman = DataMgr.getSecretary(womanIndex);
  21811. let curUse = DataMgr.getCurSecretary();
  21812. if (getWoman) {
  21813. if (curUse == womanIndex) {
  21814. temp.purchaseBtn.c1.selectedIndex = 1;
  21815. }
  21816. else {
  21817. temp.purchaseBtn.c1.selectedIndex = 2;
  21818. }
  21819. }
  21820. else {
  21821. temp.purchaseBtn.c1.selectedIndex = 0;
  21822. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  21823. }
  21824. temp.purchaseBtn.visible = false;
  21825. }
  21826. }
  21827. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  21828. console.log('zh: 点击了clickSecretary ');
  21829. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21830. if (getWoman) {
  21831. if (curUse != womanIndex) {
  21832. console.log();
  21833. DataMgr.setCurSecretary(womanIndex);
  21834. this.updateData();
  21835. }
  21836. }
  21837. else {
  21838. console.log('zh:点击购买了');
  21839. let need = needDiamond;
  21840. if (DataMgr.diamondEnough(need)) {
  21841. DataMgr.setDiamond(-need);
  21842. DataMgr.setSecretary(womanIndex, 1);
  21843. DataMgr.setCurSecretary(womanIndex);
  21844. this.updateData();
  21845. }
  21846. else {
  21847. xGame.uiMgr.Show(UIAddProp$1, 1);
  21848. }
  21849. }
  21850. }
  21851. closeSelf() {
  21852. this.hide();
  21853. }
  21854. }
  21855. UISecretary$1.uiName = "UISecretary";
  21856. class BallRodDisplay$1 {
  21857. constructor(ui, index) {
  21858. this.index = 0;
  21859. this.uiIndex = 0;
  21860. this.ui = ui;
  21861. this.index = index;
  21862. this.initData();
  21863. }
  21864. initData() {
  21865. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  21866. let data = cfgTable.ballrodData[this.index + 1];
  21867. this.ui.nameTxt.text = data.name;
  21868. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  21869. this.ui.levelNode.c1.selectedIndex = data.quality;
  21870. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  21871. if (data.spine) {
  21872. this.mySpine = new SpineMgr(data.spine, () => {
  21873. let xx = 150;
  21874. let yy = 70;
  21875. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  21876. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  21877. });
  21878. }
  21879. }
  21880. updateSelf() {
  21881. console.log('zh:updateSelf -------------- ');
  21882. let get = DataMgr.getBallRod(this.index);
  21883. if (get == null)
  21884. get = 1;
  21885. let curUse = DataMgr.getCurBallRod();
  21886. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21887. if (get) {
  21888. if (curUse == this.index) {
  21889. this.ui.purchaseBtn.c1.selectedIndex = 0;
  21890. }
  21891. else {
  21892. this.ui.purchaseBtn.c1.selectedIndex = 1;
  21893. }
  21894. }
  21895. else {
  21896. this.ui.purchaseBtn.c1.selectedIndex = 2;
  21897. }
  21898. }
  21899. buyBallRod() {
  21900. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21901. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  21902. switch (selectedIndex) {
  21903. case 0:
  21904. break;
  21905. case 1:
  21906. console.log('zh:点击了 USE THIS');
  21907. DataMgr.setCurBallRod(this.index);
  21908. let curUse = DataMgr.getCurBallRod();
  21909. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  21910. let ui = xGame.uiMgr.getUI(UIShop$1);
  21911. ui.updateBallRod();
  21912. break;
  21913. case 2:
  21914. let data = cfgTable.ballrodData[this.index + 1];
  21915. let need = data.price;
  21916. if (DataMgr.diamondEnough(need)) {
  21917. DataMgr.setDiamond(-need);
  21918. DataMgr.setBallRod(this.index, 1);
  21919. DataMgr.setCurBallRod(this.index);
  21920. let ui = xGame.uiMgr.getUI(UIShop$1);
  21921. ui.updateBallRod();
  21922. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  21923. }
  21924. else {
  21925. xGame.uiMgr.Show(UIAddProp$1, 1);
  21926. }
  21927. break;
  21928. default:
  21929. break;
  21930. }
  21931. }
  21932. logEventForGouMaiGan(qiuGanName) {
  21933. const ev = {
  21934. value: qiuGanName
  21935. };
  21936. const jsonStr = JSON.stringify(ev);
  21937. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  21938. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  21939. }
  21940. }
  21941. class DaoJuDisplay$1 {
  21942. constructor(ui, index) {
  21943. this.index = 0;
  21944. this.uiIndex = 0;
  21945. this.ui = ui;
  21946. this.index = index;
  21947. this.initData();
  21948. }
  21949. initData() {
  21950. this.ui.btn_buy.onClick(this, this.buySp);
  21951. this.ui.btn_buy.onClick(this, this.buyDj);
  21952. let data = cfgTable.daoJuData[this.index + 1];
  21953. console.log('zh:' + JSON.stringify(data));
  21954. this.ui.nameTxt.text = data.spbt;
  21955. this.ui.n_jiaGe.text = data.spjg + "";
  21956. this.ui.n_zuanShi.text = data.spjg + "";
  21957. let baseUrl = "asset/sound/ogg/";
  21958. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  21959. }
  21960. buyDj() {
  21961. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21962. }
  21963. buySp() {
  21964. let data = cfgTable.daoJuData[this.index + 1];
  21965. console.log('zh:点击购买 data =' + JSON.stringify(data));
  21966. }
  21967. }
  21968. class UIShop$1 extends UIBase {
  21969. constructor() {
  21970. super();
  21971. this.itemNums = 0;
  21972. this.itemNumsForDj = 0;
  21973. this.curType = "";
  21974. }
  21975. onConstructor() {
  21976. this.ui = ui_UIShop.createInstance();
  21977. this.contentPane = this.ui;
  21978. this.isEject = false;
  21979. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21980. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21981. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  21982. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  21983. this.addUIClick(this.ui, this.interuptSecretary);
  21984. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  21985. this.ballRodArr = [];
  21986. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  21987. this.ui.myNode.myList.numItems = this.itemNums;
  21988. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  21989. console.log('zh:obj=' + this.ui.myNode.djList);
  21990. this.daoJuArr = [];
  21991. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  21992. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  21993. console.log('zh:999=' + this.itemNumsForDj);
  21994. }
  21995. show(type) {
  21996. super.show();
  21997. this.curType = type == 0 ? "qiugan" : "daoju";
  21998. this.switchBtn("qiugan");
  21999. this.playSecretaryIdle();
  22000. this.updateBallRod();
  22001. }
  22002. test123() {
  22003. console.log('zh:test123 ');
  22004. }
  22005. switchBtn(type) {
  22006. console.log('zh:1111切換 sel type=' + type);
  22007. if (type == "") {
  22008. type = this.curType;
  22009. }
  22010. else {
  22011. if (this.curType == type) {
  22012. return;
  22013. }
  22014. else {
  22015. this.curType = type;
  22016. }
  22017. }
  22018. if (type == "qiugan") {
  22019. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22020. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22021. this.ui.myNode.c1.selectedIndex = 0;
  22022. this.ui.myNode.myList.visible = true;
  22023. this.ui.myNode.djList.visible = false;
  22024. }
  22025. else {
  22026. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22027. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22028. this.ui.myNode.c1.selectedIndex = 1;
  22029. this.ui.myNode.myList.visible = false;
  22030. this.ui.myNode.djList.visible = true;
  22031. }
  22032. }
  22033. updateBallRod() {
  22034. for (let index = 0; index < this.ballRodArr.length; index++) {
  22035. this.ballRodArr[index].updateSelf();
  22036. }
  22037. }
  22038. renderBallRod(sort, obj) {
  22039. let index = this.getIndexBySort(sort + 1) - 1;
  22040. let ballRod = new BallRodDisplay$1(obj, index);
  22041. this.ballRodArr.push(ballRod);
  22042. }
  22043. renderDaoJu(sort, obj) {
  22044. let index = this.getIndexBySortForDj(sort + 1) - 1;
  22045. let b = new DaoJuDisplay$1(obj, index);
  22046. this.daoJuArr.push(b);
  22047. }
  22048. getIndexBySort(sort) {
  22049. let object = cfgTable.ballrodData;
  22050. for (const key in object) {
  22051. if (object[key].sort == sort) {
  22052. return parseInt(key);
  22053. }
  22054. }
  22055. }
  22056. getIndexBySortForDj(sort) {
  22057. let object = cfgTable.daoJuData;
  22058. for (const key in object) {
  22059. if (object[key].sort == sort) {
  22060. return parseInt(key);
  22061. }
  22062. }
  22063. }
  22064. playSecretaryIdle() {
  22065. let parent = this.ui.secretary.displayObject;
  22066. parent.destroyChildren();
  22067. let xx = this.ui.secretary.width / 2;
  22068. let yy = this.ui.secretary.height;
  22069. let scale = xGame.common.getSecretaryScale();
  22070. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22071. xGame.common.secretary.play(data, 0, true, parent);
  22072. }
  22073. interuptSecretary() {
  22074. Laya.timer.clearAll(this);
  22075. this.playSecretaryRandomSound();
  22076. }
  22077. playSecretaryRandomSound() {
  22078. if (this.isHide)
  22079. return;
  22080. let time = xGame.common.randomNum(45000, 60000);
  22081. Laya.timer.once(time, this, () => {
  22082. if (this.isHide)
  22083. return;
  22084. let index = xGame.common.randomNum(4, 7);
  22085. xGame.soundMgr.playSound("s_main0" + index);
  22086. let words = 1;
  22087. switch (index) {
  22088. case 4:
  22089. words = 5;
  22090. break;
  22091. case 5:
  22092. words = 3;
  22093. break;
  22094. case 6:
  22095. words = 6;
  22096. break;
  22097. case 7:
  22098. words = 7;
  22099. break;
  22100. default:
  22101. break;
  22102. }
  22103. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22104. this.playSecretaryRandomSound();
  22105. });
  22106. }
  22107. closeSelf() {
  22108. this.hide();
  22109. }
  22110. }
  22111. UIShop$1.uiName = "UIShop";
  22112. class SignMax$1 {
  22113. constructor(ui) {
  22114. this.ui = ui;
  22115. }
  22116. updateSelf(index, sameDay, curDayIndex) {
  22117. let data = cfgTable.signData[index + 1];
  22118. this.ui.titleTxt.text = data.title;
  22119. let arr1 = data.award[0].split('-');
  22120. let arr2 = data.award[1].split('-');
  22121. let num1 = parseInt(arr1[1]);
  22122. let num2 = parseInt(arr2[1]);
  22123. this.ui.numTxt1.text = num1 + "";
  22124. this.ui.numTxt2.text = num2 + "";
  22125. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  22126. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  22127. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  22128. this.ui.numTxt1.visible = false;
  22129. }
  22130. else {
  22131. this.ui.numTxt1.visible = true;
  22132. }
  22133. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  22134. this.ui.numTxt2.visible = false;
  22135. }
  22136. else {
  22137. this.ui.numTxt2.visible = true;
  22138. }
  22139. if (index < curDayIndex) {
  22140. this.ui.c1.selectedIndex = 1;
  22141. }
  22142. else if (index == curDayIndex) {
  22143. if (sameDay) {
  22144. this.ui.c1.selectedIndex = 2;
  22145. }
  22146. else {
  22147. this.ui.c1.selectedIndex = 2;
  22148. }
  22149. }
  22150. else {
  22151. this.ui.c1.selectedIndex = 0;
  22152. }
  22153. }
  22154. }
  22155. class SignNormal$1 {
  22156. constructor(ui) {
  22157. this.ui = ui;
  22158. }
  22159. updateSelf(index, sameDay, curDayIndex) {
  22160. let data = cfgTable.signData[index + 1];
  22161. this.ui.titleTxt.text = data.title;
  22162. let arr = data.award[0].split('-');
  22163. let type = parseInt(arr[0]);
  22164. let num = parseInt(arr[1]);
  22165. this.ui.numTxt.text = num + "";
  22166. if (type > 2) {
  22167. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  22168. this.ui.myIcon.rotation = 0;
  22169. }
  22170. else {
  22171. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  22172. this.ui.myIcon.rotation = 0;
  22173. }
  22174. if (xGame.common.signAwardContainsRod(data.award)) {
  22175. this.ui.numTxt.visible = false;
  22176. }
  22177. else {
  22178. this.ui.numTxt.visible = true;
  22179. }
  22180. if (index < curDayIndex) {
  22181. this.ui.c1.selectedIndex = 1;
  22182. }
  22183. else if (index == curDayIndex) {
  22184. if (sameDay) {
  22185. this.ui.c1.selectedIndex = 2;
  22186. }
  22187. else {
  22188. this.ui.c1.selectedIndex = 2;
  22189. }
  22190. }
  22191. else {
  22192. this.ui.c1.selectedIndex = 0;
  22193. }
  22194. }
  22195. }
  22196. class UISign$1 extends UIBase {
  22197. constructor() {
  22198. super();
  22199. this.curDayIndex = 0;
  22200. this.starX = 0;
  22201. }
  22202. onConstructor() {
  22203. this.ui = ui_UISign.createInstance();
  22204. this.contentPane = this.ui;
  22205. this.isEject = false;
  22206. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22207. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22208. this.initSignItem();
  22209. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  22210. this.addUIClick(this.ui.againBtn, this.againGetAward);
  22211. }
  22212. show() {
  22213. super.show();
  22214. this.ui.t0.play();
  22215. this.playSecretaryIdle();
  22216. this.updateSign();
  22217. }
  22218. initSignItem() {
  22219. this.signArr = [];
  22220. for (let index = 0; index < 6; index++) {
  22221. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  22222. this.signArr.push(temp);
  22223. }
  22224. this.signMax = new SignMax$1(this.ui.myNode.day7);
  22225. if (Moyu.isKs)
  22226. this.ui.closeNode.closeBtn.x += 100;
  22227. }
  22228. updateSign() {
  22229. let sameDay = xGame.common.judgeSameDay();
  22230. let max = 7;
  22231. this.curDayIndex = DataMgr.getSignData();
  22232. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  22233. this.curDayIndex = 0;
  22234. if (!sameDay) {
  22235. this.ui.normalBtn.visible = true;
  22236. this.ui.tipsNode.visible = false;
  22237. this.ui.againBtn.visible = false;
  22238. }
  22239. else {
  22240. this.ui.normalBtn.visible = false;
  22241. let again = DataMgr.getExtraSign();
  22242. let isCurrency = false;
  22243. let index = this.curDayIndex;
  22244. if (index == 0)
  22245. index = 7;
  22246. let award = cfgTable.signData[index].award;
  22247. let num = award[0].split("-")[0];
  22248. if (num == "1" || num == "2")
  22249. isCurrency = true;
  22250. let showAgain = again == 0 && isCurrency;
  22251. this.ui.againBtn.visible = showAgain;
  22252. this.ui.tipsNode.visible = !showAgain;
  22253. }
  22254. for (let index = 0; index < this.signArr.length; index++) {
  22255. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  22256. }
  22257. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  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. xGame.common.secretary.play(data, 0, true, parent);
  22267. }
  22268. closeSelf() {
  22269. this.hide();
  22270. }
  22271. normalGetAward() {
  22272. let sameDay = xGame.common.judgeSameDay();
  22273. if (!sameDay) {
  22274. let award = cfgTable.signData[this.curDayIndex + 1].award;
  22275. let temp;
  22276. let type;
  22277. let num;
  22278. let arr = [];
  22279. for (let index = 0; index < award.length; index++) {
  22280. temp = award[index].split("-");
  22281. type = parseInt(temp[0]);
  22282. num = parseInt(temp[1]);
  22283. let awardType = new AwardType();
  22284. awardType.num = num;
  22285. awardType.type = type;
  22286. arr.push(awardType);
  22287. }
  22288. xGame.common.getAward(arr, (watchVideo) => {
  22289. this.curDayIndex++;
  22290. if (this.curDayIndex > 7)
  22291. this.curDayIndex = 0;
  22292. DataMgr.setSignData(this.curDayIndex);
  22293. DataMgr.setSignTime(new Date().getTime());
  22294. if (watchVideo) {
  22295. DataMgr.setExtraSign(1);
  22296. Moyu.sendDataEvent("signIn1");
  22297. }
  22298. this.updateSign();
  22299. });
  22300. }
  22301. }
  22302. againGetAward() {
  22303. Moyu.sendDataEvent("signIn2");
  22304. console.log('zh:qjff_AD_for_uisign');
  22305. if (Laya.Browser.onAndroid) {
  22306. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22307. if (!boo) {
  22308. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22309. return;
  22310. }
  22311. }
  22312. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22313. }
  22314. else {
  22315. console.log('zh:AD 失败,直接发放奖励');
  22316. this.qjff_AD_for_uisign();
  22317. }
  22318. }
  22319. qjff_AD_for_uisign() {
  22320. let index = this.curDayIndex;
  22321. if (index == 0)
  22322. index = 7;
  22323. let award = cfgTable.signData[index].award;
  22324. let temp;
  22325. let type;
  22326. let num;
  22327. for (let index = 0; index < award.length; index++) {
  22328. temp = award[index].split("-");
  22329. type = parseInt(temp[0]);
  22330. num = parseInt(temp[1]) * 3;
  22331. xGame.common.playObjFlyAnim(num, type);
  22332. }
  22333. DataMgr.setExtraSign(1);
  22334. this.updateSign();
  22335. }
  22336. }
  22337. UISign$1.uiName = "UISign";
  22338. class UIModeSelection$1 extends UIBase {
  22339. constructor() {
  22340. super();
  22341. }
  22342. onConstructor() {
  22343. this.ui = ui_UIModeSelection.createInstance();
  22344. this.contentPane = this.ui;
  22345. this.isEject = false;
  22346. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22347. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22348. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22349. this.addUIClick(this.ui.closeBtn, this.hide);
  22350. this.peopleArr = [65, 990, 580];
  22351. this.peopleOffest = [5, 10, 10];
  22352. }
  22353. show(callback) {
  22354. this.updateSelf();
  22355. super.show();
  22356. this.ui.t0.play();
  22357. this.callback = callback;
  22358. }
  22359. updateSelf() {
  22360. let cfg = cfgTable.modeselectData;
  22361. for (let index = 1; index <= 3; index++) {
  22362. let node = this.ui.myNode["type" + index];
  22363. node.need.text = cfg[index].need;
  22364. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22365. node.peopleTxt.text = this.getRandPeople(index - 1);
  22366. }
  22367. }
  22368. enterGame(type) {
  22369. console.log('zh: 进入经典模式 type: ' + type);
  22370. xGame.common.classicRoomType = type;
  22371. let cfg = cfgTable.modeselectData[type];
  22372. let need = cfg.need;
  22373. xGame.common.passAwardCoin = cfg.award;
  22374. if (DataMgr.coinEnough(need)) {
  22375. DataMgr.setCoin(-need);
  22376. this.ui.myNode["type" + type].t0.play();
  22377. Laya.timer.once(200, this, () => {
  22378. this.callback && this.callback();
  22379. });
  22380. this.logEventForClassic_start();
  22381. }
  22382. else {
  22383. Moyu.sendDataEvent("AddCoinVideo");
  22384. xGame.uiMgr.Show(UIAddProp$1, 0);
  22385. }
  22386. }
  22387. getRandPeople(index) {
  22388. let rand = this.peopleOffest[index];
  22389. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  22390. }
  22391. logEventForClassic_start() {
  22392. let rtype = xGame.common.classicRoomType;
  22393. let msmc = '';
  22394. if (rtype == 1) {
  22395. msmc = 'beginner';
  22396. }
  22397. if (rtype == 2) {
  22398. msmc = 'expert';
  22399. }
  22400. if (rtype == 3) {
  22401. msmc = 'master';
  22402. }
  22403. let keyStr = 'sjmd_classic_start_' + rtype;
  22404. let jsonStr = {
  22405. "difficulty": msmc,
  22406. "classic_count": 1,
  22407. "difficulty_count": 1
  22408. };
  22409. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22410. const d = LocalStorageManager.getItem(keyStr);
  22411. jsonStr.classic_count = d.classic_count + 1;
  22412. jsonStr.difficulty_count = d.difficulty_count + 1;
  22413. LocalStorageManager.setItem(keyStr, jsonStr);
  22414. }
  22415. else {
  22416. LocalStorageManager.setItem(keyStr, jsonStr);
  22417. }
  22418. const reqStr = JSON.stringify(jsonStr);
  22419. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  22420. }
  22421. }
  22422. UIModeSelection$1.uiName = "UIModeSelection";
  22423. class UILogin$1 extends UIBase {
  22424. constructor() {
  22425. super();
  22426. }
  22427. onConstructor() {
  22428. this.ui = ui_UILogin.createInstance();
  22429. this.contentPane = this.ui;
  22430. this.isEject = false;
  22431. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22432. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  22433. this.addUIClick(this.ui.btn_login, this.userLogin);
  22434. }
  22435. show() {
  22436. super.show();
  22437. this.x = (Laya.stage.width - this.width) / 2;
  22438. this.y = (Laya.stage.height - this.height) / 2;
  22439. }
  22440. closeSelf() {
  22441. this.hide();
  22442. }
  22443. userLogin() {
  22444. let ua = this.ui.txt_ua.text;
  22445. let up = this.ui.txt_up.text;
  22446. if (ua && up) {
  22447. let reqData = JSON.stringify({
  22448. username: ua.trim(),
  22449. password: up.trim(),
  22450. fromMark: 'app_game'
  22451. });
  22452. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  22453. try {
  22454. console.log('zh:res = ' + JSON.stringify(res));
  22455. let code = res.code;
  22456. let msg = res.msg;
  22457. if (code == 200) {
  22458. let keyStr = 'userInfo';
  22459. let jsonStr = {
  22460. "username": res.username,
  22461. "token": res.token
  22462. };
  22463. LocalStorageManager.setItem(keyStr, jsonStr);
  22464. xGame.uiMgr.Show(UIMsg$1, msg);
  22465. this.closeSelf();
  22466. }
  22467. else {
  22468. xGame.uiMgr.Show(UIMsg$1, msg);
  22469. }
  22470. }
  22471. catch (error) {
  22472. console.log('error=' + error);
  22473. alert(error);
  22474. }
  22475. finally {
  22476. }
  22477. });
  22478. }
  22479. else {
  22480. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22481. }
  22482. }
  22483. gotoRegPage() {
  22484. this.closeSelf();
  22485. xGame.uiMgr.Show(UIReg$1);
  22486. }
  22487. }
  22488. UILogin$1.uiName = "UILogin";
  22489. class UIReg$1 extends UIBase {
  22490. constructor() {
  22491. super();
  22492. }
  22493. onConstructor() {
  22494. this.ui = ui_UIReg.createInstance();
  22495. this.contentPane = this.ui;
  22496. this.isEject = false;
  22497. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22498. this.addUIClick(this.ui.btn_reg, this.regUser);
  22499. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  22500. }
  22501. show() {
  22502. super.show();
  22503. this.x = (Laya.stage.width - this.width) / 2;
  22504. this.y = (Laya.stage.height - this.height) / 2;
  22505. }
  22506. closeSelf() {
  22507. this.hide();
  22508. }
  22509. regUser() {
  22510. this.ui.lab_tip.visible = false;
  22511. let ua = this.ui.txt_ua.text;
  22512. let up1 = this.ui.txt_up1.text;
  22513. let up2 = this.ui.txt_up2.text;
  22514. if (ua && up1 && up2 && up1 == up2) {
  22515. let reqData = JSON.stringify({
  22516. username: ua.trim(),
  22517. password: up1.trim(),
  22518. fromMark: 'app_game'
  22519. });
  22520. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  22521. try {
  22522. console.log('zh:res = ' + JSON.stringify(res));
  22523. let code = res.code;
  22524. let msg = res.msg;
  22525. xGame.uiMgr.Show(UIMsg$1, msg);
  22526. if (code == 200) {
  22527. this.ui.lab_tip.color = "#FFFFFF";
  22528. xGame.uiMgr.Show(UIMsg$1, msg);
  22529. this.closeSelf();
  22530. }
  22531. else {
  22532. this.ui.lab_tip.color = "#FF0000";
  22533. xGame.uiMgr.Show(UIMsg$1, msg);
  22534. }
  22535. }
  22536. catch (error) {
  22537. console.log('error=' + error);
  22538. alert(error);
  22539. }
  22540. finally {
  22541. }
  22542. });
  22543. }
  22544. else {
  22545. if (up1 != up2) {
  22546. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  22547. }
  22548. else {
  22549. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  22550. }
  22551. }
  22552. }
  22553. gotoLogin() {
  22554. this.closeSelf();
  22555. xGame.uiMgr.Show(UILogin$1);
  22556. }
  22557. }
  22558. UIReg$1.uiName = "UIReg";
  22559. class UITry$1 extends UIBase {
  22560. constructor() {
  22561. super();
  22562. this.closeTime = 0;
  22563. this.closeNum = 0;
  22564. this.skillUrl = xGame.common.skillIconList;
  22565. }
  22566. onConstructor() {
  22567. this.ui = ui_UITry.createInstance();
  22568. this.contentPane = this.ui;
  22569. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  22570. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  22571. }
  22572. show() {
  22573. super.show();
  22574. this.closeNum = 0;
  22575. this.closeTime = 15;
  22576. this.ui.t0.play();
  22577. PlatMgr.showRateBanner();
  22578. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22579. Laya.timer.loop(1000, this, this.updateTime);
  22580. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  22581. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  22582. xGame.common.gameMgr.gamePause = true;
  22583. }
  22584. updateTime() {
  22585. if (this.closeTime > 1) {
  22586. this.closeTime--;
  22587. this.ui.myNode.txtTime.text = this.closeTime.toString();
  22588. }
  22589. else
  22590. this.hide();
  22591. }
  22592. hide() {
  22593. Laya.timer.clearAll(this);
  22594. Moyu.showBannerAd(false);
  22595. super.hide();
  22596. xGame.common.gameMgr.gamePause = false;
  22597. }
  22598. onTry() {
  22599. console.log('zh:qjff_AD_for_uitry');
  22600. if (Laya.Browser.onAndroid) {
  22601. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22602. if (!boo) {
  22603. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22604. return;
  22605. }
  22606. }
  22607. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  22608. }
  22609. else {
  22610. console.log('zh:AD 失败,直接发放奖励');
  22611. this.qjff_AD_for_uitry();
  22612. }
  22613. }
  22614. qjff_AD_for_uitry() {
  22615. let select = xGame.common.curPlayerSkillType;
  22616. DataMgr.gameData.trySkill = select;
  22617. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  22618. DataMgr.saveGameData();
  22619. DataMgr.setBigSkill(select, 1);
  22620. xGame.showTip("Trial Successful");
  22621. this.hide();
  22622. }
  22623. onCancel() {
  22624. if (this.closeNum > 0) {
  22625. this.closeNum--;
  22626. if (this.closeNum < 2)
  22627. this.hide();
  22628. return;
  22629. }
  22630. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  22631. this.onTry();
  22632. }
  22633. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  22634. this.closeNum = 3;
  22635. }
  22636. else
  22637. this.hide();
  22638. }
  22639. }
  22640. UITry$1.uiName = "UITry";
  22641. class UIGetAward$1 extends UIBase {
  22642. constructor() {
  22643. super();
  22644. this.showTriple = true;
  22645. }
  22646. onConstructor() {
  22647. this.ui = ui_UIGetAward.createInstance();
  22648. this.contentPane = this.ui;
  22649. this.isEject = false;
  22650. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  22651. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  22652. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  22653. }
  22654. show(arr, showTriple, callback) {
  22655. super.show();
  22656. this.ui.t0.play();
  22657. this.ui.eftNode.visible = true;
  22658. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  22659. this.ui.eftNode.visible = false;
  22660. }), 1, 0, 0, 0.9);
  22661. this.awardArr = arr;
  22662. this.showTriple = showTriple;
  22663. this.callback = callback;
  22664. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  22665. this.ui.myList.numItems = arr.length;
  22666. xGame.soundMgr.playSound("getaward");
  22667. }
  22668. updateSelf(index, obj) {
  22669. let temp = this.awardArr[index];
  22670. let icon = this.getIcon(temp.type);
  22671. let str = icon;
  22672. if (temp.type > 2) {
  22673. str = "s" + icon;
  22674. }
  22675. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  22676. obj.myIcon.rotation = 0;
  22677. obj.numTxt.text = temp.num + "";
  22678. obj.numTxt.visible = temp.type > 2 ? false : true;
  22679. obj.nameTxt.text = this.getNameStr(temp.type);
  22680. }
  22681. renderItem(index, obj) {
  22682. this.updateSelf(index, obj);
  22683. }
  22684. tripleGetAward() {
  22685. console.log('zh:qjff_AD_for_uigetAward');
  22686. if (Laya.Browser.onAndroid) {
  22687. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22688. if (!boo) {
  22689. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22690. return;
  22691. }
  22692. }
  22693. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  22694. }
  22695. else {
  22696. console.log('zh:AD 失败,直接发放奖励');
  22697. this.qjff_AD_for_uigetAward();
  22698. }
  22699. }
  22700. qjff_AD_for_uigetAward() {
  22701. this.getAward(3);
  22702. }
  22703. normalGetAward() {
  22704. if (PlatMgr.isMisVideo())
  22705. this.tripleGetAward();
  22706. else
  22707. this.getAward();
  22708. }
  22709. getAward(times = 1) {
  22710. this.hide();
  22711. for (let index = 0; index < this.awardArr.length; index++) {
  22712. this.awardArr[index].num *= times;
  22713. }
  22714. this.callback && this.callback(times != 1);
  22715. }
  22716. getIcon(type) {
  22717. switch (type) {
  22718. case Prop.diamond:
  22719. return "ty_zs";
  22720. case Prop.coin:
  22721. return "ty_jb";
  22722. case Prop.gan1:
  22723. return "qg1";
  22724. case Prop.gan2:
  22725. return "qg2";
  22726. case Prop.gan3:
  22727. return "qg3";
  22728. case Prop.gan4:
  22729. return "qg4";
  22730. default:
  22731. break;
  22732. }
  22733. }
  22734. getNameStr(type) {
  22735. switch (type) {
  22736. case Prop.diamond:
  22737. return "Diamond";
  22738. case Prop.coin:
  22739. return "Coins";
  22740. case Prop.gan1:
  22741. case Prop.gan2:
  22742. case Prop.gan3:
  22743. case Prop.gan4:
  22744. return cfgTable.ballrodData[type - 1].name;
  22745. default:
  22746. break;
  22747. }
  22748. }
  22749. }
  22750. UIGetAward$1.uiName = "UIGetAward";
  22751. class UIBox$1 extends UIBase {
  22752. constructor() {
  22753. super();
  22754. this.boxNum = 0;
  22755. this.boxMax = 10;
  22756. this.inAd = false;
  22757. this.isClose = false;
  22758. }
  22759. onConstructor() {
  22760. this.ui = ui_UIBox.createInstance();
  22761. this.contentPane = this.ui;
  22762. this.isEject = false;
  22763. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  22764. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  22765. Laya.timer.loop(1000, this, this.update);
  22766. }
  22767. update() {
  22768. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  22769. this.boxNum -= 1;
  22770. this.upBar();
  22771. }
  22772. }
  22773. upBar() {
  22774. if (this.boxNum > this.boxMax)
  22775. this.boxNum = this.boxMax;
  22776. this.ui.bar.value = this.boxNum * 10;
  22777. }
  22778. show() {
  22779. super.show();
  22780. this.isClose = false;
  22781. this.boxNum = 0;
  22782. this.inAd = false;
  22783. this.upBar();
  22784. this.ui.t0.play();
  22785. this.ui.closeBtn.visible = false;
  22786. Laya.timer.once(3000, this, () => {
  22787. this.ui.closeBtn.visible = true;
  22788. this.ui.bar.alpha = 1;
  22789. });
  22790. Laya.timer.once(500, this, () => {
  22791. this.ui.t1.play();
  22792. });
  22793. }
  22794. hide() {
  22795. Laya.timer.clearAll(this);
  22796. Moyu.showBannerAd(false);
  22797. super.hide();
  22798. }
  22799. onOpenBox() {
  22800. this.boxNum++;
  22801. if (this.boxNum < this.boxMax) {
  22802. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  22803. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  22804. }
  22805. }
  22806. else if (this.boxNum == this.boxMax) {
  22807. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  22808. this.ui.openBtn.c1.selectedIndex = 13;
  22809. this.inAd = true;
  22810. }
  22811. else
  22812. this.getAward();
  22813. }
  22814. else if (this.inAd) {
  22815. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  22816. if (Laya.Browser.onAndroid) {
  22817. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22818. if (!boo) {
  22819. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22820. return;
  22821. }
  22822. }
  22823. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  22824. }
  22825. else {
  22826. console.log('zh:AD 失败,直接发放奖励');
  22827. this.qjff_AD_for_UIBOX_onOpenBox();
  22828. }
  22829. }
  22830. this.upBar();
  22831. }
  22832. qjff_AD_for_UIBOX_onOpenBox() {
  22833. this.getAward();
  22834. }
  22835. onCloseBox() {
  22836. if (this.isClose)
  22837. this.hide();
  22838. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  22839. this.isClose = true;
  22840. PlatMgr.showBanner(true, 0, 3000);
  22841. }
  22842. else
  22843. this.hide();
  22844. }
  22845. getAward() {
  22846. let str = "";
  22847. if (Math.random() < 0.5) {
  22848. let max = Moyu.isLegal ? 500 : 2500;
  22849. let num = xGame.tools.random(max, 500 + max);
  22850. DataMgr.setCoin(num);
  22851. str = "金币x" + num;
  22852. }
  22853. else {
  22854. let max = Moyu.isLegal ? 10 : 30;
  22855. let num = xGame.tools.random(max, 30 + max);
  22856. DataMgr.setDiamond(num);
  22857. str = "钻石x" + num;
  22858. }
  22859. xGame.showTip("恭喜获得-" + str);
  22860. this.hide();
  22861. }
  22862. }
  22863. UIBox$1.uiName = "UIBox";
  22864. class UIMain$1 extends UIBase {
  22865. constructor() {
  22866. super();
  22867. this.firstEnter = true;
  22868. }
  22869. nativeCallJs(msg) {
  22870. let t = msg;
  22871. console.log("zh: nativeCallJs 奖励开始发放:", t);
  22872. switch (t) {
  22873. case 'qjff_chouJiang':
  22874. let dui = xGame.uiMgr.getUI(UIDraw$1);
  22875. dui.qjff_chouJiang();
  22876. break;
  22877. case 'qjff_AD_for_uisign':
  22878. let dui2 = xGame.uiMgr.getUI(UISign$1);
  22879. dui2.qjff_AD_for_uisign();
  22880. break;
  22881. case 'qjff_AD_for_uitry':
  22882. let dui3 = xGame.uiMgr.getUI(UITry$1);
  22883. dui3.qjff_AD_for_uitry();
  22884. break;
  22885. case 'qjff_AD_for_uipower':
  22886. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  22887. dui4.qjff_AD_for_uipower();
  22888. break;
  22889. case 'qjff_AD_for_uigetAward':
  22890. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  22891. dui5.qjff_AD_for_uigetAward();
  22892. break;
  22893. case 'qjff_AD_for_uiGameEnd':
  22894. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  22895. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  22896. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  22897. break;
  22898. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  22899. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  22900. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  22901. break;
  22902. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  22903. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  22904. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  22905. break;
  22906. case 'qjff_AD_for_UIrepentProp_videoRegret':
  22907. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  22908. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  22909. break;
  22910. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  22911. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  22912. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  22913. break;
  22914. case 'qjff_AD_for_UIBOX_onOpenBox':
  22915. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  22916. dui11.qjff_AD_for_UIBOX_onOpenBox();
  22917. break;
  22918. case 'qjff_AD_for_UIAddCoin':
  22919. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  22920. dui12.qjff_AD_for_UIAddCoin();
  22921. break;
  22922. case '111a':
  22923. let dui14 = xGame.uiMgr.getUI(UISign$1);
  22924. dui14.qjff_AD_for_uisign();
  22925. break;
  22926. case '222a':
  22927. let dui15 = xGame.uiMgr.getUI(UISign$1);
  22928. dui15.qjff_AD_for_uisign();
  22929. break;
  22930. case '333a':
  22931. let dui16 = xGame.uiMgr.getUI(UISign$1);
  22932. dui16.qjff_AD_for_uisign();
  22933. break;
  22934. default:
  22935. console.log('zh:未知的方法名字' + t);
  22936. break;
  22937. }
  22938. }
  22939. onConstructor() {
  22940. console.log('zh: UIMain onConstructor');
  22941. this.ui = ui_UIMain.createInstance();
  22942. this.contentPane = this.ui;
  22943. this.isEject = false;
  22944. this.addEvent();
  22945. this.addClickSpine();
  22946. this.settingNode = new SettingNode$1(this.ui.settingNode);
  22947. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22948. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  22949. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  22950. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  22951. let curUse = DataMgr.getCurSecretary();
  22952. this.changeSecretary(curUse);
  22953. this.ui.talkNode.visible = false;
  22954. let guide = DataMgr.getSkillGuide();
  22955. if (xGame.common.isNewDay && guide == 1) {
  22956. xGame.common.isNewDay = false;
  22957. xGame.soundMgr.playSound("s_main01");
  22958. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22959. console.log("zh:播放小秘书每天语音");
  22960. }
  22961. this.onGetUserInfo();
  22962. this.ui.n83.visible = false;
  22963. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22964. const d = LocalStorageManager.getItem(keyForLoginInfo);
  22965. let ua = d.username;
  22966. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  22967. }
  22968. this.c_btn_for_user();
  22969. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  22970. }
  22971. Logout() {
  22972. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22973. LocalStorageManager.removeItem(keyForLoginInfo);
  22974. this.freshUser();
  22975. }
  22976. }
  22977. gotoLogin() {
  22978. xGame.uiMgr.Show(UILogin$1);
  22979. }
  22980. gotoRegUser() {
  22981. xGame.uiMgr.Show(UIReg$1);
  22982. }
  22983. c_btn_for_user() {
  22984. this.ui.n_Logout.visible = false;
  22985. this.ui.n_dengLu.visible = false;
  22986. this.ui.n_zhuCe.visible = false;
  22987. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  22988. this.ui.n_Logout.visible = true;
  22989. }
  22990. else {
  22991. this.ui.n_dengLu.visible = true;
  22992. }
  22993. }
  22994. changeSecretary(curUse) {
  22995. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  22996. xGame.common.secretary && xGame.common.secretary.dispose();
  22997. this.addSecretarySpine(name);
  22998. }
  22999. addSecretarySpine(name) {
  23000. let spine = new SpineMgr(name, () => {
  23001. this.playSecretaryIdle();
  23002. });
  23003. xGame.common.secretary = spine;
  23004. }
  23005. addClickSpine() {
  23006. let clickSpine = new SpineMgr("dianji", () => {
  23007. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  23008. let parent = Laya.stage;
  23009. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  23010. clickSpine.play(data, 0, false, parent, (spine) => {
  23011. spine.destroy(true);
  23012. });
  23013. });
  23014. });
  23015. }
  23016. addEvent() {
  23017. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  23018. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  23019. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  23020. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  23021. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  23022. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  23023. this.addUIClick(this.ui, this.interuptSecretary);
  23024. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  23025. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  23026. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  23027. this.addUIClick(this.ui.shopBtn, this.openShopView);
  23028. this.addUIClick(this.ui.signBtn, this.openSignView);
  23029. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  23030. this.addUIClick(this.ui.rankBtn, this.openRanking);
  23031. this.addUIClick(this.ui.n_Logout, this.Logout);
  23032. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  23033. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  23034. }
  23035. show(showFailWords) {
  23036. super.show();
  23037. this.moneyNode.ui.c1.selectedIndex = 1;
  23038. this.playSecretaryIdle();
  23039. xGame.soundMgr.playMusic("caromhall01", 0);
  23040. Laya.timer.clearAll(this);
  23041. this.playSecretaryRandomSound();
  23042. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  23043. if (showFailWords) {
  23044. console.log('zh:uimain.ts ');
  23045. setTimeout(() => {
  23046. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  23047. let words = -1;
  23048. if (str == "s_main02") {
  23049. words = 2;
  23050. }
  23051. else {
  23052. words = 3;
  23053. }
  23054. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23055. xGame.soundMgr.playSound(str);
  23056. }, 300);
  23057. }
  23058. this.showGuide();
  23059. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  23060. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  23061. let guide = DataMgr.getSkillGuide();
  23062. if (guide == 1) {
  23063. let randTime = xGame.common.randomNum(300, 800);
  23064. if (this.firstEnter) {
  23065. console.log("zh: firstEnter");
  23066. this.firstEnter = false;
  23067. randTime += 900;
  23068. }
  23069. else {
  23070. console.log("zh: no firstEnter");
  23071. }
  23072. Laya.timer.once(randTime, this, () => {
  23073. xGame.common.autoPopUIView();
  23074. });
  23075. }
  23076. }
  23077. checkActive(show) {
  23078. }
  23079. showGuide() {
  23080. let guide = DataMgr.getSkillGuide();
  23081. this.ui.guideBtn.visible = guide == 0;
  23082. this.ui.enterGuide.visible = false;
  23083. this.ui.secretaryGuide.visible = guide == 0;
  23084. if (guide == 0) {
  23085. console.log("zh:显示引导");
  23086. xGame.soundMgr.playSound("s_guide");
  23087. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23088. }
  23089. else {
  23090. console.log("zh:不需要显示引导");
  23091. }
  23092. }
  23093. ensureSecretary() {
  23094. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  23095. this.ui.secretaryGuide.visible = false;
  23096. this.ui.enterGuide.visible = true;
  23097. this.ui.wordsNode.t0.play();
  23098. if (DataMgr.getNewUser())
  23099. Moyu.sendDataEvent("gameReady");
  23100. }
  23101. playSecretaryIdle() {
  23102. let parent = this.ui.secretary.displayObject;
  23103. parent.destroyChildren();
  23104. let xx = this.ui.secretary.width / 2;
  23105. let yy = this.ui.secretary.height;
  23106. let scale = xGame.common.getSecretaryScale();
  23107. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23108. xGame.common.secretary.play(data, 0, true, parent);
  23109. }
  23110. startGame(type) {
  23111. if (!this.isReadyForLoadNetSource()) {
  23112. return;
  23113. }
  23114. xGame.common.gameMode = type;
  23115. Moyu.sendDataEvent("PlayGame", { type: type });
  23116. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  23117. switch (xGame.common.gameMode) {
  23118. case GameMode.classic:
  23119. console.log('zh:进入经典模式111111111');
  23120. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  23121. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23122. console.log('zh:classic db_over_lev=', db_over_lev);
  23123. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  23124. console.log('zh:判断是否可以玩该模式classic =NO');
  23125. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  23126. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23127. return;
  23128. }
  23129. else {
  23130. console.log('zh:可以玩该模式classic 66666666666666');
  23131. this.beginGame();
  23132. }
  23133. }
  23134. else {
  23135. console.log('zh:不需要判断是否可以玩该classic');
  23136. let challengeTimes = DataMgr.getChallengeTimes();
  23137. if (challengeTimes == 0) {
  23138. xGame.uiMgr.Show(UIInvitation$1);
  23139. }
  23140. else {
  23141. this.beginGame();
  23142. }
  23143. break;
  23144. }
  23145. case GameMode.bigMove:
  23146. console.error('zh:bigMove check');
  23147. let guide = DataMgr.getSkillGuide();
  23148. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  23149. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23150. console.log('zh:bigMove db_over_lev=', db_over_lev);
  23151. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  23152. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  23153. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23154. return;
  23155. }
  23156. else {
  23157. console.log('zh:可以玩该模式 bigMove');
  23158. this.beginGame();
  23159. if (DataMgr.getNewUser())
  23160. Moyu.sendDataEvent("gameStart0");
  23161. }
  23162. }
  23163. else {
  23164. this.beginGame();
  23165. if (DataMgr.getNewUser())
  23166. Moyu.sendDataEvent("gameStart0");
  23167. }
  23168. break;
  23169. default:
  23170. console.error('zh:未知错误!!!!');
  23171. break;
  23172. }
  23173. }
  23174. beginGame(isNice = false) {
  23175. console.log('zh:beginGame ');
  23176. let guide = DataMgr.getSkillGuide();
  23177. if (guide == 1) {
  23178. console.log('zh:非新手引导,showInternAd ');
  23179. JSBridgeUtils.instance.showInternAd('beginGame');
  23180. }
  23181. else {
  23182. console.log('zh:新手引导,不显示AD ');
  23183. }
  23184. console.log('zh:beginGame 2 go');
  23185. if (xGame.common.gameMode == GameMode.classic) {
  23186. if (isNice) {
  23187. this.enterClassic();
  23188. }
  23189. else {
  23190. xGame.uiMgr.Show(UIModeSelection$1, () => {
  23191. console.log('zh:BBBBBBBBBBBBBBB');
  23192. this.enterClassic();
  23193. });
  23194. }
  23195. }
  23196. else if (xGame.common.gameMode == GameMode.bigMove) {
  23197. this.ui.enterGuide.visible = false;
  23198. xGame.uiMgr.Show(UISkill$1);
  23199. }
  23200. }
  23201. enterClassic() {
  23202. xGame.uiMgr.Show(UIGame$1);
  23203. xGame.uiMgr.Show(UIMatching$1, () => {
  23204. if (!this.isHide)
  23205. this.hide();
  23206. xGame.common.gameUI.ui.alpha = 1;
  23207. xGame.common.gameUI.startGame();
  23208. xGame.uiMgr.Hide(UIGameEnd$1);
  23209. });
  23210. }
  23211. startGlobal() {
  23212. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23213. }
  23214. startWeekly() {
  23215. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23216. }
  23217. zhouSaiMonth() {
  23218. console.log('zh: zhouSaiMonth 被调用');
  23219. }
  23220. isReadyForLoadNetSource() {
  23221. let reqCount = xGame.cfgMgr.httpReqCount;
  23222. let ok = xGame.cfgMgr.httpReqOkCount;
  23223. if (reqCount > ok) {
  23224. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  23225. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  23226. Laya.timer.once(5000, this, () => {
  23227. xGame.cfgMgr.getConfigFromServer();
  23228. });
  23229. return false;
  23230. }
  23231. return true;
  23232. }
  23233. startPlaceBall() {
  23234. if (!this.isReadyForLoadNetSource()) {
  23235. return;
  23236. }
  23237. xGame.uiMgr.Show(UILevelDisplay$1);
  23238. }
  23239. hide() {
  23240. console.log('zh:uimain hide ...');
  23241. super.hide();
  23242. xGame.common.stopGirlPop(this.ui.talkNode);
  23243. }
  23244. onGetUserInfo(force = false) {
  23245. if (Moyu.isWx) {
  23246. let info = Moyu.getSystemInfo();
  23247. if (info)
  23248. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  23249. }
  23250. else {
  23251. Moyu.initUser(this, this.freshUser, force);
  23252. }
  23253. this.freshUser();
  23254. }
  23255. freshUser() {
  23256. let user = Moyu.getUserInfo();
  23257. if (!user.isAuth) {
  23258. user.headIcon = 'res/ty_touxiang.png';
  23259. }
  23260. else {
  23261. DataMgr.upRankData();
  23262. }
  23263. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  23264. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  23265. let keyStr = keyForLoginInfo;
  23266. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23267. const d = LocalStorageManager.getItem(keyStr);
  23268. let ua = d.username;
  23269. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23270. }
  23271. else {
  23272. }
  23273. this.c_btn_for_user();
  23274. }
  23275. interuptSecretary() {
  23276. Laya.timer.clearAll(this);
  23277. this.playSecretaryRandomSound();
  23278. }
  23279. playSecretaryRandomSound() {
  23280. if (this.isHide)
  23281. return;
  23282. let time = xGame.common.randomNum(45000, 60000);
  23283. Laya.timer.once(time, this, () => {
  23284. if (this.isHide)
  23285. return;
  23286. let index = xGame.common.randomNum(4, 7);
  23287. xGame.soundMgr.playSound("s_main0" + index);
  23288. let words = 1;
  23289. switch (index) {
  23290. case 4:
  23291. words = 5;
  23292. break;
  23293. case 5:
  23294. words = 3;
  23295. break;
  23296. case 6:
  23297. words = 6;
  23298. break;
  23299. case 7:
  23300. words = 7;
  23301. break;
  23302. default:
  23303. break;
  23304. }
  23305. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23306. this.playSecretaryRandomSound();
  23307. });
  23308. }
  23309. openSecretaryView() {
  23310. xGame.uiMgr.Show(UISecretary$1);
  23311. Moyu.sendDataEvent("secretary");
  23312. }
  23313. openShopView() {
  23314. xGame.uiMgr.Show(UIShop$1, 0);
  23315. }
  23316. openSignView() {
  23317. xGame.uiMgr.Show(UISign$1);
  23318. }
  23319. openDrawView() {
  23320. xGame.uiMgr.Show(UIDraw$1);
  23321. }
  23322. openRanking() {
  23323. console.log('zh:phb openRanking');
  23324. xGame.uiMgr.Show(UIRanking$1);
  23325. Moyu.sendDataEvent("rankingList");
  23326. }
  23327. }
  23328. UIMain$1.uiName = "UIMain";
  23329. function InitShader() {
  23330. }
  23331. function appInit() {
  23332. xGame.context.init(getLoadingResList(), initCallback);
  23333. }
  23334. function getLoadingResList() {
  23335. return [
  23336. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  23337. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  23338. ];
  23339. }
  23340. function getGameResList() {
  23341. return [
  23342. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  23343. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  23344. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  23345. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  23346. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  23347. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  23348. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  23349. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  23350. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  23351. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  23352. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  23353. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  23354. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  23355. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  23356. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  23357. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  23358. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  23359. ];
  23360. }
  23361. function initCallback() {
  23362. window["DataMgr"] = DataMgr;
  23363. DataMgr.Init();
  23364. Moyu.init(getPlat(), this, () => {
  23365. DataMgr.isNewDay();
  23366. PlatMgr.initConfig();
  23367. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  23368. }, true);
  23369. console.log('zh:开始sm init1 start');
  23370. xGame.soundMgr.init();
  23371. console.log('zh:开始sm init1 end');
  23372. xGame.uiMgr.init();
  23373. xGame.uiMgr.clearTempData();
  23374. xGame.uiMgr.bindFUI(fguiRes.loading);
  23375. xGame.uiMgr.Show(UILoading);
  23376. }
  23377. function loadSubRes(callback) {
  23378. var tab = ["asset", "res", "spine"];
  23379. let subDone = 0;
  23380. for (var i = 0; i < tab.length; i++) {
  23381. let sub = tab[i];
  23382. Moyu.loadSubRes(sub, (pro) => {
  23383. callback && callback(pro, false);
  23384. }).then(() => {
  23385. subDone++;
  23386. if (subDone >= tab.length)
  23387. callback && callback(1, true);
  23388. });
  23389. }
  23390. }
  23391. function enterGame() {
  23392. xGame.cfgMgr.init();
  23393. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  23394. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  23395. xGame.uiMgr.Hide(UILoading);
  23396. fgui.UIPackage.removePackage(fguiRes.loading);
  23397. xGame.uiMgr.bindFUI(fguiRes.game);
  23398. xGame.uiMgr.Show(UIMain$1);
  23399. if (DataMgr.getNewUser())
  23400. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  23401. }
  23402. function getPlat() {
  23403. let cfg = new MoyuCfg();
  23404. cfg.plat = MoyuPlat.web;
  23405. cfg.myId = 180;
  23406. cfg.myKey = '8848a885774230a4';
  23407. cfg.version = 0;
  23408. if (window.hasOwnProperty("gamebox")) {
  23409. cfg.plat = MoyuPlat.f399;
  23410. cfg.version = 0;
  23411. }
  23412. else if (window.hasOwnProperty("ks")) {
  23413. cfg.plat = MoyuPlat.ks;
  23414. cfg.version = 0;
  23415. cfg.ads.ksVideoId = '2300002254_01';
  23416. cfg.ads.ksInsertId = '2300002254_02';
  23417. }
  23418. else if (Laya.Browser.onTTMiniGame) {
  23419. cfg.plat = MoyuPlat.tt;
  23420. cfg.version = 0;
  23421. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  23422. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  23423. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  23424. }
  23425. else if (Laya.Browser.onMiniGame) {
  23426. cfg.plat = MoyuPlat.wx;
  23427. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  23428. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  23429. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  23430. }
  23431. else if (Laya.Browser.onQQMiniGame) {
  23432. cfg.plat = MoyuPlat.qq;
  23433. }
  23434. else if (Laya.Browser.onQGMiniGame) {
  23435. cfg.plat = MoyuPlat.op;
  23436. cfg.ads.opVideoId = '455502';
  23437. cfg.ads.opBannerId = '455507';
  23438. }
  23439. else if (Laya.Browser.onVVMiniGame) {
  23440. cfg.plat = MoyuPlat.vv;
  23441. cfg.version = 0;
  23442. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  23443. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  23444. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  23445. }
  23446. else if (Laya.Browser.onHWMiniGame) {
  23447. cfg.plat = MoyuPlat.hw;
  23448. }
  23449. else if (window["mz"]) {
  23450. cfg.plat = MoyuPlat.mz;
  23451. }
  23452. else {
  23453. let cfg = window['conchConfig'];
  23454. if (cfg) {
  23455. var os = cfg.getOS();
  23456. if (os == "Conch-ios") {
  23457. cfg.plat = MoyuPlat.ios;
  23458. }
  23459. else if (os == "Conch-android") {
  23460. }
  23461. }
  23462. }
  23463. return cfg;
  23464. }
  23465. class Main {
  23466. constructor() {
  23467. if (window["Laya3D"])
  23468. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  23469. else {
  23470. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  23471. this.initMain();
  23472. }
  23473. }
  23474. initMain() {
  23475. Laya["Physics"] && Laya["Physics"].enable();
  23476. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  23477. Laya.stage.scaleMode = GameConfig.scaleMode;
  23478. Laya.stage.screenMode = GameConfig.screenMode;
  23479. Laya.stage.alignV = GameConfig.alignV;
  23480. Laya.stage.alignH = GameConfig.alignH;
  23481. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  23482. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  23483. Laya.enableDebugPanel();
  23484. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  23485. Laya["PhysicsDebugDraw"].enable();
  23486. if (GameConfig.stat)
  23487. Laya.Stat.show();
  23488. Laya.alertGlobalError(true);
  23489. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  23490. }
  23491. onVersionLoaded() {
  23492. appInit();
  23493. }
  23494. }
  23495. new Main();
  23496. }());
  23497. //# sourceMappingURL=bundle.js.map