bundle.js 947 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724
  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 TIP_MSG_key = {
  53. loginTimeOut: "Login timed out, please log in again.",
  54. pleaseLoginIn: "Please log in."
  55. };
  56. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  57. let poolKey = {
  58. inHoleEft: "inHoleEft",
  59. d3ball: "d3ball",
  60. iceEft: "iceEft",
  61. hitEft: "hitEft",
  62. fireworksEft: "fireworksEft",
  63. };
  64. var GameMode;
  65. (function (GameMode) {
  66. GameMode[GameMode["classic"] = 0] = "classic";
  67. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  68. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  69. })(GameMode || (GameMode = {}));
  70. var SkillType;
  71. (function (SkillType) {
  72. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  73. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  74. SkillType[SkillType["ice"] = 2] = "ice";
  75. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  76. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  77. })(SkillType || (SkillType = {}));
  78. var ClassicWordsType;
  79. (function (ClassicWordsType) {
  80. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  81. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  82. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  83. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  84. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  85. })(ClassicWordsType || (ClassicWordsType = {}));
  86. var PressType;
  87. (function (PressType) {
  88. PressType[PressType["powerNode"] = 0] = "powerNode";
  89. PressType[PressType["d2Root"] = 1] = "d2Root";
  90. PressType[PressType["moveNode"] = 2] = "moveNode";
  91. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  92. })(PressType || (PressType = {}));
  93. var PlaceBallType;
  94. (function (PlaceBallType) {
  95. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  96. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  97. })(PlaceBallType || (PlaceBallType = {}));
  98. var EAdType;
  99. (function (EAdType) {
  100. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  101. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  102. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  103. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  104. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  105. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  106. EAdType[EAdType["sign"] = 6] = "sign";
  107. EAdType[EAdType["draw"] = 7] = "draw";
  108. EAdType[EAdType["triple"] = 8] = "triple";
  109. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  110. EAdType[EAdType["getPower"] = 10] = "getPower";
  111. EAdType[EAdType["box"] = 11] = "box";
  112. EAdType[EAdType["try"] = 12] = "try";
  113. EAdType[EAdType["againSign"] = 13] = "againSign";
  114. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  115. })(EAdType || (EAdType = {}));
  116. var Prop;
  117. (function (Prop) {
  118. Prop[Prop["diamond"] = 1] = "diamond";
  119. Prop[Prop["coin"] = 2] = "coin";
  120. Prop[Prop["gan1"] = 3] = "gan1";
  121. Prop[Prop["gan2"] = 4] = "gan2";
  122. Prop[Prop["gan3"] = 5] = "gan3";
  123. Prop[Prop["gan4"] = 6] = "gan4";
  124. })(Prop || (Prop = {}));
  125. var TipsType;
  126. (function (TipsType) {
  127. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  128. TipsType[TipsType["foul"] = 1] = "foul";
  129. })(TipsType || (TipsType = {}));
  130. class AwardType {
  131. constructor(type, num) {
  132. this.type = type;
  133. this.num = num;
  134. }
  135. }
  136. var define = /*#__PURE__*/Object.freeze({
  137. fguiRes: fguiRes,
  138. ballCamp: ballCamp,
  139. FoulType: FoulType,
  140. ALL_BALL_STOP: ALL_BALL_STOP,
  141. WAIT_SHOOT: WAIT_SHOOT,
  142. D3RES_LOADED: D3RES_LOADED,
  143. BALL_SHOOT: BALL_SHOOT,
  144. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  145. RESET_GAME: RESET_GAME,
  146. COIN_CHANGE: COIN_CHANGE,
  147. DIAMOND_CHANGE: DIAMOND_CHANGE,
  148. RESTART_GAME: RESTART_GAME,
  149. GET_USER_INFO: GET_USER_INFO,
  150. CHANGE_SECRETARY: CHANGE_SECRETARY,
  151. POWER_CHANGE: POWER_CHANGE,
  152. POWER_TIME: POWER_TIME,
  153. keyForLoginInfo: keyForLoginInfo,
  154. TIP_MSG_key: TIP_MSG_key,
  155. baseHeadUrl: baseHeadUrl,
  156. poolKey: poolKey,
  157. get GameMode () { return GameMode; },
  158. get SkillType () { return SkillType; },
  159. get ClassicWordsType () { return ClassicWordsType; },
  160. get PressType () { return PressType; },
  161. get PlaceBallType () { return PlaceBallType; },
  162. get EAdType () { return EAdType; },
  163. get Prop () { return Prop; },
  164. get TipsType () { return TipsType; },
  165. AwardType: AwardType
  166. });
  167. class CContext {
  168. constructor() {
  169. this.winSize = { width: 0, height: 0 };
  170. this.notchHeight = 0;
  171. this.bannerHeight = 0;
  172. }
  173. init(resList, callback) {
  174. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  175. this.notchHeight = this.getNotchHeight();
  176. this.bannerHeight = this.getBannerHeight();
  177. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  178. callback && callback();
  179. }));
  180. }
  181. getNotchHeight() {
  182. let notchHeight = 50;
  183. if (Laya.Browser.onMiniGame) {
  184. let deviceInfo = wx.getSystemInfoSync();
  185. if (Laya.Browser.onIOS) {
  186. if (deviceInfo.model.search('iPhone X') != -1) {
  187. notchHeight = deviceInfo.statusBarHeight - 10;
  188. }
  189. else {
  190. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  191. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  192. notchHeight = deviceInfo.statusBarHeight - 10;
  193. }
  194. }
  195. }
  196. else if (Laya.Browser.onAndroid) {
  197. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  198. notchHeight = deviceInfo.statusBarHeight;
  199. }
  200. }
  201. }
  202. return notchHeight;
  203. }
  204. getBannerHeight() {
  205. return 0;
  206. }
  207. }
  208. let context = new CContext();
  209. var Handler = Laya.Handler;
  210. var Tween = Laya.Tween;
  211. function playClickEffect(btn) {
  212. if (!btn)
  213. return;
  214. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  215. if (!btn)
  216. return;
  217. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  218. if (!btn)
  219. return;
  220. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  221. }), 0, true);
  222. }), 0, true);
  223. }
  224. function getNumList(strList) {
  225. let dataList = [];
  226. if (strList) {
  227. let list = strList;
  228. let array = list.split(',');
  229. for (var v in array) {
  230. dataList.push(Number(array[v]));
  231. }
  232. }
  233. return dataList;
  234. }
  235. function getStrList(strList) {
  236. let dataList = [];
  237. if (strList) {
  238. let list = strList;
  239. let array = list.split('|');
  240. for (var v in array) {
  241. dataList.push(String(array[v]));
  242. }
  243. }
  244. return dataList;
  245. }
  246. function getRandStr(len) {
  247. 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'];
  248. let str = "";
  249. for (let i = 0; i < len; i++) {
  250. let rand = random(0, list.length);
  251. str += list[rand];
  252. }
  253. return str;
  254. }
  255. function getUserId() {
  256. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  257. return str;
  258. }
  259. function formatPos(pos, len = 2) {
  260. let v = Math.pow(10, len);
  261. pos.x = Math.floor(pos.x * v) / v;
  262. pos.y = Math.floor(pos.y * v) / v;
  263. if (pos.z)
  264. pos.z = Math.floor(pos.z * v) / v;
  265. return pos;
  266. }
  267. function setPosInt(pos) {
  268. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  269. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  270. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  271. return pos;
  272. }
  273. function random(min, max) {
  274. var rang = max - min;
  275. var rand = Math.random() * rang;
  276. return Math.floor(rand) + min;
  277. }
  278. function randomList(list, num) {
  279. if (list.length <= num)
  280. return list;
  281. let arry = [];
  282. list.forEach(item => {
  283. arry.push(item);
  284. });
  285. let nums = [];
  286. for (let i = 0; i < num; i++) {
  287. let rand = random(0, arry.length);
  288. let v = arry[rand];
  289. nums.push(v);
  290. arry.splice(rand, 1);
  291. }
  292. return nums;
  293. }
  294. function worldToScreen(camera, point, pos) {
  295. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  296. pos.x = pos.x / Laya.stage.clientScaleX;
  297. pos.y = pos.y / Laya.stage.clientScaleY;
  298. }
  299. function getStringLenght(str) {
  300. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  301. }
  302. function reviseString(str, len) {
  303. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  304. if (ld > len) {
  305. let sl = Math.floor(len / 2);
  306. let rs = str.substring(0, sl);
  307. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. while (d + 2 < len) {
  309. sl++;
  310. rs = str.substring(0, sl);
  311. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. }
  313. return rs + "...";
  314. }
  315. return str;
  316. }
  317. function getCoinString(coin) {
  318. if (coin < 10000)
  319. return coin.toString();
  320. else if (coin < 1000000) {
  321. let vh = Math.ceil(coin / 100);
  322. return (vh / 10) + "k";
  323. }
  324. else if (coin < 1000000000) {
  325. var vh = Math.ceil(coin / 100000);
  326. return (vh / 10) + "m";
  327. }
  328. else if (coin < 1000000000000) {
  329. var vh = Math.ceil(coin / 100000000);
  330. return (vh / 10) + "b";
  331. }
  332. else if (coin < 1000000000000000) {
  333. var vh = Math.ceil(coin / 100000000000);
  334. return (vh / 10) + "t";
  335. }
  336. }
  337. function getV3Dest(pos, dir, dis, dest) {
  338. dir.x *= dis;
  339. dir.y *= dis;
  340. dir.z *= dis;
  341. Laya.Vector3.add(pos, dir, dest);
  342. return dest;
  343. }
  344. function getV2Dest(x1, y1, dir, dis, dest) {
  345. dest.x = x1 + dir.x * dis;
  346. dest.y = y1 + dir.y * dis;
  347. return dest;
  348. }
  349. function getV2Dir(x1, y1, x2, y2, dir) {
  350. dir.x = x2 - x1;
  351. dir.y = y2 - y1;
  352. Laya.Vector2.normalize(dir, dir);
  353. return dir;
  354. }
  355. function getV3Dir(p1, p2, dir) {
  356. Laya.Vector3.subtract(p1, p2, dir);
  357. Laya.Vector3.normalize(dir, dir);
  358. return dir;
  359. }
  360. function copyPos(ip, op) {
  361. op.x = ip.x;
  362. op.y = ip.y;
  363. if (ip.z)
  364. op.z = ip.z;
  365. return op;
  366. }
  367. function getScreenImg() {
  368. let gl = Laya.WebGLContext.mainContext;
  369. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  370. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  371. let w = gl.drawingBufferWidth;
  372. let h = gl.drawingBufferHeight;
  373. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  374. texture2d.setPixels(pixels);
  375. return new Laya.Texture(texture2d);
  376. }
  377. function playMoveByPositions(sp, positions, v, completeCallback) {
  378. let p;
  379. let play = () => {
  380. if (positions.length == 0) {
  381. completeCallback();
  382. return;
  383. }
  384. p = positions[0];
  385. positions.splice(0, 1);
  386. 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, () => {
  387. play();
  388. }));
  389. };
  390. play();
  391. }
  392. function setStarPos(node, num, max) {
  393. for (let i = 1; i <= 5; i++) {
  394. let img = node.getChildAt(i - 1);
  395. img.width = img.height = 30;
  396. img.pivotX = img.pivotY = 0.5;
  397. img.gray = i > num;
  398. img.visible = i <= max;
  399. if (max == 3) {
  400. img.x = node.width / 2 + (i - 2) * 30 - 15;
  401. img.y = node.height - 40;
  402. if (i == 2)
  403. img.y = node.height - 30;
  404. }
  405. else if (max == 5) {
  406. let ly = Math.abs(i - 3);
  407. img.x = node.width / 2 + (i - 3) * 20 - 15;
  408. img.y = node.height - ly * 8 - 30;
  409. }
  410. }
  411. }
  412. function playLoopAnimRotate(sp, time, clockwise = true) {
  413. let rotation;
  414. sp.rotation = sp.rotation % 360;
  415. if (clockwise) {
  416. rotation = -360;
  417. }
  418. else {
  419. rotation = 360;
  420. }
  421. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  422. this.playLoopAnimRotate(sp, time, clockwise);
  423. }));
  424. }
  425. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  426. let x, y;
  427. if (isBig) {
  428. x = valueXMin;
  429. y = valueYMin;
  430. }
  431. else {
  432. x = valueXMax;
  433. y = valueYMax;
  434. }
  435. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  436. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  437. }));
  438. }
  439. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  440. let scale;
  441. if (isBig) {
  442. scale = valueMin;
  443. }
  444. else {
  445. scale = valueMax;
  446. }
  447. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  448. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  449. }));
  450. }
  451. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  452. let value;
  453. if (isBig) {
  454. value = valueMin;
  455. }
  456. else {
  457. value = valueMax;
  458. }
  459. if (count) {
  460. count--;
  461. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  462. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  463. }));
  464. }
  465. else {
  466. sp.rotation = 0;
  467. }
  468. }
  469. function inRect(rect, p) {
  470. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  471. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  472. return true;
  473. }
  474. }
  475. return false;
  476. }
  477. function getNumberK(number) {
  478. if (number < 1000) {
  479. return number.toString();
  480. }
  481. else {
  482. return (number / 1000).toFixed(1) + "k";
  483. }
  484. }
  485. function pointInsideCircle(point, circle, r) {
  486. if (r === 0)
  487. return false;
  488. var dx = circle.x - point.x;
  489. var dy = circle.y - point.y;
  490. return dx * dx + dy * dy <= r * r;
  491. }
  492. function formatString(str, data) {
  493. if (!str || data == undefined) {
  494. return str;
  495. }
  496. if (typeof data === "object") {
  497. for (var key in data) {
  498. if (data.hasOwnProperty(key)) {
  499. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  500. }
  501. }
  502. }
  503. else {
  504. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  505. return str.replace(reg, function (match, index) {
  506. return args[index - (-1)];
  507. });
  508. }
  509. return str;
  510. }
  511. function getIntersection(a, b) {
  512. let t = [];
  513. for (var i = 0; i < a.length; i++) {
  514. for (var j = 0; j < b.length; j++) {
  515. if (a[i] == b[j]) {
  516. t.push(a[i]);
  517. }
  518. }
  519. }
  520. return t;
  521. }
  522. function getComplement(a, b) {
  523. let t = [];
  524. let count = false;
  525. for (var i = 0; i < a.length; i++) {
  526. count = false;
  527. for (var j = 0; j < b.length; j++) {
  528. if (a[i] == b[j]) {
  529. count = true;
  530. break;
  531. }
  532. }
  533. if (!count) {
  534. t.push(a[i]);
  535. }
  536. }
  537. return t;
  538. }
  539. function geSpriteStageRect(sp) {
  540. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  541. let rect = {
  542. x: point.x,
  543. y: point.y,
  544. width: sp.width * sp.globalScaleX,
  545. height: sp.height * sp.globalScaleY
  546. };
  547. return rect;
  548. }
  549. function touchButton(button) {
  550. let event = new Laya.Event();
  551. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  552. }
  553. function setColor(sprite, r, g, b) {
  554. var redMat = [
  555. r / 255, 0, 0, 0, 0,
  556. g / 255, 0, 0, 0, 0,
  557. b / 255, 0, 0, 0, 0,
  558. 0, 0, 0, 1, 0,
  559. ];
  560. var filter = new Laya.ColorFilter(redMat);
  561. sprite.filters = [filter];
  562. }
  563. function clone(obj, newobj = {}) {
  564. for (var attr in obj) {
  565. if (typeof obj[attr] == "object") {
  566. newobj[attr] = clone(obj[attr], newobj[attr]);
  567. }
  568. else {
  569. newobj[attr] = obj[attr];
  570. }
  571. }
  572. return newobj;
  573. }
  574. function _ms(arr, compare, begin, end) {
  575. const size = end - begin;
  576. if (size <= 1) {
  577. return;
  578. }
  579. const middle = (end + begin) >> 1;
  580. _ms(arr, compare, begin, middle);
  581. _ms(arr, compare, middle, end);
  582. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  583. return;
  584. }
  585. const merged = [];
  586. let leftIndex = begin, rightIndex = middle;
  587. while (merged.length < size) {
  588. if (leftIndex === middle) {
  589. merged.push(arr[rightIndex++]);
  590. }
  591. else if (rightIndex === end) {
  592. merged.push(arr[leftIndex++]);
  593. }
  594. else {
  595. const c = compare(arr[leftIndex], arr[rightIndex]);
  596. if (c <= 0) {
  597. merged.push(arr[leftIndex++]);
  598. }
  599. else {
  600. merged.push(arr[rightIndex++]);
  601. }
  602. }
  603. }
  604. arr.splice(begin, size, ...merged);
  605. }
  606. function sort(arr, compare) {
  607. if (!Array.isArray(arr)) {
  608. throw new Error('sort的参数必须为数组');
  609. }
  610. _ms(arr, compare, 0, arr.length);
  611. return arr;
  612. }
  613. function getLanguage(id) {
  614. }
  615. function getLanguageByTip(id) {
  616. }
  617. function toWeights(array) {
  618. let max = 0;
  619. for (var i = 0; i < array.length; i++) {
  620. max = max + array[i];
  621. if (array[i] == 0) {
  622. array[i] = 0;
  623. }
  624. else {
  625. array[i] = max;
  626. }
  627. }
  628. return array;
  629. }
  630. function unique(array) {
  631. var n = {}, r = [], len = array.length, val, type;
  632. for (var i = 0; i < array.length; i++) {
  633. val = array[i];
  634. type = typeof val;
  635. if (!n[val]) {
  636. n[val] = [type];
  637. r.push(val);
  638. }
  639. else if (n[val].indexOf(type) < 0) {
  640. n[val].push(type);
  641. r.push(val);
  642. }
  643. }
  644. return r;
  645. }
  646. function unique1(array) {
  647. var r = [];
  648. for (var i = 0, l = array.length; i < l; i++) {
  649. for (var j = i + 1; j < l; j++)
  650. if (array[i] == array[j])
  651. j == ++i;
  652. r.push(array[i]);
  653. }
  654. return r;
  655. }
  656. function getDistance(x1, y1, x2, y2) {
  657. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  658. }
  659. function getV2Dis(pos1, pos2) {
  660. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  661. }
  662. function getV2SqDis(pos1, pos2) {
  663. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  664. }
  665. function getDis(x1, y1, x2, y2) {
  666. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  667. }
  668. function getDeltaxy(x1, y1, x2, y2) {
  669. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  670. }
  671. function getSymbolNumber(num) {
  672. if (num > 0) {
  673. return "+" + num;
  674. }
  675. else if (num < 0) {
  676. return num.toString();
  677. }
  678. return num.toString();
  679. }
  680. function fixNumber(num, length) {
  681. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  682. }
  683. function toThousands(num) {
  684. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  685. }
  686. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  687. function fmtMoney(money) {
  688. money = toThousands(money.replace(/^0+/, ''));
  689. if (money.length == 0) {
  690. money = "0";
  691. }
  692. let unit = 0;
  693. for (var i = 0; i < money.length; i++) {
  694. if (money.charAt(i) == ",") {
  695. unit++;
  696. }
  697. }
  698. if (unit == 0) {
  699. return money;
  700. }
  701. else {
  702. let idx = money.indexOf(",");
  703. if (idx) {
  704. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  705. }
  706. return money.replace(",", ".");
  707. }
  708. }
  709. function flatten(arr) {
  710. while (arr.some(item => Array.isArray(item))) {
  711. arr = [].concat(...arr);
  712. }
  713. return arr;
  714. }
  715. function getDistanceByPoint(p1, p2) {
  716. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  717. }
  718. function getAngleByPoint(p1, p2) {
  719. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  720. }
  721. function toIntByArray(array) {
  722. for (var index = 0; index < array.length; index++) {
  723. array[index] = parseInt(array[index]);
  724. }
  725. return array;
  726. }
  727. function getAngle0To360(angle) {
  728. while (angle < 0) {
  729. angle += 360;
  730. }
  731. while (angle >= 360) {
  732. angle -= 360;
  733. }
  734. return angle;
  735. }
  736. function toAngle(radian) {
  737. return radian * 180 / Math.PI;
  738. }
  739. function toRadian(angle) {
  740. return angle * Math.PI / 180;
  741. }
  742. function getArrayValueRandom(array) {
  743. return array[random(0, array.length - 1)];
  744. }
  745. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  746. }
  747. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  748. }
  749. function fmtTimeMMSS(time) {
  750. if (time < 0) {
  751. time = 0;
  752. }
  753. else
  754. time = Math.floor(time);
  755. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  756. }
  757. function fmtTimeMS(time) {
  758. if (time < 0) {
  759. time = 0;
  760. }
  761. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  762. }
  763. function fmtTimeHHMM(time) {
  764. if (time < 0) {
  765. time = 0;
  766. }
  767. time = Math.floor(time / 1000);
  768. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  769. }
  770. let severTime = 0;
  771. function getServerTime() {
  772. return new Date(new Date().getTime() - severTime);
  773. }
  774. function setServerTime(data) {
  775. severTime = (new Date().getTime() - data);
  776. }
  777. var tools = /*#__PURE__*/Object.freeze({
  778. playClickEffect: playClickEffect,
  779. getNumList: getNumList,
  780. getStrList: getStrList,
  781. getRandStr: getRandStr,
  782. getUserId: getUserId,
  783. formatPos: formatPos,
  784. setPosInt: setPosInt,
  785. random: random,
  786. randomList: randomList,
  787. worldToScreen: worldToScreen,
  788. getStringLenght: getStringLenght,
  789. reviseString: reviseString,
  790. getCoinString: getCoinString,
  791. getV3Dest: getV3Dest,
  792. getV2Dest: getV2Dest,
  793. getV2Dir: getV2Dir,
  794. getV3Dir: getV3Dir,
  795. copyPos: copyPos,
  796. getScreenImg: getScreenImg,
  797. playMoveByPositions: playMoveByPositions,
  798. setStarPos: setStarPos,
  799. playLoopAnimRotate: playLoopAnimRotate,
  800. playLoopAnimPosition: playLoopAnimPosition,
  801. playLoopAnimScale: playLoopAnimScale,
  802. playLoopAnimRotation: playLoopAnimRotation,
  803. inRect: inRect,
  804. getNumberK: getNumberK,
  805. pointInsideCircle: pointInsideCircle,
  806. formatString: formatString,
  807. getIntersection: getIntersection,
  808. getComplement: getComplement,
  809. geSpriteStageRect: geSpriteStageRect,
  810. touchButton: touchButton,
  811. setColor: setColor,
  812. clone: clone,
  813. sort: sort,
  814. getLanguage: getLanguage,
  815. getLanguageByTip: getLanguageByTip,
  816. toWeights: toWeights,
  817. unique: unique,
  818. unique1: unique1,
  819. getDistance: getDistance,
  820. getV2Dis: getV2Dis,
  821. getV2SqDis: getV2SqDis,
  822. getDis: getDis,
  823. getDeltaxy: getDeltaxy,
  824. getSymbolNumber: getSymbolNumber,
  825. fixNumber: fixNumber,
  826. toThousands: toThousands,
  827. fmtMoney: fmtMoney,
  828. flatten: flatten,
  829. getDistanceByPoint: getDistanceByPoint,
  830. getAngleByPoint: getAngleByPoint,
  831. toIntByArray: toIntByArray,
  832. getAngle0To360: getAngle0To360,
  833. toAngle: toAngle,
  834. toRadian: toRadian,
  835. getArrayValueRandom: getArrayValueRandom,
  836. promptByTip: promptByTip,
  837. promptByErrorCode: promptByErrorCode,
  838. fmtTimeMMSS: fmtTimeMMSS,
  839. fmtTimeMS: fmtTimeMS,
  840. fmtTimeHHMM: fmtTimeHHMM,
  841. getServerTime: getServerTime,
  842. setServerTime: setServerTime
  843. });
  844. class HttpMgr {
  845. constructor() {
  846. HttpMgr._instance = this;
  847. }
  848. static getInstance() {
  849. if (!this._instance) {
  850. this._instance = new HttpMgr();
  851. }
  852. return this._instance;
  853. }
  854. sendPost(url, data, call) {
  855. let httpObj = new Laya.HttpRequest();
  856. httpObj.http.timeout = 5000;
  857. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  858. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  859. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  860. function errorHandler(error) {
  861. console.log("errorHandler:" + error);
  862. alert("Please check your network connection.");
  863. }
  864. function completeHandler(data) {
  865. if (data && data.length > 0) {
  866. let jsonData = JSON.parse(data);
  867. if (call)
  868. call(jsonData);
  869. }
  870. }
  871. }
  872. getReqData() {
  873. let reqData = JSON.stringify({
  874. gameName: "TQ",
  875. gameUserName: "zhangSan"
  876. });
  877. return reqData;
  878. }
  879. sendPost2025(reqUrl, data, call) {
  880. let isDev = true;
  881. let urlTop = "https://api.kessongame.site/";
  882. let urlMid = urlTop + "prod-api/api/";
  883. if (isDev) {
  884. urlTop = "http://192.168.1.13:8090/";
  885. urlMid = urlTop + "api/";
  886. }
  887. let url = urlMid + reqUrl;
  888. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  889. if (isDev) {
  890. url = urlTop + reqUrl;
  891. }
  892. else {
  893. url = urlTop + "prod-api/" + reqUrl;
  894. }
  895. }
  896. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  897. if (reqUrl.indexOf("/api/game/") >= 0) {
  898. }
  899. const keyForLoginInfo = "userInfo";
  900. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  901. if (userInfoData != null) {
  902. try {
  903. let bb = JSON.parse(userInfoData);
  904. if (bb) {
  905. let token = bb.token;
  906. headers.push("Authorization");
  907. headers.push(`Bearer ${token}`);
  908. }
  909. }
  910. catch (e) {
  911. }
  912. }
  913. let httpObj = new Laya.HttpRequest();
  914. httpObj.http.timeout = 5000;
  915. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  916. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  917. httpObj.send(url, data, 'post', 'text', headers);
  918. function errorHandler(error) {
  919. if (call) {
  920. call("{'msg':'Network exception','code':500}");
  921. }
  922. else {
  923. alert("Tip:Please check your network connection.");
  924. }
  925. }
  926. function completeHandler(data) {
  927. if (data && data.length > 0) {
  928. let jsonData = JSON.parse(data);
  929. if (call)
  930. call(jsonData);
  931. }
  932. }
  933. }
  934. sendGet(url, call) {
  935. let httpObj = new Laya.HttpRequest();
  936. httpObj.http.timeout = 5000;
  937. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  938. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  939. httpObj.send(url, '', 'get');
  940. function errorHandler(error) {
  941. console.log("errorHandler:" + error);
  942. }
  943. function completeHandler(data) {
  944. if (data && data.length > 0) {
  945. if (call)
  946. call(data);
  947. }
  948. }
  949. }
  950. }
  951. HttpMgr._instance = null;
  952. class LightShader extends Laya.Sprite {
  953. constructor() {
  954. super();
  955. this._time = 0;
  956. this._sin = 0;
  957. this.initShader();
  958. }
  959. initShader() {
  960. var vs = `
  961. #define FSHIGHPRECISION
  962. attribute vec4 posuv;
  963. uniform vec2 size;
  964. varying vec4 v_texcoord;
  965. void main() {
  966. vec4 pos = vec4(posuv.xy,0.,1.);
  967. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  968. gl_Position=pos1;
  969. v_texcoord.xy = posuv.xy;
  970. }
  971. `;
  972. var ps = `
  973. #define FSHIGHPRECISION
  974. precision highp float;
  975. varying vec4 v_texcoord;
  976. uniform vec2 size;
  977. uniform sampler2D texture;
  978. uniform float u_Time;
  979. void main() {
  980. vec4 color= texture2D(texture, v_texcoord.xy);
  981. float width = 0.2;
  982. float start = u_Time;
  983. float offset = 1.0;
  984. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  985. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  986. {
  987. color.r=1.1;
  988. color.g=1.1;
  989. color.b=1.1;
  990. gl_FragColor = color;
  991. } else {
  992. gl_FragColor = color;
  993. }
  994. }
  995. `;
  996. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  997. this.customRenderEnable = true;
  998. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  999. }
  1000. customRender(context, x, y) {
  1001. this.onUpdate();
  1002. if (!this.texture)
  1003. return;
  1004. let xx = x - this.pivotX;
  1005. let yy = y - this.pivotY;
  1006. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1007. }
  1008. onUpdate() {
  1009. this._time += 2 * Laya.timer.delta * 0.001;
  1010. this._sin = Math.sin(this._time);
  1011. if (this._sin > 0.99) {
  1012. this._sin = 0;
  1013. this._time = 0;
  1014. }
  1015. this.shaderValue['u_Time'] = this._sin;
  1016. }
  1017. }
  1018. LightShader.DissolveSurfaceSaveName = 9997;
  1019. class UIBase extends fairygui.Window {
  1020. constructor() {
  1021. super();
  1022. this.isEject = true;
  1023. this.isHide = true;
  1024. this.showbanner = true;
  1025. this.className = "";
  1026. this.isMuti = false;
  1027. this.showbanner = false;
  1028. this.onConstructor();
  1029. }
  1030. checkActive(show) {
  1031. }
  1032. getUIName() {
  1033. return UIBase.uiName;
  1034. }
  1035. onConstructor() {
  1036. }
  1037. onInit() {
  1038. if (!!this.contentPane) {
  1039. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1040. }
  1041. this.setPivot(0.5, 0.5, false);
  1042. }
  1043. doShowAnimation() {
  1044. if (!this.isEject)
  1045. return;
  1046. super.doShowAnimation();
  1047. Laya.Tween.clearTween(this);
  1048. this.scaleX = this.scaleY = 0.8;
  1049. let tweenFunc1 = (func) => {
  1050. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1051. };
  1052. let tweenFunc2 = (func) => {
  1053. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1054. };
  1055. tweenFunc1(tweenFunc2);
  1056. }
  1057. show(...args) {
  1058. super.show();
  1059. this._openParam = args;
  1060. this.isHide = false;
  1061. xGame.uiMgr.checkUIState();
  1062. }
  1063. moveBannerButton() {
  1064. }
  1065. showBannerButton() {
  1066. this.bannerButton.visible = true;
  1067. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1068. this.bannerButton.touchable = true;
  1069. }));
  1070. }
  1071. hide() {
  1072. super.hide();
  1073. this.isHide = true;
  1074. xGame.uiMgr.checkUIState();
  1075. }
  1076. Dispose() {
  1077. super.dispose();
  1078. }
  1079. myUpdate(delay) {
  1080. }
  1081. refresh() { }
  1082. addUIClick(obj, func, arr = null) {
  1083. obj.onClick(this, func, arr);
  1084. obj.onClick(this, this.playBtnSound);
  1085. }
  1086. offUIClick(obj, func) {
  1087. obj.offClick(this, func);
  1088. }
  1089. playBtnSound() {
  1090. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1091. }
  1092. }
  1093. UIBase.lastShowBanner = 0;
  1094. UIBase.showBannerNum = 0;
  1095. UIBase.uiName = "";
  1096. class ui_UIDraw extends fgui.GComponent {
  1097. static createInstance() {
  1098. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1099. }
  1100. onConstruct() {
  1101. this.n1 = (this.getChild("n1"));
  1102. this.extraNode = (this.getChild("extraNode"));
  1103. this.myNode = (this.getChild("myNode"));
  1104. this.closeNode = (this.getChild("closeNode"));
  1105. this.moneyNode = (this.getChild("moneyNode"));
  1106. this.n38 = (this.getChild("n38"));
  1107. this.secretary = (this.getChild("secretary"));
  1108. this.drawBtn = (this.getChild("drawBtn"));
  1109. this.talkNode = (this.getChild("talkNode"));
  1110. this.t0 = this.getTransition("t0");
  1111. }
  1112. }
  1113. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1114. class ui_UIBox extends fgui.GComponent {
  1115. static createInstance() {
  1116. return (fgui.UIPackage.createObject("game", "UIBox"));
  1117. }
  1118. onConstruct() {
  1119. this.n0 = (this.getChild("n0"));
  1120. this.n12 = (this.getChild("n12"));
  1121. this.n1 = (this.getChild("n1"));
  1122. this.n2 = (this.getChild("n2"));
  1123. this.bar = (this.getChild("bar"));
  1124. this.closeBtn = (this.getChild("closeBtn"));
  1125. this.openBtn = (this.getChild("openBtn"));
  1126. this.t0 = this.getTransition("t0");
  1127. this.t1 = this.getTransition("t1");
  1128. }
  1129. }
  1130. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1131. class GlobalManager {
  1132. constructor() {
  1133. }
  1134. registerMethod(name, method) {
  1135. console.log('zh: 注册全局方法', name);
  1136. this[name] = method;
  1137. }
  1138. callMethod(name, ...args) {
  1139. console.log('zh: 调用全局方法', name);
  1140. if (this[name]) {
  1141. return this[name](...args);
  1142. }
  1143. else {
  1144. console.error(`zh: 全局方法 Method ${name} not found`);
  1145. }
  1146. }
  1147. }
  1148. GlobalManager.instance = new GlobalManager();
  1149. class JSBridgeUtils {
  1150. constructor() { }
  1151. static get instance() {
  1152. if (!this._instance) {
  1153. this._instance = new JSBridgeUtils();
  1154. }
  1155. return this._instance;
  1156. }
  1157. initBridge() {
  1158. if (!Laya.Browser.onAndroid) {
  1159. console.log('zh:非android dev');
  1160. return;
  1161. }
  1162. let cfg = window['conchConfig'];
  1163. if (cfg) {
  1164. var os = cfg.getOS();
  1165. if (os == "Conch-android") {
  1166. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1167. if (this.bridge) {
  1168. return true;
  1169. }
  1170. else {
  1171. return false;
  1172. }
  1173. }
  1174. else {
  1175. return false;
  1176. }
  1177. }
  1178. else {
  1179. return false;
  1180. }
  1181. }
  1182. testAd1() {
  1183. if (!Laya.Browser.onAndroid) {
  1184. console.log('zh:非android dev');
  1185. return;
  1186. }
  1187. if (!this.initBridge()) {
  1188. return;
  1189. }
  1190. let rs = this.bridge.call("testString", "hello");
  1191. console.log('zh:testString rs=' + rs);
  1192. }
  1193. testAdCallBack() {
  1194. if (!this.initBridge()) {
  1195. return;
  1196. }
  1197. console.log("zh:testAdCallBack start");
  1198. const defaultObj = { code: 200, msg: "req update Ui" };
  1199. const reqObj = { code: 300, msg: "hello java ui" };
  1200. this.bridge.callWithBack((rsStr) => {
  1201. const rsObj = JSON.parse(rsStr);
  1202. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1203. }, "testAsyncCallback", JSON.stringify(reqObj));
  1204. }
  1205. showInternAd(mark) {
  1206. console.log('zh:showInternAd start');
  1207. if (!Laya.Browser.onAndroid) {
  1208. console.log('zh:showInternAd 非android dev');
  1209. return false;
  1210. }
  1211. if (!this.initBridge()) {
  1212. return false;
  1213. }
  1214. let rs = this.bridge.call("showInternAd", mark);
  1215. try {
  1216. const result = JSON.parse(rs);
  1217. if (result.code === 200) {
  1218. console.log("zh:showInternAd OK");
  1219. return true;
  1220. }
  1221. else {
  1222. console.warn("zh:showInternAd FAILL:", result.msg);
  1223. return false;
  1224. }
  1225. }
  1226. catch (e) {
  1227. console.error("zh:解析桥接返回值失败:", e);
  1228. return false;
  1229. }
  1230. }
  1231. exitAndCloseGame() {
  1232. if (!Laya.Browser.onAndroid) {
  1233. return;
  1234. }
  1235. if (!this.initBridge()) {
  1236. return;
  1237. }
  1238. console.log('zh:开始关闭游戏-');
  1239. this.bridge.call("exitAndCloseGame");
  1240. }
  1241. showRewardAd(mark) {
  1242. if (!Laya.Browser.onAndroid) {
  1243. return false;
  1244. }
  1245. if (!this.initBridge()) {
  1246. return false;
  1247. }
  1248. let rs = this.bridge.call("showRewardAd", mark);
  1249. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1250. try {
  1251. const result = JSON.parse(rs);
  1252. if (result.code === 200) {
  1253. console.log("zh:广告显示成功");
  1254. return true;
  1255. }
  1256. else {
  1257. console.warn("zh:广告显示失败:", result.msg);
  1258. return false;
  1259. }
  1260. }
  1261. catch (e) {
  1262. console.error("zh:解析桥接返回值失败:", e);
  1263. return false;
  1264. }
  1265. }
  1266. logEventForAdNoParams(eventName) {
  1267. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1268. if (!Laya.Browser.onAndroid) {
  1269. return;
  1270. }
  1271. if (!this.initBridge()) {
  1272. return;
  1273. }
  1274. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1275. this.bridge.call("logEventForAdNoParams", eventName);
  1276. }
  1277. logEventForAdHaveParams(eventName, jsonStr) {
  1278. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1279. if (!Laya.Browser.onAndroid) {
  1280. return;
  1281. }
  1282. if (!this.initBridge()) {
  1283. return;
  1284. }
  1285. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1286. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1287. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1288. }
  1289. logEventForFirebase(eventName, jsonStr) {
  1290. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1291. if (!Laya.Browser.onAndroid) {
  1292. return;
  1293. }
  1294. if (!this.initBridge()) {
  1295. return;
  1296. }
  1297. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1298. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1299. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1300. }
  1301. testNetTip() {
  1302. if (Laya.Browser.onAndroid) {
  1303. let boo = this.getNetworkAvailable();
  1304. this.showToast2("Network error, reward unavailable");
  1305. return;
  1306. }
  1307. }
  1308. getNetworkAvailable() {
  1309. if (!Laya.Browser.onAndroid) {
  1310. return;
  1311. }
  1312. if (!this.initBridge()) {
  1313. return;
  1314. }
  1315. let boo = this.bridge.call("getNetworkAvailable");
  1316. console.log("zh:getNetworkAvailable boo=" + boo);
  1317. return boo;
  1318. }
  1319. showToast2(msg) {
  1320. if (!Laya.Browser.onAndroid) {
  1321. return;
  1322. }
  1323. if (!this.initBridge()) {
  1324. return;
  1325. }
  1326. this.bridge.call("showToast2", msg);
  1327. }
  1328. testPay() {
  1329. if (!Laya.Browser.onAndroid) {
  1330. return;
  1331. }
  1332. if (!this.initBridge()) {
  1333. return;
  1334. }
  1335. console.log('z_test:js testPay');
  1336. this.bridge.call("testPay");
  1337. }
  1338. nativeCallJs(msg) {
  1339. console.log("zh:nativeCallJs received data: 1111", msg);
  1340. if (msg === 'Ad1') {
  1341. GlobalManager.instance.callMethod('Ad1');
  1342. console.log("zh: Ad1 奖励发送成功");
  1343. }
  1344. else if (msg === 'Ad2') {
  1345. GlobalManager.instance.callMethod('Ad2');
  1346. console.log("zh: Ad2 奖励发送成功");
  1347. }
  1348. else if (msg === 'Ad3') {
  1349. GlobalManager.instance.callMethod('Ad3');
  1350. console.log("zh: Ad3 奖励发送成功");
  1351. }
  1352. else if (msg === 'Ad4') {
  1353. GlobalManager.instance.callMethod('Ad4');
  1354. console.log("zh: Ad4 奖励发送成功");
  1355. }
  1356. else if (msg === 'Ad5') {
  1357. console.log("zh: Ad5 奖励发送成功");
  1358. GlobalManager.instance.callMethod('Ad5');
  1359. }
  1360. }
  1361. }
  1362. class UIBox extends UIBase {
  1363. constructor() {
  1364. super();
  1365. this.boxNum = 0;
  1366. this.boxMax = 10;
  1367. this.inAd = false;
  1368. this.isClose = false;
  1369. }
  1370. onConstructor() {
  1371. this.ui = ui_UIBox.createInstance();
  1372. this.contentPane = this.ui;
  1373. this.isEject = false;
  1374. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1375. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1376. Laya.timer.loop(1000, this, this.update);
  1377. }
  1378. update() {
  1379. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1380. this.boxNum -= 1;
  1381. this.upBar();
  1382. }
  1383. }
  1384. upBar() {
  1385. if (this.boxNum > this.boxMax)
  1386. this.boxNum = this.boxMax;
  1387. this.ui.bar.value = this.boxNum * 10;
  1388. }
  1389. show() {
  1390. super.show();
  1391. this.isClose = false;
  1392. this.boxNum = 0;
  1393. this.inAd = false;
  1394. this.upBar();
  1395. this.ui.t0.play();
  1396. this.ui.closeBtn.visible = false;
  1397. Laya.timer.once(3000, this, () => {
  1398. this.ui.closeBtn.visible = true;
  1399. this.ui.bar.alpha = 1;
  1400. });
  1401. Laya.timer.once(500, this, () => {
  1402. this.ui.t1.play();
  1403. });
  1404. }
  1405. hide() {
  1406. Laya.timer.clearAll(this);
  1407. Moyu.showBannerAd(false);
  1408. super.hide();
  1409. }
  1410. onOpenBox() {
  1411. this.boxNum++;
  1412. if (this.boxNum < this.boxMax) {
  1413. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1414. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1415. }
  1416. }
  1417. else if (this.boxNum == this.boxMax) {
  1418. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1419. this.ui.openBtn.c1.selectedIndex = 13;
  1420. this.inAd = true;
  1421. }
  1422. else
  1423. this.getAward();
  1424. }
  1425. else if (this.inAd) {
  1426. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1427. if (Laya.Browser.onAndroid) {
  1428. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1429. if (!boo) {
  1430. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1431. return;
  1432. }
  1433. }
  1434. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1435. }
  1436. else {
  1437. console.log('zh:AD 失败,直接发放奖励');
  1438. this.qjff_AD_for_UIBOX_onOpenBox();
  1439. }
  1440. }
  1441. this.upBar();
  1442. }
  1443. qjff_AD_for_UIBOX_onOpenBox() {
  1444. this.getAward();
  1445. }
  1446. onCloseBox() {
  1447. if (this.isClose)
  1448. this.hide();
  1449. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1450. this.isClose = true;
  1451. PlatMgr.showBanner(true, 0, 3000);
  1452. }
  1453. else
  1454. this.hide();
  1455. }
  1456. getAward() {
  1457. let str = "";
  1458. if (Math.random() < 0.5) {
  1459. let max = Moyu.isLegal ? 500 : 2500;
  1460. let num = xGame.tools.random(max, 500 + max);
  1461. DataMgr.setCoin(num);
  1462. str = "金币x" + num;
  1463. }
  1464. else {
  1465. let max = Moyu.isLegal ? 10 : 30;
  1466. let num = xGame.tools.random(max, 30 + max);
  1467. DataMgr.setDiamond(num);
  1468. str = "钻石x" + num;
  1469. }
  1470. xGame.showTip("恭喜获得-" + str);
  1471. this.hide();
  1472. }
  1473. }
  1474. UIBox.uiName = "UIBox";
  1475. class ui_UITry extends fgui.GComponent {
  1476. static createInstance() {
  1477. return (fgui.UIPackage.createObject("game", "UITry"));
  1478. }
  1479. onConstruct() {
  1480. this.n11 = (this.getChild("n11"));
  1481. this.myNode = (this.getChild("myNode"));
  1482. this.t0 = this.getTransition("t0");
  1483. }
  1484. }
  1485. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1486. class UITry extends UIBase {
  1487. constructor() {
  1488. super();
  1489. this.closeTime = 0;
  1490. this.closeNum = 0;
  1491. this.skillUrl = xGame.common.skillIconList;
  1492. }
  1493. onConstructor() {
  1494. this.ui = ui_UITry.createInstance();
  1495. this.contentPane = this.ui;
  1496. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1497. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1498. }
  1499. show() {
  1500. super.show();
  1501. this.closeNum = 0;
  1502. this.closeTime = 15;
  1503. this.ui.t0.play();
  1504. PlatMgr.showRateBanner();
  1505. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1506. Laya.timer.loop(1000, this, this.updateTime);
  1507. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1508. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1509. xGame.common.gameMgr.gamePause = true;
  1510. }
  1511. updateTime() {
  1512. if (this.closeTime > 1) {
  1513. this.closeTime--;
  1514. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1515. }
  1516. else
  1517. this.hide();
  1518. }
  1519. hide() {
  1520. Laya.timer.clearAll(this);
  1521. Moyu.showBannerAd(false);
  1522. super.hide();
  1523. xGame.common.gameMgr.gamePause = false;
  1524. }
  1525. onTry() {
  1526. console.log('zh:qjff_AD_for_uitry');
  1527. if (Laya.Browser.onAndroid) {
  1528. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1529. if (!boo) {
  1530. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1531. return;
  1532. }
  1533. }
  1534. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1535. }
  1536. else {
  1537. console.log('zh:AD 失败,直接发放奖励');
  1538. this.qjff_AD_for_uitry();
  1539. }
  1540. }
  1541. qjff_AD_for_uitry() {
  1542. let select = xGame.common.curPlayerSkillType;
  1543. DataMgr.gameData.trySkill = select;
  1544. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1545. DataMgr.saveGameData();
  1546. DataMgr.setBigSkill(select, 1);
  1547. xGame.showTip("Trial Successful");
  1548. this.hide();
  1549. }
  1550. onCancel() {
  1551. if (this.closeNum > 0) {
  1552. this.closeNum--;
  1553. if (this.closeNum < 2)
  1554. this.hide();
  1555. return;
  1556. }
  1557. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1558. this.onTry();
  1559. }
  1560. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1561. this.closeNum = 3;
  1562. }
  1563. else
  1564. this.hide();
  1565. }
  1566. }
  1567. UITry.uiName = "UITry";
  1568. class PlatMgr {
  1569. static initConfig() {
  1570. this.lastVt = 0;
  1571. if (!Moyu.platConfig)
  1572. return;
  1573. for (let k in Moyu.platConfig) {
  1574. let pd = this[k];
  1575. let pc = Moyu.platConfig[k];
  1576. if (pd != undefined && pc != undefined)
  1577. this[k] = pc;
  1578. }
  1579. Moyu.setBannerPos(0.5, 1);
  1580. }
  1581. static rand100(num) {
  1582. return xGame.tools.random(0, 100) < num;
  1583. }
  1584. static isMisVideo() {
  1585. let dt = Laya.timer.currTimer - this.lastVt;
  1586. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1587. this.lastVt = Laya.timer.currTimer;
  1588. return true;
  1589. }
  1590. else {
  1591. if (this.rand100(this.fullVideoRate)) {
  1592. console.log('zh:插屏 ad start');
  1593. JSBridgeUtils.instance.showInternAd('platMgr');
  1594. }
  1595. return false;
  1596. }
  1597. }
  1598. static showVideo(call, type) {
  1599. Moyu.showVideoAd(() => {
  1600. this.lastVt = Laya.timer.currTimer;
  1601. call && call();
  1602. }, type);
  1603. }
  1604. static showInsert(delay = false) {
  1605. if (this.getRand() < this.insertRate) {
  1606. let dt = delay ? this.insertDelay : 0;
  1607. console.log('zh:插屏 ad start');
  1608. JSBridgeUtils.instance.showInternAd('gameInsert');
  1609. }
  1610. }
  1611. static gameInsert() {
  1612. let t = this.getRand();
  1613. let r = this.gameInsertRate;
  1614. if (t < r) {
  1615. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1616. }
  1617. }
  1618. static showRateBanner() {
  1619. if (this.getRand() < this.bannerRate)
  1620. this.showBanner(true, this.bannerDelay, 3000);
  1621. }
  1622. static showBanner(show, delay = 0, hide = 0) {
  1623. if (2 > 1) {
  1624. console.log('zh:显示showBanner广告 直接返回');
  1625. return;
  1626. }
  1627. if (!show)
  1628. Moyu.showBannerAd(false);
  1629. else {
  1630. Laya.timer.clear(this, this.bannerShow);
  1631. if (delay > 0)
  1632. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1633. else
  1634. this.bannerShow(true);
  1635. if (hide > 0)
  1636. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1637. }
  1638. }
  1639. static bannerShow(show) {
  1640. if (2 > 1) {
  1641. console.log('zh:显示showBanner广告 直接返回');
  1642. return;
  1643. }
  1644. Moyu.showBannerAd(show);
  1645. console.log("showBanner" + show);
  1646. }
  1647. static getRand() {
  1648. return xGame.tools.random(0, 100);
  1649. }
  1650. static openBox() {
  1651. if (this.getRand() < this.boxRate)
  1652. xGame.uiMgr.Show(UIBox);
  1653. }
  1654. static openTry() {
  1655. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1656. return;
  1657. if (this.getRand() < this.tryRate)
  1658. xGame.uiMgr.Show(UITry);
  1659. else if (DataMgr.gameData.gameCount == 1)
  1660. xGame.uiMgr.Show(UITry);
  1661. }
  1662. }
  1663. PlatMgr.forceShare = 0;
  1664. PlatMgr.signAdRate = 0;
  1665. PlatMgr.forceVideoRate = 0;
  1666. PlatMgr.forceVideoGap = 0;
  1667. PlatMgr.fullVideoRate = 0;
  1668. PlatMgr.gameInsertRate = 0;
  1669. PlatMgr.insertGap = 0;
  1670. PlatMgr.insertDelay = 0;
  1671. PlatMgr.insertRate = 0;
  1672. PlatMgr.boxRate = 0;
  1673. PlatMgr.boxVideoRate = 0;
  1674. PlatMgr.boxInsertRate = 0;
  1675. PlatMgr.boxBannerRate = 0;
  1676. PlatMgr.tryRate = 0;
  1677. PlatMgr.tryClose3Rate = 0;
  1678. PlatMgr.tryVideoRate = 0;
  1679. PlatMgr.bannerRate = 0;
  1680. PlatMgr.lastVt = 0;
  1681. class ui_UIAddProp extends fgui.GComponent {
  1682. static createInstance() {
  1683. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1684. }
  1685. onConstruct() {
  1686. this.n11 = (this.getChild("n11"));
  1687. this.myNode = (this.getChild("myNode"));
  1688. this.closeBtn = (this.getChild("closeBtn"));
  1689. this.t0 = this.getTransition("t0");
  1690. }
  1691. }
  1692. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1693. class SpineMgr {
  1694. constructor(name, loadCb = null) {
  1695. this.loaded = false;
  1696. this.spineName = '';
  1697. this.loadedCallback = loadCb;
  1698. this.templet = new Laya.Templet();
  1699. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1700. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1701. if (name === 'mishu') {
  1702. this.templet.loadAni('spine/nvmishu.sk');
  1703. }
  1704. else {
  1705. this.templet.loadAni(`spine/${name}.sk`);
  1706. }
  1707. this.templet.lock = true;
  1708. this.spineName = name;
  1709. }
  1710. onError() {
  1711. console.log("zh:spine加载出错");
  1712. }
  1713. parseComplete() {
  1714. this.loaded = true;
  1715. this.loadedCallback && this.loadedCallback();
  1716. }
  1717. dispose() {
  1718. if (this.templet && !this.templet.destroyed) {
  1719. this.templet.destroy();
  1720. }
  1721. this.templet = null;
  1722. }
  1723. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1724. if (!this.loaded) {
  1725. return;
  1726. }
  1727. let spine;
  1728. if (mySpine) {
  1729. spine = mySpine;
  1730. }
  1731. else {
  1732. spine = this.createSpine(data, parent);
  1733. }
  1734. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1735. if (!isLoop) {
  1736. spine.on(Laya.Event.STOPPED, this, () => {
  1737. spine.offAll(Laya.Event.STOPPED);
  1738. callback && callback(spine);
  1739. });
  1740. }
  1741. return spine;
  1742. }
  1743. createSpine(data, parent, type = 1) {
  1744. let spine;
  1745. spine = this.templet.buildArmature(type);
  1746. spine.showSkinByIndex(0);
  1747. parent.addChild(spine);
  1748. spine.pos(data.x, data.y);
  1749. spine.scale(data.scaleX, data.scaleY, true);
  1750. return spine;
  1751. }
  1752. }
  1753. var AIState;
  1754. (function (AIState) {
  1755. AIState[AIState["none"] = 0] = "none";
  1756. AIState[AIState["idle"] = 1] = "idle";
  1757. AIState[AIState["reset"] = 2] = "reset";
  1758. AIState[AIState["move"] = 3] = "move";
  1759. AIState[AIState["wait"] = 4] = "wait";
  1760. AIState[AIState["select"] = 5] = "select";
  1761. AIState[AIState["turn"] = 6] = "turn";
  1762. AIState[AIState["shoot"] = 7] = "shoot";
  1763. AIState[AIState["leave"] = 8] = "leave";
  1764. })(AIState || (AIState = {}));
  1765. class AIPlayer {
  1766. constructor() {
  1767. this.dtime = 30;
  1768. this.awayTime = 0;
  1769. this.awayNum = 0;
  1770. this.hideTime = 0;
  1771. this.rootMoveTime = 0;
  1772. this.isGuide = false;
  1773. this.state = AIState.none;
  1774. this.waitTime = 0;
  1775. this.forceNum = 0;
  1776. this.forceMax = 0;
  1777. this.ballSize = 33;
  1778. this.selectNum = 0;
  1779. this.destRot = 0;
  1780. this.aiLv = 10;
  1781. this.kickBall = [];
  1782. this.lineBall = [];
  1783. this.scoreBall = [];
  1784. this.holeBall = [];
  1785. this.turnNum = 0;
  1786. this.setNum = 0;
  1787. this.setMax = 0;
  1788. this.setRate = 0;
  1789. this.rectL = 0;
  1790. this.rectR = 0;
  1791. this.rectT = 0;
  1792. this.rectB = 0;
  1793. this.rootPos = { x: 0, y: 0 };
  1794. this.bestForce = 0;
  1795. this.bestAngle = 180;
  1796. this.bestPos = { x: 0, y: 0 };
  1797. this.bestKick = { x: 0, y: 0 };
  1798. this.posList = [];
  1799. this.posIdx = 0;
  1800. this.chatTime = 3000;
  1801. this.tempDir1 = new Laya.Vector2();
  1802. this.tempDir2 = new Laya.Vector2();
  1803. this.tempDir3 = new Laya.Vector2();
  1804. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1805. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1806. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1807. this.gameSrc = xGame.common.gameUI;
  1808. this.hideTime = Laya.timer.currTimer;
  1809. Moyu.setOnTipCall((id) => {
  1810. if (id == 20012)
  1811. this.hideTime = Laya.timer.currTimer;
  1812. else
  1813. (id == 20011);
  1814. {
  1815. let dt = Laya.timer.currTimer - this.hideTime;
  1816. console.log("onshow" + dt);
  1817. if (dt > 30000 && this.state > AIState.none)
  1818. xGame.common.gameMgr.aiGameEnd(false);
  1819. }
  1820. }, this);
  1821. }
  1822. init() {
  1823. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1824. this.awayTime = xGame.tools.random(5000, 10000);
  1825. this.awayNum = 0;
  1826. this.hideTime = Laya.timer.currTimer;
  1827. let rect = xGame.common.d2World.borderRect;
  1828. this.rectL = Math.ceil(rect.x) + 17;
  1829. this.rectT = Math.ceil(rect.y) + 17;
  1830. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1831. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1832. this.wBall = xGame.common.d2World.rootBall;
  1833. this.ballSize = this.wBall.gameObj.width - 1;
  1834. if (this.posList.length < 1) {
  1835. let dp = 40;
  1836. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1837. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1838. let dx = i < this.rectR ? i : this.rectR;
  1839. let dy = j < this.rectB ? j : this.rectB;
  1840. let order = xGame.tools.random(0, 1000);
  1841. this.posList.push({ x: dx, y: dy, order: order });
  1842. }
  1843. }
  1844. this.posList.sort(function (a, b) {
  1845. return a.order - b.order;
  1846. });
  1847. this.setMax = this.posList.length;
  1848. }
  1849. this.state = AIState.idle;
  1850. }
  1851. setAiLevel(num) {
  1852. this.aiLv = num;
  1853. }
  1854. initBall() {
  1855. this.rootPos.x = this.wBall.gameObj.x;
  1856. this.rootPos.y = this.wBall.gameObj.y;
  1857. this.initHoleBall();
  1858. }
  1859. initHoleBall() {
  1860. this.kickBall = [];
  1861. this.lineBall = [];
  1862. this.scoreBall = [];
  1863. this.holeBall = [];
  1864. this.selectNum = 0;
  1865. this.forceNum = 0;
  1866. this.forceMax = 0;
  1867. this.turnNum = 0;
  1868. let list = xGame.common.d2World.ballArr;
  1869. if (list.length < 20 && !this.isGuide) {
  1870. let holes = xGame.common.gameMgr.holePosList;
  1871. for (let i = 0; i < list.length; i++) {
  1872. let obj = list[i];
  1873. if (!obj)
  1874. continue;
  1875. obj.kickPos.x = 0;
  1876. obj.kickPos.y = 0;
  1877. obj.poleAngle = 0;
  1878. obj.hard = 0;
  1879. obj.borderDis = 0;
  1880. obj.kickAngle = 180;
  1881. if (obj.number == 0)
  1882. continue;
  1883. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1884. continue;
  1885. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1886. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  1887. continue;
  1888. }
  1889. let b = obj.gameObj;
  1890. let wbp = this.rootPos;
  1891. let bx = wbp.x - b.x;
  1892. let by = wbp.y - b.y;
  1893. obj.borderDis = xGame.tools.random(0, 100);
  1894. this.kickBall.push(obj);
  1895. if (!this.isLine(wbp, obj))
  1896. continue;
  1897. obj.kickAngle = xGame.tools.random(90, 180);
  1898. obj.kickPos.x = b.x;
  1899. obj.kickPos.y = b.y;
  1900. this.lineBall.push(obj);
  1901. let minDis = 999999;
  1902. let hole = false;
  1903. for (let j = 0; j < holes.length; j++) {
  1904. let hp = holes[j];
  1905. if (bx >= 0 && hp.x > b.x + 100)
  1906. continue;
  1907. if (bx <= 0 && hp.x < b.x - 100)
  1908. continue;
  1909. if (by < -10 && hp.y < wbp.y)
  1910. continue;
  1911. if (by > 10 && hp.y > wbp.y)
  1912. continue;
  1913. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  1914. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  1915. if (dis < minDis) {
  1916. let dx = b.x - this.tempDir1.x * this.ballSize;
  1917. let dy = b.y - this.tempDir1.y * this.ballSize;
  1918. this.tempDir3.x = this.tempDir1.x;
  1919. this.tempDir3.y = this.tempDir1.y;
  1920. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  1921. obj.kickPos.x = dx;
  1922. obj.kickPos.y = dy;
  1923. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  1924. if (num > 1)
  1925. num = 1;
  1926. obj.kickAngle = Math.acos(num) * 57.3;
  1927. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  1928. dis = dis * 2;
  1929. if (Math.abs(hp.x - 600) < 100)
  1930. dis += 50;
  1931. obj.hard = dis + obj.kickAngle * 3;
  1932. hole = true;
  1933. }
  1934. }
  1935. }
  1936. }
  1937. if (hole) {
  1938. this.scoreBall.push(obj);
  1939. this.holeBall.push(obj);
  1940. }
  1941. }
  1942. this.scoreBall.sort(function (a, b) {
  1943. return a.hard - b.hard;
  1944. });
  1945. this.holeBall.sort(function (a, b) {
  1946. return a.kickAngle - b.kickAngle;
  1947. });
  1948. this.kickBall.sort(function (a, b) {
  1949. return a.borderDis - b.borderDis;
  1950. });
  1951. }
  1952. else {
  1953. let max = list.length - 1;
  1954. let i = xGame.tools.random(0, max);
  1955. for (i; i <= max; i++) {
  1956. let idx = i >= max ? i -= max : i;
  1957. let obj = list[idx];
  1958. if (obj && obj.number != 0) {
  1959. obj.kickAngle = xGame.tools.random(90, 180);
  1960. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  1961. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  1962. this.lineBall.push(obj);
  1963. break;
  1964. }
  1965. }
  1966. }
  1967. }
  1968. selectBall() {
  1969. let ball = null;
  1970. this.destRot = 0;
  1971. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  1972. let ai = 110 - this.aiLv * 10;
  1973. let mis = xGame.tools.random(-ai, ai) * 0.005;
  1974. let score = false;
  1975. if (this.scoreBall.length < 1) {
  1976. if (this.lineBall.length < 1) {
  1977. for (let i = 0; i < this.kickBall.length; i++) {
  1978. let list = [];
  1979. let bo = this.kickBall[i];
  1980. let bobj = bo.gameObj;
  1981. let rect = xGame.common.d2World.borderRect;
  1982. let mobj = this.wBall.gameObj;
  1983. let minb = bobj.y - rect.y - 20;
  1984. let minw = mobj.y - rect.y - 50;
  1985. if (minb > 0 && minw > 0) {
  1986. let dlenx = 0;
  1987. let dleny = mobj.y - rect.y;
  1988. let spx = mobj.x;
  1989. let spy = rect.y - dleny;
  1990. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  1991. }
  1992. minb = rect.y + rect.height - bobj.y - 20;
  1993. minw = rect.y + rect.height - mobj.y - 50;
  1994. if (minb > 0 && minw > 0) {
  1995. let dlenx = 0;
  1996. let dleny = rect.y + rect.height - mobj.y;
  1997. let spx = mobj.x;
  1998. let spy = rect.y + rect.height + dleny;
  1999. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2000. }
  2001. minb = bobj.x - rect.x - 20;
  2002. minw = mobj.x - rect.x - 50;
  2003. if (minb > 0 && minw > 0) {
  2004. let dlenx = mobj.x - rect.x;
  2005. let dleny = 0;
  2006. let spx = rect.x - dlenx;
  2007. let spy = mobj.y;
  2008. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2009. }
  2010. minb = rect.x + rect.width - bobj.x - 20;
  2011. minw = rect.x + rect.width - mobj.x - 50;
  2012. if (minb > 0 && minw > 0) {
  2013. let dlenx = rect.x + rect.width - mobj.x;
  2014. let dleny = 0;
  2015. let spx = rect.x + rect.width + dlenx;
  2016. let spy = mobj.y;
  2017. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2018. }
  2019. list.sort(function (a, b) {
  2020. return a.order - b.order;
  2021. });
  2022. for (let i = 0; i < list.length; i++) {
  2023. let data = list[i];
  2024. let mx = mobj.x - bobj.x;
  2025. let my = mobj.y - bobj.y;
  2026. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2027. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2028. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2029. if (num > 1)
  2030. num = 1;
  2031. let cos = Math.acos(num);
  2032. if (cos > 1.57)
  2033. cos = 1.57;
  2034. else if (cos < 0.01)
  2035. cos = 0.01;
  2036. let tan = Math.tan(cos);
  2037. let dx = tan * data.dleny;
  2038. let dy = tan * data.dlenx;
  2039. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2040. if (Math.abs(bx - 667) < 40)
  2041. continue;
  2042. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2043. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2044. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2045. this.forceMax = dis * 0.08;
  2046. this.destRot += mis * 0.1;
  2047. this.setKick(bx, by);
  2048. return true;
  2049. }
  2050. }
  2051. }
  2052. }
  2053. else {
  2054. ball = xGame.common.getRandArrEle(this.lineBall);
  2055. }
  2056. }
  2057. else {
  2058. for (let i = 0; i < this.scoreBall.length; i++) {
  2059. if (i < this.scoreBall.length - 1) {
  2060. let rand = 70 + this.aiLv * 10 + i * 10;
  2061. if (xGame.tools.random(0, 100) < rand) {
  2062. ball = this.scoreBall[i];
  2063. break;
  2064. }
  2065. }
  2066. else {
  2067. ball = this.scoreBall[i];
  2068. break;
  2069. }
  2070. }
  2071. score = true;
  2072. this.selectNum++;
  2073. }
  2074. if (!ball)
  2075. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2076. if (this.selectNum >= max) {
  2077. let dx = ball.gameObj.x;
  2078. let dy = ball.gameObj.y;
  2079. let kickAngle = 0;
  2080. if (score) {
  2081. dx = ball.kickPos.x;
  2082. dy = ball.kickPos.y;
  2083. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2084. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2085. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2086. if (adot > 1)
  2087. adot = 1;
  2088. kickAngle = Math.acos(adot) * 57.3;
  2089. if (kickAngle > 45) {
  2090. let kdx = ball.kickPos.x - ball.gameObj.x;
  2091. let kdy = ball.kickPos.y - ball.gameObj.y;
  2092. dx = ball.kickPos.x - kdx * mis * 0.3;
  2093. dy = ball.kickPos.y - kdy * mis * 0.3;
  2094. }
  2095. else
  2096. this.destRot += mis;
  2097. }
  2098. else if (ball.poleAngle != 0) {
  2099. this.destRot += ball.poleAngle;
  2100. }
  2101. if (xGame.common.gameMode == 0) {
  2102. let af = kickAngle * 0.08;
  2103. this.forceMax = ball.hard * 0.1 + af * af;
  2104. }
  2105. this.setKick(dx, dy);
  2106. }
  2107. else {
  2108. let rand = this.aiLv * 5 + 40;
  2109. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2110. ball = xGame.common.getRandArrEle(this.scoreBall);
  2111. else
  2112. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2113. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2114. if (xGame.tools.random(0, 100) > rand) {
  2115. this.selectNum = max;
  2116. }
  2117. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2118. this.selectNum++;
  2119. }
  2120. ball.onClick(0, true);
  2121. }
  2122. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2123. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2124. let balls = xGame.common.d2World.ballArr;
  2125. let max = xGame.tools.getDis(hx, hy, bx, by);
  2126. for (let index = 0; index < balls.length; index++) {
  2127. let obj = balls[index];
  2128. if (obj.number == 0)
  2129. continue;
  2130. if (obj.number == bn || obj.number == dn)
  2131. continue;
  2132. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2133. if (dis * dis > max)
  2134. continue;
  2135. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2136. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2137. if (num > 1)
  2138. num = 1;
  2139. if (num < 0)
  2140. continue;
  2141. let gap = Math.sin(Math.acos(num)) * dis;
  2142. if (gap < this.ballSize)
  2143. return true;
  2144. }
  2145. return false;
  2146. }
  2147. isLine(xy, ball) {
  2148. let bx = xy.x;
  2149. let by = xy.y;
  2150. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2151. let dis = ball.getDestDis(xy);
  2152. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2153. let sin = Math.sin(angle);
  2154. let cos = Math.cos(angle);
  2155. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2156. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2157. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2158. let dx = bx + this.tempDir2.x * dis;
  2159. let dy = by + this.tempDir2.y * dis;
  2160. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2161. sin = Math.sin(-angle);
  2162. cos = Math.cos(-angle);
  2163. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2164. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2165. dx = bx + this.tempDir2.x * dis;
  2166. dy = by + this.tempDir2.y * dis;
  2167. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2168. if (isr && isl)
  2169. return false;
  2170. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2171. }
  2172. return true;
  2173. }
  2174. turnPole() {
  2175. this.turnNum++;
  2176. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2177. let dr = rot - this.destRot;
  2178. let abs = Math.abs(dr) % 360;
  2179. if (abs > 180) {
  2180. if (rot > 180)
  2181. rot -= 360;
  2182. if (this.destRot > 180)
  2183. this.destRot -= 360;
  2184. }
  2185. let max = this.turnNum * 5 + this.aiLv * 5;
  2186. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2187. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2188. let at = xGame.tools.random(1000, 2000);
  2189. if (!this.onAway(3))
  2190. at += xGame.tools.random(10000, 15000);
  2191. this.setState(AIState.shoot, at);
  2192. }
  2193. else {
  2194. let mr = 0;
  2195. if (abs > 3)
  2196. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2197. else if (Math.random() > 0.6)
  2198. mr = xGame.tools.random(1, 10) * 0.1;
  2199. mr = dr > 0 ? -mr : mr;
  2200. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2201. }
  2202. }
  2203. setKick(dx, dy) {
  2204. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2205. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2206. this.tempDir1.x = 0;
  2207. this.tempDir1.y = 1;
  2208. this.tempDir2.y = -this.tempDir2.y;
  2209. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2210. if (num > 1)
  2211. num = 1;
  2212. let rot = Math.acos(num) * 57.3;
  2213. if (this.tempDir2.x < 0)
  2214. rot = 360 - rot;
  2215. this.destRot += rot;
  2216. if (!xGame.common.gameMgr.finishOneShoot) {
  2217. this.forceMax += xGame.tools.random(10, 50);
  2218. this.forceMax -= this.aiLv * 2;
  2219. if (this.forceMax < 20)
  2220. this.forceMax = 20;
  2221. }
  2222. if (this.forceMax > 100)
  2223. this.forceMax = 101;
  2224. else if (this.forceMax < 10)
  2225. this.forceMax += xGame.tools.random(0, 10);
  2226. if (xGame.common.gameMode == 1)
  2227. this.forceMax = xGame.tools.random(80, 100);
  2228. else
  2229. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2230. let max = 2000 - this.aiLv * 100;
  2231. if (Math.random() > 0.8)
  2232. max += xGame.tools.random(100, 2000);
  2233. this.setState(AIState.turn, xGame.tools.random(500, max));
  2234. }
  2235. shoot() {
  2236. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2237. if (Math.random() > 0.8) {
  2238. this.gameSrc.aiForce(1);
  2239. this.setState(AIState.wait);
  2240. }
  2241. }
  2242. else {
  2243. let df = xGame.tools.random(3, 8);
  2244. if (this.forceNum < this.forceMax)
  2245. this.forceNum += df;
  2246. else
  2247. this.forceNum -= df;
  2248. let startY = this.gameSrc.ui.powerNode.y;
  2249. let height = this.gameSrc.ui.powerNode.height;
  2250. let force = startY + height * this.forceNum * 0.01;
  2251. this.gameSrc.aiForce(2, force);
  2252. }
  2253. }
  2254. reset() {
  2255. for (let i = 0; i < 4; i++) {
  2256. this.setRate--;
  2257. this.setNum++;
  2258. let pos = this.posList[this.posIdx];
  2259. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2260. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2261. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2262. this.rootPos.x = 387;
  2263. if (this.rootPos.x < this.rectL)
  2264. this.rootPos.x = this.rectL;
  2265. else if (this.rootPos.x > this.rectR)
  2266. this.rootPos.x = this.rectR;
  2267. if (this.rootPos.y < this.rectT)
  2268. this.rootPos.y = this.rectT;
  2269. else if (this.rootPos.y > this.rectB)
  2270. this.rootPos.y = this.rectB;
  2271. this.posIdx++;
  2272. let max = this.posList.length;
  2273. if (this.posIdx >= max)
  2274. this.posIdx -= max;
  2275. this.initHoleBall();
  2276. let ball = null;
  2277. if (this.scoreBall.length > 0)
  2278. ball = this.scoreBall[0];
  2279. else if (this.lineBall.length > 0)
  2280. ball = xGame.common.getRandArrEle(this.lineBall);
  2281. if (ball && ball.kickAngle < this.bestAngle) {
  2282. this.bestAngle = ball.kickAngle;
  2283. this.bestKick.x = ball.kickPos.x;
  2284. this.bestKick.y = ball.kickPos.y;
  2285. this.bestPos.x = this.rootPos.x;
  2286. this.bestPos.y = this.rootPos.y;
  2287. this.bestForce = ball.hard * 0.08;
  2288. }
  2289. }
  2290. if (this.setNum >= this.setMax)
  2291. this.setMax = 0;
  2292. if (this.setRate < 1) {
  2293. this.setState(AIState.move, 0);
  2294. this.rootMoveTime = Laya.timer.currTimer;
  2295. this.gameSrc.aiRootMove(true);
  2296. }
  2297. }
  2298. delayLine() {
  2299. this.gameSrc.aiRootMove(false);
  2300. }
  2301. move() {
  2302. if (this.bestPos.x < 1)
  2303. this.bestPos = this.rootPos;
  2304. let wObj = this.wBall.gameObj;
  2305. let destx = wObj.x;
  2306. let desty = wObj.y;
  2307. let dx = Math.abs(destx - this.bestPos.x);
  2308. let dy = Math.abs(desty - this.bestPos.y);
  2309. let mx = 3 + dx * 0.03;
  2310. let my = 3 + dy * 0.03;
  2311. if (dx < 4 && dy < 4) {
  2312. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2313. dt = dt < 1000 ? 1000 - dt : 0;
  2314. if (this.setMax > 0) {
  2315. let min = this.setMax * 0.3 + this.aiLv * 5;
  2316. this.setRate = xGame.tools.random(min, this.setMax);
  2317. this.setState(AIState.reset, 0);
  2318. }
  2319. else {
  2320. this.destRot = 0;
  2321. this.forceMax = this.bestForce;
  2322. this.setKick(this.bestKick.x, this.bestKick.y);
  2323. }
  2324. if (dt > 100) {
  2325. Laya.timer.clear(this, this.delayLine);
  2326. Laya.timer.once(dt, this, this.delayLine);
  2327. }
  2328. else
  2329. this.gameSrc.aiRootMove(false);
  2330. }
  2331. else {
  2332. if (dx > 4)
  2333. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2334. if (dy > 4)
  2335. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2336. this.gameSrc.onRootMove({ x: destx, y: desty });
  2337. }
  2338. }
  2339. resetRoot() {
  2340. this.bestAngle = 180;
  2341. this.bestForce = 0;
  2342. this.setMax = this.posList.length;
  2343. this.posIdx = xGame.tools.random(0, this.setMax);
  2344. let min = this.setMax * 0.3 + this.aiLv * 5;
  2345. this.setRate = xGame.tools.random(min, this.setMax);
  2346. let max = 2000 - this.aiLv * 100;
  2347. if (Math.random() > 0.8)
  2348. max += xGame.tools.random(100, 1000);
  2349. if (this.isGuide)
  2350. this.setState(AIState.select, 500);
  2351. else if (this.onAway(2))
  2352. this.setState(AIState.reset, xGame.tools.random(400, max));
  2353. else
  2354. this.setState(AIState.none);
  2355. if (xGame.common.gameMgr.finishOneShoot)
  2356. this.chat();
  2357. }
  2358. runAI() {
  2359. if (this.state > AIState.idle)
  2360. return;
  2361. this.initBall();
  2362. this.onGame(2500);
  2363. if (Math.random() > 0.6)
  2364. this.chat();
  2365. }
  2366. stopRun() {
  2367. this.setState(AIState.idle);
  2368. }
  2369. onGame(base) {
  2370. let max = base - this.aiLv * 100;
  2371. if (Math.random() > 0.8)
  2372. max += xGame.tools.random(100, 1000);
  2373. if (this.onAway(2))
  2374. this.setState(AIState.select, xGame.tools.random(500, max));
  2375. else
  2376. this.setState(AIState.none);
  2377. }
  2378. setState(sta, wt = 0) {
  2379. if (this.state == AIState.none)
  2380. return;
  2381. this.state = sta;
  2382. this.waitTime = wt;
  2383. }
  2384. onUpdate() {
  2385. if (this.state == AIState.none)
  2386. return;
  2387. this.awayTime -= this.dtime;
  2388. if (this.awayTime < 1) {
  2389. this.awayTime = xGame.tools.random(6000, 10000);
  2390. this.awayNum += (11 - this.aiLv);
  2391. this.onAway(1);
  2392. }
  2393. if (this.waitTime >= 0) {
  2394. this.waitTime -= this.dtime;
  2395. return;
  2396. }
  2397. switch (this.state) {
  2398. case AIState.idle:
  2399. this.chat();
  2400. break;
  2401. case AIState.reset:
  2402. this.reset();
  2403. break;
  2404. case AIState.move:
  2405. this.move();
  2406. break;
  2407. case AIState.leave:
  2408. this.state = AIState.none;
  2409. xGame.common.gameMgr.aiGameEnd(true);
  2410. break;
  2411. case AIState.select:
  2412. this.selectBall();
  2413. break;
  2414. case AIState.turn:
  2415. this.turnPole();
  2416. break;
  2417. case AIState.shoot:
  2418. this.shoot();
  2419. break;
  2420. }
  2421. }
  2422. onAway(type) {
  2423. if (type == 1) {
  2424. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2425. let num = this.awayNum + db * 20;
  2426. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2427. xGame.common.gameMgr.aiLeave();
  2428. this.setState(AIState.leave, 6666);
  2429. }
  2430. }
  2431. else if (type == 2) {
  2432. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2433. let num = this.awayNum + db * 30;
  2434. if (xGame.tools.random(0, 10000) < num)
  2435. return false;
  2436. }
  2437. else if (type == 3) {
  2438. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2439. let num = this.awayNum + db * 10;
  2440. if (xGame.tools.random(0, 4000) < num)
  2441. return false;
  2442. }
  2443. return true;
  2444. }
  2445. chat() {
  2446. if (this.chatTime > 0) {
  2447. this.chatTime -= this.dtime;
  2448. return;
  2449. }
  2450. this.chatTime = xGame.tools.random(2000, 10000);
  2451. let rand = xGame.tools.random(0, 100);
  2452. if (rand < 15)
  2453. this.talk();
  2454. else if (rand < 35)
  2455. this.emotion();
  2456. }
  2457. talk() {
  2458. xGame.common.talkMgr.showAITalk(0);
  2459. }
  2460. emotion() {
  2461. xGame.common.talkMgr.showAIEmotion(0);
  2462. }
  2463. resetAI() {
  2464. this.stopRun();
  2465. this.state = AIState.none;
  2466. }
  2467. }
  2468. class Partical extends Laya.Script3D {
  2469. constructor() {
  2470. super();
  2471. this.duration = 2000;
  2472. }
  2473. ;
  2474. onAwake() {
  2475. this.gameObj = this.owner;
  2476. }
  2477. onEnable() {
  2478. this.openTimer();
  2479. }
  2480. openTimer() {
  2481. Laya.timer.once(this.duration, this, this.disappear);
  2482. }
  2483. setCallback(obj, callback) {
  2484. this.obj = obj;
  2485. this.callback = callback;
  2486. Laya.timer.clearAll(this);
  2487. Laya.timer.once(this.duration, this, this.disappear);
  2488. }
  2489. disappear() {
  2490. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2491. this.callback && this.callback(this.obj);
  2492. }
  2493. }
  2494. class Ball extends Laya.Script3D {
  2495. constructor() {
  2496. super();
  2497. this.posV3 = new Laya.Vector3();
  2498. this.rotRate = 2.1;
  2499. this.rotSpeed = new Laya.Vector3();
  2500. this.myIndex = 0;
  2501. }
  2502. onAwake() {
  2503. this.gameObj = this.owner;
  2504. this.transform = this.gameObj.transform;
  2505. this.ballNode = this.gameObj.getChildByName("Ball");
  2506. this.shadowNode = this.gameObj.getChildByName("shadow");
  2507. }
  2508. initSelf(index, x, y, owner) {
  2509. this.d2BallSrc = owner;
  2510. this.myIndex = index;
  2511. this.setAlbedoTexture();
  2512. this.setTransPos(x, y);
  2513. this.setScale();
  2514. this.ballNode.transform.localRotationEulerX = 90;
  2515. if (index == 0) {
  2516. }
  2517. }
  2518. setAlbedoTexture(isIce = false) {
  2519. let url;
  2520. if (isIce) {
  2521. url = `res/d3Res/ballTexture/ice.jpg`;
  2522. }
  2523. else {
  2524. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2525. }
  2526. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2527. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2528. }));
  2529. }
  2530. runFireworks(obj, delay, callback) {
  2531. Laya.timer.clearAll(this);
  2532. Laya.timer.once(delay + 1, this, () => {
  2533. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2534. fire.transform.localPositionX = this.transform.localPositionX;
  2535. fire.transform.localPositionY = this.transform.localPositionY;
  2536. fire.transform.localPositionZ = this.transform.localPositionZ;
  2537. let src = fire.getComponent(Partical);
  2538. src.duration = 1000;
  2539. src.setCallback(obj, callback);
  2540. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2541. eft.transform.localPositionX = this.transform.localPositionX;
  2542. eft.transform.localPositionY = this.transform.localPositionY;
  2543. eft.transform.localPositionZ = this.transform.localPositionZ;
  2544. });
  2545. }
  2546. setTransPos(x, y) {
  2547. this.setRotation();
  2548. xGame.common.pos2to3Convert(x, y, this.posV3);
  2549. this.transform.localPositionX = this.posV3.x;
  2550. this.transform.localPositionY = 0;
  2551. this.transform.localPositionZ = this.posV3.z;
  2552. this.transform.localRotationEulerX = 0;
  2553. this.transform.localRotationEulerY = 0;
  2554. this.transform.localRotationEulerZ = 0;
  2555. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2556. this.shadowNode.transform.localPositionY = 0.1;
  2557. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2558. }
  2559. setRotation() {
  2560. if (this.d2BallSrc.canRot) {
  2561. let speed = this.d2BallSrc.rigy.linearVelocity;
  2562. this.rotSpeed.x = speed.x * this.rotRate;
  2563. this.rotSpeed.z = speed.y * this.rotRate;
  2564. this.rotSpeed.y = this.d2BallSrc.rotY;
  2565. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2566. }
  2567. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2568. this.rotSpeed.x = this.rotSpeed.y = 0;
  2569. this.rotSpeed.y = this.d2BallSrc.rotY;
  2570. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2571. }
  2572. }
  2573. setScale() {
  2574. let radius = xGame.common.d2World.rootBall.ui.width;
  2575. let scale = xGame.common.scale2to3Convert(radius);
  2576. this.transform.localScaleX = scale;
  2577. this.transform.localScaleY = scale;
  2578. this.transform.localScaleZ = scale;
  2579. }
  2580. playInHoleEft() {
  2581. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2582. eft.transform.position = this.transform.position;
  2583. }
  2584. playIceEft() {
  2585. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2586. eft.transform.position = this.transform.position;
  2587. }
  2588. get scaleXYZ() {
  2589. return this.transform.localScaleX;
  2590. }
  2591. set scaleXYZ(val) {
  2592. this.transform.localScaleX = val;
  2593. this.transform.localScaleY = val;
  2594. this.transform.localScaleZ = val;
  2595. }
  2596. get posX() {
  2597. return this.transform.localPositionX;
  2598. }
  2599. set posX(val) {
  2600. this.transform.localPositionX = val;
  2601. }
  2602. get posY() {
  2603. return this.transform.localPositionY;
  2604. }
  2605. set posY(val) {
  2606. this.transform.localPositionY = val;
  2607. }
  2608. get posZ() {
  2609. return this.transform.localPositionZ;
  2610. }
  2611. set posZ(val) {
  2612. this.transform.localPositionZ = val;
  2613. }
  2614. destroySelf() {
  2615. this.posV3 = null;
  2616. this.rotSpeed = null;
  2617. this.d2BallSrc = null;
  2618. this.ballNode = null;
  2619. this.gameObj.destroy(true);
  2620. this.transform = null;
  2621. this.destroy();
  2622. }
  2623. }
  2624. class ui_D2Ball extends fgui.GComponent {
  2625. static createInstance() {
  2626. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2627. }
  2628. onConstruct() {
  2629. this.myIcon = (this.getChild("myIcon"));
  2630. this.inner = (this.getChild("inner"));
  2631. this.n8 = (this.getChild("n8"));
  2632. this.n4 = (this.getChild("n4"));
  2633. this.wrongTips = (this.getChild("wrongTips"));
  2634. this.rightTips = (this.getChild("rightTips"));
  2635. this.breathAni = this.getTransition("breathAni");
  2636. }
  2637. }
  2638. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2639. class D2BallSrc extends Laya.Script {
  2640. constructor() {
  2641. super();
  2642. this.number = 0;
  2643. this.startX = 0;
  2644. this.startY = 0;
  2645. this.angleV2 = new Laya.Vector2();
  2646. this.isRootBall = false;
  2647. this.isBlackBall = false;
  2648. this.ballType = "";
  2649. this.canRot = true;
  2650. this.rotY = 0;
  2651. this.poleAngle = 0;
  2652. this.kickPos = { x: 0, y: 0 };
  2653. this.hard = 0;
  2654. this.kickAngle = 0;
  2655. this.borderDis = 0;
  2656. this.speedP10 = 5.6;
  2657. this.lastSpeed = { x: 0, y: 0 };
  2658. this.stillSpeed = 0.12;
  2659. this.ballFunc = "normal";
  2660. this.isRunSkillAni = false;
  2661. this.isInHole = false;
  2662. this.iceOwner = "";
  2663. this.forceRun = false;
  2664. this.myUNID = "";
  2665. this.rectL = 0;
  2666. this.rectR = 0;
  2667. this.rectT = 0;
  2668. this.rectB = 0;
  2669. this.forceVec = new Laya.Vector2();
  2670. this.lastDis = 0;
  2671. this.helpOut = { type: "", x: 0, y: 0 };
  2672. }
  2673. initSelf(number, x, y, d3Ball) {
  2674. if (!this.gameObj)
  2675. this.gameObj = this.owner;
  2676. this.number = number;
  2677. this.startX = x;
  2678. this.startY = y;
  2679. this.d3Ball = d3Ball;
  2680. this.isRootBall = false;
  2681. this.isBlackBall = false;
  2682. this.ballType = "";
  2683. if (number == 0) {
  2684. this.isRootBall = true;
  2685. }
  2686. else if (number == 8) {
  2687. this.isBlackBall = true;
  2688. }
  2689. else {
  2690. if (number <= 7) {
  2691. this.ballType = ballCamp.full;
  2692. }
  2693. else {
  2694. this.ballType = ballCamp.flower;
  2695. }
  2696. }
  2697. this.setInfo();
  2698. this.setD3Ball();
  2699. this.owner["mySrc"] = this;
  2700. this.rigy.linearDamping = 1;
  2701. D2BallSrc._unid++;
  2702. this.myUNID = "d2ball" + D2BallSrc._unid;
  2703. let rect = xGame.common.d2World.borderRect;
  2704. this.rectL = Math.ceil(rect.x) + 20;
  2705. this.rectT = Math.ceil(rect.y) + 20;
  2706. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2707. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2708. }
  2709. setInfo() {
  2710. this.gameObj.x = this.startX;
  2711. this.gameObj.y = this.startY;
  2712. let radius = this.ui.width / 2;
  2713. this.gameObj.width = radius * 2;
  2714. this.gameObj.height = radius * 2;
  2715. if (xGame.common.showDebug) {
  2716. this.ui.myIcon.alpha = 1;
  2717. this.ui.inner.alpha = 1;
  2718. }
  2719. else {
  2720. this.ui.myIcon.alpha = 0;
  2721. this.ui.inner.alpha = 0;
  2722. }
  2723. }
  2724. setD3Ball() {
  2725. this.d3Ball = this.d3Ball;
  2726. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2727. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2728. }
  2729. onUpdate() {
  2730. if (xGame.common.gameMgr.gamePause)
  2731. return;
  2732. if (this.isInHole)
  2733. return;
  2734. if (!xGame.common.d2World.openCheckStill)
  2735. return;
  2736. this.runBall();
  2737. }
  2738. runBall() {
  2739. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2740. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2741. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2742. this.judgeBorder();
  2743. }
  2744. getDestDis(dest) {
  2745. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2746. }
  2747. setmyXY(x, y) {
  2748. this.d3BallSrc.setTransPos(x, y);
  2749. }
  2750. getSpeed() {
  2751. let speed = this.rigy.linearVelocity;
  2752. return speed.x * speed.x + speed.y * speed.y;
  2753. }
  2754. onTriggerEnter(collider) {
  2755. if (!collider || !collider.owner)
  2756. return;
  2757. let coll = "collide";
  2758. let speed = this.getSpeed();
  2759. let sv2 = this.speedP10 * this.speedP10;
  2760. if (collider.label == "ball") {
  2761. if (speed < 9 && this.number != 0)
  2762. coll = "";
  2763. else if (speed < sv2)
  2764. coll = "collide_4";
  2765. else if (speed < sv2 * 6.2)
  2766. coll = "collide_3";
  2767. else if (speed < sv2 * 25)
  2768. coll = "collide_2";
  2769. else if (speed < sv2 * 56)
  2770. coll = "collide_1";
  2771. xGame.soundMgr.playSound(coll);
  2772. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2773. if (collider.owner) {
  2774. let rig = collider.owner.getComponent(D2BallSrc);
  2775. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2776. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2777. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2778. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2779. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2780. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2781. let rx = 0;
  2782. let ry = 0;
  2783. if (this.gameObj.x < this.rectL)
  2784. rx = vx;
  2785. else if (this.gameObj.x > this.rectR)
  2786. rx = -vx;
  2787. else if (this.gameObj.y < this.rectT)
  2788. ry = vy;
  2789. else if (this.gameObj.y > this.rectB)
  2790. ry = -vy;
  2791. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2792. }
  2793. }
  2794. if (this.number != 0) {
  2795. return;
  2796. }
  2797. else {
  2798. if (this.forceRun) {
  2799. console.log("randon force");
  2800. this.applyForce(collider);
  2801. }
  2802. }
  2803. if (xGame.common.d2World.isOnSameLine) {
  2804. xGame.common.d2World.isOnSameLine = false;
  2805. this.rigy.linearVelocity = { x: 0, y: 0 };
  2806. }
  2807. if (xGame.common.gameMgr.firstColliObj == null) {
  2808. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2809. xGame.common.gameMgr.isTouchedBall = true;
  2810. }
  2811. }
  2812. else {
  2813. xGame.common.recoverCameraView();
  2814. let wallStr = "";
  2815. if (speed < 9) { }
  2816. else if (speed < sv2) { }
  2817. else if (speed < sv2 * 6.2)
  2818. wallStr = "wall_30";
  2819. else if (speed < sv2 * 25)
  2820. wallStr = "wall_50";
  2821. else if (speed < sv2 * 56)
  2822. wallStr = "wall_80";
  2823. xGame.soundMgr.playSound(wallStr);
  2824. }
  2825. }
  2826. applyForce(collider) {
  2827. let src = collider.owner.mySrc;
  2828. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2829. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2830. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2831. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2832. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2833. }
  2834. checkWrongBall(playEft = true) {
  2835. if (this.isInHole)
  2836. return;
  2837. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2838. if (this.number != 0 && playEft)
  2839. this.d3BallSrc.playInHoleEft();
  2840. let coll = "inpocket_1";
  2841. let speed = this.getSpeed();
  2842. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2843. if (speed < 9 && this.number != 0)
  2844. coll = "";
  2845. else if (speed < sv2 * 6.2)
  2846. coll = "inpocket_4";
  2847. else if (speed < sv2 * 25)
  2848. coll = "collide_3";
  2849. else if (speed < sv2 * 56)
  2850. coll = "collide_2";
  2851. xGame.soundMgr.playSound(coll);
  2852. this.isInHole = true;
  2853. if (this.number == 0) {
  2854. console.log("白球进了。。");
  2855. this.reset();
  2856. this.rigy.linearVelocity = { x: 0, y: 0 };
  2857. this.hideSelf();
  2858. xGame.common.gameUI.ui.whiteAni.visible = true;
  2859. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2860. xGame.common.gameUI.ui.whiteAni.visible = false;
  2861. }));
  2862. }
  2863. else {
  2864. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2865. xGame.common.d2World.removeOneBall(this);
  2866. this.destroySelf();
  2867. xGame.common.playHappySound(this.number);
  2868. this.runFlyEft();
  2869. }
  2870. }
  2871. runFlyEft() {
  2872. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2873. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2874. }
  2875. }
  2876. hideSelf() {
  2877. if (this.d3Ball)
  2878. this.d3Ball.active = false;
  2879. }
  2880. showSelf() {
  2881. this.isInHole = false;
  2882. if (this.d3Ball && !this.d3Ball.active)
  2883. this.d3Ball.active = true;
  2884. }
  2885. isStill() {
  2886. let speed = this.rigy.linearVelocity;
  2887. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  2888. this.rigy.linearVelocity = { x: 0, y: 0 };
  2889. return true;
  2890. }
  2891. return false;
  2892. }
  2893. reset() {
  2894. }
  2895. destroySelf() {
  2896. this.d3BallSrc.destroySelf();
  2897. if (!this.ui.isDisposed) {
  2898. this.ui.removeFromParent();
  2899. this.ui.dispose();
  2900. this.ui = null;
  2901. }
  2902. this.outColli = null;
  2903. this.innerColli = null;
  2904. this.rigy = null;
  2905. this.d3Ball = null;
  2906. this.d3BallSrc = null;
  2907. this.angleV2 = null;
  2908. this.gameObj.destroy(true);
  2909. this.destroy();
  2910. }
  2911. judgeBorder() {
  2912. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  2913. return;
  2914. }
  2915. if (this.destroyed)
  2916. return;
  2917. if (xGame.common.gameMode == GameMode.classic)
  2918. return;
  2919. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  2920. if (isOver) {
  2921. this.checkWrongBall();
  2922. }
  2923. }
  2924. onClick(e, force = false) {
  2925. if (this.number == 0)
  2926. return;
  2927. if (force) {
  2928. }
  2929. else {
  2930. if (xGame.common.d2World.openCheckStill)
  2931. return;
  2932. if (!xGame.common.gameMgr.selfTurn) {
  2933. return;
  2934. }
  2935. }
  2936. if (!xGame.common.gameMgr.finishOneShoot)
  2937. return;
  2938. let root = xGame.common.d2World.rootBall.gameObj;
  2939. let x = this.gameObj.x - root.x;
  2940. let y = this.gameObj.y - root.y;
  2941. let angle = xGame.common.getfguiRotation(x, y);
  2942. xGame.common.d2World.d2Gan.ui.rotation = angle;
  2943. xGame.common.d2World.getHelpLine();
  2944. xGame.common.clickedBall = true;
  2945. this.checkGuide();
  2946. }
  2947. checkGuide() {
  2948. let guide = DataMgr.getSkillGuide();
  2949. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  2950. xGame.common.guideStep++;
  2951. xGame.common.gameUI.ui.guide1.visible = false;
  2952. xGame.common.gameUI.ui.guide2.visible = true;
  2953. }
  2954. }
  2955. checkDistance(disX, disY, angle) {
  2956. let diameter = this.gameObj.width - 1;
  2957. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  2958. if (!this.lastDis)
  2959. this.lastDis = dis;
  2960. else {
  2961. if (dis > this.lastDis) {
  2962. this.helpOut.type = "remove";
  2963. return this.helpOut;
  2964. }
  2965. }
  2966. if (dis <= Math.pow(diameter, 2)) {
  2967. let del = 0.01;
  2968. let offest = 0;
  2969. let realX = disX - this.gameObj.x;
  2970. let realY = disY - this.gameObj.y;
  2971. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  2972. offest += del;
  2973. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  2974. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  2975. }
  2976. this.helpOut.type = "ok";
  2977. this.helpOut.x = realX + this.gameObj.x;
  2978. this.helpOut.y = realY + this.gameObj.y;
  2979. return this.helpOut;
  2980. }
  2981. else {
  2982. this.helpOut.type = "no";
  2983. return this.helpOut;
  2984. }
  2985. }
  2986. clearBallEft() {
  2987. this.clearBallRightEft();
  2988. this.clearBallWrongEft();
  2989. }
  2990. clearBallRightEft() {
  2991. this.ui.breathAni.stop();
  2992. this.ui.rightTips.visible = false;
  2993. }
  2994. clearBallWrongEft() {
  2995. this.ui.wrongTips.visible = false;
  2996. }
  2997. showWrongEft() {
  2998. if (!xGame.common.gameMgr.selfTurn)
  2999. return;
  3000. this.ui.wrongTips.visible = true;
  3001. }
  3002. showRightEft() {
  3003. if (!xGame.common.gameMgr.selfTurn)
  3004. return;
  3005. this.ui.rightTips.visible = true;
  3006. this.ui.rightTips.scaleX = 1;
  3007. this.ui.rightTips.scaleY = 1;
  3008. this.ui.breathAni.play();
  3009. }
  3010. setBallFunc(type, owner) {
  3011. if (type == "ice") {
  3012. this.ballFunc = type;
  3013. this.d3BallSrc.setAlbedoTexture(true);
  3014. this.rigy.type = "static";
  3015. this.iceOwner = owner;
  3016. }
  3017. else {
  3018. if (owner == this.iceOwner) {
  3019. this.ballFunc = type;
  3020. this.d3BallSrc.setAlbedoTexture(false);
  3021. this.rigy.type = "dynamic";
  3022. }
  3023. }
  3024. }
  3025. }
  3026. D2BallSrc._unid = 0;
  3027. class D2RootBallSrc extends D2BallSrc {
  3028. constructor() {
  3029. super();
  3030. this.maxSpeed = 0;
  3031. this.classicMaxSpeed = 2.2;
  3032. this.bigSkillMaxSpeed = 4;
  3033. this.angle = 0;
  3034. this.allPercent = 0;
  3035. this.linearPercent = 0;
  3036. this.anglePercent = 0;
  3037. this.maxAngleRate = 0.6;
  3038. this.baseRot = 7;
  3039. this.angleMax = 0;
  3040. this.speed = new Laya.Vector2();
  3041. this.rotSpeed = new Laya.Vector2();
  3042. }
  3043. isStill() {
  3044. let speed = this.rigy.linearVelocity;
  3045. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3046. if (this.anglePercent <= 0.1) {
  3047. this.rigy.linearVelocity = { x: 0, y: 0 };
  3048. return true;
  3049. }
  3050. }
  3051. return false;
  3052. }
  3053. reset() {
  3054. this.linearPercent = 0;
  3055. this.anglePercent = 0;
  3056. }
  3057. setSpeed(percent, angle) {
  3058. this.allPercent = percent;
  3059. this.angle = angle;
  3060. this.setAngleSpeed();
  3061. this.setLinearSpeed();
  3062. let hit = "hit";
  3063. if (percent < 25)
  3064. hit = "hit03";
  3065. else if (percent < 50)
  3066. hit = "hit02";
  3067. else if (percent < 75)
  3068. hit = "hit01";
  3069. xGame.soundMgr.playSound(hit);
  3070. }
  3071. setAngleSpeed() {
  3072. let offest = xGame.common.rodOffest;
  3073. let radius = 82;
  3074. let rate = Math.abs(offest.y / radius) * 0.5;
  3075. if (offest.y > 0)
  3076. this.angleMax = -this.baseRot * 2;
  3077. else
  3078. this.angleMax = this.baseRot;
  3079. this.rotY = -offest.x / radius * 100;
  3080. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3081. this.linearPercent = this.allPercent - this.anglePercent;
  3082. }
  3083. setLinearSpeed() {
  3084. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3085. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3086. if (!xGame.common.longHelpLine) {
  3087. let offset = -150 + xGame.common.randomNum(0, 300);
  3088. offset /= 100;
  3089. this.angle += offset;
  3090. }
  3091. }
  3092. }
  3093. let sin = Math.sin(this.angle * Math.PI / 180);
  3094. let cos = Math.cos(this.angle * Math.PI / 180);
  3095. switch (xGame.common.gameMode) {
  3096. case GameMode.classic:
  3097. this.maxSpeed = this.classicMaxSpeed;
  3098. break;
  3099. case GameMode.bigMove:
  3100. this.maxSpeed = this.bigSkillMaxSpeed;
  3101. break;
  3102. case GameMode.placeBall:
  3103. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3104. if (data.type == 1) {
  3105. this.maxSpeed = this.bigSkillMaxSpeed;
  3106. }
  3107. else {
  3108. this.maxSpeed = this.classicMaxSpeed;
  3109. }
  3110. break;
  3111. default:
  3112. break;
  3113. }
  3114. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3115. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3116. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3117. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3118. this.rigy.applyLinearImpulseToCenter(this.speed);
  3119. }
  3120. onUpdate() {
  3121. if (this.anglePercent > 0.1) {
  3122. this.anglePercent *= 0.97;
  3123. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3124. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3125. this.rigy.applyForceToCenter(this.rotSpeed);
  3126. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3127. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3128. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3129. if (num > 0.9)
  3130. this.canRot = true;
  3131. }
  3132. else
  3133. this.canRot = true;
  3134. if (Math.abs(this.rotY) > 0.1)
  3135. this.rotY *= 0.98;
  3136. super.onUpdate();
  3137. }
  3138. destroySelf() {
  3139. super.destroySelf();
  3140. this.speed = null;
  3141. }
  3142. }
  3143. class D2Ball extends Laya.Sprite {
  3144. constructor(isRootBall = false) {
  3145. super();
  3146. this.ui = ui_D2Ball.createInstance();
  3147. this.pivotX = this.ui.width / 2;
  3148. this.pivotY = this.ui.width / 2;
  3149. this.x = 0;
  3150. this.y = 0;
  3151. this.addChild(this.ui.displayObject);
  3152. this.ui.displayObject.x += this.ui.width / 2;
  3153. this.ui.displayObject.y += this.ui.width / 2;
  3154. if (isRootBall) {
  3155. this.d2Src = this.addComponent(D2RootBallSrc);
  3156. }
  3157. else {
  3158. this.d2Src = this.addComponent(D2BallSrc);
  3159. }
  3160. this.d2Src.ui = this.ui;
  3161. this.addCircleCollider();
  3162. this.addInnerCircleCollider();
  3163. this.addRigyBody();
  3164. }
  3165. addCircleCollider() {
  3166. let colli = xGame.common.getCollider("circle");
  3167. colli.radius = this.ui.width / 2;
  3168. this.addComponentIntance(colli);
  3169. this.d2Src.outColli = colli;
  3170. colli.label = "ball";
  3171. }
  3172. addInnerCircleCollider() {
  3173. let colli = xGame.common.getCollider("circle");
  3174. colli.radius = this.ui.inner.width / 2;
  3175. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3176. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3177. this.addComponentIntance(colli);
  3178. this.d2Src.innerColli = colli;
  3179. colli.label = "inner";
  3180. }
  3181. addRigyBody() {
  3182. let rigy = xGame.common.getRigbody();
  3183. rigy.type = "dynamic";
  3184. this.addComponentIntance(rigy);
  3185. this.d2Src.rigy = rigy;
  3186. }
  3187. disposeSelf() {
  3188. if (!this.ui.isDisposed) {
  3189. this.ui.dispose();
  3190. this.ui.removeFromParent();
  3191. this.ui = null;
  3192. }
  3193. }
  3194. }
  3195. class ui_D2Gan extends fgui.GComponent {
  3196. static createInstance() {
  3197. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3198. }
  3199. onConstruct() {
  3200. this.myIcon = (this.getChild("myIcon"));
  3201. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3202. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3203. this.self = (this.getChild("self"));
  3204. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3205. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3206. this.ai = (this.getChild("ai"));
  3207. }
  3208. }
  3209. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3210. class D2Gan {
  3211. constructor() {
  3212. this.offset = 0.15;
  3213. this.cell = 1.5;
  3214. this.onBallCell = 0.4;
  3215. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3216. this.moveNum = 70;
  3217. this.rulerRate = 0.1;
  3218. this.ui = ui_D2Gan.createInstance();
  3219. this.changeSelfRod();
  3220. this.changeAIRod();
  3221. }
  3222. changeSelfRod() {
  3223. let index = DataMgr.getCurBallRod();
  3224. let data = cfgTable.ballrodData[index + 1];
  3225. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3226. this.selfMySpine && this.selfMySpine.dispose();
  3227. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3228. if (data.spine) {
  3229. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3230. this.selfMySpine = new SpineMgr(data.spine, () => {
  3231. let xx = this.ui.selfEftRoot.width / 2;
  3232. let yy = this.ui.selfEftRoot.height / 2;
  3233. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3234. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3235. outSpine.rotation = -90;
  3236. });
  3237. }
  3238. }
  3239. changeAIRod() {
  3240. let length = Object.keys(cfgTable.ballrodData).length;
  3241. let rand = Math.floor(length * Math.random()) + 1;
  3242. let data = cfgTable.ballrodData[rand];
  3243. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3244. this.aiMySpine && this.aiMySpine.dispose();
  3245. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3246. if (data.spine) {
  3247. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3248. this.aiMySpine = new SpineMgr(data.spine, () => {
  3249. let xx = this.ui.aiEftRoot.width / 2;
  3250. let yy = this.ui.aiEftRoot.height / 2;
  3251. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3252. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3253. outSpine.rotation = -90;
  3254. });
  3255. }
  3256. }
  3257. setGanLastInfo() {
  3258. this.lastInfo.rotation = this.ui.rotation;
  3259. this.lastInfo.x = this.ui.x;
  3260. this.lastInfo.y = this.ui.y;
  3261. }
  3262. rotateSelf(flag, isRuler = false) {
  3263. let angle;
  3264. flag = flag * this.offset;
  3265. if (xGame.common.d2World.isHelpLineOnBall) {
  3266. angle = flag * this.onBallCell;
  3267. }
  3268. else {
  3269. angle = flag * this.cell;
  3270. }
  3271. if (isRuler) {
  3272. angle *= this.rulerRate;
  3273. }
  3274. this.ui.rotation += angle;
  3275. xGame.common.d2World.getHelpLine();
  3276. }
  3277. checkDistance() {
  3278. let target = xGame.common.d2World.targetBall;
  3279. let root = xGame.common.d2World.rootBall;
  3280. if (target == null) {
  3281. return 1;
  3282. }
  3283. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3284. if (dis <= 2500) {
  3285. return 5;
  3286. }
  3287. return 1;
  3288. }
  3289. rotDest(rot) {
  3290. this.ui.rotation = rot;
  3291. xGame.common.d2World.getHelpLine();
  3292. }
  3293. storagePower(powerNum) {
  3294. let pos = (powerNum / 100) * this.moveNum;
  3295. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3296. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3297. this.ui.x = this.lastInfo.x + xx;
  3298. this.ui.y = this.lastInfo.y + yy;
  3299. }
  3300. shoot() {
  3301. this.storagePower(0);
  3302. this.ui.visible = false;
  3303. }
  3304. destroySelf() {
  3305. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3306. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3307. this.selfMySpine && this.selfMySpine.dispose();
  3308. this.aiMySpine && this.aiMySpine.dispose();
  3309. this.lastInfo = null;
  3310. if (!this.ui.isDisposed) {
  3311. this.ui.removeFromParent();
  3312. this.ui.dispose();
  3313. }
  3314. }
  3315. }
  3316. class ui_HelpLine extends fgui.GComponent {
  3317. static createInstance() {
  3318. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3319. }
  3320. onConstruct() {
  3321. this.n10 = (this.getChild("n10"));
  3322. this.rect = (this.getChild("rect"));
  3323. this.dir11 = (this.getChild("dir11"));
  3324. this.dir = (this.getChild("dir"));
  3325. this.rootDir = (this.getChild("rootDir"));
  3326. this.dirDot = (this.getChild("dirDot"));
  3327. }
  3328. }
  3329. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3330. class D2HelpLine {
  3331. constructor() {
  3332. this.starX = 0;
  3333. this.starY = 0;
  3334. this.ui = ui_HelpLine.createInstance();
  3335. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3336. this.starX = this.ui.rect.x;
  3337. this.starY = this.ui.rect.y;
  3338. }
  3339. shoot() {
  3340. this.ui.visible = false;
  3341. }
  3342. destroySelf() {
  3343. if (this.ui.isDisposed) {
  3344. this.ui.removeFromParent();
  3345. this.ui.dispose();
  3346. }
  3347. }
  3348. }
  3349. class D2World extends Laya.Script {
  3350. constructor() {
  3351. super();
  3352. this.ballArr = [];
  3353. this.openCheckStill = false;
  3354. this.checkArr = [];
  3355. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3356. this.isHelpLineOnBall = false;
  3357. this.isOnSameLine = false;
  3358. this.reflectAngle = 0;
  3359. this.powerPercent = 0;
  3360. this.inHolesSpeed = [];
  3361. this.outDir = new Laya.Vector2();
  3362. this.rootDir = new Laya.Vector2();
  3363. this.aiLv = 0;
  3364. this.rootPos = new Laya.Vector2();
  3365. this.tempDir1 = new Laya.Vector2();
  3366. this.tempDir2 = new Laya.Vector2();
  3367. this.tempDir3 = new Laya.Vector2();
  3368. this.ballSize = 33;
  3369. this.destRot = 0;
  3370. }
  3371. initSelf() {
  3372. this.createBalls();
  3373. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3374. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3375. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3376. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3377. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3378. }
  3379. setBorderRect() {
  3380. let ui = xGame.common.gameUI.ui;
  3381. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3382. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3383. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3384. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3385. this.borderRect.x = starX;
  3386. this.borderRect.y = starY;
  3387. this.borderRect.width = width;
  3388. this.borderRect.height = height;
  3389. }
  3390. resetGame() {
  3391. this.openCheckStill = false;
  3392. let temp;
  3393. for (let index = 0; index < this.ballArr.length; index++) {
  3394. temp = this.ballArr[index];
  3395. temp.destroySelf();
  3396. }
  3397. xGame.common.d3World.ballRoot.destroyChildren();
  3398. xGame.common.gameUI.ui.ballNode.removeChildren();
  3399. console.log("进入摧毁逻辑");
  3400. this.d2Gan.destroySelf();
  3401. this.d2HelpLine.destroySelf();
  3402. this.ballArr = [];
  3403. }
  3404. setD2Gan() {
  3405. let ballNode = this.rootBall.ui;
  3406. let d2Gan = new D2Gan();
  3407. this.d2Gan = d2Gan;
  3408. let ganNode = d2Gan.ui;
  3409. ballNode.addChild(ganNode);
  3410. ganNode.pivotX = ganNode.pivotX;
  3411. ganNode.pivotY = ganNode.pivotY;
  3412. ganNode.x = ganNode.myIcon.width / 2;
  3413. ganNode.y = this.rootBall.gameObj.width;
  3414. d2Gan.setGanLastInfo();
  3415. }
  3416. setHelpLine() {
  3417. let d2Help = new D2HelpLine();
  3418. this.d2HelpLine = d2Help;
  3419. }
  3420. createBalls() {
  3421. let cfg;
  3422. switch (xGame.common.gameMode) {
  3423. case GameMode.classic:
  3424. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3425. break;
  3426. case GameMode.bigMove:
  3427. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3428. break;
  3429. case GameMode.placeBall:
  3430. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3431. break;
  3432. default:
  3433. break;
  3434. }
  3435. cfg = JSON.parse(JSON.stringify(cfg));
  3436. for (const key in cfg) {
  3437. if (cfg[key].value == 0) {
  3438. this.createRootBall(cfg[key]);
  3439. delete cfg[key];
  3440. break;
  3441. }
  3442. }
  3443. this.createOtherBalls(cfg);
  3444. }
  3445. createRootBall(data) {
  3446. let root = new D2Ball(true);
  3447. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3448. this.rootBall = root.d2Src;
  3449. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3450. let d3BallSrc = d3Ball.getComponent(Ball);
  3451. xGame.common.d3World.rootBall = d3Ball;
  3452. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3453. let xx = data.x;
  3454. let yy = data.y;
  3455. let numer = data.value;
  3456. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3457. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3458. this.ballArr.push(this.rootBall);
  3459. this.setD2Gan();
  3460. this.setHelpLine();
  3461. }
  3462. createOtherBalls(cfg) {
  3463. let temp;
  3464. let src;
  3465. let data;
  3466. for (const key in cfg) {
  3467. data = cfg[key];
  3468. temp = new D2Ball();
  3469. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3470. src = temp.d2Src;
  3471. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3472. src.initSelf(data.value, data.x, data.y, d3Ball);
  3473. this.ballArr.push(src);
  3474. }
  3475. }
  3476. shoot(percent) {
  3477. this.powerPercent = percent;
  3478. this.openCheckStill = true;
  3479. let d2Angle = this.d2Gan.ui.rotation;
  3480. this.rootBall.setSpeed(percent, d2Angle);
  3481. this.clearBallAllEft();
  3482. this.changePlayerView();
  3483. }
  3484. onUpdate() {
  3485. if (!this.openCheckStill)
  3486. return;
  3487. this.checkStill();
  3488. }
  3489. checkStill() {
  3490. for (let index = 0; index < this.ballArr.length; index++) {
  3491. if (!this.ballArr[index].isStill()) {
  3492. return;
  3493. }
  3494. }
  3495. xGame.eventMgr.event(ALL_BALL_STOP);
  3496. }
  3497. allBallStop() {
  3498. this.openCheckStill = false;
  3499. xGame.common.recoverCameraView();
  3500. }
  3501. waitShoot() {
  3502. if (!this.d2Gan.ui.isDisposed) {
  3503. this.d2Gan.ui.visible = true;
  3504. }
  3505. if (!this.d2HelpLine.ui.isDisposed) {
  3506. this.d2HelpLine.ui.visible = true;
  3507. }
  3508. this.clearBallAllEft();
  3509. this.showBallRightEft();
  3510. this.getHelpLine();
  3511. this.inHolesSpeed = [];
  3512. this.selectOneBall();
  3513. }
  3514. _getAllBallArr() {
  3515. let arr = this.ballArr;
  3516. let outArr = [];
  3517. for (let index = 0; index < arr.length; index++) {
  3518. if (arr[index] instanceof D2RootBallSrc)
  3519. continue;
  3520. if (arr[index].ballFunc == "ice")
  3521. continue;
  3522. if (arr[index].destroyed)
  3523. continue;
  3524. outArr.push(arr[index]);
  3525. }
  3526. return outArr;
  3527. }
  3528. _getBlackObj() {
  3529. let arr = this.ballArr;
  3530. for (let index = 0; index < arr.length; index++) {
  3531. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3532. return arr[index];
  3533. }
  3534. }
  3535. }
  3536. selectOneBall() {
  3537. let all = this._getAllBallArr();
  3538. let target;
  3539. switch (xGame.common.gameMode) {
  3540. case GameMode.classic:
  3541. if (xGame.common.gameMgr.selfTurn) {
  3542. let self = xGame.common.gameMgr.selfBallArr;
  3543. let black = this._getBlackObj();
  3544. if (xGame.common.gameMgr.ensureBallType) {
  3545. if (self.length > 0) {
  3546. let out = [];
  3547. for (let j = 0; j < all.length; j++) {
  3548. if (self.indexOf(all[j].number) > -1) {
  3549. out.push(all[j]);
  3550. }
  3551. }
  3552. target = this.selectBestEnterOne(out);
  3553. }
  3554. else {
  3555. target = this.selectBestEnterOne([black]);
  3556. }
  3557. }
  3558. else {
  3559. target = this.selectBestEnterOne(all);
  3560. }
  3561. }
  3562. else {
  3563. target = this.selectBestEnterOne(all);
  3564. }
  3565. break;
  3566. case GameMode.bigMove:
  3567. target = this.selectBestEnterOne(all);
  3568. break;
  3569. case GameMode.placeBall:
  3570. if (all.length > 0) {
  3571. target = this.selectBestEnterOne(all);
  3572. }
  3573. break;
  3574. default:
  3575. break;
  3576. }
  3577. if (target && !target.destroyed && target.onClick) {
  3578. target.onClick(0, true);
  3579. let num = -200 + xGame.common.randomNum(0, 400);
  3580. num /= 150;
  3581. if (xGame.common.longHelpLine) {
  3582. num = 0;
  3583. }
  3584. this.destRot += num;
  3585. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3586. }
  3587. }
  3588. removeOneBall(ball) {
  3589. for (let index = 0; index < this.ballArr.length; index++) {
  3590. if (this.ballArr[index].id == ball.id) {
  3591. this.ballArr.splice(index, 1);
  3592. break;
  3593. }
  3594. }
  3595. }
  3596. getHelpLine() {
  3597. this.d2HelpLine.ui.dirDot.visible = false;
  3598. this.isOnSameLine = false;
  3599. let startX = this.rootBall.gameObj.x;
  3600. let startY = this.rootBall.gameObj.y;
  3601. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3602. if (dis == null) {
  3603. this.d2HelpLine.ui.visible = false;
  3604. console.error("辅助线异常");
  3605. return;
  3606. }
  3607. this.d2HelpLine.ui.visible = true;
  3608. let angle = this.d2Gan.ui.rotation;
  3609. let radius = 16.5;
  3610. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3611. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3612. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3613. if (colliObj == null) {
  3614. this.getColliPos(disX, disY, radius, angle);
  3615. xGame.common.d2World.isHelpLineOnBall = false;
  3616. this.targetBall = null;
  3617. this.reflectAngle = 0;
  3618. this.showBallWrongEft();
  3619. }
  3620. else {
  3621. let target = colliObj.src;
  3622. let radius = 16.5;
  3623. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3624. dis1 = Math.sqrt(dis1);
  3625. let realDis = colliObj.disHon - dis1;
  3626. let dir = colliObj.dir;
  3627. let xx = startX + dir.x * realDis;
  3628. let yy = startY + dir.y * realDis;
  3629. this.getColliPos(xx, yy, radius, angle);
  3630. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3631. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3632. let offset = xGame.common.rodOffest;
  3633. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3634. this.isOnSameLine = true;
  3635. }
  3636. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3637. xGame.common.d2World.isHelpLineOnBall = true;
  3638. this.targetBall = target;
  3639. this.reflectAngle = reflectAngle;
  3640. this.showBallWrongEft();
  3641. if (xGame.common.longHelpLine) {
  3642. this.delayReflectLine(target, reflectAngle);
  3643. }
  3644. }
  3645. }
  3646. getBorderDot(startX, startY, angle) {
  3647. let radius = 17;
  3648. let distance;
  3649. let isDone;
  3650. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3651. isDone = this.judgeUpDown(distance, angle, startX);
  3652. if (isDone != null) {
  3653. return isDone;
  3654. }
  3655. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3656. isDone = this.judgeUpDown(distance, angle, startX);
  3657. if (isDone != null) {
  3658. return isDone;
  3659. }
  3660. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3661. isDone = this.judgeLeftRight(distance, angle, startY);
  3662. if (isDone != null) {
  3663. return isDone;
  3664. }
  3665. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3666. isDone = this.judgeLeftRight(distance, angle, startY);
  3667. if (isDone != null) {
  3668. return isDone;
  3669. }
  3670. }
  3671. judgeUpDown(distance, angle, startX) {
  3672. let flag = Math.sin(angle * Math.PI / 180);
  3673. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3674. if (distance >= 0) {
  3675. if (flag > 0) {
  3676. if (temp < this.borderRect.x + this.borderRect.width) {
  3677. return distance;
  3678. }
  3679. }
  3680. else {
  3681. if (temp > this.borderRect.x) {
  3682. return distance;
  3683. }
  3684. }
  3685. }
  3686. }
  3687. judgeLeftRight(distance, angle, starY) {
  3688. let flag = -Math.cos(angle * Math.PI / 180);
  3689. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3690. if (distance >= 0) {
  3691. if (flag > 0) {
  3692. if (temp < this.borderRect.y + this.borderRect.height) {
  3693. return distance;
  3694. }
  3695. }
  3696. else {
  3697. if (temp > this.borderRect.y) {
  3698. return distance;
  3699. }
  3700. }
  3701. }
  3702. }
  3703. clearBallAllEft() {
  3704. let temp;
  3705. for (let index = 0; index < this.ballArr.length; index++) {
  3706. temp = this.ballArr[index];
  3707. temp.clearBallEft();
  3708. }
  3709. }
  3710. showBallRightEft() {
  3711. let gameMgr = xGame.common.gameMgr;
  3712. let temp;
  3713. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3714. if (targetArr.length <= 0)
  3715. return;
  3716. for (let index = 0; index < this.ballArr.length; index++) {
  3717. temp = this.ballArr[index];
  3718. if (targetArr.indexOf(temp.number) > -1) {
  3719. temp.showRightEft();
  3720. }
  3721. }
  3722. }
  3723. showBallWrongEft() {
  3724. let gameMgr = xGame.common.gameMgr;
  3725. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3726. if (targetArr.length <= 0)
  3727. return;
  3728. let temp;
  3729. for (let index = 0; index < this.ballArr.length; index++) {
  3730. temp = this.ballArr[index];
  3731. if (this.targetBall && this.targetBall.number == temp.number) {
  3732. if (targetArr.indexOf(temp.number) <= -1) {
  3733. temp.showWrongEft();
  3734. }
  3735. else {
  3736. temp.clearBallWrongEft();
  3737. }
  3738. }
  3739. else {
  3740. temp.clearBallWrongEft();
  3741. }
  3742. }
  3743. }
  3744. getColliPos(x, y, radius, angle) {
  3745. this.d2HelpLine.ui.x = x;
  3746. this.d2HelpLine.ui.y = y;
  3747. let dirX = x - this.rootBall.gameObj.x;
  3748. let dirY = y - this.rootBall.gameObj.y;
  3749. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3750. if (rectH <= 0)
  3751. rectH = 0;
  3752. this.d2HelpLine.ui.rect.height = 0;
  3753. this.d2HelpLine.ui.rect.height = rectH;
  3754. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3755. if (rectH < this.rootBall.gameObj.width) {
  3756. this.d2HelpLine.ui.rect.visible = false;
  3757. }
  3758. else {
  3759. this.d2HelpLine.ui.rect.visible = true;
  3760. }
  3761. this.d2HelpLine.ui.dir.visible = false;
  3762. this.d2HelpLine.ui.rootDir.visible = false;
  3763. }
  3764. getReflectLine(x, y, radius, target) {
  3765. this.d2HelpLine.ui.dir.visible = true;
  3766. let dirX = target.x - x;
  3767. let dirY = target.y - y;
  3768. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3769. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3770. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3771. this.d2HelpLine.ui.dir.height = 48;
  3772. this.d2HelpLine.ui.dir.rotation = angle;
  3773. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3774. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3775. return angle;
  3776. }
  3777. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3778. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3779. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3780. let targetX = target.gameObj.x;
  3781. let targetY = target.gameObj.y;
  3782. this.outDir.setValue(targetX - xx, targetY - yy);
  3783. this.rootDir.setValue(rtX - xx, rtY - yy);
  3784. let ver = Math.PI / 2;
  3785. let sin = Math.sin(ver);
  3786. let cos = Math.cos(ver);
  3787. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3788. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3789. this.outDir.setValue(outX, outY);
  3790. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3791. Laya.Vector2.normalize(this.outDir, this.outDir);
  3792. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3793. if (Math.abs(result) <= 0.08) {
  3794. this.d2HelpLine.ui.rootDir.visible = false;
  3795. return;
  3796. }
  3797. if (result > 0) {
  3798. angle += 90;
  3799. }
  3800. else if (result < 0) {
  3801. angle -= 90;
  3802. }
  3803. this.d2HelpLine.ui.rootDir.visible = true;
  3804. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3805. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3806. this.d2HelpLine.ui.rootDir.rotation = angle;
  3807. }
  3808. delayReflectLine(obj, angle) {
  3809. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3810. return;
  3811. }
  3812. this.isOnSameLine = false;
  3813. let startX = obj.gameObj.x;
  3814. let startY = obj.gameObj.y;
  3815. let dis = this.getBorderDot(startX, startY, angle);
  3816. if (dis == null) {
  3817. this.d2HelpLine.ui.dirDot.visible = false;
  3818. return;
  3819. }
  3820. this.d2HelpLine.ui.visible = true;
  3821. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3822. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3823. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3824. if (colliObj == null) {
  3825. this.setDelayLine(disX, disY, obj, angle);
  3826. }
  3827. else {
  3828. let radius = 16;
  3829. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3830. dis1 = Math.sqrt(dis1);
  3831. let realDis = colliObj.disHon - dis1;
  3832. let dir = colliObj.dir;
  3833. let xx = startX + dir.x * realDis;
  3834. let yy = startY + dir.y * realDis;
  3835. this.setDelayLine(xx, yy, obj, angle);
  3836. }
  3837. }
  3838. setDelayLine(x, y, obj, angle) {
  3839. let dirX = x - obj.gameObj.x;
  3840. let dirY = y - obj.gameObj.y;
  3841. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3842. if (rectH <= 0)
  3843. rectH = 0;
  3844. this.d2HelpLine.ui.dir.height = rectH;
  3845. this.d2HelpLine.ui.dirDot.visible = true;
  3846. this.d2HelpLine.ui.dirDot.x = 17;
  3847. this.d2HelpLine.ui.dirDot.y = 17;
  3848. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3849. ;
  3850. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3851. }
  3852. changePlayerView() {
  3853. if (Math.random() >= 0.7)
  3854. return;
  3855. if (!this.targetBall) {
  3856. return;
  3857. }
  3858. if (!xGame.common.gameMgr.selfTurn)
  3859. return;
  3860. switch (xGame.common.gameMode) {
  3861. case GameMode.classic:
  3862. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3863. if (this.targetBall.number != 8) {
  3864. return;
  3865. }
  3866. }
  3867. break;
  3868. case GameMode.bigMove:
  3869. return;
  3870. case GameMode.placeBall:
  3871. break;
  3872. default:
  3873. break;
  3874. }
  3875. let startX = this.targetBall.gameObj.x;
  3876. let startY = this.targetBall.gameObj.y;
  3877. let angle = this.reflectAngle;
  3878. let dis = this.getBorderDot(startX, startY, angle);
  3879. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3880. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3881. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3882. if (colliObj) {
  3883. return;
  3884. }
  3885. let offset = 40;
  3886. let posObj = xGame.common.gameMgr.posObj;
  3887. let temp;
  3888. let radius;
  3889. let tarX, tarY;
  3890. for (const key in posObj) {
  3891. temp = posObj[key];
  3892. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  3893. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  3894. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  3895. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  3896. xGame.common.showOneCamera("angle" + key);
  3897. xGame.common.gameUI.ui.d2Node.alpha = 0;
  3898. Laya.physicsTimer.scale = 0.7;
  3899. break;
  3900. }
  3901. }
  3902. }
  3903. selectBestEnterOne(arr) {
  3904. this.aiLv = xGame.tools.random(1, 11);
  3905. this.aiLv = 10;
  3906. this.wBall = xGame.common.d2World.rootBall;
  3907. this.rootPos.x = this.wBall.gameObj.x;
  3908. this.rootPos.y = this.wBall.gameObj.y;
  3909. this.initHoleBall(arr);
  3910. return this.selectBall();
  3911. }
  3912. selectBall() {
  3913. let ball = null;
  3914. this.destRot = 0;
  3915. let ai = 110 - this.aiLv * 10;
  3916. let mis = xGame.tools.random(-ai, ai) * 0.005;
  3917. let score = false;
  3918. if (this.scoreBall.length < 1) {
  3919. if (this.lineBall.length < 1) {
  3920. for (let i = 0; i < this.kickBall.length; i++) {
  3921. let list = [];
  3922. let bo = this.kickBall[i];
  3923. let bobj = bo.gameObj;
  3924. let rect = xGame.common.d2World.borderRect;
  3925. let mobj = this.wBall.gameObj;
  3926. let minb = bobj.y - rect.y - 20;
  3927. let minw = mobj.y - rect.y - 50;
  3928. if (minb > 0 && minw > 0) {
  3929. let dlenx = 0;
  3930. let dleny = mobj.y - rect.y;
  3931. let spx = mobj.x;
  3932. let spy = rect.y - dleny;
  3933. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3934. }
  3935. minb = rect.y + rect.height - bobj.y - 20;
  3936. minw = rect.y + rect.height - mobj.y - 50;
  3937. if (minb > 0 && minw > 0) {
  3938. let dlenx = 0;
  3939. let dleny = rect.y + rect.height - mobj.y;
  3940. let spx = mobj.x;
  3941. let spy = rect.y + rect.height + dleny;
  3942. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3943. }
  3944. minb = bobj.x - rect.x - 20;
  3945. minw = mobj.x - rect.x - 50;
  3946. if (minb > 0 && minw > 0) {
  3947. let dlenx = mobj.x - rect.x;
  3948. let dleny = 0;
  3949. let spx = rect.x - dlenx;
  3950. let spy = mobj.y;
  3951. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3952. }
  3953. minb = rect.x + rect.width - bobj.x - 20;
  3954. minw = rect.x + rect.width - mobj.x - 50;
  3955. if (minb > 0 && minw > 0) {
  3956. let dlenx = rect.x + rect.width - mobj.x;
  3957. let dleny = 0;
  3958. let spx = rect.x + rect.width + dlenx;
  3959. let spy = mobj.y;
  3960. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  3961. }
  3962. list.sort(function (a, b) {
  3963. return a.order - b.order;
  3964. });
  3965. for (let i = 0; i < list.length; i++) {
  3966. let data = list[i];
  3967. let mx = mobj.x - bobj.x;
  3968. let my = mobj.y - bobj.y;
  3969. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  3970. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  3971. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  3972. if (num > 1)
  3973. num = 1;
  3974. let cos = Math.acos(num);
  3975. if (cos > 1.57)
  3976. cos = 1.57;
  3977. else if (cos < 0.01)
  3978. cos = 0.01;
  3979. let tan = Math.tan(cos);
  3980. let dx = tan * data.dleny;
  3981. let dy = tan * data.dlenx;
  3982. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  3983. if (Math.abs(bx - 667) < 40)
  3984. continue;
  3985. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  3986. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  3987. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  3988. this.forceMax = dis * 0.08;
  3989. this.destRot += mis * 0.1;
  3990. this.setKick(bx, by);
  3991. return true;
  3992. }
  3993. }
  3994. }
  3995. }
  3996. else {
  3997. ball = xGame.common.getRandArrEle(this.lineBall);
  3998. }
  3999. }
  4000. else {
  4001. for (let i = 0; i < this.scoreBall.length; i++) {
  4002. if (i < this.scoreBall.length - 1) {
  4003. let rand = 70 + this.aiLv * 10 + i * 10;
  4004. if (xGame.tools.random(0, 100) < rand) {
  4005. ball = this.scoreBall[i];
  4006. break;
  4007. }
  4008. }
  4009. else {
  4010. ball = this.scoreBall[i];
  4011. break;
  4012. }
  4013. }
  4014. score = true;
  4015. this.selectNum++;
  4016. }
  4017. if (!ball)
  4018. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4019. let dx = ball.gameObj.x;
  4020. let dy = ball.gameObj.y;
  4021. let kickAngle = 0;
  4022. if (score) {
  4023. dx = ball.kickPos.x;
  4024. dy = ball.kickPos.y;
  4025. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4026. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4027. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4028. if (adot > 1)
  4029. adot = 1;
  4030. kickAngle = Math.acos(adot) * 57.3;
  4031. if (kickAngle > 45) {
  4032. let kdx = ball.kickPos.x - ball.gameObj.x;
  4033. let kdy = ball.kickPos.y - ball.gameObj.y;
  4034. dx = ball.kickPos.x - kdx * mis * 0.3;
  4035. dy = ball.kickPos.y - kdy * mis * 0.3;
  4036. }
  4037. else
  4038. this.destRot += mis;
  4039. }
  4040. else if (ball.poleAngle != 0) {
  4041. this.destRot += ball.poleAngle;
  4042. }
  4043. if (xGame.common.gameMode == 0) {
  4044. let af = kickAngle * 0.08;
  4045. this.forceMax = ball.hard * 0.1 + af * af;
  4046. }
  4047. this.setKick(dx, dy);
  4048. return ball;
  4049. }
  4050. initHoleBall(arr) {
  4051. this.kickBall = [];
  4052. this.lineBall = [];
  4053. this.scoreBall = [];
  4054. this.holeBall = [];
  4055. this.selectNum = 0;
  4056. this.forceNum = 0;
  4057. this.forceMax = 0;
  4058. this.turnNum = 0;
  4059. let list = arr;
  4060. let holes = xGame.common.gameMgr.holePosList;
  4061. let self = xGame.common.aiPlayer;
  4062. for (let i = 0; i < list.length; i++) {
  4063. let obj = list[i];
  4064. if (!obj)
  4065. continue;
  4066. obj.kickPos.x = 0;
  4067. obj.kickPos.y = 0;
  4068. obj.poleAngle = 0;
  4069. obj.hard = 0;
  4070. obj.borderDis = 0;
  4071. obj.kickAngle = 180;
  4072. let b = obj.gameObj;
  4073. let wbp = this.rootPos;
  4074. let bx = wbp.x - b.x;
  4075. let by = wbp.y - b.y;
  4076. obj.borderDis = xGame.tools.random(0, 100);
  4077. this.kickBall.push(obj);
  4078. if (!this.isLine(wbp, obj))
  4079. continue;
  4080. obj.kickAngle = xGame.tools.random(90, 180);
  4081. obj.kickPos.x = b.x;
  4082. obj.kickPos.y = b.y;
  4083. this.lineBall.push(obj);
  4084. let minDis = 999999;
  4085. let hole = false;
  4086. for (let j = 0; j < holes.length; j++) {
  4087. let hp = holes[j];
  4088. if (bx >= 0 && hp.x > b.x + 100)
  4089. continue;
  4090. if (bx <= 0 && hp.x < b.x - 100)
  4091. continue;
  4092. if (by < -10 && hp.y < wbp.y)
  4093. continue;
  4094. if (by > 10 && hp.y > wbp.y)
  4095. continue;
  4096. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4097. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4098. if (dis < minDis) {
  4099. let dx = b.x - this.tempDir1.x * this.ballSize;
  4100. let dy = b.y - this.tempDir1.y * this.ballSize;
  4101. this.tempDir3.x = this.tempDir1.x;
  4102. this.tempDir3.y = this.tempDir1.y;
  4103. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4104. obj.kickPos.x = dx;
  4105. obj.kickPos.y = dy;
  4106. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4107. if (num > 1)
  4108. num = 1;
  4109. obj.kickAngle = Math.acos(num) * 57.3;
  4110. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4111. dis = dis * 2;
  4112. if (Math.abs(hp.x - 600) < 100)
  4113. dis += 50;
  4114. obj.hard = dis + obj.kickAngle * 3;
  4115. hole = true;
  4116. }
  4117. }
  4118. }
  4119. }
  4120. if (hole) {
  4121. this.scoreBall.push(obj);
  4122. this.holeBall.push(obj);
  4123. }
  4124. }
  4125. this.scoreBall.sort(function (a, b) {
  4126. return a.hard - b.hard;
  4127. });
  4128. this.holeBall.sort(function (a, b) {
  4129. return a.kickAngle - b.kickAngle;
  4130. });
  4131. this.kickBall.sort(function (a, b) {
  4132. return a.borderDis - b.borderDis;
  4133. });
  4134. }
  4135. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4136. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4137. let balls = xGame.common.d2World.ballArr;
  4138. let max = xGame.tools.getDis(hx, hy, bx, by);
  4139. for (let index = 0; index < balls.length; index++) {
  4140. let obj = balls[index];
  4141. if (obj.number == 0)
  4142. continue;
  4143. if (obj.number == bn || obj.number == dn)
  4144. continue;
  4145. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4146. if (dis * dis > max)
  4147. continue;
  4148. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4149. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4150. if (num > 1)
  4151. num = 1;
  4152. if (num < 0)
  4153. continue;
  4154. let gap = Math.sin(Math.acos(num)) * dis;
  4155. if (gap < this.ballSize)
  4156. return true;
  4157. }
  4158. return false;
  4159. }
  4160. isLine(xy, ball) {
  4161. let bx = xy.x;
  4162. let by = xy.y;
  4163. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4164. let dis = ball.getDestDis(xy);
  4165. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4166. let sin = Math.sin(angle);
  4167. let cos = Math.cos(angle);
  4168. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4169. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4170. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4171. let dx = bx + this.tempDir2.x * dis;
  4172. let dy = by + this.tempDir2.y * dis;
  4173. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4174. sin = Math.sin(-angle);
  4175. cos = Math.cos(-angle);
  4176. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4177. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4178. dx = bx + this.tempDir2.x * dis;
  4179. dy = by + this.tempDir2.y * dis;
  4180. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4181. if (isr && isl)
  4182. return false;
  4183. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4184. }
  4185. return true;
  4186. }
  4187. setKick(dx, dy) {
  4188. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4189. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4190. this.tempDir1.x = 0;
  4191. this.tempDir1.y = 1;
  4192. this.tempDir2.y = -this.tempDir2.y;
  4193. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4194. if (num > 1)
  4195. num = 1;
  4196. let rot = Math.acos(num) * 57.3;
  4197. if (this.tempDir2.x < 0)
  4198. rot = 360 - rot;
  4199. this.destRot += rot;
  4200. }
  4201. }
  4202. class ui_UIGame extends fgui.GComponent {
  4203. static createInstance() {
  4204. return (fgui.UIPackage.createObject("game", "UIGame"));
  4205. }
  4206. onConstruct() {
  4207. this.c1 = this.getController("c1");
  4208. this.d3Root = (this.getChild("d3Root"));
  4209. this.clickNode = (this.getChild("clickNode"));
  4210. this.d2Root = (this.getChild("d2Root"));
  4211. this.topNode = (this.getChild("topNode"));
  4212. this.n72 = (this.getChild("n72"));
  4213. this.n40 = (this.getChild("n40"));
  4214. this.rulerNode = (this.getChild("rulerNode"));
  4215. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4216. this.n50 = (this.getChild("n50"));
  4217. this.keduNode = (this.getChild("keduNode"));
  4218. this.powerTxt = (this.getChild("powerTxt"));
  4219. this.powerNode = (this.getChild("powerNode"));
  4220. this.colorNode = (this.getChild("colorNode"));
  4221. this.powerEft = (this.getChild("powerEft"));
  4222. this.myPowerNode = (this.getChild("myPowerNode"));
  4223. this.ganNode = (this.getChild("ganNode"));
  4224. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4225. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4226. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4227. this.skillRod = (this.getChild("skillRod"));
  4228. this.border = (this.getChild("border"));
  4229. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4230. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4231. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4232. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4233. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4234. this.guanyuNode = (this.getChild("guanyuNode"));
  4235. this.helpBtn = (this.getChild("helpBtn"));
  4236. this.wordsBtn = (this.getChild("wordsBtn"));
  4237. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4238. this.returnBtn = (this.getChild("returnBtn"));
  4239. this.ballNode = (this.getChild("ballNode"));
  4240. this.whiteAni = (this.getChild("whiteAni"));
  4241. this.blackAni = (this.getChild("blackAni"));
  4242. this.selfTurn = (this.getChild("selfTurn"));
  4243. this.aiTurn = (this.getChild("aiTurn"));
  4244. this.deskNode = (this.getChild("deskNode"));
  4245. this.moveNode = (this.getChild("moveNode"));
  4246. this.selfTalk = (this.getChild("selfTalk"));
  4247. this.aiTalk = (this.getChild("aiTalk"));
  4248. this.d2Node = (this.getChild("d2Node"));
  4249. this.snowNode = (this.getChild("snowNode"));
  4250. this.guide2 = (this.getChild("guide2"));
  4251. this.guide1 = (this.getChild("guide1"));
  4252. this.guide3 = (this.getChild("guide3"));
  4253. this.guideNode = (this.getChild("guideNode"));
  4254. }
  4255. }
  4256. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4257. class ui_UIGameEnd extends fgui.GComponent {
  4258. static createInstance() {
  4259. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4260. }
  4261. onConstruct() {
  4262. this.c1 = this.getController("c1");
  4263. this.n22 = (this.getChild("n22"));
  4264. this.n2 = (this.getChild("n2"));
  4265. this.n52 = (this.getChild("n52"));
  4266. this.n53 = (this.getChild("n53"));
  4267. this.coinNode = (this.getChild("coinNode"));
  4268. this.closeNode = (this.getChild("closeNode"));
  4269. this.moneyNode = (this.getChild("moneyNode"));
  4270. this.secretary = (this.getChild("secretary"));
  4271. this.n27 = (this.getChild("n27"));
  4272. this.n29 = (this.getChild("n29"));
  4273. this.talkNode = (this.getChild("talkNode"));
  4274. this.n38 = (this.getChild("n38"));
  4275. this.n39 = (this.getChild("n39"));
  4276. this.n40 = (this.getChild("n40"));
  4277. this.awardNode = (this.getChild("awardNode"));
  4278. this.starNumNode = (this.getChild("starNumNode"));
  4279. this.n47 = (this.getChild("n47"));
  4280. this.conditionNode = (this.getChild("conditionNode"));
  4281. this.isGetAward = (this.getChild("isGetAward"));
  4282. this.leftBtn = (this.getChild("leftBtn"));
  4283. this.rightBtn = (this.getChild("rightBtn"));
  4284. this.btnNode = (this.getChild("btnNode"));
  4285. }
  4286. }
  4287. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4288. class ui_UIAddCoin extends fgui.GComponent {
  4289. static createInstance() {
  4290. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4291. }
  4292. onConstruct() {
  4293. this.n11 = (this.getChild("n11"));
  4294. this.myNode = (this.getChild("myNode"));
  4295. this.t0 = this.getTransition("t0");
  4296. }
  4297. }
  4298. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4299. class UIAddCoin extends UIBase {
  4300. constructor() {
  4301. super();
  4302. this.coinNum = 2000;
  4303. }
  4304. onConstructor() {
  4305. this.ui = ui_UIAddCoin.createInstance();
  4306. this.contentPane = this.ui;
  4307. this.isEject = false;
  4308. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4309. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4310. }
  4311. show() {
  4312. super.show();
  4313. this.ui.t0.play();
  4314. }
  4315. videoAddCoin() {
  4316. console.log('zh:qjff_AD_for_UIAddCoin');
  4317. if (Laya.Browser.onAndroid) {
  4318. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4319. if (!boo) {
  4320. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4321. return;
  4322. }
  4323. }
  4324. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4325. }
  4326. else {
  4327. console.log('zh:AD 失败,直接发放奖励');
  4328. this.qjff_AD_for_UIAddCoin();
  4329. }
  4330. }
  4331. qjff_AD_for_UIAddCoin() {
  4332. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4333. this.hide();
  4334. }
  4335. }
  4336. UIAddCoin.uiName = "UIAddCoin";
  4337. class ui_UIInvitation extends fgui.GComponent {
  4338. static createInstance() {
  4339. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4340. }
  4341. onConstruct() {
  4342. this.n14 = (this.getChild("n14"));
  4343. this.myNode = (this.getChild("myNode"));
  4344. this.t0 = this.getTransition("t0");
  4345. }
  4346. }
  4347. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4348. class UIInvitation extends UIBase {
  4349. constructor() {
  4350. super();
  4351. }
  4352. onConstructor() {
  4353. this.ui = ui_UIInvitation.createInstance();
  4354. this.contentPane = this.ui;
  4355. this.isEject = false;
  4356. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4357. }
  4358. show() {
  4359. super.show();
  4360. }
  4361. enterGame() {
  4362. xGame.common.gameMode = GameMode.classic;
  4363. DataMgr.setChallengeTimes(1);
  4364. xGame.common.passAwardCoin = 2000;
  4365. let need = xGame.common.classicNiceNeddCoin;
  4366. if (DataMgr.coinEnough(need)) {
  4367. DataMgr.setCoin(-need);
  4368. xGame.eventMgr.event(RESTART_GAME, true);
  4369. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4370. }
  4371. else {
  4372. xGame.eventMgr.event(RESTART_GAME, true);
  4373. }
  4374. this.hide();
  4375. }
  4376. hide() {
  4377. super.hide();
  4378. }
  4379. }
  4380. UIInvitation.uiName = "UIInvitation";
  4381. class ui_UIMain extends fgui.GComponent {
  4382. static createInstance() {
  4383. return (fgui.UIPackage.createObject("game", "UIMain"));
  4384. }
  4385. onConstruct() {
  4386. this.n47 = (this.getChild("n47"));
  4387. this.n10 = (this.getChild("n10"));
  4388. this.secretary = (this.getChild("secretary"));
  4389. this.shopBtn = (this.getChild("shopBtn"));
  4390. this.moneyNode = (this.getChild("moneyNode"));
  4391. this.headNode = (this.getChild("headNode"));
  4392. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4393. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4394. this.classicBtn = (this.getChild("classicBtn"));
  4395. this.globalBtn = (this.getChild("globalBtn"));
  4396. this.n44 = (this.getChild("n44"));
  4397. this.signBtn = (this.getChild("signBtn"));
  4398. this.drawBtn = (this.getChild("drawBtn"));
  4399. this.settingNode = (this.getChild("settingNode"));
  4400. this.n_fuli = (this.getChild("n_fuli"));
  4401. this.n45 = (this.getChild("n45"));
  4402. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4403. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4404. this.rankBtn = (this.getChild("rankBtn"));
  4405. this.n46 = (this.getChild("n46"));
  4406. this.liucheng1 = (this.getChild("liucheng1"));
  4407. this.rightBtn = (this.getChild("rightBtn"));
  4408. this.n75 = (this.getChild("n75"));
  4409. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4410. this.liucheng2 = (this.getChild("liucheng2"));
  4411. this.guideBtn = (this.getChild("guideBtn"));
  4412. this.n73 = (this.getChild("n73"));
  4413. this.wordsNode = (this.getChild("wordsNode"));
  4414. this.enterGuide = (this.getChild("enterGuide"));
  4415. this.talkNode = (this.getChild("talkNode"));
  4416. this.n83 = (this.getChild("n83"));
  4417. this.n84 = (this.getChild("n84"));
  4418. this.n_Logout = (this.getChild("n_Logout"));
  4419. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4420. this.n_dengLu = (this.getChild("n_dengLu"));
  4421. }
  4422. }
  4423. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4424. class ui_UIMoyu extends fgui.GComponent {
  4425. static createInstance() {
  4426. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4427. }
  4428. onConstruct() {
  4429. this.ageTip = (this.getChild("ageTip"));
  4430. this.mainBg = (this.getChild("mainBg"));
  4431. this.xyNode = (this.getChild("xyNode"));
  4432. this.rnNode = (this.getChild("rnNode"));
  4433. this.fcmNode = (this.getChild("fcmNode"));
  4434. this.ageNode = (this.getChild("ageNode"));
  4435. this.tipNode = (this.getChild("tipNode"));
  4436. this.msgNode = (this.getChild("msgNode"));
  4437. }
  4438. }
  4439. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4440. class MoyuMgr {
  4441. static initMoyu() {
  4442. this.moyuView = new MoyuView();
  4443. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4444. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4445. this.moyuView.ui.displayObject.zOrder = 1000;
  4446. this.moyuView.init();
  4447. this.moyuView.showTip(true);
  4448. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4449. window['XApk'] = this;
  4450. }
  4451. static showAge(show) {
  4452. if (this.moyuView)
  4453. this.moyuView.showAge(show);
  4454. }
  4455. static onPlatMsg(idx) {
  4456. if (!MoyuMgr.moyuView)
  4457. return;
  4458. if (idx == '0') {
  4459. MoyuMgr.moyuView.showTip(false);
  4460. }
  4461. }
  4462. static showAgree(call) {
  4463. if (this.moyuView)
  4464. this.moyuView.showAgree(call);
  4465. else
  4466. call && call();
  4467. }
  4468. static showXy(type = 1) {
  4469. if (this.moyuView)
  4470. this.moyuView.showXy(type);
  4471. }
  4472. }
  4473. MoyuMgr.isAdvise = false;
  4474. class MoyuView {
  4475. constructor() {
  4476. this.ysxyNum = 1;
  4477. this.ysJson = null;
  4478. this.ui = ui_UIMoyu.createInstance();
  4479. }
  4480. init() {
  4481. this.ui.mainBg.visible = false;
  4482. this.ui.xyNode.visible = false;
  4483. this.ui.ageNode.visible = false;
  4484. this.ui.tipNode.visible = false;
  4485. this.ui.rnNode.visible = false;
  4486. this.ui.fcmNode.visible = false;
  4487. this.ui.ageTip.visible = false;
  4488. this.ui.msgNode.visible = false;
  4489. this.ui.visible = false;
  4490. this.ui.xyNode.xyList.setVirtual();
  4491. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4492. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4493. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4494. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4495. this.ui.xyNode.btnKnown.visible = false;
  4496. this.ui.xyNode.xy1.visible = false;
  4497. this.ui.xyNode.xy2.visible = false;
  4498. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4499. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4500. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4501. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4502. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4503. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4504. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4505. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4506. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4507. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4508. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4509. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4510. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4511. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4512. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4513. this.ysxyNum = 2;
  4514. }
  4515. }
  4516. onClick(obj) {
  4517. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4518. switch (obj) {
  4519. case this.ui.ageTip:
  4520. if (Moyu.isTTApk) {
  4521. this.ui.ageNode.visible = true;
  4522. this.ui.mainBg.visible = true;
  4523. }
  4524. break;
  4525. case this.ui.tipNode:
  4526. this.showTip(false);
  4527. break;
  4528. case this.ui.ageNode.btnAge:
  4529. this.ui.ageNode.visible = false;
  4530. this.ui.mainBg.visible = false;
  4531. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4532. this.ui.visible = false;
  4533. break;
  4534. case this.ui.xyNode.btnXy3:
  4535. case this.ui.xyNode.btnXy1:
  4536. this.loadXy(1);
  4537. break;
  4538. case this.ui.xyNode.btnXy2:
  4539. this.loadXy(2);
  4540. break;
  4541. case this.ui.xyNode.btnBack:
  4542. this.ui.xyNode.xy1.visible = true;
  4543. this.ui.xyNode.xy2.visible = false;
  4544. break;
  4545. case this.ui.xyNode.btnKnown:
  4546. this.ui.xyNode.visible = false;
  4547. this.ui.mainBg.visible = false;
  4548. this.ui.visible = false;
  4549. break;
  4550. case this.ui.rnNode.btnCheck:
  4551. this.check();
  4552. break;
  4553. case this.ui.rnNode.btnExit:
  4554. case this.ui.xyNode.btnNo:
  4555. this.ysxyNum--;
  4556. if (this.ysxyNum > 0)
  4557. this.showMsg("Refuse to quit the game once again");
  4558. else {
  4559. Moyu.userAgree(false);
  4560. Moyu.exit();
  4561. }
  4562. break;
  4563. case this.ui.xyNode.btnSure:
  4564. case this.ui.xyNode.btnYes:
  4565. DataMgr.userData.isAgree = true;
  4566. DataMgr.saveUserData();
  4567. this.onAgree();
  4568. break;
  4569. case this.ui.rnNode.btnDone:
  4570. this.ui.rnNode.visible = false;
  4571. this.ui.visible = false;
  4572. break;
  4573. case this.ui.fcmNode.btnRn:
  4574. this.showRn();
  4575. break;
  4576. }
  4577. }
  4578. showTip(show) {
  4579. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4580. return;
  4581. if (show) {
  4582. MoyuMgr.isAdvise = true;
  4583. this.ui.visible = true;
  4584. this.ui.tipNode.visible = true;
  4585. this.ui.tipNode.alpha = 1;
  4586. Laya.timer.once(1000, this, this.showTip, [false]);
  4587. }
  4588. else {
  4589. this.ui.tipNode.alpha = 1;
  4590. this.ui.tipNode.visible = true;
  4591. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4592. this.ui.tipNode.visible = false;
  4593. MoyuMgr.isAdvise = false;
  4594. }), 1000);
  4595. }
  4596. }
  4597. showAge(show, px = 0, py = 0) {
  4598. if (Moyu.platType > 10 && !Moyu.isIos) {
  4599. this.ui.ageTip.x = px;
  4600. this.ui.ageTip.y = py;
  4601. this.ui.ageTip.visible = show;
  4602. if (show)
  4603. this.ui.visible = true;
  4604. }
  4605. }
  4606. showAgree(call) {
  4607. this.agreeCall = call;
  4608. this.onAgree();
  4609. return;
  4610. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4611. this.showXy(0);
  4612. }
  4613. else
  4614. this.onAgree();
  4615. }
  4616. onAgree() {
  4617. if (!this.ui.ageNode.visible)
  4618. this.ui.visible = false;
  4619. this.ui.xyNode.visible = false;
  4620. Moyu.userAgree(true);
  4621. this.showAge(false);
  4622. this.agreeCall && this.agreeCall();
  4623. this.showRn();
  4624. }
  4625. showMsg(txt) {
  4626. this.ui.msgNode.txtMsg.text = txt;
  4627. this.ui.msgNode.visible = true;
  4628. this.ui.msgNode.alpha = 1;
  4629. this.ui.visible = true;
  4630. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4631. this.ui.msgNode.visible = false;
  4632. }), 2500, true);
  4633. }
  4634. showRn() {
  4635. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4636. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4637. this.ui.rnNode.rn1.visible = true;
  4638. this.ui.rnNode.rn2.visible = false;
  4639. this.ui.rnNode.rn3.visible = false;
  4640. this.ui.rnNode.rn4.visible = false;
  4641. this.ui.rnNode.visible = true;
  4642. this.ui.mainBg.visible = true;
  4643. this.ui.rnNode.btnDone.visible = false;
  4644. this.ui.rnNode.btnExit.visible = true;
  4645. this.ui.rnNode.btnCheck.visible = true;
  4646. this.ui.fcmNode.visible = false;
  4647. this.ui.visible = true;
  4648. return;
  4649. }
  4650. }
  4651. this.showFcm();
  4652. }
  4653. showFcm() {
  4654. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4655. Moyu.initFCM(true);
  4656. if (Moyu.gameTime < 1)
  4657. this.fcmLoop();
  4658. else if (Moyu.gameTime < 999)
  4659. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4660. }
  4661. }
  4662. fcmLoop() {
  4663. if (Moyu.gameTime < 1) {
  4664. this.ui.rnNode.visible = false;
  4665. this.ui.fcmNode.visible = true;
  4666. this.ui.mainBg.visible = true;
  4667. this.ui.visible = true;
  4668. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4669. Laya.timer.clear(this.ui, this.fcmLoop);
  4670. }
  4671. }
  4672. check() {
  4673. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4674. this.ui.rnNode.rn1.visible = false;
  4675. this.ui.rnNode.rn2.visible = false;
  4676. this.ui.rnNode.rn4.visible = true;
  4677. }
  4678. else if (this.ui.rnNode.rn4.visible) {
  4679. let name = this.ui.rnNode.inputName.text;
  4680. let code = this.ui.rnNode.inputCode.text;
  4681. if (code && code.length == 18) {
  4682. this.ui.rnNode.rn1.visible = false;
  4683. this.ui.rnNode.rn4.visible = false;
  4684. Moyu.authenticate(name, code, (res) => {
  4685. this.ui.rnNode.rn2.visible = !res;
  4686. this.ui.rnNode.rn3.visible = res;
  4687. this.ui.rnNode.btnDone.visible = res;
  4688. this.ui.rnNode.btnExit.visible = !res;
  4689. this.ui.rnNode.btnCheck.visible = !res;
  4690. if (res)
  4691. this.showFcm();
  4692. });
  4693. }
  4694. else
  4695. this.showMsg("信息填写不完整");
  4696. }
  4697. }
  4698. loadXy(type = 0) {
  4699. this.ui.xyNode.xy1.visible = false;
  4700. this.ui.xyNode.xy2.visible = true;
  4701. this.ui.xyNode.xyList.scrollToView(0);
  4702. if (type == 1) {
  4703. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4704. }
  4705. else if (type == 2) {
  4706. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4707. }
  4708. }
  4709. showXy(type = 0) {
  4710. this.xyBtn();
  4711. if (type == 0) {
  4712. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4713. this.ui.xyNode.btnSure.visible = true;
  4714. }
  4715. else {
  4716. this.ui.xyNode.btnYes.visible = true;
  4717. this.ui.xyNode.btnNo.visible = true;
  4718. }
  4719. }
  4720. else {
  4721. this.ui.xyNode.btnKnown.visible = true;
  4722. this.ui.mainBg.visible = true;
  4723. }
  4724. this.ui.xyNode.xy1.visible = true;
  4725. this.ui.xyNode.xy2.visible = false;
  4726. this.ui.xyNode.visible = true;
  4727. this.ui.visible = true;
  4728. }
  4729. xyBtn() {
  4730. this.ui.xyNode.btnSure.visible = false;
  4731. this.ui.xyNode.btnYes.visible = false;
  4732. this.ui.xyNode.btnNo.visible = false;
  4733. this.ui.xyNode.btnKnown.visible = false;
  4734. {
  4735. this.ui.xyNode.btnXy3.visible = false;
  4736. this.ui.xyNode.btnXy2.visible = true;
  4737. this.ui.xyNode.btnXy1.visible = true;
  4738. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4739. }
  4740. }
  4741. createXY(json) {
  4742. this.ysJson = json.content;
  4743. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4744. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4745. this.ui.xyNode.xy2.visible = true;
  4746. }
  4747. renderListItem(idx, cell) {
  4748. let xy = this.ysJson[idx];
  4749. cell.height = xy.line * 30;
  4750. cell.xyItem.text = xy.text;
  4751. }
  4752. onDestroy() {
  4753. this.agreeCall = null;
  4754. }
  4755. }
  4756. class SettingNode {
  4757. constructor(ui) {
  4758. this.showSetting = false;
  4759. this.openSound = true;
  4760. this.openShake = true;
  4761. this.ui = ui;
  4762. this.ui.soundBtn.onClick(this, this.switchSound);
  4763. this.ui.shakeBtn.onClick(this, this.switchShake);
  4764. this.ui.xyBtn.onClick(this, this.onXy);
  4765. this.ui.clickNode.onClick(this, this.changeSetting);
  4766. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4767. this.ui.xyBtn.visible = false;
  4768. this.ui.shakeBtn.visible = false;
  4769. }
  4770. changeSetting() {
  4771. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4772. this.showSetting = !this.showSetting;
  4773. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4774. }
  4775. switchSound() {
  4776. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4777. this.openSound = !this.openSound;
  4778. Moyu.onSetting(this.openSound, this.openShake);
  4779. xGame.soundMgr.onSetting(this.openSound);
  4780. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4781. }
  4782. switchShake() {
  4783. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4784. this.openShake = !this.openShake;
  4785. Moyu.onSetting(this.openSound, this.openShake);
  4786. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4787. }
  4788. onXy() {
  4789. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4790. MoyuMgr.showXy(1);
  4791. }
  4792. }
  4793. class ui_UILevelDisplay extends fgui.GComponent {
  4794. static createInstance() {
  4795. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4796. }
  4797. onConstruct() {
  4798. this.n9 = (this.getChild("n9"));
  4799. this.myNode = (this.getChild("myNode"));
  4800. this.closeNode = (this.getChild("closeNode"));
  4801. }
  4802. }
  4803. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4804. class ui_UILevelProp extends fgui.GComponent {
  4805. static createInstance() {
  4806. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4807. }
  4808. onConstruct() {
  4809. this.n16 = (this.getChild("n16"));
  4810. this.myNode = (this.getChild("myNode"));
  4811. this.closeBtn = (this.getChild("closeBtn"));
  4812. this.moneyNode = (this.getChild("moneyNode"));
  4813. this.t1 = this.getTransition("t1");
  4814. }
  4815. }
  4816. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4817. class ui_ShowItem extends fgui.GComponent {
  4818. static createInstance() {
  4819. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4820. }
  4821. onConstruct() {
  4822. this.myImg = (this.getChild("myImg"));
  4823. }
  4824. }
  4825. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4826. class ShowItem {
  4827. constructor() {
  4828. this.ui = ui_ShowItem.createInstance();
  4829. }
  4830. destroySelf() {
  4831. if (!this.ui.isDisposed) {
  4832. this.ui.removeFromParent();
  4833. this.ui.dispose();
  4834. }
  4835. }
  4836. setParent(parent) {
  4837. parent.addChild(this.ui);
  4838. }
  4839. setPos(x, y) {
  4840. this.ui.x = x;
  4841. this.ui.y = y;
  4842. }
  4843. setUrl(index) {
  4844. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4845. }
  4846. }
  4847. class ui_UIPower extends fgui.GComponent {
  4848. static createInstance() {
  4849. return (fgui.UIPackage.createObject("game", "UIPower"));
  4850. }
  4851. onConstruct() {
  4852. this.n11 = (this.getChild("n11"));
  4853. this.myNode = (this.getChild("myNode"));
  4854. this.t0 = this.getTransition("t0");
  4855. }
  4856. }
  4857. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4858. class UIPower extends UIBase {
  4859. constructor() {
  4860. super();
  4861. }
  4862. onConstructor() {
  4863. this.ui = ui_UIPower.createInstance();
  4864. this.contentPane = this.ui;
  4865. this.isEject = false;
  4866. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4867. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4868. }
  4869. show() {
  4870. super.show();
  4871. this.ui.t0.play();
  4872. }
  4873. videoGetPower() {
  4874. console.log('zh:qjff_AD_for_uipower');
  4875. if (Laya.Browser.onAndroid) {
  4876. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4877. if (!boo) {
  4878. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4879. return;
  4880. }
  4881. }
  4882. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4883. }
  4884. else {
  4885. console.log('zh:AD 失败,直接发放奖励');
  4886. this.qjff_AD_for_uipower();
  4887. }
  4888. }
  4889. qjff_AD_for_uipower() {
  4890. DataMgr.setPower(xGame.common.videoPower, true);
  4891. xGame.eventMgr.event(POWER_TIME);
  4892. this.hide();
  4893. }
  4894. }
  4895. UIPower.uiName = "UIPower";
  4896. class LocalStorageManager {
  4897. test1() {
  4898. LocalStorageManager.setItem("playerName", "Tom");
  4899. LocalStorageManager.setItem("playerLevel", 5);
  4900. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  4901. const name = LocalStorageManager.getItem("playerName");
  4902. const level = LocalStorageManager.getItem("playerLevel");
  4903. const data = LocalStorageManager.getItem("playerData");
  4904. console.log(name);
  4905. console.log(level);
  4906. console.log(data);
  4907. LocalStorageManager.removeItem("playerLevel");
  4908. }
  4909. static setItem(key, value) {
  4910. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  4911. }
  4912. static getItem(key) {
  4913. const data = Laya.LocalStorage.getItem(key);
  4914. if (data === null)
  4915. return null;
  4916. try {
  4917. return JSON.parse(data);
  4918. }
  4919. catch (e) {
  4920. return data;
  4921. }
  4922. }
  4923. static removeItem(key) {
  4924. Laya.LocalStorage.removeItem(key);
  4925. }
  4926. static clear() {
  4927. Laya.LocalStorage.clear();
  4928. }
  4929. static hasJosnKey(key) {
  4930. var value = Laya.LocalStorage.getJSON(key);
  4931. if (value != null) {
  4932. return true;
  4933. }
  4934. else {
  4935. return false;
  4936. }
  4937. }
  4938. static hasKey(key) {
  4939. return Laya.LocalStorage.getItem(key) !== null;
  4940. }
  4941. }
  4942. class UILevelProp extends UIBase {
  4943. constructor() {
  4944. super();
  4945. this.firstPos = 385;
  4946. this.secondPos = 467;
  4947. this.showItemArr = [];
  4948. }
  4949. onFontLoaded() {
  4950. try {
  4951. this.ui.myNode.conditionTxt.font = "arial";
  4952. console.log("zh: onFontLoaded 设置arial字体成功");
  4953. }
  4954. catch (error) {
  4955. console.log("zh: constructor onFontLoaded加载arial字体失败");
  4956. }
  4957. }
  4958. onConstructor() {
  4959. this.ui = ui_UILevelProp.createInstance();
  4960. this.contentPane = this.ui;
  4961. this.isEject = false;
  4962. this.addUIClick(this.ui.closeBtn, this.hide);
  4963. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  4964. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  4965. }
  4966. show(level) {
  4967. super.show();
  4968. this.ui.t1.play();
  4969. this.level = level;
  4970. this.data = cfgTable.placeballData[this.level];
  4971. this.updateSelf();
  4972. this.showPreView();
  4973. this.moneyNode.ui.c1.selectedIndex = 2;
  4974. this.moneyNode.checkPowerTime();
  4975. this.moneyNode.powerChange();
  4976. }
  4977. showPreView() {
  4978. let item;
  4979. let data;
  4980. for (let index = 0; index < this.showItemArr.length; index++) {
  4981. item = this.showItemArr[index];
  4982. item.destroySelf();
  4983. }
  4984. this.showItemArr = [];
  4985. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  4986. for (const key in cfgData) {
  4987. data = cfgData[key];
  4988. item = new ShowItem();
  4989. item.setParent(this.ui.myNode.displayRoot);
  4990. item.setPos(data.x, data.y);
  4991. item.setUrl(data.value);
  4992. this.showItemArr.push(item);
  4993. }
  4994. }
  4995. updateSelf() {
  4996. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  4997. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  4998. if (this.data.ball == -1) {
  4999. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5000. }
  5001. else {
  5002. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5003. }
  5004. let localData = DataMgr.getPlaceBallLevel(this.level);
  5005. let getAward = localData.getAward;
  5006. let cfg = cfgTable.placeballData[this.level];
  5007. let coin = this.data.award[0];
  5008. let diamond = this.data.award[1];
  5009. if (cfg.type == PlaceBallType.challenge) {
  5010. diamond = 0;
  5011. coin = 100;
  5012. }
  5013. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5014. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5015. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5016. if (cfg.type == PlaceBallType.challenge) {
  5017. this.ui.myNode.coinNode.numTxt.text = "";
  5018. }
  5019. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5020. if (coin > 0 && diamond > 0) {
  5021. this.ui.myNode.diamondNode.x = 385;
  5022. this.ui.myNode.coinNode.x = 467;
  5023. }
  5024. else {
  5025. this.ui.myNode.diamondNode.x = 385;
  5026. this.ui.myNode.coinNode.x = 385;
  5027. }
  5028. if (!getAward) {
  5029. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5030. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5031. }
  5032. else {
  5033. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5034. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5035. }
  5036. }
  5037. startGame() {
  5038. if (DataMgr.powerEnough()) {
  5039. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5040. this.ui.myNode.startBtn.touchable = false;
  5041. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5042. console.log('zh:startGame ');
  5043. this.ui.myNode.startBtn.touchable = true;
  5044. DataMgr.setPower(-1);
  5045. xGame.eventMgr.event(POWER_TIME);
  5046. xGame.common.gameMode = GameMode.placeBall;
  5047. xGame.common.placeBallCurLevel = this.level;
  5048. xGame.uiMgr.Show(UIGame);
  5049. this.logEventForChallenge_level_start(this.level);
  5050. xGame.uiMgr.Hide(UILevelDisplay);
  5051. xGame.uiMgr.Hide(UIMain);
  5052. this.hide();
  5053. }));
  5054. }
  5055. else {
  5056. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5057. xGame.uiMgr.Show(UIPower);
  5058. }
  5059. }
  5060. logEventForChallenge_level_start(level) {
  5061. let keyStr = 'sjmd_challenge_level_start';
  5062. let jsonStr = {
  5063. "count": 1,
  5064. "gold_balance ": DataMgr.getCoin(),
  5065. "level": level,
  5066. "diamond_balance ": DataMgr.getDiamond()
  5067. };
  5068. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5069. const d = LocalStorageManager.getItem(keyStr);
  5070. if (level > d.level) {
  5071. jsonStr.count = d.count + 1;
  5072. LocalStorageManager.setItem(keyStr, jsonStr);
  5073. }
  5074. else {
  5075. }
  5076. }
  5077. else {
  5078. LocalStorageManager.setItem(keyStr, jsonStr);
  5079. }
  5080. const reqStr = JSON.stringify(jsonStr);
  5081. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5082. }
  5083. hide() {
  5084. super.hide();
  5085. }
  5086. }
  5087. UILevelProp.uiName = "UILevelProp";
  5088. class PutBallLevelDisplay {
  5089. constructor(ui, index) {
  5090. this.index = 0;
  5091. this.ui = ui;
  5092. this.index = index;
  5093. this.ui.onClick(this, this.clickSelf);
  5094. this.updateSelf();
  5095. this.ui.levelTxt.text = (this.index + 1) + "";
  5096. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5097. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5098. }
  5099. updateSelf() {
  5100. let level = this.index + 1;
  5101. this.data = DataMgr.getPlaceBallLevel(level);
  5102. this.ui.starNode.c1.selectedIndex = this.data.star;
  5103. let isChallenge = cfgTable.placeballData[level].type;
  5104. if (this.data.isCur) {
  5105. if (isChallenge) {
  5106. this.ui.c1.selectedIndex = 5;
  5107. }
  5108. else {
  5109. this.ui.c1.selectedIndex = 2;
  5110. }
  5111. }
  5112. else {
  5113. if (this.data.play) {
  5114. if (this.data.star == 3) {
  5115. this.ui.c1.selectedIndex = 0;
  5116. }
  5117. else {
  5118. this.ui.c1.selectedIndex = 1;
  5119. }
  5120. }
  5121. else {
  5122. if (isChallenge) {
  5123. this.ui.c1.selectedIndex = 4;
  5124. }
  5125. else {
  5126. this.ui.c1.selectedIndex = 3;
  5127. }
  5128. }
  5129. }
  5130. }
  5131. clickSelf() {
  5132. if (!this.data.play)
  5133. return;
  5134. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5135. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5136. }
  5137. }
  5138. class UILevelDisplay extends UIBase {
  5139. constructor() {
  5140. super();
  5141. }
  5142. onConstructor() {
  5143. this.ui = ui_UILevelDisplay.createInstance();
  5144. this.contentPane = this.ui;
  5145. this.isEject = false;
  5146. this.myList = this.ui.myNode.myList;
  5147. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5148. this.levelItemArr = [];
  5149. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5150. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5151. this.myList.numItems = levelNum;
  5152. if (Moyu.isKs)
  5153. this.ui.closeNode.closeBtn.x += 100;
  5154. }
  5155. levelItemRender(index, target) {
  5156. let item = new PutBallLevelDisplay(target, index);
  5157. this.levelItemArr.push(item);
  5158. }
  5159. show() {
  5160. super.show();
  5161. this.updateLevel();
  5162. this.scrollToPlace();
  5163. }
  5164. updateLevel() {
  5165. let temp;
  5166. for (let index = 0; index < this.levelItemArr.length; index++) {
  5167. temp = this.levelItemArr[index];
  5168. temp.updateSelf();
  5169. }
  5170. }
  5171. scrollToPlace() {
  5172. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5173. let passArr = DataMgr.getPlaceBallLevelList();
  5174. let offest = passArr.length;
  5175. if (offest >= maxNum - 1)
  5176. offest = maxNum - 1;
  5177. this.myList.scrollToView(offest, true, true);
  5178. }
  5179. hide() {
  5180. super.hide();
  5181. }
  5182. }
  5183. UILevelDisplay.uiName = "UILevelDisplay";
  5184. class ui_UIMatching extends fgui.GComponent {
  5185. static createInstance() {
  5186. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5187. }
  5188. onConstruct() {
  5189. this.n5 = (this.getChild("n5"));
  5190. this.n49 = (this.getChild("n49"));
  5191. this.n51 = (this.getChild("n51"));
  5192. this.n64 = (this.getChild("n64"));
  5193. this.n2 = (this.getChild("n2"));
  5194. this.n53 = (this.getChild("n53"));
  5195. this.n54 = (this.getChild("n54"));
  5196. this.n56 = (this.getChild("n56"));
  5197. this.n58 = (this.getChild("n58"));
  5198. this.n59 = (this.getChild("n59"));
  5199. this.n57 = (this.getChild("n57"));
  5200. this.n60 = (this.getChild("n60"));
  5201. this.n62 = (this.getChild("n62"));
  5202. this.awardTxt = (this.getChild("awardTxt"));
  5203. this.n61 = (this.getChild("n61"));
  5204. this.selfHead = (this.getChild("selfHead"));
  5205. this.aiHead = (this.getChild("aiHead"));
  5206. this.n82 = (this.getChild("n82"));
  5207. this.n84 = (this.getChild("n84"));
  5208. this.n83 = (this.getChild("n83"));
  5209. this.t1 = this.getTransition("t1");
  5210. this.t2 = this.getTransition("t2");
  5211. this.t3 = this.getTransition("t3");
  5212. this.t4 = this.getTransition("t4");
  5213. }
  5214. }
  5215. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5216. class UIMatching extends UIBase {
  5217. constructor() {
  5218. super();
  5219. }
  5220. onConstructor() {
  5221. this.ui = ui_UIMatching.createInstance();
  5222. this.contentPane = this.ui;
  5223. this.isEject = false;
  5224. }
  5225. show(callback) {
  5226. super.show();
  5227. PlatMgr.showBanner(true);
  5228. this.callback = callback;
  5229. let user = Moyu.getUserInfo();
  5230. if (!this.selfPot) {
  5231. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5232. }
  5233. if (!this.aiPot) {
  5234. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5235. }
  5236. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5237. this.ui.selfHead.nameTxt.text = user.nickName;
  5238. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5239. this.ui.aiHead.nameTxt.text = "???";
  5240. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5241. this.ui.selfHead.c1.selectedIndex = 0;
  5242. this.ui.aiHead.c1.selectedIndex = 0;
  5243. this.ui.selfHead.x = this.selfPot.x;
  5244. this.ui.selfHead.y = this.selfPot.y;
  5245. this.ui.aiHead.x = this.aiPot.x;
  5246. this.ui.aiHead.y = this.aiPot.y;
  5247. switch (xGame.common.gameMode) {
  5248. case GameMode.classic:
  5249. break;
  5250. case GameMode.bigMove:
  5251. this.initSkillData();
  5252. break;
  5253. default:
  5254. break;
  5255. }
  5256. this.ui.t1.play(Laya.Handler.create(this, () => {
  5257. this.ui.t2.play(Laya.Handler.create(this, () => {
  5258. switch (xGame.common.gameMode) {
  5259. case GameMode.classic:
  5260. this.waitingPeople();
  5261. break;
  5262. case GameMode.bigMove:
  5263. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5264. break;
  5265. default:
  5266. break;
  5267. }
  5268. }));
  5269. }));
  5270. }
  5271. initSkillData() {
  5272. this.skillSelectData = [];
  5273. let skillUrl = xGame.common.skillIconList;
  5274. let skillName = xGame.common.skillNameList;
  5275. let skillLevel = DataMgr.getBigSkillList();
  5276. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5277. for (let index = 0; index < 5; index++) {
  5278. let obj = {};
  5279. obj.skillImg = skillUrl[index];
  5280. obj.skillName = skillName[index];
  5281. obj.skillType = skillType[index];
  5282. obj.skillLevel = skillLevel[index];
  5283. this.skillSelectData.push(obj);
  5284. }
  5285. }
  5286. getAISkillLevel(myLevel) {
  5287. let video = xGame.common.upSkillLevel;
  5288. let aiLevel;
  5289. let temp;
  5290. if (video) {
  5291. temp = xGame.common.randomNum(-2, -1);
  5292. }
  5293. else {
  5294. if (myLevel <= 5) {
  5295. temp = xGame.common.randomNum(1, 3);
  5296. }
  5297. else if (myLevel <= 9) {
  5298. temp = xGame.common.randomNum(-2, 1);
  5299. }
  5300. else {
  5301. temp = xGame.common.randomNum(-4, 0);
  5302. }
  5303. }
  5304. aiLevel = temp + myLevel;
  5305. if (aiLevel <= 1)
  5306. aiLevel = 1;
  5307. if (aiLevel >= 10)
  5308. aiLevel = 10;
  5309. return aiLevel;
  5310. }
  5311. getAISkillType() {
  5312. return xGame.common.randomNum(1, 4);
  5313. let successTimes = DataMgr.getSkillSuccessTimes();
  5314. let info = cfgTable.aiskillData[successTimes];
  5315. if (!info) {
  5316. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5317. info = cfgTable.aiskillData[max];
  5318. }
  5319. let dataArr = info.skillselect;
  5320. let myCfg = {};
  5321. for (let index = 0; index < dataArr.length; index++) {
  5322. let temp = dataArr[index].split('-');
  5323. myCfg[temp[0]] = {};
  5324. myCfg[temp[0]].id = parseInt(temp[0]);
  5325. myCfg[temp[0]].weight = parseInt(temp[1]);
  5326. }
  5327. let aiCfg = xGame.common.initWeight(myCfg);
  5328. let curData = xGame.common.getRandomWeightData(aiCfg);
  5329. return parseInt(curData.id);
  5330. }
  5331. getAISkillData(index) {
  5332. let myLevel = this.skillSelectData[index].skillLevel;
  5333. let aiLevel = this.getAISkillLevel(myLevel);
  5334. let aiType = this.getAISkillType() - 1;
  5335. return { aiLevel, aiType } = { aiLevel, aiType };
  5336. }
  5337. skillSelectFinish(index) {
  5338. let aiInfo = this.getAISkillData(index);
  5339. xGame.common.gameMgr.selfCurSkill = index;
  5340. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5341. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5342. this.ui.selfHead.c1.selectedIndex = 1;
  5343. this.ui.aiHead.c1.selectedIndex = 1;
  5344. let myData = this.skillSelectData[index];
  5345. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5346. let guide = DataMgr.getSkillGuide();
  5347. if (guide == 0) {
  5348. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5349. }
  5350. else {
  5351. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5352. }
  5353. let aiData = this.skillSelectData[aiInfo.aiType];
  5354. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5355. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5356. this.waitingPeople();
  5357. }
  5358. waitingPeople() {
  5359. let time = xGame.common.randomNum(1000, 3000);
  5360. time += 1000;
  5361. Laya.timer.once(time, this, () => {
  5362. this.matchingSuccess();
  5363. });
  5364. }
  5365. matchingSuccess() {
  5366. let gameUI = xGame.common.gameUI;
  5367. let name = gameUI.ui.topNode.aiNameTxt.text;
  5368. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5369. this.ui.aiHead.nameTxt.text = name;
  5370. this.ui.aiHead.headImg.url = url;
  5371. name = gameUI.ui.topNode.selfNameTxt.text;
  5372. url = gameUI.ui.topNode.selfHeadLoader.url;
  5373. this.ui.selfHead.nameTxt.text = name;
  5374. this.ui.selfHead.headImg.url = url;
  5375. this.ui.t3.play(Laya.Handler.create(this, () => {
  5376. this.callback && this.callback();
  5377. this.ui.t4.play(Laya.Handler.create(this, () => {
  5378. this.destroySelf();
  5379. }));
  5380. }));
  5381. }
  5382. destroySelf() {
  5383. this.callback = null;
  5384. this.skillSelectData = null;
  5385. this.selfPot = null;
  5386. this.aiPot = null;
  5387. if (!this.ui.isDisposed) {
  5388. this.ui.removeFromParent();
  5389. this.ui.dispose();
  5390. }
  5391. xGame.uiMgr.destroyUI(this);
  5392. }
  5393. }
  5394. UIMatching.uiName = "UIMatching";
  5395. class ui_UIRanking extends fgui.GComponent {
  5396. static createInstance() {
  5397. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5398. }
  5399. onConstruct() {
  5400. this.n26 = (this.getChild("n26"));
  5401. this.myNode = (this.getChild("myNode"));
  5402. }
  5403. }
  5404. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5405. class UIRanking extends UIBase {
  5406. constructor() {
  5407. super();
  5408. this.showSelf = true;
  5409. this.rankType = 1;
  5410. this.rankList = [];
  5411. this.topX = 10;
  5412. this.myIndex = this.topX + 1;
  5413. this.myStar = 0;
  5414. }
  5415. onConstructor() {
  5416. this.ui = ui_UIRanking.createInstance();
  5417. this.contentPane = this.ui;
  5418. this.isEject = false;
  5419. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5420. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5421. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5422. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5423. this.ui.myNode.myList.setVirtual();
  5424. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5425. }
  5426. show() {
  5427. super.show();
  5428. this.getPaiHangBangDataFormJosnFile();
  5429. this.updateSelf();
  5430. let self = Moyu.getUserInfo();
  5431. if (!self.isAuth) {
  5432. Moyu.initUser(this, () => {
  5433. DataMgr.upRankData();
  5434. });
  5435. }
  5436. }
  5437. getPaiHangBangDataFormJosnFile() {
  5438. const rankingList = cfgTable.paiHangBangData.list;
  5439. this.updateItemData(rankingList);
  5440. }
  5441. updateSelfItem() {
  5442. console.log('zh:Moyu.platType =' + Moyu.platType);
  5443. let self = Moyu.getUserInfo();
  5444. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5445. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5446. if (this.myIndex > this.topX) {
  5447. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5448. }
  5449. else {
  5450. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5451. }
  5452. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5453. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5454. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5455. }
  5456. updateItemData(data) {
  5457. this.myStar = xGame.common.getAllStarNum();
  5458. if (this.rankList.length < 2) {
  5459. this.rankList = data;
  5460. let self = Moyu.getUserInfo();
  5461. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5462. self.headIcon = self.headIcon;
  5463. for (let i = 0; i < data.length; i++) {
  5464. let data = this.rankList[i];
  5465. if (data.userId == self.userId) {
  5466. this.rankList.splice(i, 1);
  5467. break;
  5468. }
  5469. }
  5470. for (let i = 0; i < data.length; i++) {
  5471. let data = this.rankList[i];
  5472. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5473. this.myIndex = i + 1;
  5474. let user = { headIcon: self.headIcon, nickName: "myself" };
  5475. let ud = { user: user, data: {} };
  5476. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5477. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5478. if (Moyu.platType < 11) {
  5479. user.headIcon = self.headIcon;
  5480. user.nickName = self.nickName;
  5481. }
  5482. this.rankList.splice(i, 0, md);
  5483. break;
  5484. }
  5485. }
  5486. }
  5487. this.updateSelfItem();
  5488. this.ui.myNode.myList.numItems = this.rankList.length;
  5489. }
  5490. updateItemUI(index, obj) {
  5491. let data = this.rankList[index];
  5492. let userData = JSON.parse(data.userData).user;
  5493. obj.nameTxt.text = userData.nickName.toString();
  5494. obj.valueTxt.text = data.rankScore;
  5495. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5496. obj.rankTxt.text = index + 1;
  5497. switch (index) {
  5498. case 0:
  5499. this.setImg(obj, 1, 0, 0);
  5500. obj.rankTxt.color = "#FFC047";
  5501. break;
  5502. case 1:
  5503. this.setImg(obj, 0, 1, 0);
  5504. obj.rankTxt.color = "#ACACAC";
  5505. break;
  5506. case 2:
  5507. this.setImg(obj, 0, 0, 1);
  5508. obj.rankTxt.color = "#D09672";
  5509. break;
  5510. default:
  5511. this.setImg(obj, 0, 0, 0);
  5512. obj.rankTxt.color = "#496FAB";
  5513. break;
  5514. }
  5515. }
  5516. setImg(obj, a, b, c) {
  5517. obj.img1.visible = a ? true : false;
  5518. obj.img2.visible = b ? true : false;
  5519. obj.img3.visible = c ? true : false;
  5520. }
  5521. changeList(type) {
  5522. this.rankType = type;
  5523. this.updateSelf();
  5524. }
  5525. changeSelfNode() {
  5526. this.showSelf = !this.showSelf;
  5527. this.updateSelf();
  5528. }
  5529. updateSelf() {
  5530. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5531. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5532. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5533. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5534. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5535. }
  5536. }
  5537. UIRanking.uiName = "UIRanking";
  5538. class ui_UISecretary extends fgui.GComponent {
  5539. static createInstance() {
  5540. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5541. }
  5542. onConstruct() {
  5543. this.n0 = (this.getChild("n0"));
  5544. this.myNode = (this.getChild("myNode"));
  5545. this.closeBtn = (this.getChild("closeBtn"));
  5546. this.t0 = this.getTransition("t0");
  5547. }
  5548. }
  5549. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5550. class UISecretary extends UIBase {
  5551. constructor() {
  5552. super();
  5553. this.curIndex = 1;
  5554. }
  5555. onConstructor() {
  5556. this.ui = ui_UISecretary.createInstance();
  5557. this.contentPane = this.ui;
  5558. this.isEject = false;
  5559. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5560. this.nodeObj = { left: null, right: null, cur: null };
  5561. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5562. }
  5563. show() {
  5564. super.show();
  5565. this.ui.t0.play();
  5566. this.updateData();
  5567. }
  5568. addSecretarySpine(node, spineName) {
  5569. if (spineName == "mishu") {
  5570. if (this.secretarySpine1) {
  5571. node.displayObject.destroyChildren();
  5572. this.playWoman(this.secretarySpine1, node.displayObject);
  5573. }
  5574. else {
  5575. let spine1 = new SpineMgr("mishu", () => {
  5576. this.secretarySpine1 = spine1;
  5577. this.playWoman(this.secretarySpine1, node.displayObject);
  5578. });
  5579. }
  5580. }
  5581. else {
  5582. if (this.secretarySpine2) {
  5583. node.displayObject.destroyChildren();
  5584. this.playWoman(this.secretarySpine2, node.displayObject);
  5585. }
  5586. else {
  5587. let spine2 = new SpineMgr("xiaomishu2", () => {
  5588. this.secretarySpine2 = spine2;
  5589. this.playWoman(this.secretarySpine2, node.displayObject);
  5590. });
  5591. }
  5592. }
  5593. }
  5594. playWoman(node, parent) {
  5595. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5596. let yy = this.ui.myNode.gameNode3.secretary.height;
  5597. let scale = 1.5;
  5598. if (node == this.secretarySpine2) {
  5599. scale = 1.2;
  5600. }
  5601. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5602. node.play(data, 0, true, parent);
  5603. }
  5604. turnLeft() {
  5605. this.curIndex--;
  5606. if (this.curIndex < 1) {
  5607. this.curIndex = 2;
  5608. }
  5609. let left = this.nodeObj.left;
  5610. let right = this.nodeObj.right;
  5611. let cur = this.nodeObj.cur;
  5612. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5613. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5614. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5615. this.updateData();
  5616. }));
  5617. this.ui.myNode.setChildIndex(right, 2);
  5618. this.nodeObj.left = cur;
  5619. this.nodeObj.right = left;
  5620. this.nodeObj.cur = right;
  5621. }
  5622. turnRight() {
  5623. this.curIndex++;
  5624. if (this.curIndex > 2) {
  5625. this.curIndex = 1;
  5626. }
  5627. let left = this.nodeObj.left;
  5628. let right = this.nodeObj.right;
  5629. let cur = this.nodeObj.cur;
  5630. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5631. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5632. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5633. this.updateData();
  5634. }));
  5635. this.ui.myNode.setChildIndex(left, 2);
  5636. this.nodeObj.left = right;
  5637. this.nodeObj.right = cur;
  5638. this.nodeObj.cur = left;
  5639. }
  5640. updateData() {
  5641. console.log('zh: updateData FFFFFFFFFF');
  5642. let data = cfgTable.secretaryshopData;
  5643. let children = this.ui.myNode._children;
  5644. let temp;
  5645. let curData;
  5646. for (let index = 0; index < children.length; index++) {
  5647. temp = children[index];
  5648. curData = data[1];
  5649. temp.heightTxt.text = curData.height;
  5650. temp.foodTxt.text = curData.food;
  5651. temp.historyTxt.text = curData.history;
  5652. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5653. this.addSecretarySpine(temp.secretary, curData.spine);
  5654. let womanIndex = curData.id - 1;
  5655. let getWoman = DataMgr.getSecretary(womanIndex);
  5656. let curUse = DataMgr.getCurSecretary();
  5657. if (getWoman) {
  5658. if (curUse == womanIndex) {
  5659. temp.purchaseBtn.c1.selectedIndex = 1;
  5660. }
  5661. else {
  5662. temp.purchaseBtn.c1.selectedIndex = 2;
  5663. }
  5664. }
  5665. else {
  5666. temp.purchaseBtn.c1.selectedIndex = 0;
  5667. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5668. }
  5669. temp.purchaseBtn.visible = false;
  5670. }
  5671. }
  5672. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5673. console.log('zh: 点击了clickSecretary ');
  5674. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5675. if (getWoman) {
  5676. if (curUse != womanIndex) {
  5677. console.log();
  5678. DataMgr.setCurSecretary(womanIndex);
  5679. this.updateData();
  5680. }
  5681. }
  5682. else {
  5683. console.log('zh:点击购买了');
  5684. let need = needDiamond;
  5685. if (DataMgr.diamondEnough(need)) {
  5686. DataMgr.setDiamond(-need);
  5687. DataMgr.setSecretary(womanIndex, 1);
  5688. DataMgr.setCurSecretary(womanIndex);
  5689. this.updateData();
  5690. }
  5691. else {
  5692. xGame.uiMgr.Show(UIAddProp, 1);
  5693. }
  5694. }
  5695. }
  5696. closeSelf() {
  5697. this.hide();
  5698. }
  5699. }
  5700. UISecretary.uiName = "UISecretary";
  5701. class ui_UIShop extends fgui.GComponent {
  5702. static createInstance() {
  5703. return (fgui.UIPackage.createObject("game", "UIShop"));
  5704. }
  5705. onConstruct() {
  5706. this.n48 = (this.getChild("n48"));
  5707. this.n0 = (this.getChild("n0"));
  5708. this.secretary = (this.getChild("secretary"));
  5709. this.talkNode = (this.getChild("talkNode"));
  5710. this.closeNode = (this.getChild("closeNode"));
  5711. this.moneyNode = (this.getChild("moneyNode"));
  5712. this.myNode = (this.getChild("myNode"));
  5713. }
  5714. }
  5715. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5716. class ui_UIMsg extends fgui.GComponent {
  5717. static createInstance() {
  5718. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5719. }
  5720. onConstruct() {
  5721. this.tipsNode = (this.getChild("tipsNode"));
  5722. }
  5723. }
  5724. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5725. class UIMsg extends UIBase {
  5726. constructor() {
  5727. super();
  5728. }
  5729. onConstructor() {
  5730. this.ui = ui_UIMsg.createInstance();
  5731. this.contentPane = this.ui;
  5732. this.isEject = false;
  5733. this.isMuti = true;
  5734. }
  5735. show(msg, callback) {
  5736. super.show();
  5737. this.ui.tipsNode.msgTxt.text = msg;
  5738. this.ui.alpha = 1;
  5739. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5740. this.hide();
  5741. callback && callback();
  5742. }), 1000);
  5743. }
  5744. }
  5745. UIMsg.uiName = "UIMsg";
  5746. class BallRodDisplay {
  5747. constructor(ui, index) {
  5748. this.index = 0;
  5749. this.uiIndex = 0;
  5750. this.ui = ui;
  5751. this.index = index;
  5752. this.initData();
  5753. }
  5754. initData() {
  5755. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5756. let data = cfgTable.ballrodData[this.index + 1];
  5757. this.ui.nameTxt.text = data.name;
  5758. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5759. this.ui.levelNode.c1.selectedIndex = data.quality;
  5760. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5761. if (data.spine) {
  5762. this.mySpine = new SpineMgr(data.spine, () => {
  5763. let xx = 150;
  5764. let yy = 70;
  5765. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5766. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5767. });
  5768. }
  5769. }
  5770. updateSelf() {
  5771. console.log('zh:updateSelf -------------- ');
  5772. let get = DataMgr.getBallRod(this.index);
  5773. if (get == null)
  5774. get = 1;
  5775. let curUse = DataMgr.getCurBallRod();
  5776. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5777. if (get) {
  5778. if (curUse == this.index) {
  5779. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5780. }
  5781. else {
  5782. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5783. }
  5784. }
  5785. else {
  5786. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5787. }
  5788. }
  5789. buyBallRod() {
  5790. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5791. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5792. switch (selectedIndex) {
  5793. case 0:
  5794. break;
  5795. case 1:
  5796. console.log('zh:点击了 USE THIS');
  5797. DataMgr.setCurBallRod(this.index);
  5798. let curUse = DataMgr.getCurBallRod();
  5799. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5800. let ui = xGame.uiMgr.getUI(UIShop);
  5801. ui.updateBallRod();
  5802. break;
  5803. case 2:
  5804. let data = cfgTable.ballrodData[this.index + 1];
  5805. let need = data.price;
  5806. if (DataMgr.diamondEnough(need)) {
  5807. this.buyQiuGan(data);
  5808. DataMgr.setDiamond(-need);
  5809. DataMgr.setBallRod(this.index, 1);
  5810. DataMgr.setCurBallRod(this.index);
  5811. let ui = xGame.uiMgr.getUI(UIShop);
  5812. ui.updateBallRod();
  5813. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5814. }
  5815. else {
  5816. xGame.uiMgr.Show(UIAddProp, 1);
  5817. }
  5818. break;
  5819. default:
  5820. break;
  5821. }
  5822. }
  5823. buyQiuGan(qgItem) {
  5824. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5825. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5826. if (userInfo == null) {
  5827. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5828. return;
  5829. }
  5830. let reqData = xGame.httpMgr.getReqData();
  5831. let pd = JSON.parse(reqData);
  5832. pd.qiuGanData = qgItem;
  5833. reqData = JSON.stringify(pd);
  5834. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5835. try {
  5836. console.log('zh:buySp res = ' + JSON.stringify(res));
  5837. let code = res.code;
  5838. let msg = res.msg;
  5839. if (code == 401) {
  5840. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5841. alert(TIP_MSG_key.loginTimeOut);
  5842. xGame.uiMgr.Show(UIMsg, msg);
  5843. return;
  5844. }
  5845. if (code == 200) {
  5846. xGame.uiMgr.Show(UIMsg, msg);
  5847. DataMgr.getUserZiChanInfo();
  5848. }
  5849. else {
  5850. xGame.uiMgr.Show(UIMsg, msg);
  5851. }
  5852. }
  5853. catch (error) {
  5854. console.log('error=' + error);
  5855. alert(error);
  5856. }
  5857. finally {
  5858. }
  5859. });
  5860. }
  5861. logEventForGouMaiGan(qiuGanName) {
  5862. const ev = {
  5863. value: qiuGanName
  5864. };
  5865. const jsonStr = JSON.stringify(ev);
  5866. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5867. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5868. }
  5869. }
  5870. class DaoJuDisplay {
  5871. constructor(ui, index) {
  5872. this.index = 0;
  5873. this.uiIndex = 0;
  5874. this.ui = ui;
  5875. this.index = index;
  5876. this.initData();
  5877. }
  5878. initData() {
  5879. this.ui.btn_buy.onClick(this, this.buySp);
  5880. this.ui.btn_buy.onClick(this, this.buyDj);
  5881. let data = cfgTable.daoJuData[this.index + 1];
  5882. console.log('zh:' + JSON.stringify(data));
  5883. this.ui.nameTxt.text = data.spbt;
  5884. this.ui.n_jiaGe.text = data.spjg + "";
  5885. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5886. let baseUrl = "asset/sound/ogg/";
  5887. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5888. }
  5889. buyDj() {
  5890. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5891. }
  5892. buySp() {
  5893. let djItem = cfgTable.daoJuData[this.index + 1];
  5894. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5895. let userInfo = LocalStorageManager.getItem('userInfo');
  5896. if (userInfo == null) {
  5897. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5898. return;
  5899. }
  5900. let reqData = xGame.httpMgr.getReqData();
  5901. let pd = JSON.parse(reqData);
  5902. pd.spItem = djItem;
  5903. reqData = JSON.stringify(pd);
  5904. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  5905. try {
  5906. console.log('zh:buySp res = ' + JSON.stringify(res));
  5907. let code = res.code;
  5908. let msg = res.msg;
  5909. if (code == 401) {
  5910. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5911. alert(TIP_MSG_key.pleaseLoginIn);
  5912. return;
  5913. }
  5914. if (code == 200) {
  5915. xGame.uiMgr.Show(UIMsg, msg);
  5916. DataMgr.getUserZiChanInfo();
  5917. }
  5918. else {
  5919. xGame.uiMgr.Show(UIMsg, msg);
  5920. }
  5921. }
  5922. catch (error) {
  5923. console.log('error=' + error);
  5924. alert(error);
  5925. }
  5926. finally {
  5927. }
  5928. });
  5929. }
  5930. }
  5931. class UIShop extends UIBase {
  5932. constructor() {
  5933. super();
  5934. this.itemNums = 0;
  5935. this.itemNumsForDj = 0;
  5936. this.curType = "";
  5937. }
  5938. onConstructor() {
  5939. this.ui = ui_UIShop.createInstance();
  5940. this.contentPane = this.ui;
  5941. this.isEject = false;
  5942. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5943. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  5944. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  5945. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  5946. this.addUIClick(this.ui, this.interuptSecretary);
  5947. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  5948. this.ballRodArr = [];
  5949. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  5950. this.ui.myNode.myList.numItems = this.itemNums;
  5951. this.loadDjdata_old();
  5952. }
  5953. loadDjdata_old() {
  5954. let fff = cfgTable.daoJuData;
  5955. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  5956. this.daoJuArr = [];
  5957. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  5958. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  5959. }
  5960. getProductList() {
  5961. let reqData = xGame.httpMgr.getReqData();
  5962. let pd = JSON.parse(reqData);
  5963. pd.splx = "Consumable";
  5964. reqData = JSON.stringify(pd);
  5965. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  5966. try {
  5967. let code = res.code;
  5968. let msg = res.msg;
  5969. if (code == 401) {
  5970. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5971. alert(TIP_MSG_key.pleaseLoginIn);
  5972. return;
  5973. }
  5974. if (code == 200) {
  5975. let data = res.data;
  5976. for (let index = 0; index < data.length; index++) {
  5977. let element = data[index];
  5978. cfgTable.daoJuData[element.spid] = element;
  5979. }
  5980. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  5981. }
  5982. else {
  5983. xGame.uiMgr.Show(UIMsg, msg);
  5984. }
  5985. }
  5986. catch (error) {
  5987. console.log('error=' + error);
  5988. alert(error);
  5989. }
  5990. finally {
  5991. }
  5992. });
  5993. }
  5994. show(type) {
  5995. super.show();
  5996. this.curType = type == 0 ? "qiugan" : "daoju";
  5997. this.switchBtn("qiugan");
  5998. this.playSecretaryIdle();
  5999. this.updateBallRod();
  6000. }
  6001. test123() {
  6002. console.log('zh:test123 ');
  6003. }
  6004. switchBtn(type) {
  6005. console.log('zh:1111切換 sel type=' + type);
  6006. if (type == "") {
  6007. type = this.curType;
  6008. }
  6009. else {
  6010. if (this.curType == type) {
  6011. return;
  6012. }
  6013. else {
  6014. this.curType = type;
  6015. }
  6016. }
  6017. if (type == "qiugan") {
  6018. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6019. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6020. this.ui.myNode.c1.selectedIndex = 0;
  6021. this.ui.myNode.myList.visible = true;
  6022. this.ui.myNode.djList.visible = false;
  6023. }
  6024. else {
  6025. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6026. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6027. this.ui.myNode.c1.selectedIndex = 1;
  6028. this.ui.myNode.myList.visible = false;
  6029. this.ui.myNode.djList.visible = true;
  6030. }
  6031. }
  6032. updateBallRod() {
  6033. for (let index = 0; index < this.ballRodArr.length; index++) {
  6034. this.ballRodArr[index].updateSelf();
  6035. }
  6036. }
  6037. renderBallRod(sort, obj) {
  6038. let index = this.getIndexBySort(sort + 1) - 1;
  6039. let ballRod = new BallRodDisplay(obj, index);
  6040. this.ballRodArr.push(ballRod);
  6041. }
  6042. renderDaoJu(idx, obj) {
  6043. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6044. let b = new DaoJuDisplay(obj, index);
  6045. this.daoJuArr.push(b);
  6046. }
  6047. getIndexBySort(sort) {
  6048. let object = cfgTable.ballrodData;
  6049. for (const key in object) {
  6050. if (object[key].sort == sort) {
  6051. return parseInt(key);
  6052. }
  6053. }
  6054. }
  6055. getIndexBySortForDj(idx) {
  6056. let object = cfgTable.daoJuData;
  6057. for (const key in object) {
  6058. if (object[key].idx == idx) {
  6059. return parseInt(key);
  6060. }
  6061. }
  6062. }
  6063. playSecretaryIdle() {
  6064. let parent = this.ui.secretary.displayObject;
  6065. parent.destroyChildren();
  6066. let xx = this.ui.secretary.width / 2;
  6067. let yy = this.ui.secretary.height;
  6068. let scale = xGame.common.getSecretaryScale();
  6069. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6070. xGame.common.secretary.play(data, 0, true, parent);
  6071. }
  6072. interuptSecretary() {
  6073. Laya.timer.clearAll(this);
  6074. this.playSecretaryRandomSound();
  6075. }
  6076. playSecretaryRandomSound() {
  6077. if (this.isHide)
  6078. return;
  6079. let time = xGame.common.randomNum(45000, 60000);
  6080. Laya.timer.once(time, this, () => {
  6081. if (this.isHide)
  6082. return;
  6083. let index = xGame.common.randomNum(4, 7);
  6084. xGame.soundMgr.playSound("s_main0" + index);
  6085. let words = 1;
  6086. switch (index) {
  6087. case 4:
  6088. words = 5;
  6089. break;
  6090. case 5:
  6091. words = 3;
  6092. break;
  6093. case 6:
  6094. words = 6;
  6095. break;
  6096. case 7:
  6097. words = 7;
  6098. break;
  6099. default:
  6100. break;
  6101. }
  6102. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6103. this.playSecretaryRandomSound();
  6104. });
  6105. }
  6106. closeSelf() {
  6107. this.hide();
  6108. }
  6109. }
  6110. UIShop.uiName = "UIShop";
  6111. class ui_UISign extends fgui.GComponent {
  6112. static createInstance() {
  6113. return (fgui.UIPackage.createObject("game", "UISign"));
  6114. }
  6115. onConstruct() {
  6116. this.n6 = (this.getChild("n6"));
  6117. this.closeNode = (this.getChild("closeNode"));
  6118. this.myNode = (this.getChild("myNode"));
  6119. this.moneyNode = (this.getChild("moneyNode"));
  6120. this.secretary = (this.getChild("secretary"));
  6121. this.talkNode = (this.getChild("talkNode"));
  6122. this.tripleBtn = (this.getChild("tripleBtn"));
  6123. this.normalBtn = (this.getChild("normalBtn"));
  6124. this.tipsNode = (this.getChild("tipsNode"));
  6125. this.againBtn = (this.getChild("againBtn"));
  6126. this.t0 = this.getTransition("t0");
  6127. }
  6128. }
  6129. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6130. class SignMax {
  6131. constructor(ui) {
  6132. this.ui = ui;
  6133. }
  6134. updateSelf(index, sameDay, curDayIndex) {
  6135. let data = cfgTable.signData[index + 1];
  6136. this.ui.titleTxt.text = data.title;
  6137. let arr1 = data.award[0].split('-');
  6138. let arr2 = data.award[1].split('-');
  6139. let num1 = parseInt(arr1[1]);
  6140. let num2 = parseInt(arr2[1]);
  6141. this.ui.numTxt1.text = num1 + "";
  6142. this.ui.numTxt2.text = num2 + "";
  6143. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6144. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6145. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6146. this.ui.numTxt1.visible = false;
  6147. }
  6148. else {
  6149. this.ui.numTxt1.visible = true;
  6150. }
  6151. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6152. this.ui.numTxt2.visible = false;
  6153. }
  6154. else {
  6155. this.ui.numTxt2.visible = true;
  6156. }
  6157. if (index < curDayIndex) {
  6158. this.ui.c1.selectedIndex = 1;
  6159. }
  6160. else if (index == curDayIndex) {
  6161. if (sameDay) {
  6162. this.ui.c1.selectedIndex = 2;
  6163. }
  6164. else {
  6165. this.ui.c1.selectedIndex = 2;
  6166. }
  6167. }
  6168. else {
  6169. this.ui.c1.selectedIndex = 0;
  6170. }
  6171. }
  6172. }
  6173. class SignNormal {
  6174. constructor(ui) {
  6175. this.ui = ui;
  6176. }
  6177. updateSelf(index, sameDay, curDayIndex) {
  6178. let data = cfgTable.signData[index + 1];
  6179. this.ui.titleTxt.text = data.title;
  6180. let arr = data.award[0].split('-');
  6181. let type = parseInt(arr[0]);
  6182. let num = parseInt(arr[1]);
  6183. this.ui.numTxt.text = num + "";
  6184. if (type > 2) {
  6185. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6186. this.ui.myIcon.rotation = 0;
  6187. }
  6188. else {
  6189. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6190. this.ui.myIcon.rotation = 0;
  6191. }
  6192. if (xGame.common.signAwardContainsRod(data.award)) {
  6193. this.ui.numTxt.visible = false;
  6194. }
  6195. else {
  6196. this.ui.numTxt.visible = true;
  6197. }
  6198. if (index < curDayIndex) {
  6199. this.ui.c1.selectedIndex = 1;
  6200. }
  6201. else if (index == curDayIndex) {
  6202. if (sameDay) {
  6203. this.ui.c1.selectedIndex = 2;
  6204. }
  6205. else {
  6206. this.ui.c1.selectedIndex = 2;
  6207. }
  6208. }
  6209. else {
  6210. this.ui.c1.selectedIndex = 0;
  6211. }
  6212. }
  6213. }
  6214. class UISign extends UIBase {
  6215. constructor() {
  6216. super();
  6217. this.curDayIndex = 0;
  6218. this.starX = 0;
  6219. }
  6220. onConstructor() {
  6221. this.ui = ui_UISign.createInstance();
  6222. this.contentPane = this.ui;
  6223. this.isEject = false;
  6224. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6225. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6226. this.initSignItem();
  6227. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6228. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6229. }
  6230. show() {
  6231. super.show();
  6232. this.ui.t0.play();
  6233. this.playSecretaryIdle();
  6234. this.updateSign();
  6235. }
  6236. initSignItem() {
  6237. this.signArr = [];
  6238. for (let index = 0; index < 6; index++) {
  6239. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6240. this.signArr.push(temp);
  6241. }
  6242. this.signMax = new SignMax(this.ui.myNode.day7);
  6243. if (Moyu.isKs)
  6244. this.ui.closeNode.closeBtn.x += 100;
  6245. }
  6246. updateSign() {
  6247. let sameDay = xGame.common.judgeSameDay();
  6248. let max = 7;
  6249. this.curDayIndex = DataMgr.getSignData();
  6250. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6251. this.curDayIndex = 0;
  6252. if (!sameDay) {
  6253. this.ui.normalBtn.visible = true;
  6254. this.ui.tipsNode.visible = false;
  6255. this.ui.againBtn.visible = false;
  6256. }
  6257. else {
  6258. this.ui.normalBtn.visible = false;
  6259. let again = DataMgr.getExtraSign();
  6260. let isCurrency = false;
  6261. let index = this.curDayIndex;
  6262. if (index == 0)
  6263. index = 7;
  6264. let award = cfgTable.signData[index].award;
  6265. let num = award[0].split("-")[0];
  6266. if (num == "1" || num == "2")
  6267. isCurrency = true;
  6268. let showAgain = again == 0 && isCurrency;
  6269. this.ui.againBtn.visible = showAgain;
  6270. this.ui.tipsNode.visible = !showAgain;
  6271. }
  6272. for (let index = 0; index < this.signArr.length; index++) {
  6273. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6274. }
  6275. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6276. }
  6277. playSecretaryIdle() {
  6278. let parent = this.ui.secretary.displayObject;
  6279. parent.destroyChildren();
  6280. let xx = this.ui.secretary.width / 2;
  6281. let yy = this.ui.secretary.height;
  6282. let scale = xGame.common.getSecretaryScale();
  6283. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6284. xGame.common.secretary.play(data, 0, true, parent);
  6285. }
  6286. closeSelf() {
  6287. this.hide();
  6288. }
  6289. normalGetAward() {
  6290. let sameDay = xGame.common.judgeSameDay();
  6291. if (!sameDay) {
  6292. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6293. let temp;
  6294. let type;
  6295. let num;
  6296. let arr = [];
  6297. for (let index = 0; index < award.length; index++) {
  6298. temp = award[index].split("-");
  6299. type = parseInt(temp[0]);
  6300. num = parseInt(temp[1]);
  6301. let awardType = new AwardType();
  6302. awardType.num = num;
  6303. awardType.type = type;
  6304. arr.push(awardType);
  6305. }
  6306. xGame.common.getAward(arr, (watchVideo) => {
  6307. this.curDayIndex++;
  6308. if (this.curDayIndex > 7)
  6309. this.curDayIndex = 0;
  6310. DataMgr.setSignData(this.curDayIndex);
  6311. DataMgr.setSignTime(new Date().getTime());
  6312. if (watchVideo) {
  6313. DataMgr.setExtraSign(1);
  6314. Moyu.sendDataEvent("signIn1");
  6315. }
  6316. this.updateSign();
  6317. });
  6318. }
  6319. }
  6320. againGetAward() {
  6321. Moyu.sendDataEvent("signIn2");
  6322. console.log('zh:qjff_AD_for_uisign');
  6323. if (Laya.Browser.onAndroid) {
  6324. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6325. if (!boo) {
  6326. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6327. return;
  6328. }
  6329. }
  6330. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6331. }
  6332. else {
  6333. console.log('zh:AD 失败,直接发放奖励');
  6334. this.qjff_AD_for_uisign();
  6335. }
  6336. }
  6337. qjff_AD_for_uisign() {
  6338. let index = this.curDayIndex;
  6339. if (index == 0)
  6340. index = 7;
  6341. let award = cfgTable.signData[index].award;
  6342. let temp;
  6343. let type;
  6344. let num;
  6345. for (let index = 0; index < award.length; index++) {
  6346. temp = award[index].split("-");
  6347. type = parseInt(temp[0]);
  6348. num = parseInt(temp[1]) * 3;
  6349. xGame.common.playObjFlyAnim(num, type);
  6350. }
  6351. DataMgr.setExtraSign(1);
  6352. this.updateSign();
  6353. }
  6354. }
  6355. UISign.uiName = "UISign";
  6356. class ui_UISkill extends fgui.GComponent {
  6357. static createInstance() {
  6358. return (fgui.UIPackage.createObject("game", "UISkill"));
  6359. }
  6360. onConstruct() {
  6361. this.n48 = (this.getChild("n48"));
  6362. this.n0 = (this.getChild("n0"));
  6363. this.secretary = (this.getChild("secretary"));
  6364. this.talkNode = (this.getChild("talkNode"));
  6365. this.closeNode = (this.getChild("closeNode"));
  6366. this.moneyNode = (this.getChild("moneyNode"));
  6367. this.skillNode = (this.getChild("skillNode"));
  6368. this.guideNode = (this.getChild("guideNode"));
  6369. }
  6370. }
  6371. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6372. class SkillDisplay {
  6373. constructor(ui, data, uiIndex) {
  6374. this.starX = 0;
  6375. this.starY = 0;
  6376. this.index = 0;
  6377. this.ui = ui;
  6378. this.data = data;
  6379. this.index = uiIndex;
  6380. this.initSelf();
  6381. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6382. }
  6383. initSelf() {
  6384. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6385. this.ui.nameTxt.text = this.data.name;
  6386. this.ui.describeTxt.text = this.data.describe;
  6387. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6388. this.ui.startBtn.onClick(this, this.startGame);
  6389. this.updateSelf();
  6390. }
  6391. updateSelf() {
  6392. this.checkTry();
  6393. let level = DataMgr.getBigSkillByIndex(this.index);
  6394. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6395. }
  6396. checkTry() {
  6397. let index = this.index;
  6398. let level = DataMgr.getBigSkillByIndex(index);
  6399. if (level == null) {
  6400. DataMgr.setBigSkill(index, 1, false);
  6401. level = 1;
  6402. }
  6403. this.ui.levelTxt.text = "LV." + level;
  6404. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6405. this.ui.tryNode.visible = true;
  6406. else
  6407. this.ui.tryNode.visible = false;
  6408. }
  6409. clickAddLevel() {
  6410. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6411. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6412. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6413. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6414. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6415. }
  6416. else {
  6417. console.log('zh:AD 失败,直接发放奖励');
  6418. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6419. }
  6420. }
  6421. qjff_AD_for_skilldisplay_clickAddLevel() {
  6422. DataMgr.setBigSkill(this.data.index, 1);
  6423. this.updateSelf();
  6424. xGame.common.upSkillLevel = true;
  6425. }
  6426. startGame() {
  6427. console.log('zh:rod skill startgame');
  6428. if (this.data.index == 3) {
  6429. alert('Coming soon!');
  6430. return;
  6431. }
  6432. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6433. let needCoin = xGame.common.bigMoveNeedCoin;
  6434. xGame.common.passAwardCoin = 2000;
  6435. let guide = DataMgr.getSkillGuide();
  6436. console.log('zh:startGame guide=' + guide);
  6437. xGame.common.temSelfLevel = 0;
  6438. if (guide == 0) {
  6439. needCoin = 0;
  6440. xGame.common.temSelfLevel = 100;
  6441. }
  6442. if (DataMgr.coinEnough(needCoin)) {
  6443. DataMgr.setCoin(-needCoin);
  6444. xGame.common.curPlayerSkillType = this.index;
  6445. if (guide == 0)
  6446. xGame.common.curPlayerSkillType = 0;
  6447. console.log('zh: skilldisplay 1');
  6448. xGame.uiMgr.Show(UIGame);
  6449. xGame.uiMgr.Hide(UIMain);
  6450. xGame.uiMgr.Show(UIMatching, () => {
  6451. xGame.common.gameUI.ui.alpha = 1;
  6452. xGame.common.gameUI.startGame();
  6453. xGame.uiMgr.Hide(UISkill);
  6454. });
  6455. this.logEventForRod_start();
  6456. }
  6457. else {
  6458. console.log('zh: skilldisplay 2');
  6459. xGame.uiMgr.Show(UIAddProp, 0);
  6460. Moyu.sendDataEvent("AddCoinVideo");
  6461. }
  6462. }
  6463. logEventForRod_start() {
  6464. let gfmsIdx = xGame.common.curPlayerSkillType;
  6465. console.log('zh:选择的技能=' + gfmsIdx);
  6466. let gfmc = 'Skyfall Shot';
  6467. if (gfmsIdx == 0) {
  6468. gfmc = 'Skyfall Shot';
  6469. }
  6470. if (gfmsIdx == 1) {
  6471. gfmc = 'Surging break';
  6472. }
  6473. if (gfmsIdx == 2) {
  6474. gfmc = 'Frost Lock';
  6475. }
  6476. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6477. let jsonStr = {
  6478. "count": 0,
  6479. "name": gfmc
  6480. };
  6481. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6482. const d = LocalStorageManager.getItem(keyStr);
  6483. jsonStr.count = d.count + 1;
  6484. LocalStorageManager.setItem(keyStr, jsonStr);
  6485. }
  6486. else {
  6487. LocalStorageManager.setItem(keyStr, jsonStr);
  6488. }
  6489. const reqStr = JSON.stringify(jsonStr);
  6490. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6491. }
  6492. }
  6493. class UISkill extends UIBase {
  6494. constructor() {
  6495. super();
  6496. this.skillData = [];
  6497. }
  6498. onConstructor() {
  6499. this.ui = ui_UISkill.createInstance();
  6500. this.contentPane = this.ui;
  6501. this.isEject = false;
  6502. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6503. this.initSkillData();
  6504. console.log('zh:aaaaaa1111111111');
  6505. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6506. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6507. console.log('zh:aaaaaa22222222');
  6508. this.displayList = [];
  6509. this.ui.skillNode.skillList.numItems = 3;
  6510. this.addUIClick(this.ui, this.interuptSecretary);
  6511. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6512. this.ui.talkNode.visible = false;
  6513. if (Moyu.isKs)
  6514. this.ui.closeNode.closeBtn.x += 100;
  6515. }
  6516. show() {
  6517. super.show();
  6518. this.playSecretaryIdle();
  6519. this.moneyNode.ui.c1.selectedIndex = 1;
  6520. Laya.timer.clearAll(this);
  6521. xGame.soundMgr.playSound("s_start");
  6522. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6523. let guide = DataMgr.getSkillGuide();
  6524. this.ui.guideNode.visible = guide == 0;
  6525. let item = this.getSkillItemByUIIndex(0);
  6526. if (guide == 0) {
  6527. item.ui.c1.selectedIndex = 1;
  6528. }
  6529. else {
  6530. item.ui.c1.selectedIndex = 0;
  6531. }
  6532. this.ui.guideNode.guideBtn.visible = guide == 0;
  6533. for (let index = 0; index < this.displayList.length; index++) {
  6534. this.displayList[index].checkTry();
  6535. }
  6536. }
  6537. getSkillItemByUIIndex(cur) {
  6538. for (let index = 0; index < this.displayList.length; index++) {
  6539. if (this.displayList[index].index == cur) {
  6540. return this.displayList[index];
  6541. }
  6542. }
  6543. }
  6544. enterGuideLevel() {
  6545. let item = this.getSkillItemByUIIndex(0);
  6546. item.startGame();
  6547. if (DataMgr.getNewUser())
  6548. Moyu.sendDataEvent("gameStart1");
  6549. }
  6550. initSkillData() {
  6551. this.skillData = [];
  6552. let nameList = xGame.common.skillNameList;
  6553. let iconList = xGame.common.skillIconList;
  6554. let describeList = [
  6555. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6556. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6557. "The power of frost descends—freezing the flow and taking full control of the game!"
  6558. ];
  6559. console.log('zh:initSkillData 111111111');
  6560. let data;
  6561. for (let index = 0; index < nameList.length; index++) {
  6562. data = {};
  6563. data.name = nameList[index];
  6564. data.icon = iconList[index];
  6565. data.describe = describeList[index];
  6566. data.index = index;
  6567. this.skillData.push(data);
  6568. }
  6569. }
  6570. updateSkillItem(index, target) {
  6571. if (this.displayList[index] == null) {
  6572. let uiIndex;
  6573. switch (index) {
  6574. case 0:
  6575. uiIndex = 1;
  6576. break;
  6577. case 1:
  6578. uiIndex = 0;
  6579. break;
  6580. case 2:
  6581. uiIndex = 2;
  6582. break;
  6583. case 3:
  6584. uiIndex = 3;
  6585. break;
  6586. default:
  6587. break;
  6588. }
  6589. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6590. this.displayList.push(temp);
  6591. }
  6592. }
  6593. playSecretaryIdle() {
  6594. let parent = this.ui.secretary.displayObject;
  6595. parent.destroyChildren();
  6596. let xx = this.ui.secretary.width / 2;
  6597. let yy = this.ui.secretary.height;
  6598. let scale = xGame.common.getSecretaryScale();
  6599. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6600. xGame.common.secretary.play(data, 0, true, parent);
  6601. }
  6602. returnUIMain() {
  6603. this.hide();
  6604. xGame.common.stopGirlPop(this.ui.talkNode);
  6605. xGame.uiMgr.Show(UIMain);
  6606. }
  6607. interuptSecretary() {
  6608. Laya.timer.clearAll(this);
  6609. this.playSecretaryRandomSound();
  6610. }
  6611. playSecretaryRandomSound() {
  6612. if (this.isHide)
  6613. return;
  6614. let time = xGame.common.randomNum(45000, 60000);
  6615. Laya.timer.once(time, this, () => {
  6616. if (this.isHide)
  6617. return;
  6618. let index = xGame.common.randomNum(4, 7);
  6619. xGame.soundMgr.playSound("s_main0" + index);
  6620. let words = 1;
  6621. switch (index) {
  6622. case 4:
  6623. words = 5;
  6624. break;
  6625. case 5:
  6626. words = 3;
  6627. break;
  6628. case 6:
  6629. words = 6;
  6630. break;
  6631. case 7:
  6632. words = 7;
  6633. break;
  6634. default:
  6635. break;
  6636. }
  6637. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6638. this.playSecretaryRandomSound();
  6639. });
  6640. }
  6641. }
  6642. UISkill.uiName = "UISkill";
  6643. class ui_UIModeSelection extends fgui.GComponent {
  6644. static createInstance() {
  6645. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6646. }
  6647. onConstruct() {
  6648. this.n19 = (this.getChild("n19"));
  6649. this.closeBtn = (this.getChild("closeBtn"));
  6650. this.myNode = (this.getChild("myNode"));
  6651. this.t0 = this.getTransition("t0");
  6652. }
  6653. }
  6654. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6655. class UIModeSelection extends UIBase {
  6656. constructor() {
  6657. super();
  6658. }
  6659. onConstructor() {
  6660. this.ui = ui_UIModeSelection.createInstance();
  6661. this.contentPane = this.ui;
  6662. this.isEject = false;
  6663. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6664. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6665. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6666. this.addUIClick(this.ui.closeBtn, this.hide);
  6667. this.peopleArr = [65, 990, 580];
  6668. this.peopleOffest = [5, 10, 10];
  6669. }
  6670. show(callback) {
  6671. this.updateSelf();
  6672. super.show();
  6673. this.ui.t0.play();
  6674. this.callback = callback;
  6675. }
  6676. updateSelf() {
  6677. let cfg = cfgTable.modeselectData;
  6678. for (let index = 1; index <= 3; index++) {
  6679. let node = this.ui.myNode["type" + index];
  6680. node.need.text = cfg[index].need;
  6681. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6682. node.peopleTxt.text = this.getRandPeople(index - 1);
  6683. }
  6684. }
  6685. enterGame(type) {
  6686. console.log('zh: 进入经典模式 type: ' + type);
  6687. xGame.common.classicRoomType = type;
  6688. let cfg = cfgTable.modeselectData[type];
  6689. let need = cfg.need;
  6690. xGame.common.passAwardCoin = cfg.award;
  6691. if (DataMgr.coinEnough(need)) {
  6692. DataMgr.setCoin(-need);
  6693. this.ui.myNode["type" + type].t0.play();
  6694. Laya.timer.once(200, this, () => {
  6695. this.callback && this.callback();
  6696. });
  6697. this.logEventForClassic_start();
  6698. }
  6699. else {
  6700. Moyu.sendDataEvent("AddCoinVideo");
  6701. xGame.uiMgr.Show(UIAddProp, 0);
  6702. }
  6703. }
  6704. getRandPeople(index) {
  6705. let rand = this.peopleOffest[index];
  6706. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6707. }
  6708. logEventForClassic_start() {
  6709. let rtype = xGame.common.classicRoomType;
  6710. let msmc = '';
  6711. if (rtype == 1) {
  6712. msmc = 'beginner';
  6713. }
  6714. if (rtype == 2) {
  6715. msmc = 'expert';
  6716. }
  6717. if (rtype == 3) {
  6718. msmc = 'master';
  6719. }
  6720. let keyStr = 'sjmd_classic_start_' + rtype;
  6721. let jsonStr = {
  6722. "difficulty": msmc,
  6723. "classic_count": 1,
  6724. "difficulty_count": 1
  6725. };
  6726. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6727. const d = LocalStorageManager.getItem(keyStr);
  6728. jsonStr.classic_count = d.classic_count + 1;
  6729. jsonStr.difficulty_count = d.difficulty_count + 1;
  6730. LocalStorageManager.setItem(keyStr, jsonStr);
  6731. }
  6732. else {
  6733. LocalStorageManager.setItem(keyStr, jsonStr);
  6734. }
  6735. const reqStr = JSON.stringify(jsonStr);
  6736. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6737. }
  6738. }
  6739. UIModeSelection.uiName = "UIModeSelection";
  6740. class ui_UIReg extends fgui.GComponent {
  6741. static createInstance() {
  6742. return (fgui.UIPackage.createObject("game", "UIReg"));
  6743. }
  6744. onConstruct() {
  6745. this.n38 = (this.getChild("n38"));
  6746. this.n9 = (this.getChild("n9"));
  6747. this.n14 = (this.getChild("n14"));
  6748. this.n15 = (this.getChild("n15"));
  6749. this.n34 = (this.getChild("n34"));
  6750. this.closeBtn = (this.getChild("closeBtn"));
  6751. this.lab_tip = (this.getChild("lab_tip"));
  6752. this.n43 = (this.getChild("n43"));
  6753. this.txt_ua = (this.getChild("txt_ua"));
  6754. this.n44 = (this.getChild("n44"));
  6755. this.txt_up1 = (this.getChild("txt_up1"));
  6756. this.n45 = (this.getChild("n45"));
  6757. this.txt_up2 = (this.getChild("txt_up2"));
  6758. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6759. this.btn_reg = (this.getChild("btn_reg"));
  6760. this.n50 = (this.getChild("n50"));
  6761. }
  6762. }
  6763. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6764. class ui_UILogin extends fgui.GComponent {
  6765. static createInstance() {
  6766. return (fgui.UIPackage.createObject("game", "UILogin"));
  6767. }
  6768. onConstruct() {
  6769. this.c1 = this.getController("c1");
  6770. this.n18 = (this.getChild("n18"));
  6771. this.n7 = (this.getChild("n7"));
  6772. this.n5 = (this.getChild("n5"));
  6773. this.n6 = (this.getChild("n6"));
  6774. this.closeBtn = (this.getChild("closeBtn"));
  6775. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6776. this.btn_login = (this.getChild("btn_login"));
  6777. this.n30 = (this.getChild("n30"));
  6778. this.n31 = (this.getChild("n31"));
  6779. this.txt_up = (this.getChild("txt_up"));
  6780. this.n32 = (this.getChild("n32"));
  6781. this.txt_ua = (this.getChild("txt_ua"));
  6782. }
  6783. }
  6784. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6785. class UILogin extends UIBase {
  6786. constructor() {
  6787. super();
  6788. }
  6789. onConstructor() {
  6790. this.ui = ui_UILogin.createInstance();
  6791. this.contentPane = this.ui;
  6792. this.isEject = false;
  6793. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6794. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6795. this.addUIClick(this.ui.btn_login, this.userLogin);
  6796. }
  6797. show() {
  6798. super.show();
  6799. this.x = (Laya.stage.width - this.width) / 2;
  6800. this.y = (Laya.stage.height - this.height) / 2;
  6801. }
  6802. closeSelf() {
  6803. this.hide();
  6804. }
  6805. userLogin() {
  6806. let ua = this.ui.txt_ua.text;
  6807. let up = this.ui.txt_up.text;
  6808. if (ua && up) {
  6809. let reqData = JSON.stringify({
  6810. username: ua.trim(),
  6811. password: up.trim(),
  6812. fromMark: 'app_game'
  6813. });
  6814. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6815. try {
  6816. console.log('zh:res = ' + JSON.stringify(res));
  6817. let code = res.code;
  6818. let msg = res.msg;
  6819. if (code == 200) {
  6820. let keyStr = 'userInfo';
  6821. let jsonStr = {
  6822. "username": res.username,
  6823. "token": res.token
  6824. };
  6825. LocalStorageManager.setItem(keyStr, jsonStr);
  6826. xGame.uiMgr.Show(UIMsg, msg);
  6827. DataMgr.getUserZiChanInfo();
  6828. this.closeSelf();
  6829. }
  6830. else {
  6831. xGame.uiMgr.Show(UIMsg, msg);
  6832. }
  6833. }
  6834. catch (error) {
  6835. console.log('error=' + error);
  6836. alert(error);
  6837. }
  6838. finally {
  6839. }
  6840. });
  6841. }
  6842. else {
  6843. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6844. }
  6845. }
  6846. gotoRegPage() {
  6847. this.closeSelf();
  6848. xGame.uiMgr.Show(UIReg);
  6849. }
  6850. }
  6851. UILogin.uiName = "UILogin";
  6852. class UIReg extends UIBase {
  6853. constructor() {
  6854. super();
  6855. }
  6856. onConstructor() {
  6857. this.ui = ui_UIReg.createInstance();
  6858. this.contentPane = this.ui;
  6859. this.isEject = false;
  6860. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6861. this.addUIClick(this.ui.btn_reg, this.regUser);
  6862. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6863. }
  6864. show() {
  6865. super.show();
  6866. this.x = (Laya.stage.width - this.width) / 2;
  6867. this.y = (Laya.stage.height - this.height) / 2;
  6868. }
  6869. closeSelf() {
  6870. this.hide();
  6871. }
  6872. regUser() {
  6873. this.ui.lab_tip.visible = false;
  6874. let ua = this.ui.txt_ua.text;
  6875. let up1 = this.ui.txt_up1.text;
  6876. let up2 = this.ui.txt_up2.text;
  6877. if (ua && up1 && up2 && up1 == up2) {
  6878. let reqData = JSON.stringify({
  6879. username: ua.trim(),
  6880. password: up1.trim(),
  6881. fromMark: 'app_game'
  6882. });
  6883. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  6884. try {
  6885. console.log('zh:res = ' + JSON.stringify(res));
  6886. let code = res.code;
  6887. let msg = res.msg;
  6888. xGame.uiMgr.Show(UIMsg, msg);
  6889. if (code == 200) {
  6890. this.ui.lab_tip.color = "#FFFFFF";
  6891. xGame.uiMgr.Show(UIMsg, msg);
  6892. this.closeSelf();
  6893. }
  6894. else {
  6895. this.ui.lab_tip.color = "#FF0000";
  6896. xGame.uiMgr.Show(UIMsg, msg);
  6897. }
  6898. }
  6899. catch (error) {
  6900. console.log('error=' + error);
  6901. alert(error);
  6902. }
  6903. finally {
  6904. }
  6905. });
  6906. }
  6907. else {
  6908. if (up1 != up2) {
  6909. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  6910. }
  6911. else {
  6912. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6913. }
  6914. }
  6915. }
  6916. gotoLogin() {
  6917. this.closeSelf();
  6918. xGame.uiMgr.Show(UILogin);
  6919. }
  6920. }
  6921. UIReg.uiName = "UIReg";
  6922. class ui_UIFuli1 extends fgui.GComponent {
  6923. static createInstance() {
  6924. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  6925. }
  6926. onConstruct() {
  6927. this.n1 = (this.getChild("n1"));
  6928. this.n2 = (this.getChild("n2"));
  6929. }
  6930. }
  6931. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  6932. class UIFuli1 extends UIBase {
  6933. constructor() {
  6934. super();
  6935. }
  6936. onConstructor() {
  6937. this.ui = ui_UIFuli1.createInstance();
  6938. this.contentPane = this.ui;
  6939. this.isEject = false;
  6940. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  6941. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  6942. }
  6943. show() {
  6944. super.show();
  6945. this.x = (Laya.stage.width - this.width) / 2;
  6946. this.y = (Laya.stage.height - this.height) / 2;
  6947. }
  6948. closeSelf() {
  6949. this.hide();
  6950. }
  6951. gotoBuy() {
  6952. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6953. if (userInfo == null) {
  6954. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6955. return;
  6956. }
  6957. let reqData = xGame.httpMgr.getReqData();
  6958. let pd = JSON.parse(reqData);
  6959. pd.productId = 1;
  6960. reqData = JSON.stringify(pd);
  6961. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  6962. try {
  6963. console.log('zh:buySp res = ' + JSON.stringify(res));
  6964. let code = res.code;
  6965. let msg = res.msg;
  6966. if (code == 401) {
  6967. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6968. alert(TIP_MSG_key.loginTimeOut);
  6969. xGame.uiMgr.Show(UIMsg, msg);
  6970. return;
  6971. }
  6972. if (code == 200) {
  6973. xGame.uiMgr.Show(UIMsg, msg);
  6974. DataMgr.getUserZiChanInfo();
  6975. this.closeSelf();
  6976. }
  6977. else {
  6978. xGame.uiMgr.Show(UIMsg, msg);
  6979. }
  6980. }
  6981. catch (error) {
  6982. console.log('error=' + error);
  6983. alert(error);
  6984. }
  6985. finally {
  6986. }
  6987. });
  6988. }
  6989. }
  6990. UIFuli1.uiName = "UIFuli1";
  6991. class ui_UIFuli2 extends fgui.GComponent {
  6992. static createInstance() {
  6993. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  6994. }
  6995. onConstruct() {
  6996. this.n1 = (this.getChild("n1"));
  6997. this.n0 = (this.getChild("n0"));
  6998. }
  6999. }
  7000. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7001. class UIFuli2 extends UIBase {
  7002. constructor() {
  7003. super();
  7004. }
  7005. onConstructor() {
  7006. this.ui = ui_UIFuli2.createInstance();
  7007. this.contentPane = this.ui;
  7008. this.isEject = false;
  7009. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  7010. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  7011. }
  7012. show() {
  7013. super.show();
  7014. this.x = (Laya.stage.width - this.width) / 2;
  7015. this.y = (Laya.stage.height - this.height) / 2;
  7016. }
  7017. closeSelf() {
  7018. this.hide();
  7019. }
  7020. gotoBuy() {
  7021. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7022. if (userInfo == null) {
  7023. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7024. return;
  7025. }
  7026. let reqData = xGame.httpMgr.getReqData();
  7027. let pd = JSON.parse(reqData);
  7028. pd.productId = 2;
  7029. reqData = JSON.stringify(pd);
  7030. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7031. try {
  7032. console.log('zh:buySp res = ' + JSON.stringify(res));
  7033. let code = res.code;
  7034. let msg = res.msg;
  7035. if (code == 401) {
  7036. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7037. alert(TIP_MSG_key.loginTimeOut);
  7038. xGame.uiMgr.Show(UIMsg, msg);
  7039. return;
  7040. }
  7041. if (code == 200) {
  7042. xGame.uiMgr.Show(UIMsg, msg);
  7043. DataMgr.getUserZiChanInfo();
  7044. this.closeSelf();
  7045. }
  7046. else {
  7047. xGame.uiMgr.Show(UIMsg, msg);
  7048. }
  7049. }
  7050. catch (error) {
  7051. console.log('error=' + error);
  7052. alert(error);
  7053. }
  7054. finally {
  7055. }
  7056. });
  7057. }
  7058. }
  7059. UIFuli2.uiName = "UIFuli2";
  7060. class ui_UIGetAward extends fgui.GComponent {
  7061. static createInstance() {
  7062. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7063. }
  7064. onConstruct() {
  7065. this.n4 = (this.getChild("n4"));
  7066. this.n0 = (this.getChild("n0"));
  7067. this.myList = (this.getChild("myList"));
  7068. this.n1 = (this.getChild("n1"));
  7069. this.eftNode = (this.getChild("eftNode"));
  7070. this.btnNode = (this.getChild("btnNode"));
  7071. this.t0 = this.getTransition("t0");
  7072. }
  7073. }
  7074. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7075. class UIGetAward extends UIBase {
  7076. constructor() {
  7077. super();
  7078. this.showTriple = true;
  7079. }
  7080. onConstructor() {
  7081. this.ui = ui_UIGetAward.createInstance();
  7082. this.contentPane = this.ui;
  7083. this.isEject = false;
  7084. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7085. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7086. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7087. }
  7088. show(arr, showTriple, callback) {
  7089. super.show();
  7090. this.ui.t0.play();
  7091. this.ui.eftNode.visible = true;
  7092. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7093. this.ui.eftNode.visible = false;
  7094. }), 1, 0, 0, 0.9);
  7095. this.awardArr = arr;
  7096. this.showTriple = showTriple;
  7097. this.callback = callback;
  7098. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7099. this.ui.myList.numItems = arr.length;
  7100. xGame.soundMgr.playSound("getaward");
  7101. }
  7102. updateSelf(index, obj) {
  7103. let temp = this.awardArr[index];
  7104. let icon = this.getIcon(temp.type);
  7105. let str = icon;
  7106. if (temp.type > 2) {
  7107. str = "s" + icon;
  7108. }
  7109. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7110. obj.myIcon.rotation = 0;
  7111. obj.numTxt.text = temp.num + "";
  7112. obj.numTxt.visible = temp.type > 2 ? false : true;
  7113. obj.nameTxt.text = this.getNameStr(temp.type);
  7114. }
  7115. renderItem(index, obj) {
  7116. this.updateSelf(index, obj);
  7117. }
  7118. tripleGetAward() {
  7119. console.log('zh:qjff_AD_for_uigetAward');
  7120. if (Laya.Browser.onAndroid) {
  7121. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7122. if (!boo) {
  7123. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7124. return;
  7125. }
  7126. }
  7127. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7128. }
  7129. else {
  7130. console.log('zh:AD 失败,直接发放奖励');
  7131. this.qjff_AD_for_uigetAward();
  7132. }
  7133. }
  7134. qjff_AD_for_uigetAward() {
  7135. this.getAward(3);
  7136. }
  7137. normalGetAward() {
  7138. if (PlatMgr.isMisVideo())
  7139. this.tripleGetAward();
  7140. else
  7141. this.getAward();
  7142. }
  7143. getAward(times = 1) {
  7144. this.hide();
  7145. for (let index = 0; index < this.awardArr.length; index++) {
  7146. this.awardArr[index].num *= times;
  7147. }
  7148. this.callback && this.callback(times != 1);
  7149. }
  7150. getIcon(type) {
  7151. switch (type) {
  7152. case Prop.diamond:
  7153. return "ty_zs";
  7154. case Prop.coin:
  7155. return "ty_jb";
  7156. case Prop.gan1:
  7157. return "qg1";
  7158. case Prop.gan2:
  7159. return "qg2";
  7160. case Prop.gan3:
  7161. return "qg3";
  7162. case Prop.gan4:
  7163. return "qg4";
  7164. default:
  7165. break;
  7166. }
  7167. }
  7168. getNameStr(type) {
  7169. switch (type) {
  7170. case Prop.diamond:
  7171. return "Diamond";
  7172. case Prop.coin:
  7173. return "Coins";
  7174. case Prop.gan1:
  7175. case Prop.gan2:
  7176. case Prop.gan3:
  7177. case Prop.gan4:
  7178. return cfgTable.ballrodData[type - 1].name;
  7179. default:
  7180. break;
  7181. }
  7182. }
  7183. }
  7184. UIGetAward.uiName = "UIGetAward";
  7185. class ui_UIRepentProp extends fgui.GComponent {
  7186. static createInstance() {
  7187. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7188. }
  7189. onConstruct() {
  7190. this.c1 = this.getController("c1");
  7191. this.n11 = (this.getChild("n11"));
  7192. this.regretNode = (this.getChild("regretNode"));
  7193. this.helpLineNode = (this.getChild("helpLineNode"));
  7194. this.t0 = this.getTransition("t0");
  7195. }
  7196. }
  7197. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7198. class UIRepentProp extends UIBase {
  7199. constructor() {
  7200. super();
  7201. this.viewType = 0;
  7202. this.regretType = 0;
  7203. }
  7204. onConstructor() {
  7205. this.ui = ui_UIRepentProp.createInstance();
  7206. this.contentPane = this.ui;
  7207. this.isEject = false;
  7208. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7209. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7210. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7211. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7212. }
  7213. show(viewType, regretType, callback) {
  7214. PlatMgr.showInsert(true);
  7215. this.viewType = viewType;
  7216. this.regretType = regretType;
  7217. this.callback = callback;
  7218. super.show();
  7219. this.ui.t0.play();
  7220. this.ui.c1.selectedIndex = this.viewType;
  7221. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7222. if (this.viewType == 0) {
  7223. let guide = DataMgr.getGuideHelpLine();
  7224. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7225. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7226. }
  7227. xGame.common.gameMgr.gamePause = true;
  7228. }
  7229. hideSelf() {
  7230. xGame.common.gameMgr.gamePause = false;
  7231. this.callback && this.callback(false);
  7232. this.hide();
  7233. }
  7234. videoRegret() {
  7235. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7236. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7237. }
  7238. else {
  7239. console.log('zh:AD 失败,直接发放奖励');
  7240. this.qjff_AD_for_UIrepentProp_videoRegret();
  7241. }
  7242. }
  7243. qjff_AD_for_UIrepentProp_videoRegret() {
  7244. this.callback && this.callback(true);
  7245. this.hideSelf();
  7246. }
  7247. videoAddHelpLine() {
  7248. let guide = DataMgr.getGuideHelpLine();
  7249. if (guide == 0) {
  7250. this.callback && this.callback(true);
  7251. this.hideSelf();
  7252. DataMgr.setGuideHelpLine();
  7253. xGame.common.gameUI.ui.guideNode.visible = false;
  7254. }
  7255. else {
  7256. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7257. if (Laya.Browser.onAndroid) {
  7258. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7259. if (!boo) {
  7260. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7261. return;
  7262. }
  7263. }
  7264. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7265. }
  7266. else {
  7267. console.log('zh:AD 失败,直接发放奖励');
  7268. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7269. }
  7270. }
  7271. }
  7272. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7273. this.callback && this.callback(true);
  7274. this.hideSelf();
  7275. }
  7276. }
  7277. UIRepentProp.uiName = "UIRepentProp";
  7278. class UIMain extends UIBase {
  7279. constructor() {
  7280. super();
  7281. this.firstEnter = true;
  7282. }
  7283. nativeCallJs(msg) {
  7284. let t = msg;
  7285. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7286. switch (t) {
  7287. case 'qjff_chouJiang':
  7288. let dui = xGame.uiMgr.getUI(UIDraw);
  7289. dui.qjff_chouJiang();
  7290. break;
  7291. case 'qjff_AD_for_uisign':
  7292. let dui2 = xGame.uiMgr.getUI(UISign);
  7293. dui2.qjff_AD_for_uisign();
  7294. break;
  7295. case 'qjff_AD_for_uitry':
  7296. let dui3 = xGame.uiMgr.getUI(UITry);
  7297. dui3.qjff_AD_for_uitry();
  7298. break;
  7299. case 'qjff_AD_for_uipower':
  7300. let dui4 = xGame.uiMgr.getUI(UIPower);
  7301. dui4.qjff_AD_for_uipower();
  7302. break;
  7303. case 'qjff_AD_for_uigetAward':
  7304. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7305. dui5.qjff_AD_for_uigetAward();
  7306. break;
  7307. case 'qjff_AD_for_uiGameEnd':
  7308. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7309. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7310. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7311. break;
  7312. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7313. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7314. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7315. break;
  7316. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7317. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7318. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7319. break;
  7320. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7321. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7322. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7323. break;
  7324. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7325. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7326. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7327. break;
  7328. case 'qjff_AD_for_UIBOX_onOpenBox':
  7329. let dui11 = xGame.uiMgr.getUI(UIBox);
  7330. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7331. break;
  7332. case 'qjff_AD_for_UIAddCoin':
  7333. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7334. dui12.qjff_AD_for_UIAddCoin();
  7335. break;
  7336. case '111a':
  7337. let dui14 = xGame.uiMgr.getUI(UISign);
  7338. dui14.qjff_AD_for_uisign();
  7339. break;
  7340. case '222a':
  7341. let dui15 = xGame.uiMgr.getUI(UISign);
  7342. dui15.qjff_AD_for_uisign();
  7343. break;
  7344. case '333a':
  7345. let dui16 = xGame.uiMgr.getUI(UISign);
  7346. dui16.qjff_AD_for_uisign();
  7347. break;
  7348. default:
  7349. console.log('zh:未知的方法名字' + t);
  7350. break;
  7351. }
  7352. }
  7353. onConstructor() {
  7354. console.log('zh: UIMain onConstructor');
  7355. this.ui = ui_UIMain.createInstance();
  7356. this.contentPane = this.ui;
  7357. this.isEject = false;
  7358. this.addEvent();
  7359. this.addClickSpine();
  7360. this.settingNode = new SettingNode(this.ui.settingNode);
  7361. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7362. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7363. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7364. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7365. let curUse = DataMgr.getCurSecretary();
  7366. this.changeSecretary(curUse);
  7367. this.ui.talkNode.visible = false;
  7368. let guide = DataMgr.getSkillGuide();
  7369. if (xGame.common.isNewDay && guide == 1) {
  7370. xGame.common.isNewDay = false;
  7371. xGame.soundMgr.playSound("s_main01");
  7372. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7373. console.log("zh:播放小秘书每天语音");
  7374. }
  7375. this.onGetUserInfo();
  7376. DataMgr.getUserZiChanInfo();
  7377. this.ui.n83.visible = false;
  7378. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7379. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7380. let ua = d.username;
  7381. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7382. }
  7383. this.c_btn_for_user();
  7384. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7385. }
  7386. Logout() {
  7387. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7388. LocalStorageManager.removeItem(keyForLoginInfo);
  7389. this.freshUser();
  7390. }
  7391. }
  7392. gotoLogin() {
  7393. xGame.uiMgr.Show(UILogin);
  7394. }
  7395. gotoRegUser() {
  7396. xGame.uiMgr.Show(UIReg);
  7397. }
  7398. showFuLi() {
  7399. console.log('zh:福利2');
  7400. xGame.uiMgr.Show(UIFuli1);
  7401. xGame.uiMgr.Show(UIFuli2);
  7402. console.log('zh:福利2222');
  7403. }
  7404. c_btn_for_user() {
  7405. this.ui.n_Logout.visible = false;
  7406. this.ui.n_dengLu.visible = false;
  7407. this.ui.n_zhuCe.visible = false;
  7408. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7409. this.ui.n_Logout.visible = true;
  7410. }
  7411. else {
  7412. this.ui.n_dengLu.visible = true;
  7413. }
  7414. }
  7415. changeSecretary(curUse) {
  7416. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7417. xGame.common.secretary && xGame.common.secretary.dispose();
  7418. this.addSecretarySpine(name);
  7419. }
  7420. addSecretarySpine(name) {
  7421. let spine = new SpineMgr(name, () => {
  7422. this.playSecretaryIdle();
  7423. });
  7424. xGame.common.secretary = spine;
  7425. }
  7426. addClickSpine() {
  7427. let clickSpine = new SpineMgr("dianji", () => {
  7428. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7429. let parent = Laya.stage;
  7430. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7431. clickSpine.play(data, 0, false, parent, (spine) => {
  7432. spine.destroy(true);
  7433. });
  7434. });
  7435. });
  7436. }
  7437. addEvent() {
  7438. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7439. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7440. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7441. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7442. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7443. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7444. this.addUIClick(this.ui, this.interuptSecretary);
  7445. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7446. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7447. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7448. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7449. this.addUIClick(this.ui.signBtn, this.openSignView);
  7450. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7451. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7452. this.addUIClick(this.ui.n_Logout, this.Logout);
  7453. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7454. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7455. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  7456. }
  7457. show(showFailWords) {
  7458. super.show();
  7459. this.moneyNode.ui.c1.selectedIndex = 1;
  7460. this.playSecretaryIdle();
  7461. xGame.soundMgr.playMusic("caromhall01", 0);
  7462. Laya.timer.clearAll(this);
  7463. this.playSecretaryRandomSound();
  7464. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7465. if (showFailWords) {
  7466. console.log('zh:uimain.ts ');
  7467. setTimeout(() => {
  7468. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7469. let words = -1;
  7470. if (str == "s_main02") {
  7471. words = 2;
  7472. }
  7473. else {
  7474. words = 3;
  7475. }
  7476. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7477. xGame.soundMgr.playSound(str);
  7478. }, 300);
  7479. }
  7480. this.showGuide();
  7481. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7482. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7483. let guide = DataMgr.getSkillGuide();
  7484. if (guide == 1) {
  7485. let randTime = xGame.common.randomNum(300, 800);
  7486. if (this.firstEnter) {
  7487. console.log("zh: firstEnter");
  7488. this.firstEnter = false;
  7489. randTime += 900;
  7490. }
  7491. else {
  7492. console.log("zh: no firstEnter");
  7493. }
  7494. Laya.timer.once(randTime, this, () => {
  7495. xGame.common.autoPopUIView();
  7496. });
  7497. }
  7498. }
  7499. checkActive(show) {
  7500. }
  7501. showGuide() {
  7502. let guide = DataMgr.getSkillGuide();
  7503. this.ui.guideBtn.visible = guide == 0;
  7504. this.ui.enterGuide.visible = false;
  7505. this.ui.secretaryGuide.visible = guide == 0;
  7506. if (guide == 0) {
  7507. console.log("zh:显示引导");
  7508. xGame.soundMgr.playSound("s_guide");
  7509. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7510. }
  7511. else {
  7512. console.log("zh:不需要显示引导");
  7513. }
  7514. }
  7515. ensureSecretary() {
  7516. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7517. this.ui.secretaryGuide.visible = false;
  7518. this.ui.enterGuide.visible = true;
  7519. this.ui.wordsNode.t0.play();
  7520. if (DataMgr.getNewUser())
  7521. Moyu.sendDataEvent("gameReady");
  7522. }
  7523. playSecretaryIdle() {
  7524. let parent = this.ui.secretary.displayObject;
  7525. parent.destroyChildren();
  7526. let xx = this.ui.secretary.width / 2;
  7527. let yy = this.ui.secretary.height;
  7528. let scale = xGame.common.getSecretaryScale();
  7529. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7530. xGame.common.secretary.play(data, 0, true, parent);
  7531. }
  7532. startGame(type) {
  7533. if (!this.isReadyForLoadNetSource()) {
  7534. return;
  7535. }
  7536. xGame.common.gameMode = type;
  7537. Moyu.sendDataEvent("PlayGame", { type: type });
  7538. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7539. switch (xGame.common.gameMode) {
  7540. case GameMode.classic:
  7541. console.log('zh:进入经典模式111111111');
  7542. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7543. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7544. console.log('zh:classic db_over_lev=', db_over_lev);
  7545. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7546. console.log('zh:判断是否可以玩该模式classic =NO');
  7547. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7548. xGame.uiMgr.Show(UIMsg, tipStr);
  7549. return;
  7550. }
  7551. else {
  7552. console.log('zh:可以玩该模式classic 66666666666666');
  7553. this.beginGame();
  7554. }
  7555. }
  7556. else {
  7557. console.log('zh:不需要判断是否可以玩该classic');
  7558. let challengeTimes = DataMgr.getChallengeTimes();
  7559. if (challengeTimes == 0) {
  7560. xGame.uiMgr.Show(UIInvitation);
  7561. }
  7562. else {
  7563. this.beginGame();
  7564. }
  7565. break;
  7566. }
  7567. case GameMode.bigMove:
  7568. console.error('zh:bigMove check');
  7569. let guide = DataMgr.getSkillGuide();
  7570. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7571. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7572. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7573. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7574. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7575. xGame.uiMgr.Show(UIMsg, tipStr);
  7576. return;
  7577. }
  7578. else {
  7579. console.log('zh:可以玩该模式 bigMove');
  7580. this.beginGame();
  7581. if (DataMgr.getNewUser())
  7582. Moyu.sendDataEvent("gameStart0");
  7583. }
  7584. }
  7585. else {
  7586. this.beginGame();
  7587. if (DataMgr.getNewUser())
  7588. Moyu.sendDataEvent("gameStart0");
  7589. }
  7590. break;
  7591. default:
  7592. console.error('zh:未知错误!!!!');
  7593. break;
  7594. }
  7595. }
  7596. beginGame(isNice = false) {
  7597. console.log('zh:beginGame ');
  7598. let guide = DataMgr.getSkillGuide();
  7599. if (guide == 1) {
  7600. console.log('zh:非新手引导,showInternAd ');
  7601. JSBridgeUtils.instance.showInternAd('beginGame');
  7602. }
  7603. else {
  7604. console.log('zh:新手引导,不显示AD ');
  7605. }
  7606. console.log('zh:beginGame 2 go');
  7607. if (xGame.common.gameMode == GameMode.classic) {
  7608. if (isNice) {
  7609. this.enterClassic();
  7610. }
  7611. else {
  7612. xGame.uiMgr.Show(UIModeSelection, () => {
  7613. console.log('zh:BBBBBBBBBBBBBBB');
  7614. this.enterClassic();
  7615. });
  7616. }
  7617. }
  7618. else if (xGame.common.gameMode == GameMode.bigMove) {
  7619. this.ui.enterGuide.visible = false;
  7620. xGame.uiMgr.Show(UISkill);
  7621. }
  7622. }
  7623. enterClassic() {
  7624. xGame.uiMgr.Show(UIGame);
  7625. xGame.uiMgr.Show(UIMatching, () => {
  7626. if (!this.isHide)
  7627. this.hide();
  7628. xGame.common.gameUI.ui.alpha = 1;
  7629. xGame.common.gameUI.startGame();
  7630. xGame.uiMgr.Hide(UIGameEnd);
  7631. });
  7632. }
  7633. startGlobal() {
  7634. xGame.uiMgr.Show(UIMsg, "Coming Soon111");
  7635. JSBridgeUtils.instance.testPay();
  7636. }
  7637. startWeekly() {
  7638. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7639. }
  7640. zhouSaiMonth() {
  7641. console.log('zh: zhouSaiMonth 被调用');
  7642. }
  7643. isReadyForLoadNetSource() {
  7644. let reqCount = xGame.cfgMgr.httpReqCount;
  7645. let ok = xGame.cfgMgr.httpReqOkCount;
  7646. if (reqCount > ok) {
  7647. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7648. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7649. Laya.timer.once(5000, this, () => {
  7650. let retryCount = 0;
  7651. const maxRetries = 3;
  7652. const tryFetchConfig = () => {
  7653. try {
  7654. xGame.cfgMgr.getConfigFromServer();
  7655. }
  7656. catch (error) {
  7657. if (retryCount < maxRetries) {
  7658. retryCount++;
  7659. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7660. Laya.timer.once(5000, this, tryFetchConfig);
  7661. }
  7662. else {
  7663. console.error("❌ 达到最大重试次数,配置获取失败");
  7664. }
  7665. }
  7666. };
  7667. tryFetchConfig();
  7668. });
  7669. return false;
  7670. }
  7671. return true;
  7672. }
  7673. startPlaceBall() {
  7674. if (!this.isReadyForLoadNetSource()) {
  7675. return;
  7676. }
  7677. xGame.uiMgr.Show(UILevelDisplay);
  7678. }
  7679. hide() {
  7680. console.log('zh:uimain hide ...');
  7681. super.hide();
  7682. xGame.common.stopGirlPop(this.ui.talkNode);
  7683. }
  7684. onGetUserInfo(force = false) {
  7685. if (Moyu.isWx) {
  7686. let info = Moyu.getSystemInfo();
  7687. if (info)
  7688. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7689. }
  7690. else {
  7691. Moyu.initUser(this, this.freshUser, force);
  7692. }
  7693. this.freshUser();
  7694. }
  7695. freshUser() {
  7696. let user = Moyu.getUserInfo();
  7697. if (!user.isAuth) {
  7698. user.headIcon = 'res/ty_touxiang.png';
  7699. }
  7700. else {
  7701. DataMgr.upRankData();
  7702. }
  7703. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7704. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7705. let keyStr = keyForLoginInfo;
  7706. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7707. const d = LocalStorageManager.getItem(keyStr);
  7708. let ua = d.username;
  7709. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7710. }
  7711. else {
  7712. }
  7713. this.c_btn_for_user();
  7714. }
  7715. interuptSecretary() {
  7716. Laya.timer.clearAll(this);
  7717. this.playSecretaryRandomSound();
  7718. }
  7719. playSecretaryRandomSound() {
  7720. if (this.isHide)
  7721. return;
  7722. let time = xGame.common.randomNum(45000, 60000);
  7723. Laya.timer.once(time, this, () => {
  7724. if (this.isHide)
  7725. return;
  7726. let index = xGame.common.randomNum(4, 7);
  7727. xGame.soundMgr.playSound("s_main0" + index);
  7728. let words = 1;
  7729. switch (index) {
  7730. case 4:
  7731. words = 5;
  7732. break;
  7733. case 5:
  7734. words = 3;
  7735. break;
  7736. case 6:
  7737. words = 6;
  7738. break;
  7739. case 7:
  7740. words = 7;
  7741. break;
  7742. default:
  7743. break;
  7744. }
  7745. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7746. this.playSecretaryRandomSound();
  7747. });
  7748. }
  7749. openSecretaryView() {
  7750. xGame.uiMgr.Show(UISecretary);
  7751. Moyu.sendDataEvent("secretary");
  7752. }
  7753. openShopView() {
  7754. xGame.uiMgr.Show(UIShop, 0);
  7755. }
  7756. openSignView() {
  7757. xGame.uiMgr.Show(UISign);
  7758. }
  7759. openDrawView() {
  7760. xGame.uiMgr.Show(UIDraw);
  7761. }
  7762. openRanking() {
  7763. console.log('zh:phb openRanking');
  7764. xGame.uiMgr.Show(UIRanking);
  7765. Moyu.sendDataEvent("rankingList");
  7766. }
  7767. }
  7768. UIMain.uiName = "UIMain";
  7769. class UIGameEnd extends UIBase {
  7770. constructor() {
  7771. super();
  7772. this.success = false;
  7773. this.awardCoinNum = 1000;
  7774. this.awardDiamondNum = 10;
  7775. }
  7776. onConstructor() {
  7777. this.ui = ui_UIGameEnd.createInstance();
  7778. this.contentPane = this.ui;
  7779. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  7780. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  7781. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  7782. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7783. this.ui.talkNode.visible = false;
  7784. if (Moyu.isKs)
  7785. this.ui.closeNode.closeBtn.x += 100;
  7786. }
  7787. updateType() {
  7788. switch (xGame.common.gameMode) {
  7789. case GameMode.classic:
  7790. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7791. this.ui.coinNode.visible = this.success;
  7792. if (!this.success) {
  7793. Laya.timer.once(500, this, () => {
  7794. xGame.uiMgr.Show(UIAddCoin);
  7795. });
  7796. }
  7797. else {
  7798. this.logEventForClassic_win();
  7799. }
  7800. this.logEventForClassic_complete();
  7801. this.ui.isGetAward.visible = false;
  7802. this.ui.leftBtn.c1.selectedIndex = 3;
  7803. this.ui.rightBtn.c1.selectedIndex = 0;
  7804. this.moneyNode.ui.c1.selectedIndex = 1;
  7805. break;
  7806. case GameMode.bigMove:
  7807. console.log('zh:招法模式 aaaaaa bigMove');
  7808. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  7809. this.ui.coinNode.visible = this.success;
  7810. if (xGame.common.gameMode == GameMode.bigMove) {
  7811. if (this.success) {
  7812. DataMgr.setSkillSuccessTimes(1, true);
  7813. DataMgr.setSkillAccTimes(1);
  7814. }
  7815. else {
  7816. DataMgr.setSkillSuccessTimes(0, false);
  7817. }
  7818. }
  7819. this.logEventForRod_complete_N();
  7820. if (!this.success) {
  7821. Laya.timer.once(500, this, () => {
  7822. xGame.uiMgr.Show(UIAddCoin);
  7823. });
  7824. }
  7825. else {
  7826. this.logEventForRod_win();
  7827. }
  7828. this.ui.isGetAward.visible = false;
  7829. this.ui.leftBtn.c1.selectedIndex = 3;
  7830. this.ui.rightBtn.c1.selectedIndex = 0;
  7831. this.moneyNode.ui.c1.selectedIndex = 1;
  7832. break;
  7833. case GameMode.placeBall:
  7834. this.ui.coinNode.visible = false;
  7835. if (this.success) {
  7836. if (xGame.common.placeBallStarNum == 3) {
  7837. this.ui.c1.selectedIndex = 2;
  7838. }
  7839. else {
  7840. this.ui.c1.selectedIndex = 3;
  7841. }
  7842. let level = xGame.common.placeBallCurLevel;
  7843. if (level > 59) {
  7844. this.logEventForChallenge_level_complete(level);
  7845. }
  7846. else {
  7847. this.logEventForChallenge_level_N(level);
  7848. }
  7849. }
  7850. else {
  7851. this.ui.c1.selectedIndex = 4;
  7852. }
  7853. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  7854. if (cfg.type == PlaceBallType.challenge) {
  7855. this.ui.c1.selectedIndex = 2;
  7856. }
  7857. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  7858. this.updatePlaceBallBtn();
  7859. this.updatePlaceBallStarNum();
  7860. this.updatePlaceBallAwardState();
  7861. this.moneyNode.ui.c1.selectedIndex = 2;
  7862. this.moneyNode.checkPowerTime();
  7863. this.moneyNode.powerChange();
  7864. DataMgr.upRankData();
  7865. break;
  7866. default:
  7867. break;
  7868. }
  7869. }
  7870. logEventForRod_complete_N() {
  7871. let gfmsIdx = xGame.common.curPlayerSkillType;
  7872. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  7873. let gfmc = 'Skyfall Shot';
  7874. if (gfmsIdx == 0) {
  7875. gfmc = 'Skyfall Shot';
  7876. }
  7877. if (gfmsIdx == 1) {
  7878. gfmc = 'Surging break';
  7879. }
  7880. if (gfmsIdx == 2) {
  7881. gfmc = 'Frost Lock';
  7882. }
  7883. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7884. console.log('zh:logEventForRod_complete_N level = ' + level);
  7885. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  7886. let jsonStr = {
  7887. "count": 0,
  7888. "name": gfmc
  7889. };
  7890. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7891. const d = LocalStorageManager.getItem(keyStr);
  7892. jsonStr.count = d.count + 1;
  7893. LocalStorageManager.setItem(keyStr, jsonStr);
  7894. }
  7895. else {
  7896. LocalStorageManager.setItem(keyStr, jsonStr);
  7897. }
  7898. const d2 = LocalStorageManager.getItem(keyStr);
  7899. let count = d2.count;
  7900. console.log('zh:logEventForRod_complete_N count = ' + count);
  7901. if (count % 5 == 0) {
  7902. const reqStr = JSON.stringify(jsonStr);
  7903. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  7904. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  7905. }
  7906. }
  7907. logEventForRod_win() {
  7908. console.log('zh:logEventForRod_win,胜利');
  7909. let gfmsIdx = xGame.common.curPlayerSkillType;
  7910. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  7911. let gfmc = 'Skyfall Shot';
  7912. if (gfmsIdx == 0) {
  7913. gfmc = 'Skyfall Shot';
  7914. }
  7915. if (gfmsIdx == 1) {
  7916. gfmc = 'Surging break';
  7917. }
  7918. if (gfmsIdx == 2) {
  7919. gfmc = 'Frost Lock';
  7920. }
  7921. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  7922. console.log('zh:logEventForRod_win level = ' + level);
  7923. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  7924. let jsonStr = {
  7925. "count": 1,
  7926. "name": gfmc + ' Lev' + level
  7927. };
  7928. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7929. const d = LocalStorageManager.getItem(keyStr);
  7930. jsonStr.count = d.count + 1;
  7931. LocalStorageManager.setItem(keyStr, jsonStr);
  7932. }
  7933. else {
  7934. LocalStorageManager.setItem(keyStr, jsonStr);
  7935. }
  7936. const reqStr = JSON.stringify(jsonStr);
  7937. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  7938. }
  7939. logEventForClassic_win() {
  7940. console.log('zh:logEventForClassic_win,胜利');
  7941. let rtype = xGame.common.classicRoomType;
  7942. let msmc = '';
  7943. if (rtype == 1) {
  7944. msmc = 'beginner';
  7945. }
  7946. if (rtype == 2) {
  7947. msmc = 'expert';
  7948. }
  7949. if (rtype == 3) {
  7950. msmc = 'master';
  7951. }
  7952. let keyStr = 'sjmd_classic_win_' + rtype;
  7953. let jsonStr = {
  7954. "difficulty": msmc,
  7955. "classic_count": 1,
  7956. "difficulty_count": 1
  7957. };
  7958. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7959. const d = LocalStorageManager.getItem(keyStr);
  7960. jsonStr.classic_count = d.classic_count + 1;
  7961. jsonStr.difficulty_count = d.difficulty_count + 1;
  7962. LocalStorageManager.setItem(keyStr, jsonStr);
  7963. }
  7964. else {
  7965. LocalStorageManager.setItem(keyStr, jsonStr);
  7966. }
  7967. const reqStr = JSON.stringify(jsonStr);
  7968. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  7969. }
  7970. logEventForClassic_complete() {
  7971. console.log('zh:logEventForClassic_complete,胜利');
  7972. let rtype = xGame.common.classicRoomType;
  7973. let msmc = '';
  7974. if (rtype == 1) {
  7975. msmc = 'beginner';
  7976. }
  7977. if (rtype == 2) {
  7978. msmc = 'expert';
  7979. }
  7980. if (rtype == 3) {
  7981. msmc = 'master';
  7982. }
  7983. let keyStr = 'sjmd_classic_complete_' + rtype;
  7984. let jsonStr = {
  7985. "msmc": msmc,
  7986. "count": 0
  7987. };
  7988. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7989. const d = LocalStorageManager.getItem(keyStr);
  7990. jsonStr.count = d.count + 1;
  7991. LocalStorageManager.setItem(keyStr, jsonStr);
  7992. }
  7993. else {
  7994. LocalStorageManager.setItem(keyStr, jsonStr);
  7995. }
  7996. if (jsonStr.count % 5 == 0) {
  7997. const reqStr = JSON.stringify(jsonStr);
  7998. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  7999. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8000. }
  8001. }
  8002. updatePlaceBallBtn() {
  8003. this.ui.leftBtn.c1.selectedIndex = 5;
  8004. if (this.success) {
  8005. this.ui.rightBtn.c1.selectedIndex = 14;
  8006. }
  8007. else {
  8008. if (xGame.common.placeBallStarNum == 3) {
  8009. this.ui.rightBtn.c1.selectedIndex = 14;
  8010. }
  8011. else {
  8012. this.ui.rightBtn.c1.selectedIndex = 1;
  8013. }
  8014. }
  8015. }
  8016. updatePlaceBallStarNum() {
  8017. let starNum = xGame.common.placeBallStarNum;
  8018. if (starNum == 0)
  8019. this.ui.starNumNode.c1.selectedIndex = 3;
  8020. else {
  8021. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8022. }
  8023. }
  8024. updatePlaceBallAwardState() {
  8025. let level = xGame.common.placeBallCurLevel;
  8026. let starNum = xGame.common.placeBallStarNum;
  8027. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8028. let data = cfgTable.placeballData[level].award;
  8029. let cfg = cfgTable.placeballData[level];
  8030. this.awardDiamondNum = data[1];
  8031. this.awardCoinNum = data[0];
  8032. if (cfg.type == PlaceBallType.challenge) {
  8033. this.awardDiamondNum = 0;
  8034. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8035. }
  8036. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8037. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8038. if (cfg.type == PlaceBallType.challenge) {
  8039. this.ui.awardNode.coinNode.visible = true;
  8040. }
  8041. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8042. this.ui.awardNode.diamondNode.x = 265;
  8043. this.ui.awardNode.coinNode.x = 354;
  8044. }
  8045. else {
  8046. this.ui.awardNode.diamondNode.x = 291;
  8047. this.ui.awardNode.coinNode.x = 291;
  8048. }
  8049. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8050. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8051. if (this.awardCoinNum == 0) {
  8052. this.ui.awardNode.coinNode.numTxt.text = "";
  8053. }
  8054. if (getAward) {
  8055. this.ui.isGetAward.visible = true;
  8056. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8057. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8058. }
  8059. else {
  8060. this.ui.isGetAward.visible = false;
  8061. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8062. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8063. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8064. }
  8065. else {
  8066. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8067. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8068. }
  8069. }
  8070. }
  8071. show(success) {
  8072. super.show();
  8073. xGame.eventMgr.event(RESET_GAME);
  8074. this.success = success;
  8075. Laya.timer.clearAll(this);
  8076. this.playSecretaryAni();
  8077. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8078. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8079. offsetTime = Math.floor(offsetTime / 1000);
  8080. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8081. this.updateType();
  8082. Laya.timer.once(200, this, () => {
  8083. this.addAward(() => {
  8084. this.updateType();
  8085. Laya.timer.once(500, this, () => {
  8086. this.showChallengeLevel();
  8087. });
  8088. });
  8089. });
  8090. if (this.success) {
  8091. JSBridgeUtils.instance.showInternAd('gameend_success');
  8092. console.log('zh:game end 成功');
  8093. xGame.soundMgr.playSound('slots_roll01');
  8094. xGame.soundMgr.playSound("s_win");
  8095. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8096. this.diyGameDataUtilForGameWin();
  8097. }
  8098. else {
  8099. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8100. console.log('zh:game end失败');
  8101. xGame.soundMgr.playSound('matchwin01');
  8102. xGame.soundMgr.playSound("s_lose");
  8103. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8104. }
  8105. let challengeNum = DataMgr.getChallengeTimes();
  8106. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8107. DataMgr.setChallengeTimes(1);
  8108. }
  8109. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8110. DataMgr.setClassicTimes();
  8111. }
  8112. }
  8113. diyGameDataUtilForGameWin() {
  8114. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8115. switch (xGame.common.gameMode) {
  8116. case GameMode.classic:
  8117. console.log('zh:DiyGameDataUtilForGameWin 111');
  8118. case GameMode.bigMove:
  8119. console.log('zh:DiyGameDataUtilForGameWin 222');
  8120. this.restartGame();
  8121. break;
  8122. case GameMode.placeBall:
  8123. console.log('zh:DiyGameDataUtilForGameWin 333');
  8124. var level = xGame.common.placeBallCurLevel;
  8125. console.log('zh:练习模式 联系了多少LEV=' + level);
  8126. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8127. if (level > db_over_lev) {
  8128. DataMgr.setChallengeMode_overLev(level);
  8129. }
  8130. break;
  8131. default:
  8132. console.log('zh:DiyGameDataUtilForGameWin 444');
  8133. break;
  8134. }
  8135. }
  8136. showChallengeLevel() {
  8137. if (DataMgr.getChallengeTimes() != 0)
  8138. return;
  8139. let skill = DataMgr.getSkillAccTimes();
  8140. let put = DataMgr.getPlaceBallLevelList().length;
  8141. if (skill >= 3 || put >= 5) {
  8142. xGame.uiMgr.Show(UIInvitation);
  8143. this.hide();
  8144. }
  8145. }
  8146. addAward(callback) {
  8147. if (!this.success) {
  8148. callback && callback();
  8149. return;
  8150. }
  8151. switch (xGame.common.gameMode) {
  8152. case GameMode.classic:
  8153. this.awardCoinNum = xGame.common.passAwardCoin;
  8154. this.awardDiamondNum = 0;
  8155. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8156. break;
  8157. case GameMode.bigMove:
  8158. this.awardCoinNum = xGame.common.passAwardCoin;
  8159. this.awardDiamondNum = 0;
  8160. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8161. callback && callback();
  8162. break;
  8163. case GameMode.placeBall:
  8164. let level = xGame.common.placeBallCurLevel;
  8165. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8166. if (xGame.common.placeBallStarNum != 3) {
  8167. callback && callback();
  8168. return;
  8169. }
  8170. else {
  8171. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8172. if (getAward) {
  8173. callback && callback();
  8174. return;
  8175. }
  8176. }
  8177. let cfg = cfgTable.placeballData[level];
  8178. let data = cfgTable.placeballData[level].award;
  8179. this.awardCoinNum = data[0];
  8180. this.awardDiamondNum = data[1];
  8181. if (cfg.type == PlaceBallType.challenge) {
  8182. this.awardDiamondNum = 0;
  8183. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8184. }
  8185. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8186. let diamondAward;
  8187. if (this.awardDiamondNum > 0) {
  8188. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8189. xGame.common.getAward([diamondAward, coinAward], callback);
  8190. }
  8191. else {
  8192. xGame.common.getAward([coinAward], callback);
  8193. }
  8194. if (cfg.type == PlaceBallType.normal) {
  8195. DataMgr.setPlaceBallAward(level);
  8196. }
  8197. break;
  8198. default:
  8199. break;
  8200. }
  8201. }
  8202. playSecretaryAni_old() {
  8203. let parent = this.ui.secretary.displayObject;
  8204. parent.destroyChildren();
  8205. let xx = this.ui.secretary.width / 2;
  8206. let yy = this.ui.secretary.height;
  8207. let scale = xGame.common.getSecretaryScale();
  8208. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8209. if (this.success) {
  8210. let rand = Math.random() <= 0.5 ? 2 : 3;
  8211. xGame.common.secretary.play(data, rand, false, parent, () => {
  8212. xGame.common.secretary.play(data, 1, true, parent);
  8213. });
  8214. }
  8215. else {
  8216. xGame.common.secretary.play(data, 0, true, parent);
  8217. }
  8218. }
  8219. playSecretaryAni() {
  8220. let parent = this.ui.secretary.displayObject;
  8221. parent.destroyChildren();
  8222. let xx = this.ui.secretary.width / 2;
  8223. let yy = this.ui.secretary.height;
  8224. let scale = xGame.common.getSecretaryScale();
  8225. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8226. if (this.success) {
  8227. let rand = 0;
  8228. xGame.common.secretary.play(data, 0, true, parent);
  8229. }
  8230. else {
  8231. xGame.common.secretary.play(data, 0, true, parent);
  8232. }
  8233. }
  8234. restartGame() {
  8235. switch (xGame.common.gameMode) {
  8236. case GameMode.classic:
  8237. xGame.eventMgr.event(RESTART_GAME);
  8238. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8239. break;
  8240. case GameMode.bigMove:
  8241. this.hide();
  8242. xGame.eventMgr.event(RESTART_GAME);
  8243. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8244. break;
  8245. default:
  8246. break;
  8247. }
  8248. }
  8249. hide() {
  8250. super.hide();
  8251. xGame.common.stopGirlPop(this.ui.talkNode);
  8252. PlatMgr.showBanner(false);
  8253. }
  8254. returnHome() {
  8255. this.hide();
  8256. let showFailWords = !this.success;
  8257. xGame.uiMgr.Show(UIMain, showFailWords);
  8258. }
  8259. clickLeftBtn() {
  8260. switch (xGame.common.gameMode) {
  8261. case GameMode.classic:
  8262. case GameMode.bigMove:
  8263. this.returnHome();
  8264. break;
  8265. case GameMode.placeBall:
  8266. let level = xGame.common.placeBallCurLevel;
  8267. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8268. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8269. break;
  8270. default:
  8271. break;
  8272. }
  8273. }
  8274. powerStartPlaceBallLevel(level, btn) {
  8275. if (DataMgr.powerEnough()) {
  8276. btn.touchable = false;
  8277. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8278. btn.touchable = true;
  8279. DataMgr.setPower(-1);
  8280. xGame.eventMgr.event(POWER_TIME);
  8281. this.startPlaceBallLevel(level);
  8282. this.logEventForChallenge_level_start(level);
  8283. }));
  8284. }
  8285. else {
  8286. xGame.uiMgr.Show(UIPower, 0);
  8287. }
  8288. }
  8289. clickRightBtn() {
  8290. switch (xGame.common.gameMode) {
  8291. case GameMode.classic:
  8292. console.log('zh:clickRightBtn 111');
  8293. case GameMode.bigMove:
  8294. console.log('zh:clickRightBtn 222');
  8295. this.restartGame();
  8296. break;
  8297. case GameMode.placeBall:
  8298. console.log('zh:clickRightBtn 333');
  8299. let level = xGame.common.placeBallCurLevel;
  8300. let data = DataMgr.getPlaceBallLevel(level);
  8301. let curPss = data.play && !data.isCur;
  8302. if (curPss) {
  8303. console.log('zh:clickRightBtn 333-111');
  8304. console.log('zh:当前LV=' + level);
  8305. if (level == 60) {
  8306. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8307. Laya.timer.once(3000, this, () => {
  8308. this.returnHome();
  8309. });
  8310. }
  8311. else {
  8312. let lev = level + 1;
  8313. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8314. }
  8315. }
  8316. else {
  8317. console.log('zh:clickRightBtn 333-000');
  8318. Moyu.sendDataEvent("placeBallNextLevel");
  8319. console.log('zh:qjff_AD_for_uiGameEnd');
  8320. if (Laya.Browser.onAndroid) {
  8321. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8322. if (!boo) {
  8323. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8324. return;
  8325. }
  8326. }
  8327. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8328. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8329. }
  8330. else {
  8331. console.log('zh:AD 失败,直接发放奖励');
  8332. this.qjff_AD_for_uiGameEnd(level);
  8333. }
  8334. }
  8335. break;
  8336. default:
  8337. console.log('zh:clickRightBtn 444');
  8338. break;
  8339. }
  8340. }
  8341. logEventForChallenge_level_start(level) {
  8342. let keyStr = 'sjmd_challenge_level_start';
  8343. let jsonStr = {
  8344. "count": 0,
  8345. "gold_balance ": DataMgr.getCoin(),
  8346. "level": level,
  8347. "diamond_balance ": DataMgr.getDiamond()
  8348. };
  8349. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8350. const d = LocalStorageManager.getItem(keyStr);
  8351. if (level > d.level) {
  8352. jsonStr.count = d.count + 1;
  8353. LocalStorageManager.setItem(keyStr, jsonStr);
  8354. }
  8355. else {
  8356. }
  8357. }
  8358. else {
  8359. LocalStorageManager.setItem(keyStr, jsonStr);
  8360. }
  8361. const reqStr = JSON.stringify(jsonStr);
  8362. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8363. }
  8364. qjff_AD_for_uiGameEnd(level) {
  8365. DataMgr.setPlaceBallLevel(level, 1);
  8366. this.startPlaceBallLevel(level + 1);
  8367. }
  8368. startPlaceBallLevel(level) {
  8369. xGame.common.gameMode = GameMode.placeBall;
  8370. xGame.common.placeBallCurLevel = level;
  8371. xGame.uiMgr.Show(UIGame);
  8372. this.hide();
  8373. }
  8374. logEventForChallenge_level_complete(level) {
  8375. let keyStr = 'sjmd_challenge_level_complete';
  8376. let jsonStr = {
  8377. "count": 1,
  8378. "gold_balance ": DataMgr.getCoin(),
  8379. "level": level,
  8380. "diamond_balance ": DataMgr.getDiamond()
  8381. };
  8382. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8383. const d = LocalStorageManager.getItem(keyStr);
  8384. jsonStr.count = d.count + 1;
  8385. LocalStorageManager.setItem(keyStr, jsonStr);
  8386. }
  8387. else {
  8388. LocalStorageManager.setItem(keyStr, jsonStr);
  8389. }
  8390. const reqStr = JSON.stringify(jsonStr);
  8391. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8392. }
  8393. logEventForChallenge_level_N(level) {
  8394. console.log('zh:logEventForChallenge_level_N ' + level);
  8395. let keyStr = 'sjmd_challenge_level_N';
  8396. if (LocalStorageManager.hasKey(keyStr)) {
  8397. let lev = LocalStorageManager.getItem(keyStr);
  8398. if (level > lev) {
  8399. LocalStorageManager.setItem(keyStr, level);
  8400. }
  8401. if ((level) % 5 == 0) {
  8402. console.log('zh:每5关上报1次');
  8403. let sjmc = 'challenge_level_' + level;
  8404. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8405. let sjmcForFirebase = 'challenge_level_' + level;
  8406. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8407. }
  8408. else {
  8409. console.log('zh:5 no 上报');
  8410. }
  8411. }
  8412. else {
  8413. LocalStorageManager.setItem(keyStr, level);
  8414. }
  8415. }
  8416. }
  8417. UIGameEnd.uiName = "UIGameEnd";
  8418. class ui_UIVideoShare extends fgui.GComponent {
  8419. static createInstance() {
  8420. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8421. }
  8422. onConstruct() {
  8423. this.n10 = (this.getChild("n10"));
  8424. this.myNode = (this.getChild("myNode"));
  8425. this.t0 = this.getTransition("t0");
  8426. }
  8427. }
  8428. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8429. class UIVideoShare extends UIBase {
  8430. constructor() {
  8431. super();
  8432. this.success = false;
  8433. this.awardNum = 0;
  8434. this.isShared = true;
  8435. }
  8436. onConstructor() {
  8437. this.ui = ui_UIVideoShare.createInstance();
  8438. this.contentPane = this.ui;
  8439. this.isEject = false;
  8440. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8441. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8442. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8443. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8444. }
  8445. show(success) {
  8446. super.show();
  8447. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8448. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8449. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8450. this.success = success;
  8451. let time = xGame.common.randomNum(600, 1500);
  8452. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8453. if (success)
  8454. xGame.soundMgr.playSound("applause");
  8455. this.ui.t0.play();
  8456. this.checkShareState();
  8457. let times = DataMgr.getDailyVideoShareTimes();
  8458. this.awardNum = times == 0 ? 2000 : 200;
  8459. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8460. }
  8461. checkShareState() {
  8462. if (PlatMgr.forceShare == 0) {
  8463. this.ui.myNode.closeBtn.visible = true;
  8464. this.ui.myNode.tipsNode.visible = false;
  8465. this.ui.myNode.closeBtn.x = 90;
  8466. this.ui.myNode.shareBtn.x = 342;
  8467. }
  8468. else if (PlatMgr.forceShare == 1) {
  8469. this.ui.myNode.closeBtn.visible = false;
  8470. this.ui.myNode.tipsNode.visible = true;
  8471. this.ui.myNode.shareBtn.x = 218;
  8472. this.isShared = true;
  8473. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8474. }
  8475. }
  8476. checkForceShare() {
  8477. this.isShared = !this.isShared;
  8478. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8479. }
  8480. videoShare() {
  8481. if (PlatMgr.forceShare == 1) {
  8482. if (this.isShared) {
  8483. this.shareGame();
  8484. }
  8485. else {
  8486. this.hideSelf();
  8487. }
  8488. }
  8489. else {
  8490. this.shareGame();
  8491. }
  8492. }
  8493. shareGame() {
  8494. Moyu.sendDataEvent("VideoShare");
  8495. if (Moyu.canShare() > 100) {
  8496. Moyu.shareGame((success) => {
  8497. if (success) {
  8498. DataMgr.setDailyVideoShareTimes(1);
  8499. DataMgr.setCoin(this.awardNum);
  8500. }
  8501. this.hideSelf();
  8502. }, this);
  8503. }
  8504. else {
  8505. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8506. this.hideSelf();
  8507. }
  8508. }
  8509. hideSelf() {
  8510. this.hide();
  8511. xGame.uiMgr.Show(UIGameEnd, this.success);
  8512. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8513. xGame.common.screenImg.destroy();
  8514. xGame.common.screenImg = null;
  8515. }
  8516. }
  8517. }
  8518. UIVideoShare.uiName = "UIVideoShare";
  8519. class ui_UITips extends fgui.GComponent {
  8520. static createInstance() {
  8521. return (fgui.UIPackage.createObject("game", "UITips"));
  8522. }
  8523. onConstruct() {
  8524. this.n0 = (this.getChild("n0"));
  8525. this.myNode = (this.getChild("myNode"));
  8526. this.t0 = this.getTransition("t0");
  8527. }
  8528. }
  8529. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8530. class UITips extends UIBase {
  8531. constructor() {
  8532. super();
  8533. this.type = 0;
  8534. }
  8535. onConstructor() {
  8536. this.ui = ui_UITips.createInstance();
  8537. this.contentPane = this.ui;
  8538. this.isEject = false;
  8539. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8540. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8541. }
  8542. show(tipsTxt, womanTxt, type) {
  8543. super.show();
  8544. this.ui.t0.play();
  8545. this.ui.myNode.tipsTxt.text = tipsTxt;
  8546. this.ui.myNode.womanTxt.text = womanTxt;
  8547. PlatMgr.showInsert(true);
  8548. this.ui.myNode.c1.selectedIndex = type;
  8549. this.type = type;
  8550. switch (this.type) {
  8551. case TipsType.exitGame:
  8552. xGame.common.gameMgr.gamePause = true;
  8553. break;
  8554. case TipsType.foul:
  8555. Laya.timer.once(200, this, () => {
  8556. xGame.common.gameMgr.gamePause = true;
  8557. });
  8558. break;
  8559. default:
  8560. break;
  8561. }
  8562. }
  8563. clickLeftBtn() {
  8564. this.hide();
  8565. xGame.common.gameMgr.gamePause = false;
  8566. switch (this.type) {
  8567. case TipsType.exitGame:
  8568. break;
  8569. case TipsType.foul:
  8570. break;
  8571. default:
  8572. break;
  8573. }
  8574. }
  8575. clickRightBtn() {
  8576. this.hide();
  8577. switch (this.type) {
  8578. case TipsType.exitGame:
  8579. xGame.eventMgr.event(RESET_GAME);
  8580. xGame.uiMgr.Show(UIMain);
  8581. Moyu.recordEnd(this, null);
  8582. xGame.common.longHelpLine = false;
  8583. break;
  8584. case TipsType.foul:
  8585. xGame.common.gameMgr.gamePause = false;
  8586. Laya.timer.clearAll(this);
  8587. break;
  8588. default:
  8589. break;
  8590. }
  8591. }
  8592. }
  8593. UITips.uiName = "UITips";
  8594. class GameMgr {
  8595. constructor() {
  8596. this.selfCamp = "";
  8597. this.selfFoulNum = 0;
  8598. this.selfBallArr = [];
  8599. this.selfTimer = 0;
  8600. this.selfScore = 0;
  8601. this.aiCamp = "";
  8602. this.aiFoulNum = 0;
  8603. this.aiBallArr = [];
  8604. this.aiTimer = 0;
  8605. this.aiScore = 0;
  8606. this.aiSkillLevelNum = 1;
  8607. this.targertScore = 0;
  8608. this.setTime = 30;
  8609. this.selfTurnRate = 0.5;
  8610. this.accTime = 0;
  8611. this.curFoul = "";
  8612. this.maxFoulTimes = 3;
  8613. this.isFirstInGame = true;
  8614. this.firstColliObj = null;
  8615. this.inHoleBalls = [];
  8616. this.blackNum = 8;
  8617. this.success = false;
  8618. this.holePosList = [];
  8619. this.posObj = {};
  8620. this._selfTurn = false;
  8621. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8622. this.ensureBallType = false;
  8623. this.isOpenBall = true;
  8624. this.finishOneShoot = true;
  8625. this.isEnd = false;
  8626. this.isChangeTurn = false;
  8627. this.isInterrupt = false;
  8628. this.aiPlayedBreakArmy = false;
  8629. this.isTouchedBall = false;
  8630. this.finishBalls = 0;
  8631. this.needBalls = 0;
  8632. this.allBallNum = 0;
  8633. this.placeBallPosData = {};
  8634. this.curHP = 0;
  8635. this.showLongView = false;
  8636. this.firstShoot = true;
  8637. this._gamePause = false;
  8638. this.trunCount = 0;
  8639. this.isBlackInHole = false;
  8640. this.isEnter = true;
  8641. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8642. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8643. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8644. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8645. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8646. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8647. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8648. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8649. }
  8650. get gamePause() {
  8651. return this._gamePause;
  8652. }
  8653. set gamePause(v) {
  8654. if (v) {
  8655. Laya.physicsTimer.pause();
  8656. }
  8657. else {
  8658. Laya.physicsTimer.resume();
  8659. }
  8660. this._gamePause = v;
  8661. }
  8662. get selfTurn() {
  8663. return this._selfTurn;
  8664. }
  8665. set selfTurn(val) {
  8666. this.trunCount++;
  8667. this._selfTurn = val;
  8668. if (val) {
  8669. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8670. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8671. }
  8672. else {
  8673. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8674. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8675. if (this.trunCount > 1)
  8676. PlatMgr.openBox();
  8677. }
  8678. }
  8679. resetGame() {
  8680. this.inHoleBalls = [];
  8681. this.isFirstInGame = true;
  8682. this.firstColliObj = null;
  8683. this.aiCamp = "";
  8684. this.selfCamp = "";
  8685. this.aiFoulNum = 0;
  8686. this.selfFoulNum = 0;
  8687. this.selfBallArr = [];
  8688. this.aiBallArr = [];
  8689. this.gamePause = false;
  8690. this.ensureBallType = false;
  8691. this.isInterrupt = false;
  8692. this.updateLeftBall();
  8693. this.clearTime();
  8694. this.aiPlayedBreakArmy = false;
  8695. this.isBlackInHole = false;
  8696. this.placeBallPosData = {};
  8697. if (xGame.common.d3World.knifeRoot) {
  8698. xGame.common.d3World.knifeRoot.destroyChildren();
  8699. }
  8700. }
  8701. gameReady() {
  8702. this.trunCount = 0;
  8703. this.firstColliObj = null;
  8704. this.isFirstInGame = true;
  8705. this.selfTurn = Math.random() <= this.selfTurnRate;
  8706. let challengeNum = DataMgr.getChallengeTimes();
  8707. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8708. this.selfTurn = true;
  8709. }
  8710. if (xGame.common.gameMode == GameMode.placeBall)
  8711. this.selfTurn = true;
  8712. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8713. this.selfTurn = true;
  8714. }
  8715. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8716. this.checkGuide();
  8717. if (xGame.common.uiRodMethod)
  8718. xGame.common.uiRodMethod.resetRod();
  8719. xGame.common.d2World.getHelpLine();
  8720. this.isOpenBall = true;
  8721. this.isTouchedBall = false;
  8722. xGame.common.aiPlayer.stopRun();
  8723. this.setTime = 30;
  8724. let ui = xGame.common.gameUI.ui;
  8725. switch (xGame.common.gameMode) {
  8726. case GameMode.classic:
  8727. xGame.common.aiPlayer.init();
  8728. this.blackNum = 8;
  8729. this.placeRootBall();
  8730. this.peoplePlay(9, 10);
  8731. ui.wordsBtn.visible = true;
  8732. ui.aiWordsBtn.visible = true;
  8733. xGame.common.talkMgr.changeAIState(true);
  8734. DataMgr.gameData.gameCount++;
  8735. DataMgr.saveGameData();
  8736. break;
  8737. case GameMode.bigMove:
  8738. this.blackNum = -1;
  8739. this.selfScore = 0;
  8740. this.aiScore = 0;
  8741. xGame.common.aiPlayer.init();
  8742. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8743. this.updateSelfScore();
  8744. this.updateAIScore();
  8745. this.updateTargetSroce();
  8746. this.placeRootBall();
  8747. this.peoplePlay(9, 10);
  8748. ui.wordsBtn.visible = true;
  8749. ui.aiWordsBtn.visible = true;
  8750. xGame.common.talkMgr.changeAIState(true);
  8751. if (DataMgr.getSkillGuide() < 1)
  8752. DataMgr.gameData.gameCount = 0;
  8753. else {
  8754. DataMgr.gameData.gameCount++;
  8755. DataMgr.saveGameData();
  8756. PlatMgr.openTry();
  8757. }
  8758. if (xGame.common.d3World.knifeRoot) {
  8759. xGame.common.d3World.knifeRoot.destroyChildren();
  8760. }
  8761. break;
  8762. case GameMode.placeBall:
  8763. this.blackNum = -1;
  8764. this.selfTurn = true;
  8765. this.setTime = 10000;
  8766. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8767. this.curHP = this.placeBallData.hp;
  8768. if (this.placeBallData.ball == -1)
  8769. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  8770. else
  8771. this.needBalls = this.placeBallData.ball;
  8772. console.log("需要的进球数目", this.needBalls);
  8773. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  8774. this.finishBalls = 0;
  8775. this.placeBallPosData = {};
  8776. this.updatePlaceBallPos();
  8777. this.updatePlaceBallState();
  8778. this.finishOneShoot = true;
  8779. xGame.common.gameUI.ui.moveNode.visible = false;
  8780. this.isOpenBall = false;
  8781. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8782. ui.wordsBtn.visible = false;
  8783. ui.aiWordsBtn.visible = false;
  8784. xGame.common.talkMgr.changeAIState(false);
  8785. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  8786. PlatMgr.openBox();
  8787. });
  8788. break;
  8789. default:
  8790. break;
  8791. }
  8792. this.showLongView = false;
  8793. xGame.common.wordsMgr.comboTimes = 1;
  8794. let guide = DataMgr.getSkillGuide();
  8795. if (guide)
  8796. xGame.eventMgr.event(WAIT_SHOOT);
  8797. xGame.common.upSkillLevel = false;
  8798. xGame.common.gameStartTime = new Date().getTime();
  8799. this.firstShoot = true;
  8800. }
  8801. checkGuide() {
  8802. let guide = DataMgr.getSkillGuide();
  8803. let gameUI = xGame.common.gameUI.ui;
  8804. gameUI.guide1.visible = false;
  8805. gameUI.guide2.visible = false;
  8806. gameUI.guide3.visible = false;
  8807. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  8808. this.selfTurn = true;
  8809. }
  8810. else {
  8811. return;
  8812. }
  8813. let oneBall = this.getOneBall();
  8814. gameUI.guide1.visible = true;
  8815. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  8816. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  8817. }
  8818. getOneBall() {
  8819. let arr = xGame.common.d2World.ballArr;
  8820. for (let index = 0; index < arr.length; index++) {
  8821. if (arr[index].number == 0)
  8822. continue;
  8823. return arr[index];
  8824. }
  8825. }
  8826. updateSelfScore() {
  8827. let ui = xGame.common.gameUI.ui.topNode;
  8828. ui.selfScoreTxt.text = this.selfScore + "";
  8829. }
  8830. updateAIScore() {
  8831. let ui = xGame.common.gameUI.ui.topNode;
  8832. ui.aiScoreTxt.text = this.aiScore + "";
  8833. }
  8834. updateTargetSroce() {
  8835. let ui = xGame.common.gameUI.ui.topNode;
  8836. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  8837. }
  8838. updateLeftBall() {
  8839. let topUI = xGame.common.gameUI.ui.topNode;
  8840. topUI.selfBallList.numItems = this.selfBallArr.length;
  8841. topUI.aiBallList.numItems = this.aiBallArr.length;
  8842. }
  8843. ballShoot() {
  8844. this.clearTime();
  8845. this.finishOneShoot = false;
  8846. xGame.common.gameUI.ui.moveNode.visible = false;
  8847. if (xGame.common.gameUI.ui.guideNode.visible) {
  8848. xGame.common.gameUI.ui.guideNode.visible = false;
  8849. }
  8850. if (this.firstShoot) {
  8851. this.firstShoot = false;
  8852. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  8853. }
  8854. }
  8855. ensureCamp(number) {
  8856. this.ensureBallType = true;
  8857. this.isOpenBall = false;
  8858. if (xGame.common.gameMode != GameMode.classic)
  8859. return;
  8860. let full = [1, 2, 3, 4, 5, 6, 7];
  8861. let flower = [9, 10, 11, 12, 13, 14, 15];
  8862. let sayWords = "";
  8863. if (this.selfTurn) {
  8864. if (number <= 7) {
  8865. this.selfCamp = ballCamp.full;
  8866. this.selfBallArr = full;
  8867. this.aiCamp = ballCamp.flower;
  8868. this.aiBallArr = flower;
  8869. sayWords = cfgTable.wordsData[3].msg;
  8870. }
  8871. else {
  8872. this.selfCamp = ballCamp.flower;
  8873. this.selfBallArr = flower;
  8874. this.aiCamp = ballCamp.full;
  8875. this.aiBallArr = full;
  8876. sayWords = cfgTable.wordsData[4].msg;
  8877. }
  8878. }
  8879. else {
  8880. if (number <= 7) {
  8881. this.selfCamp = ballCamp.flower;
  8882. this.selfBallArr = flower;
  8883. this.aiCamp = ballCamp.full;
  8884. this.aiBallArr = full;
  8885. sayWords = cfgTable.wordsData[2].msg;
  8886. }
  8887. else {
  8888. this.selfCamp = ballCamp.full;
  8889. this.selfBallArr = full;
  8890. this.aiCamp = ballCamp.flower;
  8891. this.aiBallArr = flower;
  8892. sayWords = cfgTable.wordsData[1].msg;
  8893. }
  8894. }
  8895. this.updateLeftBall();
  8896. xGame.uiMgr.Show(UIMsg, sayWords);
  8897. }
  8898. updatePlaceBallState() {
  8899. let ui = xGame.common.gameUI.ui;
  8900. switch (this.placeBallData.type) {
  8901. case PlaceBallType.normal:
  8902. let normal = ui.placeNormalNode;
  8903. normal.hpTxt.text = this.curHP + "";
  8904. this.updatePlaceBallStar(normal);
  8905. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  8906. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8907. break;
  8908. case PlaceBallType.challenge:
  8909. let challenge = ui.placeChallengeNode;
  8910. challenge.hpTxt.text = "Shots:" + this.curHP;
  8911. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  8912. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  8913. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  8914. break;
  8915. default:
  8916. break;
  8917. }
  8918. }
  8919. playSubHpAni() {
  8920. let ui = xGame.common.gameUI.ui;
  8921. switch (this.placeBallData.type) {
  8922. case PlaceBallType.normal:
  8923. let normal = ui.placeNormalNode;
  8924. normal.hpTxt.visible = false;
  8925. normal.starAni.c1.selectedIndex = 1;
  8926. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  8927. normal.hpTxt.visible = true;
  8928. normal.starAni.c1.selectedIndex = 0;
  8929. }));
  8930. break;
  8931. default:
  8932. break;
  8933. }
  8934. }
  8935. getEndStarNum() {
  8936. let num;
  8937. let level = xGame.common.placeBallCurLevel;
  8938. if (this.curHP == this.placeBallData.hp) {
  8939. num = 3;
  8940. }
  8941. else if (this.curHP <= 1) {
  8942. num = 1;
  8943. }
  8944. else {
  8945. num = 2;
  8946. }
  8947. if (!this.success) {
  8948. num = 0;
  8949. }
  8950. else {
  8951. DataMgr.setPlaceBallLevel(level, num);
  8952. }
  8953. let myType = cfgTable.placeballData[level].type;
  8954. if (this.success && myType == 1) {
  8955. num = 3;
  8956. }
  8957. xGame.common.placeBallStarNum = num;
  8958. }
  8959. updatePlaceBallStar(node) {
  8960. let star = 0;
  8961. if (this.curHP == this.placeBallData.hp) {
  8962. star = 3;
  8963. }
  8964. else if (this.curHP >= 2) {
  8965. star = 2;
  8966. }
  8967. else if (this.curHP == 1) {
  8968. star = 1;
  8969. }
  8970. else {
  8971. star = 0;
  8972. }
  8973. let temp;
  8974. for (let index = 1; index <= 3; index++) {
  8975. temp = node["star" + index];
  8976. temp.c1.selectedIndex = star >= index ? 1 : 0;
  8977. }
  8978. node.myProgress.value = (star / 3) * 100;
  8979. }
  8980. openRegretView(isFoul, GoalNum, challenge = false) {
  8981. let regretType = -1;
  8982. if (isFoul) {
  8983. regretType = 1;
  8984. }
  8985. else {
  8986. if (GoalNum <= 0) {
  8987. regretType = 0;
  8988. }
  8989. }
  8990. if (challenge) {
  8991. regretType = 1;
  8992. }
  8993. if (regretType != -1) {
  8994. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  8995. if (success) {
  8996. this.curHP++;
  8997. this.updatePlaceBallState();
  8998. this.setPlaceBallAllPos();
  8999. xGame.common.gameUI.ui.moveNode.visible = false;
  9000. }
  9001. else {
  9002. if (this.curHP <= 0) {
  9003. this.success = false;
  9004. this.gameEnd();
  9005. }
  9006. this.playSubHpAni();
  9007. }
  9008. this.updatePlaceBallState();
  9009. this.updatePlaceBallPos();
  9010. });
  9011. }
  9012. }
  9013. setPlaceBallAllPos() {
  9014. let allBall = xGame.common.d2World.ballArr;
  9015. let cfgArr = this.placeBallPosData;
  9016. let temp;
  9017. let obj;
  9018. for (let index = 0; index < allBall.length; index++) {
  9019. temp = allBall[index];
  9020. if (temp.destroyed)
  9021. continue;
  9022. obj = cfgArr[temp.myUNID];
  9023. if (obj && obj.src && !obj.src.destroyed) {
  9024. temp.gameObj.x = obj.posX;
  9025. temp.gameObj.y = obj.posY;
  9026. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9027. }
  9028. }
  9029. xGame.common.d2World.getHelpLine();
  9030. }
  9031. updatePlaceBallPos() {
  9032. let arr = xGame.common.d2World.ballArr;
  9033. let temp;
  9034. for (let index = 0; index < arr.length; index++) {
  9035. temp = arr[index];
  9036. if (!this.placeBallPosData[temp.myUNID]) {
  9037. this.placeBallPosData[temp.myUNID] = {
  9038. src: temp,
  9039. posX: temp.gameObj.x,
  9040. posY: temp.gameObj.y
  9041. };
  9042. }
  9043. else {
  9044. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9045. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9046. }
  9047. }
  9048. let check;
  9049. for (const key in this.placeBallPosData) {
  9050. check = this.placeBallPosData[key];
  9051. if (check.src.destroyed) {
  9052. delete this.placeBallPosData[key];
  9053. }
  9054. }
  9055. }
  9056. gameRun(type) {
  9057. if (this.gamePause)
  9058. return;
  9059. this.curFoul = this.getFoulType();
  9060. if (type) {
  9061. xGame.common.d2World.d2Gan.shoot();
  9062. xGame.common.gameUI.forceCancel();
  9063. this.curFoul = type;
  9064. }
  9065. this.isEnd = false;
  9066. this.isChangeTurn = true;
  9067. if (xGame.common.gameMode == GameMode.classic) {
  9068. this.judgeClassic(this.curFoul);
  9069. this.checkClassicWords(() => {
  9070. xGame.common.destroyClassicEmotion();
  9071. if (this.isEnd) {
  9072. if (this.isBlackInHole) {
  9073. xGame.common.gameUI.ui.blackAni.visible = true;
  9074. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9075. xGame.common.gameUI.ui.blackAni.visible = false;
  9076. this.gameEnd();
  9077. }));
  9078. }
  9079. else {
  9080. this.gameEnd();
  9081. }
  9082. }
  9083. else {
  9084. this.waitShoot();
  9085. xGame.eventMgr.event(WAIT_SHOOT);
  9086. }
  9087. });
  9088. }
  9089. else if (xGame.common.gameMode == GameMode.bigMove) {
  9090. xGame.common.aiPlayer.stopRun();
  9091. let scoreArr = this.getScore(this.curFoul);
  9092. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9093. this.isEnd = true;
  9094. }
  9095. this.checkBigSkillWords(() => {
  9096. if (this.isEnd) {
  9097. this.gameEnd();
  9098. }
  9099. else {
  9100. this.waitShoot();
  9101. xGame.eventMgr.event(WAIT_SHOOT);
  9102. }
  9103. });
  9104. }
  9105. else if (xGame.common.gameMode == GameMode.placeBall) {
  9106. xGame.common.destroyAwardSpine();
  9107. let isFoul = this.curFoul == FoulType.rootHole;
  9108. let GoalNum = this.inHoleBalls.length;
  9109. if (this.inHoleBalls.indexOf(0) > -1)
  9110. GoalNum -= 1;
  9111. if (isFoul) {
  9112. this.placeRootBall();
  9113. }
  9114. console.log("neeballs", this.needBalls);
  9115. console.log("当前完成的goalNum", GoalNum);
  9116. this.finishBalls += GoalNum;
  9117. console.log("当前完成的finishballs", this.finishBalls);
  9118. let need = this.needBalls;
  9119. if (this.placeBallData.type == PlaceBallType.challenge) {
  9120. need += 100;
  9121. }
  9122. if (this.finishBalls >= need) {
  9123. this.success = true;
  9124. this.gameEnd();
  9125. }
  9126. else {
  9127. switch (this.placeBallData.type) {
  9128. case PlaceBallType.normal:
  9129. if (!isFoul && GoalNum > 0) {
  9130. this.updatePlaceBallPos();
  9131. this.updatePlaceBallState();
  9132. }
  9133. else {
  9134. this.curHP--;
  9135. this.openRegretView(isFoul, GoalNum);
  9136. }
  9137. this.waitShoot();
  9138. xGame.eventMgr.event(WAIT_SHOOT);
  9139. break;
  9140. case PlaceBallType.challenge:
  9141. this.curHP--;
  9142. this.updatePlaceBallState();
  9143. if (isFoul) {
  9144. this.openRegretView(isFoul, GoalNum, true);
  9145. }
  9146. else {
  9147. this.updatePlaceBallPos();
  9148. if (this.curHP <= 0) {
  9149. this.success = true;
  9150. this.gameEnd();
  9151. }
  9152. }
  9153. this.waitShoot();
  9154. xGame.eventMgr.event(WAIT_SHOOT);
  9155. break;
  9156. default:
  9157. break;
  9158. }
  9159. }
  9160. }
  9161. }
  9162. checkClassicWords(callback) {
  9163. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9164. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9165. let type = this.getClassicWordsType();
  9166. if (condition && type != -1) {
  9167. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9168. xGame.soundMgr.playSound(str);
  9169. xGame.common.wordsMgr.playClassicWords(type, callback);
  9170. }
  9171. else {
  9172. Laya.timer.once(300, this, () => {
  9173. callback && callback();
  9174. });
  9175. }
  9176. }
  9177. getClassicWordsType() {
  9178. let d2world = xGame.common.d2World;
  9179. let type = -1;
  9180. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9181. type = ClassicWordsType.perfectShow;
  9182. return type;
  9183. }
  9184. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9185. type = ClassicWordsType.directShoot;
  9186. return type;
  9187. }
  9188. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9189. type = ClassicWordsType.anotherShoot;
  9190. return type;
  9191. }
  9192. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9193. type = ClassicWordsType.bigPower;
  9194. return type;
  9195. }
  9196. let minSpeed = 1;
  9197. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9198. type = ClassicWordsType.hardShoot;
  9199. return type;
  9200. }
  9201. if (this.inHoleBalls.length > 0) {
  9202. type = ClassicWordsType.directShoot;
  9203. return type;
  9204. }
  9205. return type;
  9206. }
  9207. checkBigSkillWords(callback) {
  9208. if (this.curFoul == FoulType.timeOut) {
  9209. callback && callback();
  9210. }
  9211. else {
  9212. let playSkill = false;
  9213. if (this.selfTurn) {
  9214. playSkill = true;
  9215. }
  9216. else {
  9217. if (!this.aiPlayedBreakArmy) {
  9218. this.aiPlayedBreakArmy = true;
  9219. playSkill = true;
  9220. }
  9221. if (this.aiCurSkill != SkillType.breakArmy) {
  9222. playSkill = true;
  9223. }
  9224. }
  9225. if (xGame.common.skillMgr.playedLastSkill) {
  9226. xGame.common.skillMgr.playedLastSkill = false;
  9227. playSkill = false;
  9228. }
  9229. if (playSkill) {
  9230. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9231. let selfExtra = 0;
  9232. let aiExtra = 0;
  9233. if (this.selfTurn)
  9234. selfExtra += extraScore;
  9235. else
  9236. aiExtra += extraScore;
  9237. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9238. this.isEnd = true;
  9239. }
  9240. this.playBigSkillTimes(callback);
  9241. });
  9242. }
  9243. else {
  9244. this.playBigSkillTimes(callback);
  9245. }
  9246. }
  9247. }
  9248. playBigSkillTimes(callback) {
  9249. let length = this.inHoleBalls.length;
  9250. if (this.inHoleBalls.indexOf(0) > -1) {
  9251. length = this.inHoleBalls.length - 1;
  9252. }
  9253. if (length <= 0) {
  9254. callback && callback();
  9255. return;
  9256. }
  9257. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9258. callback && callback();
  9259. });
  9260. }
  9261. playSkillTips() {
  9262. let levelNum = 0;
  9263. let curType;
  9264. if (this.selfTurn) {
  9265. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9266. curType = this.selfCurSkill;
  9267. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9268. levelNum += 5;
  9269. }
  9270. }
  9271. else {
  9272. levelNum = this.aiSkillLevelNum;
  9273. curType = this.aiCurSkill;
  9274. }
  9275. let str = ``;
  9276. switch (curType) {
  9277. case SkillType.highSpace:
  9278. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9279. break;
  9280. case SkillType.breakArmy:
  9281. str = `You pocketed ${levelNum} extra balls`;
  9282. break;
  9283. case SkillType.ice:
  9284. str = `${levelNum * 2} extra balls were frozen`;
  9285. break;
  9286. case SkillType.fireworks:
  9287. str = `${levelNum} extra balls exploded `;
  9288. break;
  9289. case SkillType.GuanYu:
  9290. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9291. break;
  9292. default:
  9293. break;
  9294. }
  9295. xGame.uiMgr.Show(UIMsg, str);
  9296. }
  9297. getFoulType() {
  9298. let foulType = "";
  9299. if (this.firstColliObj == null) {
  9300. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9301. return FoulType.rootHole;
  9302. }
  9303. return FoulType.notTouch;
  9304. }
  9305. else {
  9306. if (this.selfTurn) {
  9307. if (this.selfBallArr.length > 0) {
  9308. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9309. foulType = FoulType.wrongTouch;
  9310. }
  9311. }
  9312. else {
  9313. if (this.ensureBallType) {
  9314. }
  9315. else {
  9316. if (this.firstColliObj == this.blackNum) {
  9317. foulType = FoulType.wrongTouch;
  9318. }
  9319. }
  9320. }
  9321. }
  9322. else {
  9323. if (this.aiBallArr.length > 0) {
  9324. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9325. foulType = FoulType.wrongTouch;
  9326. }
  9327. }
  9328. else {
  9329. if (this.ensureBallType) {
  9330. }
  9331. else {
  9332. if (this.firstColliObj == this.blackNum) {
  9333. foulType = FoulType.wrongTouch;
  9334. }
  9335. }
  9336. }
  9337. }
  9338. if (this.inHoleBalls.length <= 0) {
  9339. return foulType;
  9340. }
  9341. let temp;
  9342. if (this.inHoleBalls.indexOf(0) > -1) {
  9343. foulType = FoulType.rootHole;
  9344. }
  9345. else {
  9346. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9347. temp = this.inHoleBalls[index];
  9348. if (this.selfTurn) {
  9349. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9350. foulType = FoulType.wrongHole;
  9351. break;
  9352. }
  9353. }
  9354. else {
  9355. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9356. foulType = FoulType.wrongHole;
  9357. break;
  9358. }
  9359. }
  9360. }
  9361. }
  9362. let foo;
  9363. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9364. temp = this.inHoleBalls[index];
  9365. foo = this.selfBallArr.indexOf(temp);
  9366. if (foo > -1) {
  9367. this.selfBallArr.splice(foo, 1);
  9368. }
  9369. foo = this.aiBallArr.indexOf(temp);
  9370. if (foo > -1) {
  9371. this.aiBallArr.splice(foo, 1);
  9372. }
  9373. }
  9374. this.updateLeftBall();
  9375. }
  9376. return foulType;
  9377. }
  9378. judgeGameEndByBlack(arr) {
  9379. if (this.selfTurn) {
  9380. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9381. this.selfFoulNum = this.maxFoulTimes;
  9382. return true;
  9383. }
  9384. }
  9385. else {
  9386. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9387. this.aiFoulNum = this.maxFoulTimes;
  9388. return true;
  9389. }
  9390. }
  9391. }
  9392. judgeClassic(type) {
  9393. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9394. xGame.common.aiPlayer.stopRun();
  9395. if (this.judgeNormalSuccess()) {
  9396. this.isEnd = true;
  9397. return;
  9398. }
  9399. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9400. if (this.selfTurn) {
  9401. if (isFoul) {
  9402. this.selfFoulNum++;
  9403. }
  9404. if (this.selfFoulNum >= this.maxFoulTimes) {
  9405. this.success = false;
  9406. this.isEnd = true;
  9407. return;
  9408. }
  9409. }
  9410. else {
  9411. if (isFoul)
  9412. this.aiFoulNum++;
  9413. if (this.aiFoulNum >= this.maxFoulTimes) {
  9414. this.success = true;
  9415. this.isEnd = true;
  9416. return;
  9417. }
  9418. }
  9419. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9420. this.isChangeTurn = false;
  9421. }
  9422. else {
  9423. this.isInterrupt = true;
  9424. }
  9425. }
  9426. waitShoot() {
  9427. if (xGame.common.gameMode == GameMode.classic) {
  9428. switch (this.curFoul) {
  9429. case FoulType.timeOut:
  9430. case FoulType.rootHole:
  9431. this.selfTurn = !this.selfTurn;
  9432. this.peoplePlay(5, 6, true);
  9433. break;
  9434. case FoulType.notTouch:
  9435. this.selfTurn = !this.selfTurn;
  9436. this.peoplePlay(7, 7);
  9437. break;
  9438. case FoulType.wrongHole:
  9439. this.selfTurn = !this.selfTurn;
  9440. this.peoplePlay(11, 11);
  9441. break;
  9442. default:
  9443. if (this.inHoleBalls.length > 0) {
  9444. this.peoplePlay(0, 0, false, false);
  9445. }
  9446. else {
  9447. this.selfTurn = !this.selfTurn;
  9448. this.peoplePlay(7, 7);
  9449. }
  9450. break;
  9451. }
  9452. }
  9453. else if (xGame.common.gameMode == GameMode.bigMove) {
  9454. if (this.curFoul == FoulType.timeOut) {
  9455. this.selfTurn = !this.selfTurn;
  9456. this.peoplePlay(14, 15);
  9457. this.placeRootBall();
  9458. }
  9459. else {
  9460. this.selfTurn = !this.selfTurn;
  9461. if (this.curFoul == FoulType.rootHole) {
  9462. this.peoplePlay(12, 13);
  9463. this.placeRootBall();
  9464. }
  9465. else {
  9466. this.peoplePlay(0, 0, false, false);
  9467. }
  9468. }
  9469. }
  9470. else if (xGame.common.gameMode == GameMode.placeBall) {
  9471. this.finishOneShoot = true;
  9472. }
  9473. this.gameResult();
  9474. }
  9475. gameResult() {
  9476. this.firstColliObj = null;
  9477. this.inHoleBalls = [];
  9478. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9479. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9480. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9481. if (xGame.common.uiRodMethod)
  9482. xGame.common.uiRodMethod.resetRod();
  9483. xGame.common.d2World.rootBall.showSelf();
  9484. this.clearIceSkill();
  9485. if (this.selfTurn) {
  9486. PlatMgr.gameInsert();
  9487. }
  9488. xGame.common.d3World.knifeRoot.destroyChildren();
  9489. if (this.selfTurn) {
  9490. xGame.common.gameUI.showHelpLineGuide();
  9491. xGame.common.gameUI.setTurnAlpha(true);
  9492. }
  9493. else {
  9494. xGame.common.gameUI.setTurnAlpha(false);
  9495. }
  9496. }
  9497. getScore(type) {
  9498. let selfAdd = 0;
  9499. let aiAdd = 0;
  9500. if (type == FoulType.timeOut) {
  9501. if (this.selfTurn)
  9502. aiAdd += 3;
  9503. else
  9504. selfAdd += 3;
  9505. }
  9506. else {
  9507. if (this.inHoleBalls.length > 0) {
  9508. if (this.selfTurn) {
  9509. if (type == FoulType.rootHole) {
  9510. aiAdd += 3;
  9511. if (this.inHoleBalls.length - 1 > 0) {
  9512. selfAdd += this.inHoleBalls.length - 1;
  9513. }
  9514. }
  9515. else {
  9516. selfAdd += this.inHoleBalls.length;
  9517. }
  9518. }
  9519. else {
  9520. if (type == FoulType.rootHole) {
  9521. selfAdd += 3;
  9522. if (this.inHoleBalls.length - 1 > 0) {
  9523. aiAdd += this.inHoleBalls.length - 1;
  9524. }
  9525. }
  9526. else {
  9527. aiAdd += this.inHoleBalls.length;
  9528. }
  9529. }
  9530. }
  9531. }
  9532. return [selfAdd, aiAdd];
  9533. }
  9534. judgeScoreEnd(selfAdd, aiAdd) {
  9535. this.selfScore += selfAdd;
  9536. this.aiScore += aiAdd;
  9537. this.updateAIScore();
  9538. this.updateSelfScore();
  9539. if (this.selfScore >= this.targertScore) {
  9540. this.success = true;
  9541. return true;
  9542. }
  9543. if (this.aiScore >= this.targertScore) {
  9544. this.success = false;
  9545. return true;
  9546. }
  9547. let ballArr = xGame.common.d2World.ballArr;
  9548. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9549. if (this.selfScore > this.aiScore) {
  9550. this.success = true;
  9551. return true;
  9552. }
  9553. else if (this.selfScore < this.aiScore) {
  9554. this.success = false;
  9555. return true;
  9556. }
  9557. else {
  9558. if (this.selfTurn) {
  9559. this.success = false;
  9560. }
  9561. else {
  9562. this.success = true;
  9563. }
  9564. return true;
  9565. }
  9566. }
  9567. }
  9568. clearIceSkill() {
  9569. let arr = xGame.common.d2World.ballArr;
  9570. let temp;
  9571. if (this.selfTurn) {
  9572. if (this.selfCurSkill == SkillType.ice) {
  9573. for (let index = 0; index < arr.length; index++) {
  9574. temp = arr[index];
  9575. if (temp.ballFunc == "ice") {
  9576. temp.setBallFunc("normal", "self");
  9577. }
  9578. }
  9579. }
  9580. }
  9581. else {
  9582. if (this.aiCurSkill == SkillType.ice) {
  9583. for (let index = 0; index < arr.length; index++) {
  9584. temp = arr[index];
  9585. if (temp.ballFunc == "ice") {
  9586. temp.setBallFunc("normal", "ai");
  9587. }
  9588. }
  9589. }
  9590. }
  9591. }
  9592. judgeNormalSuccess() {
  9593. if (this.selfTurn) {
  9594. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9595. this.success = true;
  9596. return true;
  9597. }
  9598. }
  9599. else {
  9600. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9601. this.success = false;
  9602. return true;
  9603. }
  9604. }
  9605. }
  9606. gameEnd() {
  9607. if (Moyu.isTT) {
  9608. xGame.common.screenImg = getScreenImg();
  9609. }
  9610. console.log("游戏结束", this.success);
  9611. xGame.common.aiPlayer.stopRun();
  9612. if (xGame.common.gameMode == GameMode.placeBall) {
  9613. this.getEndStarNum();
  9614. this.updatePlaceBallState();
  9615. }
  9616. this.isEnter = false;
  9617. Moyu.recordEnd(this, () => {
  9618. if (this.isEnter)
  9619. return;
  9620. this.isEnter = true;
  9621. console.log("进入录结束回调");
  9622. this.enterNext();
  9623. });
  9624. Laya.timer.once(1000, this, () => {
  9625. if (this.isEnter)
  9626. return;
  9627. this.isEnter = true;
  9628. this.enterNext();
  9629. });
  9630. xGame.common.longHelpLine = false;
  9631. }
  9632. enterNext() {
  9633. Laya.timer.clearAll(this);
  9634. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9635. xGame.uiMgr.Show(UIVideoShare, this.success);
  9636. }
  9637. else {
  9638. xGame.uiMgr.Show(UIGameEnd, this.success);
  9639. }
  9640. }
  9641. aiLeave() {
  9642. let ui = xGame.common.gameUI.ui;
  9643. ui.topNode.aiNameTxt.text = "offline";
  9644. }
  9645. aiGameEnd(suc) {
  9646. this.success = suc;
  9647. xGame.common.aiPlayer.stopRun();
  9648. if (this.success) {
  9649. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9650. Laya.timer.once(1000, this, () => {
  9651. this.clearTime();
  9652. this.gameEnd();
  9653. });
  9654. }
  9655. }
  9656. openTimer() {
  9657. let src = xGame.common.gameUI;
  9658. if (this.selfTurn) {
  9659. src.ui.topNode.selfProgress.visible = true;
  9660. src.ui.topNode.aiProgress.visible = false;
  9661. this.curTimer = src.ui.topNode.selfProgress;
  9662. }
  9663. else {
  9664. src.ui.topNode.selfProgress.visible = false;
  9665. src.ui.topNode.aiProgress.visible = true;
  9666. this.curTimer = src.ui.topNode.aiProgress;
  9667. }
  9668. this.accTime = 0;
  9669. Laya.timer.clearAll(this);
  9670. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9671. this.curTimer.value = 100;
  9672. }
  9673. updateTime(dt) {
  9674. if (this.gamePause)
  9675. return;
  9676. this.accTime += dt;
  9677. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9678. if (this.accTime >= this.setTime) {
  9679. this.clearTime();
  9680. console.log("时钟进入了gameRun");
  9681. this.gameRun(FoulType.timeOut);
  9682. }
  9683. }
  9684. clearTime() {
  9685. let src = xGame.common.gameUI;
  9686. src.ui.topNode.selfProgress.visible = false;
  9687. src.ui.topNode.aiProgress.visible = false;
  9688. Laya.timer.clearAll(this);
  9689. }
  9690. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9691. let ui = xGame.common.gameUI.ui;
  9692. let selfMsg, aiMsg;
  9693. if (sayWords) {
  9694. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9695. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9696. if (Foul) {
  9697. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9698. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9699. this.placeRootBall();
  9700. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9701. if (this.curFoul == FoulType.rootHole) {
  9702. if (!DataMgr.getRootBallFoul()) {
  9703. DataMgr.setRootBallFoul();
  9704. aiMsg = "";
  9705. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9706. let woman = "Boss, pay attention next time~";
  9707. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9708. }
  9709. }
  9710. else if (this.curFoul == FoulType.timeOut) {
  9711. if (!DataMgr.getTimeoutFoul()) {
  9712. DataMgr.setTimeoutFoul();
  9713. aiMsg = "";
  9714. let tips = "Game timeout, 3 fouls, this game failed.";
  9715. let woman = "Boss, pay attention to the timeline~";
  9716. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9717. }
  9718. }
  9719. }
  9720. }
  9721. }
  9722. if (this.selfTurn) {
  9723. if (sayWords) {
  9724. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9725. ui.selfTurn.visible = true;
  9726. ui.aiTurn.visible = false;
  9727. ui.selfTurn.t0.play();
  9728. Moyu.vibration();
  9729. });
  9730. }
  9731. }
  9732. else {
  9733. let aiNum = xGame.tools.random(1, 11);
  9734. let challengeNum = DataMgr.getChallengeTimes();
  9735. let delay = false;
  9736. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9737. aiNum = 9;
  9738. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9739. aiNum = 3;
  9740. if (challengeNum == 3) {
  9741. if (!this.showLongView) {
  9742. this.showLongView = true;
  9743. delay = true;
  9744. }
  9745. }
  9746. }
  9747. }
  9748. if (delay) {
  9749. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9750. if (success) {
  9751. xGame.common.longHelpLine = true;
  9752. xGame.common.d2World.getHelpLine();
  9753. }
  9754. else {
  9755. aiNum = 10;
  9756. }
  9757. xGame.common.aiPlayer.setAiLevel(aiNum);
  9758. if (sayWords) {
  9759. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9760. xGame.common.aiPlayer.runAI();
  9761. ui.selfTurn.visible = false;
  9762. ui.aiTurn.visible = true;
  9763. ui.aiTurn.t0.play();
  9764. });
  9765. }
  9766. else {
  9767. xGame.common.aiPlayer.runAI();
  9768. }
  9769. this.openTimer();
  9770. this.finishOneShoot = true;
  9771. if (this.selfTurn) {
  9772. ui.topNode.selfKuang.visible = true;
  9773. ui.topNode.aiKuang.visible = false;
  9774. ui.topNode.selfTips.visible = true;
  9775. ui.topNode.aiTips.visible = false;
  9776. }
  9777. else {
  9778. ui.topNode.selfKuang.visible = false;
  9779. ui.topNode.aiKuang.visible = true;
  9780. ui.topNode.selfTips.visible = false;
  9781. ui.topNode.aiTips.visible = true;
  9782. }
  9783. });
  9784. return;
  9785. }
  9786. if (xGame.common.gameMode == GameMode.classic) {
  9787. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  9788. if (cfg) {
  9789. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  9790. aiNum = aiLevel;
  9791. }
  9792. }
  9793. xGame.common.aiPlayer.setAiLevel(aiNum);
  9794. if (sayWords) {
  9795. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  9796. xGame.common.aiPlayer.runAI();
  9797. ui.selfTurn.visible = false;
  9798. ui.aiTurn.visible = true;
  9799. ui.aiTurn.t0.play();
  9800. });
  9801. }
  9802. else {
  9803. xGame.common.aiPlayer.runAI();
  9804. }
  9805. }
  9806. this.openTimer();
  9807. this.finishOneShoot = true;
  9808. if (this.selfTurn) {
  9809. ui.topNode.selfKuang.visible = true;
  9810. ui.topNode.aiKuang.visible = false;
  9811. ui.topNode.selfTips.visible = true;
  9812. ui.topNode.aiTips.visible = false;
  9813. }
  9814. else {
  9815. ui.topNode.selfKuang.visible = false;
  9816. ui.topNode.aiKuang.visible = true;
  9817. ui.topNode.selfTips.visible = false;
  9818. ui.topNode.aiTips.visible = true;
  9819. }
  9820. }
  9821. placeRootBall() {
  9822. let rootBall = xGame.common.d2World.rootBall;
  9823. if (!rootBall)
  9824. return;
  9825. rootBall.gameObj.x = this.lastRootBallPos.x;
  9826. rootBall.gameObj.y = this.lastRootBallPos.y;
  9827. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  9828. let moveNode = xGame.common.gameUI.ui.moveNode;
  9829. moveNode.visible = true;
  9830. moveNode.x = this.lastRootBallPos.x;
  9831. moveNode.y = this.lastRootBallPos.y;
  9832. if (!this.selfTurn) {
  9833. xGame.common.aiPlayer.resetRoot();
  9834. }
  9835. }
  9836. }
  9837. class ui_guanyuAni extends fgui.GComponent {
  9838. static createInstance() {
  9839. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  9840. }
  9841. onConstruct() {
  9842. this.n0 = (this.getChild("n0"));
  9843. }
  9844. }
  9845. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  9846. class UIFireworks extends UIBase {
  9847. constructor() {
  9848. super();
  9849. }
  9850. onConstructor() {
  9851. this.isEject = false;
  9852. }
  9853. show(callback) {
  9854. super.show();
  9855. }
  9856. }
  9857. UIFireworks.uiName = "UIFireworks";
  9858. class ui_UIGuanYu extends fgui.GComponent {
  9859. static createInstance() {
  9860. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  9861. }
  9862. onConstruct() {
  9863. this.n2 = (this.getChild("n2"));
  9864. this.n1 = (this.getChild("n1"));
  9865. this.n3 = (this.getChild("n3"));
  9866. this.n4 = (this.getChild("n4"));
  9867. this.n5 = (this.getChild("n5"));
  9868. this.n6 = (this.getChild("n6"));
  9869. this.n8 = (this.getChild("n8"));
  9870. this.n7 = (this.getChild("n7"));
  9871. this.t0 = this.getTransition("t0");
  9872. }
  9873. }
  9874. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  9875. class UIGuanYu extends UIBase {
  9876. constructor() {
  9877. super();
  9878. }
  9879. onConstructor() {
  9880. this.ui = ui_UIGuanYu.createInstance();
  9881. this.contentPane = this.ui;
  9882. this.isEject = false;
  9883. }
  9884. show(callback) {
  9885. super.show();
  9886. this.ui.t0.play(Laya.Handler.create(this, () => {
  9887. callback && callback();
  9888. this.hide();
  9889. }));
  9890. }
  9891. }
  9892. UIGuanYu.uiName = "UIGuanYu";
  9893. class SkillMgr {
  9894. constructor() {
  9895. this.leveNum = 0;
  9896. this.extraScore = 0;
  9897. this.selfTurn = false;
  9898. this.playedLastSkill = false;
  9899. this.tweenArr = [];
  9900. this._finishNum = 0;
  9901. this._curFinish = 0;
  9902. this._rootX = 0;
  9903. this._rootY = 0;
  9904. this.knifeTimes = 0;
  9905. this.knifeV2 = new Laya.Vector2();
  9906. this.knifeV3 = new Laya.Vector3();
  9907. this.rtStarX = 0;
  9908. this.rtStarY = 0;
  9909. this.addBigSkillSpine();
  9910. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9911. }
  9912. addBigSkillSpine() {
  9913. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  9914. console.log("extra2 success");
  9915. });
  9916. }
  9917. runBigSkill(callback) {
  9918. this.tweenArr = [];
  9919. this.callback = callback;
  9920. this.judgeSkill();
  9921. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  9922. let guide = DataMgr.getSkillGuide();
  9923. if (!xGame.common.gameMgr.selfTurn) {
  9924. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  9925. }
  9926. else {
  9927. if (xGame.common.temSelfLevel != 0) {
  9928. this.leveNum = xGame.common.temSelfLevel;
  9929. }
  9930. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9931. this.leveNum += 5;
  9932. }
  9933. }
  9934. if (guide == 0) {
  9935. DataMgr.setSkillGuide(1);
  9936. if (DataMgr.getNewUser()) {
  9937. Moyu.sendDataEvent("gameFirstPlay");
  9938. DataMgr.setNewUser();
  9939. }
  9940. }
  9941. this.playSpineAni(() => {
  9942. switch (this.curSkill) {
  9943. case SkillType.highSpace:
  9944. this.runHighSpace();
  9945. break;
  9946. case SkillType.breakArmy:
  9947. this.runBreakArmy();
  9948. break;
  9949. case SkillType.ice:
  9950. this.runIce();
  9951. break;
  9952. case SkillType.fireworks:
  9953. this.runFireworks();
  9954. break;
  9955. case SkillType.GuanYu:
  9956. this.runGuanYu();
  9957. break;
  9958. default:
  9959. break;
  9960. }
  9961. });
  9962. }
  9963. judgeSkill() {
  9964. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  9965. let gameMgr = xGame.common.gameMgr;
  9966. let type;
  9967. for (let index = 0; index < typeArr.length; index++) {
  9968. type = typeArr[index];
  9969. if (gameMgr.selfTurn) {
  9970. if (gameMgr.selfCurSkill == type) {
  9971. this.selfTurn = true;
  9972. this.curSkill = type;
  9973. return;
  9974. }
  9975. }
  9976. else {
  9977. if (gameMgr.aiCurSkill == type) {
  9978. this.selfTurn = false;
  9979. this.curSkill = type;
  9980. return;
  9981. }
  9982. }
  9983. }
  9984. }
  9985. playSpineAni(callback) {
  9986. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  9987. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  9988. parent.destroyChildren();
  9989. let aniIndex = 0;
  9990. let skillSpine;
  9991. switch (this.curSkill) {
  9992. case SkillType.highSpace:
  9993. aniIndex = 1;
  9994. xGame.soundMgr.playSound("skill01");
  9995. skillSpine = this.skillSpine2;
  9996. data.scaleX = 0.5;
  9997. data.scaleY = 0.5;
  9998. skillSpine.play(data, 1, false, parent, () => {
  9999. callback && callback();
  10000. });
  10001. break;
  10002. case SkillType.breakArmy:
  10003. aniIndex = 2;
  10004. xGame.soundMgr.playSound("skill02");
  10005. skillSpine = this.skillSpine2;
  10006. data.scaleX = 0.5;
  10007. data.scaleY = 0.5;
  10008. skillSpine.play(data, 2, false, parent, () => {
  10009. callback && callback();
  10010. });
  10011. break;
  10012. case SkillType.ice:
  10013. aniIndex = 0;
  10014. xGame.soundMgr.playSound("skill03");
  10015. skillSpine = this.skillSpine2;
  10016. data.scaleX = 0.5;
  10017. data.scaleY = 0.5;
  10018. skillSpine.play(data, 0, false, parent, () => {
  10019. callback && callback();
  10020. });
  10021. break;
  10022. case SkillType.fireworks:
  10023. xGame.soundMgr.playSound("skill_04_01");
  10024. xGame.soundMgr.playSound("skill04");
  10025. xGame.uiMgr.Show(UIFireworks, callback);
  10026. break;
  10027. case SkillType.GuanYu:
  10028. xGame.soundMgr.playSound("skill05_1");
  10029. xGame.soundMgr.playSound("skill05");
  10030. xGame.uiMgr.Show(UIGuanYu, callback);
  10031. break;
  10032. default:
  10033. break;
  10034. }
  10035. }
  10036. getAllBallArr() {
  10037. let arr = xGame.common.d2World.ballArr;
  10038. let outArr = [];
  10039. for (let index = 0; index < arr.length; index++) {
  10040. if (arr[index] instanceof D2RootBallSrc)
  10041. continue;
  10042. if (arr[index].ballFunc == "ice")
  10043. continue;
  10044. if (arr[index].destroyed)
  10045. continue;
  10046. outArr.push(arr[index]);
  10047. }
  10048. return outArr;
  10049. }
  10050. getOneArr(deletObj) {
  10051. let allArr = this.getAllBallArr();
  10052. let temp;
  10053. for (let index = 0; index < allArr.length; index++) {
  10054. temp = allArr[index];
  10055. if (temp.id == deletObj.id) {
  10056. allArr.splice(index, 1);
  10057. break;
  10058. }
  10059. }
  10060. return allArr;
  10061. }
  10062. getNearBallBag(ball) {
  10063. let ui = xGame.common.gameUI.ui;
  10064. let circleArr = [];
  10065. for (let index = 1; index <= 6; index++) {
  10066. circleArr.push(ui.border["circle" + index]);
  10067. }
  10068. let outIndex = 0;
  10069. let temp;
  10070. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10071. ;
  10072. let dis = 0;
  10073. for (let index = 1; index < circleArr.length; index++) {
  10074. temp = circleArr[index];
  10075. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10076. if (dis < min) {
  10077. min = dis;
  10078. outIndex = index;
  10079. }
  10080. }
  10081. return [circleArr[outIndex], outIndex];
  10082. }
  10083. ballFlyToBag(ballArr, time = 300) {
  10084. let temp;
  10085. let hole;
  10086. this._finishNum = ballArr.length;
  10087. this._curFinish = 0;
  10088. let holeObj = {};
  10089. let holeCfg = {
  10090. "1": 0,
  10091. "2": 0,
  10092. "3": 0,
  10093. "4": 0,
  10094. "5": 0,
  10095. "6": 0
  10096. };
  10097. for (let index = 0; index < ballArr.length; index++) {
  10098. temp = ballArr[index];
  10099. temp.outColli.isSensor = true;
  10100. temp.innerColli.isSensor = true;
  10101. temp.isRunSkillAni = true;
  10102. let holeArr = this.getNearBallBag(temp);
  10103. hole = holeArr[0];
  10104. holeObj[index] = holeArr[1];
  10105. temp.d3BallSrc.scaleXYZ = 0.5;
  10106. this.tweenArr.push(temp.d3BallSrc, temp);
  10107. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10108. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10109. }));
  10110. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10111. let mIndex = holeObj[this._curFinish];
  10112. let isDone = holeCfg[mIndex];
  10113. if (isDone) {
  10114. ballArr[this._curFinish].checkWrongBall(false);
  10115. }
  10116. else {
  10117. holeCfg[mIndex] = 1;
  10118. ballArr[this._curFinish].checkWrongBall();
  10119. }
  10120. this._curFinish++;
  10121. if (this._curFinish >= this._finishNum) {
  10122. if (this.curSkill == SkillType.highSpace) {
  10123. }
  10124. else if (this.curSkill == SkillType.breakArmy) {
  10125. let rootBall = xGame.common.d2World.rootBall;
  10126. rootBall.gameObj.x = this._rootX;
  10127. rootBall.gameObj.y = this._rootY;
  10128. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10129. xGame.common.d2World.d2Gan.ui.visible = true;
  10130. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10131. xGame.common.d2World.getHelpLine();
  10132. this.callback && this.callback(this.extraScore);
  10133. }
  10134. }
  10135. }));
  10136. }
  10137. }
  10138. runHighSpace() {
  10139. let rootBall = xGame.common.d2World.rootBall;
  10140. rootBall.showSelf();
  10141. let d3Src = rootBall.d3BallSrc;
  10142. let allArr = this.getAllBallArr();
  10143. if (allArr.length <= 0) {
  10144. this.callback && this.callback(0);
  10145. return;
  10146. }
  10147. let selectBall = xGame.common.d2World.targetBall;
  10148. let wrong = selectBall && selectBall.destroyed;
  10149. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10150. selectBall = xGame.common.getRandArrEle(allArr);
  10151. }
  10152. let targetD3Src = selectBall.d3BallSrc;
  10153. xGame.common.d2World.d2Gan.ui.visible = false;
  10154. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10155. d3Src.scaleXYZ = 0.5;
  10156. this.tweenArr.push(d3Src);
  10157. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10158. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10159. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10160. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10161. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10162. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10163. let outArr = [selectBall];
  10164. let other = this.leveNum - 1;
  10165. if (other > 0) {
  10166. let nearArr = this.getOneArr(selectBall);
  10167. if (nearArr.length > 0) {
  10168. xGame.common.botherArr(nearArr);
  10169. if (other >= nearArr.length)
  10170. other = nearArr.length;
  10171. for (let index = 0; index < other; index++) {
  10172. outArr.push(nearArr[index]);
  10173. }
  10174. }
  10175. }
  10176. xGame.common.extraMoveNum = other + 1;
  10177. this.extraScore = other + 1;
  10178. this._rootX = selectBall.gameObj.x;
  10179. this._rootY = selectBall.gameObj.y;
  10180. rootBall.gameObj.x = this._rootX;
  10181. rootBall.gameObj.y = this._rootY;
  10182. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10183. Laya.Tween.clearAll(d3Src);
  10184. this.addRandomForce(outArr);
  10185. }));
  10186. }));
  10187. }
  10188. addRandomForce(outArr) {
  10189. if (outArr.length > 0) {
  10190. xGame.common.d2World.openCheckStill = true;
  10191. this.playedLastSkill = true;
  10192. }
  10193. let temp;
  10194. for (let index = 0; index < outArr.length; index++) {
  10195. let angle = xGame.common.randomNum(0, 360);
  10196. let linearPercent = xGame.common.randomNum(65, 100);
  10197. temp = outArr[index];
  10198. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10199. }
  10200. }
  10201. setLinearSpeed(angle, rigy, linearPercent) {
  10202. let sin = Math.sin(angle * Math.PI / 180);
  10203. let cos = Math.cos(angle * Math.PI / 180);
  10204. let maxSpeed = 4;
  10205. let speed = new Laya.Vector2();
  10206. speed.x = maxSpeed * linearPercent * sin;
  10207. speed.y = -maxSpeed * linearPercent * cos;
  10208. rigy.applyLinearImpulseToCenter(speed);
  10209. }
  10210. runBreakArmy() {
  10211. xGame.common.d2World.d2Gan.ui.visible = false;
  10212. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10213. let gameUI = xGame.common.gameUI.ui;
  10214. gameUI.skillRod.visible = true;
  10215. gameUI.skillRod.rotation = 110;
  10216. let outArr = this.getAllBallArr();
  10217. if (outArr.length <= 0) {
  10218. gameUI.skillRod.visible = false;
  10219. this.callback && this.callback(0);
  10220. return;
  10221. }
  10222. xGame.common.botherArr(outArr);
  10223. if (this.leveNum >= outArr.length)
  10224. this.leveNum = outArr.length;
  10225. let deleteNum = outArr.length - this.leveNum;
  10226. outArr.splice(0, deleteNum);
  10227. this.extraScore = this.leveNum;
  10228. let potX = gameUI.skillRod.x;
  10229. let potY = gameUI.skillRod.y;
  10230. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10231. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10232. let disArr = [];
  10233. for (let index = 0; index < outArr.length; index++) {
  10234. let obj = outArr[index];
  10235. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10236. dis = Math.pow(dis, 0.5);
  10237. disArr.push(dis);
  10238. }
  10239. this.tweenArr.push(gameUI.skillRod);
  10240. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10241. })).update = Laya.Handler.create(this, (e, t, c) => {
  10242. let angle = gameUI.skillRod.rotation;
  10243. let xx;
  10244. let yy;
  10245. let temp;
  10246. for (let index = 0; index < outArr.length; index++) {
  10247. temp = outArr[index];
  10248. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10249. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10250. yy -= 20;
  10251. temp.gameObj.x = xx;
  10252. temp.gameObj.y = yy;
  10253. temp.d3BallSrc.setTransPos(xx, yy);
  10254. }
  10255. if (angle <= 60) {
  10256. Laya.Tween.clearAll(gameUI.skillRod);
  10257. this.ballFlyToBag(outArr, 150);
  10258. gameUI.skillRod.visible = false;
  10259. }
  10260. }, null, false);
  10261. }
  10262. runIce() {
  10263. let ballArr = xGame.common.d2World.ballArr;
  10264. this.leveNum *= 2;
  10265. if (this.leveNum >= ballArr.length - 1)
  10266. this.leveNum = ballArr.length - 1;
  10267. let tempArr = [];
  10268. let outArr = [];
  10269. for (let index = 0; index < ballArr.length; index++) {
  10270. if (ballArr[index] instanceof D2RootBallSrc)
  10271. continue;
  10272. tempArr.push(ballArr[index]);
  10273. }
  10274. if (tempArr.length <= 0) {
  10275. this.callback && this.callback(0);
  10276. return;
  10277. }
  10278. xGame.common.botherArr(tempArr);
  10279. for (let index = 0; index < this.leveNum; index++) {
  10280. outArr.push(tempArr[index]);
  10281. }
  10282. this.extraScore = this.leveNum;
  10283. let temp;
  10284. for (let index = 0; index < outArr.length; index++) {
  10285. temp = outArr[index];
  10286. temp.d3BallSrc.playIceEft();
  10287. }
  10288. Laya.timer.once(2000, this, () => {
  10289. for (let index = 0; index < outArr.length; index++) {
  10290. temp = outArr[index];
  10291. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10292. temp.setBallFunc("ice", str);
  10293. }
  10294. this.callback && this.callback(0);
  10295. });
  10296. }
  10297. runFireworks() {
  10298. let allArr = this.getAllBallArr();
  10299. if (allArr.length <= 0) {
  10300. this.callback && this.callback(0);
  10301. return;
  10302. }
  10303. xGame.common.d2World.d2Gan.ui.visible = false;
  10304. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10305. let outArr = [];
  10306. let other = this.leveNum;
  10307. if (other > 0) {
  10308. if (allArr.length > 0) {
  10309. xGame.common.botherArr(allArr);
  10310. if (other >= allArr.length)
  10311. other = allArr.length;
  10312. for (let index = 0; index < other; index++) {
  10313. outArr.push(allArr[index]);
  10314. }
  10315. }
  10316. }
  10317. xGame.common.extraMoveNum = other;
  10318. this.extraScore = other;
  10319. this.addRandmomFireworks(outArr);
  10320. }
  10321. addRandmomFireworks(outArr) {
  10322. Laya.timer.once(1100, this, () => {
  10323. if (outArr.length > 0) {
  10324. xGame.common.d2World.openCheckStill = true;
  10325. this.playedLastSkill = true;
  10326. }
  10327. });
  10328. xGame.soundMgr.playSound("skill_04_02");
  10329. let temp;
  10330. let delay = -200;
  10331. for (let index = 0; index < outArr.length; index++) {
  10332. temp = outArr[index];
  10333. delay += 200;
  10334. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10335. let angle = xGame.common.randomNum(0, 360);
  10336. angle = this.getFireworksAngle(obj);
  10337. let linearPercent = xGame.common.randomNum(45, 80);
  10338. if (!obj.destroyed)
  10339. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10340. });
  10341. }
  10342. }
  10343. getFireworksAngle(obj) {
  10344. let rootBall = xGame.common.d2World.rootBall;
  10345. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10346. }
  10347. resetGame() {
  10348. Laya.timer.clearAll(this);
  10349. if (this.tweenArr) {
  10350. for (let index = 0; index < this.tweenArr.length; index++) {
  10351. Laya.Tween.clearAll(this.tweenArr[index]);
  10352. }
  10353. }
  10354. this.tweenArr = null;
  10355. }
  10356. runGuanYu() {
  10357. xGame.common.d2World.d2Gan.ui.visible = false;
  10358. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10359. let rootBall = xGame.common.d2World.rootBall;
  10360. if (rootBall.isInHole) {
  10361. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10362. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10363. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10364. rootBall.showSelf();
  10365. }
  10366. this.rtStarX = rootBall.gameObj.x;
  10367. this.rtStarY = rootBall.gameObj.y;
  10368. this.knifeTimes = 0;
  10369. this.playedLastSkill = true;
  10370. rootBall.forceRun = true;
  10371. rootBall.rigy.type = "static";
  10372. xGame.common.d2World.openCheckStill = true;
  10373. this.guanyuRandomKnife();
  10374. }
  10375. guanyuRandomKnife() {
  10376. let rootBall = xGame.common.d2World.rootBall;
  10377. let dir = this.getRandDir();
  10378. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10379. console.log("当前angle", angle);
  10380. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10381. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10382. let dis = 324;
  10383. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10384. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10385. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10386. this.rtStarX = rootBall.gameObj.x;
  10387. this.rtStarY = rootBall.gameObj.y;
  10388. this.knifeTimes++;
  10389. let skillLevel;
  10390. if (xGame.common.gameMgr.selfTurn) {
  10391. skillLevel = DataMgr.getBigSkillByIndex(4);
  10392. }
  10393. else {
  10394. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10395. }
  10396. if (!skillLevel)
  10397. skillLevel = 1;
  10398. skillLevel += 2;
  10399. if (this.knifeTimes < skillLevel) {
  10400. Laya.timer.once(400, this, () => {
  10401. this.guanyuRandomKnife();
  10402. });
  10403. }
  10404. else {
  10405. rootBall.forceRun = false;
  10406. rootBall.rigy.type = "dynamic";
  10407. xGame.common.extraMoveNum = skillLevel;
  10408. }
  10409. }));
  10410. }
  10411. getRandDir() {
  10412. let rootBall = xGame.common.d2World.rootBall;
  10413. let allBall = this.getAllBallArr();
  10414. let target = xGame.common.getRandArrEle(allBall);
  10415. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10416. return this.knifeV2;
  10417. }
  10418. cloneKnife(x, y, rotation) {
  10419. let parent = xGame.common.d3World.knifeRoot;
  10420. let prefab = xGame.common.d3World.knife;
  10421. let clone = prefab.clone();
  10422. parent.addChild(clone);
  10423. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10424. clone.transform.localPositionX = this.knifeV3.x;
  10425. clone.transform.localPositionY = 0;
  10426. clone.transform.localPositionZ = this.knifeV3.z;
  10427. clone.transform.localRotationEulerX = 0;
  10428. clone.transform.localRotationEulerY = rotation;
  10429. clone.transform.localRotationEulerZ = 0;
  10430. clone.active = true;
  10431. return clone;
  10432. }
  10433. cloneGuanYuEft(x, y, angle) {
  10434. return;
  10435. let parent = xGame.common.gameUI.ui.guanyuNode;
  10436. let eft = new ui_guanyuAni();
  10437. eft.parent = parent;
  10438. eft.x = x;
  10439. eft.y = y;
  10440. eft.rotation = angle;
  10441. }
  10442. }
  10443. class ui_UIWordsList extends fgui.GComponent {
  10444. static createInstance() {
  10445. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10446. }
  10447. onConstruct() {
  10448. this.c1 = this.getController("c1");
  10449. this.n74 = (this.getChild("n74"));
  10450. this.clickNode = (this.getChild("clickNode"));
  10451. this.myNode = (this.getChild("myNode"));
  10452. this.n68 = (this.getChild("n68"));
  10453. this.n66 = (this.getChild("n66"));
  10454. this.n55 = (this.getChild("n55"));
  10455. this.wordsBtn = (this.getChild("wordsBtn"));
  10456. this.emotionBtn = (this.getChild("emotionBtn"));
  10457. this.mybggg = (this.getChild("mybggg"));
  10458. this.wordsList = (this.getChild("wordsList"));
  10459. this.emotionList = (this.getChild("emotionList"));
  10460. this.myRoot = (this.getChild("myRoot"));
  10461. }
  10462. }
  10463. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10464. class EmotionDisplay {
  10465. constructor(index, ui) {
  10466. this.ui = ui;
  10467. this.index = index;
  10468. this.ui.onClick(this, this.clickSelf);
  10469. this.updateSelf();
  10470. }
  10471. updateSelf() {
  10472. let data = cfgTable.emotionData[this.index + 1];
  10473. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10474. }
  10475. clickSelf() {
  10476. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10477. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10478. xGame.common.talkMgr.closeTalkView();
  10479. }
  10480. }
  10481. class WordsDisplay {
  10482. constructor(index, ui) {
  10483. this.ui = ui;
  10484. this.index = index;
  10485. this.ui.onClick(this, this.clickSelf);
  10486. this.updateSelf();
  10487. }
  10488. updateSelf() {
  10489. let data = cfgTable.talkwordsData[this.index + 1];
  10490. this.ui.txt.text = data.msg;
  10491. }
  10492. clickSelf() {
  10493. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10494. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10495. xGame.common.talkMgr.closeTalkView();
  10496. }
  10497. }
  10498. class UIWordsList extends UIBase {
  10499. constructor() {
  10500. super();
  10501. }
  10502. onConstructor() {
  10503. this.ui = ui_UIWordsList.createInstance();
  10504. this.contentPane = this.ui;
  10505. this.isEject = false;
  10506. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10507. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10508. this.addUIClick(this.ui.clickNode, this.hide);
  10509. this.initTalkList();
  10510. this.initEmotionList();
  10511. }
  10512. show() {
  10513. super.show();
  10514. }
  10515. initTalkList() {
  10516. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10517. let data = cfgTable.talkwordsData;
  10518. let length = Object.keys(data).length;
  10519. this.ui.wordsList.numItems = length;
  10520. }
  10521. initEmotionList() {
  10522. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10523. let data = cfgTable.emotionData;
  10524. let length = Object.keys(data).length;
  10525. this.ui.emotionList.numItems = length;
  10526. }
  10527. renderTalkItem(index, obj) {
  10528. let temp = new WordsDisplay(index, obj);
  10529. }
  10530. renderEmotionItem(index, obj) {
  10531. let temp = new EmotionDisplay(index, obj);
  10532. }
  10533. openTalkList() {
  10534. this.ui.c1.selectedIndex = 0;
  10535. }
  10536. openEmotionList() {
  10537. this.ui.c1.selectedIndex = 1;
  10538. }
  10539. }
  10540. UIWordsList.uiName = "UIWordsList";
  10541. class TalkMgr {
  10542. constructor() {
  10543. this.aiSpeak = true;
  10544. this.emotionList = [];
  10545. this.talkList = [];
  10546. this.addEvent();
  10547. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10548. this.emotionList = [];
  10549. this.talkList = [];
  10550. for (let k in cfgTable.emotionData) {
  10551. this.emotionList.push(cfgTable.emotionData[k].id);
  10552. }
  10553. for (let k in cfgTable.talkwordsData) {
  10554. this.talkList.push(cfgTable.talkwordsData[k].id);
  10555. }
  10556. }
  10557. addEvent() {
  10558. let ui = xGame.common.gameUI.ui;
  10559. ui.wordsBtn.visible = true;
  10560. ui.wordsBtn.onClick(this, this.openTalkView);
  10561. ui.aiWordsBtn.visible = true;
  10562. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10563. }
  10564. openTalkView() {
  10565. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10566. xGame.uiMgr.Show(UIWordsList);
  10567. }
  10568. closeTalkView() {
  10569. xGame.uiMgr.Hide(UIWordsList);
  10570. }
  10571. clickAIState() {
  10572. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10573. this.aiSpeak = !this.aiSpeak;
  10574. this.changeAIState(this.aiSpeak);
  10575. }
  10576. changeAIState(speak) {
  10577. this.aiSpeak = speak;
  10578. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10579. if (speak) {
  10580. btn.c1.selectedIndex = 0;
  10581. }
  10582. else {
  10583. btn.c1.selectedIndex = 1;
  10584. }
  10585. }
  10586. showSelfTalk(wordsId) {
  10587. let ui = xGame.common.gameUI.ui;
  10588. ui.selfTalk.visible = true;
  10589. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10590. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10591. ui.selfTalk.t0.play();
  10592. }
  10593. showSelfEmotion(emotionId) {
  10594. let ui = xGame.common.gameUI.ui;
  10595. ui.selfTalk.visible = true;
  10596. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10597. this.selfSpine && this.selfSpine.dispose();
  10598. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10599. let spineData = cfgTable.emotionData[emotionId].spine;
  10600. this.selfSpine = new SpineMgr(spineData, () => {
  10601. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10602. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10603. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10604. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10605. });
  10606. ui.selfTalk.t0.play();
  10607. }
  10608. showAITalk(wordsId) {
  10609. if (!this.aiSpeak)
  10610. return;
  10611. if (DataMgr.gameData.gameCount < 2)
  10612. return;
  10613. if (wordsId < 1)
  10614. wordsId = this.getRandTalk();
  10615. let ui = xGame.common.gameUI.ui;
  10616. ui.aiTalk.visible = true;
  10617. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10618. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10619. ui.aiTalk.t0.play();
  10620. }
  10621. getRandTalk() {
  10622. let rand = xGame.tools.random(0, this.talkList.length);
  10623. return this.emotionList[rand];
  10624. }
  10625. getRandEmotion() {
  10626. let rand = xGame.tools.random(0, this.emotionList.length);
  10627. return this.emotionList[rand];
  10628. }
  10629. showAIEmotion(emotionId) {
  10630. if (!this.aiSpeak)
  10631. return;
  10632. if (DataMgr.gameData.gameCount < 2)
  10633. return;
  10634. if (emotionId < 1)
  10635. emotionId = this.getRandEmotion();
  10636. let ui = xGame.common.gameUI.ui;
  10637. ui.aiTalk.visible = true;
  10638. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10639. this.aiSpine && this.aiSpine.dispose();
  10640. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10641. let spineData = cfgTable.emotionData[emotionId].spine;
  10642. this.aiSpine = new SpineMgr(spineData, () => {
  10643. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10644. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10645. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10646. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10647. });
  10648. ui.aiTalk.t0.play();
  10649. }
  10650. resetGame() {
  10651. let ui = xGame.common.gameUI.ui;
  10652. ui.aiTalk.visible = false;
  10653. ui.selfTalk.visible = false;
  10654. this.aiSpine && this.aiSpine.dispose();
  10655. this.selfSpine && this.selfSpine.dispose();
  10656. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10657. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10658. this.closeTalkView();
  10659. }
  10660. }
  10661. class WordsMgr {
  10662. constructor() {
  10663. this.comboTimes = 1;
  10664. this.skillTimes = 0;
  10665. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10666. this.comboSpine = new SpineMgr("yxz_liangan");
  10667. this.skillSpine = new SpineMgr("yiganxqiu");
  10668. this.scoreSpine = new SpineMgr("defen");
  10669. }
  10670. setClassicCombo(isInterrupt) {
  10671. if (isInterrupt) {
  10672. this.comboTimes = 0;
  10673. }
  10674. }
  10675. playClassicWords(type, callback) {
  10676. this.callback = callback;
  10677. let aniIndex = type;
  10678. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10679. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10680. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10681. mySpine.destroy(true);
  10682. this.playClassicTimes();
  10683. });
  10684. }
  10685. playClassicTimes() {
  10686. this.comboTimes++;
  10687. if (this.comboTimes <= 1) {
  10688. this.callback && this.callback();
  10689. }
  10690. else {
  10691. let aniIndex = this.comboTimes - 1;
  10692. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10693. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10694. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10695. mySpine.destroy(true);
  10696. this.callback && this.callback();
  10697. });
  10698. }
  10699. }
  10700. playBigSkillTimes(times, callback) {
  10701. if (times <= 0) {
  10702. callback && callback();
  10703. return;
  10704. }
  10705. this.callback = callback;
  10706. let pre = "sz_0";
  10707. let aniIndex = 0;
  10708. this.getWordsImg(times, pre, () => {
  10709. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10710. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10711. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10712. let r1 = ``;
  10713. let r2 = ``;
  10714. if (times <= 9) {
  10715. r1 = `res/d2Res/${pre}${times}.png`;
  10716. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10717. aniIndex = 0;
  10718. }
  10719. else {
  10720. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10721. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10722. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10723. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10724. aniIndex = 1;
  10725. }
  10726. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10727. mySpine.destroy(true);
  10728. xGame.common.gameMgr.playSkillTips();
  10729. this.playScore(times);
  10730. xGame.common.playRandomMutiBallBigSkillSound();
  10731. }, mySpine);
  10732. });
  10733. }
  10734. playScore(score) {
  10735. let pre = "sz_";
  10736. let aniIndex = 0;
  10737. this.getWordsImg(score, pre, () => {
  10738. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10739. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10740. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10741. let r1 = ``;
  10742. let r2 = ``;
  10743. if (score <= 9) {
  10744. r1 = `res/d2Res/${pre}${score}.png`;
  10745. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10746. aniIndex = 0;
  10747. }
  10748. else {
  10749. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10750. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10751. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10752. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10753. aniIndex = 1;
  10754. }
  10755. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  10756. mySpine.destroy(true);
  10757. this.callback && this.callback();
  10758. }, mySpine);
  10759. });
  10760. }
  10761. getWordsImg(number, pre = "", callback) {
  10762. let arr = [];
  10763. if (number <= 9) {
  10764. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  10765. }
  10766. else {
  10767. 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 });
  10768. }
  10769. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  10770. callback && callback();
  10771. }));
  10772. }
  10773. }
  10774. class ui_UIRodMethod extends fgui.GComponent {
  10775. static createInstance() {
  10776. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  10777. }
  10778. onConstruct() {
  10779. this.n24 = (this.getChild("n24"));
  10780. this.white = (this.getChild("white"));
  10781. this.dot = (this.getChild("dot"));
  10782. this.sureBtn = (this.getChild("sureBtn"));
  10783. this.n20 = (this.getChild("n20"));
  10784. this.n21 = (this.getChild("n21"));
  10785. this.n22 = (this.getChild("n22"));
  10786. this.n23 = (this.getChild("n23"));
  10787. this.n5 = (this.getChild("n5"));
  10788. this.n14 = (this.getChild("n14"));
  10789. this.t0 = this.getTransition("t0");
  10790. }
  10791. }
  10792. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  10793. class UIRodMethod extends UIBase {
  10794. constructor() {
  10795. super();
  10796. this.isPressd = false;
  10797. }
  10798. onConstructor() {
  10799. this.ui = ui_UIRodMethod.createInstance();
  10800. this.contentPane = this.ui;
  10801. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  10802. this.moveDir = new Laya.Vector2();
  10803. this.moveDest = new Laya.Vector2();
  10804. this.centerPos = new Laya.Vector2();
  10805. xGame.common.uiRodMethod = this;
  10806. }
  10807. show() {
  10808. super.show();
  10809. xGame.common.gameMgr.gamePause = true;
  10810. this.openPressDotEvent();
  10811. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  10812. this.centerPos.x = this.ui.white.x;
  10813. this.centerPos.y = this.ui.white.y;
  10814. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  10815. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  10816. this.setDot();
  10817. }
  10818. setDot() {
  10819. this.ui.dot.x = this.moveDest.x;
  10820. this.ui.dot.y = this.moveDest.y;
  10821. }
  10822. closeSelf() {
  10823. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  10824. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  10825. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  10826. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  10827. xGame.common.gameMgr.gamePause = false;
  10828. this.hide();
  10829. }
  10830. openPressDotEvent() {
  10831. this.closePressDotEvent();
  10832. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10833. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10834. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10835. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10836. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  10837. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10838. }
  10839. closePressDotEvent() {
  10840. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10841. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  10842. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10843. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10844. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  10845. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  10846. }
  10847. onDown(e) {
  10848. if (e.type == Laya.Event.MOUSE_DOWN)
  10849. this.isPressd = true;
  10850. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  10851. this.isPressd = false;
  10852. if (!this.isPressd)
  10853. return;
  10854. this.moveDest.x = e.stageX;
  10855. this.moveDest.y = e.stageY;
  10856. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  10857. if (dis > 6724) {
  10858. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  10859. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  10860. }
  10861. this.setDot();
  10862. }
  10863. resetRod() {
  10864. this.ui.dot.x = this.ui.white.x;
  10865. this.ui.dot.y = this.ui.white.y;
  10866. this.gameRod.dot.x = this.gameRod.bg.x;
  10867. this.gameRod.dot.y = this.gameRod.bg.y;
  10868. xGame.common.rodOffest.x = 0;
  10869. xGame.common.rodOffest.y = 0;
  10870. }
  10871. }
  10872. UIRodMethod.uiName = "UIRodMethod";
  10873. class UIGame extends UIBase {
  10874. constructor() {
  10875. super();
  10876. this.powerNum = 0;
  10877. this.isD3Inited = false;
  10878. this.isPrePlay = false;
  10879. this.isMoveRod = false;
  10880. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  10881. this.rulerDis = 20;
  10882. this.rulerOffset = 0;
  10883. }
  10884. onConstructor() {
  10885. this.ui = ui_UIGame.createInstance();
  10886. this.contentPane = this.ui;
  10887. this.ui.x += xGame.common.sysOffestNum;
  10888. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  10889. this.isEject = false;
  10890. xGame.common.gameUI = this;
  10891. this.initSelf();
  10892. }
  10893. isTurnSelf() {
  10894. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  10895. return true;
  10896. }
  10897. }
  10898. initSelf() {
  10899. let topUI = this.ui.topNode;
  10900. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  10901. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  10902. this.barInfo = {};
  10903. this.barInfo.curY = 0;
  10904. this.barInfo.height = this.ui.powerNode.height;
  10905. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  10906. this.barInfo.powerStartY = this.ui.powerNode.y;
  10907. xGame.common.aiPlayer = new AIPlayer();
  10908. xGame.common.gameMgr = new GameMgr();
  10909. xGame.common.skillMgr = new SkillMgr();
  10910. xGame.common.wordsMgr = new WordsMgr();
  10911. xGame.common.talkMgr = new TalkMgr();
  10912. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  10913. console.log("加载经典模式表情文件chenggon !");
  10914. });
  10915. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  10916. console.log("挑战模式奖励模式spine加载成功!");
  10917. });
  10918. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  10919. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10920. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  10921. this.addUIClick(this.ui.returnBtn, this.returnHome);
  10922. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  10923. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  10924. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  10925. }
  10926. getGanZiImg() {
  10927. let index = DataMgr.getCurBallRod();
  10928. let data = cfgTable.ballrodData[index + 1];
  10929. let gan_url = xGame.common.getGameIconUrl(data.img);
  10930. console.log('zh:getGanZiImg gan_url==' + gan_url);
  10931. this.ui.powerNode.showImg.url = gan_url;
  10932. console.log('zh:修改杆子图标O K');
  10933. }
  10934. returnHome() {
  10935. let tips = "Are you sure to exit the game?";
  10936. let woman = "Boss, why don't you play for a while longer?";
  10937. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  10938. }
  10939. addRodMethodClick() {
  10940. if (this.isTurnSelf()) {
  10941. xGame.uiMgr.Show(UIRodMethod);
  10942. }
  10943. }
  10944. clickHelpLineBtn(force = false) {
  10945. if (!this.isTurnSelf())
  10946. return;
  10947. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10948. if (success) {
  10949. xGame.common.longHelpLine = true;
  10950. xGame.common.d2World.getHelpLine();
  10951. Moyu.sendDataEvent("guideNum");
  10952. }
  10953. else {
  10954. }
  10955. });
  10956. }
  10957. renderSelfDisplayBalls(index, target) {
  10958. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  10959. target.myImg.url = xGame.common.getGameIconUrl(str);
  10960. }
  10961. renderAIDisplayBalls(index, target) {
  10962. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  10963. target.myImg.url = xGame.common.getGameIconUrl(str);
  10964. ;
  10965. }
  10966. updateMode() {
  10967. if (xGame.common.gameMode == GameMode.classic) {
  10968. this.ui.topNode.scoreNode.visible = false;
  10969. }
  10970. else if (xGame.common.gameMode == GameMode.bigMove) {
  10971. this.ui.topNode.scoreNode.visible = true;
  10972. }
  10973. }
  10974. show() {
  10975. super.show();
  10976. console.log("zh:uigame show AADD");
  10977. this.ui.alpha = 0;
  10978. this.updateSelf();
  10979. xGame.common.gameMgr.gamePause = false;
  10980. xGame.common.gameUI.ui.blackAni.visible = false;
  10981. xGame.common.gameUI.ui.whiteAni.visible = false;
  10982. this.ui.powerEft.visible = false;
  10983. this.ui.colorNode.visible = false;
  10984. this.updateHead();
  10985. let curUse = DataMgr.getCurBallRod();
  10986. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  10987. this.getGanZiImg();
  10988. }
  10989. updateSelf() {
  10990. if (xGame.common.gameMode == GameMode.classic) {
  10991. this.ui.c1.selectedIndex = 0;
  10992. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  10993. this.ui.topNode.middleNode.visible = true;
  10994. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  10995. }
  10996. else if (xGame.common.gameMode == GameMode.bigMove) {
  10997. this.ui.c1.selectedIndex = 0;
  10998. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  10999. this.ui.topNode.middleNode.visible = false;
  11000. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11001. let rand = xGame.common.randomNum(1, max);
  11002. let guide = DataMgr.getSkillGuide();
  11003. if (guide == 0)
  11004. rand = 1;
  11005. xGame.common.bigMoveLevelIndex = rand;
  11006. }
  11007. else if (xGame.common.gameMode == GameMode.placeBall) {
  11008. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11009. this.ui.c1.selectedIndex = 1 + data.type;
  11010. this.ui.alpha = 1;
  11011. this.startGame();
  11012. }
  11013. this.updateMode();
  11014. this.initD3world();
  11015. this.initD2world();
  11016. }
  11017. startGame() {
  11018. this.ui.snowNode.visible = Math.random() <= 0.1;
  11019. this.ui.d2Node.visible = false;
  11020. xGame.common.d3World.d3Hand.gameObj.active = false;
  11021. xGame.common.d3World.tableSrc.init();
  11022. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11023. this.cameraViewChange(() => {
  11024. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11025. switch (xGame.common.gameMode) {
  11026. case GameMode.classic:
  11027. xGame.common.d3World.d3Hand.gameObj.active = true;
  11028. this.playPutBallD3Ani();
  11029. break;
  11030. case GameMode.bigMove:
  11031. this.enterGame();
  11032. Laya.timer.once(500, this, () => {
  11033. this.ui.topNode.middleNode.visible = true;
  11034. this.ui.topNode.middleNode.t0.play();
  11035. });
  11036. break;
  11037. case GameMode.placeBall:
  11038. this.enterGame();
  11039. break;
  11040. default:
  11041. break;
  11042. }
  11043. });
  11044. PlatMgr.showBanner(false);
  11045. }
  11046. enterGame() {
  11047. this.ui.d2Node.visible = true;
  11048. xGame.common.d3World.d3Hand.gameObj.active = false;
  11049. xGame.common.showOneCamera("mainCamera");
  11050. Moyu.recordGame(30, true);
  11051. if (!this.isPrePlay) {
  11052. this.isPrePlay = true;
  11053. xGame.common.d3World.prePlayEft();
  11054. }
  11055. xGame.common.gameMgr.gameReady();
  11056. this.openAllEvent();
  11057. this.ui.snowNode.visible = false;
  11058. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11059. this.ui.helpBtn.visible = condition;
  11060. }
  11061. showHelpLineGuide() {
  11062. let longGuide = DataMgr.getGuideHelpLine();
  11063. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11064. this.ui.helpBtn.visible = true;
  11065. this.ui.guideNode.visible = true;
  11066. }
  11067. }
  11068. setTurnAlpha(alpha) {
  11069. this.ui.keduNode.alpha = alpha;
  11070. this.ui.ganNode.alpha = alpha;
  11071. this.ui.rodMethodNode.alpha = alpha;
  11072. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11073. }
  11074. cameraViewChange(callback) {
  11075. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11076. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11077. xGame.common.showOneCamera("visitAngle");
  11078. cameraSrc.localRotationEulerY = 180;
  11079. cameraSrc.localRotationEulerZ = 0;
  11080. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11081. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11082. callback && callback();
  11083. }));
  11084. }));
  11085. }
  11086. playPutBallD3Ani() {
  11087. xGame.common.showOneCamera("mainCamera");
  11088. let handSrc = xGame.common.d3World.d3Hand;
  11089. handSrc.gameObj.active = true;
  11090. handSrc.transform.localPositionZ = 3;
  11091. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11092. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11093. handSrc.gameObj.active = false;
  11094. this.enterGame();
  11095. }), 400);
  11096. }));
  11097. }
  11098. updateHead() {
  11099. let user = Moyu.getUserInfo();
  11100. this.ui.topNode.selfNameTxt.text = user.nickName;
  11101. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11102. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11103. if (DataMgr.getSkillGuide() < 1) {
  11104. this.ui.topNode.aiNameTxt.text = 'billiards';
  11105. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11106. }
  11107. else {
  11108. this.ui.topNode.aiNameTxt.text = aiData.name;
  11109. let randNo = Math.floor(Math.random() * 10) + 1;
  11110. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11111. }
  11112. }
  11113. initD2world() {
  11114. let node = this.ui.d2Root.displayObject;
  11115. let src = node.getComponent(D2World);
  11116. if (!src) {
  11117. xGame.common.d2World = node.addComponent(D2World);
  11118. }
  11119. xGame.common.d2World.initSelf();
  11120. }
  11121. initD3world() {
  11122. if (this.isD3Inited)
  11123. return;
  11124. this.isD3Inited = true;
  11125. let scene3D = xGame.common.d3Scene;
  11126. this.ui.d3Root.displayObject.addChild(scene3D);
  11127. scene3D.active = true;
  11128. xGame.common.d3World.tableSrc.setBorderPos();
  11129. }
  11130. onRootMove(e) {
  11131. let rootBall = xGame.common.d2World.rootBall;
  11132. this.ui.moveNode.x = e.x;
  11133. this.ui.moveNode.y = e.y;
  11134. rootBall.gameObj.x = e.x;
  11135. rootBall.gameObj.y = e.y;
  11136. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11137. }
  11138. aiRootMove(move) {
  11139. if (move)
  11140. this.hideBallUI();
  11141. else {
  11142. this.showBallUI();
  11143. xGame.common.d2World.getHelpLine();
  11144. }
  11145. }
  11146. aiForce(type, force = 0) {
  11147. this.pressTarget = PressType.powerNode;
  11148. if (type == 1)
  11149. this.onEventUp({ force: true });
  11150. else if (type == 2)
  11151. this.onEventMove({ stageY: force, force: true });
  11152. }
  11153. onEventPress(e) {
  11154. if (e.stopPropagation)
  11155. e.stopPropagation();
  11156. if (!this.isTurnSelf())
  11157. return;
  11158. let target = e.target;
  11159. switch (target) {
  11160. case this.ui.myPowerNode.displayObject:
  11161. this.pressTarget = PressType.powerNode;
  11162. this.barInfo.curY = e.stageY;
  11163. this.updateBarInfo();
  11164. break;
  11165. case this.ui.moveNode.displayObject:
  11166. this.pressTarget = PressType.moveNode;
  11167. this.hideBallUI();
  11168. this.eventObj.curX = this.ui.moveNode.x;
  11169. this.eventObj.curY = this.ui.moveNode.y;
  11170. this.ui.moveNode.finger.visible = false;
  11171. this.eventObj.lastX = e.stageX;
  11172. this.eventObj.lastY = e.stageY;
  11173. break;
  11174. case this.ui.rulerClickNode.displayObject:
  11175. this.pressTarget = PressType.rulerNode;
  11176. this.eventObj.lastY = e.stageY;
  11177. break;
  11178. case this.ui.d2Root.displayObject:
  11179. this.pressTarget = PressType.d2Root;
  11180. this.eventObj.lastX = e.stageX;
  11181. this.eventObj.lastY = e.stageY;
  11182. this.eventObj.starX = e.stageX;
  11183. this.eventObj.starY = e.stageY;
  11184. this.eventObj.curX = 0;
  11185. this.eventObj.curY = 0;
  11186. xGame.common.d2World.d2Gan.setGanLastInfo();
  11187. this.rulerOffset = 0;
  11188. break;
  11189. default:
  11190. break;
  11191. }
  11192. }
  11193. onEventMove(e) {
  11194. if (e.stopPropagation)
  11195. e.stopPropagation();
  11196. if (e && e.force) {
  11197. }
  11198. else {
  11199. if (!this.isTurnSelf())
  11200. return;
  11201. }
  11202. switch (this.pressTarget) {
  11203. case PressType.powerNode:
  11204. this.barInfo.curY = e.stageY;
  11205. this.updateBarInfo();
  11206. this.isMoveRod = true;
  11207. break;
  11208. case PressType.moveNode:
  11209. let rootBall = xGame.common.d2World.rootBall;
  11210. let radius = rootBall.gameObj.width / 2;
  11211. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11212. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11213. let border = xGame.common.d2World.borderRect;
  11214. if (curX <= border.x + radius)
  11215. curX = border.x + radius;
  11216. else if (curX >= border.x + border.width - radius)
  11217. curX = border.x + border.width - radius;
  11218. if (curY <= border.y + radius)
  11219. curY = border.y + radius;
  11220. else if (curY >= border.y + border.height - radius)
  11221. curY = border.y + border.height - radius;
  11222. if (xGame.common.gameMgr.isOpenBall) {
  11223. if (curX >= border.x + border.openBallW - radius)
  11224. curX = border.x + border.openBallW - radius;
  11225. }
  11226. this.ui.moveNode.x = curX;
  11227. this.ui.moveNode.y = curY;
  11228. rootBall.gameObj.x = curX;
  11229. rootBall.gameObj.y = curY;
  11230. rootBall.d3BallSrc.setTransPos(curX, curY);
  11231. this.isMoveRod = true;
  11232. break;
  11233. case PressType.rulerNode:
  11234. let yy = e.stageY - this.eventObj.lastY;
  11235. this.eventObj.lastY = e.stageY;
  11236. let ruler1 = this.ui.rulerNode.img1;
  11237. let ruler2 = this.ui.rulerNode.img2;
  11238. ruler1.y += yy;
  11239. ruler2.y += yy;
  11240. this.rulerOffset += yy;
  11241. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11242. this.rulerOffset = 0;
  11243. xGame.soundMgr.playSound("inch", 1, 10);
  11244. }
  11245. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11246. let h = ruler1.height;
  11247. this.checkGuide();
  11248. this.isMoveRod = true;
  11249. if (ruler1.y >= h) {
  11250. ruler1.y = -h;
  11251. ruler2.y = 0;
  11252. return;
  11253. }
  11254. else if (ruler1.y <= -h) {
  11255. ruler1.y = h;
  11256. ruler2.y = 0;
  11257. return;
  11258. }
  11259. if (ruler2.y >= h) {
  11260. ruler2.y = -h;
  11261. ruler1.y = 0;
  11262. return;
  11263. }
  11264. else if (ruler2.y <= -h) {
  11265. ruler2.y = h;
  11266. ruler1.y = 0;
  11267. return;
  11268. }
  11269. break;
  11270. case PressType.d2Root:
  11271. this.eventObj.curX = e.stageX;
  11272. this.eventObj.curY = e.stageY;
  11273. let offset = this.checkRodMoveDir();
  11274. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11275. this.eventObj.lastX = e.stageX;
  11276. this.eventObj.lastY = e.stageY;
  11277. break;
  11278. default:
  11279. break;
  11280. }
  11281. }
  11282. onEventUp(e) {
  11283. if (e.stopPropagation)
  11284. e.stopPropagation();
  11285. if (e && e.force) {
  11286. }
  11287. else {
  11288. if (!this.isTurnSelf())
  11289. return;
  11290. }
  11291. switch (this.pressTarget) {
  11292. case PressType.powerNode:
  11293. this.ui.powerNode.value = 0;
  11294. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11295. this.ui.powerTxt.text = "";
  11296. if (this.powerNum > 0) {
  11297. xGame.eventMgr.event(BALL_SHOOT);
  11298. xGame.common.d2World.shoot(this.powerNum);
  11299. xGame.common.d2World.d2Gan.shoot();
  11300. xGame.common.d2World.d2HelpLine.shoot();
  11301. this.finishGuide();
  11302. this.ui.powerEft.visible = false;
  11303. this.ui.colorNode.visible = false;
  11304. let ganStr = "";
  11305. if (this.powerNum <= 30) {
  11306. ganStr = "gan_30";
  11307. }
  11308. else if (this.powerNum <= 60) {
  11309. ganStr = "gan_50";
  11310. }
  11311. else {
  11312. ganStr = "gan_80";
  11313. }
  11314. xGame.soundMgr.playSound(ganStr);
  11315. }
  11316. break;
  11317. case PressType.moveNode:
  11318. let rootBall = xGame.common.d2World.rootBall;
  11319. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11320. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11321. let isIntersect = this.judgeBallIntersect();
  11322. if (isIntersect) {
  11323. this.ui.moveNode.x = lastX;
  11324. this.ui.moveNode.y = lastY;
  11325. rootBall.gameObj.x = lastX;
  11326. rootBall.gameObj.y = lastY;
  11327. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11328. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11329. }
  11330. else {
  11331. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11332. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11333. }
  11334. this.showBallUI();
  11335. this.ui.moveNode.finger.visible = true;
  11336. xGame.common.d2World.getHelpLine();
  11337. break;
  11338. case PressType.rulerNode:
  11339. break;
  11340. case PressType.d2Root:
  11341. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11342. if (dis <= 25) {
  11343. this.moveToClickDot(e);
  11344. }
  11345. break;
  11346. default:
  11347. break;
  11348. }
  11349. this.pressTarget = -1;
  11350. }
  11351. checkGuide() {
  11352. let guide = DataMgr.getSkillGuide();
  11353. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11354. xGame.common.guideStep++;
  11355. xGame.common.gameUI.ui.guide2.visible = false;
  11356. xGame.common.gameUI.ui.guide3.visible = true;
  11357. }
  11358. }
  11359. finishGuide() {
  11360. let guide = DataMgr.getSkillGuide();
  11361. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11362. xGame.common.guideStep = 10;
  11363. this.closeAllGuide();
  11364. console.log('zh: 新手引导完毕');
  11365. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11366. }
  11367. }
  11368. closeAllGuide() {
  11369. xGame.common.gameUI.ui.guide1.visible = false;
  11370. xGame.common.gameUI.ui.guide2.visible = false;
  11371. xGame.common.gameUI.ui.guide3.visible = false;
  11372. }
  11373. updateBarInfo() {
  11374. let star = this.ui.powerNode.y;
  11375. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11376. if (rate >= 1)
  11377. rate = 1;
  11378. if (rate <= 0)
  11379. rate = 0;
  11380. this.powerNum = Math.ceil(rate * 100);
  11381. this.ui.powerNode.value = this.powerNum;
  11382. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11383. this.ui.colorNode.value = this.powerNum;
  11384. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11385. this.ui.powerEft.visible = this.powerNum != 0;
  11386. this.ui.colorNode.visible = this.powerNum != 0;
  11387. this.ui.powerTxt.text = this.powerNum + "";
  11388. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11389. }
  11390. forceCancel() {
  11391. this.ui.powerNode.value = 0;
  11392. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11393. this.ui.powerTxt.text = "";
  11394. }
  11395. checkRodMoveDir() {
  11396. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11397. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11398. if (tempX >= 0 && tempY <= 0) {
  11399. return this.checkDir();
  11400. }
  11401. else if (tempX < 0 && tempY < 0) {
  11402. return this.checkDir(1, -1);
  11403. }
  11404. else if (tempX < 0 && tempY > 0) {
  11405. return this.checkDir(-1, -1);
  11406. }
  11407. else {
  11408. return this.checkDir(-1, 1);
  11409. }
  11410. }
  11411. checkDir(flagX = 1, flagY = 1) {
  11412. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11413. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11414. if (offsetY == 0) {
  11415. return offsetX * flagX;
  11416. }
  11417. if (offsetX == 0) {
  11418. return offsetY * flagY;
  11419. }
  11420. let angle = offsetY / offsetX;
  11421. if (Math.abs(angle) >= 1) {
  11422. return offsetY * flagY;
  11423. }
  11424. else {
  11425. return offsetX * flagX;
  11426. }
  11427. }
  11428. judgeBallIntersect() {
  11429. let rootBall = xGame.common.d2World.rootBall;
  11430. let ballArr = xGame.common.d2World.ballArr;
  11431. let radius = rootBall.gameObj.width / 2;
  11432. let temp;
  11433. let isIntersect = false;
  11434. for (let index = 0; index < ballArr.length; index++) {
  11435. temp = ballArr[index];
  11436. if (temp.number == rootBall.number)
  11437. continue;
  11438. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11439. if (isIntersect) {
  11440. break;
  11441. }
  11442. }
  11443. return isIntersect;
  11444. }
  11445. hideBallUI() {
  11446. let d2Gan = xGame.common.d2World.d2Gan;
  11447. if (!d2Gan.ui.isDisposed)
  11448. d2Gan.ui.visible = false;
  11449. let d2Help = xGame.common.d2World.d2HelpLine;
  11450. if (!d2Help.ui.isDisposed)
  11451. d2Help.ui.visible = false;
  11452. let rootBall = xGame.common.d2World.rootBall;
  11453. if (!rootBall.destroyed) {
  11454. rootBall.gameObj.active = false;
  11455. }
  11456. }
  11457. showBallUI() {
  11458. let d2Gan = xGame.common.d2World.d2Gan;
  11459. if (!d2Gan.ui.isDisposed)
  11460. d2Gan.ui.visible = true;
  11461. let d2Help = xGame.common.d2World.d2HelpLine;
  11462. if (!d2Help.ui.isDisposed)
  11463. d2Help.ui.visible = true;
  11464. let rootBall = xGame.common.d2World.rootBall;
  11465. if (!rootBall.destroyed) {
  11466. rootBall.gameObj.active = true;
  11467. }
  11468. }
  11469. moveToClickDot(e) {
  11470. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11471. let root = xGame.common.d2World.rootBall.gameObj;
  11472. let xx = e.stageX - xGame.common.sysOffestNum;
  11473. let yy = e.stageY;
  11474. let x = xx - root.x;
  11475. let y = yy - root.y;
  11476. let angle = xGame.common.getfguiRotation(x, y);
  11477. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11478. xGame.common.d2World.getHelpLine();
  11479. }
  11480. this.isMoveRod = false;
  11481. xGame.common.clickedBall = false;
  11482. }
  11483. openAllEvent() {
  11484. this.closeAllEvent();
  11485. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11486. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11487. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11488. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11489. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11490. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11491. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11492. }
  11493. closeAllEvent() {
  11494. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11495. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11496. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11497. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11498. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11499. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11500. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11501. }
  11502. resetGame() {
  11503. this.closeAllEvent();
  11504. this.hideBallUI();
  11505. xGame.common.gameMgr.gamePause = true;
  11506. }
  11507. }
  11508. UIGame.uiName = "UIGame";
  11509. class UIAddProp extends UIBase {
  11510. constructor() {
  11511. super();
  11512. this.curType = "";
  11513. }
  11514. onConstructor() {
  11515. this.ui = ui_UIAddProp.createInstance();
  11516. this.contentPane = this.ui;
  11517. this.isEject = false;
  11518. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11519. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11520. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11521. this.updateUI();
  11522. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11523. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11524. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11525. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11526. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11527. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11528. }
  11529. show(type) {
  11530. super.show();
  11531. this.curType = type == 0 ? "coin" : "diamond";
  11532. this.switchBtn("");
  11533. this.ui.t0.play();
  11534. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11535. PlatMgr.showInsert(true);
  11536. }
  11537. closeSelf() {
  11538. this.hide();
  11539. }
  11540. updateUI() {
  11541. let data = cfgTable.moneyData;
  11542. let temp;
  11543. let obj;
  11544. for (const key in data) {
  11545. temp = data[key];
  11546. obj = this.ui.myNode["node" + key];
  11547. if (parseInt(key) <= 2) {
  11548. obj.diamondTxt.text = "+" + temp.num;
  11549. }
  11550. else {
  11551. obj.coinTxt.text = temp.num;
  11552. obj.diamondTxt.text = temp.get.split('_')[1];
  11553. }
  11554. }
  11555. this.updateDiamondShare();
  11556. }
  11557. updateDiamondShare() {
  11558. let data = DataMgr.getShareDiamondTimes();
  11559. if (data >= xGame.common.maxShareDiamondTimes) {
  11560. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11561. this.ui.myNode.node1.touchable = false;
  11562. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11563. }
  11564. else {
  11565. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11566. this.ui.myNode.node1.touchable = true;
  11567. }
  11568. }
  11569. switchBtn(type) {
  11570. if (type == "")
  11571. type = this.curType;
  11572. else {
  11573. if (this.curType == type) {
  11574. return;
  11575. }
  11576. else {
  11577. this.curType = type;
  11578. }
  11579. }
  11580. if (type == "coin") {
  11581. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11582. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11583. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11584. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11585. this.ui.myNode.c1.selectedIndex = 0;
  11586. }
  11587. else {
  11588. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11589. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11590. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11591. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11592. this.ui.myNode.c1.selectedIndex = 1;
  11593. }
  11594. }
  11595. convertCoin(index) {
  11596. let data = cfgTable.moneyData[index];
  11597. let coinNum = data.num;
  11598. let str = data.get.split('_')[1];
  11599. let needDiamond = parseInt(str);
  11600. if (DataMgr.diamondEnough(needDiamond)) {
  11601. DataMgr.setDiamond(-needDiamond);
  11602. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11603. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11604. }
  11605. else {
  11606. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11607. this.switchBtn("diamond");
  11608. }
  11609. }
  11610. videoGetDiamond() {
  11611. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11612. if (Laya.Browser.onAndroid) {
  11613. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11614. if (!boo) {
  11615. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11616. return;
  11617. }
  11618. }
  11619. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11620. }
  11621. else {
  11622. console.log('zh:AD 失败,直接发放奖励');
  11623. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11624. }
  11625. }
  11626. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11627. let num = cfgTable.moneyData[2].num;
  11628. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11629. this.closeSelf();
  11630. }
  11631. videoGetCoin() {
  11632. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11633. if (Laya.Browser.onAndroid) {
  11634. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11635. if (!boo) {
  11636. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11637. return;
  11638. }
  11639. }
  11640. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11641. }
  11642. else {
  11643. console.log('zh:AD 失败,直接发放奖励');
  11644. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11645. }
  11646. }
  11647. qjff_AD_for_uiAddProp_videoGetCoin() {
  11648. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11649. this.closeSelf();
  11650. }
  11651. shareGetDiamond() {
  11652. let times = DataMgr.getShareDiamondTimes();
  11653. if (times >= xGame.common.maxShareDiamondTimes) {
  11654. console.log('zh: 233333333333 maxShareDiamondTimes');
  11655. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11656. }
  11657. else {
  11658. console.log('zh:33333333333333ad');
  11659. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11660. if (Laya.Browser.onAndroid) {
  11661. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11662. if (!boo) {
  11663. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11664. return;
  11665. }
  11666. }
  11667. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11668. }
  11669. else {
  11670. console.log('zh:AD 失败,直接发放奖励');
  11671. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11672. }
  11673. }
  11674. }
  11675. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11676. let diamond = xGame.common.randomNum(50, 100);
  11677. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11678. DataMgr.setShareDiamondTimes(1);
  11679. this.updateDiamondShare();
  11680. }
  11681. openPutBallView() {
  11682. let end = xGame.uiMgr.getUI(UIGameEnd);
  11683. let skill = xGame.uiMgr.getUI(UISkill);
  11684. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11685. let uigame = xGame.uiMgr.getUI(UIGame);
  11686. if (end && !end.isHide) {
  11687. xGame.uiMgr.Hide(UIGameEnd);
  11688. xGame.uiMgr.Show(UIMain);
  11689. }
  11690. if (skill && !skill.isHide)
  11691. xGame.uiMgr.Hide(UISkill);
  11692. if (uigame && !uigame.isHide)
  11693. xGame.uiMgr.Hide(UIGame);
  11694. if (level && !level.isHide) {
  11695. }
  11696. else {
  11697. xGame.uiMgr.Show(UILevelDisplay);
  11698. }
  11699. this.closeSelf();
  11700. }
  11701. }
  11702. UIAddProp.uiName = "UIAddProp";
  11703. class MoneyNode {
  11704. constructor(ui) {
  11705. this.leftTime = 0;
  11706. this.ui = ui;
  11707. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11708. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11709. this.ui.addPowerBtn.onClick(this, this.addPower);
  11710. this.ui.c1.selectedIndex = 1;
  11711. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11712. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11713. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11714. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11715. this.coinChange();
  11716. this.diamondChange();
  11717. this.powerChange();
  11718. }
  11719. addPower() {
  11720. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11721. xGame.uiMgr.Show(UIPower);
  11722. }
  11723. powerChange() {
  11724. let powerNum = DataMgr.getPower();
  11725. this.ui.powerTxt.text = powerNum + "";
  11726. }
  11727. checkPowerTime() {
  11728. let cur = new Date().getTime();
  11729. let last = DataMgr.getPowerTime();
  11730. if (last == 0) {
  11731. last = cur;
  11732. DataMgr.setPowerTime(cur);
  11733. }
  11734. let power = DataMgr.getPower();
  11735. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11736. Laya.timer.clearAll(this);
  11737. if (power >= xGame.common.natureMaxPower) {
  11738. this.ui.powerTimeTxt.text = "";
  11739. DataMgr.setPowerTime(cur);
  11740. return;
  11741. }
  11742. if (power + offset >= xGame.common.natureMaxPower) {
  11743. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11744. this.ui.powerTimeTxt.text = "";
  11745. DataMgr.setPowerTime(cur);
  11746. }
  11747. else {
  11748. if (offset > 0) {
  11749. DataMgr.setPower(offset);
  11750. DataMgr.setPowerTime(cur);
  11751. }
  11752. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11753. this.leftTime = xGame.common.powerRecoverNum - time;
  11754. if (this.leftTime <= 0)
  11755. this.leftTime = 0;
  11756. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11757. Laya.timer.loop(1000, this, this.updatePowerTime);
  11758. }
  11759. }
  11760. updatePowerTime() {
  11761. this.leftTime -= 1;
  11762. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11763. if (this.leftTime <= 0) {
  11764. this.checkPowerTime();
  11765. }
  11766. }
  11767. coinChange() {
  11768. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  11769. }
  11770. diamondChange() {
  11771. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  11772. }
  11773. addCoin() {
  11774. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11775. Moyu.sendDataEvent("AddCoinBtn");
  11776. xGame.uiMgr.Show(UIAddProp, 0);
  11777. }
  11778. addDiamond() {
  11779. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11780. Moyu.sendDataEvent("AddDiamondBtn");
  11781. xGame.uiMgr.Show(UIAddProp, 1);
  11782. }
  11783. }
  11784. class UIDraw extends UIBase {
  11785. constructor() {
  11786. super();
  11787. this.curKey = 0;
  11788. }
  11789. onConstructor() {
  11790. this.ui = ui_UIDraw.createInstance();
  11791. this.contentPane = this.ui;
  11792. this.isEject = false;
  11793. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  11794. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  11795. this.addUIClick(this.ui.drawBtn, this.startDraw);
  11796. this.initDraw();
  11797. this.initUI();
  11798. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11799. if (Moyu.isKs)
  11800. this.ui.closeNode.closeBtn.x += 100;
  11801. }
  11802. show() {
  11803. super.show();
  11804. this.ui.t0.play();
  11805. this.playSecretaryIdle();
  11806. this.updateDraw();
  11807. this.checkFree();
  11808. if (PlatMgr.bannerDelay > 0) {
  11809. this.ui.closeNode.closeBtn.visible = false;
  11810. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  11811. this.ui.closeNode.closeBtn.visible = true;
  11812. });
  11813. }
  11814. PlatMgr.showRateBanner();
  11815. }
  11816. hide() {
  11817. Laya.timer.clearAll(this);
  11818. super.hide();
  11819. }
  11820. checkFree() {
  11821. let isFree = DataMgr.getDailyfreeDrawTimes();
  11822. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  11823. }
  11824. initDraw() {
  11825. this.drawObj = [];
  11826. let data = cfgTable.drawData;
  11827. let temp;
  11828. let weight = 0;
  11829. for (const key in data) {
  11830. temp = data[key];
  11831. weight += temp.weight;
  11832. this.drawObj.push(weight);
  11833. }
  11834. this.allWeight = weight;
  11835. }
  11836. initUI() {
  11837. let data = cfgTable.drawData;
  11838. let temp;
  11839. let img;
  11840. let txt;
  11841. for (const key in data) {
  11842. temp = data[key];
  11843. img = this.ui.myNode.rotNode["img" + key];
  11844. txt = this.ui.myNode.rotNode["txt" + key];
  11845. img.url = xGame.common.getGameIconUrl(temp.icon);
  11846. txt.visible = true;
  11847. if (temp.award > 2) {
  11848. img.rotation = 0;
  11849. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  11850. }
  11851. else {
  11852. img.rotation = temp.rotation;
  11853. txt.text = temp.num;
  11854. }
  11855. }
  11856. }
  11857. getCurkey() {
  11858. let rand = Math.random() * this.allWeight;
  11859. let temp;
  11860. for (let index = 0; index < this.drawObj.length - 1; index++) {
  11861. temp = this.drawObj[index];
  11862. if (index == 0) {
  11863. if (rand < temp) {
  11864. return index + 1;
  11865. }
  11866. }
  11867. else {
  11868. if (rand >= temp && rand < this.drawObj[index + 1]) {
  11869. return index + 1;
  11870. }
  11871. }
  11872. }
  11873. return 2;
  11874. }
  11875. startDraw() {
  11876. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  11877. if (freeTimes > 0) {
  11878. this.beginDraw();
  11879. DataMgr.setDailyfreeDrawTimes(0);
  11880. this.checkFree();
  11881. }
  11882. else {
  11883. if (Laya.Browser.onAndroid) {
  11884. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11885. if (!boo) {
  11886. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11887. return;
  11888. }
  11889. }
  11890. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  11891. }
  11892. else {
  11893. console.log('zh:AD 失败,直接发放奖励');
  11894. this.qjff_chouJiang();
  11895. }
  11896. }
  11897. }
  11898. qjff_chouJiang() {
  11899. this.beginDraw();
  11900. }
  11901. beginDraw() {
  11902. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  11903. this.ui.drawBtn.touchable = false;
  11904. this.curKey = this.getCurkey();
  11905. console.log("当前key", this.curKey);
  11906. let cell = 60;
  11907. let lap = 3;
  11908. let angle = cell * (this.curKey - 1) + lap * 360;
  11909. let target = this.ui.myNode.rotNode;
  11910. target.rotation = 0;
  11911. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  11912. console.log("旋转完成");
  11913. this.ui.drawBtn.touchable = true;
  11914. this.getAward();
  11915. }));
  11916. }
  11917. getAward() {
  11918. let data = cfgTable.drawData[this.curKey];
  11919. let temp = new AwardType();
  11920. temp.type = data.award;
  11921. temp.num = data.num;
  11922. xGame.common.getAward([temp], () => {
  11923. DataMgr.setDrawTimes(1);
  11924. this.updateDraw();
  11925. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  11926. });
  11927. }
  11928. updateDraw() {
  11929. let drawTimes = DataMgr.getDrawTimes();
  11930. let awardTimes = DataMgr.getDrawAwardTimes();
  11931. if (Math.floor(drawTimes / 3) > awardTimes) {
  11932. this.ui.extraNode.boxBtn.t0.play(null, -1);
  11933. this.ui.extraNode.boxBtn.touchable = true;
  11934. this.ui.extraNode.tipsTxt.text = "3/3";
  11935. this.ui.extraNode.barNode.width = 265;
  11936. this.getExtraAward();
  11937. }
  11938. else {
  11939. this.ui.extraNode.boxBtn.t0.stop();
  11940. this.ui.extraNode.boxBtn.touchable = false;
  11941. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  11942. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  11943. }
  11944. let data = cfgTable.drawData[1];
  11945. if (awardTimes == 0) {
  11946. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  11947. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  11948. this.ui.myNode.rotNode.img1.rotation = 0;
  11949. }
  11950. else {
  11951. let award = data.nextid;
  11952. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  11953. this.ui.myNode.rotNode.txt1.text = award[1];
  11954. this.ui.myNode.rotNode.img1.rotation = 0;
  11955. }
  11956. }
  11957. getExtraAward() {
  11958. let drawTimes = DataMgr.getDrawTimes();
  11959. let awardTimes = DataMgr.getDrawAwardTimes();
  11960. let data = cfgTable.drawData[1];
  11961. let award = new AwardType();
  11962. if (awardTimes == 0) {
  11963. award.num = data.num;
  11964. award.type = data.award;
  11965. xGame.common.getAward([award], () => {
  11966. let all = Math.floor(drawTimes / 3);
  11967. DataMgr.setDrawAwardTimes(all);
  11968. this.updateDraw();
  11969. });
  11970. }
  11971. else {
  11972. award.num = parseInt(data.nextid[1]);
  11973. award.type = parseInt(data.nextid[0]);
  11974. xGame.common.getAward([award], () => {
  11975. let all = Math.floor(drawTimes / 3);
  11976. DataMgr.setDrawAwardTimes(all);
  11977. this.updateDraw();
  11978. });
  11979. }
  11980. }
  11981. closeSelf() {
  11982. this.hide();
  11983. }
  11984. playSecretaryIdle() {
  11985. let parent = this.ui.secretary.displayObject;
  11986. parent.destroyChildren();
  11987. let xx = this.ui.secretary.width / 2;
  11988. let yy = this.ui.secretary.height;
  11989. let scale = xGame.common.getSecretaryScale();
  11990. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  11991. xGame.common.secretary.play(data, 0, true, parent);
  11992. }
  11993. }
  11994. UIDraw.uiName = "UIDraw";
  11995. class ui_UIFlyEft extends fgui.GComponent {
  11996. static createInstance() {
  11997. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  11998. }
  11999. onConstruct() {
  12000. this.n0 = (this.getChild("n0"));
  12001. this.n1 = (this.getChild("n1"));
  12002. this.n2 = (this.getChild("n2"));
  12003. this.n3 = (this.getChild("n3"));
  12004. this.n4 = (this.getChild("n4"));
  12005. this.n5 = (this.getChild("n5"));
  12006. this.n6 = (this.getChild("n6"));
  12007. this.n7 = (this.getChild("n7"));
  12008. this.iconNode = (this.getChild("iconNode"));
  12009. this.txt = (this.getChild("txt"));
  12010. this.txtNode = (this.getChild("txtNode"));
  12011. }
  12012. }
  12013. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12014. class UIFlyEft extends UIBase {
  12015. constructor() {
  12016. super();
  12017. this.max = 8;
  12018. this.delay = 0;
  12019. }
  12020. onConstructor() {
  12021. this.ui = ui_UIFlyEft.createInstance();
  12022. this.contentPane = this.ui;
  12023. this.isEject = false;
  12024. this.isMuti = true;
  12025. this.ui.x += xGame.common.sysOffestNum;
  12026. }
  12027. getArrPos() {
  12028. if (this.iconPos && this.iconPos.length > 0)
  12029. return;
  12030. this.iconPos = [];
  12031. let temp;
  12032. for (let index = 0; index < this.max; index++) {
  12033. temp = this.ui["n" + index];
  12034. this.iconPos.push([temp.x, temp.y]);
  12035. }
  12036. }
  12037. show(stPos, edPos, num, type, callback) {
  12038. super.show();
  12039. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12040. this.getArrPos();
  12041. this.updateUI(type);
  12042. this.updatePos();
  12043. this.runFly(edPos, callback);
  12044. this.runWorlds(stPos, num);
  12045. }
  12046. updateUI(type) {
  12047. let temp;
  12048. let str;
  12049. for (let index = 0; index < this.max; index++) {
  12050. temp = this.ui["n" + index];
  12051. str = this.getIconStr(type);
  12052. temp.url = xGame.common.getGameIconUrl(str);
  12053. }
  12054. }
  12055. getIconStr(type) {
  12056. switch (type) {
  12057. case Prop.diamond:
  12058. return "ty_zs";
  12059. case Prop.coin:
  12060. return "ty_jb";
  12061. default:
  12062. break;
  12063. }
  12064. }
  12065. updatePos() {
  12066. let temp;
  12067. for (let index = 0; index < this.max; index++) {
  12068. temp = this.ui["n" + index];
  12069. temp.x = this.iconPos[index][0];
  12070. temp.y = this.iconPos[index][1];
  12071. }
  12072. }
  12073. runFly(endPos, callback) {
  12074. let all = 0;
  12075. let temp;
  12076. for (let index = 0; index < this.max; index++) {
  12077. temp = this.ui["n" + index];
  12078. temp.visible = true;
  12079. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12080. temp.visible = false;
  12081. all++;
  12082. if (all >= this.max) {
  12083. callback && callback();
  12084. }
  12085. }), 20 * index);
  12086. }
  12087. }
  12088. runWorlds(stPos, num) {
  12089. let str = "+" + num;
  12090. this.ui.txt.text = str;
  12091. let starX = stPos.x;
  12092. let starY = stPos.y + 50;
  12093. this.ui.txt.x = starX;
  12094. this.ui.txt.y = starY;
  12095. this.ui.txt.visible = true;
  12096. this.ui.txt.alpha = 1;
  12097. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12098. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12099. this.ui.txt.visible = false;
  12100. this.hide();
  12101. }));
  12102. }));
  12103. }
  12104. }
  12105. UIFlyEft.uiName = "UIFlyEft";
  12106. class Common {
  12107. constructor() {
  12108. this.convertNum = 0.025;
  12109. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12110. this.scaleV3One = new Laya.Vector3();
  12111. this.scaleV3Two = new Laya.Vector3();
  12112. this.posV4 = new Laya.Vector4();
  12113. this.showDebug = false;
  12114. this.openGuide = true;
  12115. this.rodOffest = new Laya.Vector2(0, 0);
  12116. this.rodAngle = 0;
  12117. this.gameMode = GameMode.classic;
  12118. this.bigMoveLevelIndex = 1;
  12119. this.bigMoveNeedCoin = 1000;
  12120. this.classicNiceNeddCoin = 1000;
  12121. this.passAwardCoin = 2000;
  12122. this.classicRoomType = 1;
  12123. this.maxPower = 20;
  12124. this.natureMaxPower = 5;
  12125. this.videoPower = 2;
  12126. this.powerRecoverNum = 900;
  12127. this.curPlayerSkillType = 0;
  12128. this.isNewDay = false;
  12129. this.clickedBall = false;
  12130. this.placeBallCurLevel = 0;
  12131. this.placeBallStarNum = 0;
  12132. this.longHelpLine = false;
  12133. this.maxShareDiamondTimes = 3;
  12134. this.guideStep = 0;
  12135. this.temSelfLevel = 0;
  12136. this.extraMoveNum = 0;
  12137. this.curRankID = 0;
  12138. this.rankID = {
  12139. normalStar: 12000,
  12140. wxStar: 12001
  12141. };
  12142. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  12143. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12144. this.btnClickStr = "buttonclick";
  12145. this.maxSkillLevel = 10;
  12146. this.upSkillLevel = false;
  12147. this.gameStartTime = 0;
  12148. this._sysOffestNum = 0;
  12149. this.angleV2 = new Laya.Vector2();
  12150. this.rootV = new Laya.Vector2(0, 1);
  12151. this.tempDir1 = new Laya.Vector2();
  12152. this.tempDir2 = new Laya.Vector2();
  12153. this.ballSize = 33;
  12154. this.stPos = new Laya.Point();
  12155. this.edPos = new Laya.Point();
  12156. Common._instance = this;
  12157. window["common"] = this;
  12158. }
  12159. static getInstance() {
  12160. if (!this._instance) {
  12161. this._instance = new Common();
  12162. }
  12163. return this._instance;
  12164. }
  12165. get sysOffestNum() {
  12166. if (this._sysOffestNum == 0) {
  12167. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12168. }
  12169. return this._sysOffestNum;
  12170. }
  12171. testShader() {
  12172. let test = new LightShader();
  12173. test.texture = "res/d3Res/ballTexture/ball1.png";
  12174. Laya.stage.addChild(test);
  12175. }
  12176. playScale(node) {
  12177. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12178. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12179. }));
  12180. }));
  12181. }
  12182. setGroup(colli, ...group) {
  12183. let out = 0;
  12184. for (let index = 0; index < group.length; index++) {
  12185. if (index == 0) {
  12186. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12187. }
  12188. else {
  12189. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12190. }
  12191. }
  12192. colli.collisionGroup = out;
  12193. }
  12194. setCanGroupWith(colli, ...group) {
  12195. let out = 0;
  12196. for (let index = 0; index < group.length; index++) {
  12197. if (index == 0) {
  12198. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12199. }
  12200. else {
  12201. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12202. }
  12203. }
  12204. colli.canCollideWith = out;
  12205. }
  12206. loadPrefab(name, callback) {
  12207. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12208. let prefab = new Laya.Prefab();
  12209. prefab.json = obj;
  12210. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12211. callback && callback(img);
  12212. }));
  12213. }
  12214. pos2to3Convert(x, y, d3Pos) {
  12215. x = x + this.sysOffestNum;
  12216. d3Pos.setValue(x, y, 0);
  12217. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12218. if (success) {
  12219. }
  12220. else {
  12221. console.error("转换出错了。。。。。。。。");
  12222. }
  12223. }
  12224. scale2to3Convert(num) {
  12225. this.scaleV3One.setValue(0, 0, 0);
  12226. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12227. this.scaleV3Two.setValue(0, num, 0);
  12228. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12229. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12230. return outNum;
  12231. }
  12232. pos3to2Convert(d3Pos) {
  12233. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12234. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12235. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12236. d3Pos.x -= this.sysOffestNum;
  12237. }
  12238. scale3to2Convert(num) {
  12239. let scale = this.scale2to3Convert(1);
  12240. let d2Out = num / scale;
  12241. return d2Out;
  12242. }
  12243. getCollider(type, restitution = 0.9, density = 10) {
  12244. let colli;
  12245. if (type == "box")
  12246. colli = new Laya.BoxCollider();
  12247. else
  12248. colli = new Laya.CircleCollider();
  12249. colli.friction = 0;
  12250. colli.restitution = restitution;
  12251. colli.density = density;
  12252. return colli;
  12253. }
  12254. getRigbody() {
  12255. let rigy = new Laya.RigidBody();
  12256. rigy.bullet = true;
  12257. rigy.allowRotation = false;
  12258. rigy.allowSleep = false;
  12259. rigy.gravityScale = 0;
  12260. return rigy;
  12261. }
  12262. getfguiRotation(x, y) {
  12263. this.angleV2.setValue(x, y);
  12264. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12265. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12266. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12267. angle = -angle;
  12268. }
  12269. return 180 + angle;
  12270. }
  12271. getAngle(x, y) {
  12272. this.angleV2.setValue(x, y);
  12273. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12274. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12275. return angle;
  12276. }
  12277. randomNum(a, b) {
  12278. return a + Math.floor((b - a + 1) * Math.random());
  12279. }
  12280. getRandArrEle(arr) {
  12281. return arr[Math.floor(arr.length * Math.random())];
  12282. }
  12283. getSign(val) {
  12284. return val >= 0 ? 1 : -1;
  12285. }
  12286. botherArr(arr) {
  12287. let times = arr.length + 2;
  12288. let length = arr.length;
  12289. let a;
  12290. let b;
  12291. let temp;
  12292. for (let index = 0; index < times; index++) {
  12293. a = Math.floor(Math.random() * length);
  12294. b = Math.floor(Math.random() * length);
  12295. temp = arr[a];
  12296. arr[a] = arr[b];
  12297. arr[b] = temp;
  12298. }
  12299. }
  12300. getGameIconUrl(id) {
  12301. return "ui://game/" + id;
  12302. }
  12303. getComponentUrl(id) {
  12304. return "ui://game/" + id;
  12305. }
  12306. getAnimation() {
  12307. }
  12308. judgeSkillType(type = SkillType.highSpace) {
  12309. if (this.gameMode == GameMode.classic)
  12310. return;
  12311. let gameMgr = this.gameMgr;
  12312. if (gameMgr.selfTurn) {
  12313. if (gameMgr.selfCurSkill == type) {
  12314. return true;
  12315. }
  12316. }
  12317. else {
  12318. if (gameMgr.aiCurSkill == type) {
  12319. return true;
  12320. }
  12321. }
  12322. }
  12323. ballColliHole(collider) {
  12324. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12325. xGame.common.gameMgr.isFirstInGame = false;
  12326. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12327. }
  12328. collider.owner.mySrc.checkWrongBall();
  12329. }
  12330. getArrMaxEle(arr) {
  12331. let max = -Infinity;
  12332. for (let index = 0; index < arr.length; index++) {
  12333. max = Math.max(arr[index], max);
  12334. }
  12335. return max;
  12336. }
  12337. getArrMinEle(arr) {
  12338. let min = Infinity;
  12339. for (let index = 0; index < arr.length; index++) {
  12340. min = Math.min(arr[index], min);
  12341. }
  12342. return min;
  12343. }
  12344. playRandomMutiBallBigSkillSound() {
  12345. if (Math.random() <= 0.5)
  12346. return;
  12347. let rand = this.randomNum(1, 6);
  12348. let str = "ganfa0" + rand;
  12349. xGame.soundMgr.playSound(str);
  12350. }
  12351. showOneCamera(type) {
  12352. let object = xGame.common.d3World.cameraObj;
  12353. for (const key in object) {
  12354. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12355. object[key].init();
  12356. object[key].owner.active = key == type;
  12357. }
  12358. }
  12359. }
  12360. checkBallOverBorder(x, y) {
  12361. let radius = 17;
  12362. let condition = this._checkBorder(x + radius, y) ||
  12363. this._checkBorder(x - radius, y) ||
  12364. this._checkBorder(x, y + radius) ||
  12365. this._checkBorder(x, y - radius);
  12366. if (condition) {
  12367. return true;
  12368. }
  12369. }
  12370. _checkBorder(x, y) {
  12371. let borderRect = this.d2World.borderRect;
  12372. let xOffest = 20;
  12373. let yOffest = 20;
  12374. if (y <= borderRect.y - yOffest) {
  12375. return true;
  12376. }
  12377. if (y >= borderRect.y + borderRect.height + yOffest) {
  12378. return true;
  12379. }
  12380. if (x <= borderRect.x - xOffest) {
  12381. return true;
  12382. }
  12383. if (x >= borderRect.x + borderRect.width + xOffest) {
  12384. return true;
  12385. }
  12386. }
  12387. initWeight(cfg) {
  12388. let allCfgData = { data: {}, allWeightNum: 0 };
  12389. let weightCfg = allCfgData.data;
  12390. let weight = 0;
  12391. for (const key in cfg) {
  12392. weightCfg[key] = {};
  12393. weightCfg[key].id = cfg[key].id;
  12394. weightCfg[key].minWeight = weight;
  12395. weight += cfg[key].weight;
  12396. weightCfg[key].maxWeight = weight;
  12397. }
  12398. allCfgData.allWeightNum = weight;
  12399. return allCfgData;
  12400. }
  12401. getRandomWeightData(cfg) {
  12402. let weightCfg = cfg.data;
  12403. let allWeightNum = cfg.allWeightNum;
  12404. let rand = Math.floor(Math.random() * allWeightNum);
  12405. for (const key in weightCfg) {
  12406. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12407. return weightCfg[key];
  12408. }
  12409. }
  12410. return weightCfg[1];
  12411. }
  12412. showGirlTalkPop(wordsIndex, node, msgNode) {
  12413. node.visible = true;
  12414. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12415. node.t0.play(Laya.Handler.create(this, () => {
  12416. node.visible = false;
  12417. }));
  12418. }
  12419. stopGirlPop(node) {
  12420. node.t0.stop();
  12421. node.visible = false;
  12422. }
  12423. createHead(loader, url, size = 107) {
  12424. if (Laya.Browser.name == "Browser") {
  12425. loader.url = url;
  12426. return;
  12427. }
  12428. else {
  12429. console.log('zh:url=', url);
  12430. loader.url = url;
  12431. }
  12432. }
  12433. addTestCoin(num) {
  12434. DataMgr.setCoin(num);
  12435. }
  12436. addTestDiamond(num) {
  12437. DataMgr.setDiamond(num);
  12438. }
  12439. addTestSkill() {
  12440. DataMgr.setBigSkill(0, 99);
  12441. DataMgr.setBigSkill(1, 99);
  12442. DataMgr.setBigSkill(2, 99);
  12443. }
  12444. playClassicEmotion(number, x, y) {
  12445. if (this.gameMode == GameMode.bigMove)
  12446. return;
  12447. let randIndex = this.randomNum(0, 2);
  12448. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12449. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12450. if (this.gameMgr.selfTurn) {
  12451. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12452. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12453. }
  12454. else {
  12455. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12456. }
  12457. else {
  12458. if (number == this.gameMgr.blackNum) {
  12459. if (this.gameMgr.selfBallArr.length == 0) {
  12460. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12461. }
  12462. else {
  12463. }
  12464. }
  12465. else {
  12466. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12467. }
  12468. }
  12469. }
  12470. }
  12471. else {
  12472. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12473. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12474. }
  12475. else {
  12476. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12477. }
  12478. else {
  12479. if (number == this.gameMgr.blackNum) {
  12480. if (this.gameMgr.aiBallArr.length == 0) {
  12481. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12482. }
  12483. else {
  12484. }
  12485. }
  12486. else {
  12487. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12488. }
  12489. }
  12490. }
  12491. }
  12492. }
  12493. playHappySound(number) {
  12494. if (this.gameMode != GameMode.classic)
  12495. return;
  12496. if (number == 8)
  12497. return;
  12498. let play = false;
  12499. if (this.gameMgr.selfTurn) {
  12500. if (this.gameMgr.ensureBallType) {
  12501. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12502. play = true;
  12503. }
  12504. }
  12505. else {
  12506. play = true;
  12507. }
  12508. }
  12509. else {
  12510. if (this.gameMgr.ensureBallType) {
  12511. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12512. play = true;
  12513. }
  12514. }
  12515. else {
  12516. play = true;
  12517. }
  12518. }
  12519. if (play)
  12520. xGame.soundMgr.playSound("applause");
  12521. }
  12522. destroyClassicEmotion() {
  12523. if (this.gameMode == GameMode.bigMove)
  12524. return;
  12525. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12526. parent.destroyChildren();
  12527. }
  12528. playAwardSpine(x, y) {
  12529. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12530. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12531. this.awardSpine.play(data, 0, false, parent);
  12532. }
  12533. destroyAwardSpine() {
  12534. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12535. parent.destroyChildren();
  12536. }
  12537. isBlock(bx, by, hx, hy, except = null) {
  12538. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12539. let balls = xGame.common.d2World.ballArr;
  12540. let outArr = [];
  12541. for (let index = 0; index < balls.length; index++) {
  12542. let obj = balls[index];
  12543. if (obj.number == 0)
  12544. continue;
  12545. if (obj == except)
  12546. continue;
  12547. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12548. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12549. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12550. if (num >= 1)
  12551. num = 1;
  12552. if (num < 0)
  12553. continue;
  12554. let gap = Math.sin(Math.acos(num)) * dis;
  12555. if (gap < this.ballSize) {
  12556. outArr.push({
  12557. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12558. disHon: Math.cos(Math.acos(num)) * dis,
  12559. disVer: Math.sin(Math.acos(num)) * dis,
  12560. src: balls[index],
  12561. dir: this.tempDir1
  12562. });
  12563. }
  12564. }
  12565. if (outArr.length > 0) {
  12566. outArr.sort((a, b) => { return a.dis - b.dis; });
  12567. return outArr[0];
  12568. }
  12569. }
  12570. AngleBetween(vector1, vector2) {
  12571. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12572. return rad * (180 / Math.PI);
  12573. }
  12574. getSecretaryScale() {
  12575. if (this.secretary.spineName == "mishu") {
  12576. return 1.28;
  12577. }
  12578. else {
  12579. return 1.024;
  12580. }
  12581. }
  12582. signAwardContainsRod(arr) {
  12583. let temp;
  12584. for (let index = 0; index < arr.length; index++) {
  12585. temp = arr[index].split('-')[0];
  12586. if (parseInt(temp) > 2) {
  12587. return true;
  12588. }
  12589. }
  12590. }
  12591. judgeSameDay() {
  12592. let lastTime = DataMgr.getSignTime();
  12593. let curTime = new Date().getTime();
  12594. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12595. return true;
  12596. }
  12597. return false;
  12598. }
  12599. getAward(arr, callback) {
  12600. let showTriple = arr[0].type <= 2;
  12601. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12602. let temp;
  12603. for (let index = 0; index < arr.length; index++) {
  12604. temp = arr[index];
  12605. switch (temp.type) {
  12606. case 1:
  12607. this.playObjFlyAnim(temp.num, temp.type);
  12608. break;
  12609. case 2:
  12610. this.playObjFlyAnim(temp.num, temp.type);
  12611. break;
  12612. case 3:
  12613. case 4:
  12614. case 5:
  12615. case 6:
  12616. DataMgr.setBallRod(temp.type - 2, 1);
  12617. DataMgr.setCurBallRod(temp.type - 2);
  12618. break;
  12619. default:
  12620. break;
  12621. }
  12622. }
  12623. callback && callback(watchVideo);
  12624. });
  12625. }
  12626. getMoneyNode() {
  12627. let moneyNode;
  12628. let sign = xGame.uiMgr.getUI(UISign);
  12629. let draw = xGame.uiMgr.getUI(UIDraw);
  12630. let end = xGame.uiMgr.getUI(UIGameEnd);
  12631. let skill = xGame.uiMgr.getUI(UISkill);
  12632. if (sign && !sign.isHide)
  12633. moneyNode = sign.ui.moneyNode;
  12634. if (draw && !draw.isHide)
  12635. moneyNode = draw.ui.moneyNode;
  12636. if (end && !end.isHide)
  12637. moneyNode = end.ui.moneyNode;
  12638. if (skill && !skill.isHide)
  12639. moneyNode = skill.ui.moneyNode;
  12640. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12641. let main = xGame.uiMgr.getUI(UIMain);
  12642. if (condition1 && main && !main.isHide) {
  12643. moneyNode = main.ui.moneyNode;
  12644. }
  12645. return moneyNode;
  12646. }
  12647. playObjFlyAnim(num, type, callback = null) {
  12648. this.stPos.x = Laya.stage.width / 2;
  12649. this.stPos.y = Laya.stage.height / 2;
  12650. let moneyNode = this.getMoneyNode();
  12651. switch (type) {
  12652. case Prop.diamond:
  12653. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12654. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12655. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12656. this.edPos.x /= 2;
  12657. this.edPos.y /= 2;
  12658. break;
  12659. case Prop.coin:
  12660. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12661. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12662. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12663. this.edPos.x /= 2;
  12664. this.edPos.y /= 2;
  12665. break;
  12666. default:
  12667. break;
  12668. }
  12669. xGame.soundMgr.playSound("coinbag");
  12670. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12671. switch (type) {
  12672. case Prop.diamond:
  12673. DataMgr.setDiamond(num);
  12674. break;
  12675. case Prop.coin:
  12676. DataMgr.setCoin(num);
  12677. break;
  12678. default:
  12679. break;
  12680. }
  12681. callback && callback();
  12682. });
  12683. }
  12684. autoPopUIView() {
  12685. let arr = [];
  12686. let sign = this.judgeSameDay() ? false : true;
  12687. if (sign)
  12688. arr.push("sign");
  12689. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12690. if (draw)
  12691. arr.push("draw");
  12692. if (arr.length <= 0)
  12693. return;
  12694. let str = this.getRandArrEle(arr);
  12695. switch (str) {
  12696. case "sign":
  12697. xGame.uiMgr.Show(UISign);
  12698. break;
  12699. case "draw":
  12700. xGame.uiMgr.Show(UIDraw);
  12701. break;
  12702. default:
  12703. break;
  12704. }
  12705. }
  12706. getMSTime(time) {
  12707. let min = Math.floor(time / 60);
  12708. let sec = Math.floor((time - min * 60));
  12709. if (sec < 10)
  12710. sec = "0" + sec;
  12711. if (min < 10)
  12712. min = "0" + min;
  12713. return `${min}:${sec}`;
  12714. }
  12715. testPower() {
  12716. DataMgr.setPower(0, false);
  12717. }
  12718. getAllStarNum() {
  12719. let data = DataMgr.getPlaceBallLevelList();
  12720. let out = 0;
  12721. for (let index = 0; index < data.length; index++) {
  12722. out += data[index].star;
  12723. }
  12724. return out;
  12725. }
  12726. recoverCameraView() {
  12727. Laya.timer.once(900, this, () => {
  12728. xGame.common.showOneCamera("mainCamera");
  12729. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12730. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12731. xGame.common.gameUI.ui.border.alpha = 0;
  12732. if (Laya.physicsTimer.scale < 1) {
  12733. Laya.physicsTimer.scale = 1;
  12734. }
  12735. }
  12736. });
  12737. }
  12738. getClassicLevel() {
  12739. let successTimes = DataMgr.getClassicTimes();
  12740. let needKey = "";
  12741. let lastKey = "";
  12742. let cfg = cfgTable.classictimesData;
  12743. let data;
  12744. for (const key in cfg) {
  12745. data = cfg[key];
  12746. if (successTimes <= data.times) {
  12747. needKey = key;
  12748. }
  12749. lastKey = key;
  12750. }
  12751. if (needKey == "")
  12752. needKey = lastKey;
  12753. return cfg[needKey];
  12754. }
  12755. }
  12756. Common._instance = null;
  12757. class ui_Component92 extends fgui.GComponent {
  12758. static createInstance() {
  12759. return (fgui.UIPackage.createObject("game", "Component92"));
  12760. }
  12761. onConstruct() {
  12762. this.n0 = (this.getChild("n0"));
  12763. }
  12764. }
  12765. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  12766. class ui_Component129 extends fgui.GProgressBar {
  12767. static createInstance() {
  12768. return (fgui.UIPackage.createObject("game", "Component129"));
  12769. }
  12770. onConstruct() {
  12771. this.bar_v = (this.getChild("bar_v"));
  12772. this.n84 = (this.getChild("n84"));
  12773. }
  12774. }
  12775. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  12776. class ui_Component130 extends fgui.GComponent {
  12777. static createInstance() {
  12778. return (fgui.UIPackage.createObject("game", "Component130"));
  12779. }
  12780. onConstruct() {
  12781. this.ani = (this.getChild("ani"));
  12782. this.t0 = this.getTransition("t0");
  12783. }
  12784. }
  12785. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  12786. class ui_powerEft extends fgui.GComponent {
  12787. static createInstance() {
  12788. return (fgui.UIPackage.createObject("game", "powerEft"));
  12789. }
  12790. onConstruct() {
  12791. this.ani = (this.getChild("ani"));
  12792. this.n88 = (this.getChild("n88"));
  12793. this.n89 = (this.getChild("n89"));
  12794. }
  12795. }
  12796. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  12797. class ui_PutBallLevelDisplay extends fgui.GComponent {
  12798. static createInstance() {
  12799. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  12800. }
  12801. onConstruct() {
  12802. this.c1 = this.getController("c1");
  12803. this.n2 = (this.getChild("n2"));
  12804. this.n22 = (this.getChild("n22"));
  12805. this.n23 = (this.getChild("n23"));
  12806. this.n15 = (this.getChild("n15"));
  12807. this.challenge = (this.getChild("challenge"));
  12808. this.n17 = (this.getChild("n17"));
  12809. this.n3 = (this.getChild("n3"));
  12810. this.starNode = (this.getChild("starNode"));
  12811. this.levelTxt = (this.getChild("levelTxt"));
  12812. this.n14 = (this.getChild("n14"));
  12813. this.n19 = (this.getChild("n19"));
  12814. this.n20 = (this.getChild("n20"));
  12815. this.n21 = (this.getChild("n21"));
  12816. this.special = (this.getChild("special"));
  12817. }
  12818. }
  12819. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  12820. class ui_Component79 extends fgui.GComponent {
  12821. static createInstance() {
  12822. return (fgui.UIPackage.createObject("game", "Component79"));
  12823. }
  12824. onConstruct() {
  12825. this.c1 = this.getController("c1");
  12826. this.n7 = (this.getChild("n7"));
  12827. this.n8 = (this.getChild("n8"));
  12828. this.n9 = (this.getChild("n9"));
  12829. this.n10 = (this.getChild("n10"));
  12830. this.n11 = (this.getChild("n11"));
  12831. this.n12 = (this.getChild("n12"));
  12832. }
  12833. }
  12834. ui_Component79.URL = "ui://isxx5ak7avag477";
  12835. class ui_Component80 extends fgui.GComponent {
  12836. static createInstance() {
  12837. return (fgui.UIPackage.createObject("game", "Component80"));
  12838. }
  12839. onConstruct() {
  12840. this.n0 = (this.getChild("n0"));
  12841. this.n1 = (this.getChild("n1"));
  12842. this.myList = (this.getChild("myList"));
  12843. this.t0 = this.getTransition("t0");
  12844. }
  12845. }
  12846. ui_Component80.URL = "ui://isxx5ak7avag47b";
  12847. class ui_SignNormal extends fgui.GComponent {
  12848. static createInstance() {
  12849. return (fgui.UIPackage.createObject("game", "SignNormal"));
  12850. }
  12851. onConstruct() {
  12852. this.c1 = this.getController("c1");
  12853. this.n7 = (this.getChild("n7"));
  12854. this.n15 = (this.getChild("n15"));
  12855. this.titleTxt = (this.getChild("titleTxt"));
  12856. this.n8 = (this.getChild("n8"));
  12857. this.myIcon = (this.getChild("myIcon"));
  12858. this.numTxt = (this.getChild("numTxt"));
  12859. this.n12 = (this.getChild("n12"));
  12860. this.n13 = (this.getChild("n13"));
  12861. this.n17 = (this.getChild("n17"));
  12862. this.n14 = (this.getChild("n14"));
  12863. }
  12864. }
  12865. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  12866. class ui_Button_reg extends fgui.GButton {
  12867. static createInstance() {
  12868. return (fgui.UIPackage.createObject("game", "Button_reg"));
  12869. }
  12870. onConstruct() {
  12871. this.button = this.getController("button");
  12872. this.n6 = (this.getChild("n6"));
  12873. this.n4 = (this.getChild("n4"));
  12874. }
  12875. }
  12876. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  12877. class ui_screenNode extends fgui.GComponent {
  12878. static createInstance() {
  12879. return (fgui.UIPackage.createObject("game", "screenNode"));
  12880. }
  12881. onConstruct() {
  12882. this.n9 = (this.getChild("n9"));
  12883. this.screenImg = (this.getChild("screenImg"));
  12884. }
  12885. }
  12886. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  12887. class ui_GetAwrad_com1 extends fgui.GComponent {
  12888. static createInstance() {
  12889. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  12890. }
  12891. onConstruct() {
  12892. this.n38 = (this.getChild("n38"));
  12893. this.n39 = (this.getChild("n39"));
  12894. this.n40 = (this.getChild("n40"));
  12895. this.t0 = this.getTransition("t0");
  12896. this.t1 = this.getTransition("t1");
  12897. }
  12898. }
  12899. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  12900. class ui_GetAwrad_com2 extends fgui.GComponent {
  12901. static createInstance() {
  12902. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  12903. }
  12904. onConstruct() {
  12905. this.n39 = (this.getChild("n39"));
  12906. this.n40 = (this.getChild("n40"));
  12907. this.t0 = this.getTransition("t0");
  12908. }
  12909. }
  12910. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  12911. class ui_Component128 extends fgui.GComponent {
  12912. static createInstance() {
  12913. return (fgui.UIPackage.createObject("game", "Component128"));
  12914. }
  12915. onConstruct() {
  12916. this.n38 = (this.getChild("n38"));
  12917. this.n40 = (this.getChild("n40"));
  12918. }
  12919. }
  12920. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  12921. class ui_Component100_1 extends fgui.GComponent {
  12922. static createInstance() {
  12923. return (fgui.UIPackage.createObject("game", "Component100_1"));
  12924. }
  12925. onConstruct() {
  12926. this.myNode = (this.getChild("myNode"));
  12927. this.t0 = this.getTransition("t0");
  12928. }
  12929. }
  12930. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  12931. class ui_Component142 extends fgui.GComponent {
  12932. static createInstance() {
  12933. return (fgui.UIPackage.createObject("game", "Component142"));
  12934. }
  12935. onConstruct() {
  12936. this.n41 = (this.getChild("n41"));
  12937. this.n42 = (this.getChild("n42"));
  12938. }
  12939. }
  12940. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  12941. class ui_main_guang extends fgui.GComponent {
  12942. static createInstance() {
  12943. return (fgui.UIPackage.createObject("game", "main_guang"));
  12944. }
  12945. onConstruct() {
  12946. this.n1 = (this.getChild("n1"));
  12947. this.n2 = (this.getChild("n2"));
  12948. this.n3 = (this.getChild("n3"));
  12949. this.n4 = (this.getChild("n4"));
  12950. this.n5 = (this.getChild("n5"));
  12951. this.n6 = (this.getChild("n6"));
  12952. this.n8 = (this.getChild("n8"));
  12953. this.t0 = this.getTransition("t0");
  12954. }
  12955. }
  12956. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  12957. class ui_try_com1 extends fgui.GComponent {
  12958. static createInstance() {
  12959. return (fgui.UIPackage.createObject("game", "try_com1"));
  12960. }
  12961. onConstruct() {
  12962. this.c1 = this.getController("c1");
  12963. this.n0 = (this.getChild("n0"));
  12964. this.n2 = (this.getChild("n2"));
  12965. this.cancelBtn = (this.getChild("cancelBtn"));
  12966. this.videoBtn = (this.getChild("videoBtn"));
  12967. this.n9 = (this.getChild("n9"));
  12968. this.n24 = (this.getChild("n24"));
  12969. this.titleTxt = (this.getChild("titleTxt"));
  12970. this.n32 = (this.getChild("n32"));
  12971. this.n29 = (this.getChild("n29"));
  12972. this.n36 = (this.getChild("n36"));
  12973. this.txtTime = (this.getChild("txtTime"));
  12974. this.t0 = this.getTransition("t0");
  12975. }
  12976. }
  12977. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  12978. class ui_try_com2 extends fgui.GComponent {
  12979. static createInstance() {
  12980. return (fgui.UIPackage.createObject("game", "try_com2"));
  12981. }
  12982. onConstruct() {
  12983. this.skillicon = (this.getChild("skillicon"));
  12984. this.n35 = (this.getChild("n35"));
  12985. this.n31 = (this.getChild("n31"));
  12986. this.n32 = (this.getChild("n32"));
  12987. this.n33 = (this.getChild("n33"));
  12988. this.n34 = (this.getChild("n34"));
  12989. }
  12990. }
  12991. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  12992. class ui_try_com3 extends fgui.GComponent {
  12993. static createInstance() {
  12994. return (fgui.UIPackage.createObject("game", "try_com3"));
  12995. }
  12996. onConstruct() {
  12997. this.n33 = (this.getChild("n33"));
  12998. this.n34 = (this.getChild("n34"));
  12999. this.n35 = (this.getChild("n35"));
  13000. this.t0 = this.getTransition("t0");
  13001. }
  13002. }
  13003. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13004. class ui_huihe1 extends fgui.GComponent {
  13005. static createInstance() {
  13006. return (fgui.UIPackage.createObject("game", "huihe1"));
  13007. }
  13008. onConstruct() {
  13009. this.n0 = (this.getChild("n0"));
  13010. this.n1 = (this.getChild("n1"));
  13011. this.t0 = this.getTransition("t0");
  13012. }
  13013. }
  13014. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13015. class ui_huihe2 extends fgui.GComponent {
  13016. static createInstance() {
  13017. return (fgui.UIPackage.createObject("game", "huihe2"));
  13018. }
  13019. onConstruct() {
  13020. this.n0 = (this.getChild("n0"));
  13021. this.n1 = (this.getChild("n1"));
  13022. this.t0 = this.getTransition("t0");
  13023. }
  13024. }
  13025. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13026. class ui_Component143 extends fgui.GComponent {
  13027. static createInstance() {
  13028. return (fgui.UIPackage.createObject("game", "Component143"));
  13029. }
  13030. onConstruct() {
  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.n7 = (this.getChild("n7"));
  13036. this.n8 = (this.getChild("n8"));
  13037. this.n9 = (this.getChild("n9"));
  13038. this.n10 = (this.getChild("n10"));
  13039. this.t0 = this.getTransition("t0");
  13040. }
  13041. }
  13042. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13043. class ui_dh_jingbi2 extends fgui.GComponent {
  13044. static createInstance() {
  13045. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13046. }
  13047. onConstruct() {
  13048. this.n0 = (this.getChild("n0"));
  13049. this.n1 = (this.getChild("n1"));
  13050. this.n2 = (this.getChild("n2"));
  13051. this.n3 = (this.getChild("n3"));
  13052. this.n4 = (this.getChild("n4"));
  13053. this.n5 = (this.getChild("n5"));
  13054. this.n6 = (this.getChild("n6"));
  13055. this.n8 = (this.getChild("n8"));
  13056. this.n10 = (this.getChild("n10"));
  13057. this.t0 = this.getTransition("t0");
  13058. }
  13059. }
  13060. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13061. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13062. static createInstance() {
  13063. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13064. }
  13065. onConstruct() {
  13066. this.n1 = (this.getChild("n1"));
  13067. this.n4 = (this.getChild("n4"));
  13068. this.t0 = this.getTransition("t0");
  13069. }
  13070. }
  13071. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13072. class ui_dh_jingbi3 extends fgui.GComponent {
  13073. static createInstance() {
  13074. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13075. }
  13076. onConstruct() {
  13077. this.n0 = (this.getChild("n0"));
  13078. this.n1 = (this.getChild("n1"));
  13079. this.n2 = (this.getChild("n2"));
  13080. this.n3 = (this.getChild("n3"));
  13081. this.n4 = (this.getChild("n4"));
  13082. this.n5 = (this.getChild("n5"));
  13083. this.n6 = (this.getChild("n6"));
  13084. this.n8 = (this.getChild("n8"));
  13085. this.n10 = (this.getChild("n10"));
  13086. this.t0 = this.getTransition("t0");
  13087. }
  13088. }
  13089. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13090. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13091. static createInstance() {
  13092. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13093. }
  13094. onConstruct() {
  13095. this.n3 = (this.getChild("n3"));
  13096. this.n1 = (this.getChild("n1"));
  13097. this.t0 = this.getTransition("t0");
  13098. }
  13099. }
  13100. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13101. class ui_hb_jinbi1 extends fgui.GButton {
  13102. static createInstance() {
  13103. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13104. }
  13105. onConstruct() {
  13106. this.n20 = (this.getChild("n20"));
  13107. this.n25 = (this.getChild("n25"));
  13108. this.coinTxt = (this.getChild("coinTxt"));
  13109. this.n28 = (this.getChild("n28"));
  13110. this.n32 = (this.getChild("n32"));
  13111. this.n38 = (this.getChild("n38"));
  13112. this.n45 = (this.getChild("n45"));
  13113. this.getTips = (this.getChild("getTips"));
  13114. this.n39 = (this.getChild("n39"));
  13115. this.diamondTxt = (this.getChild("diamondTxt"));
  13116. this.n41 = (this.getChild("n41"));
  13117. this.n42 = (this.getChild("n42"));
  13118. this.n46 = (this.getChild("n46"));
  13119. this.n47 = (this.getChild("n47"));
  13120. this.n48 = (this.getChild("n48"));
  13121. this.t0 = this.getTransition("t0");
  13122. }
  13123. }
  13124. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13125. class ui_hb_jinbi2 extends fgui.GButton {
  13126. static createInstance() {
  13127. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13128. }
  13129. onConstruct() {
  13130. this.n20 = (this.getChild("n20"));
  13131. this.n25 = (this.getChild("n25"));
  13132. this.coinTxt = (this.getChild("coinTxt"));
  13133. this.n28 = (this.getChild("n28"));
  13134. this.n32 = (this.getChild("n32"));
  13135. this.n38 = (this.getChild("n38"));
  13136. this.n39 = (this.getChild("n39"));
  13137. this.diamondTxt = (this.getChild("diamondTxt"));
  13138. this.n41 = (this.getChild("n41"));
  13139. this.n42 = (this.getChild("n42"));
  13140. this.n43 = (this.getChild("n43"));
  13141. this.n44 = (this.getChild("n44"));
  13142. this.n45 = (this.getChild("n45"));
  13143. this.t0 = this.getTransition("t0");
  13144. }
  13145. }
  13146. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13147. class ui_hb_jinbi3 extends fgui.GButton {
  13148. static createInstance() {
  13149. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13150. }
  13151. onConstruct() {
  13152. this.n20 = (this.getChild("n20"));
  13153. this.n25 = (this.getChild("n25"));
  13154. this.coinTxt = (this.getChild("coinTxt"));
  13155. this.n28 = (this.getChild("n28"));
  13156. this.n32 = (this.getChild("n32"));
  13157. this.n38 = (this.getChild("n38"));
  13158. this.n39 = (this.getChild("n39"));
  13159. this.diamondTxt = (this.getChild("diamondTxt"));
  13160. this.n41 = (this.getChild("n41"));
  13161. this.n42 = (this.getChild("n42"));
  13162. this.n43 = (this.getChild("n43"));
  13163. this.n44 = (this.getChild("n44"));
  13164. this.n45 = (this.getChild("n45"));
  13165. this.t0 = this.getTransition("t0");
  13166. }
  13167. }
  13168. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13169. class ui_Component104 extends fgui.GComponent {
  13170. static createInstance() {
  13171. return (fgui.UIPackage.createObject("game", "Component104"));
  13172. }
  13173. onConstruct() {
  13174. this.c1 = this.getController("c1");
  13175. this.n12 = (this.getChild("n12"));
  13176. this.coinBtn = (this.getChild("coinBtn"));
  13177. this.diamondBtn = (this.getChild("diamondBtn"));
  13178. this.node3 = (this.getChild("node3"));
  13179. this.node4 = (this.getChild("node4"));
  13180. this.node5 = (this.getChild("node5"));
  13181. this.node1 = (this.getChild("node1"));
  13182. this.node2 = (this.getChild("node2"));
  13183. this.node6 = (this.getChild("node6"));
  13184. this.t0 = this.getTransition("t0");
  13185. }
  13186. }
  13187. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13188. class ui_Component105 extends fgui.GButton {
  13189. static createInstance() {
  13190. return (fgui.UIPackage.createObject("game", "Component105"));
  13191. }
  13192. onConstruct() {
  13193. this.c1 = this.getController("c1");
  13194. this.n49 = (this.getChild("n49"));
  13195. this.n18 = (this.getChild("n18"));
  13196. this.n46 = (this.getChild("n46"));
  13197. this.n48 = (this.getChild("n48"));
  13198. }
  13199. }
  13200. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13201. class ui_Component106 extends fgui.GButton {
  13202. static createInstance() {
  13203. return (fgui.UIPackage.createObject("game", "Component106"));
  13204. }
  13205. onConstruct() {
  13206. this.c1 = this.getController("c1");
  13207. this.n49 = (this.getChild("n49"));
  13208. this.n18 = (this.getChild("n18"));
  13209. this.n46 = (this.getChild("n46"));
  13210. this.n48 = (this.getChild("n48"));
  13211. }
  13212. }
  13213. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13214. class ui_hb_zs1 extends fgui.GButton {
  13215. static createInstance() {
  13216. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13217. }
  13218. onConstruct() {
  13219. this.c1 = this.getController("c1");
  13220. this.n20 = (this.getChild("n20"));
  13221. this.n21 = (this.getChild("n21"));
  13222. this.n26 = (this.getChild("n26"));
  13223. this.n27 = (this.getChild("n27"));
  13224. this.shareTxt = (this.getChild("shareTxt"));
  13225. this.n32 = (this.getChild("n32"));
  13226. this.n38 = (this.getChild("n38"));
  13227. this.n39 = (this.getChild("n39"));
  13228. this.n44 = (this.getChild("n44"));
  13229. this.diamondTxt = (this.getChild("diamondTxt"));
  13230. this.n41 = (this.getChild("n41"));
  13231. this.n45 = (this.getChild("n45"));
  13232. this.n47 = (this.getChild("n47"));
  13233. this.n48 = (this.getChild("n48"));
  13234. this.randTxt = (this.getChild("randTxt"));
  13235. this.n50 = (this.getChild("n50"));
  13236. this.t0 = this.getTransition("t0");
  13237. }
  13238. }
  13239. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13240. class ui_dh_zs1 extends fgui.GComponent {
  13241. static createInstance() {
  13242. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13243. }
  13244. onConstruct() {
  13245. this.n10 = (this.getChild("n10"));
  13246. this.n9 = (this.getChild("n9"));
  13247. this.n1 = (this.getChild("n1"));
  13248. this.n2 = (this.getChild("n2"));
  13249. this.n3 = (this.getChild("n3"));
  13250. this.n4 = (this.getChild("n4"));
  13251. this.n5 = (this.getChild("n5"));
  13252. this.n6 = (this.getChild("n6"));
  13253. this.n8 = (this.getChild("n8"));
  13254. this.n11 = (this.getChild("n11"));
  13255. this.t0 = this.getTransition("t0");
  13256. }
  13257. }
  13258. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13259. class ui_dh_zs1_1 extends fgui.GComponent {
  13260. static createInstance() {
  13261. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13262. }
  13263. onConstruct() {
  13264. this.n3 = (this.getChild("n3"));
  13265. this.n1 = (this.getChild("n1"));
  13266. this.t0 = this.getTransition("t0");
  13267. }
  13268. }
  13269. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13270. class ui_hb_zs2 extends fgui.GButton {
  13271. static createInstance() {
  13272. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13273. }
  13274. onConstruct() {
  13275. this.n20 = (this.getChild("n20"));
  13276. this.n21 = (this.getChild("n21"));
  13277. this.n26 = (this.getChild("n26"));
  13278. this.n27 = (this.getChild("n27"));
  13279. this.n32 = (this.getChild("n32"));
  13280. this.n38 = (this.getChild("n38"));
  13281. this.n39 = (this.getChild("n39"));
  13282. this.n44 = (this.getChild("n44"));
  13283. this.diamondTxt = (this.getChild("diamondTxt"));
  13284. this.n41 = (this.getChild("n41"));
  13285. this.n45 = (this.getChild("n45"));
  13286. this.t0 = this.getTransition("t0");
  13287. }
  13288. }
  13289. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13290. class ui_hb_zs3 extends fgui.GButton {
  13291. static createInstance() {
  13292. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13293. }
  13294. onConstruct() {
  13295. this.n20 = (this.getChild("n20"));
  13296. this.n21 = (this.getChild("n21"));
  13297. this.n26 = (this.getChild("n26"));
  13298. this.n27 = (this.getChild("n27"));
  13299. this.n32 = (this.getChild("n32"));
  13300. this.n38 = (this.getChild("n38"));
  13301. this.n47 = (this.getChild("n47"));
  13302. this.t0 = this.getTransition("t0");
  13303. }
  13304. }
  13305. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13306. class ui_dh_zs2 extends fgui.GComponent {
  13307. static createInstance() {
  13308. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13309. }
  13310. onConstruct() {
  13311. this.n10 = (this.getChild("n10"));
  13312. this.n9 = (this.getChild("n9"));
  13313. this.n1 = (this.getChild("n1"));
  13314. this.n2 = (this.getChild("n2"));
  13315. this.n3 = (this.getChild("n3"));
  13316. this.n4 = (this.getChild("n4"));
  13317. this.n5 = (this.getChild("n5"));
  13318. this.n6 = (this.getChild("n6"));
  13319. this.n8 = (this.getChild("n8"));
  13320. this.n11 = (this.getChild("n11"));
  13321. this.t0 = this.getTransition("t0");
  13322. }
  13323. }
  13324. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13325. class ui_dh_zs2_1 extends fgui.GComponent {
  13326. static createInstance() {
  13327. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13328. }
  13329. onConstruct() {
  13330. this.n3 = (this.getChild("n3"));
  13331. this.n1 = (this.getChild("n1"));
  13332. this.t0 = this.getTransition("t0");
  13333. }
  13334. }
  13335. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13336. class ui_dh_zs3 extends fgui.GComponent {
  13337. static createInstance() {
  13338. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13339. }
  13340. onConstruct() {
  13341. this.n10 = (this.getChild("n10"));
  13342. this.n9 = (this.getChild("n9"));
  13343. this.n1 = (this.getChild("n1"));
  13344. this.n2 = (this.getChild("n2"));
  13345. this.n3 = (this.getChild("n3"));
  13346. this.n4 = (this.getChild("n4"));
  13347. this.n5 = (this.getChild("n5"));
  13348. this.n6 = (this.getChild("n6"));
  13349. this.n8 = (this.getChild("n8"));
  13350. this.n11 = (this.getChild("n11"));
  13351. this.t0 = this.getTransition("t0");
  13352. }
  13353. }
  13354. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13355. class ui_dh_zs3_1 extends fgui.GComponent {
  13356. static createInstance() {
  13357. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13358. }
  13359. onConstruct() {
  13360. this.n3 = (this.getChild("n3"));
  13361. this.n1 = (this.getChild("n1"));
  13362. this.t0 = this.getTransition("t0");
  13363. }
  13364. }
  13365. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13366. class ui_Component107 extends fgui.GComponent {
  13367. static createInstance() {
  13368. return (fgui.UIPackage.createObject("game", "Component107"));
  13369. }
  13370. onConstruct() {
  13371. this.n18 = (this.getChild("n18"));
  13372. this.n19 = (this.getChild("n19"));
  13373. this.n20 = (this.getChild("n20"));
  13374. this.n21 = (this.getChild("n21"));
  13375. this.n22 = (this.getChild("n22"));
  13376. this.levelTxt = (this.getChild("levelTxt"));
  13377. this.t0 = this.getTransition("t0");
  13378. }
  13379. }
  13380. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13381. class ui_box_com1 extends fgui.GComponent {
  13382. static createInstance() {
  13383. return (fgui.UIPackage.createObject("game", "box_com1"));
  13384. }
  13385. onConstruct() {
  13386. this.n14 = (this.getChild("n14"));
  13387. this.n6 = (this.getChild("n6"));
  13388. this.t0 = this.getTransition("t0");
  13389. }
  13390. }
  13391. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13392. class ui_box_com2 extends fgui.GProgressBar {
  13393. static createInstance() {
  13394. return (fgui.UIPackage.createObject("game", "box_com2"));
  13395. }
  13396. onConstruct() {
  13397. this.bg0 = (this.getChild("bg0"));
  13398. this.bg = (this.getChild("bg"));
  13399. this.bar = (this.getChild("bar"));
  13400. this.n7 = (this.getChild("n7"));
  13401. this.n8 = (this.getChild("n8"));
  13402. this.n10 = (this.getChild("n10"));
  13403. this.n11 = (this.getChild("n11"));
  13404. this.n12 = (this.getChild("n12"));
  13405. }
  13406. }
  13407. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13408. class ui_box_com4 extends fgui.GComponent {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "box_com4"));
  13411. }
  13412. onConstruct() {
  13413. this.n8 = (this.getChild("n8"));
  13414. this.t0 = this.getTransition("t0");
  13415. }
  13416. }
  13417. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13418. class ui_box_com3 extends fgui.GComponent {
  13419. static createInstance() {
  13420. return (fgui.UIPackage.createObject("game", "box_com3"));
  13421. }
  13422. onConstruct() {
  13423. this.n2 = (this.getChild("n2"));
  13424. this.n3 = (this.getChild("n3"));
  13425. this.n4 = (this.getChild("n4"));
  13426. this.n5 = (this.getChild("n5"));
  13427. this.t0 = this.getTransition("t0");
  13428. this.t1 = this.getTransition("t1");
  13429. }
  13430. }
  13431. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13432. class ui_Component97 extends fgui.GComponent {
  13433. static createInstance() {
  13434. return (fgui.UIPackage.createObject("game", "Component97"));
  13435. }
  13436. onConstruct() {
  13437. this.c1 = this.getController("c1");
  13438. this.n46 = (this.getChild("n46"));
  13439. this.diamondNode = (this.getChild("diamondNode"));
  13440. this.coinNode = (this.getChild("coinNode"));
  13441. this.t0 = this.getTransition("t0");
  13442. }
  13443. }
  13444. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13445. class ui_Component98 extends fgui.GButton {
  13446. static createInstance() {
  13447. return (fgui.UIPackage.createObject("game", "Component98"));
  13448. }
  13449. onConstruct() {
  13450. this.n8 = (this.getChild("n8"));
  13451. this.n40 = (this.getChild("n40"));
  13452. }
  13453. }
  13454. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13455. class ui_Component28_11 extends fgui.GButton {
  13456. static createInstance() {
  13457. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13458. }
  13459. onConstruct() {
  13460. this.c1 = this.getController("c1");
  13461. this.n12 = (this.getChild("n12"));
  13462. this.n17 = (this.getChild("n17"));
  13463. this.n13 = (this.getChild("n13"));
  13464. this.diamondTxt = (this.getChild("diamondTxt"));
  13465. this.n15 = (this.getChild("n15"));
  13466. this.n16 = (this.getChild("n16"));
  13467. }
  13468. }
  13469. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13470. class ui_Component58_11 extends fgui.GComponent {
  13471. static createInstance() {
  13472. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13473. }
  13474. onConstruct() {
  13475. this.c1 = this.getController("c1");
  13476. this.n23 = (this.getChild("n23"));
  13477. this.n41 = (this.getChild("n41"));
  13478. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13479. this.n_daoju = (this.getChild("n_daoju"));
  13480. this.myList = (this.getChild("myList"));
  13481. this.djList = (this.getChild("djList"));
  13482. this.t0 = this.getTransition("t0");
  13483. }
  13484. }
  13485. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13486. class ui_Component100 extends fgui.GComponent {
  13487. static createInstance() {
  13488. return (fgui.UIPackage.createObject("game", "Component100"));
  13489. }
  13490. onConstruct() {
  13491. this.c1 = this.getController("c1");
  13492. this.n75 = (this.getChild("n75"));
  13493. this.n76 = (this.getChild("n76"));
  13494. this.n80 = (this.getChild("n80"));
  13495. this.txt = (this.getChild("txt"));
  13496. this.spineRoot = (this.getChild("spineRoot"));
  13497. }
  13498. }
  13499. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13500. class ui_Component101 extends fgui.GComponent {
  13501. static createInstance() {
  13502. return (fgui.UIPackage.createObject("game", "Component101"));
  13503. }
  13504. onConstruct() {
  13505. this.c1 = this.getController("c1");
  13506. this.n36 = (this.getChild("n36"));
  13507. this.n35 = (this.getChild("n35"));
  13508. this.n33 = (this.getChild("n33"));
  13509. this.n34 = (this.getChild("n34"));
  13510. }
  13511. }
  13512. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13513. class ui_Component53 extends fgui.GComponent {
  13514. static createInstance() {
  13515. return (fgui.UIPackage.createObject("game", "Component53"));
  13516. }
  13517. onConstruct() {
  13518. this.n0 = (this.getChild("n0"));
  13519. this.n1 = (this.getChild("n1"));
  13520. this.n2 = (this.getChild("n2"));
  13521. this.n3 = (this.getChild("n3"));
  13522. this.n4 = (this.getChild("n4"));
  13523. this.n5 = (this.getChild("n5"));
  13524. this.n6 = (this.getChild("n6"));
  13525. this.n7 = (this.getChild("n7"));
  13526. this.n8 = (this.getChild("n8"));
  13527. this.n9 = (this.getChild("n9"));
  13528. this.n10 = (this.getChild("n10"));
  13529. this.n11 = (this.getChild("n11"));
  13530. this.n12 = (this.getChild("n12"));
  13531. this.n13 = (this.getChild("n13"));
  13532. this.n14 = (this.getChild("n14"));
  13533. this.n15 = (this.getChild("n15"));
  13534. this.n16 = (this.getChild("n16"));
  13535. this.n19 = (this.getChild("n19"));
  13536. this.n20 = (this.getChild("n20"));
  13537. this.n21 = (this.getChild("n21"));
  13538. this.n22 = (this.getChild("n22"));
  13539. this.n23 = (this.getChild("n23"));
  13540. this.n24 = (this.getChild("n24"));
  13541. this.n25 = (this.getChild("n25"));
  13542. this.n26 = (this.getChild("n26"));
  13543. this.n27 = (this.getChild("n27"));
  13544. this.n28 = (this.getChild("n28"));
  13545. this.n29 = (this.getChild("n29"));
  13546. this.n30 = (this.getChild("n30"));
  13547. this.n31 = (this.getChild("n31"));
  13548. this.n32 = (this.getChild("n32"));
  13549. this.n33 = (this.getChild("n33"));
  13550. this.n34 = (this.getChild("n34"));
  13551. this.n35 = (this.getChild("n35"));
  13552. this.t0 = this.getTransition("t0");
  13553. }
  13554. }
  13555. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13556. class ui_Component58 extends fgui.GComponent {
  13557. static createInstance() {
  13558. return (fgui.UIPackage.createObject("game", "Component58"));
  13559. }
  13560. onConstruct() {
  13561. this.n23 = (this.getChild("n23"));
  13562. this.n41 = (this.getChild("n41"));
  13563. this.n8 = (this.getChild("n8"));
  13564. this.skillList = (this.getChild("skillList"));
  13565. this.t0 = this.getTransition("t0");
  13566. }
  13567. }
  13568. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13569. class ui_Component59 extends fgui.GComponent {
  13570. static createInstance() {
  13571. return (fgui.UIPackage.createObject("game", "Component59"));
  13572. }
  13573. onConstruct() {
  13574. this.n3 = (this.getChild("n3"));
  13575. this.msgTxt = (this.getChild("msgTxt"));
  13576. this.t0 = this.getTransition("t0");
  13577. }
  13578. }
  13579. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13580. class ui_RulerNode extends fgui.GComponent {
  13581. static createInstance() {
  13582. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13583. }
  13584. onConstruct() {
  13585. this.n6 = (this.getChild("n6"));
  13586. this.n4 = (this.getChild("n4"));
  13587. this.img1 = (this.getChild("img1"));
  13588. this.img2 = (this.getChild("img2"));
  13589. }
  13590. }
  13591. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13592. class ui_Component108 extends fgui.GComponent {
  13593. static createInstance() {
  13594. return (fgui.UIPackage.createObject("game", "Component108"));
  13595. }
  13596. onConstruct() {
  13597. this.n19 = (this.getChild("n19"));
  13598. this.t0 = this.getTransition("t0");
  13599. }
  13600. }
  13601. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13602. class ui_Component63 extends fgui.GComponent {
  13603. static createInstance() {
  13604. return (fgui.UIPackage.createObject("game", "Component63"));
  13605. }
  13606. onConstruct() {
  13607. this.n66 = (this.getChild("n66"));
  13608. this.n56 = (this.getChild("n56"));
  13609. this.n63 = (this.getChild("n63"));
  13610. this.n65 = (this.getChild("n65"));
  13611. this.t0 = this.getTransition("t0");
  13612. }
  13613. }
  13614. ui_Component63.URL = "ui://isxx5ak7h657452";
  13615. class ui_topNode extends fgui.GComponent {
  13616. static createInstance() {
  13617. return (fgui.UIPackage.createObject("game", "topNode"));
  13618. }
  13619. onConstruct() {
  13620. this.selfProgress = (this.getChild("selfProgress"));
  13621. this.aiProgress = (this.getChild("aiProgress"));
  13622. this.selfKuang = (this.getChild("selfKuang"));
  13623. this.aiKuang = (this.getChild("aiKuang"));
  13624. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13625. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13626. this.n33 = (this.getChild("n33"));
  13627. this.n34 = (this.getChild("n34"));
  13628. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13629. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13630. this.selfBallList = (this.getChild("selfBallList"));
  13631. this.aiBallList = (this.getChild("aiBallList"));
  13632. this.middleNode = (this.getChild("middleNode"));
  13633. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13634. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13635. this.scoreNode = (this.getChild("scoreNode"));
  13636. this.selfTips = (this.getChild("selfTips"));
  13637. this.aiTips = (this.getChild("aiTips"));
  13638. }
  13639. }
  13640. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13641. class ui_selfProgress extends fgui.GProgressBar {
  13642. static createInstance() {
  13643. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13644. }
  13645. onConstruct() {
  13646. this.n3 = (this.getChild("n3"));
  13647. this.bar = (this.getChild("bar"));
  13648. }
  13649. }
  13650. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13651. class ui_aiProgress extends fgui.GProgressBar {
  13652. static createInstance() {
  13653. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13654. }
  13655. onConstruct() {
  13656. this.n3 = (this.getChild("n3"));
  13657. this.bar = (this.getChild("bar"));
  13658. }
  13659. }
  13660. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13661. class ui_ballDisplay extends fgui.GComponent {
  13662. static createInstance() {
  13663. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13664. }
  13665. onConstruct() {
  13666. this.myImg = (this.getChild("myImg"));
  13667. }
  13668. }
  13669. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13670. class ui_moveNode extends fgui.GComponent {
  13671. static createInstance() {
  13672. return (fgui.UIPackage.createObject("game", "moveNode"));
  13673. }
  13674. onConstruct() {
  13675. this.n8 = (this.getChild("n8"));
  13676. this.finger = (this.getChild("finger"));
  13677. }
  13678. }
  13679. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13680. class ui_cancelBtn extends fgui.GButton {
  13681. static createInstance() {
  13682. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13683. }
  13684. onConstruct() {
  13685. this.c1 = this.getController("c1");
  13686. this.n0 = (this.getChild("n0"));
  13687. this.n1 = (this.getChild("n1"));
  13688. }
  13689. }
  13690. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13691. class ui_shareBtn extends fgui.GButton {
  13692. static createInstance() {
  13693. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13694. }
  13695. onConstruct() {
  13696. this.c1 = this.getController("c1");
  13697. this.n2 = (this.getChild("n2"));
  13698. this.n1 = (this.getChild("n1"));
  13699. this.n3 = (this.getChild("n3"));
  13700. this.n4 = (this.getChild("n4"));
  13701. this.n5 = (this.getChild("n5"));
  13702. this.n6 = (this.getChild("n6"));
  13703. }
  13704. }
  13705. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13706. class ui_share2Btn extends fgui.GButton {
  13707. static createInstance() {
  13708. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13709. }
  13710. onConstruct() {
  13711. this.n3 = (this.getChild("n3"));
  13712. }
  13713. }
  13714. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13715. class ui_rodMethodNode extends fgui.GComponent {
  13716. static createInstance() {
  13717. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13718. }
  13719. onConstruct() {
  13720. this.bg = (this.getChild("bg"));
  13721. this.dot = (this.getChild("dot"));
  13722. }
  13723. }
  13724. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13725. class ui_sureBtn extends fgui.GButton {
  13726. static createInstance() {
  13727. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13728. }
  13729. onConstruct() {
  13730. this.n2 = (this.getChild("n2"));
  13731. this.n1 = (this.getChild("n1"));
  13732. }
  13733. }
  13734. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13735. class ui_Component18 extends fgui.GComponent {
  13736. static createInstance() {
  13737. return (fgui.UIPackage.createObject("game", "Component18"));
  13738. }
  13739. onConstruct() {
  13740. this.c1 = this.getController("c1");
  13741. this.nameTxt = (this.getChild("nameTxt"));
  13742. this.headImg = (this.getChild("headImg"));
  13743. this.n24 = (this.getChild("n24"));
  13744. this.skillImg = (this.getChild("skillImg"));
  13745. this.skillTxt = (this.getChild("skillTxt"));
  13746. }
  13747. }
  13748. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  13749. class ui_Component45 extends fgui.GComponent {
  13750. static createInstance() {
  13751. return (fgui.UIPackage.createObject("game", "Component45"));
  13752. }
  13753. onConstruct() {
  13754. this.c1 = this.getController("c1");
  13755. this.n40 = (this.getChild("n40"));
  13756. this.n41 = (this.getChild("n41"));
  13757. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  13758. this.n42 = (this.getChild("n42"));
  13759. this.awardTxt = (this.getChild("awardTxt"));
  13760. this.n44 = (this.getChild("n44"));
  13761. this.t0 = this.getTransition("t0");
  13762. }
  13763. }
  13764. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  13765. class ui_emotionDisplay extends fgui.GButton {
  13766. static createInstance() {
  13767. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  13768. }
  13769. onConstruct() {
  13770. this.myIcon = (this.getChild("myIcon"));
  13771. }
  13772. }
  13773. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  13774. class ui_Component49 extends fgui.GButton {
  13775. static createInstance() {
  13776. return (fgui.UIPackage.createObject("game", "Component49"));
  13777. }
  13778. onConstruct() {
  13779. this.n69 = (this.getChild("n69"));
  13780. this.n56 = (this.getChild("n56"));
  13781. }
  13782. }
  13783. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  13784. class ui_Component50 extends fgui.GButton {
  13785. static createInstance() {
  13786. return (fgui.UIPackage.createObject("game", "Component50"));
  13787. }
  13788. onConstruct() {
  13789. this.n54 = (this.getChild("n54"));
  13790. this.n65 = (this.getChild("n65"));
  13791. }
  13792. }
  13793. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  13794. class ui_Component51 extends fgui.GButton {
  13795. static createInstance() {
  13796. return (fgui.UIPackage.createObject("game", "Component51"));
  13797. }
  13798. onConstruct() {
  13799. this.c1 = this.getController("c1");
  13800. this.n51 = (this.getChild("n51"));
  13801. this.n54 = (this.getChild("n54"));
  13802. }
  13803. }
  13804. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  13805. class ui_Button5 extends fgui.GButton {
  13806. static createInstance() {
  13807. return (fgui.UIPackage.createObject("game", "Button5"));
  13808. }
  13809. onConstruct() {
  13810. this.c1 = this.getController("c1");
  13811. this.n0 = (this.getChild("n0"));
  13812. this.n2 = (this.getChild("n2"));
  13813. }
  13814. }
  13815. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  13816. class ui_Component124 extends fgui.GComponent {
  13817. static createInstance() {
  13818. return (fgui.UIPackage.createObject("game", "Component124"));
  13819. }
  13820. onConstruct() {
  13821. this.n22 = (this.getChild("n22"));
  13822. this.shareNode = (this.getChild("shareNode"));
  13823. }
  13824. }
  13825. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  13826. class ui_Component125 extends fgui.GComponent {
  13827. static createInstance() {
  13828. return (fgui.UIPackage.createObject("game", "Component125"));
  13829. }
  13830. onConstruct() {
  13831. this.n29 = (this.getChild("n29"));
  13832. this.coinTxt = (this.getChild("coinTxt"));
  13833. }
  13834. }
  13835. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  13836. class ui_Component52 extends fgui.GButton {
  13837. static createInstance() {
  13838. return (fgui.UIPackage.createObject("game", "Component52"));
  13839. }
  13840. onConstruct() {
  13841. this.n35 = (this.getChild("n35"));
  13842. this.n36 = (this.getChild("n36"));
  13843. }
  13844. }
  13845. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  13846. class ui_Component_fl_1 extends fgui.GComponent {
  13847. static createInstance() {
  13848. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  13849. }
  13850. onConstruct() {
  13851. this.n0 = (this.getChild("n0"));
  13852. this.n6 = (this.getChild("n6"));
  13853. this.n7 = (this.getChild("n7"));
  13854. this.n8 = (this.getChild("n8"));
  13855. this.n5 = (this.getChild("n5"));
  13856. this.n9 = (this.getChild("n9"));
  13857. this.n10 = (this.getChild("n10"));
  13858. this.txt_price = (this.getChild("txt_price"));
  13859. this.n_no = (this.getChild("n_no"));
  13860. this.n_buy = (this.getChild("n_buy"));
  13861. }
  13862. }
  13863. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  13864. class ui_Component_fl_2 extends fgui.GComponent {
  13865. static createInstance() {
  13866. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  13867. }
  13868. onConstruct() {
  13869. this.n0 = (this.getChild("n0"));
  13870. this.txt_price = (this.getChild("txt_price"));
  13871. this.n4 = (this.getChild("n4"));
  13872. this.n6 = (this.getChild("n6"));
  13873. this.n7 = (this.getChild("n7"));
  13874. this.n5 = (this.getChild("n5"));
  13875. this.n8 = (this.getChild("n8"));
  13876. this.n9 = (this.getChild("n9"));
  13877. this.n_no = (this.getChild("n_no"));
  13878. this.n_buy = (this.getChild("n_buy"));
  13879. }
  13880. }
  13881. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  13882. class ui_drawBtn extends fgui.GButton {
  13883. static createInstance() {
  13884. return (fgui.UIPackage.createObject("game", "drawBtn"));
  13885. }
  13886. onConstruct() {
  13887. this.c1 = this.getController("c1");
  13888. this.n2 = (this.getChild("n2"));
  13889. this.n1 = (this.getChild("n1"));
  13890. this.n5 = (this.getChild("n5"));
  13891. }
  13892. }
  13893. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  13894. class ui_Component43 extends fgui.GButton {
  13895. static createInstance() {
  13896. return (fgui.UIPackage.createObject("game", "Component43"));
  13897. }
  13898. onConstruct() {
  13899. this.n49 = (this.getChild("n49"));
  13900. }
  13901. }
  13902. ui_Component43.URL = "ui://isxx5ak7iveg434";
  13903. class ui_wordsDisplay extends fgui.GComponent {
  13904. static createInstance() {
  13905. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  13906. }
  13907. onConstruct() {
  13908. this.txt = (this.getChild("txt"));
  13909. this.n63 = (this.getChild("n63"));
  13910. }
  13911. }
  13912. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  13913. class ui_Component_phb extends fgui.GComponent {
  13914. static createInstance() {
  13915. return (fgui.UIPackage.createObject("game", "Component_phb"));
  13916. }
  13917. onConstruct() {
  13918. this.n3 = (this.getChild("n3"));
  13919. this.n4 = (this.getChild("n4"));
  13920. }
  13921. }
  13922. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  13923. class ui_Component3 extends fgui.GComponent {
  13924. static createInstance() {
  13925. return (fgui.UIPackage.createObject("game", "Component3"));
  13926. }
  13927. onConstruct() {
  13928. this.n26 = (this.getChild("n26"));
  13929. this.n24 = (this.getChild("n24"));
  13930. this.nameTxt = (this.getChild("nameTxt"));
  13931. this.headRoot = (this.getChild("headRoot"));
  13932. }
  13933. }
  13934. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  13935. class ui_Component4 extends fgui.GComponent {
  13936. static createInstance() {
  13937. return (fgui.UIPackage.createObject("game", "Component4"));
  13938. }
  13939. onConstruct() {
  13940. this.headImg = (this.getChild("headImg"));
  13941. }
  13942. }
  13943. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  13944. class ui_Component7 extends fgui.GButton {
  13945. static createInstance() {
  13946. return (fgui.UIPackage.createObject("game", "Component7"));
  13947. }
  13948. onConstruct() {
  13949. this.n17 = (this.getChild("n17"));
  13950. }
  13951. }
  13952. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  13953. class ui_Component8 extends fgui.GButton {
  13954. static createInstance() {
  13955. return (fgui.UIPackage.createObject("game", "Component8"));
  13956. }
  13957. onConstruct() {
  13958. this.n19 = (this.getChild("n19"));
  13959. }
  13960. }
  13961. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  13962. class ui_Component10 extends fgui.GButton {
  13963. static createInstance() {
  13964. return (fgui.UIPackage.createObject("game", "Component10"));
  13965. }
  13966. onConstruct() {
  13967. this.c1 = this.getController("c1");
  13968. this.n40 = (this.getChild("n40"));
  13969. }
  13970. }
  13971. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  13972. class ui_Component11 extends fgui.GButton {
  13973. static createInstance() {
  13974. return (fgui.UIPackage.createObject("game", "Component11"));
  13975. }
  13976. onConstruct() {
  13977. this.n34 = (this.getChild("n34"));
  13978. }
  13979. }
  13980. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  13981. class ui_Component12 extends fgui.GButton {
  13982. static createInstance() {
  13983. return (fgui.UIPackage.createObject("game", "Component12"));
  13984. }
  13985. onConstruct() {
  13986. this.n35 = (this.getChild("n35"));
  13987. }
  13988. }
  13989. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  13990. class ui_Component13 extends fgui.GButton {
  13991. static createInstance() {
  13992. return (fgui.UIPackage.createObject("game", "Component13"));
  13993. }
  13994. onConstruct() {
  13995. this.n27 = (this.getChild("n27"));
  13996. this.n36 = (this.getChild("n36"));
  13997. }
  13998. }
  13999. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14000. class ui_dh_js_tuowei extends fgui.GComponent {
  14001. static createInstance() {
  14002. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14003. }
  14004. onConstruct() {
  14005. this.n19 = (this.getChild("n19"));
  14006. this.n18 = (this.getChild("n18"));
  14007. this.n0 = (this.getChild("n0"));
  14008. this.n3 = (this.getChild("n3"));
  14009. this.n4 = (this.getChild("n4"));
  14010. this.n5 = (this.getChild("n5"));
  14011. this.n6 = (this.getChild("n6"));
  14012. this.n8 = (this.getChild("n8"));
  14013. this.n9 = (this.getChild("n9"));
  14014. this.n10 = (this.getChild("n10"));
  14015. this.n11 = (this.getChild("n11"));
  14016. this.n12 = (this.getChild("n12"));
  14017. this.n13 = (this.getChild("n13"));
  14018. this.n14 = (this.getChild("n14"));
  14019. this.n15 = (this.getChild("n15"));
  14020. this.n20 = (this.getChild("n20"));
  14021. this.t0 = this.getTransition("t0");
  14022. this.t1 = this.getTransition("t1");
  14023. }
  14024. }
  14025. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14026. class ui_dh_js_tw_g extends fgui.GComponent {
  14027. static createInstance() {
  14028. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14029. }
  14030. onConstruct() {
  14031. this.n0 = (this.getChild("n0"));
  14032. this.n1 = (this.getChild("n1"));
  14033. this.t0 = this.getTransition("t0");
  14034. }
  14035. }
  14036. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14037. class ui_dh_js_xingxing extends fgui.GComponent {
  14038. static createInstance() {
  14039. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14040. }
  14041. onConstruct() {
  14042. this.n1 = (this.getChild("n1"));
  14043. this.n2 = (this.getChild("n2"));
  14044. this.n3 = (this.getChild("n3"));
  14045. this.n4 = (this.getChild("n4"));
  14046. this.n0 = (this.getChild("n0"));
  14047. this.t2 = this.getTransition("t2");
  14048. this.t1 = this.getTransition("t1");
  14049. }
  14050. }
  14051. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14052. class ui_dh_zy_jiazai extends fgui.GComponent {
  14053. static createInstance() {
  14054. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14055. }
  14056. onConstruct() {
  14057. this.c1 = this.getController("c1");
  14058. this.n0 = (this.getChild("n0"));
  14059. this.n1 = (this.getChild("n1"));
  14060. this.n2 = (this.getChild("n2"));
  14061. this.n4 = (this.getChild("n4"));
  14062. this.n5 = (this.getChild("n5"));
  14063. this.n6 = (this.getChild("n6"));
  14064. this.n8 = (this.getChild("n8"));
  14065. this.n7 = (this.getChild("n7"));
  14066. this.t0 = this.getTransition("t0");
  14067. }
  14068. }
  14069. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14070. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14071. static createInstance() {
  14072. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14073. }
  14074. onConstruct() {
  14075. this.c1 = this.getController("c1");
  14076. this.n3 = (this.getChild("n3"));
  14077. this.n5 = (this.getChild("n5"));
  14078. this.n4 = (this.getChild("n4"));
  14079. this.n0 = (this.getChild("n0"));
  14080. this.n1 = (this.getChild("n1"));
  14081. this.n2 = (this.getChild("n2"));
  14082. }
  14083. }
  14084. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14085. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14086. static createInstance() {
  14087. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14088. }
  14089. onConstruct() {
  14090. this.n19 = (this.getChild("n19"));
  14091. this.n21 = (this.getChild("n21"));
  14092. this.n0 = (this.getChild("n0"));
  14093. this.n3 = (this.getChild("n3"));
  14094. this.n4 = (this.getChild("n4"));
  14095. this.n5 = (this.getChild("n5"));
  14096. this.n6 = (this.getChild("n6"));
  14097. this.n8 = (this.getChild("n8"));
  14098. this.n9 = (this.getChild("n9"));
  14099. this.n10 = (this.getChild("n10"));
  14100. this.n11 = (this.getChild("n11"));
  14101. this.n12 = (this.getChild("n12"));
  14102. this.n13 = (this.getChild("n13"));
  14103. this.n14 = (this.getChild("n14"));
  14104. this.n15 = (this.getChild("n15"));
  14105. this.n23 = (this.getChild("n23"));
  14106. this.t0 = this.getTransition("t0");
  14107. this.t1 = this.getTransition("t1");
  14108. }
  14109. }
  14110. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14111. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14112. static createInstance() {
  14113. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14114. }
  14115. onConstruct() {
  14116. this.n1 = (this.getChild("n1"));
  14117. this.n2 = (this.getChild("n2"));
  14118. this.t0 = this.getTransition("t0");
  14119. }
  14120. }
  14121. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14122. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14123. static createInstance() {
  14124. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14125. }
  14126. onConstruct() {
  14127. this.n4 = (this.getChild("n4"));
  14128. this.n2 = (this.getChild("n2"));
  14129. this.n3 = (this.getChild("n3"));
  14130. this.idle = this.getTransition("idle");
  14131. this.attack = this.getTransition("attack");
  14132. }
  14133. }
  14134. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14135. class ui_special extends fgui.GComponent {
  14136. static createInstance() {
  14137. return (fgui.UIPackage.createObject("game", "special"));
  14138. }
  14139. onConstruct() {
  14140. this.n18 = (this.getChild("n18"));
  14141. this.n19 = (this.getChild("n19"));
  14142. this.n20 = (this.getChild("n20"));
  14143. this.n21 = (this.getChild("n21"));
  14144. this.n22 = (this.getChild("n22"));
  14145. this.levelTxt = (this.getChild("levelTxt"));
  14146. this.n24 = (this.getChild("n24"));
  14147. this.n25 = (this.getChild("n25"));
  14148. this.t0 = this.getTransition("t0");
  14149. }
  14150. }
  14151. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14152. class ui_Component145 extends fgui.GComponent {
  14153. static createInstance() {
  14154. return (fgui.UIPackage.createObject("game", "Component145"));
  14155. }
  14156. onConstruct() {
  14157. this.guanyuNode = (this.getChild("guanyuNode"));
  14158. }
  14159. }
  14160. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14161. class ui_longBtn extends fgui.GButton {
  14162. static createInstance() {
  14163. return (fgui.UIPackage.createObject("game", "longBtn"));
  14164. }
  14165. onConstruct() {
  14166. this.c1 = this.getController("c1");
  14167. this.n2 = (this.getChild("n2"));
  14168. this.n1 = (this.getChild("n1"));
  14169. this.n4 = (this.getChild("n4"));
  14170. }
  14171. }
  14172. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14173. class ui_Component146 extends fgui.GComponent {
  14174. static createInstance() {
  14175. return (fgui.UIPackage.createObject("game", "Component146"));
  14176. }
  14177. onConstruct() {
  14178. this.n89 = (this.getChild("n89"));
  14179. this.n90 = (this.getChild("n90"));
  14180. this.guideBtn = (this.getChild("guideBtn"));
  14181. }
  14182. }
  14183. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14184. class ui_Component146_11 extends fgui.GComponent {
  14185. static createInstance() {
  14186. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14187. }
  14188. onConstruct() {
  14189. this.n89 = (this.getChild("n89"));
  14190. this.n90 = (this.getChild("n90"));
  14191. this.guideBtn = (this.getChild("guideBtn"));
  14192. }
  14193. }
  14194. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14195. class ui_Component111_1 extends fgui.GComponent {
  14196. static createInstance() {
  14197. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14198. }
  14199. onConstruct() {
  14200. this.n68 = (this.getChild("n68"));
  14201. this.myMask = (this.getChild("myMask"));
  14202. }
  14203. }
  14204. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14205. class ui_Component64_1 extends fgui.GComponent {
  14206. static createInstance() {
  14207. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14208. }
  14209. onConstruct() {
  14210. this.n57 = (this.getChild("n57"));
  14211. this.n54 = (this.getChild("n54"));
  14212. this.n55 = (this.getChild("n55"));
  14213. this.n56 = (this.getChild("n56"));
  14214. this.t1 = this.getTransition("t1");
  14215. }
  14216. }
  14217. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14218. class ui_ModeSelection_com123 extends fgui.GComponent {
  14219. static createInstance() {
  14220. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14221. }
  14222. onConstruct() {
  14223. this.type1 = (this.getChild("type1"));
  14224. this.type2 = (this.getChild("type2"));
  14225. this.type3 = (this.getChild("type3"));
  14226. this.n38 = (this.getChild("n38"));
  14227. this.t0 = this.getTransition("t0");
  14228. }
  14229. }
  14230. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14231. class ui_Component132_2 extends fgui.GComponent {
  14232. static createInstance() {
  14233. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14234. }
  14235. onConstruct() {
  14236. this.n25 = (this.getChild("n25"));
  14237. this.n26 = (this.getChild("n26"));
  14238. this.n27 = (this.getChild("n27"));
  14239. this.t0 = this.getTransition("t0");
  14240. }
  14241. }
  14242. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14243. class ui_UIPower$1 extends fgui.GComponent {
  14244. static createInstance() {
  14245. return (fgui.UIPackage.createObject("game", "UIPower"));
  14246. }
  14247. onConstruct() {
  14248. this.n11 = (this.getChild("n11"));
  14249. this.myNode = (this.getChild("myNode"));
  14250. this.t0 = this.getTransition("t0");
  14251. }
  14252. }
  14253. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14254. class ui_Component133 extends fgui.GComponent {
  14255. static createInstance() {
  14256. return (fgui.UIPackage.createObject("game", "Component133"));
  14257. }
  14258. onConstruct() {
  14259. this.n29 = (this.getChild("n29"));
  14260. this.n30 = (this.getChild("n30"));
  14261. }
  14262. }
  14263. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14264. class ui_Component134 extends fgui.GComponent {
  14265. static createInstance() {
  14266. return (fgui.UIPackage.createObject("game", "Component134"));
  14267. }
  14268. onConstruct() {
  14269. this.n30 = (this.getChild("n30"));
  14270. this.n31 = (this.getChild("n31"));
  14271. this.t0 = this.getTransition("t0");
  14272. }
  14273. }
  14274. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14275. class ui_Component135 extends fgui.GComponent {
  14276. static createInstance() {
  14277. return (fgui.UIPackage.createObject("game", "Component135"));
  14278. }
  14279. onConstruct() {
  14280. this.n30 = (this.getChild("n30"));
  14281. this.t0 = this.getTransition("t0");
  14282. }
  14283. }
  14284. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14285. class ui_Component137 extends fgui.GComponent {
  14286. static createInstance() {
  14287. return (fgui.UIPackage.createObject("game", "Component137"));
  14288. }
  14289. onConstruct() {
  14290. this.n28 = (this.getChild("n28"));
  14291. this.n29 = (this.getChild("n29"));
  14292. this.n30 = (this.getChild("n30"));
  14293. this.n32 = (this.getChild("n32"));
  14294. }
  14295. }
  14296. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14297. class ui_dh_zuanshi extends fgui.GButton {
  14298. static createInstance() {
  14299. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14300. }
  14301. onConstruct() {
  14302. this.n1 = (this.getChild("n1"));
  14303. this.n2 = (this.getChild("n2"));
  14304. this.n0 = (this.getChild("n0"));
  14305. this.n3 = (this.getChild("n3"));
  14306. this.n4 = (this.getChild("n4"));
  14307. }
  14308. }
  14309. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14310. class ui_Component138 extends fgui.GComponent {
  14311. static createInstance() {
  14312. return (fgui.UIPackage.createObject("game", "Component138"));
  14313. }
  14314. onConstruct() {
  14315. this.n1 = (this.getChild("n1"));
  14316. this.n2 = (this.getChild("n2"));
  14317. this.t0 = this.getTransition("t0");
  14318. }
  14319. }
  14320. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14321. class ui_Component139 extends fgui.GComponent {
  14322. static createInstance() {
  14323. return (fgui.UIPackage.createObject("game", "Component139"));
  14324. }
  14325. onConstruct() {
  14326. this.n0 = (this.getChild("n0"));
  14327. this.t0 = this.getTransition("t0");
  14328. }
  14329. }
  14330. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14331. class ui_Component140 extends fgui.GComponent {
  14332. static createInstance() {
  14333. return (fgui.UIPackage.createObject("game", "Component140"));
  14334. }
  14335. onConstruct() {
  14336. this.n2 = (this.getChild("n2"));
  14337. this.n3 = (this.getChild("n3"));
  14338. this.t0 = this.getTransition("t0");
  14339. }
  14340. }
  14341. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14342. class ui_Component141 extends fgui.GComponent {
  14343. static createInstance() {
  14344. return (fgui.UIPackage.createObject("game", "Component141"));
  14345. }
  14346. onConstruct() {
  14347. this.n0 = (this.getChild("n0"));
  14348. this.t0 = this.getTransition("t0");
  14349. }
  14350. }
  14351. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14352. class ui_powerNode extends fgui.GProgressBar {
  14353. static createInstance() {
  14354. return (fgui.UIPackage.createObject("game", "powerNode"));
  14355. }
  14356. onConstruct() {
  14357. this.n2 = (this.getChild("n2"));
  14358. this.bar_v = (this.getChild("bar_v"));
  14359. this.showImg = (this.getChild("showImg"));
  14360. this.n12 = (this.getChild("n12"));
  14361. }
  14362. }
  14363. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14364. class ui_dh_jingbi1 extends fgui.GComponent {
  14365. static createInstance() {
  14366. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14367. }
  14368. onConstruct() {
  14369. this.n0 = (this.getChild("n0"));
  14370. this.n1 = (this.getChild("n1"));
  14371. this.n2 = (this.getChild("n2"));
  14372. this.n3 = (this.getChild("n3"));
  14373. this.n4 = (this.getChild("n4"));
  14374. this.n5 = (this.getChild("n5"));
  14375. this.n6 = (this.getChild("n6"));
  14376. this.n8 = (this.getChild("n8"));
  14377. this.t0 = this.getTransition("t0");
  14378. }
  14379. }
  14380. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14381. class ui_Component94 extends fgui.GButton {
  14382. static createInstance() {
  14383. return (fgui.UIPackage.createObject("game", "Component94"));
  14384. }
  14385. onConstruct() {
  14386. this.n77 = (this.getChild("n77"));
  14387. }
  14388. }
  14389. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14390. class ui_Component95 extends fgui.GButton {
  14391. static createInstance() {
  14392. return (fgui.UIPackage.createObject("game", "Component95"));
  14393. }
  14394. onConstruct() {
  14395. this.n77 = (this.getChild("n77"));
  14396. }
  14397. }
  14398. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14399. class ui_Component126 extends fgui.GComponent {
  14400. static createInstance() {
  14401. return (fgui.UIPackage.createObject("game", "Component126"));
  14402. }
  14403. onConstruct() {
  14404. this.c1 = this.getController("c1");
  14405. this.normalBtn = (this.getChild("normalBtn"));
  14406. this.tripleBtn = (this.getChild("tripleBtn"));
  14407. }
  14408. }
  14409. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14410. class ui_Component60 extends fgui.GComponent {
  14411. static createInstance() {
  14412. return (fgui.UIPackage.createObject("game", "Component60"));
  14413. }
  14414. onConstruct() {
  14415. this.c1 = this.getController("c1");
  14416. this.n48 = (this.getChild("n48"));
  14417. this.womanTxt = (this.getChild("womanTxt"));
  14418. this.t0 = this.getTransition("t0");
  14419. }
  14420. }
  14421. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14422. class ui_Component_fuli1 extends fgui.GComponent {
  14423. static createInstance() {
  14424. return (fgui.UIPackage.createObject("game", "Component_fuli1"));
  14425. }
  14426. onConstruct() {
  14427. this.n0 = (this.getChild("n0"));
  14428. }
  14429. }
  14430. ui_Component_fuli1.URL = "ui://isxx5ak7loypv59q";
  14431. class ui_Button_h extends fgui.GButton {
  14432. static createInstance() {
  14433. return (fgui.UIPackage.createObject("game", "Button_h"));
  14434. }
  14435. onConstruct() {
  14436. this.button = this.getController("button");
  14437. this.n0 = (this.getChild("n0"));
  14438. this.n1 = (this.getChild("n1"));
  14439. }
  14440. }
  14441. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14442. class ui_Button_lv extends fgui.GButton {
  14443. static createInstance() {
  14444. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14445. }
  14446. onConstruct() {
  14447. this.button = this.getController("button");
  14448. this.n0 = (this.getChild("n0"));
  14449. this.n1 = (this.getChild("n1"));
  14450. }
  14451. }
  14452. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14453. class ui_Component98_3 extends fgui.GButton {
  14454. static createInstance() {
  14455. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14456. }
  14457. onConstruct() {
  14458. this.c1 = this.getController("c1");
  14459. this.n8 = (this.getChild("n8"));
  14460. this.n41 = (this.getChild("n41"));
  14461. this.n40 = (this.getChild("n40"));
  14462. }
  14463. }
  14464. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14465. class ui_ModeSelection_com1 extends fgui.GButton {
  14466. static createInstance() {
  14467. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14468. }
  14469. onConstruct() {
  14470. this.n34 = (this.getChild("n34"));
  14471. this.n36 = (this.getChild("n36"));
  14472. this.n22 = (this.getChild("n22"));
  14473. this.n20 = (this.getChild("n20"));
  14474. this.n23 = (this.getChild("n23"));
  14475. this.n24 = (this.getChild("n24"));
  14476. this.n26 = (this.getChild("n26"));
  14477. this.n33 = (this.getChild("n33"));
  14478. this.coinImg = (this.getChild("coinImg"));
  14479. this.need = (this.getChild("need"));
  14480. this.n35 = (this.getChild("n35"));
  14481. this.n29 = (this.getChild("n29"));
  14482. this.tipsTxt = (this.getChild("tipsTxt"));
  14483. this.n30 = (this.getChild("n30"));
  14484. this.peopleTxt = (this.getChild("peopleTxt"));
  14485. this.t0 = this.getTransition("t0");
  14486. }
  14487. }
  14488. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14489. class ui_ModeSelection_com2 extends fgui.GButton {
  14490. static createInstance() {
  14491. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14492. }
  14493. onConstruct() {
  14494. this.n36 = (this.getChild("n36"));
  14495. this.n34 = (this.getChild("n34"));
  14496. this.n22 = (this.getChild("n22"));
  14497. this.n20 = (this.getChild("n20"));
  14498. this.n23 = (this.getChild("n23"));
  14499. this.n24 = (this.getChild("n24"));
  14500. this.n26 = (this.getChild("n26"));
  14501. this.n33 = (this.getChild("n33"));
  14502. this.coinImg = (this.getChild("coinImg"));
  14503. this.need = (this.getChild("need"));
  14504. this.n35 = (this.getChild("n35"));
  14505. this.n29 = (this.getChild("n29"));
  14506. this.tipsTxt = (this.getChild("tipsTxt"));
  14507. this.n30 = (this.getChild("n30"));
  14508. this.peopleTxt = (this.getChild("peopleTxt"));
  14509. this.t0 = this.getTransition("t0");
  14510. }
  14511. }
  14512. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14513. class ui_ModeSelection_com3 extends fgui.GButton {
  14514. static createInstance() {
  14515. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14516. }
  14517. onConstruct() {
  14518. this.n34 = (this.getChild("n34"));
  14519. this.n36 = (this.getChild("n36"));
  14520. this.n22 = (this.getChild("n22"));
  14521. this.n20 = (this.getChild("n20"));
  14522. this.n23 = (this.getChild("n23"));
  14523. this.n24 = (this.getChild("n24"));
  14524. this.n26 = (this.getChild("n26"));
  14525. this.n33 = (this.getChild("n33"));
  14526. this.coinImg = (this.getChild("coinImg"));
  14527. this.need = (this.getChild("need"));
  14528. this.n35 = (this.getChild("n35"));
  14529. this.n29 = (this.getChild("n29"));
  14530. this.tipsTxt = (this.getChild("tipsTxt"));
  14531. this.n30 = (this.getChild("n30"));
  14532. this.peopleTxt = (this.getChild("peopleTxt"));
  14533. this.t0 = this.getTransition("t0");
  14534. }
  14535. }
  14536. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14537. class ui_Invitation_com1 extends fgui.GComponent {
  14538. static createInstance() {
  14539. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14540. }
  14541. onConstruct() {
  14542. this.n14 = (this.getChild("n14"));
  14543. this.n13 = (this.getChild("n13"));
  14544. this.n3 = (this.getChild("n3"));
  14545. this.n1 = (this.getChild("n1"));
  14546. this.n6 = (this.getChild("n6"));
  14547. this.n7 = (this.getChild("n7"));
  14548. this.enterBtn = (this.getChild("enterBtn"));
  14549. this.n11 = (this.getChild("n11"));
  14550. this.n12 = (this.getChild("n12"));
  14551. this.n15 = (this.getChild("n15"));
  14552. this.t0 = this.getTransition("t0");
  14553. this.t1 = this.getTransition("t1");
  14554. }
  14555. }
  14556. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14557. class ui_Component87_1 extends fgui.GComponent {
  14558. static createInstance() {
  14559. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14560. }
  14561. onConstruct() {
  14562. this.n74 = (this.getChild("n74"));
  14563. this.n73 = (this.getChild("n73"));
  14564. this.ballTxt = (this.getChild("ballTxt"));
  14565. this.n76 = (this.getChild("n76"));
  14566. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14567. this.levelTxt = (this.getChild("levelTxt"));
  14568. this.n87 = (this.getChild("n87"));
  14569. this.n84 = (this.getChild("n84"));
  14570. this.hpTxt = (this.getChild("hpTxt"));
  14571. this.n89 = (this.getChild("n89"));
  14572. this.tipsTxt = (this.getChild("tipsTxt"));
  14573. }
  14574. }
  14575. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14576. class ui_sqg1 extends fgui.GComponent {
  14577. static createInstance() {
  14578. return (fgui.UIPackage.createObject("game", "sqg1"));
  14579. }
  14580. onConstruct() {
  14581. this.n1 = (this.getChild("n1"));
  14582. this.n0 = (this.getChild("n0"));
  14583. }
  14584. }
  14585. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14586. class ui_sqg2 extends fgui.GComponent {
  14587. static createInstance() {
  14588. return (fgui.UIPackage.createObject("game", "sqg2"));
  14589. }
  14590. onConstruct() {
  14591. this.n1 = (this.getChild("n1"));
  14592. this.n0 = (this.getChild("n0"));
  14593. }
  14594. }
  14595. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14596. class ui_sqg3 extends fgui.GComponent {
  14597. static createInstance() {
  14598. return (fgui.UIPackage.createObject("game", "sqg3"));
  14599. }
  14600. onConstruct() {
  14601. this.n1 = (this.getChild("n1"));
  14602. this.n0 = (this.getChild("n0"));
  14603. }
  14604. }
  14605. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14606. class ui_sqg4 extends fgui.GComponent {
  14607. static createInstance() {
  14608. return (fgui.UIPackage.createObject("game", "sqg4"));
  14609. }
  14610. onConstruct() {
  14611. this.n1 = (this.getChild("n1"));
  14612. this.n0 = (this.getChild("n0"));
  14613. }
  14614. }
  14615. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14616. class ui_Component36 extends fgui.GButton {
  14617. static createInstance() {
  14618. return (fgui.UIPackage.createObject("game", "Component36"));
  14619. }
  14620. onConstruct() {
  14621. this.c1 = this.getController("c1");
  14622. this.n53 = (this.getChild("n53"));
  14623. this.n56 = (this.getChild("n56"));
  14624. }
  14625. }
  14626. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14627. class ui_Component37 extends fgui.GButton {
  14628. static createInstance() {
  14629. return (fgui.UIPackage.createObject("game", "Component37"));
  14630. }
  14631. onConstruct() {
  14632. this.c1 = this.getController("c1");
  14633. this.n52 = (this.getChild("n52"));
  14634. this.n54 = (this.getChild("n54"));
  14635. }
  14636. }
  14637. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14638. class ui_UISetting extends fgui.GComponent {
  14639. static createInstance() {
  14640. return (fgui.UIPackage.createObject("game", "UISetting"));
  14641. }
  14642. onConstruct() {
  14643. this.c1 = this.getController("c1");
  14644. this.n4 = (this.getChild("n4"));
  14645. this.soundBtn = (this.getChild("soundBtn"));
  14646. this.shakeBtn = (this.getChild("shakeBtn"));
  14647. this.clickNode = (this.getChild("clickNode"));
  14648. this.xyBtn = (this.getChild("xyBtn"));
  14649. }
  14650. }
  14651. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14652. class ui_Component39 extends fgui.GComponent {
  14653. static createInstance() {
  14654. return (fgui.UIPackage.createObject("game", "Component39"));
  14655. }
  14656. onConstruct() {
  14657. this.n5 = (this.getChild("n5"));
  14658. this.n6 = (this.getChild("n6"));
  14659. this.n7 = (this.getChild("n7"));
  14660. this.t0 = this.getTransition("t0");
  14661. }
  14662. }
  14663. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14664. class ui_Component40 extends fgui.GButton {
  14665. static createInstance() {
  14666. return (fgui.UIPackage.createObject("game", "Component40"));
  14667. }
  14668. onConstruct() {
  14669. this.n46 = (this.getChild("n46"));
  14670. this.n47 = (this.getChild("n47"));
  14671. }
  14672. }
  14673. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14674. class ui_Component41 extends fgui.GComponent {
  14675. static createInstance() {
  14676. return (fgui.UIPackage.createObject("game", "Component41"));
  14677. }
  14678. onConstruct() {
  14679. this.c1 = this.getController("c1");
  14680. this.n0 = (this.getChild("n0"));
  14681. this.titleTxt = (this.getChild("titleTxt"));
  14682. this.n2 = (this.getChild("n2"));
  14683. this.msgTips = (this.getChild("msgTips"));
  14684. this.numTxt = (this.getChild("numTxt"));
  14685. this.n18 = (this.getChild("n18"));
  14686. this.cancelBtn = (this.getChild("cancelBtn"));
  14687. this.videoBtn = (this.getChild("videoBtn"));
  14688. this.n10 = (this.getChild("n10"));
  14689. }
  14690. }
  14691. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14692. class ui_Component42 extends fgui.GComponent {
  14693. static createInstance() {
  14694. return (fgui.UIPackage.createObject("game", "Component42"));
  14695. }
  14696. onConstruct() {
  14697. this.c1 = this.getController("c1");
  14698. this.n1 = (this.getChild("n1"));
  14699. this.n2 = (this.getChild("n2"));
  14700. this.n3 = (this.getChild("n3"));
  14701. this.tipsTxt = (this.getChild("tipsTxt"));
  14702. this.cancelBtn = (this.getChild("cancelBtn"));
  14703. this.sureBtn = (this.getChild("sureBtn"));
  14704. this.n11 = (this.getChild("n11"));
  14705. this.n13 = (this.getChild("n13"));
  14706. this.n14 = (this.getChild("n14"));
  14707. this.womanTxt = (this.getChild("womanTxt"));
  14708. this.t0 = this.getTransition("t0");
  14709. }
  14710. }
  14711. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14712. class ui_dh_js_shengli extends fgui.GComponent {
  14713. static createInstance() {
  14714. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14715. }
  14716. onConstruct() {
  14717. this.n3 = (this.getChild("n3"));
  14718. this.n4 = (this.getChild("n4"));
  14719. this.n1 = (this.getChild("n1"));
  14720. this.n2 = (this.getChild("n2"));
  14721. this.n5 = (this.getChild("n5"));
  14722. this.n6 = (this.getChild("n6"));
  14723. this.n7 = (this.getChild("n7"));
  14724. this.n8 = (this.getChild("n8"));
  14725. this.attack = this.getTransition("attack");
  14726. this.idle = this.getTransition("idle");
  14727. }
  14728. }
  14729. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14730. class ui_dh_js_shengli_g extends fgui.GComponent {
  14731. static createInstance() {
  14732. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14733. }
  14734. onConstruct() {
  14735. this.n3 = (this.getChild("n3"));
  14736. this.n1 = (this.getChild("n1"));
  14737. this.t0 = this.getTransition("t0");
  14738. }
  14739. }
  14740. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  14741. class ui_dh_js_shibai extends fgui.GComponent {
  14742. static createInstance() {
  14743. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  14744. }
  14745. onConstruct() {
  14746. this.n0 = (this.getChild("n0"));
  14747. this.n1 = (this.getChild("n1"));
  14748. this.n2 = (this.getChild("n2"));
  14749. this.n3 = (this.getChild("n3"));
  14750. this.idle = this.getTransition("idle");
  14751. this.attack = this.getTransition("attack");
  14752. }
  14753. }
  14754. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  14755. class ui_dh_zy_ganfa extends fgui.GButton {
  14756. static createInstance() {
  14757. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  14758. }
  14759. onConstruct() {
  14760. this.n0 = (this.getChild("n0"));
  14761. }
  14762. }
  14763. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  14764. class ui_dh_zy_sc_guang extends fgui.GButton {
  14765. static createInstance() {
  14766. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  14767. }
  14768. onConstruct() {
  14769. this.n0 = (this.getChild("n0"));
  14770. this.n2 = (this.getChild("n2"));
  14771. }
  14772. }
  14773. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  14774. class ui_dh_zy_shangcheng extends fgui.GComponent {
  14775. static createInstance() {
  14776. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  14777. }
  14778. onConstruct() {
  14779. this.n0 = (this.getChild("n0"));
  14780. this.n3 = (this.getChild("n3"));
  14781. this.t0 = this.getTransition("t0");
  14782. }
  14783. }
  14784. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  14785. class ui_dh_zy_wanfa extends fgui.GButton {
  14786. static createInstance() {
  14787. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  14788. }
  14789. onConstruct() {
  14790. this.n0 = (this.getChild("n0"));
  14791. }
  14792. }
  14793. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  14794. class ui_Button_login extends fgui.GButton {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("game", "Button_login"));
  14797. }
  14798. onConstruct() {
  14799. this.button = this.getController("button");
  14800. this.n5 = (this.getChild("n5"));
  14801. this.n3 = (this.getChild("n3"));
  14802. }
  14803. }
  14804. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  14805. class ui_Component53_1 extends fgui.GComponent {
  14806. static createInstance() {
  14807. return (fgui.UIPackage.createObject("game", "Component53_1"));
  14808. }
  14809. onConstruct() {
  14810. this.n0 = (this.getChild("n0"));
  14811. this.n1 = (this.getChild("n1"));
  14812. this.n2 = (this.getChild("n2"));
  14813. this.n3 = (this.getChild("n3"));
  14814. this.n4 = (this.getChild("n4"));
  14815. this.n5 = (this.getChild("n5"));
  14816. this.n6 = (this.getChild("n6"));
  14817. this.n7 = (this.getChild("n7"));
  14818. this.n8 = (this.getChild("n8"));
  14819. this.n9 = (this.getChild("n9"));
  14820. this.n10 = (this.getChild("n10"));
  14821. this.n11 = (this.getChild("n11"));
  14822. this.n12 = (this.getChild("n12"));
  14823. this.n13 = (this.getChild("n13"));
  14824. this.n14 = (this.getChild("n14"));
  14825. this.n15 = (this.getChild("n15"));
  14826. this.n16 = (this.getChild("n16"));
  14827. this.n19 = (this.getChild("n19"));
  14828. this.n20 = (this.getChild("n20"));
  14829. this.n21 = (this.getChild("n21"));
  14830. this.n22 = (this.getChild("n22"));
  14831. this.n23 = (this.getChild("n23"));
  14832. this.n24 = (this.getChild("n24"));
  14833. this.n25 = (this.getChild("n25"));
  14834. this.n26 = (this.getChild("n26"));
  14835. this.n27 = (this.getChild("n27"));
  14836. this.n28 = (this.getChild("n28"));
  14837. this.n29 = (this.getChild("n29"));
  14838. this.n30 = (this.getChild("n30"));
  14839. this.n31 = (this.getChild("n31"));
  14840. this.n32 = (this.getChild("n32"));
  14841. this.n33 = (this.getChild("n33"));
  14842. this.n34 = (this.getChild("n34"));
  14843. this.n35 = (this.getChild("n35"));
  14844. this.t0 = this.getTransition("t0");
  14845. }
  14846. }
  14847. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  14848. class ui_Component30 extends fgui.GComponent {
  14849. static createInstance() {
  14850. return (fgui.UIPackage.createObject("game", "Component30"));
  14851. }
  14852. onConstruct() {
  14853. this.c1 = this.getController("c1");
  14854. this.n46 = (this.getChild("n46"));
  14855. this.n47 = (this.getChild("n47"));
  14856. this.numTxt = (this.getChild("numTxt"));
  14857. this.n50 = (this.getChild("n50"));
  14858. this.n53 = (this.getChild("n53"));
  14859. this.n54 = (this.getChild("n54"));
  14860. this.n55 = (this.getChild("n55"));
  14861. this.n56 = (this.getChild("n56"));
  14862. }
  14863. }
  14864. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  14865. class ui_Component30_1 extends fgui.GComponent {
  14866. static createInstance() {
  14867. return (fgui.UIPackage.createObject("game", "Component30_1"));
  14868. }
  14869. onConstruct() {
  14870. this.c1 = this.getController("c1");
  14871. this.n46 = (this.getChild("n46"));
  14872. this.n47 = (this.getChild("n47"));
  14873. this.numTxt = (this.getChild("numTxt"));
  14874. this.n50 = (this.getChild("n50"));
  14875. this.n51 = (this.getChild("n51"));
  14876. this.n52 = (this.getChild("n52"));
  14877. this.n53 = (this.getChild("n53"));
  14878. this.n54 = (this.getChild("n54"));
  14879. }
  14880. }
  14881. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  14882. class ui_Component31 extends fgui.GComponent {
  14883. static createInstance() {
  14884. return (fgui.UIPackage.createObject("game", "Component31"));
  14885. }
  14886. onConstruct() {
  14887. this.n55 = (this.getChild("n55"));
  14888. this.n54 = (this.getChild("n54"));
  14889. this.conditionTxt = (this.getChild("conditionTxt"));
  14890. this.n57 = (this.getChild("n57"));
  14891. this.t0 = this.getTransition("t0");
  14892. }
  14893. }
  14894. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  14895. class ui_Component32 extends fgui.GComponent {
  14896. static createInstance() {
  14897. return (fgui.UIPackage.createObject("game", "Component32"));
  14898. }
  14899. onConstruct() {
  14900. this.n5 = (this.getChild("n5"));
  14901. this.n6 = (this.getChild("n6"));
  14902. this.n7 = (this.getChild("n7"));
  14903. this.t0 = this.getTransition("t0");
  14904. }
  14905. }
  14906. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  14907. class ui_AwardItem extends fgui.GComponent {
  14908. static createInstance() {
  14909. return (fgui.UIPackage.createObject("game", "AwardItem"));
  14910. }
  14911. onConstruct() {
  14912. this.n9 = (this.getChild("n9"));
  14913. this.myIcon = (this.getChild("myIcon"));
  14914. this.numTxt = (this.getChild("numTxt"));
  14915. this.nameTxt = (this.getChild("nameTxt"));
  14916. this.n16 = (this.getChild("n16"));
  14917. this.n17 = (this.getChild("n17"));
  14918. }
  14919. }
  14920. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  14921. class ui_ranking_com1 extends fgui.GButton {
  14922. static createInstance() {
  14923. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  14924. }
  14925. onConstruct() {
  14926. this.c1 = this.getController("c1");
  14927. this.n49 = (this.getChild("n49"));
  14928. this.n18 = (this.getChild("n18"));
  14929. this.n46 = (this.getChild("n46"));
  14930. this.n48 = (this.getChild("n48"));
  14931. this.n50 = (this.getChild("n50"));
  14932. }
  14933. }
  14934. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  14935. class ui_ranking_com2 extends fgui.GButton {
  14936. static createInstance() {
  14937. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  14938. }
  14939. onConstruct() {
  14940. this.c1 = this.getController("c1");
  14941. this.n49 = (this.getChild("n49"));
  14942. this.n18 = (this.getChild("n18"));
  14943. this.n46 = (this.getChild("n46"));
  14944. this.n48 = (this.getChild("n48"));
  14945. this.n50 = (this.getChild("n50"));
  14946. }
  14947. }
  14948. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  14949. class ui_ranking_com3 extends fgui.GComponent {
  14950. static createInstance() {
  14951. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  14952. }
  14953. onConstruct() {
  14954. this.n17 = (this.getChild("n17"));
  14955. this.myIcon = (this.getChild("myIcon"));
  14956. }
  14957. }
  14958. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  14959. class ui_ranking_com4 extends fgui.GComponent {
  14960. static createInstance() {
  14961. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  14962. }
  14963. onConstruct() {
  14964. this.n16 = (this.getChild("n16"));
  14965. this.head = (this.getChild("head"));
  14966. }
  14967. }
  14968. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  14969. class ui_ranking_com5 extends fgui.GComponent {
  14970. static createInstance() {
  14971. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  14972. }
  14973. onConstruct() {
  14974. this.c1 = this.getController("c1");
  14975. this.c2 = this.getController("c2");
  14976. this.n2 = (this.getChild("n2"));
  14977. this.n3 = (this.getChild("n3"));
  14978. this.levelBtn = (this.getChild("levelBtn"));
  14979. this.starBtn = (this.getChild("starBtn"));
  14980. this.n23 = (this.getChild("n23"));
  14981. this.n24 = (this.getChild("n24"));
  14982. this.n25 = (this.getChild("n25"));
  14983. this.myList = (this.getChild("myList"));
  14984. this.selfNode = (this.getChild("selfNode"));
  14985. this.n9 = (this.getChild("n9"));
  14986. this.n12 = (this.getChild("n12"));
  14987. this.n13 = (this.getChild("n13"));
  14988. this.n14 = (this.getChild("n14"));
  14989. this.n39 = (this.getChild("n39"));
  14990. this.n41 = (this.getChild("n41"));
  14991. this.n42 = (this.getChild("n42"));
  14992. this.n45 = (this.getChild("n45"));
  14993. this.changeBtn = (this.getChild("changeBtn"));
  14994. this.closeBtn = (this.getChild("closeBtn"));
  14995. this.t0 = this.getTransition("t0");
  14996. }
  14997. }
  14998. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  14999. class ui_RankItem extends fgui.GComponent {
  15000. static createInstance() {
  15001. return (fgui.UIPackage.createObject("game", "RankItem"));
  15002. }
  15003. onConstruct() {
  15004. this.n10 = (this.getChild("n10"));
  15005. this.n11 = (this.getChild("n11"));
  15006. this.rankTxt = (this.getChild("rankTxt"));
  15007. this.headNode = (this.getChild("headNode"));
  15008. this.nameTxt = (this.getChild("nameTxt"));
  15009. this.n19 = (this.getChild("n19"));
  15010. this.valueTxt = (this.getChild("valueTxt"));
  15011. this.img1 = (this.getChild("img1"));
  15012. this.img2 = (this.getChild("img2"));
  15013. this.img3 = (this.getChild("img3"));
  15014. }
  15015. }
  15016. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15017. class ui_ranking_com9 extends fgui.GComponent {
  15018. static createInstance() {
  15019. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15020. }
  15021. onConstruct() {
  15022. this.c1 = this.getController("c1");
  15023. this.n27 = (this.getChild("n27"));
  15024. this.n28 = (this.getChild("n28"));
  15025. this.headNode = (this.getChild("headNode"));
  15026. this.rankTxt = (this.getChild("rankTxt"));
  15027. this.nameTxt = (this.getChild("nameTxt"));
  15028. this.n34 = (this.getChild("n34"));
  15029. this.valueTxt = (this.getChild("valueTxt"));
  15030. this.n36 = (this.getChild("n36"));
  15031. this.n37 = (this.getChild("n37"));
  15032. this.n38 = (this.getChild("n38"));
  15033. this.n39 = (this.getChild("n39"));
  15034. this.n40 = (this.getChild("n40"));
  15035. }
  15036. }
  15037. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15038. class ui_ranking_com10 extends fgui.GComponent {
  15039. static createInstance() {
  15040. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15041. }
  15042. onConstruct() {
  15043. this.n23 = (this.getChild("n23"));
  15044. this.n24 = (this.getChild("n24"));
  15045. }
  15046. }
  15047. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15048. class ui_ranking_com11 extends fgui.GComponent {
  15049. static createInstance() {
  15050. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15051. }
  15052. onConstruct() {
  15053. this.n24 = (this.getChild("n24"));
  15054. this.n25 = (this.getChild("n25"));
  15055. this.t0 = this.getTransition("t0");
  15056. }
  15057. }
  15058. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15059. class ui_ranking_com13 extends fgui.GButton {
  15060. static createInstance() {
  15061. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15062. }
  15063. onConstruct() {
  15064. this.c1 = this.getController("c1");
  15065. this.n44 = (this.getChild("n44"));
  15066. this.n45 = (this.getChild("n45"));
  15067. this.n46 = (this.getChild("n46"));
  15068. }
  15069. }
  15070. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15071. class ui_Component_dl_zc extends fgui.GButton {
  15072. static createInstance() {
  15073. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  15074. }
  15075. onConstruct() {
  15076. this.c1 = this.getController("c1");
  15077. this.n0 = (this.getChild("n0"));
  15078. }
  15079. }
  15080. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  15081. class ui_Component122 extends fgui.GComponent {
  15082. static createInstance() {
  15083. return (fgui.UIPackage.createObject("game", "Component122"));
  15084. }
  15085. onConstruct() {
  15086. this.gameNode3 = (this.getChild("gameNode3"));
  15087. }
  15088. }
  15089. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15090. class ui_skillItem extends fgui.GComponent {
  15091. static createInstance() {
  15092. return (fgui.UIPackage.createObject("game", "skillItem"));
  15093. }
  15094. onConstruct() {
  15095. this.c1 = this.getController("c1");
  15096. this.n31 = (this.getChild("n31"));
  15097. this.n6 = (this.getChild("n6"));
  15098. this.skillImg = (this.getChild("skillImg"));
  15099. this.nameTxt = (this.getChild("nameTxt"));
  15100. this.levelTxt = (this.getChild("levelTxt"));
  15101. this.n28 = (this.getChild("n28"));
  15102. this.describeTxt = (this.getChild("describeTxt"));
  15103. this.n32 = (this.getChild("n32"));
  15104. this.mutiBtn = (this.getChild("mutiBtn"));
  15105. this.tryNode = (this.getChild("tryNode"));
  15106. this.normalBtn = (this.getChild("normalBtn"));
  15107. this.startBtn = (this.getChild("startBtn"));
  15108. this.n42 = (this.getChild("n42"));
  15109. this.n43 = (this.getChild("n43"));
  15110. this.n44 = (this.getChild("n44"));
  15111. }
  15112. }
  15113. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15114. class ui_Component26 extends fgui.GButton {
  15115. static createInstance() {
  15116. return (fgui.UIPackage.createObject("game", "Component26"));
  15117. }
  15118. onConstruct() {
  15119. this.n11 = (this.getChild("n11"));
  15120. this.n30 = (this.getChild("n30"));
  15121. this.n34 = (this.getChild("n34"));
  15122. }
  15123. }
  15124. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15125. class ui_Component28 extends fgui.GButton {
  15126. static createInstance() {
  15127. return (fgui.UIPackage.createObject("game", "Component28"));
  15128. }
  15129. onConstruct() {
  15130. this.n12 = (this.getChild("n12"));
  15131. this.n31 = (this.getChild("n31"));
  15132. this.curTxt = (this.getChild("curTxt"));
  15133. this.n33 = (this.getChild("n33"));
  15134. }
  15135. }
  15136. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15137. class ui_Component1302 extends fgui.GComponent {
  15138. static createInstance() {
  15139. return (fgui.UIPackage.createObject("game", "Component1302"));
  15140. }
  15141. onConstruct() {
  15142. this.n2 = (this.getChild("n2"));
  15143. this.n3 = (this.getChild("n3"));
  15144. }
  15145. }
  15146. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15147. class ui_Component113 extends fgui.GComponent {
  15148. static createInstance() {
  15149. return (fgui.UIPackage.createObject("game", "Component113"));
  15150. }
  15151. onConstruct() {
  15152. this.n85 = (this.getChild("n85"));
  15153. this.n86 = (this.getChild("n86"));
  15154. this.n77 = (this.getChild("n77"));
  15155. this.n79 = (this.getChild("n79"));
  15156. this.n80 = (this.getChild("n80"));
  15157. this.n81 = (this.getChild("n81"));
  15158. this.n82 = (this.getChild("n82"));
  15159. this.n84 = (this.getChild("n84"));
  15160. this.n87 = (this.getChild("n87"));
  15161. this.t0 = this.getTransition("t0");
  15162. }
  15163. }
  15164. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15165. class ui_Component114 extends fgui.GComponent {
  15166. static createInstance() {
  15167. return (fgui.UIPackage.createObject("game", "Component114"));
  15168. }
  15169. onConstruct() {
  15170. this.n77 = (this.getChild("n77"));
  15171. this.t0 = this.getTransition("t0");
  15172. }
  15173. }
  15174. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15175. class ui_Component115 extends fgui.GComponent {
  15176. static createInstance() {
  15177. return (fgui.UIPackage.createObject("game", "Component115"));
  15178. }
  15179. onConstruct() {
  15180. this.n83 = (this.getChild("n83"));
  15181. this.fingerNode = (this.getChild("fingerNode"));
  15182. this.n84 = (this.getChild("n84"));
  15183. }
  15184. }
  15185. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15186. class ui_Component117 extends fgui.GComponent {
  15187. static createInstance() {
  15188. return (fgui.UIPackage.createObject("game", "Component117"));
  15189. }
  15190. onConstruct() {
  15191. this.n87 = (this.getChild("n87"));
  15192. this.n88 = (this.getChild("n88"));
  15193. this.n84 = (this.getChild("n84"));
  15194. this.n85 = (this.getChild("n85"));
  15195. this.n86 = (this.getChild("n86"));
  15196. this.t0 = this.getTransition("t0");
  15197. }
  15198. }
  15199. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15200. class ui_Component98_1 extends fgui.GButton {
  15201. static createInstance() {
  15202. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15203. }
  15204. onConstruct() {
  15205. this.c1 = this.getController("c1");
  15206. this.n8 = (this.getChild("n8"));
  15207. this.n41 = (this.getChild("n41"));
  15208. this.n40 = (this.getChild("n40"));
  15209. }
  15210. }
  15211. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15212. class ui_Component61 extends fgui.GComponent {
  15213. static createInstance() {
  15214. return (fgui.UIPackage.createObject("game", "Component61"));
  15215. }
  15216. onConstruct() {
  15217. this.n14 = (this.getChild("n14"));
  15218. this.n6 = (this.getChild("n6"));
  15219. this.t0 = this.getTransition("t0");
  15220. }
  15221. }
  15222. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15223. class ui_Component62 extends fgui.GComponent {
  15224. static createInstance() {
  15225. return (fgui.UIPackage.createObject("game", "Component62"));
  15226. }
  15227. onConstruct() {
  15228. this.n66 = (this.getChild("n66"));
  15229. this.n56 = (this.getChild("n56"));
  15230. this.n63 = (this.getChild("n63"));
  15231. this.n65 = (this.getChild("n65"));
  15232. this.t0 = this.getTransition("t0");
  15233. }
  15234. }
  15235. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15236. class ui_d3Root extends fgui.GComponent {
  15237. static createInstance() {
  15238. return (fgui.UIPackage.createObject("game", "d3Root"));
  15239. }
  15240. onConstruct() {
  15241. }
  15242. }
  15243. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15244. class ui_d2Root extends fgui.GComponent {
  15245. static createInstance() {
  15246. return (fgui.UIPackage.createObject("game", "d2Root"));
  15247. }
  15248. onConstruct() {
  15249. }
  15250. }
  15251. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15252. class ui_ballNode extends fgui.GComponent {
  15253. static createInstance() {
  15254. return (fgui.UIPackage.createObject("game", "ballNode"));
  15255. }
  15256. onConstruct() {
  15257. }
  15258. }
  15259. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15260. class ui_border extends fgui.GComponent {
  15261. static createInstance() {
  15262. return (fgui.UIPackage.createObject("game", "border"));
  15263. }
  15264. onConstruct() {
  15265. this.bar1 = (this.getChild("bar1"));
  15266. this.bar2 = (this.getChild("bar2"));
  15267. this.bar3 = (this.getChild("bar3"));
  15268. this.bar4 = (this.getChild("bar4"));
  15269. this.bar5 = (this.getChild("bar5"));
  15270. this.bar6 = (this.getChild("bar6"));
  15271. this.circle1 = (this.getChild("circle1"));
  15272. this.circle2 = (this.getChild("circle2"));
  15273. this.circle3 = (this.getChild("circle3"));
  15274. this.circle4 = (this.getChild("circle4"));
  15275. this.circle5 = (this.getChild("circle5"));
  15276. this.circle6 = (this.getChild("circle6"));
  15277. this.n28 = (this.getChild("n28"));
  15278. }
  15279. }
  15280. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15281. class ui_btn_buy extends fgui.GButton {
  15282. static createInstance() {
  15283. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15284. }
  15285. onConstruct() {
  15286. this.button = this.getController("button");
  15287. this.n0 = (this.getChild("n0"));
  15288. this.n1 = (this.getChild("n1"));
  15289. this.n2 = (this.getChild("n2"));
  15290. }
  15291. }
  15292. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15293. class ui_Component41_2 extends fgui.GComponent {
  15294. static createInstance() {
  15295. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15296. }
  15297. onConstruct() {
  15298. this.c1 = this.getController("c1");
  15299. this.n0 = (this.getChild("n0"));
  15300. this.n2 = (this.getChild("n2"));
  15301. this.n19 = (this.getChild("n19"));
  15302. this.cancelBtn = (this.getChild("cancelBtn"));
  15303. this.videoBtn = (this.getChild("videoBtn"));
  15304. this.n9 = (this.getChild("n9"));
  15305. this.n22 = (this.getChild("n22"));
  15306. this.tipsTxt = (this.getChild("tipsTxt"));
  15307. this.n23 = (this.getChild("n23"));
  15308. this.n24 = (this.getChild("n24"));
  15309. this.n26 = (this.getChild("n26"));
  15310. this.n27 = (this.getChild("n27"));
  15311. this.titleTxt = (this.getChild("titleTxt"));
  15312. }
  15313. }
  15314. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15315. class ui_Component41_1 extends fgui.GComponent {
  15316. static createInstance() {
  15317. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15318. }
  15319. onConstruct() {
  15320. this.c1 = this.getController("c1");
  15321. this.n0 = (this.getChild("n0"));
  15322. this.n2 = (this.getChild("n2"));
  15323. this.cancelBtn = (this.getChild("cancelBtn"));
  15324. this.videoBtn = (this.getChild("videoBtn"));
  15325. this.n27 = (this.getChild("n27"));
  15326. this.n30 = (this.getChild("n30"));
  15327. this.n31 = (this.getChild("n31"));
  15328. this.n32 = (this.getChild("n32"));
  15329. this.n33 = (this.getChild("n33"));
  15330. this.n34 = (this.getChild("n34"));
  15331. this.n35 = (this.getChild("n35"));
  15332. this.n36 = (this.getChild("n36"));
  15333. this.n1 = (this.getChild("n1"));
  15334. this.n37 = (this.getChild("n37"));
  15335. this.t0 = this.getTransition("t0");
  15336. this.t1 = this.getTransition("t1");
  15337. this.t2 = this.getTransition("t2");
  15338. this.t3 = this.getTransition("t3");
  15339. }
  15340. }
  15341. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15342. class ui_againBtn extends fgui.GButton {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "againBtn"));
  15345. }
  15346. onConstruct() {
  15347. this.n2 = (this.getChild("n2"));
  15348. this.n1 = (this.getChild("n1"));
  15349. this.n5 = (this.getChild("n5"));
  15350. }
  15351. }
  15352. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15353. class ui_Component118 extends fgui.GButton {
  15354. static createInstance() {
  15355. return (fgui.UIPackage.createObject("game", "Component118"));
  15356. }
  15357. onConstruct() {
  15358. this.c1 = this.getController("c1");
  15359. this.n14 = (this.getChild("n14"));
  15360. this.n9 = (this.getChild("n9"));
  15361. this.n10 = (this.getChild("n10"));
  15362. this.diamondTxt = (this.getChild("diamondTxt"));
  15363. this.n13 = (this.getChild("n13"));
  15364. this.n15 = (this.getChild("n15"));
  15365. }
  15366. }
  15367. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15368. class ui_Component119 extends fgui.GComponent {
  15369. static createInstance() {
  15370. return (fgui.UIPackage.createObject("game", "Component119"));
  15371. }
  15372. onConstruct() {
  15373. this.n1 = (this.getChild("n1"));
  15374. this.n2 = (this.getChild("n2"));
  15375. this.n13 = (this.getChild("n13"));
  15376. this.n6 = (this.getChild("n6"));
  15377. this.screenNode = (this.getChild("screenNode"));
  15378. this.n15 = (this.getChild("n15"));
  15379. this.closeBtn = (this.getChild("closeBtn"));
  15380. this.share2Btn = (this.getChild("share2Btn"));
  15381. this.shareBtn = (this.getChild("shareBtn"));
  15382. this.tipsNode = (this.getChild("tipsNode"));
  15383. this.awardNode = (this.getChild("awardNode"));
  15384. }
  15385. }
  15386. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15387. class ui_daoJuDisplay extends fgui.GComponent {
  15388. static createInstance() {
  15389. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15390. }
  15391. onConstruct() {
  15392. this.n6 = (this.getChild("n6"));
  15393. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15394. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15395. this.btn_buy = (this.getChild("btn_buy"));
  15396. this.nameTxt = (this.getChild("nameTxt"));
  15397. this.zsImg = (this.getChild("zsImg"));
  15398. }
  15399. }
  15400. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15401. class ui_Component132_1 extends fgui.GComponent {
  15402. static createInstance() {
  15403. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15404. }
  15405. onConstruct() {
  15406. this.n25 = (this.getChild("n25"));
  15407. this.n26 = (this.getChild("n26"));
  15408. this.n27 = (this.getChild("n27"));
  15409. this.t0 = this.getTransition("t0");
  15410. }
  15411. }
  15412. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15413. class ui_SecretaryDisplay extends fgui.GComponent {
  15414. static createInstance() {
  15415. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15416. }
  15417. onConstruct() {
  15418. this.n2 = (this.getChild("n2"));
  15419. this.levelTxt = (this.getChild("levelTxt"));
  15420. this.n4 = (this.getChild("n4"));
  15421. this.secretary = (this.getChild("secretary"));
  15422. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15423. this.n16 = (this.getChild("n16"));
  15424. this.n37 = (this.getChild("n37"));
  15425. this.n41 = (this.getChild("n41"));
  15426. this.n14 = (this.getChild("n14"));
  15427. this.n17 = (this.getChild("n17"));
  15428. this.heightTxt = (this.getChild("heightTxt"));
  15429. this.n46 = (this.getChild("n46"));
  15430. this.n36 = (this.getChild("n36"));
  15431. this.n38 = (this.getChild("n38"));
  15432. this.foodTxt = (this.getChild("foodTxt"));
  15433. this.n47 = (this.getChild("n47"));
  15434. this.n40 = (this.getChild("n40"));
  15435. this.n42 = (this.getChild("n42"));
  15436. this.historyTxt = (this.getChild("historyTxt"));
  15437. this.n48 = (this.getChild("n48"));
  15438. this.nameImg = (this.getChild("nameImg"));
  15439. this.n12 = (this.getChild("n12"));
  15440. this.n49 = (this.getChild("n49"));
  15441. this.t0 = this.getTransition("t0");
  15442. }
  15443. }
  15444. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15445. class ui_BallRodDisplay extends fgui.GComponent {
  15446. static createInstance() {
  15447. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15448. }
  15449. onConstruct() {
  15450. this.c1 = this.getController("c1");
  15451. this.n31 = (this.getChild("n31"));
  15452. this.n6 = (this.getChild("n6"));
  15453. this.nameTxt = (this.getChild("nameTxt"));
  15454. this.rodImg = (this.getChild("rodImg"));
  15455. this.eftRod = (this.getChild("eftRod"));
  15456. this.levelNode = (this.getChild("levelNode"));
  15457. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15458. }
  15459. }
  15460. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15461. class ui_Component111_11 extends fgui.GComponent {
  15462. static createInstance() {
  15463. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15464. }
  15465. onConstruct() {
  15466. this.n68 = (this.getChild("n68"));
  15467. this.n69 = (this.getChild("n69"));
  15468. }
  15469. }
  15470. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15471. class ui_Component112 extends fgui.GComponent {
  15472. static createInstance() {
  15473. return (fgui.UIPackage.createObject("game", "Component112"));
  15474. }
  15475. onConstruct() {
  15476. this.n68 = (this.getChild("n68"));
  15477. this.n70 = (this.getChild("n70"));
  15478. this.myMask = (this.getChild("myMask"));
  15479. }
  15480. }
  15481. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15482. class ui_Component111 extends fgui.GComponent {
  15483. static createInstance() {
  15484. return (fgui.UIPackage.createObject("game", "Component111"));
  15485. }
  15486. onConstruct() {
  15487. this.n68 = (this.getChild("n68"));
  15488. this.myMask = (this.getChild("myMask"));
  15489. }
  15490. }
  15491. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15492. class ui_Component144 extends fgui.GButton {
  15493. static createInstance() {
  15494. return (fgui.UIPackage.createObject("game", "Component144"));
  15495. }
  15496. onConstruct() {
  15497. this.n8 = (this.getChild("n8"));
  15498. }
  15499. }
  15500. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15501. class ui_Sign_com2 extends fgui.GComponent {
  15502. static createInstance() {
  15503. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15504. }
  15505. onConstruct() {
  15506. this.n0 = (this.getChild("n0"));
  15507. this.n1 = (this.getChild("n1"));
  15508. this.t0 = this.getTransition("t0");
  15509. }
  15510. }
  15511. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15512. class ui_Sign_guang extends fgui.GComponent {
  15513. static createInstance() {
  15514. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15515. }
  15516. onConstruct() {
  15517. this.n1 = (this.getChild("n1"));
  15518. this.n2 = (this.getChild("n2"));
  15519. this.n3 = (this.getChild("n3"));
  15520. this.n4 = (this.getChild("n4"));
  15521. this.n5 = (this.getChild("n5"));
  15522. this.n6 = (this.getChild("n6"));
  15523. this.n8 = (this.getChild("n8"));
  15524. }
  15525. }
  15526. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15527. class ui_SignMax extends fgui.GComponent {
  15528. static createInstance() {
  15529. return (fgui.UIPackage.createObject("game", "SignMax"));
  15530. }
  15531. onConstruct() {
  15532. this.c1 = this.getController("c1");
  15533. this.n7 = (this.getChild("n7"));
  15534. this.n15 = (this.getChild("n15"));
  15535. this.n8 = (this.getChild("n8"));
  15536. this.titleTxt = (this.getChild("titleTxt"));
  15537. this.myIcon1 = (this.getChild("myIcon1"));
  15538. this.numTxt1 = (this.getChild("numTxt1"));
  15539. this.myIcon2 = (this.getChild("myIcon2"));
  15540. this.n20 = (this.getChild("n20"));
  15541. this.n17 = (this.getChild("n17"));
  15542. this.numTxt2 = (this.getChild("numTxt2"));
  15543. this.n12 = (this.getChild("n12"));
  15544. this.n13 = (this.getChild("n13"));
  15545. this.n21 = (this.getChild("n21"));
  15546. this.n14 = (this.getChild("n14"));
  15547. }
  15548. }
  15549. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15550. class ui_Sign_com2_1 extends fgui.GComponent {
  15551. static createInstance() {
  15552. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15553. }
  15554. onConstruct() {
  15555. this.n0 = (this.getChild("n0"));
  15556. this.n1 = (this.getChild("n1"));
  15557. this.t0 = this.getTransition("t0");
  15558. }
  15559. }
  15560. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15561. class ui_Sign_com5 extends fgui.GComponent {
  15562. static createInstance() {
  15563. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15564. }
  15565. onConstruct() {
  15566. this.n3 = (this.getChild("n3"));
  15567. this.n29 = (this.getChild("n29"));
  15568. this.n4 = (this.getChild("n4"));
  15569. this.day1 = (this.getChild("day1"));
  15570. this.day2 = (this.getChild("day2"));
  15571. this.day3 = (this.getChild("day3"));
  15572. this.day4 = (this.getChild("day4"));
  15573. this.day5 = (this.getChild("day5"));
  15574. this.day6 = (this.getChild("day6"));
  15575. this.day7 = (this.getChild("day7"));
  15576. this.t0 = this.getTransition("t0");
  15577. }
  15578. }
  15579. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15580. class ui_Sign_com8 extends fgui.GComponent {
  15581. static createInstance() {
  15582. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15583. }
  15584. onConstruct() {
  15585. this.n48 = (this.getChild("n48"));
  15586. this.womanTxt = (this.getChild("womanTxt"));
  15587. this.t0 = this.getTransition("t0");
  15588. }
  15589. }
  15590. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15591. class ui_Sign_com6 extends fgui.GComponent {
  15592. static createInstance() {
  15593. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15594. }
  15595. onConstruct() {
  15596. this.n2 = (this.getChild("n2"));
  15597. this.n3 = (this.getChild("n3"));
  15598. this.t0 = this.getTransition("t0");
  15599. }
  15600. }
  15601. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15602. class ui_Sign_com7 extends fgui.GComponent {
  15603. static createInstance() {
  15604. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15605. }
  15606. onConstruct() {
  15607. this.n29 = (this.getChild("n29"));
  15608. this.n2 = (this.getChild("n2"));
  15609. }
  15610. }
  15611. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15612. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15613. static createInstance() {
  15614. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15615. }
  15616. onConstruct() {
  15617. this.n5 = (this.getChild("n5"));
  15618. this.n4 = (this.getChild("n4"));
  15619. this.t0 = this.getTransition("t0");
  15620. }
  15621. }
  15622. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15623. class ui_UITurntable_com2 extends fgui.GComponent {
  15624. static createInstance() {
  15625. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15626. }
  15627. onConstruct() {
  15628. this.c1 = this.getController("c1");
  15629. this.n4 = (this.getChild("n4"));
  15630. this.n6 = (this.getChild("n6"));
  15631. this.n10 = (this.getChild("n10"));
  15632. this.n11 = (this.getChild("n11"));
  15633. this.n12 = (this.getChild("n12"));
  15634. this.n13 = (this.getChild("n13"));
  15635. this.n14 = (this.getChild("n14"));
  15636. this.n15 = (this.getChild("n15"));
  15637. this.n16 = (this.getChild("n16"));
  15638. this.n17 = (this.getChild("n17"));
  15639. this.n18 = (this.getChild("n18"));
  15640. this.n19 = (this.getChild("n19"));
  15641. this.n20 = (this.getChild("n20"));
  15642. this.n21 = (this.getChild("n21"));
  15643. this.n22 = (this.getChild("n22"));
  15644. this.n23 = (this.getChild("n23"));
  15645. this.n24 = (this.getChild("n24"));
  15646. this.n25 = (this.getChild("n25"));
  15647. this.n26 = (this.getChild("n26"));
  15648. this.n27 = (this.getChild("n27"));
  15649. this.n28 = (this.getChild("n28"));
  15650. this.n29 = (this.getChild("n29"));
  15651. this.n30 = (this.getChild("n30"));
  15652. this.n31 = (this.getChild("n31"));
  15653. this.n32 = (this.getChild("n32"));
  15654. this.n33 = (this.getChild("n33"));
  15655. }
  15656. }
  15657. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15658. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15659. static createInstance() {
  15660. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15661. }
  15662. onConstruct() {
  15663. this.n5 = (this.getChild("n5"));
  15664. this.n4 = (this.getChild("n4"));
  15665. this.t0 = this.getTransition("t0");
  15666. }
  15667. }
  15668. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15669. class ui_UITurntable_com5 extends fgui.GComponent {
  15670. static createInstance() {
  15671. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15672. }
  15673. onConstruct() {
  15674. this.flashNode = (this.getChild("flashNode"));
  15675. this.rotNode = (this.getChild("rotNode"));
  15676. this.n3 = (this.getChild("n3"));
  15677. this.n21 = (this.getChild("n21"));
  15678. this.t0 = this.getTransition("t0");
  15679. }
  15680. }
  15681. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15682. class ui_UITurntable_com7 extends fgui.GComponent {
  15683. static createInstance() {
  15684. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15685. }
  15686. onConstruct() {
  15687. this.n2 = (this.getChild("n2"));
  15688. this.n35 = (this.getChild("n35"));
  15689. this.img1 = (this.getChild("img1"));
  15690. this.img2 = (this.getChild("img2"));
  15691. this.img3 = (this.getChild("img3"));
  15692. this.img4 = (this.getChild("img4"));
  15693. this.img6 = (this.getChild("img6"));
  15694. this.img5 = (this.getChild("img5"));
  15695. this.txt1 = (this.getChild("txt1"));
  15696. this.txt2 = (this.getChild("txt2"));
  15697. this.txt3 = (this.getChild("txt3"));
  15698. this.txt4 = (this.getChild("txt4"));
  15699. this.txt5 = (this.getChild("txt5"));
  15700. this.txt6 = (this.getChild("txt6"));
  15701. }
  15702. }
  15703. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15704. class ui_UITurntable_com9 extends fgui.GComponent {
  15705. static createInstance() {
  15706. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15707. }
  15708. onConstruct() {
  15709. this.n38 = (this.getChild("n38"));
  15710. this.n39 = (this.getChild("n39"));
  15711. }
  15712. }
  15713. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15714. class ui_UITurntable_com10 extends fgui.GComponent {
  15715. static createInstance() {
  15716. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15717. }
  15718. onConstruct() {
  15719. this.n39 = (this.getChild("n39"));
  15720. this.n40 = (this.getChild("n40"));
  15721. this.t0 = this.getTransition("t0");
  15722. }
  15723. }
  15724. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15725. class ui_UITurntable_com11 extends fgui.GComponent {
  15726. static createInstance() {
  15727. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15728. }
  15729. onConstruct() {
  15730. this.n38 = (this.getChild("n38"));
  15731. this.n39 = (this.getChild("n39"));
  15732. this.n40 = (this.getChild("n40"));
  15733. this.t0 = this.getTransition("t0");
  15734. }
  15735. }
  15736. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15737. class ui_UITurntable_com12 extends fgui.GComponent {
  15738. static createInstance() {
  15739. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15740. }
  15741. onConstruct() {
  15742. this.n43 = (this.getChild("n43"));
  15743. this.barNode = (this.getChild("barNode"));
  15744. this.tipsTxt = (this.getChild("tipsTxt"));
  15745. this.n45 = (this.getChild("n45"));
  15746. this.boxBtn = (this.getChild("boxBtn"));
  15747. }
  15748. }
  15749. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  15750. class ui_UITurntable_com1 extends fgui.GButton {
  15751. static createInstance() {
  15752. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  15753. }
  15754. onConstruct() {
  15755. this.n41 = (this.getChild("n41"));
  15756. this.n42 = (this.getChild("n42"));
  15757. this.t0 = this.getTransition("t0");
  15758. }
  15759. }
  15760. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  15761. class ui_UITurntable_com3 extends fgui.GComponent {
  15762. static createInstance() {
  15763. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  15764. }
  15765. onConstruct() {
  15766. this.n48 = (this.getChild("n48"));
  15767. this.womanTxt = (this.getChild("womanTxt"));
  15768. this.t0 = this.getTransition("t0");
  15769. }
  15770. }
  15771. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  15772. class ui_cancelBtn2 extends fgui.GButton {
  15773. static createInstance() {
  15774. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  15775. }
  15776. onConstruct() {
  15777. this.c1 = this.getController("c1");
  15778. this.n0 = (this.getChild("n0"));
  15779. this.n1 = (this.getChild("n1"));
  15780. this.n2 = (this.getChild("n2"));
  15781. this.n3 = (this.getChild("n3"));
  15782. this.n4 = (this.getChild("n4"));
  15783. this.n5 = (this.getChild("n5"));
  15784. this.n6 = (this.getChild("n6"));
  15785. this.n7 = (this.getChild("n7"));
  15786. this.n8 = (this.getChild("n8"));
  15787. this.powerEft = (this.getChild("powerEft"));
  15788. }
  15789. }
  15790. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  15791. class ui_shareBtn2 extends fgui.GButton {
  15792. static createInstance() {
  15793. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  15794. }
  15795. onConstruct() {
  15796. this.c1 = this.getController("c1");
  15797. this.n2 = (this.getChild("n2"));
  15798. this.n24 = (this.getChild("n24"));
  15799. this.n1 = (this.getChild("n1"));
  15800. this.n3 = (this.getChild("n3"));
  15801. this.n23 = (this.getChild("n23"));
  15802. this.n4 = (this.getChild("n4"));
  15803. this.n5 = (this.getChild("n5"));
  15804. this.n6 = (this.getChild("n6"));
  15805. this.n20 = (this.getChild("n20"));
  15806. this.n21 = (this.getChild("n21"));
  15807. this.n22 = (this.getChild("n22"));
  15808. this.powerEft = (this.getChild("powerEft"));
  15809. }
  15810. }
  15811. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  15812. class ui_UIMoney extends fgui.GComponent {
  15813. static createInstance() {
  15814. return (fgui.UIPackage.createObject("game", "UIMoney"));
  15815. }
  15816. onConstruct() {
  15817. this.c1 = this.getController("c1");
  15818. this.n4 = (this.getChild("n4"));
  15819. this.coinImg = (this.getChild("coinImg"));
  15820. this.addCoinBtn = (this.getChild("addCoinBtn"));
  15821. this.coinTxt = (this.getChild("coinTxt"));
  15822. this.n7 = (this.getChild("n7"));
  15823. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  15824. this.diamondTxt = (this.getChild("diamondTxt"));
  15825. this.diamondImg = (this.getChild("diamondImg"));
  15826. this.n12 = (this.getChild("n12"));
  15827. this.powerImg = (this.getChild("powerImg"));
  15828. this.addPowerBtn = (this.getChild("addPowerBtn"));
  15829. this.powerTxt = (this.getChild("powerTxt"));
  15830. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  15831. }
  15832. }
  15833. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  15834. class ui_backBtn extends fgui.GButton {
  15835. static createInstance() {
  15836. return (fgui.UIPackage.createObject("game", "backBtn"));
  15837. }
  15838. onConstruct() {
  15839. this.n0 = (this.getChild("n0"));
  15840. this.t0 = this.getTransition("t0");
  15841. this.t1 = this.getTransition("t1");
  15842. }
  15843. }
  15844. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  15845. class ui_MoneyBtn extends fgui.GButton {
  15846. static createInstance() {
  15847. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  15848. }
  15849. onConstruct() {
  15850. this.button = this.getController("button");
  15851. this.n0 = (this.getChild("n0"));
  15852. }
  15853. }
  15854. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  15855. class ui_UIMoneyBtn extends fgui.GComponent {
  15856. static createInstance() {
  15857. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  15858. }
  15859. onConstruct() {
  15860. this.n1 = (this.getChild("n1"));
  15861. this.closeBtn = (this.getChild("closeBtn"));
  15862. }
  15863. }
  15864. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  15865. class ui_Component64 extends fgui.GComponent {
  15866. static createInstance() {
  15867. return (fgui.UIPackage.createObject("game", "Component64"));
  15868. }
  15869. onConstruct() {
  15870. this.n57 = (this.getChild("n57"));
  15871. this.n54 = (this.getChild("n54"));
  15872. this.n55 = (this.getChild("n55"));
  15873. this.n56 = (this.getChild("n56"));
  15874. this.t1 = this.getTransition("t1");
  15875. }
  15876. }
  15877. ui_Component64.URL = "ui://isxx5ak7wp26456";
  15878. class ui_Component41_3 extends fgui.GComponent {
  15879. static createInstance() {
  15880. return (fgui.UIPackage.createObject("game", "Component41_3"));
  15881. }
  15882. onConstruct() {
  15883. this.c1 = this.getController("c1");
  15884. this.n0 = (this.getChild("n0"));
  15885. this.n2 = (this.getChild("n2"));
  15886. this.cancelBtn = (this.getChild("cancelBtn"));
  15887. this.videoBtn = (this.getChild("videoBtn"));
  15888. this.n9 = (this.getChild("n9"));
  15889. this.n24 = (this.getChild("n24"));
  15890. this.n27 = (this.getChild("n27"));
  15891. this.titleTxt = (this.getChild("titleTxt"));
  15892. this.n28 = (this.getChild("n28"));
  15893. this.t0 = this.getTransition("t0");
  15894. }
  15895. }
  15896. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  15897. class ui_dh_zs_4 extends fgui.GComponent {
  15898. static createInstance() {
  15899. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  15900. }
  15901. onConstruct() {
  15902. this.n1 = (this.getChild("n1"));
  15903. this.n2 = (this.getChild("n2"));
  15904. this.n3 = (this.getChild("n3"));
  15905. this.n4 = (this.getChild("n4"));
  15906. this.n5 = (this.getChild("n5"));
  15907. this.n6 = (this.getChild("n6"));
  15908. this.n8 = (this.getChild("n8"));
  15909. this.t0 = this.getTransition("t0");
  15910. }
  15911. }
  15912. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  15913. class ui_Component71_1 extends fgui.GButton {
  15914. static createInstance() {
  15915. return (fgui.UIPackage.createObject("game", "Component71_1"));
  15916. }
  15917. onConstruct() {
  15918. this.n17 = (this.getChild("n17"));
  15919. this.t0 = this.getTransition("t0");
  15920. }
  15921. }
  15922. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  15923. class ui_Component83 extends fgui.GComponent {
  15924. static createInstance() {
  15925. return (fgui.UIPackage.createObject("game", "Component83"));
  15926. }
  15927. onConstruct() {
  15928. this.c1 = this.getController("c1");
  15929. this.n17 = (this.getChild("n17"));
  15930. this.n19 = (this.getChild("n19"));
  15931. this.n20 = (this.getChild("n20"));
  15932. }
  15933. }
  15934. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  15935. class ui_Component84 extends fgui.GComponent {
  15936. static createInstance() {
  15937. return (fgui.UIPackage.createObject("game", "Component84"));
  15938. }
  15939. onConstruct() {
  15940. this.c1 = this.getController("c1");
  15941. this.n4 = (this.getChild("n4"));
  15942. this.n22 = (this.getChild("n22"));
  15943. this.n23 = (this.getChild("n23"));
  15944. this.numTxt = (this.getChild("numTxt"));
  15945. this.n25 = (this.getChild("n25"));
  15946. this.n26 = (this.getChild("n26"));
  15947. }
  15948. }
  15949. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  15950. class ui_Component84_1 extends fgui.GComponent {
  15951. static createInstance() {
  15952. return (fgui.UIPackage.createObject("game", "Component84_1"));
  15953. }
  15954. onConstruct() {
  15955. this.c1 = this.getController("c1");
  15956. this.n4 = (this.getChild("n4"));
  15957. this.n22 = (this.getChild("n22"));
  15958. this.n23 = (this.getChild("n23"));
  15959. this.numTxt = (this.getChild("numTxt"));
  15960. this.n25 = (this.getChild("n25"));
  15961. this.n26 = (this.getChild("n26"));
  15962. }
  15963. }
  15964. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  15965. class ui_Component85 extends fgui.GComponent {
  15966. static createInstance() {
  15967. return (fgui.UIPackage.createObject("game", "Component85"));
  15968. }
  15969. onConstruct() {
  15970. this.n1 = (this.getChild("n1"));
  15971. this.n6 = (this.getChild("n6"));
  15972. this.n2 = (this.getChild("n2"));
  15973. this.n3 = (this.getChild("n3"));
  15974. this.levelTxt = (this.getChild("levelTxt"));
  15975. this.n10 = (this.getChild("n10"));
  15976. this.n11 = (this.getChild("n11"));
  15977. this.n12 = (this.getChild("n12"));
  15978. this.n13 = (this.getChild("n13"));
  15979. this.n14 = (this.getChild("n14"));
  15980. this.modeNode = (this.getChild("modeNode"));
  15981. this.n18 = (this.getChild("n18"));
  15982. this.conditionTxt = (this.getChild("conditionTxt"));
  15983. this.diamondNode = (this.getChild("diamondNode"));
  15984. this.coinNode = (this.getChild("coinNode"));
  15985. this.startBtn = (this.getChild("startBtn"));
  15986. this.n28 = (this.getChild("n28"));
  15987. this.displayRoot = (this.getChild("displayRoot"));
  15988. this.t0 = this.getTransition("t0");
  15989. }
  15990. }
  15991. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  15992. class ui_Component86 extends fgui.GButton {
  15993. static createInstance() {
  15994. return (fgui.UIPackage.createObject("game", "Component86"));
  15995. }
  15996. onConstruct() {
  15997. this.n15 = (this.getChild("n15"));
  15998. this.t0 = this.getTransition("t0");
  15999. }
  16000. }
  16001. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16002. class ui_Component87 extends fgui.GComponent {
  16003. static createInstance() {
  16004. return (fgui.UIPackage.createObject("game", "Component87"));
  16005. }
  16006. onConstruct() {
  16007. this.n66 = (this.getChild("n66"));
  16008. this.myProgress = (this.getChild("myProgress"));
  16009. this.starAni = (this.getChild("starAni"));
  16010. this.hpTxt = (this.getChild("hpTxt"));
  16011. this.n74 = (this.getChild("n74"));
  16012. this.n73 = (this.getChild("n73"));
  16013. this.ballTxt = (this.getChild("ballTxt"));
  16014. this.n76 = (this.getChild("n76"));
  16015. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16016. this.levelTxt = (this.getChild("levelTxt"));
  16017. this.star1 = (this.getChild("star1"));
  16018. this.star2 = (this.getChild("star2"));
  16019. this.star3 = (this.getChild("star3"));
  16020. }
  16021. }
  16022. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16023. class ui_Component88 extends fgui.GProgressBar {
  16024. static createInstance() {
  16025. return (fgui.UIPackage.createObject("game", "Component88"));
  16026. }
  16027. onConstruct() {
  16028. this.n68 = (this.getChild("n68"));
  16029. this.bar = (this.getChild("bar"));
  16030. }
  16031. }
  16032. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16033. class ui_Component89 extends fgui.GComponent {
  16034. static createInstance() {
  16035. return (fgui.UIPackage.createObject("game", "Component89"));
  16036. }
  16037. onConstruct() {
  16038. this.c1 = this.getController("c1");
  16039. this.n71 = (this.getChild("n71"));
  16040. this.n72 = (this.getChild("n72"));
  16041. }
  16042. }
  16043. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16044. class ui_Component90 extends fgui.GComponent {
  16045. static createInstance() {
  16046. return (fgui.UIPackage.createObject("game", "Component90"));
  16047. }
  16048. onConstruct() {
  16049. this.c1 = this.getController("c1");
  16050. this.n64 = (this.getChild("n64"));
  16051. this.n65 = (this.getChild("n65"));
  16052. this.n66 = (this.getChild("n66"));
  16053. this.t0 = this.getTransition("t0");
  16054. }
  16055. }
  16056. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16057. class ui_Component127 extends fgui.GButton {
  16058. static createInstance() {
  16059. return (fgui.UIPackage.createObject("game", "Component127"));
  16060. }
  16061. onConstruct() {
  16062. this.n5 = (this.getChild("n5"));
  16063. }
  16064. }
  16065. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16066. class gameBinder {
  16067. static bindAll() {
  16068. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16069. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16070. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16071. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16072. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16073. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16074. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16075. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16076. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16077. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16078. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16079. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16080. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16081. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16082. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16083. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16084. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16085. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16086. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16087. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16088. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16089. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16090. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16091. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16092. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16093. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16094. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16095. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16096. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16097. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16098. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16099. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16100. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16101. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16102. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16103. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16104. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16105. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16106. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16107. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16108. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16109. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16110. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16111. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16112. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16113. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16114. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16115. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16116. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16117. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16118. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16119. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16120. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16121. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16122. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16123. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16124. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16125. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16126. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16127. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16128. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16129. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16130. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16131. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16132. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16133. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16134. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16135. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16136. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16137. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16138. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16139. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16140. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16141. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16142. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16143. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16144. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16145. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16146. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16147. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16148. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16149. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16150. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16151. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16152. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16153. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16154. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16155. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16156. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16157. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16158. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16159. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16160. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16161. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16162. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16163. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16164. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16165. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16166. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16167. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16168. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16169. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16170. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16171. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16172. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16173. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16174. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16175. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16176. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16177. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16178. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16179. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16180. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16181. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16182. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16183. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16184. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16185. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16186. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16187. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16188. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16189. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16190. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16191. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16192. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16193. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16194. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16195. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16196. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16197. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16198. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16199. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16200. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16201. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16202. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16203. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16204. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16205. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16206. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16207. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16208. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16209. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16210. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16211. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16212. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16213. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16214. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16215. fgui.UIObjectFactory.setExtension(ui_Component_fuli1.URL, ui_Component_fuli1);
  16216. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16217. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16218. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16219. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16220. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16221. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16222. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16223. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16224. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16225. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16226. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16227. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16228. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16229. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16230. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16231. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16232. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16233. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16234. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16235. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16236. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16237. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16238. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16239. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16240. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16241. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16242. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16243. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16244. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16245. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16246. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16247. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16248. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16249. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16250. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16251. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16252. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16253. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16254. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16255. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16256. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16257. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16258. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16259. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16260. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16261. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16262. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16263. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16264. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16265. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16266. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16267. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16268. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16269. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16270. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16271. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16272. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16273. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16274. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16275. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16276. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16277. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16278. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16279. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16280. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16281. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16282. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16283. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16284. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16285. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16286. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16287. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16288. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16289. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16290. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16291. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16292. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16293. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16294. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16295. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16296. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16297. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16298. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16299. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16300. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16301. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16302. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16303. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16304. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16305. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16306. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16307. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16308. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16309. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16310. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16311. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16312. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16313. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16314. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16315. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16316. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16317. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16318. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16319. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16320. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16321. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16322. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16323. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16324. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16325. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16326. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16327. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16328. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16329. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16330. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16331. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16332. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16333. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16334. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16335. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16336. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16337. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16338. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16339. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16340. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16341. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16342. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16343. }
  16344. }
  16345. class ui_btn6 extends fgui.GButton {
  16346. static createInstance() {
  16347. return (fgui.UIPackage.createObject("loading", "btn6"));
  16348. }
  16349. onConstruct() {
  16350. this.n6 = (this.getChild("n6"));
  16351. this.n1 = (this.getChild("n1"));
  16352. }
  16353. }
  16354. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16355. class ui_xyItem extends fgui.GComponent {
  16356. static createInstance() {
  16357. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16358. }
  16359. onConstruct() {
  16360. this.xyItem = (this.getChild("xyItem"));
  16361. }
  16362. }
  16363. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16364. class ui_loadinfo extends fgui.GProgressBar {
  16365. static createInstance() {
  16366. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16367. }
  16368. onConstruct() {
  16369. this.bg = (this.getChild("bg"));
  16370. this.bar = (this.getChild("bar"));
  16371. this.title = (this.getChild("title"));
  16372. this.ani = (this.getChild("ani"));
  16373. }
  16374. }
  16375. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16376. class ui_xyNode extends fgui.GComponent {
  16377. static createInstance() {
  16378. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16379. }
  16380. onConstruct() {
  16381. this.n0 = (this.getChild("n0"));
  16382. this.btnYes = (this.getChild("btnYes"));
  16383. this.btnNo = (this.getChild("btnNo"));
  16384. this.btnKnown = (this.getChild("btnKnown"));
  16385. this.btnSure = (this.getChild("btnSure"));
  16386. this.txtWelcom = (this.getChild("txtWelcom"));
  16387. this.txtXy = (this.getChild("txtXy"));
  16388. this.n75 = (this.getChild("n75"));
  16389. this.btnXy1 = (this.getChild("btnXy1"));
  16390. this.btnXy3 = (this.getChild("btnXy3"));
  16391. this.btnXy2 = (this.getChild("btnXy2"));
  16392. this.n74 = (this.getChild("n74"));
  16393. this.xy1 = (this.getChild("xy1"));
  16394. this.txtTitle = (this.getChild("txtTitle"));
  16395. this.btnBack = (this.getChild("btnBack"));
  16396. this.xyList = (this.getChild("xyList"));
  16397. this.xy2 = (this.getChild("xy2"));
  16398. this.xyNode = (this.getChild("xyNode"));
  16399. }
  16400. }
  16401. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16402. class ui_ageNode extends fgui.GComponent {
  16403. static createInstance() {
  16404. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16405. }
  16406. onConstruct() {
  16407. this.n3 = (this.getChild("n3"));
  16408. this.n7 = (this.getChild("n7"));
  16409. this.n4 = (this.getChild("n4"));
  16410. this.btnAge = (this.getChild("btnAge"));
  16411. this.ageNode = (this.getChild("ageNode"));
  16412. }
  16413. }
  16414. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16415. class ui_rnNode extends fgui.GComponent {
  16416. static createInstance() {
  16417. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16418. }
  16419. onConstruct() {
  16420. this.n28 = (this.getChild("n28"));
  16421. this.n30 = (this.getChild("n30"));
  16422. this.n33 = (this.getChild("n33"));
  16423. this.rn1 = (this.getChild("rn1"));
  16424. this.n40 = (this.getChild("n40"));
  16425. this.n41 = (this.getChild("n41"));
  16426. this.rn3 = (this.getChild("rn3"));
  16427. this.n37 = (this.getChild("n37"));
  16428. this.n39 = (this.getChild("n39"));
  16429. this.rn2 = (this.getChild("rn2"));
  16430. this.n47 = (this.getChild("n47"));
  16431. this.n49 = (this.getChild("n49"));
  16432. this.n44 = (this.getChild("n44"));
  16433. this.inputCode = (this.getChild("inputCode"));
  16434. this.inputName = (this.getChild("inputName"));
  16435. this.n48 = (this.getChild("n48"));
  16436. this.n50 = (this.getChild("n50"));
  16437. this.rn4 = (this.getChild("rn4"));
  16438. this.btnCheck = (this.getChild("btnCheck"));
  16439. this.btnExit = (this.getChild("btnExit"));
  16440. this.btnDone = (this.getChild("btnDone"));
  16441. this.rnNode = (this.getChild("rnNode"));
  16442. }
  16443. }
  16444. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16445. class ui_tipNode extends fgui.GComponent {
  16446. static createInstance() {
  16447. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16448. }
  16449. onConstruct() {
  16450. this.bg = (this.getChild("bg"));
  16451. this.n55 = (this.getChild("n55"));
  16452. this.n56 = (this.getChild("n56"));
  16453. this.tipNode = (this.getChild("tipNode"));
  16454. }
  16455. }
  16456. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16457. class ui_fcmNode extends fgui.GComponent {
  16458. static createInstance() {
  16459. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16460. }
  16461. onConstruct() {
  16462. this.n63 = (this.getChild("n63"));
  16463. this.n62 = (this.getChild("n62"));
  16464. this.btnRn = (this.getChild("btnRn"));
  16465. this.n61 = (this.getChild("n61"));
  16466. this.n58 = (this.getChild("n58"));
  16467. this.fcmNode = (this.getChild("fcmNode"));
  16468. }
  16469. }
  16470. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16471. class ui_msgNode extends fgui.GComponent {
  16472. static createInstance() {
  16473. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16474. }
  16475. onConstruct() {
  16476. this.n69 = (this.getChild("n69"));
  16477. this.txtMsg = (this.getChild("txtMsg"));
  16478. this.msgNode = (this.getChild("msgNode"));
  16479. }
  16480. }
  16481. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16482. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16483. static createInstance() {
  16484. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16485. }
  16486. onConstruct() {
  16487. this.n1 = (this.getChild("n1"));
  16488. this.n13 = (this.getChild("n13"));
  16489. this.n14 = (this.getChild("n14"));
  16490. this.n15 = (this.getChild("n15"));
  16491. this.n3 = (this.getChild("n3"));
  16492. this.n4 = (this.getChild("n4"));
  16493. this.n5 = (this.getChild("n5"));
  16494. this.n6 = (this.getChild("n6"));
  16495. this.n7 = (this.getChild("n7"));
  16496. this.n8 = (this.getChild("n8"));
  16497. this.n9 = (this.getChild("n9"));
  16498. this.n10 = (this.getChild("n10"));
  16499. this.n12 = (this.getChild("n12"));
  16500. this.n11 = (this.getChild("n11"));
  16501. this.n16 = (this.getChild("n16"));
  16502. this.n17 = (this.getChild("n17"));
  16503. this.n18 = (this.getChild("n18"));
  16504. this.n20 = (this.getChild("n20"));
  16505. this.n21 = (this.getChild("n21"));
  16506. this.t0 = this.getTransition("t0");
  16507. }
  16508. }
  16509. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16510. class ui_btn5 extends fgui.GButton {
  16511. static createInstance() {
  16512. return (fgui.UIPackage.createObject("loading", "btn5"));
  16513. }
  16514. onConstruct() {
  16515. this.n9 = (this.getChild("n9"));
  16516. this.n1 = (this.getChild("n1"));
  16517. }
  16518. }
  16519. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16520. class ui_UILoading extends fgui.GComponent {
  16521. static createInstance() {
  16522. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16523. }
  16524. onConstruct() {
  16525. this.n12 = (this.getChild("n12"));
  16526. this.loadinfo = (this.getChild("loadinfo"));
  16527. this.n13 = (this.getChild("n13"));
  16528. this.txtLoad = (this.getChild("txtLoad"));
  16529. this.n18 = (this.getChild("n18"));
  16530. }
  16531. }
  16532. ui_UILoading.URL = "ui://37nctnhwphc33";
  16533. class ui_AgeItem extends fgui.GComponent {
  16534. static createInstance() {
  16535. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16536. }
  16537. onConstruct() {
  16538. this.txtAge = (this.getChild("txtAge"));
  16539. }
  16540. }
  16541. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16542. class ui_btn1 extends fgui.GButton {
  16543. static createInstance() {
  16544. return (fgui.UIPackage.createObject("loading", "btn1"));
  16545. }
  16546. onConstruct() {
  16547. this.n6 = (this.getChild("n6"));
  16548. this.n1 = (this.getChild("n1"));
  16549. }
  16550. }
  16551. ui_btn1.URL = "ui://37nctnhwxe622p";
  16552. class ui_btn3 extends fgui.GButton {
  16553. static createInstance() {
  16554. return (fgui.UIPackage.createObject("loading", "btn3"));
  16555. }
  16556. onConstruct() {
  16557. this.n9 = (this.getChild("n9"));
  16558. this.n1 = (this.getChild("n1"));
  16559. }
  16560. }
  16561. ui_btn3.URL = "ui://37nctnhwxe622s";
  16562. class ui_btn2 extends fgui.GButton {
  16563. static createInstance() {
  16564. return (fgui.UIPackage.createObject("loading", "btn2"));
  16565. }
  16566. onConstruct() {
  16567. this.n6 = (this.getChild("n6"));
  16568. this.n1 = (this.getChild("n1"));
  16569. }
  16570. }
  16571. ui_btn2.URL = "ui://37nctnhwxe622t";
  16572. class ui_btnBack extends fgui.GButton {
  16573. static createInstance() {
  16574. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16575. }
  16576. onConstruct() {
  16577. this.n6 = (this.getChild("n6"));
  16578. this.n7 = (this.getChild("n7"));
  16579. }
  16580. }
  16581. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16582. class ui_btnXy1 extends fgui.GButton {
  16583. static createInstance() {
  16584. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16585. }
  16586. onConstruct() {
  16587. this.n1 = (this.getChild("n1"));
  16588. }
  16589. }
  16590. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16591. class ui_btnXy2 extends fgui.GButton {
  16592. static createInstance() {
  16593. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16594. }
  16595. onConstruct() {
  16596. this.n1 = (this.getChild("n1"));
  16597. }
  16598. }
  16599. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16600. class ui_btnXy3 extends fgui.GButton {
  16601. static createInstance() {
  16602. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16603. }
  16604. onConstruct() {
  16605. this.n1 = (this.getChild("n1"));
  16606. }
  16607. }
  16608. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16609. class ui_btn4 extends fgui.GButton {
  16610. static createInstance() {
  16611. return (fgui.UIPackage.createObject("loading", "btn4"));
  16612. }
  16613. onConstruct() {
  16614. this.n9 = (this.getChild("n9"));
  16615. this.n1 = (this.getChild("n1"));
  16616. }
  16617. }
  16618. ui_btn4.URL = "ui://37nctnhwxe622z";
  16619. class loadingBinder {
  16620. static bindAll() {
  16621. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16622. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16623. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16624. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16625. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16626. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16627. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16628. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16629. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16630. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16631. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16632. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16633. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16634. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16635. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16636. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16637. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16638. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16639. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16640. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16641. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16642. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16643. }
  16644. }
  16645. class UIMgr {
  16646. constructor() {
  16647. this._stage = null;
  16648. this._uiList = [];
  16649. this._showList = [];
  16650. this._bindPkgList = [];
  16651. this.uiIndex = 0;
  16652. }
  16653. static get inst() {
  16654. if (UIMgr._inst == null) {
  16655. UIMgr._inst = new UIMgr();
  16656. }
  16657. return UIMgr._inst;
  16658. }
  16659. setStage(s) {
  16660. if (this._stage) {
  16661. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16662. return;
  16663. }
  16664. this._stage = s;
  16665. }
  16666. clearTempData() {
  16667. console.log('zh:clearTempData start');
  16668. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16669. console.log('zh:clearTempData end');
  16670. }
  16671. init() {
  16672. this.setStage(Laya.stage);
  16673. fairygui.UIConfig.defaultFont = "微软雅黑";
  16674. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  16675. fairygui.UIConfig.packageFileExtension = "obj";
  16676. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16677. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16678. fairygui.GRoot.inst.width = Laya.stage.width;
  16679. fairygui.GRoot.inst.height = Laya.stage.height;
  16680. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16681. }
  16682. addAllUpdate() {
  16683. this.uiIndex = 0;
  16684. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16685. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16686. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16687. }
  16688. }
  16689. }
  16690. bindFUI(pkgname) {
  16691. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16692. return;
  16693. }
  16694. switch (pkgname) {
  16695. case fguiRes.loading:
  16696. fairygui.UIPackage.addPackage(pkgname);
  16697. loadingBinder.bindAll();
  16698. this._bindPkgList.push(pkgname);
  16699. break;
  16700. case fguiRes.game:
  16701. fairygui.UIPackage.addPackage(pkgname);
  16702. gameBinder.bindAll();
  16703. this._bindPkgList.push(pkgname);
  16704. break;
  16705. default:
  16706. break;
  16707. }
  16708. }
  16709. Show(cls, ...param) {
  16710. let nameStr = cls.uiName;
  16711. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16712. let temp = this._uiList[i];
  16713. let str = temp.className;
  16714. if (str == nameStr) {
  16715. if (temp.isMuti) {
  16716. if (temp.isHide) {
  16717. temp.show(...param);
  16718. this._uiList.splice(i, 1);
  16719. this._uiList.push(temp);
  16720. return temp;
  16721. }
  16722. }
  16723. else {
  16724. temp.show(...param);
  16725. this._uiList.splice(i, 1);
  16726. this._uiList.push(temp);
  16727. return temp;
  16728. }
  16729. }
  16730. }
  16731. let ui = new cls();
  16732. ui.className = nameStr;
  16733. this._showUI(ui, param);
  16734. return ui;
  16735. }
  16736. destroyUI(ui) {
  16737. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16738. let temp = this._uiList[i].className;
  16739. if (temp == ui.className) {
  16740. this._uiList.splice(i, 1);
  16741. break;
  16742. }
  16743. }
  16744. this.checkUIState();
  16745. }
  16746. _showUI(ui, param) {
  16747. this._uiList.push(ui);
  16748. ui.show(...param);
  16749. }
  16750. Hide(uiClass) {
  16751. let ui = this.getUI(uiClass);
  16752. if (ui && !ui.isHide) {
  16753. ui.hide();
  16754. }
  16755. }
  16756. getUI(ui) {
  16757. let nameStr = ui.uiName;
  16758. for (let index = 0; index < this._uiList.length; index++) {
  16759. let temp = this._uiList[index];
  16760. if (temp.className == nameStr) {
  16761. return temp;
  16762. }
  16763. }
  16764. return null;
  16765. }
  16766. isShow(cls) {
  16767. for (var i of this._uiList) {
  16768. if (i instanceof cls) {
  16769. return i.isShowing;
  16770. }
  16771. }
  16772. return false;
  16773. }
  16774. showUINum() {
  16775. let num = 0;
  16776. for (var i of this._uiList) {
  16777. if (i.isShowing) {
  16778. num++;
  16779. }
  16780. }
  16781. return num;
  16782. }
  16783. checkUIState() {
  16784. Laya.timer.clear(this, this._uiCheck);
  16785. Laya.timer.once(400, this, this._uiCheck);
  16786. }
  16787. _uiCheck() {
  16788. let showList = [];
  16789. for (var i of this._uiList) {
  16790. if (!i.isHide) {
  16791. showList.push(i);
  16792. }
  16793. }
  16794. for (let index = 0; index < showList.length; index++) {
  16795. if (index == showList.length - 1) {
  16796. showList[index].checkActive(true);
  16797. }
  16798. else {
  16799. showList[index].checkActive(false);
  16800. }
  16801. }
  16802. }
  16803. showTip(msg, time = 600, size = 30) {
  16804. }
  16805. }
  16806. class UIShowList {
  16807. }
  16808. class SoundMgr {
  16809. constructor() {
  16810. this.soundMax = 4;
  16811. this.isLoad = false;
  16812. this.soundMap = {};
  16813. this.isSound = true;
  16814. this.openShake = true;
  16815. SoundMgr._instance = this;
  16816. }
  16817. static getInstance() {
  16818. if (!this._instance) {
  16819. this._instance = new SoundMgr();
  16820. }
  16821. return this._instance;
  16822. }
  16823. init() {
  16824. console.log('zh:sm init 1');
  16825. Laya.SoundManager.autoReleaseSound = true;
  16826. Laya.SoundManager.autoStopMusic = true;
  16827. Laya.SoundManager.musicVolume = 0.3;
  16828. Laya.SoundManager.soundVolume = 0.5;
  16829. this.musicPlayed = false;
  16830. this.audioUrl = "asset/sound/ogg/";
  16831. console.log('zh:sm init 2');
  16832. console.log('zh:dev type ');
  16833. if (Laya.Browser.onAndroid) {
  16834. console.log('zh:dev type android');
  16835. this.audioUrl = "asset/sound/ogg/";
  16836. this.isLoad = true;
  16837. }
  16838. else {
  16839. console.log('zh:dev type not android');
  16840. this.audioUrl = "asset/sound/mp3/";
  16841. this.isLoad = true;
  16842. }
  16843. }
  16844. onSetting(isS) {
  16845. this.isSound = isS;
  16846. this.mute(!this.isSound);
  16847. }
  16848. clearCount() {
  16849. for (var key in this.soundMap) {
  16850. delete this.soundMap[key];
  16851. }
  16852. }
  16853. playMusic(path, loop = 0) {
  16854. console.log('zh:playMusic 1 PATH=' + path);
  16855. this.musicPath = path;
  16856. if (!this.isLoad) {
  16857. return;
  16858. }
  16859. if (!path || path == "") {
  16860. return;
  16861. }
  16862. if (!this.isSound) {
  16863. return;
  16864. }
  16865. this.musicPlayed = true;
  16866. let url = this.getUrl(path);
  16867. if (!Laya.Browser.onAndroid) {
  16868. Laya.loader.load(url, Laya.Handler.create(this, () => {
  16869. this.play(url, loop);
  16870. }));
  16871. }
  16872. else {
  16873. this.play(url, loop);
  16874. }
  16875. }
  16876. play(url, loop) {
  16877. Laya.SoundManager.playMusic(url, loop);
  16878. }
  16879. getUrl(path) {
  16880. let url = this.audioUrl + path;
  16881. if (Laya.Browser.onAndroid) {
  16882. url += ".ogg";
  16883. }
  16884. else {
  16885. url += ".mp3";
  16886. }
  16887. return url;
  16888. }
  16889. pauseMusic(pause) {
  16890. if (pause) {
  16891. this.mute(true);
  16892. }
  16893. else if (this.isSound)
  16894. this.mute(false);
  16895. }
  16896. stopMusic() {
  16897. Laya.SoundManager.stopMusic();
  16898. if (Moyu.isNeedPlatAudio) {
  16899. Moyu.stopMusic();
  16900. }
  16901. }
  16902. mute(mute) {
  16903. if (Moyu.isNeedPlatAudio) {
  16904. Moyu.pauseMusic(mute);
  16905. }
  16906. else {
  16907. Laya.SoundManager.musicMuted = mute;
  16908. if (!mute && !this.musicPlayed && this.musicPath) {
  16909. this.playMusic(this.musicPath);
  16910. }
  16911. }
  16912. }
  16913. stopSound(path) {
  16914. let url = this.getUrl(path);
  16915. Laya.SoundManager.stopSound(url);
  16916. }
  16917. playSound(path, loop = 1, soundMax = this.soundMax) {
  16918. if (!this.isLoad)
  16919. return;
  16920. if (!this.isSound)
  16921. return;
  16922. if (!path || path == "")
  16923. return;
  16924. let url = this.getUrl(path);
  16925. if (Moyu.isNeedPlatAudio) {
  16926. Moyu.playSound(path, loop == 0);
  16927. }
  16928. else {
  16929. let count = 1;
  16930. if (this.soundMap[path])
  16931. count = this.soundMap[path] + 1;
  16932. if (count > soundMax)
  16933. return;
  16934. this.soundMap[path] = count;
  16935. Laya.SoundManager.playSound(url, loop);
  16936. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  16937. }
  16938. }
  16939. removePath(path) {
  16940. if (this.soundMap[path]) {
  16941. let count = this.soundMap[path];
  16942. count--;
  16943. if (count < 1)
  16944. delete this.soundMap[path];
  16945. else
  16946. this.soundMap[path] = count;
  16947. }
  16948. }
  16949. playBtnSound() {
  16950. this.playSound("btn");
  16951. }
  16952. playGetSound() {
  16953. }
  16954. playCloseUISound() {
  16955. }
  16956. }
  16957. SoundMgr._instance = null;
  16958. var Handler$1 = Laya.Handler;
  16959. var EResType;
  16960. (function (EResType) {
  16961. EResType[EResType["none"] = 0] = "none";
  16962. EResType[EResType["nromal"] = 1] = "nromal";
  16963. EResType[EResType["td"] = 2] = "td";
  16964. EResType[EResType["sk"] = 3] = "sk";
  16965. })(EResType || (EResType = {}));
  16966. class CResLoader {
  16967. constructor(doneCall, proCall) {
  16968. this.completrCall = doneCall;
  16969. this.progressCall = proCall;
  16970. this.progressHander = new Handler$1(this, this.onProgress);
  16971. this.tdResMap = {};
  16972. }
  16973. load(resList) {
  16974. this.resCount = 0;
  16975. this.loadCount = 0;
  16976. for (let i = 0; i < resList.length; i++) {
  16977. let path = resList[i];
  16978. if (!path)
  16979. continue;
  16980. this.resCount++;
  16981. let type = this.getResType(path);
  16982. if (type == EResType.nromal)
  16983. this.loadNromal(path);
  16984. else if (type == EResType.td)
  16985. this.loadTd(path);
  16986. }
  16987. }
  16988. getRes(path) {
  16989. let type = this.getResType(path);
  16990. if (type == EResType.nromal)
  16991. return Laya.loader.getRes(path);
  16992. else if (type == EResType.td) {
  16993. let res = this.tdResMap[path];
  16994. if (res)
  16995. return res.clone();
  16996. return null;
  16997. }
  16998. }
  16999. destroy() {
  17000. this.progressHander.clear();
  17001. this.progressHander = null;
  17002. }
  17003. clearRes(path) {
  17004. let type = this.getResType(path);
  17005. if (type == EResType.nromal)
  17006. Laya.loader.clearRes(path);
  17007. else if (type == EResType.td) {
  17008. let obj = this.tdResMap[path];
  17009. if (obj)
  17010. obj.destroy();
  17011. delete this.tdResMap[path];
  17012. }
  17013. }
  17014. getResType(path) {
  17015. let exs = this.getExtension(path);
  17016. if (exs == "sk")
  17017. return EResType.sk;
  17018. if (exs == "ls" || exs == "lh" || exs == "lm")
  17019. return EResType.td;
  17020. else
  17021. return EResType.nromal;
  17022. }
  17023. getExtension(res) {
  17024. var index = res.lastIndexOf(".");
  17025. return res.substr(index + 1);
  17026. }
  17027. loadNromal(path) {
  17028. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17029. if (res) {
  17030. this.onLoad();
  17031. }
  17032. else
  17033. console.log("load res fail:" + path);
  17034. }), this.progressHander);
  17035. }
  17036. loadSk() {
  17037. }
  17038. loadTd(path) {
  17039. if (this.tdResMap[path]) {
  17040. this.onLoad();
  17041. return;
  17042. }
  17043. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17044. if (res) {
  17045. this.tdResMap[path] = res;
  17046. this.onLoad();
  17047. }
  17048. else
  17049. console.log("load res fail:" + path);
  17050. }));
  17051. }
  17052. onLoad() {
  17053. this.loadCount++;
  17054. this.onProgress(1);
  17055. if (this.loadCount >= this.resCount) {
  17056. this.completrCall.run();
  17057. }
  17058. }
  17059. onProgress(pro) {
  17060. let progress = (this.loadCount + pro) / this.resCount;
  17061. this.progressCall.runWith(progress);
  17062. }
  17063. }
  17064. var Handler$2 = Laya.Handler;
  17065. class ResInfo {
  17066. constructor() {
  17067. this.index = 0;
  17068. }
  17069. }
  17070. class ResMgr {
  17071. constructor() {
  17072. this.resList = [];
  17073. this.doneList = [];
  17074. this.resMap = {};
  17075. this.currentLoad = null;
  17076. this.completeHandler = new Handler$2(this, this.onComplete);
  17077. this.progressHandler = new Handler$2(this, this.onProgress);
  17078. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17079. }
  17080. static getInstance() {
  17081. if (ResMgr._instance == null) {
  17082. ResMgr._instance = new ResMgr();
  17083. }
  17084. return ResMgr._instance;
  17085. }
  17086. loadList(list, completeHandler, progressHandler) {
  17087. if (list.length < 1) {
  17088. completeHandler.run();
  17089. return;
  17090. }
  17091. let info = this.getResInfo();
  17092. info.resList = list;
  17093. info.completeHandler = completeHandler;
  17094. info.progressHandler = progressHandler;
  17095. this.resList.push(info);
  17096. this.startLoad();
  17097. }
  17098. loadFguiRes(list, completeHandler, progressHandler) {
  17099. Laya.loader.load(list, completeHandler, progressHandler);
  17100. }
  17101. loadAny(list, completeHandler, progressHandler) {
  17102. Laya.loader.load(list, completeHandler, progressHandler);
  17103. }
  17104. load(path, completeHandler, progressHandler) {
  17105. let count = this.resMap[path];
  17106. if (count && count > 0) {
  17107. if (completeHandler)
  17108. completeHandler.run();
  17109. }
  17110. else
  17111. this.loadList([path], completeHandler, progressHandler);
  17112. }
  17113. getRes(path) {
  17114. let res = this.resMap[path];
  17115. if (!res)
  17116. this.showLog("资源不存在:" + path);
  17117. else
  17118. return this.loader.getRes(path);
  17119. }
  17120. clearList(list, force = false) {
  17121. if (!list || list.length < 1)
  17122. return;
  17123. let cr = () => {
  17124. for (const k in list) {
  17125. let v = list[k];
  17126. if (!v)
  17127. continue;
  17128. if (force) {
  17129. this.loader.clearRes(v);
  17130. delete this.resMap[v];
  17131. }
  17132. else {
  17133. let count = this.resMap[v];
  17134. if (count && count > 1) {
  17135. count--;
  17136. this.resMap[v] = count;
  17137. }
  17138. else {
  17139. this.loader.clearRes(v);
  17140. delete this.resMap[v];
  17141. }
  17142. }
  17143. }
  17144. if (!window.hasOwnProperty("ks"))
  17145. Laya.Resource.destroyUnusedResources();
  17146. };
  17147. Laya.timer.clearAll(this);
  17148. Laya.timer.once(2000, this, cr);
  17149. }
  17150. clear3D() {
  17151. for (const k in this.loader.tdResMap) {
  17152. this.loader.clearRes(k);
  17153. if (this.resMap[k])
  17154. delete this.resMap[k];
  17155. }
  17156. if (!window.hasOwnProperty("ks"))
  17157. Laya.Resource.destroyUnusedResources();
  17158. }
  17159. clear(path, force = false) {
  17160. this.clearList([path], force);
  17161. }
  17162. getResInfo() {
  17163. if (this.doneList.length > 0)
  17164. return this.doneList.pop();
  17165. else
  17166. return new ResInfo();
  17167. }
  17168. startLoad() {
  17169. if (this.currentLoad)
  17170. return;
  17171. this.currentLoad = this.resList.pop();
  17172. if (this.currentLoad) {
  17173. this.loader.load(this.currentLoad.resList);
  17174. }
  17175. }
  17176. onComplete() {
  17177. if (!this.currentLoad)
  17178. return;
  17179. for (const k in this.currentLoad.resList) {
  17180. let v = this.currentLoad.resList[k];
  17181. let count = this.resMap[v];
  17182. if (count)
  17183. count++;
  17184. else
  17185. count = 1;
  17186. this.resMap[v] = count;
  17187. }
  17188. if (this.currentLoad.completeHandler)
  17189. this.currentLoad.completeHandler.run();
  17190. this.doneList.push(this.currentLoad);
  17191. this.currentLoad = null;
  17192. this.startLoad();
  17193. }
  17194. onProgress(pro) {
  17195. if (!this.currentLoad)
  17196. return;
  17197. if (this.currentLoad.progressHandler)
  17198. this.currentLoad.progressHandler.runWith(pro);
  17199. }
  17200. showLog(str, ...args) {
  17201. console.log("[ResLoader] " + str);
  17202. }
  17203. }
  17204. ResMgr._instance = null;
  17205. class EventMgr extends Laya.EventDispatcher {
  17206. }
  17207. let eventMgr = new EventMgr();
  17208. /*! *****************************************************************************
  17209. Copyright (c) Microsoft Corporation. All rights reserved.
  17210. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17211. this file except in compliance with the License. You may obtain a copy of the
  17212. License at http://www.apache.org/licenses/LICENSE-2.0
  17213. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17214. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17215. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17216. MERCHANTABLITY OR NON-INFRINGEMENT.
  17217. See the Apache Version 2.0 License for specific language governing permissions
  17218. and limitations under the License.
  17219. ***************************************************************************** */
  17220. /* global Reflect, Promise */
  17221. var extendStatics = function(d, b) {
  17222. extendStatics = Object.setPrototypeOf ||
  17223. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17224. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17225. return extendStatics(d, b);
  17226. };
  17227. function __extends(d, b) {
  17228. extendStatics(d, b);
  17229. function __() { this.constructor = d; }
  17230. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17231. }
  17232. var __assign = function() {
  17233. __assign = Object.assign || function __assign(t) {
  17234. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17235. s = arguments[i];
  17236. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17237. }
  17238. return t;
  17239. };
  17240. return __assign.apply(this, arguments);
  17241. };
  17242. function __rest(s, e) {
  17243. var t = {};
  17244. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17245. t[p] = s[p];
  17246. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17247. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17248. t[p[i]] = s[p[i]];
  17249. return t;
  17250. }
  17251. function __decorate(decorators, target, key, desc) {
  17252. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17253. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17254. 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;
  17255. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17256. }
  17257. function __param(paramIndex, decorator) {
  17258. return function (target, key) { decorator(target, key, paramIndex); }
  17259. }
  17260. function __metadata(metadataKey, metadataValue) {
  17261. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17262. }
  17263. function __awaiter(thisArg, _arguments, P, generator) {
  17264. return new (P || (P = Promise))(function (resolve, reject) {
  17265. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17266. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17267. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17268. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17269. });
  17270. }
  17271. function __generator(thisArg, body) {
  17272. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17273. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17274. function verb(n) { return function (v) { return step([n, v]); }; }
  17275. function step(op) {
  17276. if (f) throw new TypeError("Generator is already executing.");
  17277. while (_) try {
  17278. 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;
  17279. if (y = 0, t) op = [op[0] & 2, t.value];
  17280. switch (op[0]) {
  17281. case 0: case 1: t = op; break;
  17282. case 4: _.label++; return { value: op[1], done: false };
  17283. case 5: _.label++; y = op[1]; op = [0]; continue;
  17284. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17285. default:
  17286. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17287. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17288. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17289. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17290. if (t[2]) _.ops.pop();
  17291. _.trys.pop(); continue;
  17292. }
  17293. op = body.call(thisArg, _);
  17294. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17295. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17296. }
  17297. }
  17298. function __exportStar(m, exports) {
  17299. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17300. }
  17301. function __values(o) {
  17302. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17303. if (m) return m.call(o);
  17304. return {
  17305. next: function () {
  17306. if (o && i >= o.length) o = void 0;
  17307. return { value: o && o[i++], done: !o };
  17308. }
  17309. };
  17310. }
  17311. function __read(o, n) {
  17312. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17313. if (!m) return o;
  17314. var i = m.call(o), r, ar = [], e;
  17315. try {
  17316. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17317. }
  17318. catch (error) { e = { error: error }; }
  17319. finally {
  17320. try {
  17321. if (r && !r.done && (m = i["return"])) m.call(i);
  17322. }
  17323. finally { if (e) throw e.error; }
  17324. }
  17325. return ar;
  17326. }
  17327. function __spread() {
  17328. for (var ar = [], i = 0; i < arguments.length; i++)
  17329. ar = ar.concat(__read(arguments[i]));
  17330. return ar;
  17331. }
  17332. function __await(v) {
  17333. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17334. }
  17335. function __asyncGenerator(thisArg, _arguments, generator) {
  17336. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17337. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17338. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17339. 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); }); }; }
  17340. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17341. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17342. function fulfill(value) { resume("next", value); }
  17343. function reject(value) { resume("throw", value); }
  17344. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17345. }
  17346. function __asyncDelegator(o) {
  17347. var i, p;
  17348. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17349. 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; }
  17350. }
  17351. function __asyncValues(o) {
  17352. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17353. var m = o[Symbol.asyncIterator], i;
  17354. 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);
  17355. 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); }); }; }
  17356. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17357. }
  17358. function __makeTemplateObject(cooked, raw) {
  17359. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17360. return cooked;
  17361. };
  17362. function __importStar(mod) {
  17363. if (mod && mod.__esModule) return mod;
  17364. var result = {};
  17365. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17366. result.default = mod;
  17367. return result;
  17368. }
  17369. function __importDefault(mod) {
  17370. return (mod && mod.__esModule) ? mod : { default: mod };
  17371. }
  17372. class CustomAlert {
  17373. static show(title, content, buttons) {
  17374. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17375. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17376. return;
  17377. }
  17378. const bg = new Laya.Box();
  17379. bg.alpha = 0;
  17380. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17381. Laya.stage.addChild(bg);
  17382. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17383. const panel = new Laya.Box();
  17384. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17385. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17386. bg.addChild(panel);
  17387. const titleText = new Laya.Text();
  17388. titleText.text = title;
  17389. titleText.fontSize = 32;
  17390. titleText.color = "#333333";
  17391. titleText.bold = true;
  17392. titleText.pos(20, 20);
  17393. titleText.width = 360;
  17394. titleText.align = "center";
  17395. panel.addChild(titleText);
  17396. const contentText = new Laya.Text();
  17397. contentText.text = content;
  17398. contentText.fontSize = 21;
  17399. contentText.color = "#555555";
  17400. contentText.pos(20, 70);
  17401. contentText.width = 360;
  17402. contentText.wordWrap = true;
  17403. contentText.align = "center";
  17404. panel.addChild(contentText);
  17405. const buttonContainer = new Laya.Box();
  17406. buttonContainer.pos(20, 160);
  17407. panel.addChild(buttonContainer);
  17408. const btnWidth = 120;
  17409. const spacing = 30;
  17410. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17411. buttons.forEach((btn, index) => {
  17412. const button = new Laya.Button();
  17413. button.label = btn.label;
  17414. button.size(btnWidth, 40);
  17415. button.labelSize = 22;
  17416. button.pos(index * (btnWidth + spacing), 0);
  17417. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17418. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17419. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17420. button.alpha = 0.9;
  17421. });
  17422. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17423. button.alpha = 1;
  17424. });
  17425. button.on(Laya.Event.CLICK, this, () => {
  17426. btn.handler();
  17427. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17428. bg.removeSelf();
  17429. }));
  17430. });
  17431. buttonContainer.addChild(button);
  17432. });
  17433. buttonContainer.x = (panel.width - totalWidth) / 2;
  17434. }
  17435. }
  17436. class ConfigMgr {
  17437. constructor() {
  17438. this.httpReqCount = 4;
  17439. this.httpReqOkCount = 0;
  17440. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17441. try {
  17442. this.httpReqOkCount = 0;
  17443. let reqData = xGame.httpMgr.getReqData();
  17444. console.log('zh:第1个请求getClassicCfg');
  17445. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17446. this.classicCfg = classicCfg;
  17447. this.httpReqOkCount++;
  17448. console.log('zh:第2个请求getLevelCfg');
  17449. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17450. this.levelCfg = levelCfg;
  17451. this.httpReqOkCount++;
  17452. console.log('zh:第3个请求 getPlaceBallCfg');
  17453. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17454. this.placeBallCfg = placeBallCfg;
  17455. this.httpReqOkCount++;
  17456. console.log('zh:第4个请求 npc');
  17457. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17458. this.npcJson = npc.Data;
  17459. this.httpReqOkCount++;
  17460. console.log('zh:所有配置加载完成');
  17461. }
  17462. catch (error) {
  17463. console.error('❌请求失败:', error);
  17464. Laya.timer.once(5000, this, () => {
  17465. let retryCount = 0;
  17466. const maxRetries = 3;
  17467. const tryFetchConfig = () => {
  17468. try {
  17469. xGame.cfgMgr.getConfigFromServer();
  17470. }
  17471. catch (error) {
  17472. if (retryCount < maxRetries) {
  17473. retryCount++;
  17474. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17475. Laya.timer.once(5000, this, tryFetchConfig);
  17476. }
  17477. else {
  17478. console.error("❌ 达到最大重试次数,配置获取失败");
  17479. }
  17480. }
  17481. };
  17482. tryFetchConfig();
  17483. });
  17484. }
  17485. finally {
  17486. if (this.httpReqCount > this.httpReqOkCount) {
  17487. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17488. {
  17489. label: "Okay", handler: () => {
  17490. console.log("zh:好的知道了");
  17491. JSBridgeUtils.instance.exitAndCloseGame();
  17492. }
  17493. }
  17494. ]);
  17495. }
  17496. }
  17497. });
  17498. this.sendPostAsync = (action, reqData) => {
  17499. return new Promise((resolve, reject) => {
  17500. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17501. try {
  17502. let code = res.code;
  17503. if (code == 200) {
  17504. const parsedData = JSON.parse(res.msg);
  17505. resolve(parsedData);
  17506. }
  17507. else {
  17508. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17509. reject(new Error(`Request failed with code: ${code}`));
  17510. }
  17511. }
  17512. catch (error) {
  17513. console.error(`ERROR=${error}`);
  17514. alert("Please check your network connection.");
  17515. reject(error);
  17516. }
  17517. finally {
  17518. console.log(`zh:${action}的请求处理完毕`);
  17519. }
  17520. });
  17521. });
  17522. };
  17523. }
  17524. static getInstance() {
  17525. if (!this._instance) {
  17526. this._instance = new ConfigMgr();
  17527. }
  17528. return this._instance;
  17529. }
  17530. init() {
  17531. this.getConfigFromServer();
  17532. }
  17533. test() {
  17534. let reqData = xGame.httpMgr.getReqData();
  17535. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17536. console.log('zh:1s');
  17537. try {
  17538. let code = res.code;
  17539. let data = res.data;
  17540. if (code == 200) {
  17541. const parsedData = JSON.parse(data);
  17542. this.classicCfg = parsedData;
  17543. }
  17544. else {
  17545. console.log('zh:res = ' + JSON.stringify(res));
  17546. }
  17547. }
  17548. catch (error) {
  17549. console.log('error=' + error);
  17550. alert("Please check your network connection.");
  17551. }
  17552. finally {
  17553. console.log('zh:1');
  17554. }
  17555. });
  17556. }
  17557. getUserInfoByIndex(index) {
  17558. return this.npcJson[index];
  17559. }
  17560. getRandomUserInfo() {
  17561. let index = xGame.tools.random(0, this.npcJson.length);
  17562. let rs = this.npcJson[index];
  17563. return rs;
  17564. }
  17565. getMaxBigMoveLength() {
  17566. return Object.keys(this.levelCfg).length;
  17567. }
  17568. getBigMoveLevelByIndex(index) {
  17569. let cfg = this.levelCfg;
  17570. cfg = cfg[index];
  17571. return cfg;
  17572. }
  17573. getRandomClassicLevel() {
  17574. let cfg = this.classicCfg;
  17575. let num = Object.keys(cfg).length;
  17576. let rand = xGame.common.randomNum(1, num);
  17577. return cfg[rand];
  17578. }
  17579. getPlaceBallByLevel(level) {
  17580. return this.placeBallCfg[level];
  17581. }
  17582. getMaxPlaceBall() {
  17583. return Object.keys(this.placeBallCfg).length;
  17584. }
  17585. }
  17586. class PoolD3Mgr {
  17587. constructor() {
  17588. this.pool = {};
  17589. }
  17590. static get ins() {
  17591. return this._ins || (this._ins = new PoolD3Mgr);
  17592. }
  17593. createList(key, prefab, parent) {
  17594. if (!this.pool[key]) {
  17595. this.pool[key] = {};
  17596. this.pool[key].prefab = prefab;
  17597. this.pool[key].list = [];
  17598. this.pool[key].parent = parent;
  17599. }
  17600. }
  17601. getItem(key) {
  17602. if (!this.pool[key]) {
  17603. return;
  17604. }
  17605. let temp;
  17606. if (this.pool[key].list.length > 0) {
  17607. temp = this.pool[key].list.pop();
  17608. }
  17609. else {
  17610. temp = this.pool[key].prefab.clone();
  17611. if (this.pool[key].parent) {
  17612. this.pool[key].parent.addChild(temp);
  17613. }
  17614. }
  17615. temp.active = true;
  17616. return temp;
  17617. }
  17618. putItem(key, obj) {
  17619. if (!this.pool[key]) {
  17620. return;
  17621. }
  17622. obj.active = false;
  17623. this.pool[key].list.push(obj);
  17624. }
  17625. }
  17626. let context$1 = context;
  17627. let uiMgr = UIMgr.inst;
  17628. let soundMgr = SoundMgr.getInstance();
  17629. let resMgr = ResMgr.getInstance();
  17630. let httpMgr = HttpMgr.getInstance();
  17631. let common = Common.getInstance();
  17632. let cfgMgr = ConfigMgr.getInstance();
  17633. let poolD3Mgr = PoolD3Mgr.ins;
  17634. let d3TexUrl = "res/d3Res/";
  17635. let d3ModeUrl = "res/unityRes/";
  17636. function setStageSize(view) {
  17637. if (view.width) {
  17638. view.width = Laya.stage.width;
  17639. view.height = Laya.stage.height;
  17640. }
  17641. }
  17642. function filledBg(view) {
  17643. let wh = Laya.stage.height / Laya.stage.width;
  17644. if (wh > 16 / 9) {
  17645. view.height = Laya.stage.height;
  17646. view.width = Laya.stage.height / 1334 * 750;
  17647. }
  17648. else {
  17649. view.width = Laya.stage.width;
  17650. view.height = Laya.stage.width / 750 * 1334;
  17651. }
  17652. }
  17653. function setNotch(view) {
  17654. if (view.height) {
  17655. view.y += context$1.notchHeight;
  17656. }
  17657. }
  17658. function showTip(str) {
  17659. uiMgr.Show(UIMsg, str);
  17660. }
  17661. function log(...args) {
  17662. console.log(args);
  17663. }
  17664. let xGame = {
  17665. context: context$1,
  17666. eventMgr,
  17667. resMgr,
  17668. uiMgr,
  17669. soundMgr,
  17670. define,
  17671. tools,
  17672. httpMgr,
  17673. d3TexUrl,
  17674. d3ModeUrl,
  17675. common,
  17676. cfgMgr,
  17677. poolD3Mgr,
  17678. setStageSize,
  17679. filledBg,
  17680. setNotch,
  17681. showTip,
  17682. log,
  17683. };
  17684. window["xGame"] = xGame;
  17685. let dataName = 'tBall_';
  17686. class UserData {
  17687. constructor() {
  17688. this.userId = "";
  17689. this.isAgree = false;
  17690. this.coinNum = 0;
  17691. this.gemNum = 0;
  17692. this.sound = true;
  17693. this.vibration = true;
  17694. this.currentDate = 0;
  17695. this.createTime = 0;
  17696. this.awardTime = 0;
  17697. this.roleId = 1;
  17698. this.roleList = [];
  17699. this.roleAds = [];
  17700. this.dressId = 101;
  17701. this.itemId = 201;
  17702. this.bigSkills = [1, 1, 1, 1, 1];
  17703. this.coin = 4000;
  17704. this.diamond = 0;
  17705. this.skillSuccessTimes = 0;
  17706. this.skillGuide = 0;
  17707. this.skillAccTimes = 0;
  17708. this.placeBallData = [];
  17709. this.shareDiamondTimes = 0;
  17710. this.dailyVideoShareTimes = 0;
  17711. this.secretary = [1, 0];
  17712. this.curSecretary = 0;
  17713. this.ballRod = [1, 0, 0, 0, 0, 1];
  17714. this.curBallRod = 5;
  17715. this.signData = 0;
  17716. this.signTime = 0;
  17717. this.drawTimes = 0;
  17718. this.drawAwardTimes = 0;
  17719. this.dailyfreeDrawTimes = 1;
  17720. this.power = 5;
  17721. this.powerTime = 0;
  17722. this.challengeTimes = 0;
  17723. this.extraSign = 0;
  17724. this.classicTimes = 0;
  17725. this.guideHelpLine = 0;
  17726. this.newUser = true;
  17727. this.rootBallFoul = 0;
  17728. this.timeoutFoul = 0;
  17729. this.roleList = [1];
  17730. }
  17731. saveData() {
  17732. let data = {};
  17733. for (let k in this) {
  17734. data[k.toString()] = this[k];
  17735. }
  17736. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17737. }
  17738. getData() {
  17739. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17740. if (ld) {
  17741. let localData = JSON.parse(ld);
  17742. if (localData) {
  17743. for (let k in this) {
  17744. let key = k.toString();
  17745. let data = localData[key];
  17746. if (data != undefined) {
  17747. this[k] = data;
  17748. }
  17749. }
  17750. }
  17751. }
  17752. }
  17753. }
  17754. class ItemData {
  17755. constructor() {
  17756. this.itemList = {};
  17757. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  17758. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  17759. }
  17760. saveData() {
  17761. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  17762. }
  17763. getData() {
  17764. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  17765. if (ld) {
  17766. let localData = JSON.parse(ld);
  17767. if (localData) {
  17768. this.itemList = localData;
  17769. }
  17770. }
  17771. }
  17772. }
  17773. class GameData {
  17774. constructor() {
  17775. this.curLevel = 0;
  17776. this.gameType = 1;
  17777. this.signIdx = 0;
  17778. this.signMax = 0;
  17779. this.rotaryTime = 0;
  17780. this.rotaryCount = 0;
  17781. this.rotaryList = [];
  17782. this.diyCount = 3;
  17783. this.awardIdx = 0;
  17784. this.shareNum = 2;
  17785. this.rankWeek = 0;
  17786. this.rankScore = 0;
  17787. this.gameCount = 0;
  17788. this.trySkill = -1;
  17789. this.tryTime = 0;
  17790. }
  17791. saveData() {
  17792. let data = {};
  17793. for (let k in this) {
  17794. data[k.toString()] = this[k];
  17795. }
  17796. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  17797. }
  17798. getData() {
  17799. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  17800. if (ld) {
  17801. let localData = JSON.parse(ld);
  17802. if (localData) {
  17803. for (let k in this) {
  17804. let key = k.toString();
  17805. let data = localData[key];
  17806. if (data != undefined) {
  17807. this[k] = data;
  17808. }
  17809. }
  17810. }
  17811. }
  17812. }
  17813. }
  17814. class Diy2025GameData {
  17815. constructor() {
  17816. this.challengeMode_overLev = 0;
  17817. this.xszyForClassic = false;
  17818. this.xszyForChallenge = false;
  17819. }
  17820. saveData() {
  17821. let data = {};
  17822. for (let k in this) {
  17823. data[k.toString()] = this[k];
  17824. }
  17825. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  17826. }
  17827. getData() {
  17828. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  17829. if (ld) {
  17830. let localData = JSON.parse(ld);
  17831. if (localData) {
  17832. for (let k in this) {
  17833. let key = k.toString();
  17834. let data = localData[key];
  17835. if (data != undefined) {
  17836. this[k] = data;
  17837. }
  17838. }
  17839. }
  17840. }
  17841. }
  17842. }
  17843. class DataMgr {
  17844. static Init() {
  17845. this.userData = new UserData();
  17846. this.gameData = new GameData();
  17847. this.itemData = new ItemData();
  17848. this.diyGameData = new Diy2025GameData();
  17849. this.userData.getData();
  17850. this.gameData.getData();
  17851. this.itemData.getData();
  17852. this.diyGameData.getData();
  17853. this.roleId = this.userData.roleId;
  17854. this.resetUse();
  17855. }
  17856. static isNewDay() {
  17857. Moyu.isNewDay(this, (isnew) => {
  17858. xGame.common.isNewDay = isnew;
  17859. if (!isnew)
  17860. return;
  17861. DataMgr.setShareDiamondTimes(0, false);
  17862. DataMgr.setDailyVideoShareTimes(0, false);
  17863. DataMgr.setDailyfreeDrawTimes(1);
  17864. DataMgr.setExtraSign(0);
  17865. });
  17866. }
  17867. static deletData() {
  17868. Laya.LocalStorage.clear();
  17869. }
  17870. static upRankData() {
  17871. let num = xGame.common.getAllStarNum();
  17872. if (num > 0)
  17873. Moyu.upRankData(xGame.common.curRankID, num);
  17874. }
  17875. static addItem(id, count = 1) {
  17876. let v = this.itemData.itemList[id];
  17877. if (!v)
  17878. v = { id: id, count: count, adnum: 0, active: true };
  17879. else {
  17880. if (v.active) {
  17881. v.count += count;
  17882. }
  17883. else {
  17884. v.count = count;
  17885. v.active = true;
  17886. }
  17887. }
  17888. this.itemData.itemList[id] = v;
  17889. xGame.soundMgr.playGetSound();
  17890. this.saveItemData();
  17891. }
  17892. static hasItem(id) {
  17893. let v = this.itemData.itemList[id];
  17894. if (v && v.active)
  17895. return true;
  17896. return false;
  17897. }
  17898. static getItem(id) {
  17899. let v = this.itemData.itemList[id];
  17900. return v;
  17901. }
  17902. static getItemCount(id) {
  17903. let v = this.itemData.itemList[id];
  17904. if (v && v.active)
  17905. return v.count;
  17906. return 0;
  17907. }
  17908. static getItemAd(id) {
  17909. let v = this.itemData.itemList[id];
  17910. if (v) {
  17911. return v.adnum;
  17912. }
  17913. return 0;
  17914. }
  17915. static onItemAd(id, num = 1) {
  17916. let v = this.itemData.itemList[id];
  17917. if (!v)
  17918. v = { id: id, count: 1, adnum: num, active: false };
  17919. else
  17920. v.adnum += num;
  17921. this.itemData.itemList[id] = v;
  17922. this.saveItemData();
  17923. }
  17924. static costItem(id, count) {
  17925. let v = this.itemData.itemList[id];
  17926. if (v && v.active) {
  17927. if (v.count < count)
  17928. return false;
  17929. else {
  17930. v.count -= count;
  17931. this.itemData.itemList[id] = v;
  17932. return true;
  17933. }
  17934. }
  17935. return false;
  17936. }
  17937. static resetUse() {
  17938. this.dressId = this.userData.dressId;
  17939. this.itemId = this.userData.itemId;
  17940. }
  17941. static passLevel() {
  17942. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  17943. this.gameData.curLevel++;
  17944. this.curLevel = this.gameData.curLevel;
  17945. this.saveGameData();
  17946. }
  17947. static useRole(id) {
  17948. this.roleId = id;
  17949. if (this.hasRole(id)) {
  17950. this.userData.roleId = id;
  17951. this.saveUserData();
  17952. }
  17953. }
  17954. static addRole(id) {
  17955. if (this.hasRole(id))
  17956. return;
  17957. this.userData.roleList.push(id);
  17958. this.saveUserData();
  17959. }
  17960. static hasRole(id) {
  17961. return this.userData.roleList.indexOf(id) >= 0;
  17962. }
  17963. static gemEnough(num) {
  17964. return this.userData.gemNum >= num;
  17965. }
  17966. static roleHasAd(id) {
  17967. let count = this.userData.roleAds[id];
  17968. if (count != undefined && count >= 0)
  17969. return true;
  17970. else
  17971. return false;
  17972. }
  17973. static saveUserData(time = 500, event, arg) {
  17974. if (this.userSaving)
  17975. return;
  17976. this.userSaving = true;
  17977. Laya.timer.once(time, this, () => {
  17978. this.userSaving = false;
  17979. this.userData.saveData();
  17980. if (event)
  17981. xGame.eventMgr.event(event, arg);
  17982. });
  17983. }
  17984. static saveGameData() {
  17985. if (this.gameSaving)
  17986. return;
  17987. this.gameSaving = true;
  17988. Laya.timer.once(1000, this, () => {
  17989. this.gameSaving = false;
  17990. this.gameData.saveData();
  17991. });
  17992. }
  17993. static saveItemData() {
  17994. let fun = () => {
  17995. this.itemData.saveData();
  17996. };
  17997. Laya.timer.clear(this, fun);
  17998. Laya.timer.once(500, this, fun);
  17999. }
  18000. static saveData() {
  18001. this.saveUserData();
  18002. this.saveGameData();
  18003. }
  18004. static getBigSkillList() {
  18005. return this.userData.bigSkills;
  18006. }
  18007. static getBigSkillByIndex(index) {
  18008. return this.userData.bigSkills[index];
  18009. }
  18010. static setBigSkill(index, val, addUp = true) {
  18011. if (addUp) {
  18012. this.userData.bigSkills[index] += val;
  18013. }
  18014. else {
  18015. this.userData.bigSkills[index] = val;
  18016. }
  18017. this.saveUserData();
  18018. }
  18019. static coinEnough(need) {
  18020. if (typeof need != "number") {
  18021. console.error("金币格式错误");
  18022. return;
  18023. }
  18024. return this.userData.coin >= need;
  18025. }
  18026. static setCoin(val) {
  18027. if (typeof val != "number") {
  18028. return;
  18029. }
  18030. this.userData.coin += val;
  18031. this.saveUserData();
  18032. xGame.eventMgr.event(COIN_CHANGE);
  18033. this.updateUserInfo2Server("jb");
  18034. }
  18035. static setCoinFormServer(val) {
  18036. if (typeof val != "number") {
  18037. return;
  18038. }
  18039. this.userData.coin = val;
  18040. this.saveUserData();
  18041. xGame.eventMgr.event(COIN_CHANGE);
  18042. }
  18043. static getCoin() {
  18044. return this.userData.coin;
  18045. }
  18046. static diamondEnough(need) {
  18047. if (typeof need != "number") {
  18048. console.error("金币格式错误");
  18049. return;
  18050. }
  18051. return this.userData.diamond >= need;
  18052. }
  18053. static setDiamond(val) {
  18054. if (typeof val != "number") {
  18055. return;
  18056. }
  18057. this.userData.diamond += val;
  18058. this.saveUserData();
  18059. xGame.eventMgr.event(DIAMOND_CHANGE);
  18060. this.updateUserInfo2Server("zs");
  18061. }
  18062. static setDiamondFormServer(val) {
  18063. if (typeof val != "number") {
  18064. return;
  18065. }
  18066. this.userData.diamond = val;
  18067. this.saveUserData();
  18068. xGame.eventMgr.event(DIAMOND_CHANGE);
  18069. }
  18070. static getDiamond() {
  18071. return this.userData.diamond;
  18072. }
  18073. static getSkillSuccessTimes() {
  18074. return this.userData.skillSuccessTimes;
  18075. }
  18076. static setSkillSuccessTimes(val, addUp = true) {
  18077. if (addUp)
  18078. this.userData.skillSuccessTimes += val;
  18079. else
  18080. this.userData.skillSuccessTimes = val;
  18081. this.saveUserData();
  18082. }
  18083. static getSkillAccTimes() {
  18084. return this.userData.skillAccTimes;
  18085. }
  18086. static setSkillAccTimes(val) {
  18087. this.userData.skillAccTimes += val;
  18088. this.saveUserData();
  18089. }
  18090. static getSkillGuide() {
  18091. if (!xGame.common.openGuide) {
  18092. return 1;
  18093. }
  18094. return this.userData.skillGuide;
  18095. }
  18096. static setSkillGuide(val) {
  18097. this.userData.skillGuide = val;
  18098. this.saveUserData();
  18099. }
  18100. static getPlaceBallLevelList() {
  18101. return this.userData.placeBallData;
  18102. }
  18103. static getPlaceBallLevel(level) {
  18104. let arr = this.userData.placeBallData;
  18105. let index = level - 1;
  18106. let out;
  18107. if (arr[index]) {
  18108. out = arr[index];
  18109. }
  18110. else {
  18111. let max = arr.length;
  18112. if (max == index) {
  18113. out = {
  18114. star: 0,
  18115. play: true,
  18116. isCur: true,
  18117. getAward: false
  18118. };
  18119. }
  18120. else {
  18121. out = {
  18122. star: 0,
  18123. play: false,
  18124. getAward: false
  18125. };
  18126. }
  18127. }
  18128. return out;
  18129. }
  18130. static setPlaceBallLevel(level, star) {
  18131. let arr = this.userData.placeBallData;
  18132. let index = level - 1;
  18133. if (arr[index]) {
  18134. arr[index].star = Math.max(arr[index].star, star);
  18135. }
  18136. else {
  18137. let max = arr.length;
  18138. if (max == index) {
  18139. arr.push({
  18140. star: star,
  18141. play: true,
  18142. getAward: false
  18143. });
  18144. }
  18145. else {
  18146. console.error("关卡存储出错");
  18147. }
  18148. }
  18149. this.saveUserData();
  18150. }
  18151. static setPlaceBallAward(level) {
  18152. let arr = this.userData.placeBallData;
  18153. let index = level - 1;
  18154. if (arr[index]) {
  18155. arr[index].getAward = true;
  18156. }
  18157. this.saveUserData();
  18158. }
  18159. static getShareDiamondTimes() {
  18160. return this.userData.shareDiamondTimes;
  18161. }
  18162. static setShareDiamondTimes(val, addUp = true) {
  18163. if (addUp) {
  18164. this.userData.shareDiamondTimes += val;
  18165. }
  18166. else {
  18167. this.userData.shareDiamondTimes = val;
  18168. }
  18169. this.saveUserData();
  18170. }
  18171. static getDailyVideoShareTimes() {
  18172. return this.userData.dailyVideoShareTimes;
  18173. }
  18174. static setDailyVideoShareTimes(val, addUp = true) {
  18175. if (addUp) {
  18176. this.userData.dailyVideoShareTimes += val;
  18177. }
  18178. else {
  18179. this.userData.dailyVideoShareTimes = val;
  18180. }
  18181. this.saveUserData();
  18182. }
  18183. static getSecretary(index) {
  18184. return this.userData.secretary[index];
  18185. }
  18186. static setSecretary(index, val) {
  18187. this.userData.secretary[index] = val;
  18188. this.saveUserData();
  18189. }
  18190. static getCurSecretary() {
  18191. return this.userData.curSecretary;
  18192. }
  18193. static setCurSecretary(index) {
  18194. this.userData.curSecretary = index;
  18195. this.saveUserData();
  18196. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18197. }
  18198. static getBallRod(index) {
  18199. return this.userData.ballRod[index];
  18200. }
  18201. static setBallRod(index, val) {
  18202. this.userData.ballRod[index] = val;
  18203. this.saveUserData();
  18204. }
  18205. static setBallRodFormServer(haveQiuGanJsonStr) {
  18206. if (!haveQiuGanJsonStr) {
  18207. console.log("setBallRodFormServer数据为空或未定义");
  18208. return;
  18209. }
  18210. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18211. const keys = Object.keys(haveQiuGanJsonObj);
  18212. keys.forEach(key => {
  18213. let v = haveQiuGanJsonObj[key];
  18214. let k = parseInt(key);
  18215. let idx = k - 1;
  18216. console.log('zh:更新IDX = ' + idx);
  18217. console.log('this.userData.ballRod[idx]===' + this.userData.ballRod[idx]);
  18218. if (this.userData.ballRod[idx] === 0) {
  18219. console.log('zh: uuuuu ' + (k - 1));
  18220. this.userData.ballRod[k - 1] = 1;
  18221. this.saveUserData();
  18222. }
  18223. });
  18224. }
  18225. static getCurBallRod() {
  18226. return this.userData.curBallRod;
  18227. }
  18228. static setCurBallRod(index) {
  18229. this.userData.curBallRod = index;
  18230. this.saveUserData();
  18231. }
  18232. static setSignData(val) {
  18233. this.userData.signData = val;
  18234. this.saveUserData();
  18235. }
  18236. static getSignData() {
  18237. return this.userData.signData;
  18238. }
  18239. static setSignTime(val) {
  18240. this.userData.signTime = val;
  18241. this.saveUserData();
  18242. }
  18243. static getSignTime() {
  18244. return this.userData.signTime;
  18245. }
  18246. static getDrawTimes() {
  18247. return this.userData.drawTimes;
  18248. }
  18249. static setDrawTimes(val, addUp = true) {
  18250. if (addUp) {
  18251. this.userData.drawTimes += val;
  18252. }
  18253. else {
  18254. this.userData.drawTimes = val;
  18255. }
  18256. this.saveUserData();
  18257. }
  18258. static getDrawAwardTimes() {
  18259. return this.userData.drawAwardTimes;
  18260. }
  18261. static setDrawAwardTimes(val) {
  18262. this.userData.drawAwardTimes = val;
  18263. this.saveUserData();
  18264. }
  18265. static getDailyfreeDrawTimes() {
  18266. return this.userData.dailyfreeDrawTimes;
  18267. }
  18268. static setDailyfreeDrawTimes(val) {
  18269. this.userData.dailyfreeDrawTimes = val;
  18270. this.saveUserData();
  18271. }
  18272. static setPower(val, addUp = true) {
  18273. if (addUp)
  18274. this.userData.power += val;
  18275. else
  18276. this.userData.power = val;
  18277. if (this.userData.power >= xGame.common.maxPower) {
  18278. this.userData.power = xGame.common.maxPower;
  18279. }
  18280. xGame.eventMgr.event(POWER_CHANGE, val);
  18281. this.saveUserData();
  18282. }
  18283. static getPower() {
  18284. return this.userData.power;
  18285. }
  18286. static setPowerTime(val) {
  18287. this.userData.powerTime = val;
  18288. this.saveUserData();
  18289. }
  18290. static getPowerTime() {
  18291. return this.userData.powerTime;
  18292. }
  18293. static powerEnough() {
  18294. return this.getPower() > 0;
  18295. }
  18296. static getChallengeTimes() {
  18297. return this.userData.challengeTimes;
  18298. }
  18299. static setChallengeTimes(val) {
  18300. this.userData.challengeTimes += val;
  18301. this.saveUserData();
  18302. }
  18303. static getExtraSign() {
  18304. return this.userData.extraSign;
  18305. }
  18306. static setExtraSign(val) {
  18307. this.userData.extraSign = val;
  18308. this.saveUserData();
  18309. }
  18310. static getClassicTimes() {
  18311. return this.userData.classicTimes;
  18312. }
  18313. static setClassicTimes() {
  18314. this.userData.classicTimes += 1;
  18315. this.saveUserData();
  18316. }
  18317. static getGuideHelpLine() {
  18318. return this.userData.guideHelpLine;
  18319. }
  18320. static setGuideHelpLine() {
  18321. this.userData.guideHelpLine = 1;
  18322. this.saveUserData();
  18323. }
  18324. static getNewUser() {
  18325. return this.userData.newUser;
  18326. }
  18327. static setNewUser() {
  18328. this.userData.newUser = false;
  18329. this.saveUserData();
  18330. }
  18331. static getRootBallFoul() {
  18332. return this.userData.rootBallFoul;
  18333. }
  18334. static setRootBallFoul() {
  18335. this.userData.rootBallFoul = 1;
  18336. this.saveUserData();
  18337. }
  18338. static getTimeoutFoul() {
  18339. return this.userData.timeoutFoul;
  18340. }
  18341. static setTimeoutFoul() {
  18342. this.userData.timeoutFoul = 1;
  18343. this.saveUserData();
  18344. }
  18345. static saveDiyGameData() {
  18346. if (this.diyGameSaving)
  18347. return;
  18348. this.diyGameSaving = true;
  18349. Laya.timer.once(500, this, () => {
  18350. this.diyGameSaving = false;
  18351. this.diyGameData.saveData();
  18352. });
  18353. }
  18354. static getChallengeMode_overLev() {
  18355. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18356. return this.challengeMode_overLev;
  18357. }
  18358. static setChallengeMode_overLev(levNum) {
  18359. this.diyGameData.challengeMode_overLev = levNum;
  18360. this.saveDiyGameData();
  18361. }
  18362. static updateUserInfo2Server(type, count = 0) {
  18363. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18364. if (userInfoData == null) {
  18365. return;
  18366. }
  18367. let reqData = xGame.httpMgr.getReqData();
  18368. let rd = JSON.parse(reqData);
  18369. rd.dataType = type;
  18370. let dataValue = 0;
  18371. if (type == "zs") {
  18372. dataValue = this.getDiamond();
  18373. }
  18374. if (type == "jb") {
  18375. dataValue = this.getCoin();
  18376. }
  18377. rd.dataValue = dataValue;
  18378. reqData = JSON.stringify(rd);
  18379. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18380. try {
  18381. let code = res.code;
  18382. let data = res.data;
  18383. if (code == 401) {
  18384. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18385. alert(TIP_MSG_key.pleaseLoginIn);
  18386. return;
  18387. }
  18388. if (code == 200) {
  18389. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18390. }
  18391. else {
  18392. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18393. }
  18394. }
  18395. catch (error) {
  18396. console.log('error=' + error);
  18397. alert("Please check your network connection.");
  18398. }
  18399. finally {
  18400. }
  18401. });
  18402. }
  18403. static getUserZiChanInfo() {
  18404. console.log('zh:开始获取用户资产信息');
  18405. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18406. if (userInfoData == null) {
  18407. return;
  18408. }
  18409. let reqData = xGame.httpMgr.getReqData();
  18410. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18411. try {
  18412. console.log('zh:buySp res = ' + JSON.stringify(res));
  18413. let code = res.code;
  18414. let msg = res.msg;
  18415. if (code == 401) {
  18416. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18417. alert(TIP_MSG_key.pleaseLoginIn);
  18418. return;
  18419. }
  18420. if (code == 200) {
  18421. let d = res.data;
  18422. let zuanShi = d.zuanShi;
  18423. let jinBi = d.jinBi;
  18424. let haveQiuGanJson = d.haveQiuGanJson;
  18425. DataMgr.setDiamondFormServer(zuanShi);
  18426. DataMgr.setCoinFormServer(jinBi);
  18427. console.log('zh:更新球杆信息');
  18428. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18429. }
  18430. else {
  18431. alert(msg);
  18432. }
  18433. }
  18434. catch (error) {
  18435. console.log('error=' + error);
  18436. alert(error);
  18437. }
  18438. finally {
  18439. }
  18440. });
  18441. }
  18442. }
  18443. DataMgr.isNewUser = false;
  18444. DataMgr.fristEnter = true;
  18445. DataMgr.levelType = 0;
  18446. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18447. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18448. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18449. DataMgr.challengeMode_overLev = 0;
  18450. DataMgr.xszyForClassic = false;
  18451. DataMgr.xszyForChallenge = false;
  18452. DataMgr.awardId = 0;
  18453. DataMgr.awardCoin = 0;
  18454. DataMgr.sceneId = -1;
  18455. DataMgr.tryId = 0;
  18456. DataMgr.curLevel = 1;
  18457. DataMgr.vipLevel = 0;
  18458. DataMgr.maxLevel = 0;
  18459. DataMgr.awardRatio = 1;
  18460. DataMgr.gameList = [];
  18461. DataMgr.rankList = [];
  18462. DataMgr.recoverTime = 480000;
  18463. DataMgr.minScore = 0;
  18464. DataMgr.rankDis = 0;
  18465. DataMgr.userSaving = false;
  18466. DataMgr.gameSaving = false;
  18467. DataMgr.diyGameSaving = false;
  18468. class D3Tween extends Laya.Script3D {
  18469. constructor() {
  18470. super();
  18471. this.isInited = false;
  18472. }
  18473. ;
  18474. init() {
  18475. if (this.isInited)
  18476. return;
  18477. this.isInited = true;
  18478. this.gameObj = this.owner;
  18479. this.transform = this.gameObj.transform;
  18480. }
  18481. get rotX() {
  18482. return this.transform.localRotationEulerX;
  18483. }
  18484. set rotX(v) {
  18485. this.transform.localRotationEulerX = v;
  18486. }
  18487. get rotY() {
  18488. return this.transform.localRotationEulerY;
  18489. }
  18490. set rotY(v) {
  18491. this.transform.localRotationEulerY = v;
  18492. }
  18493. get rotZ() {
  18494. return this.transform.localRotationEulerZ;
  18495. }
  18496. set rotZ(v) {
  18497. this.transform.localRotationEulerZ = v;
  18498. }
  18499. get posX() {
  18500. return this.transform.localPositionX;
  18501. }
  18502. set posX(v) {
  18503. this.transform.localPositionX = v;
  18504. }
  18505. get posY() {
  18506. return this.transform.localPositionY;
  18507. }
  18508. set posY(v) {
  18509. this.transform.localPositionY = v;
  18510. }
  18511. get posZ() {
  18512. return this.transform.localPositionZ;
  18513. }
  18514. set posZ(v) {
  18515. this.transform.localPositionZ = v;
  18516. }
  18517. get rotation() {
  18518. return this.transform.localRotation;
  18519. }
  18520. set rotation(v) {
  18521. this.transform.localRotation = v;
  18522. }
  18523. }
  18524. class D2Hole extends Laya.Script {
  18525. constructor() { super(); }
  18526. onTriggerEnter(collider) {
  18527. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18528. return;
  18529. }
  18530. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18531. if (collider.owner["mySrc"].isRunSkillAni) {
  18532. return;
  18533. }
  18534. if (collider.owner["mySrc"].number != 0) {
  18535. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18536. }
  18537. xGame.common.ballColliHole(collider);
  18538. xGame.common.recoverCameraView();
  18539. }
  18540. }
  18541. }
  18542. class Table extends Laya.Script3D {
  18543. constructor() {
  18544. super();
  18545. this.isSetBorder = false;
  18546. this.inited = false;
  18547. }
  18548. ;
  18549. onAwake() {
  18550. this.init();
  18551. }
  18552. init() {
  18553. if (this.inited)
  18554. return;
  18555. this.inited = true;
  18556. this.gameObj = this.owner;
  18557. this.border = this.gameObj.getChildByName("border");
  18558. }
  18559. setBorderPos() {
  18560. if (this.isSetBorder)
  18561. return;
  18562. this.isSetBorder = true;
  18563. let ui = xGame.common.gameUI.ui;
  18564. let bar1 = this.border.getChildByName("bar1");
  18565. let bar2 = this.border.getChildByName("bar2");
  18566. let bar3 = this.border.getChildByName("bar3");
  18567. let bar4 = this.border.getChildByName("bar4");
  18568. let bar5 = this.border.getChildByName("bar5");
  18569. let bar6 = this.border.getChildByName("bar6");
  18570. this.setInfo(bar1, ui.border.bar1, "box");
  18571. this.setInfo(bar2, ui.border.bar2, "box");
  18572. this.setInfo(bar3, ui.border.bar3, "box");
  18573. this.setInfo(bar4, ui.border.bar4, "box");
  18574. this.setInfo(bar5, ui.border.bar5, "box");
  18575. this.setInfo(bar6, ui.border.bar6, "box");
  18576. let circle1 = this.border.getChildByName("circle1");
  18577. let circle2 = this.border.getChildByName("circle2");
  18578. let circle3 = this.border.getChildByName("circle3");
  18579. let circle4 = this.border.getChildByName("circle4");
  18580. let circle5 = this.border.getChildByName("circle5");
  18581. let circle6 = this.border.getChildByName("circle6");
  18582. this.setInfo(circle1, ui.border.circle1, "circle");
  18583. this.setInfo(circle2, ui.border.circle2, "circle");
  18584. this.setInfo(circle3, ui.border.circle3, "circle");
  18585. this.setInfo(circle4, ui.border.circle4, "circle");
  18586. this.setInfo(circle5, ui.border.circle5, "circle");
  18587. this.setInfo(circle6, ui.border.circle6, "circle");
  18588. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18589. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18590. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18591. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  18592. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  18593. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  18594. let arr = xGame.common.gameMgr.holePosList;
  18595. xGame.common.gameMgr.posObj = {
  18596. "1": arr[0],
  18597. "3": arr[2],
  18598. "4": arr[3],
  18599. "6": arr[5]
  18600. };
  18601. }
  18602. initHolePos(x, y) {
  18603. if (x < 300)
  18604. x += 25;
  18605. else if (x > 1000)
  18606. x -= 25;
  18607. else if (y > 200)
  18608. y -= 10;
  18609. else
  18610. y += 10;
  18611. if (y < 200)
  18612. y += 30;
  18613. else if (y > 500)
  18614. y -= 30;
  18615. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  18616. }
  18617. setInfo(d3Obj, d2Obj, type) {
  18618. let ui = xGame.common.gameUI.ui;
  18619. let sprite = new Laya.Sprite();
  18620. ui.border.displayObject.addChild(sprite);
  18621. let colli = xGame.common.getCollider(type);
  18622. sprite.addComponentIntance(colli);
  18623. let rigy = xGame.common.getRigbody();
  18624. rigy.type = "static";
  18625. sprite.addComponentIntance(rigy);
  18626. let d3Pos = d3Obj.transform.position;
  18627. xGame.common.pos3to2Convert(d3Pos);
  18628. let scaleX = d3Obj.transform.localScaleX;
  18629. let scaleZ = d3Obj.transform.localScaleZ;
  18630. let width = xGame.common.scale3to2Convert(scaleZ);
  18631. let height = xGame.common.scale3to2Convert(scaleX);
  18632. sprite.pivotX = width / 2;
  18633. sprite.pivotY = height / 2;
  18634. sprite.x = d3Pos.x;
  18635. sprite.y = d3Pos.y;
  18636. sprite.width = width;
  18637. sprite.height = height;
  18638. d2Obj.x = d3Pos.x;
  18639. d2Obj.y = d3Pos.y;
  18640. d2Obj.width = width;
  18641. d2Obj.height = height;
  18642. if (type == "box") {
  18643. colli.width = width;
  18644. colli.height = height;
  18645. colli.isSensor = false;
  18646. colli.label = "border";
  18647. }
  18648. else {
  18649. colli.radius = width / 2;
  18650. colli.isSensor = true;
  18651. colli.label = "hole";
  18652. sprite.addComponent(D2Hole);
  18653. }
  18654. }
  18655. }
  18656. class D3World extends Laya.Script3D {
  18657. constructor() {
  18658. super();
  18659. this.loadNum = 0;
  18660. this.setLoadNum = 7;
  18661. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  18662. }
  18663. onAwake() {
  18664. }
  18665. loadScene() {
  18666. this.scene = this.owner;
  18667. let url = `res/unityRes/root.lh`;
  18668. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  18669. this.scene.addChild(prefab);
  18670. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  18671. this.putCameraInfo();
  18672. this.camera.enableHDR = false;
  18673. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  18674. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  18675. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  18676. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  18677. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  18678. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  18679. this.knife.active = false;
  18680. this.loadD3Obj();
  18681. }));
  18682. }
  18683. putCameraInfo() {
  18684. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  18685. this.cameraObj = new cameraType();
  18686. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  18687. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  18688. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  18689. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  18690. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  18691. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  18692. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  18693. this.visitAngleChild.init();
  18694. this.visitRootObj.posX = this.visitAngleChild.posX;
  18695. this.visitRootObj.posY = this.visitAngleChild.posY;
  18696. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  18697. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  18698. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  18699. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  18700. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  18701. xGame.common.showOneCamera("mainCamera");
  18702. }
  18703. loadD3Obj() {
  18704. this.loadTable();
  18705. this.loadRoom();
  18706. this.loadInHoleParticial();
  18707. this.loadIceParticial();
  18708. this.loadHitParticial();
  18709. this.loadFireworksParticial();
  18710. this.loadBall();
  18711. }
  18712. loadInHoleParticial() {
  18713. this.loadD3Res("inHoleEft", "", (prefab) => {
  18714. prefab.addComponent(Partical);
  18715. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  18716. });
  18717. }
  18718. loadIceParticial() {
  18719. this.loadD3Res("iceEft", "", (prefab) => {
  18720. prefab.addComponent(Partical);
  18721. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  18722. });
  18723. }
  18724. loadHitParticial() {
  18725. this.loadD3Res("hitEft", "", (prefab) => {
  18726. prefab.addComponent(Partical);
  18727. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  18728. });
  18729. }
  18730. loadFireworksParticial() {
  18731. this.loadD3Res("fireworksEft", "", (prefab) => {
  18732. prefab.addComponent(Partical);
  18733. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  18734. });
  18735. }
  18736. loadBall(index = 1) {
  18737. this.loadD3Res("ball", index, (prefab) => {
  18738. this.ballPrefab = prefab;
  18739. this.ballPrefab.addComponent(Ball);
  18740. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  18741. });
  18742. }
  18743. loadTable(index = 1) {
  18744. this.loadD3Res("table", index, (prefab) => {
  18745. this.tableSrc = prefab.addComponent(Table);
  18746. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  18747. this.d3Hand.init();
  18748. this.tableRoot.addChild(prefab);
  18749. });
  18750. }
  18751. loadRoom(index = 1) {
  18752. this.loadD3Res("room", index, (prefab) => {
  18753. this.roomRoot.addChild(prefab);
  18754. });
  18755. }
  18756. loadD3Res(type, index, callback) {
  18757. let url = `res/unityRes/${type}${index}.lh`;
  18758. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  18759. callback && callback(prefab);
  18760. this.checkResLoad();
  18761. }));
  18762. }
  18763. checkResLoad() {
  18764. this.loadNum++;
  18765. if (this.loadNum >= this.setLoadNum) {
  18766. xGame.eventMgr.event(D3RES_LOADED);
  18767. }
  18768. }
  18769. prePlayEft() {
  18770. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  18771. eft.transform.localPositionX = 0;
  18772. eft.transform.localPositionY = -5;
  18773. eft.transform.localPositionZ = 0;
  18774. eft.active = true;
  18775. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  18776. ice.transform.localPositionX = 0;
  18777. ice.transform.localPositionY = -5;
  18778. ice.transform.localPositionZ = 0;
  18779. ice.active = true;
  18780. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  18781. hit.transform.localPositionX = 0;
  18782. hit.transform.localPositionY = -5;
  18783. hit.transform.localPositionZ = 0;
  18784. hit.active = true;
  18785. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  18786. fireworks.transform.localPositionX = 0;
  18787. fireworks.transform.localPositionY = -5;
  18788. fireworks.transform.localPositionZ = 0;
  18789. fireworks.active = true;
  18790. }
  18791. }
  18792. class cameraType {
  18793. }
  18794. class MoyuMgr$1 {
  18795. static initMoyu() {
  18796. this.moyuView = new MoyuView$1();
  18797. Laya.stage.addChild(this.moyuView.ui.displayObject);
  18798. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  18799. this.moyuView.ui.displayObject.zOrder = 1000;
  18800. this.moyuView.init();
  18801. this.moyuView.showTip(true);
  18802. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  18803. window['XApk'] = this;
  18804. }
  18805. static showAge(show) {
  18806. if (this.moyuView)
  18807. this.moyuView.showAge(show);
  18808. }
  18809. static onPlatMsg(idx) {
  18810. if (!MoyuMgr$1.moyuView)
  18811. return;
  18812. if (idx == '0') {
  18813. MoyuMgr$1.moyuView.showTip(false);
  18814. }
  18815. }
  18816. static showAgree(call) {
  18817. if (this.moyuView)
  18818. this.moyuView.showAgree(call);
  18819. else
  18820. call && call();
  18821. }
  18822. static showXy(type = 1) {
  18823. if (this.moyuView)
  18824. this.moyuView.showXy(type);
  18825. }
  18826. }
  18827. MoyuMgr$1.isAdvise = false;
  18828. class MoyuView$1 {
  18829. constructor() {
  18830. this.ysxyNum = 1;
  18831. this.ysJson = null;
  18832. this.ui = ui_UIMoyu.createInstance();
  18833. }
  18834. init() {
  18835. this.ui.mainBg.visible = false;
  18836. this.ui.xyNode.visible = false;
  18837. this.ui.ageNode.visible = false;
  18838. this.ui.tipNode.visible = false;
  18839. this.ui.rnNode.visible = false;
  18840. this.ui.fcmNode.visible = false;
  18841. this.ui.ageTip.visible = false;
  18842. this.ui.msgNode.visible = false;
  18843. this.ui.visible = false;
  18844. this.ui.xyNode.xyList.setVirtual();
  18845. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  18846. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  18847. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  18848. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  18849. this.ui.xyNode.btnKnown.visible = false;
  18850. this.ui.xyNode.xy1.visible = false;
  18851. this.ui.xyNode.xy2.visible = false;
  18852. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  18853. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  18854. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  18855. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  18856. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  18857. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  18858. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  18859. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  18860. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  18861. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  18862. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  18863. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  18864. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  18865. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  18866. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  18867. this.ysxyNum = 2;
  18868. }
  18869. }
  18870. onClick(obj) {
  18871. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  18872. switch (obj) {
  18873. case this.ui.ageTip:
  18874. if (Moyu.isTTApk) {
  18875. this.ui.ageNode.visible = true;
  18876. this.ui.mainBg.visible = true;
  18877. }
  18878. break;
  18879. case this.ui.tipNode:
  18880. this.showTip(false);
  18881. break;
  18882. case this.ui.ageNode.btnAge:
  18883. this.ui.ageNode.visible = false;
  18884. this.ui.mainBg.visible = false;
  18885. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  18886. this.ui.visible = false;
  18887. break;
  18888. case this.ui.xyNode.btnXy3:
  18889. case this.ui.xyNode.btnXy1:
  18890. this.loadXy(1);
  18891. break;
  18892. case this.ui.xyNode.btnXy2:
  18893. this.loadXy(2);
  18894. break;
  18895. case this.ui.xyNode.btnBack:
  18896. this.ui.xyNode.xy1.visible = true;
  18897. this.ui.xyNode.xy2.visible = false;
  18898. break;
  18899. case this.ui.xyNode.btnKnown:
  18900. this.ui.xyNode.visible = false;
  18901. this.ui.mainBg.visible = false;
  18902. this.ui.visible = false;
  18903. break;
  18904. case this.ui.rnNode.btnCheck:
  18905. this.check();
  18906. break;
  18907. case this.ui.rnNode.btnExit:
  18908. case this.ui.xyNode.btnNo:
  18909. this.ysxyNum--;
  18910. if (this.ysxyNum > 0)
  18911. this.showMsg("Refuse to quit the game once again");
  18912. else {
  18913. Moyu.userAgree(false);
  18914. Moyu.exit();
  18915. }
  18916. break;
  18917. case this.ui.xyNode.btnSure:
  18918. case this.ui.xyNode.btnYes:
  18919. DataMgr.userData.isAgree = true;
  18920. DataMgr.saveUserData();
  18921. this.onAgree();
  18922. break;
  18923. case this.ui.rnNode.btnDone:
  18924. this.ui.rnNode.visible = false;
  18925. this.ui.visible = false;
  18926. break;
  18927. case this.ui.fcmNode.btnRn:
  18928. this.showRn();
  18929. break;
  18930. }
  18931. }
  18932. showTip(show) {
  18933. if (!Moyu.isVVApk && !Moyu.isOPApk)
  18934. return;
  18935. if (show) {
  18936. MoyuMgr$1.isAdvise = true;
  18937. this.ui.visible = true;
  18938. this.ui.tipNode.visible = true;
  18939. this.ui.tipNode.alpha = 1;
  18940. Laya.timer.once(1000, this, this.showTip, [false]);
  18941. }
  18942. else {
  18943. this.ui.tipNode.alpha = 1;
  18944. this.ui.tipNode.visible = true;
  18945. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  18946. this.ui.tipNode.visible = false;
  18947. MoyuMgr$1.isAdvise = false;
  18948. }), 1000);
  18949. }
  18950. }
  18951. showAge(show, px = 0, py = 0) {
  18952. if (Moyu.platType > 10 && !Moyu.isIos) {
  18953. this.ui.ageTip.x = px;
  18954. this.ui.ageTip.y = py;
  18955. this.ui.ageTip.visible = show;
  18956. if (show)
  18957. this.ui.visible = true;
  18958. }
  18959. }
  18960. showAgree(call) {
  18961. this.agreeCall = call;
  18962. this.onAgree();
  18963. return;
  18964. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  18965. this.showXy(0);
  18966. }
  18967. else
  18968. this.onAgree();
  18969. }
  18970. onAgree() {
  18971. if (!this.ui.ageNode.visible)
  18972. this.ui.visible = false;
  18973. this.ui.xyNode.visible = false;
  18974. Moyu.userAgree(true);
  18975. this.showAge(false);
  18976. this.agreeCall && this.agreeCall();
  18977. this.showRn();
  18978. }
  18979. showMsg(txt) {
  18980. this.ui.msgNode.txtMsg.text = txt;
  18981. this.ui.msgNode.visible = true;
  18982. this.ui.msgNode.alpha = 1;
  18983. this.ui.visible = true;
  18984. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  18985. this.ui.msgNode.visible = false;
  18986. }), 2500, true);
  18987. }
  18988. showRn() {
  18989. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  18990. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  18991. this.ui.rnNode.rn1.visible = true;
  18992. this.ui.rnNode.rn2.visible = false;
  18993. this.ui.rnNode.rn3.visible = false;
  18994. this.ui.rnNode.rn4.visible = false;
  18995. this.ui.rnNode.visible = true;
  18996. this.ui.mainBg.visible = true;
  18997. this.ui.rnNode.btnDone.visible = false;
  18998. this.ui.rnNode.btnExit.visible = true;
  18999. this.ui.rnNode.btnCheck.visible = true;
  19000. this.ui.fcmNode.visible = false;
  19001. this.ui.visible = true;
  19002. return;
  19003. }
  19004. }
  19005. this.showFcm();
  19006. }
  19007. showFcm() {
  19008. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19009. Moyu.initFCM(true);
  19010. if (Moyu.gameTime < 1)
  19011. this.fcmLoop();
  19012. else if (Moyu.gameTime < 999)
  19013. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19014. }
  19015. }
  19016. fcmLoop() {
  19017. if (Moyu.gameTime < 1) {
  19018. this.ui.rnNode.visible = false;
  19019. this.ui.fcmNode.visible = true;
  19020. this.ui.mainBg.visible = true;
  19021. this.ui.visible = true;
  19022. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19023. Laya.timer.clear(this.ui, this.fcmLoop);
  19024. }
  19025. }
  19026. check() {
  19027. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19028. this.ui.rnNode.rn1.visible = false;
  19029. this.ui.rnNode.rn2.visible = false;
  19030. this.ui.rnNode.rn4.visible = true;
  19031. }
  19032. else if (this.ui.rnNode.rn4.visible) {
  19033. let name = this.ui.rnNode.inputName.text;
  19034. let code = this.ui.rnNode.inputCode.text;
  19035. if (code && code.length == 18) {
  19036. this.ui.rnNode.rn1.visible = false;
  19037. this.ui.rnNode.rn4.visible = false;
  19038. Moyu.authenticate(name, code, (res) => {
  19039. this.ui.rnNode.rn2.visible = !res;
  19040. this.ui.rnNode.rn3.visible = res;
  19041. this.ui.rnNode.btnDone.visible = res;
  19042. this.ui.rnNode.btnExit.visible = !res;
  19043. this.ui.rnNode.btnCheck.visible = !res;
  19044. if (res)
  19045. this.showFcm();
  19046. });
  19047. }
  19048. else
  19049. this.showMsg("信息填写不完整");
  19050. }
  19051. }
  19052. loadXy(type = 0) {
  19053. this.ui.xyNode.xy1.visible = false;
  19054. this.ui.xyNode.xy2.visible = true;
  19055. this.ui.xyNode.xyList.scrollToView(0);
  19056. if (type == 1) {
  19057. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19058. }
  19059. else if (type == 2) {
  19060. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19061. }
  19062. }
  19063. showXy(type = 0) {
  19064. this.xyBtn();
  19065. if (type == 0) {
  19066. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19067. this.ui.xyNode.btnSure.visible = true;
  19068. }
  19069. else {
  19070. this.ui.xyNode.btnYes.visible = true;
  19071. this.ui.xyNode.btnNo.visible = true;
  19072. }
  19073. }
  19074. else {
  19075. this.ui.xyNode.btnKnown.visible = true;
  19076. this.ui.mainBg.visible = true;
  19077. }
  19078. this.ui.xyNode.xy1.visible = true;
  19079. this.ui.xyNode.xy2.visible = false;
  19080. this.ui.xyNode.visible = true;
  19081. this.ui.visible = true;
  19082. }
  19083. xyBtn() {
  19084. this.ui.xyNode.btnSure.visible = false;
  19085. this.ui.xyNode.btnYes.visible = false;
  19086. this.ui.xyNode.btnNo.visible = false;
  19087. this.ui.xyNode.btnKnown.visible = false;
  19088. {
  19089. this.ui.xyNode.btnXy3.visible = false;
  19090. this.ui.xyNode.btnXy2.visible = true;
  19091. this.ui.xyNode.btnXy1.visible = true;
  19092. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19093. }
  19094. }
  19095. createXY(json) {
  19096. this.ysJson = json.content;
  19097. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19098. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19099. this.ui.xyNode.xy2.visible = true;
  19100. }
  19101. renderListItem(idx, cell) {
  19102. let xy = this.ysJson[idx];
  19103. cell.height = xy.line * 30;
  19104. cell.xyItem.text = xy.text;
  19105. }
  19106. onDestroy() {
  19107. this.agreeCall = null;
  19108. }
  19109. }
  19110. class UILoading extends UIBase {
  19111. constructor() {
  19112. super();
  19113. this.accTime = 0;
  19114. this.curNum = 0;
  19115. this.rate = 1;
  19116. this.loadSubOk = false;
  19117. this.loadResOK = false;
  19118. this.openLoading = true;
  19119. this.beginLoadRes = false;
  19120. this.finishD2 = false;
  19121. this.finishD3 = false;
  19122. }
  19123. onConstructor() {
  19124. this.ui = ui_UILoading.createInstance();
  19125. this.contentPane = this.ui;
  19126. this.isEject = false;
  19127. this._initUI();
  19128. this._addEvent();
  19129. }
  19130. _initUI() {
  19131. MoyuMgr$1.initMoyu();
  19132. }
  19133. _addEvent() {
  19134. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19135. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19136. }
  19137. show() {
  19138. super.show();
  19139. console.log('zh:加载分包资源');
  19140. loadSubRes(this.subResProgress.bind(this));
  19141. this.ui.txtLoad.text = "Loading...";
  19142. }
  19143. subResProgress(pro, finish) {
  19144. this.curNum = pro;
  19145. if (finish) {
  19146. this.curNum = 1;
  19147. this.loadSubOk = true;
  19148. }
  19149. }
  19150. laodD3Res() {
  19151. let scene3D = new Laya.Scene3D();
  19152. xGame.common.d3Scene = scene3D;
  19153. xGame.common.d3World = scene3D.addComponent(D3World);
  19154. xGame.common.d3World.loadScene();
  19155. }
  19156. loadD2Res() {
  19157. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19158. this.finishD2 = true;
  19159. this.checkLoadAll();
  19160. this.curNum = 1;
  19161. }), Laya.Handler.create(this, (pro) => {
  19162. this.curNum = pro;
  19163. }, null, false));
  19164. }
  19165. d3ResFinish() {
  19166. this.finishD3 = true;
  19167. this.checkLoadAll();
  19168. }
  19169. checkLoadAll() {
  19170. if (this.finishD2 && this.finishD3) {
  19171. this.loadResOK = true;
  19172. }
  19173. }
  19174. loadRes() {
  19175. this.laodD3Res();
  19176. this.loadD2Res();
  19177. }
  19178. myUpdate(dt) {
  19179. if (!this.openLoading)
  19180. return;
  19181. this.accTime += dt * this.rate;
  19182. if (this.accTime >= this.curNum)
  19183. this.accTime = this.curNum;
  19184. this.ui.loadinfo.value = this.accTime * 100;
  19185. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19186. if (!this.beginLoadRes) {
  19187. this.beginLoadRes = true;
  19188. this.ui.txtLoad.text = "Loading...";
  19189. this.curNum = 0;
  19190. this.accTime = 0;
  19191. this.loadRes();
  19192. }
  19193. if (this.loadResOK) {
  19194. this.openLoading = false;
  19195. Laya.timer.once(300, this, () => {
  19196. xGame.common.d3Scene.active = false;
  19197. MoyuMgr$1.showAgree(enterGame);
  19198. });
  19199. }
  19200. }
  19201. }
  19202. release() {
  19203. }
  19204. hide() {
  19205. super.hide();
  19206. this.release();
  19207. }
  19208. onClose() {
  19209. this.hide();
  19210. }
  19211. }
  19212. UILoading.uiName = "UILoading";
  19213. class UIRepentProp$1 extends UIBase {
  19214. constructor() {
  19215. super();
  19216. this.viewType = 0;
  19217. this.regretType = 0;
  19218. }
  19219. onConstructor() {
  19220. this.ui = ui_UIRepentProp.createInstance();
  19221. this.contentPane = this.ui;
  19222. this.isEject = false;
  19223. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19224. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19225. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19226. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19227. }
  19228. show(viewType, regretType, callback) {
  19229. PlatMgr.showInsert(true);
  19230. this.viewType = viewType;
  19231. this.regretType = regretType;
  19232. this.callback = callback;
  19233. super.show();
  19234. this.ui.t0.play();
  19235. this.ui.c1.selectedIndex = this.viewType;
  19236. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19237. if (this.viewType == 0) {
  19238. let guide = DataMgr.getGuideHelpLine();
  19239. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19240. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19241. }
  19242. xGame.common.gameMgr.gamePause = true;
  19243. }
  19244. hideSelf() {
  19245. xGame.common.gameMgr.gamePause = false;
  19246. this.callback && this.callback(false);
  19247. this.hide();
  19248. }
  19249. videoRegret() {
  19250. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19251. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19252. }
  19253. else {
  19254. console.log('zh:AD 失败,直接发放奖励');
  19255. this.qjff_AD_for_UIrepentProp_videoRegret();
  19256. }
  19257. }
  19258. qjff_AD_for_UIrepentProp_videoRegret() {
  19259. this.callback && this.callback(true);
  19260. this.hideSelf();
  19261. }
  19262. videoAddHelpLine() {
  19263. let guide = DataMgr.getGuideHelpLine();
  19264. if (guide == 0) {
  19265. this.callback && this.callback(true);
  19266. this.hideSelf();
  19267. DataMgr.setGuideHelpLine();
  19268. xGame.common.gameUI.ui.guideNode.visible = false;
  19269. }
  19270. else {
  19271. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19272. if (Laya.Browser.onAndroid) {
  19273. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19274. if (!boo) {
  19275. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19276. return;
  19277. }
  19278. }
  19279. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19280. }
  19281. else {
  19282. console.log('zh:AD 失败,直接发放奖励');
  19283. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19284. }
  19285. }
  19286. }
  19287. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19288. this.callback && this.callback(true);
  19289. this.hideSelf();
  19290. }
  19291. }
  19292. UIRepentProp$1.uiName = "UIRepentProp";
  19293. class UIRodMethod$1 extends UIBase {
  19294. constructor() {
  19295. super();
  19296. this.isPressd = false;
  19297. }
  19298. onConstructor() {
  19299. this.ui = ui_UIRodMethod.createInstance();
  19300. this.contentPane = this.ui;
  19301. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19302. this.moveDir = new Laya.Vector2();
  19303. this.moveDest = new Laya.Vector2();
  19304. this.centerPos = new Laya.Vector2();
  19305. xGame.common.uiRodMethod = this;
  19306. }
  19307. show() {
  19308. super.show();
  19309. xGame.common.gameMgr.gamePause = true;
  19310. this.openPressDotEvent();
  19311. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19312. this.centerPos.x = this.ui.white.x;
  19313. this.centerPos.y = this.ui.white.y;
  19314. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19315. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19316. this.setDot();
  19317. }
  19318. setDot() {
  19319. this.ui.dot.x = this.moveDest.x;
  19320. this.ui.dot.y = this.moveDest.y;
  19321. }
  19322. closeSelf() {
  19323. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19324. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19325. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19326. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19327. xGame.common.gameMgr.gamePause = false;
  19328. this.hide();
  19329. }
  19330. openPressDotEvent() {
  19331. this.closePressDotEvent();
  19332. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19333. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19334. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19335. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19336. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19337. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19338. }
  19339. closePressDotEvent() {
  19340. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19341. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19342. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19343. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19344. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19345. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19346. }
  19347. onDown(e) {
  19348. if (e.type == Laya.Event.MOUSE_DOWN)
  19349. this.isPressd = true;
  19350. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19351. this.isPressd = false;
  19352. if (!this.isPressd)
  19353. return;
  19354. this.moveDest.x = e.stageX;
  19355. this.moveDest.y = e.stageY;
  19356. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19357. if (dis > 6724) {
  19358. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19359. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19360. }
  19361. this.setDot();
  19362. }
  19363. resetRod() {
  19364. this.ui.dot.x = this.ui.white.x;
  19365. this.ui.dot.y = this.ui.white.y;
  19366. this.gameRod.dot.x = this.gameRod.bg.x;
  19367. this.gameRod.dot.y = this.gameRod.bg.y;
  19368. xGame.common.rodOffest.x = 0;
  19369. xGame.common.rodOffest.y = 0;
  19370. }
  19371. }
  19372. UIRodMethod$1.uiName = "UIRodMethod";
  19373. class UIMsg$1 extends UIBase {
  19374. constructor() {
  19375. super();
  19376. }
  19377. onConstructor() {
  19378. this.ui = ui_UIMsg.createInstance();
  19379. this.contentPane = this.ui;
  19380. this.isEject = false;
  19381. this.isMuti = true;
  19382. }
  19383. show(msg, callback) {
  19384. super.show();
  19385. this.ui.tipsNode.msgTxt.text = msg;
  19386. this.ui.alpha = 1;
  19387. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19388. this.hide();
  19389. callback && callback();
  19390. }), 1000);
  19391. }
  19392. }
  19393. UIMsg$1.uiName = "UIMsg";
  19394. class UITips$1 extends UIBase {
  19395. constructor() {
  19396. super();
  19397. this.type = 0;
  19398. }
  19399. onConstructor() {
  19400. this.ui = ui_UITips.createInstance();
  19401. this.contentPane = this.ui;
  19402. this.isEject = false;
  19403. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19404. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19405. }
  19406. show(tipsTxt, womanTxt, type) {
  19407. super.show();
  19408. this.ui.t0.play();
  19409. this.ui.myNode.tipsTxt.text = tipsTxt;
  19410. this.ui.myNode.womanTxt.text = womanTxt;
  19411. PlatMgr.showInsert(true);
  19412. this.ui.myNode.c1.selectedIndex = type;
  19413. this.type = type;
  19414. switch (this.type) {
  19415. case TipsType.exitGame:
  19416. xGame.common.gameMgr.gamePause = true;
  19417. break;
  19418. case TipsType.foul:
  19419. Laya.timer.once(200, this, () => {
  19420. xGame.common.gameMgr.gamePause = true;
  19421. });
  19422. break;
  19423. default:
  19424. break;
  19425. }
  19426. }
  19427. clickLeftBtn() {
  19428. this.hide();
  19429. xGame.common.gameMgr.gamePause = false;
  19430. switch (this.type) {
  19431. case TipsType.exitGame:
  19432. break;
  19433. case TipsType.foul:
  19434. break;
  19435. default:
  19436. break;
  19437. }
  19438. }
  19439. clickRightBtn() {
  19440. this.hide();
  19441. switch (this.type) {
  19442. case TipsType.exitGame:
  19443. xGame.eventMgr.event(RESET_GAME);
  19444. xGame.uiMgr.Show(UIMain$1);
  19445. Moyu.recordEnd(this, null);
  19446. xGame.common.longHelpLine = false;
  19447. break;
  19448. case TipsType.foul:
  19449. xGame.common.gameMgr.gamePause = false;
  19450. Laya.timer.clearAll(this);
  19451. break;
  19452. default:
  19453. break;
  19454. }
  19455. }
  19456. }
  19457. UITips$1.uiName = "UITips";
  19458. class UIGame$1 extends UIBase {
  19459. constructor() {
  19460. super();
  19461. this.powerNum = 0;
  19462. this.isD3Inited = false;
  19463. this.isPrePlay = false;
  19464. this.isMoveRod = false;
  19465. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19466. this.rulerDis = 20;
  19467. this.rulerOffset = 0;
  19468. }
  19469. onConstructor() {
  19470. this.ui = ui_UIGame.createInstance();
  19471. this.contentPane = this.ui;
  19472. this.ui.x += xGame.common.sysOffestNum;
  19473. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19474. this.isEject = false;
  19475. xGame.common.gameUI = this;
  19476. this.initSelf();
  19477. }
  19478. isTurnSelf() {
  19479. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19480. return true;
  19481. }
  19482. }
  19483. initSelf() {
  19484. let topUI = this.ui.topNode;
  19485. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19486. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19487. this.barInfo = {};
  19488. this.barInfo.curY = 0;
  19489. this.barInfo.height = this.ui.powerNode.height;
  19490. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19491. this.barInfo.powerStartY = this.ui.powerNode.y;
  19492. xGame.common.aiPlayer = new AIPlayer();
  19493. xGame.common.gameMgr = new GameMgr();
  19494. xGame.common.skillMgr = new SkillMgr();
  19495. xGame.common.wordsMgr = new WordsMgr();
  19496. xGame.common.talkMgr = new TalkMgr();
  19497. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19498. console.log("加载经典模式表情文件chenggon !");
  19499. });
  19500. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19501. console.log("挑战模式奖励模式spine加载成功!");
  19502. });
  19503. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19504. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19505. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19506. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19507. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19508. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19509. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19510. }
  19511. getGanZiImg() {
  19512. let index = DataMgr.getCurBallRod();
  19513. let data = cfgTable.ballrodData[index + 1];
  19514. let gan_url = xGame.common.getGameIconUrl(data.img);
  19515. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19516. this.ui.powerNode.showImg.url = gan_url;
  19517. console.log('zh:修改杆子图标O K');
  19518. }
  19519. returnHome() {
  19520. let tips = "Are you sure to exit the game?";
  19521. let woman = "Boss, why don't you play for a while longer?";
  19522. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19523. }
  19524. addRodMethodClick() {
  19525. if (this.isTurnSelf()) {
  19526. xGame.uiMgr.Show(UIRodMethod$1);
  19527. }
  19528. }
  19529. clickHelpLineBtn(force = false) {
  19530. if (!this.isTurnSelf())
  19531. return;
  19532. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19533. if (success) {
  19534. xGame.common.longHelpLine = true;
  19535. xGame.common.d2World.getHelpLine();
  19536. Moyu.sendDataEvent("guideNum");
  19537. }
  19538. else {
  19539. }
  19540. });
  19541. }
  19542. renderSelfDisplayBalls(index, target) {
  19543. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19544. target.myImg.url = xGame.common.getGameIconUrl(str);
  19545. }
  19546. renderAIDisplayBalls(index, target) {
  19547. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19548. target.myImg.url = xGame.common.getGameIconUrl(str);
  19549. ;
  19550. }
  19551. updateMode() {
  19552. if (xGame.common.gameMode == GameMode.classic) {
  19553. this.ui.topNode.scoreNode.visible = false;
  19554. }
  19555. else if (xGame.common.gameMode == GameMode.bigMove) {
  19556. this.ui.topNode.scoreNode.visible = true;
  19557. }
  19558. }
  19559. show() {
  19560. super.show();
  19561. console.log("zh:uigame show AADD");
  19562. this.ui.alpha = 0;
  19563. this.updateSelf();
  19564. xGame.common.gameMgr.gamePause = false;
  19565. xGame.common.gameUI.ui.blackAni.visible = false;
  19566. xGame.common.gameUI.ui.whiteAni.visible = false;
  19567. this.ui.powerEft.visible = false;
  19568. this.ui.colorNode.visible = false;
  19569. this.updateHead();
  19570. let curUse = DataMgr.getCurBallRod();
  19571. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19572. this.getGanZiImg();
  19573. }
  19574. updateSelf() {
  19575. if (xGame.common.gameMode == GameMode.classic) {
  19576. this.ui.c1.selectedIndex = 0;
  19577. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19578. this.ui.topNode.middleNode.visible = true;
  19579. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19580. }
  19581. else if (xGame.common.gameMode == GameMode.bigMove) {
  19582. this.ui.c1.selectedIndex = 0;
  19583. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19584. this.ui.topNode.middleNode.visible = false;
  19585. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19586. let rand = xGame.common.randomNum(1, max);
  19587. let guide = DataMgr.getSkillGuide();
  19588. if (guide == 0)
  19589. rand = 1;
  19590. xGame.common.bigMoveLevelIndex = rand;
  19591. }
  19592. else if (xGame.common.gameMode == GameMode.placeBall) {
  19593. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  19594. this.ui.c1.selectedIndex = 1 + data.type;
  19595. this.ui.alpha = 1;
  19596. this.startGame();
  19597. }
  19598. this.updateMode();
  19599. this.initD3world();
  19600. this.initD2world();
  19601. }
  19602. startGame() {
  19603. this.ui.snowNode.visible = Math.random() <= 0.1;
  19604. this.ui.d2Node.visible = false;
  19605. xGame.common.d3World.d3Hand.gameObj.active = false;
  19606. xGame.common.d3World.tableSrc.init();
  19607. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19608. this.cameraViewChange(() => {
  19609. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  19610. switch (xGame.common.gameMode) {
  19611. case GameMode.classic:
  19612. xGame.common.d3World.d3Hand.gameObj.active = true;
  19613. this.playPutBallD3Ani();
  19614. break;
  19615. case GameMode.bigMove:
  19616. this.enterGame();
  19617. Laya.timer.once(500, this, () => {
  19618. this.ui.topNode.middleNode.visible = true;
  19619. this.ui.topNode.middleNode.t0.play();
  19620. });
  19621. break;
  19622. case GameMode.placeBall:
  19623. this.enterGame();
  19624. break;
  19625. default:
  19626. break;
  19627. }
  19628. });
  19629. PlatMgr.showBanner(false);
  19630. }
  19631. enterGame() {
  19632. this.ui.d2Node.visible = true;
  19633. xGame.common.d3World.d3Hand.gameObj.active = false;
  19634. xGame.common.showOneCamera("mainCamera");
  19635. Moyu.recordGame(30, true);
  19636. if (!this.isPrePlay) {
  19637. this.isPrePlay = true;
  19638. xGame.common.d3World.prePlayEft();
  19639. }
  19640. xGame.common.gameMgr.gameReady();
  19641. this.openAllEvent();
  19642. this.ui.snowNode.visible = false;
  19643. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  19644. this.ui.helpBtn.visible = condition;
  19645. }
  19646. showHelpLineGuide() {
  19647. let longGuide = DataMgr.getGuideHelpLine();
  19648. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  19649. this.ui.helpBtn.visible = true;
  19650. this.ui.guideNode.visible = true;
  19651. }
  19652. }
  19653. setTurnAlpha(alpha) {
  19654. this.ui.keduNode.alpha = alpha;
  19655. this.ui.ganNode.alpha = alpha;
  19656. this.ui.rodMethodNode.alpha = alpha;
  19657. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  19658. }
  19659. cameraViewChange(callback) {
  19660. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  19661. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  19662. xGame.common.showOneCamera("visitAngle");
  19663. cameraSrc.localRotationEulerY = 180;
  19664. cameraSrc.localRotationEulerZ = 0;
  19665. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  19666. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  19667. callback && callback();
  19668. }));
  19669. }));
  19670. }
  19671. playPutBallD3Ani() {
  19672. xGame.common.showOneCamera("mainCamera");
  19673. let handSrc = xGame.common.d3World.d3Hand;
  19674. handSrc.gameObj.active = true;
  19675. handSrc.transform.localPositionZ = 3;
  19676. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  19677. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  19678. handSrc.gameObj.active = false;
  19679. this.enterGame();
  19680. }), 400);
  19681. }));
  19682. }
  19683. updateHead() {
  19684. let user = Moyu.getUserInfo();
  19685. this.ui.topNode.selfNameTxt.text = user.nickName;
  19686. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  19687. let aiData = xGame.cfgMgr.getRandomUserInfo();
  19688. if (DataMgr.getSkillGuide() < 1) {
  19689. this.ui.topNode.aiNameTxt.text = 'billiards';
  19690. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  19691. }
  19692. else {
  19693. this.ui.topNode.aiNameTxt.text = aiData.name;
  19694. let randNo = Math.floor(Math.random() * 10) + 1;
  19695. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  19696. }
  19697. }
  19698. initD2world() {
  19699. let node = this.ui.d2Root.displayObject;
  19700. let src = node.getComponent(D2World);
  19701. if (!src) {
  19702. xGame.common.d2World = node.addComponent(D2World);
  19703. }
  19704. xGame.common.d2World.initSelf();
  19705. }
  19706. initD3world() {
  19707. if (this.isD3Inited)
  19708. return;
  19709. this.isD3Inited = true;
  19710. let scene3D = xGame.common.d3Scene;
  19711. this.ui.d3Root.displayObject.addChild(scene3D);
  19712. scene3D.active = true;
  19713. xGame.common.d3World.tableSrc.setBorderPos();
  19714. }
  19715. onRootMove(e) {
  19716. let rootBall = xGame.common.d2World.rootBall;
  19717. this.ui.moveNode.x = e.x;
  19718. this.ui.moveNode.y = e.y;
  19719. rootBall.gameObj.x = e.x;
  19720. rootBall.gameObj.y = e.y;
  19721. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  19722. }
  19723. aiRootMove(move) {
  19724. if (move)
  19725. this.hideBallUI();
  19726. else {
  19727. this.showBallUI();
  19728. xGame.common.d2World.getHelpLine();
  19729. }
  19730. }
  19731. aiForce(type, force = 0) {
  19732. this.pressTarget = PressType.powerNode;
  19733. if (type == 1)
  19734. this.onEventUp({ force: true });
  19735. else if (type == 2)
  19736. this.onEventMove({ stageY: force, force: true });
  19737. }
  19738. onEventPress(e) {
  19739. if (e.stopPropagation)
  19740. e.stopPropagation();
  19741. if (!this.isTurnSelf())
  19742. return;
  19743. let target = e.target;
  19744. switch (target) {
  19745. case this.ui.myPowerNode.displayObject:
  19746. this.pressTarget = PressType.powerNode;
  19747. this.barInfo.curY = e.stageY;
  19748. this.updateBarInfo();
  19749. break;
  19750. case this.ui.moveNode.displayObject:
  19751. this.pressTarget = PressType.moveNode;
  19752. this.hideBallUI();
  19753. this.eventObj.curX = this.ui.moveNode.x;
  19754. this.eventObj.curY = this.ui.moveNode.y;
  19755. this.ui.moveNode.finger.visible = false;
  19756. this.eventObj.lastX = e.stageX;
  19757. this.eventObj.lastY = e.stageY;
  19758. break;
  19759. case this.ui.rulerClickNode.displayObject:
  19760. this.pressTarget = PressType.rulerNode;
  19761. this.eventObj.lastY = e.stageY;
  19762. break;
  19763. case this.ui.d2Root.displayObject:
  19764. this.pressTarget = PressType.d2Root;
  19765. this.eventObj.lastX = e.stageX;
  19766. this.eventObj.lastY = e.stageY;
  19767. this.eventObj.starX = e.stageX;
  19768. this.eventObj.starY = e.stageY;
  19769. this.eventObj.curX = 0;
  19770. this.eventObj.curY = 0;
  19771. xGame.common.d2World.d2Gan.setGanLastInfo();
  19772. this.rulerOffset = 0;
  19773. break;
  19774. default:
  19775. break;
  19776. }
  19777. }
  19778. onEventMove(e) {
  19779. if (e.stopPropagation)
  19780. e.stopPropagation();
  19781. if (e && e.force) {
  19782. }
  19783. else {
  19784. if (!this.isTurnSelf())
  19785. return;
  19786. }
  19787. switch (this.pressTarget) {
  19788. case PressType.powerNode:
  19789. this.barInfo.curY = e.stageY;
  19790. this.updateBarInfo();
  19791. this.isMoveRod = true;
  19792. break;
  19793. case PressType.moveNode:
  19794. let rootBall = xGame.common.d2World.rootBall;
  19795. let radius = rootBall.gameObj.width / 2;
  19796. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  19797. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  19798. let border = xGame.common.d2World.borderRect;
  19799. if (curX <= border.x + radius)
  19800. curX = border.x + radius;
  19801. else if (curX >= border.x + border.width - radius)
  19802. curX = border.x + border.width - radius;
  19803. if (curY <= border.y + radius)
  19804. curY = border.y + radius;
  19805. else if (curY >= border.y + border.height - radius)
  19806. curY = border.y + border.height - radius;
  19807. if (xGame.common.gameMgr.isOpenBall) {
  19808. if (curX >= border.x + border.openBallW - radius)
  19809. curX = border.x + border.openBallW - radius;
  19810. }
  19811. this.ui.moveNode.x = curX;
  19812. this.ui.moveNode.y = curY;
  19813. rootBall.gameObj.x = curX;
  19814. rootBall.gameObj.y = curY;
  19815. rootBall.d3BallSrc.setTransPos(curX, curY);
  19816. this.isMoveRod = true;
  19817. break;
  19818. case PressType.rulerNode:
  19819. let yy = e.stageY - this.eventObj.lastY;
  19820. this.eventObj.lastY = e.stageY;
  19821. let ruler1 = this.ui.rulerNode.img1;
  19822. let ruler2 = this.ui.rulerNode.img2;
  19823. ruler1.y += yy;
  19824. ruler2.y += yy;
  19825. this.rulerOffset += yy;
  19826. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  19827. this.rulerOffset = 0;
  19828. xGame.soundMgr.playSound("inch", 1, 10);
  19829. }
  19830. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  19831. let h = ruler1.height;
  19832. this.checkGuide();
  19833. this.isMoveRod = true;
  19834. if (ruler1.y >= h) {
  19835. ruler1.y = -h;
  19836. ruler2.y = 0;
  19837. return;
  19838. }
  19839. else if (ruler1.y <= -h) {
  19840. ruler1.y = h;
  19841. ruler2.y = 0;
  19842. return;
  19843. }
  19844. if (ruler2.y >= h) {
  19845. ruler2.y = -h;
  19846. ruler1.y = 0;
  19847. return;
  19848. }
  19849. else if (ruler2.y <= -h) {
  19850. ruler2.y = h;
  19851. ruler1.y = 0;
  19852. return;
  19853. }
  19854. break;
  19855. case PressType.d2Root:
  19856. this.eventObj.curX = e.stageX;
  19857. this.eventObj.curY = e.stageY;
  19858. let offset = this.checkRodMoveDir();
  19859. xGame.common.d2World.d2Gan.rotateSelf(offset);
  19860. this.eventObj.lastX = e.stageX;
  19861. this.eventObj.lastY = e.stageY;
  19862. break;
  19863. default:
  19864. break;
  19865. }
  19866. }
  19867. onEventUp(e) {
  19868. if (e.stopPropagation)
  19869. e.stopPropagation();
  19870. if (e && e.force) {
  19871. }
  19872. else {
  19873. if (!this.isTurnSelf())
  19874. return;
  19875. }
  19876. switch (this.pressTarget) {
  19877. case PressType.powerNode:
  19878. this.ui.powerNode.value = 0;
  19879. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19880. this.ui.powerTxt.text = "";
  19881. if (this.powerNum > 0) {
  19882. xGame.eventMgr.event(BALL_SHOOT);
  19883. xGame.common.d2World.shoot(this.powerNum);
  19884. xGame.common.d2World.d2Gan.shoot();
  19885. xGame.common.d2World.d2HelpLine.shoot();
  19886. this.finishGuide();
  19887. this.ui.powerEft.visible = false;
  19888. this.ui.colorNode.visible = false;
  19889. let ganStr = "";
  19890. if (this.powerNum <= 30) {
  19891. ganStr = "gan_30";
  19892. }
  19893. else if (this.powerNum <= 60) {
  19894. ganStr = "gan_50";
  19895. }
  19896. else {
  19897. ganStr = "gan_80";
  19898. }
  19899. xGame.soundMgr.playSound(ganStr);
  19900. }
  19901. break;
  19902. case PressType.moveNode:
  19903. let rootBall = xGame.common.d2World.rootBall;
  19904. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  19905. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  19906. let isIntersect = this.judgeBallIntersect();
  19907. if (isIntersect) {
  19908. this.ui.moveNode.x = lastX;
  19909. this.ui.moveNode.y = lastY;
  19910. rootBall.gameObj.x = lastX;
  19911. rootBall.gameObj.y = lastY;
  19912. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  19913. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  19914. }
  19915. else {
  19916. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  19917. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  19918. }
  19919. this.showBallUI();
  19920. this.ui.moveNode.finger.visible = true;
  19921. xGame.common.d2World.getHelpLine();
  19922. break;
  19923. case PressType.rulerNode:
  19924. break;
  19925. case PressType.d2Root:
  19926. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  19927. if (dis <= 25) {
  19928. this.moveToClickDot(e);
  19929. }
  19930. break;
  19931. default:
  19932. break;
  19933. }
  19934. this.pressTarget = -1;
  19935. }
  19936. checkGuide() {
  19937. let guide = DataMgr.getSkillGuide();
  19938. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  19939. xGame.common.guideStep++;
  19940. xGame.common.gameUI.ui.guide2.visible = false;
  19941. xGame.common.gameUI.ui.guide3.visible = true;
  19942. }
  19943. }
  19944. finishGuide() {
  19945. let guide = DataMgr.getSkillGuide();
  19946. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  19947. xGame.common.guideStep = 10;
  19948. this.closeAllGuide();
  19949. console.log('zh: 新手引导完毕');
  19950. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  19951. }
  19952. }
  19953. closeAllGuide() {
  19954. xGame.common.gameUI.ui.guide1.visible = false;
  19955. xGame.common.gameUI.ui.guide2.visible = false;
  19956. xGame.common.gameUI.ui.guide3.visible = false;
  19957. }
  19958. updateBarInfo() {
  19959. let star = this.ui.powerNode.y;
  19960. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  19961. if (rate >= 1)
  19962. rate = 1;
  19963. if (rate <= 0)
  19964. rate = 0;
  19965. this.powerNum = Math.ceil(rate * 100);
  19966. this.ui.powerNode.value = this.powerNum;
  19967. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  19968. this.ui.colorNode.value = this.powerNum;
  19969. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  19970. this.ui.powerEft.visible = this.powerNum != 0;
  19971. this.ui.colorNode.visible = this.powerNum != 0;
  19972. this.ui.powerTxt.text = this.powerNum + "";
  19973. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  19974. }
  19975. forceCancel() {
  19976. this.ui.powerNode.value = 0;
  19977. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  19978. this.ui.powerTxt.text = "";
  19979. }
  19980. checkRodMoveDir() {
  19981. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  19982. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  19983. if (tempX >= 0 && tempY <= 0) {
  19984. return this.checkDir();
  19985. }
  19986. else if (tempX < 0 && tempY < 0) {
  19987. return this.checkDir(1, -1);
  19988. }
  19989. else if (tempX < 0 && tempY > 0) {
  19990. return this.checkDir(-1, -1);
  19991. }
  19992. else {
  19993. return this.checkDir(-1, 1);
  19994. }
  19995. }
  19996. checkDir(flagX = 1, flagY = 1) {
  19997. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  19998. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  19999. if (offsetY == 0) {
  20000. return offsetX * flagX;
  20001. }
  20002. if (offsetX == 0) {
  20003. return offsetY * flagY;
  20004. }
  20005. let angle = offsetY / offsetX;
  20006. if (Math.abs(angle) >= 1) {
  20007. return offsetY * flagY;
  20008. }
  20009. else {
  20010. return offsetX * flagX;
  20011. }
  20012. }
  20013. judgeBallIntersect() {
  20014. let rootBall = xGame.common.d2World.rootBall;
  20015. let ballArr = xGame.common.d2World.ballArr;
  20016. let radius = rootBall.gameObj.width / 2;
  20017. let temp;
  20018. let isIntersect = false;
  20019. for (let index = 0; index < ballArr.length; index++) {
  20020. temp = ballArr[index];
  20021. if (temp.number == rootBall.number)
  20022. continue;
  20023. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20024. if (isIntersect) {
  20025. break;
  20026. }
  20027. }
  20028. return isIntersect;
  20029. }
  20030. hideBallUI() {
  20031. let d2Gan = xGame.common.d2World.d2Gan;
  20032. if (!d2Gan.ui.isDisposed)
  20033. d2Gan.ui.visible = false;
  20034. let d2Help = xGame.common.d2World.d2HelpLine;
  20035. if (!d2Help.ui.isDisposed)
  20036. d2Help.ui.visible = false;
  20037. let rootBall = xGame.common.d2World.rootBall;
  20038. if (!rootBall.destroyed) {
  20039. rootBall.gameObj.active = false;
  20040. }
  20041. }
  20042. showBallUI() {
  20043. let d2Gan = xGame.common.d2World.d2Gan;
  20044. if (!d2Gan.ui.isDisposed)
  20045. d2Gan.ui.visible = true;
  20046. let d2Help = xGame.common.d2World.d2HelpLine;
  20047. if (!d2Help.ui.isDisposed)
  20048. d2Help.ui.visible = true;
  20049. let rootBall = xGame.common.d2World.rootBall;
  20050. if (!rootBall.destroyed) {
  20051. rootBall.gameObj.active = true;
  20052. }
  20053. }
  20054. moveToClickDot(e) {
  20055. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20056. let root = xGame.common.d2World.rootBall.gameObj;
  20057. let xx = e.stageX - xGame.common.sysOffestNum;
  20058. let yy = e.stageY;
  20059. let x = xx - root.x;
  20060. let y = yy - root.y;
  20061. let angle = xGame.common.getfguiRotation(x, y);
  20062. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20063. xGame.common.d2World.getHelpLine();
  20064. }
  20065. this.isMoveRod = false;
  20066. xGame.common.clickedBall = false;
  20067. }
  20068. openAllEvent() {
  20069. this.closeAllEvent();
  20070. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20071. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20072. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20073. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20074. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20075. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20076. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20077. }
  20078. closeAllEvent() {
  20079. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20080. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20081. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20082. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20083. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20084. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20085. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20086. }
  20087. resetGame() {
  20088. this.closeAllEvent();
  20089. this.hideBallUI();
  20090. xGame.common.gameMgr.gamePause = true;
  20091. }
  20092. }
  20093. UIGame$1.uiName = "UIGame";
  20094. class UIAddCoin$1 extends UIBase {
  20095. constructor() {
  20096. super();
  20097. this.coinNum = 2000;
  20098. }
  20099. onConstructor() {
  20100. this.ui = ui_UIAddCoin.createInstance();
  20101. this.contentPane = this.ui;
  20102. this.isEject = false;
  20103. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20104. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20105. }
  20106. show() {
  20107. super.show();
  20108. this.ui.t0.play();
  20109. }
  20110. videoAddCoin() {
  20111. console.log('zh:qjff_AD_for_UIAddCoin');
  20112. if (Laya.Browser.onAndroid) {
  20113. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20114. if (!boo) {
  20115. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20116. return;
  20117. }
  20118. }
  20119. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20120. }
  20121. else {
  20122. console.log('zh:AD 失败,直接发放奖励');
  20123. this.qjff_AD_for_UIAddCoin();
  20124. }
  20125. }
  20126. qjff_AD_for_UIAddCoin() {
  20127. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20128. this.hide();
  20129. }
  20130. }
  20131. UIAddCoin$1.uiName = "UIAddCoin";
  20132. class UIInvitation$1 extends UIBase {
  20133. constructor() {
  20134. super();
  20135. }
  20136. onConstructor() {
  20137. this.ui = ui_UIInvitation.createInstance();
  20138. this.contentPane = this.ui;
  20139. this.isEject = false;
  20140. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20141. }
  20142. show() {
  20143. super.show();
  20144. }
  20145. enterGame() {
  20146. xGame.common.gameMode = GameMode.classic;
  20147. DataMgr.setChallengeTimes(1);
  20148. xGame.common.passAwardCoin = 2000;
  20149. let need = xGame.common.classicNiceNeddCoin;
  20150. if (DataMgr.coinEnough(need)) {
  20151. DataMgr.setCoin(-need);
  20152. xGame.eventMgr.event(RESTART_GAME, true);
  20153. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20154. }
  20155. else {
  20156. xGame.eventMgr.event(RESTART_GAME, true);
  20157. }
  20158. this.hide();
  20159. }
  20160. hide() {
  20161. super.hide();
  20162. }
  20163. }
  20164. UIInvitation$1.uiName = "UIInvitation";
  20165. class UIPower$1 extends UIBase {
  20166. constructor() {
  20167. super();
  20168. }
  20169. onConstructor() {
  20170. this.ui = ui_UIPower.createInstance();
  20171. this.contentPane = this.ui;
  20172. this.isEject = false;
  20173. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20174. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20175. }
  20176. show() {
  20177. super.show();
  20178. this.ui.t0.play();
  20179. }
  20180. videoGetPower() {
  20181. console.log('zh:qjff_AD_for_uipower');
  20182. if (Laya.Browser.onAndroid) {
  20183. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20184. if (!boo) {
  20185. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20186. return;
  20187. }
  20188. }
  20189. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20190. }
  20191. else {
  20192. console.log('zh:AD 失败,直接发放奖励');
  20193. this.qjff_AD_for_uipower();
  20194. }
  20195. }
  20196. qjff_AD_for_uipower() {
  20197. DataMgr.setPower(xGame.common.videoPower, true);
  20198. xGame.eventMgr.event(POWER_TIME);
  20199. this.hide();
  20200. }
  20201. }
  20202. UIPower$1.uiName = "UIPower";
  20203. class UIGameEnd$1 extends UIBase {
  20204. constructor() {
  20205. super();
  20206. this.success = false;
  20207. this.awardCoinNum = 1000;
  20208. this.awardDiamondNum = 10;
  20209. }
  20210. onConstructor() {
  20211. this.ui = ui_UIGameEnd.createInstance();
  20212. this.contentPane = this.ui;
  20213. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20214. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20215. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20216. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20217. this.ui.talkNode.visible = false;
  20218. if (Moyu.isKs)
  20219. this.ui.closeNode.closeBtn.x += 100;
  20220. }
  20221. updateType() {
  20222. switch (xGame.common.gameMode) {
  20223. case GameMode.classic:
  20224. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20225. this.ui.coinNode.visible = this.success;
  20226. if (!this.success) {
  20227. Laya.timer.once(500, this, () => {
  20228. xGame.uiMgr.Show(UIAddCoin$1);
  20229. });
  20230. }
  20231. else {
  20232. this.logEventForClassic_win();
  20233. }
  20234. this.logEventForClassic_complete();
  20235. this.ui.isGetAward.visible = false;
  20236. this.ui.leftBtn.c1.selectedIndex = 3;
  20237. this.ui.rightBtn.c1.selectedIndex = 0;
  20238. this.moneyNode.ui.c1.selectedIndex = 1;
  20239. break;
  20240. case GameMode.bigMove:
  20241. console.log('zh:招法模式 aaaaaa bigMove');
  20242. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20243. this.ui.coinNode.visible = this.success;
  20244. if (xGame.common.gameMode == GameMode.bigMove) {
  20245. if (this.success) {
  20246. DataMgr.setSkillSuccessTimes(1, true);
  20247. DataMgr.setSkillAccTimes(1);
  20248. }
  20249. else {
  20250. DataMgr.setSkillSuccessTimes(0, false);
  20251. }
  20252. }
  20253. this.logEventForRod_complete_N();
  20254. if (!this.success) {
  20255. Laya.timer.once(500, this, () => {
  20256. xGame.uiMgr.Show(UIAddCoin$1);
  20257. });
  20258. }
  20259. else {
  20260. this.logEventForRod_win();
  20261. }
  20262. this.ui.isGetAward.visible = false;
  20263. this.ui.leftBtn.c1.selectedIndex = 3;
  20264. this.ui.rightBtn.c1.selectedIndex = 0;
  20265. this.moneyNode.ui.c1.selectedIndex = 1;
  20266. break;
  20267. case GameMode.placeBall:
  20268. this.ui.coinNode.visible = false;
  20269. if (this.success) {
  20270. if (xGame.common.placeBallStarNum == 3) {
  20271. this.ui.c1.selectedIndex = 2;
  20272. }
  20273. else {
  20274. this.ui.c1.selectedIndex = 3;
  20275. }
  20276. let level = xGame.common.placeBallCurLevel;
  20277. if (level > 59) {
  20278. this.logEventForChallenge_level_complete(level);
  20279. }
  20280. else {
  20281. this.logEventForChallenge_level_N(level);
  20282. }
  20283. }
  20284. else {
  20285. this.ui.c1.selectedIndex = 4;
  20286. }
  20287. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20288. if (cfg.type == PlaceBallType.challenge) {
  20289. this.ui.c1.selectedIndex = 2;
  20290. }
  20291. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20292. this.updatePlaceBallBtn();
  20293. this.updatePlaceBallStarNum();
  20294. this.updatePlaceBallAwardState();
  20295. this.moneyNode.ui.c1.selectedIndex = 2;
  20296. this.moneyNode.checkPowerTime();
  20297. this.moneyNode.powerChange();
  20298. DataMgr.upRankData();
  20299. break;
  20300. default:
  20301. break;
  20302. }
  20303. }
  20304. logEventForRod_complete_N() {
  20305. let gfmsIdx = xGame.common.curPlayerSkillType;
  20306. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20307. let gfmc = 'Skyfall Shot';
  20308. if (gfmsIdx == 0) {
  20309. gfmc = 'Skyfall Shot';
  20310. }
  20311. if (gfmsIdx == 1) {
  20312. gfmc = 'Surging break';
  20313. }
  20314. if (gfmsIdx == 2) {
  20315. gfmc = 'Frost Lock';
  20316. }
  20317. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20318. console.log('zh:logEventForRod_complete_N level = ' + level);
  20319. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20320. let jsonStr = {
  20321. "count": 0,
  20322. "name": gfmc
  20323. };
  20324. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20325. const d = LocalStorageManager.getItem(keyStr);
  20326. jsonStr.count = d.count + 1;
  20327. LocalStorageManager.setItem(keyStr, jsonStr);
  20328. }
  20329. else {
  20330. LocalStorageManager.setItem(keyStr, jsonStr);
  20331. }
  20332. const d2 = LocalStorageManager.getItem(keyStr);
  20333. let count = d2.count;
  20334. console.log('zh:logEventForRod_complete_N count = ' + count);
  20335. if (count % 5 == 0) {
  20336. const reqStr = JSON.stringify(jsonStr);
  20337. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20338. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20339. }
  20340. }
  20341. logEventForRod_win() {
  20342. console.log('zh:logEventForRod_win,胜利');
  20343. let gfmsIdx = xGame.common.curPlayerSkillType;
  20344. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20345. let gfmc = 'Skyfall Shot';
  20346. if (gfmsIdx == 0) {
  20347. gfmc = 'Skyfall Shot';
  20348. }
  20349. if (gfmsIdx == 1) {
  20350. gfmc = 'Surging break';
  20351. }
  20352. if (gfmsIdx == 2) {
  20353. gfmc = 'Frost Lock';
  20354. }
  20355. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20356. console.log('zh:logEventForRod_win level = ' + level);
  20357. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20358. let jsonStr = {
  20359. "count": 1,
  20360. "name": gfmc + ' Lev' + level
  20361. };
  20362. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20363. const d = LocalStorageManager.getItem(keyStr);
  20364. jsonStr.count = d.count + 1;
  20365. LocalStorageManager.setItem(keyStr, jsonStr);
  20366. }
  20367. else {
  20368. LocalStorageManager.setItem(keyStr, jsonStr);
  20369. }
  20370. const reqStr = JSON.stringify(jsonStr);
  20371. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20372. }
  20373. logEventForClassic_win() {
  20374. console.log('zh:logEventForClassic_win,胜利');
  20375. let rtype = xGame.common.classicRoomType;
  20376. let msmc = '';
  20377. if (rtype == 1) {
  20378. msmc = 'beginner';
  20379. }
  20380. if (rtype == 2) {
  20381. msmc = 'expert';
  20382. }
  20383. if (rtype == 3) {
  20384. msmc = 'master';
  20385. }
  20386. let keyStr = 'sjmd_classic_win_' + rtype;
  20387. let jsonStr = {
  20388. "difficulty": msmc,
  20389. "classic_count": 1,
  20390. "difficulty_count": 1
  20391. };
  20392. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20393. const d = LocalStorageManager.getItem(keyStr);
  20394. jsonStr.classic_count = d.classic_count + 1;
  20395. jsonStr.difficulty_count = d.difficulty_count + 1;
  20396. LocalStorageManager.setItem(keyStr, jsonStr);
  20397. }
  20398. else {
  20399. LocalStorageManager.setItem(keyStr, jsonStr);
  20400. }
  20401. const reqStr = JSON.stringify(jsonStr);
  20402. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20403. }
  20404. logEventForClassic_complete() {
  20405. console.log('zh:logEventForClassic_complete,胜利');
  20406. let rtype = xGame.common.classicRoomType;
  20407. let msmc = '';
  20408. if (rtype == 1) {
  20409. msmc = 'beginner';
  20410. }
  20411. if (rtype == 2) {
  20412. msmc = 'expert';
  20413. }
  20414. if (rtype == 3) {
  20415. msmc = 'master';
  20416. }
  20417. let keyStr = 'sjmd_classic_complete_' + rtype;
  20418. let jsonStr = {
  20419. "msmc": msmc,
  20420. "count": 0
  20421. };
  20422. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20423. const d = LocalStorageManager.getItem(keyStr);
  20424. jsonStr.count = d.count + 1;
  20425. LocalStorageManager.setItem(keyStr, jsonStr);
  20426. }
  20427. else {
  20428. LocalStorageManager.setItem(keyStr, jsonStr);
  20429. }
  20430. if (jsonStr.count % 5 == 0) {
  20431. const reqStr = JSON.stringify(jsonStr);
  20432. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20433. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20434. }
  20435. }
  20436. updatePlaceBallBtn() {
  20437. this.ui.leftBtn.c1.selectedIndex = 5;
  20438. if (this.success) {
  20439. this.ui.rightBtn.c1.selectedIndex = 14;
  20440. }
  20441. else {
  20442. if (xGame.common.placeBallStarNum == 3) {
  20443. this.ui.rightBtn.c1.selectedIndex = 14;
  20444. }
  20445. else {
  20446. this.ui.rightBtn.c1.selectedIndex = 1;
  20447. }
  20448. }
  20449. }
  20450. updatePlaceBallStarNum() {
  20451. let starNum = xGame.common.placeBallStarNum;
  20452. if (starNum == 0)
  20453. this.ui.starNumNode.c1.selectedIndex = 3;
  20454. else {
  20455. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20456. }
  20457. }
  20458. updatePlaceBallAwardState() {
  20459. let level = xGame.common.placeBallCurLevel;
  20460. let starNum = xGame.common.placeBallStarNum;
  20461. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20462. let data = cfgTable.placeballData[level].award;
  20463. let cfg = cfgTable.placeballData[level];
  20464. this.awardDiamondNum = data[1];
  20465. this.awardCoinNum = data[0];
  20466. if (cfg.type == PlaceBallType.challenge) {
  20467. this.awardDiamondNum = 0;
  20468. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20469. }
  20470. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20471. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20472. if (cfg.type == PlaceBallType.challenge) {
  20473. this.ui.awardNode.coinNode.visible = true;
  20474. }
  20475. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20476. this.ui.awardNode.diamondNode.x = 265;
  20477. this.ui.awardNode.coinNode.x = 354;
  20478. }
  20479. else {
  20480. this.ui.awardNode.diamondNode.x = 291;
  20481. this.ui.awardNode.coinNode.x = 291;
  20482. }
  20483. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20484. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20485. if (this.awardCoinNum == 0) {
  20486. this.ui.awardNode.coinNode.numTxt.text = "";
  20487. }
  20488. if (getAward) {
  20489. this.ui.isGetAward.visible = true;
  20490. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20491. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20492. }
  20493. else {
  20494. this.ui.isGetAward.visible = false;
  20495. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20496. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20497. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20498. }
  20499. else {
  20500. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20501. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20502. }
  20503. }
  20504. }
  20505. show(success) {
  20506. super.show();
  20507. xGame.eventMgr.event(RESET_GAME);
  20508. this.success = success;
  20509. Laya.timer.clearAll(this);
  20510. this.playSecretaryAni();
  20511. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20512. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20513. offsetTime = Math.floor(offsetTime / 1000);
  20514. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20515. this.updateType();
  20516. Laya.timer.once(200, this, () => {
  20517. this.addAward(() => {
  20518. this.updateType();
  20519. Laya.timer.once(500, this, () => {
  20520. this.showChallengeLevel();
  20521. });
  20522. });
  20523. });
  20524. if (this.success) {
  20525. JSBridgeUtils.instance.showInternAd('gameend_success');
  20526. console.log('zh:game end 成功');
  20527. xGame.soundMgr.playSound('slots_roll01');
  20528. xGame.soundMgr.playSound("s_win");
  20529. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20530. this.diyGameDataUtilForGameWin();
  20531. }
  20532. else {
  20533. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20534. console.log('zh:game end失败');
  20535. xGame.soundMgr.playSound('matchwin01');
  20536. xGame.soundMgr.playSound("s_lose");
  20537. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20538. }
  20539. let challengeNum = DataMgr.getChallengeTimes();
  20540. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20541. DataMgr.setChallengeTimes(1);
  20542. }
  20543. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20544. DataMgr.setClassicTimes();
  20545. }
  20546. }
  20547. diyGameDataUtilForGameWin() {
  20548. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20549. switch (xGame.common.gameMode) {
  20550. case GameMode.classic:
  20551. console.log('zh:DiyGameDataUtilForGameWin 111');
  20552. case GameMode.bigMove:
  20553. console.log('zh:DiyGameDataUtilForGameWin 222');
  20554. this.restartGame();
  20555. break;
  20556. case GameMode.placeBall:
  20557. console.log('zh:DiyGameDataUtilForGameWin 333');
  20558. var level = xGame.common.placeBallCurLevel;
  20559. console.log('zh:练习模式 联系了多少LEV=' + level);
  20560. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20561. if (level > db_over_lev) {
  20562. DataMgr.setChallengeMode_overLev(level);
  20563. }
  20564. break;
  20565. default:
  20566. console.log('zh:DiyGameDataUtilForGameWin 444');
  20567. break;
  20568. }
  20569. }
  20570. showChallengeLevel() {
  20571. if (DataMgr.getChallengeTimes() != 0)
  20572. return;
  20573. let skill = DataMgr.getSkillAccTimes();
  20574. let put = DataMgr.getPlaceBallLevelList().length;
  20575. if (skill >= 3 || put >= 5) {
  20576. xGame.uiMgr.Show(UIInvitation$1);
  20577. this.hide();
  20578. }
  20579. }
  20580. addAward(callback) {
  20581. if (!this.success) {
  20582. callback && callback();
  20583. return;
  20584. }
  20585. switch (xGame.common.gameMode) {
  20586. case GameMode.classic:
  20587. this.awardCoinNum = xGame.common.passAwardCoin;
  20588. this.awardDiamondNum = 0;
  20589. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20590. break;
  20591. case GameMode.bigMove:
  20592. this.awardCoinNum = xGame.common.passAwardCoin;
  20593. this.awardDiamondNum = 0;
  20594. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  20595. callback && callback();
  20596. break;
  20597. case GameMode.placeBall:
  20598. let level = xGame.common.placeBallCurLevel;
  20599. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  20600. if (xGame.common.placeBallStarNum != 3) {
  20601. callback && callback();
  20602. return;
  20603. }
  20604. else {
  20605. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20606. if (getAward) {
  20607. callback && callback();
  20608. return;
  20609. }
  20610. }
  20611. let cfg = cfgTable.placeballData[level];
  20612. let data = cfgTable.placeballData[level].award;
  20613. this.awardCoinNum = data[0];
  20614. this.awardDiamondNum = data[1];
  20615. if (cfg.type == PlaceBallType.challenge) {
  20616. this.awardDiamondNum = 0;
  20617. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20618. }
  20619. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  20620. let diamondAward;
  20621. if (this.awardDiamondNum > 0) {
  20622. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  20623. xGame.common.getAward([diamondAward, coinAward], callback);
  20624. }
  20625. else {
  20626. xGame.common.getAward([coinAward], callback);
  20627. }
  20628. if (cfg.type == PlaceBallType.normal) {
  20629. DataMgr.setPlaceBallAward(level);
  20630. }
  20631. break;
  20632. default:
  20633. break;
  20634. }
  20635. }
  20636. playSecretaryAni_old() {
  20637. let parent = this.ui.secretary.displayObject;
  20638. parent.destroyChildren();
  20639. let xx = this.ui.secretary.width / 2;
  20640. let yy = this.ui.secretary.height;
  20641. let scale = xGame.common.getSecretaryScale();
  20642. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20643. if (this.success) {
  20644. let rand = Math.random() <= 0.5 ? 2 : 3;
  20645. xGame.common.secretary.play(data, rand, false, parent, () => {
  20646. xGame.common.secretary.play(data, 1, true, parent);
  20647. });
  20648. }
  20649. else {
  20650. xGame.common.secretary.play(data, 0, true, parent);
  20651. }
  20652. }
  20653. playSecretaryAni() {
  20654. let parent = this.ui.secretary.displayObject;
  20655. parent.destroyChildren();
  20656. let xx = this.ui.secretary.width / 2;
  20657. let yy = this.ui.secretary.height;
  20658. let scale = xGame.common.getSecretaryScale();
  20659. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  20660. if (this.success) {
  20661. let rand = 0;
  20662. xGame.common.secretary.play(data, 0, true, parent);
  20663. }
  20664. else {
  20665. xGame.common.secretary.play(data, 0, true, parent);
  20666. }
  20667. }
  20668. restartGame() {
  20669. switch (xGame.common.gameMode) {
  20670. case GameMode.classic:
  20671. xGame.eventMgr.event(RESTART_GAME);
  20672. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20673. break;
  20674. case GameMode.bigMove:
  20675. this.hide();
  20676. xGame.eventMgr.event(RESTART_GAME);
  20677. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20678. break;
  20679. default:
  20680. break;
  20681. }
  20682. }
  20683. hide() {
  20684. super.hide();
  20685. xGame.common.stopGirlPop(this.ui.talkNode);
  20686. PlatMgr.showBanner(false);
  20687. }
  20688. returnHome() {
  20689. this.hide();
  20690. let showFailWords = !this.success;
  20691. xGame.uiMgr.Show(UIMain$1, showFailWords);
  20692. }
  20693. clickLeftBtn() {
  20694. switch (xGame.common.gameMode) {
  20695. case GameMode.classic:
  20696. case GameMode.bigMove:
  20697. this.returnHome();
  20698. break;
  20699. case GameMode.placeBall:
  20700. let level = xGame.common.placeBallCurLevel;
  20701. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  20702. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  20703. break;
  20704. default:
  20705. break;
  20706. }
  20707. }
  20708. powerStartPlaceBallLevel(level, btn) {
  20709. if (DataMgr.powerEnough()) {
  20710. btn.touchable = false;
  20711. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20712. btn.touchable = true;
  20713. DataMgr.setPower(-1);
  20714. xGame.eventMgr.event(POWER_TIME);
  20715. this.startPlaceBallLevel(level);
  20716. this.logEventForChallenge_level_start(level);
  20717. }));
  20718. }
  20719. else {
  20720. xGame.uiMgr.Show(UIPower$1, 0);
  20721. }
  20722. }
  20723. clickRightBtn() {
  20724. switch (xGame.common.gameMode) {
  20725. case GameMode.classic:
  20726. console.log('zh:clickRightBtn 111');
  20727. case GameMode.bigMove:
  20728. console.log('zh:clickRightBtn 222');
  20729. this.restartGame();
  20730. break;
  20731. case GameMode.placeBall:
  20732. console.log('zh:clickRightBtn 333');
  20733. let level = xGame.common.placeBallCurLevel;
  20734. let data = DataMgr.getPlaceBallLevel(level);
  20735. let curPss = data.play && !data.isCur;
  20736. if (curPss) {
  20737. console.log('zh:clickRightBtn 333-111');
  20738. console.log('zh:当前LV=' + level);
  20739. if (level == 60) {
  20740. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  20741. Laya.timer.once(3000, this, () => {
  20742. this.returnHome();
  20743. });
  20744. }
  20745. else {
  20746. let lev = level + 1;
  20747. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  20748. }
  20749. }
  20750. else {
  20751. console.log('zh:clickRightBtn 333-000');
  20752. Moyu.sendDataEvent("placeBallNextLevel");
  20753. console.log('zh:qjff_AD_for_uiGameEnd');
  20754. if (Laya.Browser.onAndroid) {
  20755. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20756. if (!boo) {
  20757. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20758. return;
  20759. }
  20760. }
  20761. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  20762. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  20763. }
  20764. else {
  20765. console.log('zh:AD 失败,直接发放奖励');
  20766. this.qjff_AD_for_uiGameEnd(level);
  20767. }
  20768. }
  20769. break;
  20770. default:
  20771. console.log('zh:clickRightBtn 444');
  20772. break;
  20773. }
  20774. }
  20775. logEventForChallenge_level_start(level) {
  20776. let keyStr = 'sjmd_challenge_level_start';
  20777. let jsonStr = {
  20778. "count": 0,
  20779. "gold_balance ": DataMgr.getCoin(),
  20780. "level": level,
  20781. "diamond_balance ": DataMgr.getDiamond()
  20782. };
  20783. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20784. const d = LocalStorageManager.getItem(keyStr);
  20785. if (level > d.level) {
  20786. jsonStr.count = d.count + 1;
  20787. LocalStorageManager.setItem(keyStr, jsonStr);
  20788. }
  20789. else {
  20790. }
  20791. }
  20792. else {
  20793. LocalStorageManager.setItem(keyStr, jsonStr);
  20794. }
  20795. const reqStr = JSON.stringify(jsonStr);
  20796. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  20797. }
  20798. qjff_AD_for_uiGameEnd(level) {
  20799. DataMgr.setPlaceBallLevel(level, 1);
  20800. this.startPlaceBallLevel(level + 1);
  20801. }
  20802. startPlaceBallLevel(level) {
  20803. xGame.common.gameMode = GameMode.placeBall;
  20804. xGame.common.placeBallCurLevel = level;
  20805. xGame.uiMgr.Show(UIGame$1);
  20806. this.hide();
  20807. }
  20808. logEventForChallenge_level_complete(level) {
  20809. let keyStr = 'sjmd_challenge_level_complete';
  20810. let jsonStr = {
  20811. "count": 1,
  20812. "gold_balance ": DataMgr.getCoin(),
  20813. "level": level,
  20814. "diamond_balance ": DataMgr.getDiamond()
  20815. };
  20816. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20817. const d = LocalStorageManager.getItem(keyStr);
  20818. jsonStr.count = d.count + 1;
  20819. LocalStorageManager.setItem(keyStr, jsonStr);
  20820. }
  20821. else {
  20822. LocalStorageManager.setItem(keyStr, jsonStr);
  20823. }
  20824. const reqStr = JSON.stringify(jsonStr);
  20825. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  20826. }
  20827. logEventForChallenge_level_N(level) {
  20828. console.log('zh:logEventForChallenge_level_N ' + level);
  20829. let keyStr = 'sjmd_challenge_level_N';
  20830. if (LocalStorageManager.hasKey(keyStr)) {
  20831. let lev = LocalStorageManager.getItem(keyStr);
  20832. if (level > lev) {
  20833. LocalStorageManager.setItem(keyStr, level);
  20834. }
  20835. if ((level) % 5 == 0) {
  20836. console.log('zh:每5关上报1次');
  20837. let sjmc = 'challenge_level_' + level;
  20838. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  20839. let sjmcForFirebase = 'challenge_level_' + level;
  20840. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  20841. }
  20842. else {
  20843. console.log('zh:5 no 上报');
  20844. }
  20845. }
  20846. else {
  20847. LocalStorageManager.setItem(keyStr, level);
  20848. }
  20849. }
  20850. }
  20851. UIGameEnd$1.uiName = "UIGameEnd";
  20852. class ShowItem$1 {
  20853. constructor() {
  20854. this.ui = ui_ShowItem.createInstance();
  20855. }
  20856. destroySelf() {
  20857. if (!this.ui.isDisposed) {
  20858. this.ui.removeFromParent();
  20859. this.ui.dispose();
  20860. }
  20861. }
  20862. setParent(parent) {
  20863. parent.addChild(this.ui);
  20864. }
  20865. setPos(x, y) {
  20866. this.ui.x = x;
  20867. this.ui.y = y;
  20868. }
  20869. setUrl(index) {
  20870. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  20871. }
  20872. }
  20873. class UILevelProp$1 extends UIBase {
  20874. constructor() {
  20875. super();
  20876. this.firstPos = 385;
  20877. this.secondPos = 467;
  20878. this.showItemArr = [];
  20879. }
  20880. onFontLoaded() {
  20881. try {
  20882. this.ui.myNode.conditionTxt.font = "arial";
  20883. console.log("zh: onFontLoaded 设置arial字体成功");
  20884. }
  20885. catch (error) {
  20886. console.log("zh: constructor onFontLoaded加载arial字体失败");
  20887. }
  20888. }
  20889. onConstructor() {
  20890. this.ui = ui_UILevelProp.createInstance();
  20891. this.contentPane = this.ui;
  20892. this.isEject = false;
  20893. this.addUIClick(this.ui.closeBtn, this.hide);
  20894. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20895. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  20896. }
  20897. show(level) {
  20898. super.show();
  20899. this.ui.t1.play();
  20900. this.level = level;
  20901. this.data = cfgTable.placeballData[this.level];
  20902. this.updateSelf();
  20903. this.showPreView();
  20904. this.moneyNode.ui.c1.selectedIndex = 2;
  20905. this.moneyNode.checkPowerTime();
  20906. this.moneyNode.powerChange();
  20907. }
  20908. showPreView() {
  20909. let item;
  20910. let data;
  20911. for (let index = 0; index < this.showItemArr.length; index++) {
  20912. item = this.showItemArr[index];
  20913. item.destroySelf();
  20914. }
  20915. this.showItemArr = [];
  20916. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  20917. for (const key in cfgData) {
  20918. data = cfgData[key];
  20919. item = new ShowItem$1();
  20920. item.setParent(this.ui.myNode.displayRoot);
  20921. item.setPos(data.x, data.y);
  20922. item.setUrl(data.value);
  20923. this.showItemArr.push(item);
  20924. }
  20925. }
  20926. updateSelf() {
  20927. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  20928. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  20929. if (this.data.ball == -1) {
  20930. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  20931. }
  20932. else {
  20933. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  20934. }
  20935. let localData = DataMgr.getPlaceBallLevel(this.level);
  20936. let getAward = localData.getAward;
  20937. let cfg = cfgTable.placeballData[this.level];
  20938. let coin = this.data.award[0];
  20939. let diamond = this.data.award[1];
  20940. if (cfg.type == PlaceBallType.challenge) {
  20941. diamond = 0;
  20942. coin = 100;
  20943. }
  20944. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  20945. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  20946. this.ui.myNode.coinNode.numTxt.text = coin + "";
  20947. if (cfg.type == PlaceBallType.challenge) {
  20948. this.ui.myNode.coinNode.numTxt.text = "";
  20949. }
  20950. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  20951. if (coin > 0 && diamond > 0) {
  20952. this.ui.myNode.diamondNode.x = 385;
  20953. this.ui.myNode.coinNode.x = 467;
  20954. }
  20955. else {
  20956. this.ui.myNode.diamondNode.x = 385;
  20957. this.ui.myNode.coinNode.x = 385;
  20958. }
  20959. if (!getAward) {
  20960. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  20961. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  20962. }
  20963. else {
  20964. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  20965. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  20966. }
  20967. }
  20968. startGame() {
  20969. if (DataMgr.powerEnough()) {
  20970. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  20971. this.ui.myNode.startBtn.touchable = false;
  20972. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  20973. console.log('zh:startGame ');
  20974. this.ui.myNode.startBtn.touchable = true;
  20975. DataMgr.setPower(-1);
  20976. xGame.eventMgr.event(POWER_TIME);
  20977. xGame.common.gameMode = GameMode.placeBall;
  20978. xGame.common.placeBallCurLevel = this.level;
  20979. xGame.uiMgr.Show(UIGame$1);
  20980. this.logEventForChallenge_level_start(this.level);
  20981. xGame.uiMgr.Hide(UILevelDisplay$1);
  20982. xGame.uiMgr.Hide(UIMain$1);
  20983. this.hide();
  20984. }));
  20985. }
  20986. else {
  20987. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  20988. xGame.uiMgr.Show(UIPower$1);
  20989. }
  20990. }
  20991. logEventForChallenge_level_start(level) {
  20992. let keyStr = 'sjmd_challenge_level_start';
  20993. let jsonStr = {
  20994. "count": 1,
  20995. "gold_balance ": DataMgr.getCoin(),
  20996. "level": level,
  20997. "diamond_balance ": DataMgr.getDiamond()
  20998. };
  20999. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21000. const d = LocalStorageManager.getItem(keyStr);
  21001. if (level > d.level) {
  21002. jsonStr.count = d.count + 1;
  21003. LocalStorageManager.setItem(keyStr, jsonStr);
  21004. }
  21005. else {
  21006. }
  21007. }
  21008. else {
  21009. LocalStorageManager.setItem(keyStr, jsonStr);
  21010. }
  21011. const reqStr = JSON.stringify(jsonStr);
  21012. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21013. }
  21014. hide() {
  21015. super.hide();
  21016. }
  21017. }
  21018. UILevelProp$1.uiName = "UILevelProp";
  21019. class PutBallLevelDisplay$1 {
  21020. constructor(ui, index) {
  21021. this.index = 0;
  21022. this.ui = ui;
  21023. this.index = index;
  21024. this.ui.onClick(this, this.clickSelf);
  21025. this.updateSelf();
  21026. this.ui.levelTxt.text = (this.index + 1) + "";
  21027. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21028. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21029. }
  21030. updateSelf() {
  21031. let level = this.index + 1;
  21032. this.data = DataMgr.getPlaceBallLevel(level);
  21033. this.ui.starNode.c1.selectedIndex = this.data.star;
  21034. let isChallenge = cfgTable.placeballData[level].type;
  21035. if (this.data.isCur) {
  21036. if (isChallenge) {
  21037. this.ui.c1.selectedIndex = 5;
  21038. }
  21039. else {
  21040. this.ui.c1.selectedIndex = 2;
  21041. }
  21042. }
  21043. else {
  21044. if (this.data.play) {
  21045. if (this.data.star == 3) {
  21046. this.ui.c1.selectedIndex = 0;
  21047. }
  21048. else {
  21049. this.ui.c1.selectedIndex = 1;
  21050. }
  21051. }
  21052. else {
  21053. if (isChallenge) {
  21054. this.ui.c1.selectedIndex = 4;
  21055. }
  21056. else {
  21057. this.ui.c1.selectedIndex = 3;
  21058. }
  21059. }
  21060. }
  21061. }
  21062. clickSelf() {
  21063. if (!this.data.play)
  21064. return;
  21065. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21066. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21067. }
  21068. }
  21069. class UILevelDisplay$1 extends UIBase {
  21070. constructor() {
  21071. super();
  21072. }
  21073. onConstructor() {
  21074. this.ui = ui_UILevelDisplay.createInstance();
  21075. this.contentPane = this.ui;
  21076. this.isEject = false;
  21077. this.myList = this.ui.myNode.myList;
  21078. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21079. this.levelItemArr = [];
  21080. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21081. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21082. this.myList.numItems = levelNum;
  21083. if (Moyu.isKs)
  21084. this.ui.closeNode.closeBtn.x += 100;
  21085. }
  21086. levelItemRender(index, target) {
  21087. let item = new PutBallLevelDisplay$1(target, index);
  21088. this.levelItemArr.push(item);
  21089. }
  21090. show() {
  21091. super.show();
  21092. this.updateLevel();
  21093. this.scrollToPlace();
  21094. }
  21095. updateLevel() {
  21096. let temp;
  21097. for (let index = 0; index < this.levelItemArr.length; index++) {
  21098. temp = this.levelItemArr[index];
  21099. temp.updateSelf();
  21100. }
  21101. }
  21102. scrollToPlace() {
  21103. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21104. let passArr = DataMgr.getPlaceBallLevelList();
  21105. let offest = passArr.length;
  21106. if (offest >= maxNum - 1)
  21107. offest = maxNum - 1;
  21108. this.myList.scrollToView(offest, true, true);
  21109. }
  21110. hide() {
  21111. super.hide();
  21112. }
  21113. }
  21114. UILevelDisplay$1.uiName = "UILevelDisplay";
  21115. class UIMatching$1 extends UIBase {
  21116. constructor() {
  21117. super();
  21118. }
  21119. onConstructor() {
  21120. this.ui = ui_UIMatching.createInstance();
  21121. this.contentPane = this.ui;
  21122. this.isEject = false;
  21123. }
  21124. show(callback) {
  21125. super.show();
  21126. PlatMgr.showBanner(true);
  21127. this.callback = callback;
  21128. let user = Moyu.getUserInfo();
  21129. if (!this.selfPot) {
  21130. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21131. }
  21132. if (!this.aiPot) {
  21133. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21134. }
  21135. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21136. this.ui.selfHead.nameTxt.text = user.nickName;
  21137. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21138. this.ui.aiHead.nameTxt.text = "???";
  21139. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21140. this.ui.selfHead.c1.selectedIndex = 0;
  21141. this.ui.aiHead.c1.selectedIndex = 0;
  21142. this.ui.selfHead.x = this.selfPot.x;
  21143. this.ui.selfHead.y = this.selfPot.y;
  21144. this.ui.aiHead.x = this.aiPot.x;
  21145. this.ui.aiHead.y = this.aiPot.y;
  21146. switch (xGame.common.gameMode) {
  21147. case GameMode.classic:
  21148. break;
  21149. case GameMode.bigMove:
  21150. this.initSkillData();
  21151. break;
  21152. default:
  21153. break;
  21154. }
  21155. this.ui.t1.play(Laya.Handler.create(this, () => {
  21156. this.ui.t2.play(Laya.Handler.create(this, () => {
  21157. switch (xGame.common.gameMode) {
  21158. case GameMode.classic:
  21159. this.waitingPeople();
  21160. break;
  21161. case GameMode.bigMove:
  21162. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21163. break;
  21164. default:
  21165. break;
  21166. }
  21167. }));
  21168. }));
  21169. }
  21170. initSkillData() {
  21171. this.skillSelectData = [];
  21172. let skillUrl = xGame.common.skillIconList;
  21173. let skillName = xGame.common.skillNameList;
  21174. let skillLevel = DataMgr.getBigSkillList();
  21175. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21176. for (let index = 0; index < 5; index++) {
  21177. let obj = {};
  21178. obj.skillImg = skillUrl[index];
  21179. obj.skillName = skillName[index];
  21180. obj.skillType = skillType[index];
  21181. obj.skillLevel = skillLevel[index];
  21182. this.skillSelectData.push(obj);
  21183. }
  21184. }
  21185. getAISkillLevel(myLevel) {
  21186. let video = xGame.common.upSkillLevel;
  21187. let aiLevel;
  21188. let temp;
  21189. if (video) {
  21190. temp = xGame.common.randomNum(-2, -1);
  21191. }
  21192. else {
  21193. if (myLevel <= 5) {
  21194. temp = xGame.common.randomNum(1, 3);
  21195. }
  21196. else if (myLevel <= 9) {
  21197. temp = xGame.common.randomNum(-2, 1);
  21198. }
  21199. else {
  21200. temp = xGame.common.randomNum(-4, 0);
  21201. }
  21202. }
  21203. aiLevel = temp + myLevel;
  21204. if (aiLevel <= 1)
  21205. aiLevel = 1;
  21206. if (aiLevel >= 10)
  21207. aiLevel = 10;
  21208. return aiLevel;
  21209. }
  21210. getAISkillType() {
  21211. return xGame.common.randomNum(1, 4);
  21212. let successTimes = DataMgr.getSkillSuccessTimes();
  21213. let info = cfgTable.aiskillData[successTimes];
  21214. if (!info) {
  21215. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21216. info = cfgTable.aiskillData[max];
  21217. }
  21218. let dataArr = info.skillselect;
  21219. let myCfg = {};
  21220. for (let index = 0; index < dataArr.length; index++) {
  21221. let temp = dataArr[index].split('-');
  21222. myCfg[temp[0]] = {};
  21223. myCfg[temp[0]].id = parseInt(temp[0]);
  21224. myCfg[temp[0]].weight = parseInt(temp[1]);
  21225. }
  21226. let aiCfg = xGame.common.initWeight(myCfg);
  21227. let curData = xGame.common.getRandomWeightData(aiCfg);
  21228. return parseInt(curData.id);
  21229. }
  21230. getAISkillData(index) {
  21231. let myLevel = this.skillSelectData[index].skillLevel;
  21232. let aiLevel = this.getAISkillLevel(myLevel);
  21233. let aiType = this.getAISkillType() - 1;
  21234. return { aiLevel, aiType } = { aiLevel, aiType };
  21235. }
  21236. skillSelectFinish(index) {
  21237. let aiInfo = this.getAISkillData(index);
  21238. xGame.common.gameMgr.selfCurSkill = index;
  21239. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21240. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21241. this.ui.selfHead.c1.selectedIndex = 1;
  21242. this.ui.aiHead.c1.selectedIndex = 1;
  21243. let myData = this.skillSelectData[index];
  21244. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21245. let guide = DataMgr.getSkillGuide();
  21246. if (guide == 0) {
  21247. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21248. }
  21249. else {
  21250. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21251. }
  21252. let aiData = this.skillSelectData[aiInfo.aiType];
  21253. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21254. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21255. this.waitingPeople();
  21256. }
  21257. waitingPeople() {
  21258. let time = xGame.common.randomNum(1000, 3000);
  21259. time += 1000;
  21260. Laya.timer.once(time, this, () => {
  21261. this.matchingSuccess();
  21262. });
  21263. }
  21264. matchingSuccess() {
  21265. let gameUI = xGame.common.gameUI;
  21266. let name = gameUI.ui.topNode.aiNameTxt.text;
  21267. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21268. this.ui.aiHead.nameTxt.text = name;
  21269. this.ui.aiHead.headImg.url = url;
  21270. name = gameUI.ui.topNode.selfNameTxt.text;
  21271. url = gameUI.ui.topNode.selfHeadLoader.url;
  21272. this.ui.selfHead.nameTxt.text = name;
  21273. this.ui.selfHead.headImg.url = url;
  21274. this.ui.t3.play(Laya.Handler.create(this, () => {
  21275. this.callback && this.callback();
  21276. this.ui.t4.play(Laya.Handler.create(this, () => {
  21277. this.destroySelf();
  21278. }));
  21279. }));
  21280. }
  21281. destroySelf() {
  21282. this.callback = null;
  21283. this.skillSelectData = null;
  21284. this.selfPot = null;
  21285. this.aiPot = null;
  21286. if (!this.ui.isDisposed) {
  21287. this.ui.removeFromParent();
  21288. this.ui.dispose();
  21289. }
  21290. xGame.uiMgr.destroyUI(this);
  21291. }
  21292. }
  21293. UIMatching$1.uiName = "UIMatching";
  21294. class SkillDisplay$1 {
  21295. constructor(ui, data, uiIndex) {
  21296. this.starX = 0;
  21297. this.starY = 0;
  21298. this.index = 0;
  21299. this.ui = ui;
  21300. this.data = data;
  21301. this.index = uiIndex;
  21302. this.initSelf();
  21303. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21304. }
  21305. initSelf() {
  21306. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21307. this.ui.nameTxt.text = this.data.name;
  21308. this.ui.describeTxt.text = this.data.describe;
  21309. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21310. this.ui.startBtn.onClick(this, this.startGame);
  21311. this.updateSelf();
  21312. }
  21313. updateSelf() {
  21314. this.checkTry();
  21315. let level = DataMgr.getBigSkillByIndex(this.index);
  21316. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21317. }
  21318. checkTry() {
  21319. let index = this.index;
  21320. let level = DataMgr.getBigSkillByIndex(index);
  21321. if (level == null) {
  21322. DataMgr.setBigSkill(index, 1, false);
  21323. level = 1;
  21324. }
  21325. this.ui.levelTxt.text = "LV." + level;
  21326. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21327. this.ui.tryNode.visible = true;
  21328. else
  21329. this.ui.tryNode.visible = false;
  21330. }
  21331. clickAddLevel() {
  21332. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21333. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21334. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21335. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21336. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21337. }
  21338. else {
  21339. console.log('zh:AD 失败,直接发放奖励');
  21340. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21341. }
  21342. }
  21343. qjff_AD_for_skilldisplay_clickAddLevel() {
  21344. DataMgr.setBigSkill(this.data.index, 1);
  21345. this.updateSelf();
  21346. xGame.common.upSkillLevel = true;
  21347. }
  21348. startGame() {
  21349. console.log('zh:rod skill startgame');
  21350. if (this.data.index == 3) {
  21351. alert('Coming soon!');
  21352. return;
  21353. }
  21354. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21355. let needCoin = xGame.common.bigMoveNeedCoin;
  21356. xGame.common.passAwardCoin = 2000;
  21357. let guide = DataMgr.getSkillGuide();
  21358. console.log('zh:startGame guide=' + guide);
  21359. xGame.common.temSelfLevel = 0;
  21360. if (guide == 0) {
  21361. needCoin = 0;
  21362. xGame.common.temSelfLevel = 100;
  21363. }
  21364. if (DataMgr.coinEnough(needCoin)) {
  21365. DataMgr.setCoin(-needCoin);
  21366. xGame.common.curPlayerSkillType = this.index;
  21367. if (guide == 0)
  21368. xGame.common.curPlayerSkillType = 0;
  21369. console.log('zh: skilldisplay 1');
  21370. xGame.uiMgr.Show(UIGame$1);
  21371. xGame.uiMgr.Hide(UIMain$1);
  21372. xGame.uiMgr.Show(UIMatching$1, () => {
  21373. xGame.common.gameUI.ui.alpha = 1;
  21374. xGame.common.gameUI.startGame();
  21375. xGame.uiMgr.Hide(UISkill$1);
  21376. });
  21377. this.logEventForRod_start();
  21378. }
  21379. else {
  21380. console.log('zh: skilldisplay 2');
  21381. xGame.uiMgr.Show(UIAddProp$1, 0);
  21382. Moyu.sendDataEvent("AddCoinVideo");
  21383. }
  21384. }
  21385. logEventForRod_start() {
  21386. let gfmsIdx = xGame.common.curPlayerSkillType;
  21387. console.log('zh:选择的技能=' + gfmsIdx);
  21388. let gfmc = 'Skyfall Shot';
  21389. if (gfmsIdx == 0) {
  21390. gfmc = 'Skyfall Shot';
  21391. }
  21392. if (gfmsIdx == 1) {
  21393. gfmc = 'Surging break';
  21394. }
  21395. if (gfmsIdx == 2) {
  21396. gfmc = 'Frost Lock';
  21397. }
  21398. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21399. let jsonStr = {
  21400. "count": 0,
  21401. "name": gfmc
  21402. };
  21403. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21404. const d = LocalStorageManager.getItem(keyStr);
  21405. jsonStr.count = d.count + 1;
  21406. LocalStorageManager.setItem(keyStr, jsonStr);
  21407. }
  21408. else {
  21409. LocalStorageManager.setItem(keyStr, jsonStr);
  21410. }
  21411. const reqStr = JSON.stringify(jsonStr);
  21412. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21413. }
  21414. }
  21415. class UISkill$1 extends UIBase {
  21416. constructor() {
  21417. super();
  21418. this.skillData = [];
  21419. }
  21420. onConstructor() {
  21421. this.ui = ui_UISkill.createInstance();
  21422. this.contentPane = this.ui;
  21423. this.isEject = false;
  21424. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21425. this.initSkillData();
  21426. console.log('zh:aaaaaa1111111111');
  21427. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21428. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21429. console.log('zh:aaaaaa22222222');
  21430. this.displayList = [];
  21431. this.ui.skillNode.skillList.numItems = 3;
  21432. this.addUIClick(this.ui, this.interuptSecretary);
  21433. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21434. this.ui.talkNode.visible = false;
  21435. if (Moyu.isKs)
  21436. this.ui.closeNode.closeBtn.x += 100;
  21437. }
  21438. show() {
  21439. super.show();
  21440. this.playSecretaryIdle();
  21441. this.moneyNode.ui.c1.selectedIndex = 1;
  21442. Laya.timer.clearAll(this);
  21443. xGame.soundMgr.playSound("s_start");
  21444. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21445. let guide = DataMgr.getSkillGuide();
  21446. this.ui.guideNode.visible = guide == 0;
  21447. let item = this.getSkillItemByUIIndex(0);
  21448. if (guide == 0) {
  21449. item.ui.c1.selectedIndex = 1;
  21450. }
  21451. else {
  21452. item.ui.c1.selectedIndex = 0;
  21453. }
  21454. this.ui.guideNode.guideBtn.visible = guide == 0;
  21455. for (let index = 0; index < this.displayList.length; index++) {
  21456. this.displayList[index].checkTry();
  21457. }
  21458. }
  21459. getSkillItemByUIIndex(cur) {
  21460. for (let index = 0; index < this.displayList.length; index++) {
  21461. if (this.displayList[index].index == cur) {
  21462. return this.displayList[index];
  21463. }
  21464. }
  21465. }
  21466. enterGuideLevel() {
  21467. let item = this.getSkillItemByUIIndex(0);
  21468. item.startGame();
  21469. if (DataMgr.getNewUser())
  21470. Moyu.sendDataEvent("gameStart1");
  21471. }
  21472. initSkillData() {
  21473. this.skillData = [];
  21474. let nameList = xGame.common.skillNameList;
  21475. let iconList = xGame.common.skillIconList;
  21476. let describeList = [
  21477. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21478. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21479. "The power of frost descends—freezing the flow and taking full control of the game!"
  21480. ];
  21481. console.log('zh:initSkillData 111111111');
  21482. let data;
  21483. for (let index = 0; index < nameList.length; index++) {
  21484. data = {};
  21485. data.name = nameList[index];
  21486. data.icon = iconList[index];
  21487. data.describe = describeList[index];
  21488. data.index = index;
  21489. this.skillData.push(data);
  21490. }
  21491. }
  21492. updateSkillItem(index, target) {
  21493. if (this.displayList[index] == null) {
  21494. let uiIndex;
  21495. switch (index) {
  21496. case 0:
  21497. uiIndex = 1;
  21498. break;
  21499. case 1:
  21500. uiIndex = 0;
  21501. break;
  21502. case 2:
  21503. uiIndex = 2;
  21504. break;
  21505. case 3:
  21506. uiIndex = 3;
  21507. break;
  21508. default:
  21509. break;
  21510. }
  21511. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21512. this.displayList.push(temp);
  21513. }
  21514. }
  21515. playSecretaryIdle() {
  21516. let parent = this.ui.secretary.displayObject;
  21517. parent.destroyChildren();
  21518. let xx = this.ui.secretary.width / 2;
  21519. let yy = this.ui.secretary.height;
  21520. let scale = xGame.common.getSecretaryScale();
  21521. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21522. xGame.common.secretary.play(data, 0, true, parent);
  21523. }
  21524. returnUIMain() {
  21525. this.hide();
  21526. xGame.common.stopGirlPop(this.ui.talkNode);
  21527. xGame.uiMgr.Show(UIMain$1);
  21528. }
  21529. interuptSecretary() {
  21530. Laya.timer.clearAll(this);
  21531. this.playSecretaryRandomSound();
  21532. }
  21533. playSecretaryRandomSound() {
  21534. if (this.isHide)
  21535. return;
  21536. let time = xGame.common.randomNum(45000, 60000);
  21537. Laya.timer.once(time, this, () => {
  21538. if (this.isHide)
  21539. return;
  21540. let index = xGame.common.randomNum(4, 7);
  21541. xGame.soundMgr.playSound("s_main0" + index);
  21542. let words = 1;
  21543. switch (index) {
  21544. case 4:
  21545. words = 5;
  21546. break;
  21547. case 5:
  21548. words = 3;
  21549. break;
  21550. case 6:
  21551. words = 6;
  21552. break;
  21553. case 7:
  21554. words = 7;
  21555. break;
  21556. default:
  21557. break;
  21558. }
  21559. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21560. this.playSecretaryRandomSound();
  21561. });
  21562. }
  21563. }
  21564. UISkill$1.uiName = "UISkill";
  21565. class UIAddProp$1 extends UIBase {
  21566. constructor() {
  21567. super();
  21568. this.curType = "";
  21569. }
  21570. onConstructor() {
  21571. this.ui = ui_UIAddProp.createInstance();
  21572. this.contentPane = this.ui;
  21573. this.isEject = false;
  21574. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  21575. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  21576. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  21577. this.updateUI();
  21578. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  21579. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  21580. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  21581. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  21582. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  21583. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  21584. }
  21585. show(type) {
  21586. super.show();
  21587. this.curType = type == 0 ? "coin" : "diamond";
  21588. this.switchBtn("");
  21589. this.ui.t0.play();
  21590. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  21591. PlatMgr.showInsert(true);
  21592. }
  21593. closeSelf() {
  21594. this.hide();
  21595. }
  21596. updateUI() {
  21597. let data = cfgTable.moneyData;
  21598. let temp;
  21599. let obj;
  21600. for (const key in data) {
  21601. temp = data[key];
  21602. obj = this.ui.myNode["node" + key];
  21603. if (parseInt(key) <= 2) {
  21604. obj.diamondTxt.text = "+" + temp.num;
  21605. }
  21606. else {
  21607. obj.coinTxt.text = temp.num;
  21608. obj.diamondTxt.text = temp.get.split('_')[1];
  21609. }
  21610. }
  21611. this.updateDiamondShare();
  21612. }
  21613. updateDiamondShare() {
  21614. let data = DataMgr.getShareDiamondTimes();
  21615. if (data >= xGame.common.maxShareDiamondTimes) {
  21616. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  21617. this.ui.myNode.node1.touchable = false;
  21618. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21619. }
  21620. else {
  21621. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  21622. this.ui.myNode.node1.touchable = true;
  21623. }
  21624. }
  21625. switchBtn(type) {
  21626. if (type == "")
  21627. type = this.curType;
  21628. else {
  21629. if (this.curType == type) {
  21630. return;
  21631. }
  21632. else {
  21633. this.curType = type;
  21634. }
  21635. }
  21636. if (type == "coin") {
  21637. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  21638. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  21639. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  21640. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  21641. this.ui.myNode.c1.selectedIndex = 0;
  21642. }
  21643. else {
  21644. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  21645. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  21646. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  21647. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  21648. this.ui.myNode.c1.selectedIndex = 1;
  21649. }
  21650. }
  21651. convertCoin(index) {
  21652. let data = cfgTable.moneyData[index];
  21653. let coinNum = data.num;
  21654. let str = data.get.split('_')[1];
  21655. let needDiamond = parseInt(str);
  21656. if (DataMgr.diamondEnough(needDiamond)) {
  21657. DataMgr.setDiamond(-needDiamond);
  21658. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  21659. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  21660. }
  21661. else {
  21662. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  21663. this.switchBtn("diamond");
  21664. }
  21665. }
  21666. videoGetDiamond() {
  21667. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  21668. if (Laya.Browser.onAndroid) {
  21669. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21670. if (!boo) {
  21671. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21672. return;
  21673. }
  21674. }
  21675. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  21676. }
  21677. else {
  21678. console.log('zh:AD 失败,直接发放奖励');
  21679. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  21680. }
  21681. }
  21682. qjff_AD_for_uiAddProp_videoGetDiamond() {
  21683. let num = cfgTable.moneyData[2].num;
  21684. xGame.common.playObjFlyAnim(num, Prop.diamond);
  21685. this.closeSelf();
  21686. }
  21687. videoGetCoin() {
  21688. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  21689. if (Laya.Browser.onAndroid) {
  21690. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21691. if (!boo) {
  21692. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21693. return;
  21694. }
  21695. }
  21696. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  21697. }
  21698. else {
  21699. console.log('zh:AD 失败,直接发放奖励');
  21700. this.qjff_AD_for_uiAddProp_videoGetCoin();
  21701. }
  21702. }
  21703. qjff_AD_for_uiAddProp_videoGetCoin() {
  21704. xGame.common.playObjFlyAnim(2000, Prop.coin);
  21705. this.closeSelf();
  21706. }
  21707. shareGetDiamond() {
  21708. let times = DataMgr.getShareDiamondTimes();
  21709. if (times >= xGame.common.maxShareDiamondTimes) {
  21710. console.log('zh: 233333333333 maxShareDiamondTimes');
  21711. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  21712. }
  21713. else {
  21714. console.log('zh:33333333333333ad');
  21715. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  21716. if (Laya.Browser.onAndroid) {
  21717. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21718. if (!boo) {
  21719. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21720. return;
  21721. }
  21722. }
  21723. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  21724. }
  21725. else {
  21726. console.log('zh:AD 失败,直接发放奖励');
  21727. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  21728. }
  21729. }
  21730. }
  21731. qjff_AD_for_uiAddProp_shareGetDiamond() {
  21732. let diamond = xGame.common.randomNum(50, 100);
  21733. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  21734. DataMgr.setShareDiamondTimes(1);
  21735. this.updateDiamondShare();
  21736. }
  21737. openPutBallView() {
  21738. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  21739. let skill = xGame.uiMgr.getUI(UISkill$1);
  21740. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  21741. let uigame = xGame.uiMgr.getUI(UIGame$1);
  21742. if (end && !end.isHide) {
  21743. xGame.uiMgr.Hide(UIGameEnd$1);
  21744. xGame.uiMgr.Show(UIMain$1);
  21745. }
  21746. if (skill && !skill.isHide)
  21747. xGame.uiMgr.Hide(UISkill$1);
  21748. if (uigame && !uigame.isHide)
  21749. xGame.uiMgr.Hide(UIGame$1);
  21750. if (level && !level.isHide) {
  21751. }
  21752. else {
  21753. xGame.uiMgr.Show(UILevelDisplay$1);
  21754. }
  21755. this.closeSelf();
  21756. }
  21757. }
  21758. UIAddProp$1.uiName = "UIAddProp";
  21759. class MoneyNode$1 {
  21760. constructor(ui) {
  21761. this.leftTime = 0;
  21762. this.ui = ui;
  21763. this.ui.addCoinBtn.onClick(this, this.addCoin);
  21764. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  21765. this.ui.addPowerBtn.onClick(this, this.addPower);
  21766. this.ui.c1.selectedIndex = 1;
  21767. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  21768. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  21769. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  21770. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  21771. this.coinChange();
  21772. this.diamondChange();
  21773. this.powerChange();
  21774. }
  21775. addPower() {
  21776. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21777. xGame.uiMgr.Show(UIPower$1);
  21778. }
  21779. powerChange() {
  21780. let powerNum = DataMgr.getPower();
  21781. this.ui.powerTxt.text = powerNum + "";
  21782. }
  21783. checkPowerTime() {
  21784. let cur = new Date().getTime();
  21785. let last = DataMgr.getPowerTime();
  21786. if (last == 0) {
  21787. last = cur;
  21788. DataMgr.setPowerTime(cur);
  21789. }
  21790. let power = DataMgr.getPower();
  21791. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  21792. Laya.timer.clearAll(this);
  21793. if (power >= xGame.common.natureMaxPower) {
  21794. this.ui.powerTimeTxt.text = "";
  21795. DataMgr.setPowerTime(cur);
  21796. return;
  21797. }
  21798. if (power + offset >= xGame.common.natureMaxPower) {
  21799. DataMgr.setPower(xGame.common.natureMaxPower, false);
  21800. this.ui.powerTimeTxt.text = "";
  21801. DataMgr.setPowerTime(cur);
  21802. }
  21803. else {
  21804. if (offset > 0) {
  21805. DataMgr.setPower(offset);
  21806. DataMgr.setPowerTime(cur);
  21807. }
  21808. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  21809. this.leftTime = xGame.common.powerRecoverNum - time;
  21810. if (this.leftTime <= 0)
  21811. this.leftTime = 0;
  21812. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21813. Laya.timer.loop(1000, this, this.updatePowerTime);
  21814. }
  21815. }
  21816. updatePowerTime() {
  21817. this.leftTime -= 1;
  21818. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  21819. if (this.leftTime <= 0) {
  21820. this.checkPowerTime();
  21821. }
  21822. }
  21823. coinChange() {
  21824. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  21825. }
  21826. diamondChange() {
  21827. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  21828. }
  21829. addCoin() {
  21830. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21831. Moyu.sendDataEvent("AddCoinBtn");
  21832. xGame.uiMgr.Show(UIAddProp$1, 0);
  21833. }
  21834. addDiamond() {
  21835. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21836. Moyu.sendDataEvent("AddDiamondBtn");
  21837. xGame.uiMgr.Show(UIAddProp$1, 1);
  21838. }
  21839. }
  21840. class SettingNode$1 {
  21841. constructor(ui) {
  21842. this.showSetting = false;
  21843. this.openSound = true;
  21844. this.openShake = true;
  21845. this.ui = ui;
  21846. this.ui.soundBtn.onClick(this, this.switchSound);
  21847. this.ui.shakeBtn.onClick(this, this.switchShake);
  21848. this.ui.xyBtn.onClick(this, this.onXy);
  21849. this.ui.clickNode.onClick(this, this.changeSetting);
  21850. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  21851. this.ui.xyBtn.visible = false;
  21852. this.ui.shakeBtn.visible = false;
  21853. }
  21854. changeSetting() {
  21855. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21856. this.showSetting = !this.showSetting;
  21857. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  21858. }
  21859. switchSound() {
  21860. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21861. this.openSound = !this.openSound;
  21862. Moyu.onSetting(this.openSound, this.openShake);
  21863. xGame.soundMgr.onSetting(this.openSound);
  21864. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  21865. }
  21866. switchShake() {
  21867. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21868. this.openShake = !this.openShake;
  21869. Moyu.onSetting(this.openSound, this.openShake);
  21870. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  21871. }
  21872. onXy() {
  21873. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21874. MoyuMgr$1.showXy(1);
  21875. }
  21876. }
  21877. class UIDraw$1 extends UIBase {
  21878. constructor() {
  21879. super();
  21880. this.curKey = 0;
  21881. }
  21882. onConstructor() {
  21883. this.ui = ui_UIDraw.createInstance();
  21884. this.contentPane = this.ui;
  21885. this.isEject = false;
  21886. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21887. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  21888. this.addUIClick(this.ui.drawBtn, this.startDraw);
  21889. this.initDraw();
  21890. this.initUI();
  21891. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  21892. if (Moyu.isKs)
  21893. this.ui.closeNode.closeBtn.x += 100;
  21894. }
  21895. show() {
  21896. super.show();
  21897. this.ui.t0.play();
  21898. this.playSecretaryIdle();
  21899. this.updateDraw();
  21900. this.checkFree();
  21901. if (PlatMgr.bannerDelay > 0) {
  21902. this.ui.closeNode.closeBtn.visible = false;
  21903. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  21904. this.ui.closeNode.closeBtn.visible = true;
  21905. });
  21906. }
  21907. PlatMgr.showRateBanner();
  21908. }
  21909. hide() {
  21910. Laya.timer.clearAll(this);
  21911. super.hide();
  21912. }
  21913. checkFree() {
  21914. let isFree = DataMgr.getDailyfreeDrawTimes();
  21915. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  21916. }
  21917. initDraw() {
  21918. this.drawObj = [];
  21919. let data = cfgTable.drawData;
  21920. let temp;
  21921. let weight = 0;
  21922. for (const key in data) {
  21923. temp = data[key];
  21924. weight += temp.weight;
  21925. this.drawObj.push(weight);
  21926. }
  21927. this.allWeight = weight;
  21928. }
  21929. initUI() {
  21930. let data = cfgTable.drawData;
  21931. let temp;
  21932. let img;
  21933. let txt;
  21934. for (const key in data) {
  21935. temp = data[key];
  21936. img = this.ui.myNode.rotNode["img" + key];
  21937. txt = this.ui.myNode.rotNode["txt" + key];
  21938. img.url = xGame.common.getGameIconUrl(temp.icon);
  21939. txt.visible = true;
  21940. if (temp.award > 2) {
  21941. img.rotation = 0;
  21942. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  21943. }
  21944. else {
  21945. img.rotation = temp.rotation;
  21946. txt.text = temp.num;
  21947. }
  21948. }
  21949. }
  21950. getCurkey() {
  21951. let rand = Math.random() * this.allWeight;
  21952. let temp;
  21953. for (let index = 0; index < this.drawObj.length - 1; index++) {
  21954. temp = this.drawObj[index];
  21955. if (index == 0) {
  21956. if (rand < temp) {
  21957. return index + 1;
  21958. }
  21959. }
  21960. else {
  21961. if (rand >= temp && rand < this.drawObj[index + 1]) {
  21962. return index + 1;
  21963. }
  21964. }
  21965. }
  21966. return 2;
  21967. }
  21968. startDraw() {
  21969. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  21970. if (freeTimes > 0) {
  21971. this.beginDraw();
  21972. DataMgr.setDailyfreeDrawTimes(0);
  21973. this.checkFree();
  21974. }
  21975. else {
  21976. if (Laya.Browser.onAndroid) {
  21977. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21978. if (!boo) {
  21979. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21980. return;
  21981. }
  21982. }
  21983. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  21984. }
  21985. else {
  21986. console.log('zh:AD 失败,直接发放奖励');
  21987. this.qjff_chouJiang();
  21988. }
  21989. }
  21990. }
  21991. qjff_chouJiang() {
  21992. this.beginDraw();
  21993. }
  21994. beginDraw() {
  21995. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  21996. this.ui.drawBtn.touchable = false;
  21997. this.curKey = this.getCurkey();
  21998. console.log("当前key", this.curKey);
  21999. let cell = 60;
  22000. let lap = 3;
  22001. let angle = cell * (this.curKey - 1) + lap * 360;
  22002. let target = this.ui.myNode.rotNode;
  22003. target.rotation = 0;
  22004. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22005. console.log("旋转完成");
  22006. this.ui.drawBtn.touchable = true;
  22007. this.getAward();
  22008. }));
  22009. }
  22010. getAward() {
  22011. let data = cfgTable.drawData[this.curKey];
  22012. let temp = new AwardType();
  22013. temp.type = data.award;
  22014. temp.num = data.num;
  22015. xGame.common.getAward([temp], () => {
  22016. DataMgr.setDrawTimes(1);
  22017. this.updateDraw();
  22018. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22019. });
  22020. }
  22021. updateDraw() {
  22022. let drawTimes = DataMgr.getDrawTimes();
  22023. let awardTimes = DataMgr.getDrawAwardTimes();
  22024. if (Math.floor(drawTimes / 3) > awardTimes) {
  22025. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22026. this.ui.extraNode.boxBtn.touchable = true;
  22027. this.ui.extraNode.tipsTxt.text = "3/3";
  22028. this.ui.extraNode.barNode.width = 265;
  22029. this.getExtraAward();
  22030. }
  22031. else {
  22032. this.ui.extraNode.boxBtn.t0.stop();
  22033. this.ui.extraNode.boxBtn.touchable = false;
  22034. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22035. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22036. }
  22037. let data = cfgTable.drawData[1];
  22038. if (awardTimes == 0) {
  22039. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22040. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22041. this.ui.myNode.rotNode.img1.rotation = 0;
  22042. }
  22043. else {
  22044. let award = data.nextid;
  22045. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22046. this.ui.myNode.rotNode.txt1.text = award[1];
  22047. this.ui.myNode.rotNode.img1.rotation = 0;
  22048. }
  22049. }
  22050. getExtraAward() {
  22051. let drawTimes = DataMgr.getDrawTimes();
  22052. let awardTimes = DataMgr.getDrawAwardTimes();
  22053. let data = cfgTable.drawData[1];
  22054. let award = new AwardType();
  22055. if (awardTimes == 0) {
  22056. award.num = data.num;
  22057. award.type = data.award;
  22058. xGame.common.getAward([award], () => {
  22059. let all = Math.floor(drawTimes / 3);
  22060. DataMgr.setDrawAwardTimes(all);
  22061. this.updateDraw();
  22062. });
  22063. }
  22064. else {
  22065. award.num = parseInt(data.nextid[1]);
  22066. award.type = parseInt(data.nextid[0]);
  22067. xGame.common.getAward([award], () => {
  22068. let all = Math.floor(drawTimes / 3);
  22069. DataMgr.setDrawAwardTimes(all);
  22070. this.updateDraw();
  22071. });
  22072. }
  22073. }
  22074. closeSelf() {
  22075. this.hide();
  22076. }
  22077. playSecretaryIdle() {
  22078. let parent = this.ui.secretary.displayObject;
  22079. parent.destroyChildren();
  22080. let xx = this.ui.secretary.width / 2;
  22081. let yy = this.ui.secretary.height;
  22082. let scale = xGame.common.getSecretaryScale();
  22083. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22084. xGame.common.secretary.play(data, 0, true, parent);
  22085. }
  22086. }
  22087. UIDraw$1.uiName = "UIDraw";
  22088. class UIRanking$1 extends UIBase {
  22089. constructor() {
  22090. super();
  22091. this.showSelf = true;
  22092. this.rankType = 1;
  22093. this.rankList = [];
  22094. this.topX = 10;
  22095. this.myIndex = this.topX + 1;
  22096. this.myStar = 0;
  22097. }
  22098. onConstructor() {
  22099. this.ui = ui_UIRanking.createInstance();
  22100. this.contentPane = this.ui;
  22101. this.isEject = false;
  22102. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22103. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22104. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22105. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22106. this.ui.myNode.myList.setVirtual();
  22107. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22108. }
  22109. show() {
  22110. super.show();
  22111. this.getPaiHangBangDataFormJosnFile();
  22112. this.updateSelf();
  22113. let self = Moyu.getUserInfo();
  22114. if (!self.isAuth) {
  22115. Moyu.initUser(this, () => {
  22116. DataMgr.upRankData();
  22117. });
  22118. }
  22119. }
  22120. getPaiHangBangDataFormJosnFile() {
  22121. const rankingList = cfgTable.paiHangBangData.list;
  22122. this.updateItemData(rankingList);
  22123. }
  22124. updateSelfItem() {
  22125. console.log('zh:Moyu.platType =' + Moyu.platType);
  22126. let self = Moyu.getUserInfo();
  22127. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22128. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22129. if (this.myIndex > this.topX) {
  22130. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22131. }
  22132. else {
  22133. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22134. }
  22135. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22136. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22137. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22138. }
  22139. updateItemData(data) {
  22140. this.myStar = xGame.common.getAllStarNum();
  22141. if (this.rankList.length < 2) {
  22142. this.rankList = data;
  22143. let self = Moyu.getUserInfo();
  22144. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22145. self.headIcon = self.headIcon;
  22146. for (let i = 0; i < data.length; i++) {
  22147. let data = this.rankList[i];
  22148. if (data.userId == self.userId) {
  22149. this.rankList.splice(i, 1);
  22150. break;
  22151. }
  22152. }
  22153. for (let i = 0; i < data.length; i++) {
  22154. let data = this.rankList[i];
  22155. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22156. this.myIndex = i + 1;
  22157. let user = { headIcon: self.headIcon, nickName: "myself" };
  22158. let ud = { user: user, data: {} };
  22159. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22160. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22161. if (Moyu.platType < 11) {
  22162. user.headIcon = self.headIcon;
  22163. user.nickName = self.nickName;
  22164. }
  22165. this.rankList.splice(i, 0, md);
  22166. break;
  22167. }
  22168. }
  22169. }
  22170. this.updateSelfItem();
  22171. this.ui.myNode.myList.numItems = this.rankList.length;
  22172. }
  22173. updateItemUI(index, obj) {
  22174. let data = this.rankList[index];
  22175. let userData = JSON.parse(data.userData).user;
  22176. obj.nameTxt.text = userData.nickName.toString();
  22177. obj.valueTxt.text = data.rankScore;
  22178. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22179. obj.rankTxt.text = index + 1;
  22180. switch (index) {
  22181. case 0:
  22182. this.setImg(obj, 1, 0, 0);
  22183. obj.rankTxt.color = "#FFC047";
  22184. break;
  22185. case 1:
  22186. this.setImg(obj, 0, 1, 0);
  22187. obj.rankTxt.color = "#ACACAC";
  22188. break;
  22189. case 2:
  22190. this.setImg(obj, 0, 0, 1);
  22191. obj.rankTxt.color = "#D09672";
  22192. break;
  22193. default:
  22194. this.setImg(obj, 0, 0, 0);
  22195. obj.rankTxt.color = "#496FAB";
  22196. break;
  22197. }
  22198. }
  22199. setImg(obj, a, b, c) {
  22200. obj.img1.visible = a ? true : false;
  22201. obj.img2.visible = b ? true : false;
  22202. obj.img3.visible = c ? true : false;
  22203. }
  22204. changeList(type) {
  22205. this.rankType = type;
  22206. this.updateSelf();
  22207. }
  22208. changeSelfNode() {
  22209. this.showSelf = !this.showSelf;
  22210. this.updateSelf();
  22211. }
  22212. updateSelf() {
  22213. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22214. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22215. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22216. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22217. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22218. }
  22219. }
  22220. UIRanking$1.uiName = "UIRanking";
  22221. class UISecretary$1 extends UIBase {
  22222. constructor() {
  22223. super();
  22224. this.curIndex = 1;
  22225. }
  22226. onConstructor() {
  22227. this.ui = ui_UISecretary.createInstance();
  22228. this.contentPane = this.ui;
  22229. this.isEject = false;
  22230. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22231. this.nodeObj = { left: null, right: null, cur: null };
  22232. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22233. }
  22234. show() {
  22235. super.show();
  22236. this.ui.t0.play();
  22237. this.updateData();
  22238. }
  22239. addSecretarySpine(node, spineName) {
  22240. if (spineName == "mishu") {
  22241. if (this.secretarySpine1) {
  22242. node.displayObject.destroyChildren();
  22243. this.playWoman(this.secretarySpine1, node.displayObject);
  22244. }
  22245. else {
  22246. let spine1 = new SpineMgr("mishu", () => {
  22247. this.secretarySpine1 = spine1;
  22248. this.playWoman(this.secretarySpine1, node.displayObject);
  22249. });
  22250. }
  22251. }
  22252. else {
  22253. if (this.secretarySpine2) {
  22254. node.displayObject.destroyChildren();
  22255. this.playWoman(this.secretarySpine2, node.displayObject);
  22256. }
  22257. else {
  22258. let spine2 = new SpineMgr("xiaomishu2", () => {
  22259. this.secretarySpine2 = spine2;
  22260. this.playWoman(this.secretarySpine2, node.displayObject);
  22261. });
  22262. }
  22263. }
  22264. }
  22265. playWoman(node, parent) {
  22266. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22267. let yy = this.ui.myNode.gameNode3.secretary.height;
  22268. let scale = 1.5;
  22269. if (node == this.secretarySpine2) {
  22270. scale = 1.2;
  22271. }
  22272. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22273. node.play(data, 0, true, parent);
  22274. }
  22275. turnLeft() {
  22276. this.curIndex--;
  22277. if (this.curIndex < 1) {
  22278. this.curIndex = 2;
  22279. }
  22280. let left = this.nodeObj.left;
  22281. let right = this.nodeObj.right;
  22282. let cur = this.nodeObj.cur;
  22283. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22284. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22285. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22286. this.updateData();
  22287. }));
  22288. this.ui.myNode.setChildIndex(right, 2);
  22289. this.nodeObj.left = cur;
  22290. this.nodeObj.right = left;
  22291. this.nodeObj.cur = right;
  22292. }
  22293. turnRight() {
  22294. this.curIndex++;
  22295. if (this.curIndex > 2) {
  22296. this.curIndex = 1;
  22297. }
  22298. let left = this.nodeObj.left;
  22299. let right = this.nodeObj.right;
  22300. let cur = this.nodeObj.cur;
  22301. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22302. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22303. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22304. this.updateData();
  22305. }));
  22306. this.ui.myNode.setChildIndex(left, 2);
  22307. this.nodeObj.left = right;
  22308. this.nodeObj.right = cur;
  22309. this.nodeObj.cur = left;
  22310. }
  22311. updateData() {
  22312. console.log('zh: updateData FFFFFFFFFF');
  22313. let data = cfgTable.secretaryshopData;
  22314. let children = this.ui.myNode._children;
  22315. let temp;
  22316. let curData;
  22317. for (let index = 0; index < children.length; index++) {
  22318. temp = children[index];
  22319. curData = data[1];
  22320. temp.heightTxt.text = curData.height;
  22321. temp.foodTxt.text = curData.food;
  22322. temp.historyTxt.text = curData.history;
  22323. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22324. this.addSecretarySpine(temp.secretary, curData.spine);
  22325. let womanIndex = curData.id - 1;
  22326. let getWoman = DataMgr.getSecretary(womanIndex);
  22327. let curUse = DataMgr.getCurSecretary();
  22328. if (getWoman) {
  22329. if (curUse == womanIndex) {
  22330. temp.purchaseBtn.c1.selectedIndex = 1;
  22331. }
  22332. else {
  22333. temp.purchaseBtn.c1.selectedIndex = 2;
  22334. }
  22335. }
  22336. else {
  22337. temp.purchaseBtn.c1.selectedIndex = 0;
  22338. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22339. }
  22340. temp.purchaseBtn.visible = false;
  22341. }
  22342. }
  22343. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22344. console.log('zh: 点击了clickSecretary ');
  22345. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22346. if (getWoman) {
  22347. if (curUse != womanIndex) {
  22348. console.log();
  22349. DataMgr.setCurSecretary(womanIndex);
  22350. this.updateData();
  22351. }
  22352. }
  22353. else {
  22354. console.log('zh:点击购买了');
  22355. let need = needDiamond;
  22356. if (DataMgr.diamondEnough(need)) {
  22357. DataMgr.setDiamond(-need);
  22358. DataMgr.setSecretary(womanIndex, 1);
  22359. DataMgr.setCurSecretary(womanIndex);
  22360. this.updateData();
  22361. }
  22362. else {
  22363. xGame.uiMgr.Show(UIAddProp$1, 1);
  22364. }
  22365. }
  22366. }
  22367. closeSelf() {
  22368. this.hide();
  22369. }
  22370. }
  22371. UISecretary$1.uiName = "UISecretary";
  22372. class BallRodDisplay$1 {
  22373. constructor(ui, index) {
  22374. this.index = 0;
  22375. this.uiIndex = 0;
  22376. this.ui = ui;
  22377. this.index = index;
  22378. this.initData();
  22379. }
  22380. initData() {
  22381. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22382. let data = cfgTable.ballrodData[this.index + 1];
  22383. this.ui.nameTxt.text = data.name;
  22384. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22385. this.ui.levelNode.c1.selectedIndex = data.quality;
  22386. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22387. if (data.spine) {
  22388. this.mySpine = new SpineMgr(data.spine, () => {
  22389. let xx = 150;
  22390. let yy = 70;
  22391. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22392. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22393. });
  22394. }
  22395. }
  22396. updateSelf() {
  22397. console.log('zh:updateSelf -------------- ');
  22398. let get = DataMgr.getBallRod(this.index);
  22399. if (get == null)
  22400. get = 1;
  22401. let curUse = DataMgr.getCurBallRod();
  22402. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22403. if (get) {
  22404. if (curUse == this.index) {
  22405. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22406. }
  22407. else {
  22408. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22409. }
  22410. }
  22411. else {
  22412. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22413. }
  22414. }
  22415. buyBallRod() {
  22416. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22417. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22418. switch (selectedIndex) {
  22419. case 0:
  22420. break;
  22421. case 1:
  22422. console.log('zh:点击了 USE THIS');
  22423. DataMgr.setCurBallRod(this.index);
  22424. let curUse = DataMgr.getCurBallRod();
  22425. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22426. let ui = xGame.uiMgr.getUI(UIShop$1);
  22427. ui.updateBallRod();
  22428. break;
  22429. case 2:
  22430. let data = cfgTable.ballrodData[this.index + 1];
  22431. let need = data.price;
  22432. if (DataMgr.diamondEnough(need)) {
  22433. this.buyQiuGan(data);
  22434. DataMgr.setDiamond(-need);
  22435. DataMgr.setBallRod(this.index, 1);
  22436. DataMgr.setCurBallRod(this.index);
  22437. let ui = xGame.uiMgr.getUI(UIShop$1);
  22438. ui.updateBallRod();
  22439. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22440. }
  22441. else {
  22442. xGame.uiMgr.Show(UIAddProp$1, 1);
  22443. }
  22444. break;
  22445. default:
  22446. break;
  22447. }
  22448. }
  22449. buyQiuGan(qgItem) {
  22450. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22451. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22452. if (userInfo == null) {
  22453. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22454. return;
  22455. }
  22456. let reqData = xGame.httpMgr.getReqData();
  22457. let pd = JSON.parse(reqData);
  22458. pd.qiuGanData = qgItem;
  22459. reqData = JSON.stringify(pd);
  22460. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22461. try {
  22462. console.log('zh:buySp res = ' + JSON.stringify(res));
  22463. let code = res.code;
  22464. let msg = res.msg;
  22465. if (code == 401) {
  22466. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22467. alert(TIP_MSG_key.loginTimeOut);
  22468. xGame.uiMgr.Show(UIMsg$1, msg);
  22469. return;
  22470. }
  22471. if (code == 200) {
  22472. xGame.uiMgr.Show(UIMsg$1, msg);
  22473. DataMgr.getUserZiChanInfo();
  22474. }
  22475. else {
  22476. xGame.uiMgr.Show(UIMsg$1, msg);
  22477. }
  22478. }
  22479. catch (error) {
  22480. console.log('error=' + error);
  22481. alert(error);
  22482. }
  22483. finally {
  22484. }
  22485. });
  22486. }
  22487. logEventForGouMaiGan(qiuGanName) {
  22488. const ev = {
  22489. value: qiuGanName
  22490. };
  22491. const jsonStr = JSON.stringify(ev);
  22492. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22493. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22494. }
  22495. }
  22496. class DaoJuDisplay$1 {
  22497. constructor(ui, index) {
  22498. this.index = 0;
  22499. this.uiIndex = 0;
  22500. this.ui = ui;
  22501. this.index = index;
  22502. this.initData();
  22503. }
  22504. initData() {
  22505. this.ui.btn_buy.onClick(this, this.buySp);
  22506. this.ui.btn_buy.onClick(this, this.buyDj);
  22507. let data = cfgTable.daoJuData[this.index + 1];
  22508. console.log('zh:' + JSON.stringify(data));
  22509. this.ui.nameTxt.text = data.spbt;
  22510. this.ui.n_jiaGe.text = data.spjg + "";
  22511. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22512. let baseUrl = "asset/sound/ogg/";
  22513. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22514. }
  22515. buyDj() {
  22516. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22517. }
  22518. buySp() {
  22519. let djItem = cfgTable.daoJuData[this.index + 1];
  22520. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  22521. let userInfo = LocalStorageManager.getItem('userInfo');
  22522. if (userInfo == null) {
  22523. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22524. return;
  22525. }
  22526. let reqData = xGame.httpMgr.getReqData();
  22527. let pd = JSON.parse(reqData);
  22528. pd.spItem = djItem;
  22529. reqData = JSON.stringify(pd);
  22530. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  22531. try {
  22532. console.log('zh:buySp res = ' + JSON.stringify(res));
  22533. let code = res.code;
  22534. let msg = res.msg;
  22535. if (code == 401) {
  22536. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22537. alert(TIP_MSG_key.pleaseLoginIn);
  22538. return;
  22539. }
  22540. if (code == 200) {
  22541. xGame.uiMgr.Show(UIMsg$1, msg);
  22542. DataMgr.getUserZiChanInfo();
  22543. }
  22544. else {
  22545. xGame.uiMgr.Show(UIMsg$1, msg);
  22546. }
  22547. }
  22548. catch (error) {
  22549. console.log('error=' + error);
  22550. alert(error);
  22551. }
  22552. finally {
  22553. }
  22554. });
  22555. }
  22556. }
  22557. class UIShop$1 extends UIBase {
  22558. constructor() {
  22559. super();
  22560. this.itemNums = 0;
  22561. this.itemNumsForDj = 0;
  22562. this.curType = "";
  22563. }
  22564. onConstructor() {
  22565. this.ui = ui_UIShop.createInstance();
  22566. this.contentPane = this.ui;
  22567. this.isEject = false;
  22568. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22569. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22570. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  22571. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  22572. this.addUIClick(this.ui, this.interuptSecretary);
  22573. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  22574. this.ballRodArr = [];
  22575. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  22576. this.ui.myNode.myList.numItems = this.itemNums;
  22577. this.loadDjdata_old();
  22578. }
  22579. loadDjdata_old() {
  22580. let fff = cfgTable.daoJuData;
  22581. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  22582. this.daoJuArr = [];
  22583. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  22584. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  22585. }
  22586. getProductList() {
  22587. let reqData = xGame.httpMgr.getReqData();
  22588. let pd = JSON.parse(reqData);
  22589. pd.splx = "Consumable";
  22590. reqData = JSON.stringify(pd);
  22591. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  22592. try {
  22593. let code = res.code;
  22594. let msg = res.msg;
  22595. if (code == 401) {
  22596. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22597. alert(TIP_MSG_key.pleaseLoginIn);
  22598. return;
  22599. }
  22600. if (code == 200) {
  22601. let data = res.data;
  22602. for (let index = 0; index < data.length; index++) {
  22603. let element = data[index];
  22604. cfgTable.daoJuData[element.spid] = element;
  22605. }
  22606. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  22607. }
  22608. else {
  22609. xGame.uiMgr.Show(UIMsg, msg);
  22610. }
  22611. }
  22612. catch (error) {
  22613. console.log('error=' + error);
  22614. alert(error);
  22615. }
  22616. finally {
  22617. }
  22618. });
  22619. }
  22620. show(type) {
  22621. super.show();
  22622. this.curType = type == 0 ? "qiugan" : "daoju";
  22623. this.switchBtn("qiugan");
  22624. this.playSecretaryIdle();
  22625. this.updateBallRod();
  22626. }
  22627. test123() {
  22628. console.log('zh:test123 ');
  22629. }
  22630. switchBtn(type) {
  22631. console.log('zh:1111切換 sel type=' + type);
  22632. if (type == "") {
  22633. type = this.curType;
  22634. }
  22635. else {
  22636. if (this.curType == type) {
  22637. return;
  22638. }
  22639. else {
  22640. this.curType = type;
  22641. }
  22642. }
  22643. if (type == "qiugan") {
  22644. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  22645. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  22646. this.ui.myNode.c1.selectedIndex = 0;
  22647. this.ui.myNode.myList.visible = true;
  22648. this.ui.myNode.djList.visible = false;
  22649. }
  22650. else {
  22651. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  22652. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  22653. this.ui.myNode.c1.selectedIndex = 1;
  22654. this.ui.myNode.myList.visible = false;
  22655. this.ui.myNode.djList.visible = true;
  22656. }
  22657. }
  22658. updateBallRod() {
  22659. for (let index = 0; index < this.ballRodArr.length; index++) {
  22660. this.ballRodArr[index].updateSelf();
  22661. }
  22662. }
  22663. renderBallRod(sort, obj) {
  22664. let index = this.getIndexBySort(sort + 1) - 1;
  22665. let ballRod = new BallRodDisplay$1(obj, index);
  22666. this.ballRodArr.push(ballRod);
  22667. }
  22668. renderDaoJu(idx, obj) {
  22669. let index = this.getIndexBySortForDj(idx + 1) - 1;
  22670. let b = new DaoJuDisplay$1(obj, index);
  22671. this.daoJuArr.push(b);
  22672. }
  22673. getIndexBySort(sort) {
  22674. let object = cfgTable.ballrodData;
  22675. for (const key in object) {
  22676. if (object[key].sort == sort) {
  22677. return parseInt(key);
  22678. }
  22679. }
  22680. }
  22681. getIndexBySortForDj(idx) {
  22682. let object = cfgTable.daoJuData;
  22683. for (const key in object) {
  22684. if (object[key].idx == idx) {
  22685. return parseInt(key);
  22686. }
  22687. }
  22688. }
  22689. playSecretaryIdle() {
  22690. let parent = this.ui.secretary.displayObject;
  22691. parent.destroyChildren();
  22692. let xx = this.ui.secretary.width / 2;
  22693. let yy = this.ui.secretary.height;
  22694. let scale = xGame.common.getSecretaryScale();
  22695. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22696. xGame.common.secretary.play(data, 0, true, parent);
  22697. }
  22698. interuptSecretary() {
  22699. Laya.timer.clearAll(this);
  22700. this.playSecretaryRandomSound();
  22701. }
  22702. playSecretaryRandomSound() {
  22703. if (this.isHide)
  22704. return;
  22705. let time = xGame.common.randomNum(45000, 60000);
  22706. Laya.timer.once(time, this, () => {
  22707. if (this.isHide)
  22708. return;
  22709. let index = xGame.common.randomNum(4, 7);
  22710. xGame.soundMgr.playSound("s_main0" + index);
  22711. let words = 1;
  22712. switch (index) {
  22713. case 4:
  22714. words = 5;
  22715. break;
  22716. case 5:
  22717. words = 3;
  22718. break;
  22719. case 6:
  22720. words = 6;
  22721. break;
  22722. case 7:
  22723. words = 7;
  22724. break;
  22725. default:
  22726. break;
  22727. }
  22728. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22729. this.playSecretaryRandomSound();
  22730. });
  22731. }
  22732. closeSelf() {
  22733. this.hide();
  22734. }
  22735. }
  22736. UIShop$1.uiName = "UIShop";
  22737. class SignMax$1 {
  22738. constructor(ui) {
  22739. this.ui = ui;
  22740. }
  22741. updateSelf(index, sameDay, curDayIndex) {
  22742. let data = cfgTable.signData[index + 1];
  22743. this.ui.titleTxt.text = data.title;
  22744. let arr1 = data.award[0].split('-');
  22745. let arr2 = data.award[1].split('-');
  22746. let num1 = parseInt(arr1[1]);
  22747. let num2 = parseInt(arr2[1]);
  22748. this.ui.numTxt1.text = num1 + "";
  22749. this.ui.numTxt2.text = num2 + "";
  22750. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  22751. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  22752. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  22753. this.ui.numTxt1.visible = false;
  22754. }
  22755. else {
  22756. this.ui.numTxt1.visible = true;
  22757. }
  22758. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  22759. this.ui.numTxt2.visible = false;
  22760. }
  22761. else {
  22762. this.ui.numTxt2.visible = true;
  22763. }
  22764. if (index < curDayIndex) {
  22765. this.ui.c1.selectedIndex = 1;
  22766. }
  22767. else if (index == curDayIndex) {
  22768. if (sameDay) {
  22769. this.ui.c1.selectedIndex = 2;
  22770. }
  22771. else {
  22772. this.ui.c1.selectedIndex = 2;
  22773. }
  22774. }
  22775. else {
  22776. this.ui.c1.selectedIndex = 0;
  22777. }
  22778. }
  22779. }
  22780. class SignNormal$1 {
  22781. constructor(ui) {
  22782. this.ui = ui;
  22783. }
  22784. updateSelf(index, sameDay, curDayIndex) {
  22785. let data = cfgTable.signData[index + 1];
  22786. this.ui.titleTxt.text = data.title;
  22787. let arr = data.award[0].split('-');
  22788. let type = parseInt(arr[0]);
  22789. let num = parseInt(arr[1]);
  22790. this.ui.numTxt.text = num + "";
  22791. if (type > 2) {
  22792. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  22793. this.ui.myIcon.rotation = 0;
  22794. }
  22795. else {
  22796. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  22797. this.ui.myIcon.rotation = 0;
  22798. }
  22799. if (xGame.common.signAwardContainsRod(data.award)) {
  22800. this.ui.numTxt.visible = false;
  22801. }
  22802. else {
  22803. this.ui.numTxt.visible = true;
  22804. }
  22805. if (index < curDayIndex) {
  22806. this.ui.c1.selectedIndex = 1;
  22807. }
  22808. else if (index == curDayIndex) {
  22809. if (sameDay) {
  22810. this.ui.c1.selectedIndex = 2;
  22811. }
  22812. else {
  22813. this.ui.c1.selectedIndex = 2;
  22814. }
  22815. }
  22816. else {
  22817. this.ui.c1.selectedIndex = 0;
  22818. }
  22819. }
  22820. }
  22821. class UISign$1 extends UIBase {
  22822. constructor() {
  22823. super();
  22824. this.curDayIndex = 0;
  22825. this.starX = 0;
  22826. }
  22827. onConstructor() {
  22828. this.ui = ui_UISign.createInstance();
  22829. this.contentPane = this.ui;
  22830. this.isEject = false;
  22831. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22832. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22833. this.initSignItem();
  22834. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  22835. this.addUIClick(this.ui.againBtn, this.againGetAward);
  22836. }
  22837. show() {
  22838. super.show();
  22839. this.ui.t0.play();
  22840. this.playSecretaryIdle();
  22841. this.updateSign();
  22842. }
  22843. initSignItem() {
  22844. this.signArr = [];
  22845. for (let index = 0; index < 6; index++) {
  22846. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  22847. this.signArr.push(temp);
  22848. }
  22849. this.signMax = new SignMax$1(this.ui.myNode.day7);
  22850. if (Moyu.isKs)
  22851. this.ui.closeNode.closeBtn.x += 100;
  22852. }
  22853. updateSign() {
  22854. let sameDay = xGame.common.judgeSameDay();
  22855. let max = 7;
  22856. this.curDayIndex = DataMgr.getSignData();
  22857. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  22858. this.curDayIndex = 0;
  22859. if (!sameDay) {
  22860. this.ui.normalBtn.visible = true;
  22861. this.ui.tipsNode.visible = false;
  22862. this.ui.againBtn.visible = false;
  22863. }
  22864. else {
  22865. this.ui.normalBtn.visible = false;
  22866. let again = DataMgr.getExtraSign();
  22867. let isCurrency = false;
  22868. let index = this.curDayIndex;
  22869. if (index == 0)
  22870. index = 7;
  22871. let award = cfgTable.signData[index].award;
  22872. let num = award[0].split("-")[0];
  22873. if (num == "1" || num == "2")
  22874. isCurrency = true;
  22875. let showAgain = again == 0 && isCurrency;
  22876. this.ui.againBtn.visible = showAgain;
  22877. this.ui.tipsNode.visible = !showAgain;
  22878. }
  22879. for (let index = 0; index < this.signArr.length; index++) {
  22880. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  22881. }
  22882. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  22883. }
  22884. playSecretaryIdle() {
  22885. let parent = this.ui.secretary.displayObject;
  22886. parent.destroyChildren();
  22887. let xx = this.ui.secretary.width / 2;
  22888. let yy = this.ui.secretary.height;
  22889. let scale = xGame.common.getSecretaryScale();
  22890. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22891. xGame.common.secretary.play(data, 0, true, parent);
  22892. }
  22893. closeSelf() {
  22894. this.hide();
  22895. }
  22896. normalGetAward() {
  22897. let sameDay = xGame.common.judgeSameDay();
  22898. if (!sameDay) {
  22899. let award = cfgTable.signData[this.curDayIndex + 1].award;
  22900. let temp;
  22901. let type;
  22902. let num;
  22903. let arr = [];
  22904. for (let index = 0; index < award.length; index++) {
  22905. temp = award[index].split("-");
  22906. type = parseInt(temp[0]);
  22907. num = parseInt(temp[1]);
  22908. let awardType = new AwardType();
  22909. awardType.num = num;
  22910. awardType.type = type;
  22911. arr.push(awardType);
  22912. }
  22913. xGame.common.getAward(arr, (watchVideo) => {
  22914. this.curDayIndex++;
  22915. if (this.curDayIndex > 7)
  22916. this.curDayIndex = 0;
  22917. DataMgr.setSignData(this.curDayIndex);
  22918. DataMgr.setSignTime(new Date().getTime());
  22919. if (watchVideo) {
  22920. DataMgr.setExtraSign(1);
  22921. Moyu.sendDataEvent("signIn1");
  22922. }
  22923. this.updateSign();
  22924. });
  22925. }
  22926. }
  22927. againGetAward() {
  22928. Moyu.sendDataEvent("signIn2");
  22929. console.log('zh:qjff_AD_for_uisign');
  22930. if (Laya.Browser.onAndroid) {
  22931. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22932. if (!boo) {
  22933. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22934. return;
  22935. }
  22936. }
  22937. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  22938. }
  22939. else {
  22940. console.log('zh:AD 失败,直接发放奖励');
  22941. this.qjff_AD_for_uisign();
  22942. }
  22943. }
  22944. qjff_AD_for_uisign() {
  22945. let index = this.curDayIndex;
  22946. if (index == 0)
  22947. index = 7;
  22948. let award = cfgTable.signData[index].award;
  22949. let temp;
  22950. let type;
  22951. let num;
  22952. for (let index = 0; index < award.length; index++) {
  22953. temp = award[index].split("-");
  22954. type = parseInt(temp[0]);
  22955. num = parseInt(temp[1]) * 3;
  22956. xGame.common.playObjFlyAnim(num, type);
  22957. }
  22958. DataMgr.setExtraSign(1);
  22959. this.updateSign();
  22960. }
  22961. }
  22962. UISign$1.uiName = "UISign";
  22963. class UIModeSelection$1 extends UIBase {
  22964. constructor() {
  22965. super();
  22966. }
  22967. onConstructor() {
  22968. this.ui = ui_UIModeSelection.createInstance();
  22969. this.contentPane = this.ui;
  22970. this.isEject = false;
  22971. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  22972. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  22973. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  22974. this.addUIClick(this.ui.closeBtn, this.hide);
  22975. this.peopleArr = [65, 990, 580];
  22976. this.peopleOffest = [5, 10, 10];
  22977. }
  22978. show(callback) {
  22979. this.updateSelf();
  22980. super.show();
  22981. this.ui.t0.play();
  22982. this.callback = callback;
  22983. }
  22984. updateSelf() {
  22985. let cfg = cfgTable.modeselectData;
  22986. for (let index = 1; index <= 3; index++) {
  22987. let node = this.ui.myNode["type" + index];
  22988. node.need.text = cfg[index].need;
  22989. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  22990. node.peopleTxt.text = this.getRandPeople(index - 1);
  22991. }
  22992. }
  22993. enterGame(type) {
  22994. console.log('zh: 进入经典模式 type: ' + type);
  22995. xGame.common.classicRoomType = type;
  22996. let cfg = cfgTable.modeselectData[type];
  22997. let need = cfg.need;
  22998. xGame.common.passAwardCoin = cfg.award;
  22999. if (DataMgr.coinEnough(need)) {
  23000. DataMgr.setCoin(-need);
  23001. this.ui.myNode["type" + type].t0.play();
  23002. Laya.timer.once(200, this, () => {
  23003. this.callback && this.callback();
  23004. });
  23005. this.logEventForClassic_start();
  23006. }
  23007. else {
  23008. Moyu.sendDataEvent("AddCoinVideo");
  23009. xGame.uiMgr.Show(UIAddProp$1, 0);
  23010. }
  23011. }
  23012. getRandPeople(index) {
  23013. let rand = this.peopleOffest[index];
  23014. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23015. }
  23016. logEventForClassic_start() {
  23017. let rtype = xGame.common.classicRoomType;
  23018. let msmc = '';
  23019. if (rtype == 1) {
  23020. msmc = 'beginner';
  23021. }
  23022. if (rtype == 2) {
  23023. msmc = 'expert';
  23024. }
  23025. if (rtype == 3) {
  23026. msmc = 'master';
  23027. }
  23028. let keyStr = 'sjmd_classic_start_' + rtype;
  23029. let jsonStr = {
  23030. "difficulty": msmc,
  23031. "classic_count": 1,
  23032. "difficulty_count": 1
  23033. };
  23034. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23035. const d = LocalStorageManager.getItem(keyStr);
  23036. jsonStr.classic_count = d.classic_count + 1;
  23037. jsonStr.difficulty_count = d.difficulty_count + 1;
  23038. LocalStorageManager.setItem(keyStr, jsonStr);
  23039. }
  23040. else {
  23041. LocalStorageManager.setItem(keyStr, jsonStr);
  23042. }
  23043. const reqStr = JSON.stringify(jsonStr);
  23044. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23045. }
  23046. }
  23047. UIModeSelection$1.uiName = "UIModeSelection";
  23048. class UILogin$1 extends UIBase {
  23049. constructor() {
  23050. super();
  23051. }
  23052. onConstructor() {
  23053. this.ui = ui_UILogin.createInstance();
  23054. this.contentPane = this.ui;
  23055. this.isEject = false;
  23056. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23057. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23058. this.addUIClick(this.ui.btn_login, this.userLogin);
  23059. }
  23060. show() {
  23061. super.show();
  23062. this.x = (Laya.stage.width - this.width) / 2;
  23063. this.y = (Laya.stage.height - this.height) / 2;
  23064. }
  23065. closeSelf() {
  23066. this.hide();
  23067. }
  23068. userLogin() {
  23069. let ua = this.ui.txt_ua.text;
  23070. let up = this.ui.txt_up.text;
  23071. if (ua && up) {
  23072. let reqData = JSON.stringify({
  23073. username: ua.trim(),
  23074. password: up.trim(),
  23075. fromMark: 'app_game'
  23076. });
  23077. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23078. try {
  23079. console.log('zh:res = ' + JSON.stringify(res));
  23080. let code = res.code;
  23081. let msg = res.msg;
  23082. if (code == 200) {
  23083. let keyStr = 'userInfo';
  23084. let jsonStr = {
  23085. "username": res.username,
  23086. "token": res.token
  23087. };
  23088. LocalStorageManager.setItem(keyStr, jsonStr);
  23089. xGame.uiMgr.Show(UIMsg$1, msg);
  23090. DataMgr.getUserZiChanInfo();
  23091. this.closeSelf();
  23092. }
  23093. else {
  23094. xGame.uiMgr.Show(UIMsg$1, msg);
  23095. }
  23096. }
  23097. catch (error) {
  23098. console.log('error=' + error);
  23099. alert(error);
  23100. }
  23101. finally {
  23102. }
  23103. });
  23104. }
  23105. else {
  23106. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23107. }
  23108. }
  23109. gotoRegPage() {
  23110. this.closeSelf();
  23111. xGame.uiMgr.Show(UIReg$1);
  23112. }
  23113. }
  23114. UILogin$1.uiName = "UILogin";
  23115. class UIReg$1 extends UIBase {
  23116. constructor() {
  23117. super();
  23118. }
  23119. onConstructor() {
  23120. this.ui = ui_UIReg.createInstance();
  23121. this.contentPane = this.ui;
  23122. this.isEject = false;
  23123. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23124. this.addUIClick(this.ui.btn_reg, this.regUser);
  23125. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23126. }
  23127. show() {
  23128. super.show();
  23129. this.x = (Laya.stage.width - this.width) / 2;
  23130. this.y = (Laya.stage.height - this.height) / 2;
  23131. }
  23132. closeSelf() {
  23133. this.hide();
  23134. }
  23135. regUser() {
  23136. this.ui.lab_tip.visible = false;
  23137. let ua = this.ui.txt_ua.text;
  23138. let up1 = this.ui.txt_up1.text;
  23139. let up2 = this.ui.txt_up2.text;
  23140. if (ua && up1 && up2 && up1 == up2) {
  23141. let reqData = JSON.stringify({
  23142. username: ua.trim(),
  23143. password: up1.trim(),
  23144. fromMark: 'app_game'
  23145. });
  23146. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23147. try {
  23148. console.log('zh:res = ' + JSON.stringify(res));
  23149. let code = res.code;
  23150. let msg = res.msg;
  23151. xGame.uiMgr.Show(UIMsg$1, msg);
  23152. if (code == 200) {
  23153. this.ui.lab_tip.color = "#FFFFFF";
  23154. xGame.uiMgr.Show(UIMsg$1, msg);
  23155. this.closeSelf();
  23156. }
  23157. else {
  23158. this.ui.lab_tip.color = "#FF0000";
  23159. xGame.uiMgr.Show(UIMsg$1, msg);
  23160. }
  23161. }
  23162. catch (error) {
  23163. console.log('error=' + error);
  23164. alert(error);
  23165. }
  23166. finally {
  23167. }
  23168. });
  23169. }
  23170. else {
  23171. if (up1 != up2) {
  23172. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23173. }
  23174. else {
  23175. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23176. }
  23177. }
  23178. }
  23179. gotoLogin() {
  23180. this.closeSelf();
  23181. xGame.uiMgr.Show(UILogin$1);
  23182. }
  23183. }
  23184. UIReg$1.uiName = "UIReg";
  23185. class UIFuli1$1 extends UIBase {
  23186. constructor() {
  23187. super();
  23188. }
  23189. onConstructor() {
  23190. this.ui = ui_UIFuli1.createInstance();
  23191. this.contentPane = this.ui;
  23192. this.isEject = false;
  23193. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23194. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23195. }
  23196. show() {
  23197. super.show();
  23198. this.x = (Laya.stage.width - this.width) / 2;
  23199. this.y = (Laya.stage.height - this.height) / 2;
  23200. }
  23201. closeSelf() {
  23202. this.hide();
  23203. }
  23204. gotoBuy() {
  23205. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23206. if (userInfo == null) {
  23207. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23208. return;
  23209. }
  23210. let reqData = xGame.httpMgr.getReqData();
  23211. let pd = JSON.parse(reqData);
  23212. pd.productId = 1;
  23213. reqData = JSON.stringify(pd);
  23214. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23215. try {
  23216. console.log('zh:buySp res = ' + JSON.stringify(res));
  23217. let code = res.code;
  23218. let msg = res.msg;
  23219. if (code == 401) {
  23220. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23221. alert(TIP_MSG_key.loginTimeOut);
  23222. xGame.uiMgr.Show(UIMsg$1, msg);
  23223. return;
  23224. }
  23225. if (code == 200) {
  23226. xGame.uiMgr.Show(UIMsg$1, msg);
  23227. DataMgr.getUserZiChanInfo();
  23228. this.closeSelf();
  23229. }
  23230. else {
  23231. xGame.uiMgr.Show(UIMsg$1, msg);
  23232. }
  23233. }
  23234. catch (error) {
  23235. console.log('error=' + error);
  23236. alert(error);
  23237. }
  23238. finally {
  23239. }
  23240. });
  23241. }
  23242. }
  23243. UIFuli1$1.uiName = "UIFuli1";
  23244. class UIFuli2$1 extends UIBase {
  23245. constructor() {
  23246. super();
  23247. }
  23248. onConstructor() {
  23249. this.ui = ui_UIFuli2.createInstance();
  23250. this.contentPane = this.ui;
  23251. this.isEject = false;
  23252. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  23253. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  23254. }
  23255. show() {
  23256. super.show();
  23257. this.x = (Laya.stage.width - this.width) / 2;
  23258. this.y = (Laya.stage.height - this.height) / 2;
  23259. }
  23260. closeSelf() {
  23261. this.hide();
  23262. }
  23263. gotoBuy() {
  23264. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23265. if (userInfo == null) {
  23266. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23267. return;
  23268. }
  23269. let reqData = xGame.httpMgr.getReqData();
  23270. let pd = JSON.parse(reqData);
  23271. pd.productId = 2;
  23272. reqData = JSON.stringify(pd);
  23273. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23274. try {
  23275. console.log('zh:buySp res = ' + JSON.stringify(res));
  23276. let code = res.code;
  23277. let msg = res.msg;
  23278. if (code == 401) {
  23279. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23280. alert(TIP_MSG_key.loginTimeOut);
  23281. xGame.uiMgr.Show(UIMsg$1, msg);
  23282. return;
  23283. }
  23284. if (code == 200) {
  23285. xGame.uiMgr.Show(UIMsg$1, msg);
  23286. DataMgr.getUserZiChanInfo();
  23287. this.closeSelf();
  23288. }
  23289. else {
  23290. xGame.uiMgr.Show(UIMsg$1, msg);
  23291. }
  23292. }
  23293. catch (error) {
  23294. console.log('error=' + error);
  23295. alert(error);
  23296. }
  23297. finally {
  23298. }
  23299. });
  23300. }
  23301. }
  23302. UIFuli2$1.uiName = "UIFuli2";
  23303. class UITry$1 extends UIBase {
  23304. constructor() {
  23305. super();
  23306. this.closeTime = 0;
  23307. this.closeNum = 0;
  23308. this.skillUrl = xGame.common.skillIconList;
  23309. }
  23310. onConstructor() {
  23311. this.ui = ui_UITry.createInstance();
  23312. this.contentPane = this.ui;
  23313. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23314. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23315. }
  23316. show() {
  23317. super.show();
  23318. this.closeNum = 0;
  23319. this.closeTime = 15;
  23320. this.ui.t0.play();
  23321. PlatMgr.showRateBanner();
  23322. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23323. Laya.timer.loop(1000, this, this.updateTime);
  23324. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23325. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23326. xGame.common.gameMgr.gamePause = true;
  23327. }
  23328. updateTime() {
  23329. if (this.closeTime > 1) {
  23330. this.closeTime--;
  23331. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23332. }
  23333. else
  23334. this.hide();
  23335. }
  23336. hide() {
  23337. Laya.timer.clearAll(this);
  23338. Moyu.showBannerAd(false);
  23339. super.hide();
  23340. xGame.common.gameMgr.gamePause = false;
  23341. }
  23342. onTry() {
  23343. console.log('zh:qjff_AD_for_uitry');
  23344. if (Laya.Browser.onAndroid) {
  23345. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23346. if (!boo) {
  23347. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23348. return;
  23349. }
  23350. }
  23351. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23352. }
  23353. else {
  23354. console.log('zh:AD 失败,直接发放奖励');
  23355. this.qjff_AD_for_uitry();
  23356. }
  23357. }
  23358. qjff_AD_for_uitry() {
  23359. let select = xGame.common.curPlayerSkillType;
  23360. DataMgr.gameData.trySkill = select;
  23361. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23362. DataMgr.saveGameData();
  23363. DataMgr.setBigSkill(select, 1);
  23364. xGame.showTip("Trial Successful");
  23365. this.hide();
  23366. }
  23367. onCancel() {
  23368. if (this.closeNum > 0) {
  23369. this.closeNum--;
  23370. if (this.closeNum < 2)
  23371. this.hide();
  23372. return;
  23373. }
  23374. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23375. this.onTry();
  23376. }
  23377. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23378. this.closeNum = 3;
  23379. }
  23380. else
  23381. this.hide();
  23382. }
  23383. }
  23384. UITry$1.uiName = "UITry";
  23385. class UIGetAward$1 extends UIBase {
  23386. constructor() {
  23387. super();
  23388. this.showTriple = true;
  23389. }
  23390. onConstructor() {
  23391. this.ui = ui_UIGetAward.createInstance();
  23392. this.contentPane = this.ui;
  23393. this.isEject = false;
  23394. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23395. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23396. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23397. }
  23398. show(arr, showTriple, callback) {
  23399. super.show();
  23400. this.ui.t0.play();
  23401. this.ui.eftNode.visible = true;
  23402. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23403. this.ui.eftNode.visible = false;
  23404. }), 1, 0, 0, 0.9);
  23405. this.awardArr = arr;
  23406. this.showTriple = showTriple;
  23407. this.callback = callback;
  23408. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23409. this.ui.myList.numItems = arr.length;
  23410. xGame.soundMgr.playSound("getaward");
  23411. }
  23412. updateSelf(index, obj) {
  23413. let temp = this.awardArr[index];
  23414. let icon = this.getIcon(temp.type);
  23415. let str = icon;
  23416. if (temp.type > 2) {
  23417. str = "s" + icon;
  23418. }
  23419. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23420. obj.myIcon.rotation = 0;
  23421. obj.numTxt.text = temp.num + "";
  23422. obj.numTxt.visible = temp.type > 2 ? false : true;
  23423. obj.nameTxt.text = this.getNameStr(temp.type);
  23424. }
  23425. renderItem(index, obj) {
  23426. this.updateSelf(index, obj);
  23427. }
  23428. tripleGetAward() {
  23429. console.log('zh:qjff_AD_for_uigetAward');
  23430. if (Laya.Browser.onAndroid) {
  23431. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23432. if (!boo) {
  23433. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23434. return;
  23435. }
  23436. }
  23437. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23438. }
  23439. else {
  23440. console.log('zh:AD 失败,直接发放奖励');
  23441. this.qjff_AD_for_uigetAward();
  23442. }
  23443. }
  23444. qjff_AD_for_uigetAward() {
  23445. this.getAward(3);
  23446. }
  23447. normalGetAward() {
  23448. if (PlatMgr.isMisVideo())
  23449. this.tripleGetAward();
  23450. else
  23451. this.getAward();
  23452. }
  23453. getAward(times = 1) {
  23454. this.hide();
  23455. for (let index = 0; index < this.awardArr.length; index++) {
  23456. this.awardArr[index].num *= times;
  23457. }
  23458. this.callback && this.callback(times != 1);
  23459. }
  23460. getIcon(type) {
  23461. switch (type) {
  23462. case Prop.diamond:
  23463. return "ty_zs";
  23464. case Prop.coin:
  23465. return "ty_jb";
  23466. case Prop.gan1:
  23467. return "qg1";
  23468. case Prop.gan2:
  23469. return "qg2";
  23470. case Prop.gan3:
  23471. return "qg3";
  23472. case Prop.gan4:
  23473. return "qg4";
  23474. default:
  23475. break;
  23476. }
  23477. }
  23478. getNameStr(type) {
  23479. switch (type) {
  23480. case Prop.diamond:
  23481. return "Diamond";
  23482. case Prop.coin:
  23483. return "Coins";
  23484. case Prop.gan1:
  23485. case Prop.gan2:
  23486. case Prop.gan3:
  23487. case Prop.gan4:
  23488. return cfgTable.ballrodData[type - 1].name;
  23489. default:
  23490. break;
  23491. }
  23492. }
  23493. }
  23494. UIGetAward$1.uiName = "UIGetAward";
  23495. class UIBox$1 extends UIBase {
  23496. constructor() {
  23497. super();
  23498. this.boxNum = 0;
  23499. this.boxMax = 10;
  23500. this.inAd = false;
  23501. this.isClose = false;
  23502. }
  23503. onConstructor() {
  23504. this.ui = ui_UIBox.createInstance();
  23505. this.contentPane = this.ui;
  23506. this.isEject = false;
  23507. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  23508. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  23509. Laya.timer.loop(1000, this, this.update);
  23510. }
  23511. update() {
  23512. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  23513. this.boxNum -= 1;
  23514. this.upBar();
  23515. }
  23516. }
  23517. upBar() {
  23518. if (this.boxNum > this.boxMax)
  23519. this.boxNum = this.boxMax;
  23520. this.ui.bar.value = this.boxNum * 10;
  23521. }
  23522. show() {
  23523. super.show();
  23524. this.isClose = false;
  23525. this.boxNum = 0;
  23526. this.inAd = false;
  23527. this.upBar();
  23528. this.ui.t0.play();
  23529. this.ui.closeBtn.visible = false;
  23530. Laya.timer.once(3000, this, () => {
  23531. this.ui.closeBtn.visible = true;
  23532. this.ui.bar.alpha = 1;
  23533. });
  23534. Laya.timer.once(500, this, () => {
  23535. this.ui.t1.play();
  23536. });
  23537. }
  23538. hide() {
  23539. Laya.timer.clearAll(this);
  23540. Moyu.showBannerAd(false);
  23541. super.hide();
  23542. }
  23543. onOpenBox() {
  23544. this.boxNum++;
  23545. if (this.boxNum < this.boxMax) {
  23546. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  23547. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  23548. }
  23549. }
  23550. else if (this.boxNum == this.boxMax) {
  23551. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  23552. this.ui.openBtn.c1.selectedIndex = 13;
  23553. this.inAd = true;
  23554. }
  23555. else
  23556. this.getAward();
  23557. }
  23558. else if (this.inAd) {
  23559. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  23560. if (Laya.Browser.onAndroid) {
  23561. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23562. if (!boo) {
  23563. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23564. return;
  23565. }
  23566. }
  23567. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  23568. }
  23569. else {
  23570. console.log('zh:AD 失败,直接发放奖励');
  23571. this.qjff_AD_for_UIBOX_onOpenBox();
  23572. }
  23573. }
  23574. this.upBar();
  23575. }
  23576. qjff_AD_for_UIBOX_onOpenBox() {
  23577. this.getAward();
  23578. }
  23579. onCloseBox() {
  23580. if (this.isClose)
  23581. this.hide();
  23582. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  23583. this.isClose = true;
  23584. PlatMgr.showBanner(true, 0, 3000);
  23585. }
  23586. else
  23587. this.hide();
  23588. }
  23589. getAward() {
  23590. let str = "";
  23591. if (Math.random() < 0.5) {
  23592. let max = Moyu.isLegal ? 500 : 2500;
  23593. let num = xGame.tools.random(max, 500 + max);
  23594. DataMgr.setCoin(num);
  23595. str = "金币x" + num;
  23596. }
  23597. else {
  23598. let max = Moyu.isLegal ? 10 : 30;
  23599. let num = xGame.tools.random(max, 30 + max);
  23600. DataMgr.setDiamond(num);
  23601. str = "钻石x" + num;
  23602. }
  23603. xGame.showTip("恭喜获得-" + str);
  23604. this.hide();
  23605. }
  23606. }
  23607. UIBox$1.uiName = "UIBox";
  23608. class UIMain$1 extends UIBase {
  23609. constructor() {
  23610. super();
  23611. this.firstEnter = true;
  23612. }
  23613. nativeCallJs(msg) {
  23614. let t = msg;
  23615. console.log("zh: nativeCallJs 奖励开始发放:", t);
  23616. switch (t) {
  23617. case 'qjff_chouJiang':
  23618. let dui = xGame.uiMgr.getUI(UIDraw$1);
  23619. dui.qjff_chouJiang();
  23620. break;
  23621. case 'qjff_AD_for_uisign':
  23622. let dui2 = xGame.uiMgr.getUI(UISign$1);
  23623. dui2.qjff_AD_for_uisign();
  23624. break;
  23625. case 'qjff_AD_for_uitry':
  23626. let dui3 = xGame.uiMgr.getUI(UITry$1);
  23627. dui3.qjff_AD_for_uitry();
  23628. break;
  23629. case 'qjff_AD_for_uipower':
  23630. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  23631. dui4.qjff_AD_for_uipower();
  23632. break;
  23633. case 'qjff_AD_for_uigetAward':
  23634. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  23635. dui5.qjff_AD_for_uigetAward();
  23636. break;
  23637. case 'qjff_AD_for_uiGameEnd':
  23638. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  23639. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  23640. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  23641. break;
  23642. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  23643. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  23644. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  23645. break;
  23646. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  23647. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  23648. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  23649. break;
  23650. case 'qjff_AD_for_UIrepentProp_videoRegret':
  23651. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  23652. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  23653. break;
  23654. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  23655. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  23656. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  23657. break;
  23658. case 'qjff_AD_for_UIBOX_onOpenBox':
  23659. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  23660. dui11.qjff_AD_for_UIBOX_onOpenBox();
  23661. break;
  23662. case 'qjff_AD_for_UIAddCoin':
  23663. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  23664. dui12.qjff_AD_for_UIAddCoin();
  23665. break;
  23666. case '111a':
  23667. let dui14 = xGame.uiMgr.getUI(UISign$1);
  23668. dui14.qjff_AD_for_uisign();
  23669. break;
  23670. case '222a':
  23671. let dui15 = xGame.uiMgr.getUI(UISign$1);
  23672. dui15.qjff_AD_for_uisign();
  23673. break;
  23674. case '333a':
  23675. let dui16 = xGame.uiMgr.getUI(UISign$1);
  23676. dui16.qjff_AD_for_uisign();
  23677. break;
  23678. default:
  23679. console.log('zh:未知的方法名字' + t);
  23680. break;
  23681. }
  23682. }
  23683. onConstructor() {
  23684. console.log('zh: UIMain onConstructor');
  23685. this.ui = ui_UIMain.createInstance();
  23686. this.contentPane = this.ui;
  23687. this.isEject = false;
  23688. this.addEvent();
  23689. this.addClickSpine();
  23690. this.settingNode = new SettingNode$1(this.ui.settingNode);
  23691. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23692. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  23693. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  23694. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  23695. let curUse = DataMgr.getCurSecretary();
  23696. this.changeSecretary(curUse);
  23697. this.ui.talkNode.visible = false;
  23698. let guide = DataMgr.getSkillGuide();
  23699. if (xGame.common.isNewDay && guide == 1) {
  23700. xGame.common.isNewDay = false;
  23701. xGame.soundMgr.playSound("s_main01");
  23702. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23703. console.log("zh:播放小秘书每天语音");
  23704. }
  23705. this.onGetUserInfo();
  23706. DataMgr.getUserZiChanInfo();
  23707. this.ui.n83.visible = false;
  23708. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23709. const d = LocalStorageManager.getItem(keyForLoginInfo);
  23710. let ua = d.username;
  23711. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  23712. }
  23713. this.c_btn_for_user();
  23714. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  23715. }
  23716. Logout() {
  23717. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23718. LocalStorageManager.removeItem(keyForLoginInfo);
  23719. this.freshUser();
  23720. }
  23721. }
  23722. gotoLogin() {
  23723. xGame.uiMgr.Show(UILogin$1);
  23724. }
  23725. gotoRegUser() {
  23726. xGame.uiMgr.Show(UIReg$1);
  23727. }
  23728. showFuLi() {
  23729. console.log('zh:福利2');
  23730. xGame.uiMgr.Show(UIFuli1$1);
  23731. xGame.uiMgr.Show(UIFuli2$1);
  23732. console.log('zh:福利2222');
  23733. }
  23734. c_btn_for_user() {
  23735. this.ui.n_Logout.visible = false;
  23736. this.ui.n_dengLu.visible = false;
  23737. this.ui.n_zhuCe.visible = false;
  23738. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  23739. this.ui.n_Logout.visible = true;
  23740. }
  23741. else {
  23742. this.ui.n_dengLu.visible = true;
  23743. }
  23744. }
  23745. changeSecretary(curUse) {
  23746. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  23747. xGame.common.secretary && xGame.common.secretary.dispose();
  23748. this.addSecretarySpine(name);
  23749. }
  23750. addSecretarySpine(name) {
  23751. let spine = new SpineMgr(name, () => {
  23752. this.playSecretaryIdle();
  23753. });
  23754. xGame.common.secretary = spine;
  23755. }
  23756. addClickSpine() {
  23757. let clickSpine = new SpineMgr("dianji", () => {
  23758. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  23759. let parent = Laya.stage;
  23760. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  23761. clickSpine.play(data, 0, false, parent, (spine) => {
  23762. spine.destroy(true);
  23763. });
  23764. });
  23765. });
  23766. }
  23767. addEvent() {
  23768. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  23769. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  23770. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  23771. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  23772. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  23773. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  23774. this.addUIClick(this.ui, this.interuptSecretary);
  23775. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  23776. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  23777. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  23778. this.addUIClick(this.ui.shopBtn, this.openShopView);
  23779. this.addUIClick(this.ui.signBtn, this.openSignView);
  23780. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  23781. this.addUIClick(this.ui.rankBtn, this.openRanking);
  23782. this.addUIClick(this.ui.n_Logout, this.Logout);
  23783. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  23784. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  23785. this.addUIClick(this.ui.n_fuli, this.showFuLi);
  23786. }
  23787. show(showFailWords) {
  23788. super.show();
  23789. this.moneyNode.ui.c1.selectedIndex = 1;
  23790. this.playSecretaryIdle();
  23791. xGame.soundMgr.playMusic("caromhall01", 0);
  23792. Laya.timer.clearAll(this);
  23793. this.playSecretaryRandomSound();
  23794. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  23795. if (showFailWords) {
  23796. console.log('zh:uimain.ts ');
  23797. setTimeout(() => {
  23798. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  23799. let words = -1;
  23800. if (str == "s_main02") {
  23801. words = 2;
  23802. }
  23803. else {
  23804. words = 3;
  23805. }
  23806. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23807. xGame.soundMgr.playSound(str);
  23808. }, 300);
  23809. }
  23810. this.showGuide();
  23811. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  23812. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  23813. let guide = DataMgr.getSkillGuide();
  23814. if (guide == 1) {
  23815. let randTime = xGame.common.randomNum(300, 800);
  23816. if (this.firstEnter) {
  23817. console.log("zh: firstEnter");
  23818. this.firstEnter = false;
  23819. randTime += 900;
  23820. }
  23821. else {
  23822. console.log("zh: no firstEnter");
  23823. }
  23824. Laya.timer.once(randTime, this, () => {
  23825. xGame.common.autoPopUIView();
  23826. });
  23827. }
  23828. }
  23829. checkActive(show) {
  23830. }
  23831. showGuide() {
  23832. let guide = DataMgr.getSkillGuide();
  23833. this.ui.guideBtn.visible = guide == 0;
  23834. this.ui.enterGuide.visible = false;
  23835. this.ui.secretaryGuide.visible = guide == 0;
  23836. if (guide == 0) {
  23837. console.log("zh:显示引导");
  23838. xGame.soundMgr.playSound("s_guide");
  23839. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23840. }
  23841. else {
  23842. console.log("zh:不需要显示引导");
  23843. }
  23844. }
  23845. ensureSecretary() {
  23846. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  23847. this.ui.secretaryGuide.visible = false;
  23848. this.ui.enterGuide.visible = true;
  23849. this.ui.wordsNode.t0.play();
  23850. if (DataMgr.getNewUser())
  23851. Moyu.sendDataEvent("gameReady");
  23852. }
  23853. playSecretaryIdle() {
  23854. let parent = this.ui.secretary.displayObject;
  23855. parent.destroyChildren();
  23856. let xx = this.ui.secretary.width / 2;
  23857. let yy = this.ui.secretary.height;
  23858. let scale = xGame.common.getSecretaryScale();
  23859. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23860. xGame.common.secretary.play(data, 0, true, parent);
  23861. }
  23862. startGame(type) {
  23863. if (!this.isReadyForLoadNetSource()) {
  23864. return;
  23865. }
  23866. xGame.common.gameMode = type;
  23867. Moyu.sendDataEvent("PlayGame", { type: type });
  23868. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  23869. switch (xGame.common.gameMode) {
  23870. case GameMode.classic:
  23871. console.log('zh:进入经典模式111111111');
  23872. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  23873. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23874. console.log('zh:classic db_over_lev=', db_over_lev);
  23875. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  23876. console.log('zh:判断是否可以玩该模式classic =NO');
  23877. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  23878. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23879. return;
  23880. }
  23881. else {
  23882. console.log('zh:可以玩该模式classic 66666666666666');
  23883. this.beginGame();
  23884. }
  23885. }
  23886. else {
  23887. console.log('zh:不需要判断是否可以玩该classic');
  23888. let challengeTimes = DataMgr.getChallengeTimes();
  23889. if (challengeTimes == 0) {
  23890. xGame.uiMgr.Show(UIInvitation$1);
  23891. }
  23892. else {
  23893. this.beginGame();
  23894. }
  23895. break;
  23896. }
  23897. case GameMode.bigMove:
  23898. console.error('zh:bigMove check');
  23899. let guide = DataMgr.getSkillGuide();
  23900. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  23901. let db_over_lev = DataMgr.getChallengeMode_overLev();
  23902. console.log('zh:bigMove db_over_lev=', db_over_lev);
  23903. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  23904. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  23905. xGame.uiMgr.Show(UIMsg$1, tipStr);
  23906. return;
  23907. }
  23908. else {
  23909. console.log('zh:可以玩该模式 bigMove');
  23910. this.beginGame();
  23911. if (DataMgr.getNewUser())
  23912. Moyu.sendDataEvent("gameStart0");
  23913. }
  23914. }
  23915. else {
  23916. this.beginGame();
  23917. if (DataMgr.getNewUser())
  23918. Moyu.sendDataEvent("gameStart0");
  23919. }
  23920. break;
  23921. default:
  23922. console.error('zh:未知错误!!!!');
  23923. break;
  23924. }
  23925. }
  23926. beginGame(isNice = false) {
  23927. console.log('zh:beginGame ');
  23928. let guide = DataMgr.getSkillGuide();
  23929. if (guide == 1) {
  23930. console.log('zh:非新手引导,showInternAd ');
  23931. JSBridgeUtils.instance.showInternAd('beginGame');
  23932. }
  23933. else {
  23934. console.log('zh:新手引导,不显示AD ');
  23935. }
  23936. console.log('zh:beginGame 2 go');
  23937. if (xGame.common.gameMode == GameMode.classic) {
  23938. if (isNice) {
  23939. this.enterClassic();
  23940. }
  23941. else {
  23942. xGame.uiMgr.Show(UIModeSelection$1, () => {
  23943. console.log('zh:BBBBBBBBBBBBBBB');
  23944. this.enterClassic();
  23945. });
  23946. }
  23947. }
  23948. else if (xGame.common.gameMode == GameMode.bigMove) {
  23949. this.ui.enterGuide.visible = false;
  23950. xGame.uiMgr.Show(UISkill$1);
  23951. }
  23952. }
  23953. enterClassic() {
  23954. xGame.uiMgr.Show(UIGame$1);
  23955. xGame.uiMgr.Show(UIMatching$1, () => {
  23956. if (!this.isHide)
  23957. this.hide();
  23958. xGame.common.gameUI.ui.alpha = 1;
  23959. xGame.common.gameUI.startGame();
  23960. xGame.uiMgr.Hide(UIGameEnd$1);
  23961. });
  23962. }
  23963. startGlobal() {
  23964. xGame.uiMgr.Show(UIMsg$1, "Coming Soon111");
  23965. JSBridgeUtils.instance.testPay();
  23966. }
  23967. startWeekly() {
  23968. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  23969. }
  23970. zhouSaiMonth() {
  23971. console.log('zh: zhouSaiMonth 被调用');
  23972. }
  23973. isReadyForLoadNetSource() {
  23974. let reqCount = xGame.cfgMgr.httpReqCount;
  23975. let ok = xGame.cfgMgr.httpReqOkCount;
  23976. if (reqCount > ok) {
  23977. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  23978. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  23979. Laya.timer.once(5000, this, () => {
  23980. let retryCount = 0;
  23981. const maxRetries = 3;
  23982. const tryFetchConfig = () => {
  23983. try {
  23984. xGame.cfgMgr.getConfigFromServer();
  23985. }
  23986. catch (error) {
  23987. if (retryCount < maxRetries) {
  23988. retryCount++;
  23989. console.log(`🔄 第${retryCount}次重试获取配置...`);
  23990. Laya.timer.once(5000, this, tryFetchConfig);
  23991. }
  23992. else {
  23993. console.error("❌ 达到最大重试次数,配置获取失败");
  23994. }
  23995. }
  23996. };
  23997. tryFetchConfig();
  23998. });
  23999. return false;
  24000. }
  24001. return true;
  24002. }
  24003. startPlaceBall() {
  24004. if (!this.isReadyForLoadNetSource()) {
  24005. return;
  24006. }
  24007. xGame.uiMgr.Show(UILevelDisplay$1);
  24008. }
  24009. hide() {
  24010. console.log('zh:uimain hide ...');
  24011. super.hide();
  24012. xGame.common.stopGirlPop(this.ui.talkNode);
  24013. }
  24014. onGetUserInfo(force = false) {
  24015. if (Moyu.isWx) {
  24016. let info = Moyu.getSystemInfo();
  24017. if (info)
  24018. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24019. }
  24020. else {
  24021. Moyu.initUser(this, this.freshUser, force);
  24022. }
  24023. this.freshUser();
  24024. }
  24025. freshUser() {
  24026. let user = Moyu.getUserInfo();
  24027. if (!user.isAuth) {
  24028. user.headIcon = 'res/ty_touxiang.png';
  24029. }
  24030. else {
  24031. DataMgr.upRankData();
  24032. }
  24033. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24034. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24035. let keyStr = keyForLoginInfo;
  24036. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24037. const d = LocalStorageManager.getItem(keyStr);
  24038. let ua = d.username;
  24039. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24040. }
  24041. else {
  24042. }
  24043. this.c_btn_for_user();
  24044. }
  24045. interuptSecretary() {
  24046. Laya.timer.clearAll(this);
  24047. this.playSecretaryRandomSound();
  24048. }
  24049. playSecretaryRandomSound() {
  24050. if (this.isHide)
  24051. return;
  24052. let time = xGame.common.randomNum(45000, 60000);
  24053. Laya.timer.once(time, this, () => {
  24054. if (this.isHide)
  24055. return;
  24056. let index = xGame.common.randomNum(4, 7);
  24057. xGame.soundMgr.playSound("s_main0" + index);
  24058. let words = 1;
  24059. switch (index) {
  24060. case 4:
  24061. words = 5;
  24062. break;
  24063. case 5:
  24064. words = 3;
  24065. break;
  24066. case 6:
  24067. words = 6;
  24068. break;
  24069. case 7:
  24070. words = 7;
  24071. break;
  24072. default:
  24073. break;
  24074. }
  24075. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24076. this.playSecretaryRandomSound();
  24077. });
  24078. }
  24079. openSecretaryView() {
  24080. xGame.uiMgr.Show(UISecretary$1);
  24081. Moyu.sendDataEvent("secretary");
  24082. }
  24083. openShopView() {
  24084. xGame.uiMgr.Show(UIShop$1, 0);
  24085. }
  24086. openSignView() {
  24087. xGame.uiMgr.Show(UISign$1);
  24088. }
  24089. openDrawView() {
  24090. xGame.uiMgr.Show(UIDraw$1);
  24091. }
  24092. openRanking() {
  24093. console.log('zh:phb openRanking');
  24094. xGame.uiMgr.Show(UIRanking$1);
  24095. Moyu.sendDataEvent("rankingList");
  24096. }
  24097. }
  24098. UIMain$1.uiName = "UIMain";
  24099. function InitShader() {
  24100. }
  24101. function appInit() {
  24102. xGame.context.init(getLoadingResList(), initCallback);
  24103. }
  24104. function getLoadingResList() {
  24105. return [
  24106. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24107. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24108. ];
  24109. }
  24110. function getGameResList() {
  24111. return [
  24112. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24113. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24114. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24115. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24116. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24117. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24118. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24119. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24120. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24121. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24122. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24123. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24124. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24125. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24126. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24127. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24128. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24129. ];
  24130. }
  24131. function initCallback() {
  24132. window["DataMgr"] = DataMgr;
  24133. DataMgr.Init();
  24134. Moyu.init(getPlat(), this, () => {
  24135. DataMgr.isNewDay();
  24136. PlatMgr.initConfig();
  24137. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24138. }, true);
  24139. console.log('zh:开始sm init1 start');
  24140. xGame.soundMgr.init();
  24141. console.log('zh:开始sm init1 end');
  24142. xGame.uiMgr.init();
  24143. xGame.uiMgr.clearTempData();
  24144. xGame.uiMgr.bindFUI(fguiRes.loading);
  24145. xGame.uiMgr.Show(UILoading);
  24146. }
  24147. function loadSubRes(callback) {
  24148. var tab = ["asset", "res", "spine"];
  24149. let subDone = 0;
  24150. for (var i = 0; i < tab.length; i++) {
  24151. let sub = tab[i];
  24152. Moyu.loadSubRes(sub, (pro) => {
  24153. callback && callback(pro, false);
  24154. }).then(() => {
  24155. subDone++;
  24156. if (subDone >= tab.length)
  24157. callback && callback(1, true);
  24158. });
  24159. }
  24160. }
  24161. function enterGame() {
  24162. xGame.cfgMgr.init();
  24163. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24164. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24165. xGame.uiMgr.Hide(UILoading);
  24166. fgui.UIPackage.removePackage(fguiRes.loading);
  24167. xGame.uiMgr.bindFUI(fguiRes.game);
  24168. xGame.uiMgr.Show(UIMain$1);
  24169. if (DataMgr.getNewUser())
  24170. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24171. }
  24172. function getPlat() {
  24173. let cfg = new MoyuCfg();
  24174. cfg.plat = MoyuPlat.web;
  24175. cfg.myId = 180;
  24176. cfg.myKey = '8848a885774230a4';
  24177. cfg.version = 0;
  24178. if (window.hasOwnProperty("gamebox")) {
  24179. cfg.plat = MoyuPlat.f399;
  24180. cfg.version = 0;
  24181. }
  24182. else if (window.hasOwnProperty("ks")) {
  24183. cfg.plat = MoyuPlat.ks;
  24184. cfg.version = 0;
  24185. cfg.ads.ksVideoId = '2300002254_01';
  24186. cfg.ads.ksInsertId = '2300002254_02';
  24187. }
  24188. else if (Laya.Browser.onTTMiniGame) {
  24189. cfg.plat = MoyuPlat.tt;
  24190. cfg.version = 0;
  24191. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24192. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24193. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24194. }
  24195. else if (Laya.Browser.onMiniGame) {
  24196. cfg.plat = MoyuPlat.wx;
  24197. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24198. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24199. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24200. }
  24201. else if (Laya.Browser.onQQMiniGame) {
  24202. cfg.plat = MoyuPlat.qq;
  24203. }
  24204. else if (Laya.Browser.onQGMiniGame) {
  24205. cfg.plat = MoyuPlat.op;
  24206. cfg.ads.opVideoId = '455502';
  24207. cfg.ads.opBannerId = '455507';
  24208. }
  24209. else if (Laya.Browser.onVVMiniGame) {
  24210. cfg.plat = MoyuPlat.vv;
  24211. cfg.version = 0;
  24212. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24213. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24214. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24215. }
  24216. else if (Laya.Browser.onHWMiniGame) {
  24217. cfg.plat = MoyuPlat.hw;
  24218. }
  24219. else if (window["mz"]) {
  24220. cfg.plat = MoyuPlat.mz;
  24221. }
  24222. else {
  24223. let cfg = window['conchConfig'];
  24224. if (cfg) {
  24225. var os = cfg.getOS();
  24226. if (os == "Conch-ios") {
  24227. cfg.plat = MoyuPlat.ios;
  24228. }
  24229. else if (os == "Conch-android") {
  24230. }
  24231. }
  24232. }
  24233. return cfg;
  24234. }
  24235. class Main {
  24236. constructor() {
  24237. if (window["Laya3D"])
  24238. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24239. else {
  24240. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  24241. this.initMain();
  24242. }
  24243. }
  24244. initMain() {
  24245. Laya["Physics"] && Laya["Physics"].enable();
  24246. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  24247. Laya.stage.scaleMode = GameConfig.scaleMode;
  24248. Laya.stage.screenMode = GameConfig.screenMode;
  24249. Laya.stage.alignV = GameConfig.alignV;
  24250. Laya.stage.alignH = GameConfig.alignH;
  24251. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  24252. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  24253. Laya.enableDebugPanel();
  24254. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  24255. Laya["PhysicsDebugDraw"].enable();
  24256. if (GameConfig.stat)
  24257. Laya.Stat.show();
  24258. Laya.alertGlobalError(true);
  24259. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  24260. }
  24261. onVersionLoaded() {
  24262. appInit();
  24263. }
  24264. }
  24265. new Main();
  24266. }());
  24267. //# sourceMappingURL=bundle.js.map