bundle.js 976 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429
  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 LOGIN_OUT = "LOGIN_OUT";
  52. let LOGIN_IN = "LOGIN_IN";
  53. let keyForLoginInfo = "userInfo";
  54. let TIP_MSG_key = {
  55. loginTimeOut: "Login timed out, please log in again.",
  56. pleaseLoginIn: "Please log in."
  57. };
  58. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  59. let poolKey = {
  60. inHoleEft: "inHoleEft",
  61. d3ball: "d3ball",
  62. iceEft: "iceEft",
  63. hitEft: "hitEft",
  64. fireworksEft: "fireworksEft",
  65. };
  66. var GameMode;
  67. (function (GameMode) {
  68. GameMode[GameMode["classic"] = 0] = "classic";
  69. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  70. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  71. })(GameMode || (GameMode = {}));
  72. var SkillType;
  73. (function (SkillType) {
  74. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  75. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  76. SkillType[SkillType["ice"] = 2] = "ice";
  77. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  78. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  79. })(SkillType || (SkillType = {}));
  80. var ClassicWordsType;
  81. (function (ClassicWordsType) {
  82. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  83. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  84. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  85. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  86. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  87. })(ClassicWordsType || (ClassicWordsType = {}));
  88. var PressType;
  89. (function (PressType) {
  90. PressType[PressType["powerNode"] = 0] = "powerNode";
  91. PressType[PressType["d2Root"] = 1] = "d2Root";
  92. PressType[PressType["moveNode"] = 2] = "moveNode";
  93. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  94. })(PressType || (PressType = {}));
  95. var PlaceBallType;
  96. (function (PlaceBallType) {
  97. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  98. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  99. })(PlaceBallType || (PlaceBallType = {}));
  100. var EAdType;
  101. (function (EAdType) {
  102. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  103. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  104. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  105. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  106. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  107. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  108. EAdType[EAdType["sign"] = 6] = "sign";
  109. EAdType[EAdType["draw"] = 7] = "draw";
  110. EAdType[EAdType["triple"] = 8] = "triple";
  111. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  112. EAdType[EAdType["getPower"] = 10] = "getPower";
  113. EAdType[EAdType["box"] = 11] = "box";
  114. EAdType[EAdType["try"] = 12] = "try";
  115. EAdType[EAdType["againSign"] = 13] = "againSign";
  116. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  117. })(EAdType || (EAdType = {}));
  118. var Prop;
  119. (function (Prop) {
  120. Prop[Prop["diamond"] = 1] = "diamond";
  121. Prop[Prop["coin"] = 2] = "coin";
  122. Prop[Prop["gan1"] = 3] = "gan1";
  123. Prop[Prop["gan2"] = 4] = "gan2";
  124. Prop[Prop["gan3"] = 5] = "gan3";
  125. Prop[Prop["gan4"] = 6] = "gan4";
  126. })(Prop || (Prop = {}));
  127. var TipsType;
  128. (function (TipsType) {
  129. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  130. TipsType[TipsType["foul"] = 1] = "foul";
  131. })(TipsType || (TipsType = {}));
  132. class AwardType {
  133. constructor(type, num) {
  134. this.type = type;
  135. this.num = num;
  136. }
  137. }
  138. var define = /*#__PURE__*/Object.freeze({
  139. fguiRes: fguiRes,
  140. ballCamp: ballCamp,
  141. FoulType: FoulType,
  142. ALL_BALL_STOP: ALL_BALL_STOP,
  143. WAIT_SHOOT: WAIT_SHOOT,
  144. D3RES_LOADED: D3RES_LOADED,
  145. BALL_SHOOT: BALL_SHOOT,
  146. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  147. RESET_GAME: RESET_GAME,
  148. COIN_CHANGE: COIN_CHANGE,
  149. DIAMOND_CHANGE: DIAMOND_CHANGE,
  150. RESTART_GAME: RESTART_GAME,
  151. GET_USER_INFO: GET_USER_INFO,
  152. CHANGE_SECRETARY: CHANGE_SECRETARY,
  153. POWER_CHANGE: POWER_CHANGE,
  154. POWER_TIME: POWER_TIME,
  155. LOGIN_OUT: LOGIN_OUT,
  156. LOGIN_IN: LOGIN_IN,
  157. keyForLoginInfo: keyForLoginInfo,
  158. TIP_MSG_key: TIP_MSG_key,
  159. baseHeadUrl: baseHeadUrl,
  160. poolKey: poolKey,
  161. get GameMode () { return GameMode; },
  162. get SkillType () { return SkillType; },
  163. get ClassicWordsType () { return ClassicWordsType; },
  164. get PressType () { return PressType; },
  165. get PlaceBallType () { return PlaceBallType; },
  166. get EAdType () { return EAdType; },
  167. get Prop () { return Prop; },
  168. get TipsType () { return TipsType; },
  169. AwardType: AwardType
  170. });
  171. class CContext {
  172. constructor() {
  173. this.winSize = { width: 0, height: 0 };
  174. this.notchHeight = 0;
  175. this.bannerHeight = 0;
  176. }
  177. init(resList, callback) {
  178. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  179. this.notchHeight = this.getNotchHeight();
  180. this.bannerHeight = this.getBannerHeight();
  181. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  182. callback && callback();
  183. }));
  184. }
  185. getNotchHeight() {
  186. let notchHeight = 50;
  187. if (Laya.Browser.onMiniGame) {
  188. let deviceInfo = wx.getSystemInfoSync();
  189. if (Laya.Browser.onIOS) {
  190. if (deviceInfo.model.search('iPhone X') != -1) {
  191. notchHeight = deviceInfo.statusBarHeight - 10;
  192. }
  193. else {
  194. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  195. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  196. notchHeight = deviceInfo.statusBarHeight - 10;
  197. }
  198. }
  199. }
  200. else if (Laya.Browser.onAndroid) {
  201. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  202. notchHeight = deviceInfo.statusBarHeight;
  203. }
  204. }
  205. }
  206. return notchHeight;
  207. }
  208. getBannerHeight() {
  209. return 0;
  210. }
  211. }
  212. let context = new CContext();
  213. var Handler = Laya.Handler;
  214. var Tween = Laya.Tween;
  215. function playClickEffect(btn) {
  216. if (!btn)
  217. return;
  218. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  219. if (!btn)
  220. return;
  221. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  222. if (!btn)
  223. return;
  224. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  225. }), 0, true);
  226. }), 0, true);
  227. }
  228. function getNumList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split(',');
  233. for (var v in array) {
  234. dataList.push(Number(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getStrList(strList) {
  240. let dataList = [];
  241. if (strList) {
  242. let list = strList;
  243. let array = list.split('|');
  244. for (var v in array) {
  245. dataList.push(String(array[v]));
  246. }
  247. }
  248. return dataList;
  249. }
  250. function getRandStr(len) {
  251. 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'];
  252. let str = "";
  253. for (let i = 0; i < len; i++) {
  254. let rand = random(0, list.length);
  255. str += list[rand];
  256. }
  257. return str;
  258. }
  259. function getUserId() {
  260. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  261. return str;
  262. }
  263. function formatPos(pos, len = 2) {
  264. let v = Math.pow(10, len);
  265. pos.x = Math.floor(pos.x * v) / v;
  266. pos.y = Math.floor(pos.y * v) / v;
  267. if (pos.z)
  268. pos.z = Math.floor(pos.z * v) / v;
  269. return pos;
  270. }
  271. function setPosInt(pos) {
  272. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  273. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  274. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  275. return pos;
  276. }
  277. function random(min, max) {
  278. var rang = max - min;
  279. var rand = Math.random() * rang;
  280. return Math.floor(rand) + min;
  281. }
  282. function randomList(list, num) {
  283. if (list.length <= num)
  284. return list;
  285. let arry = [];
  286. list.forEach(item => {
  287. arry.push(item);
  288. });
  289. let nums = [];
  290. for (let i = 0; i < num; i++) {
  291. let rand = random(0, arry.length);
  292. let v = arry[rand];
  293. nums.push(v);
  294. arry.splice(rand, 1);
  295. }
  296. return nums;
  297. }
  298. function worldToScreen(camera, point, pos) {
  299. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  300. pos.x = pos.x / Laya.stage.clientScaleX;
  301. pos.y = pos.y / Laya.stage.clientScaleY;
  302. }
  303. function getStringLenght(str) {
  304. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. function reviseString(str, len) {
  307. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. if (ld > len) {
  309. let sl = Math.floor(len / 2);
  310. let rs = str.substring(0, sl);
  311. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. while (d + 2 < len) {
  313. sl++;
  314. rs = str.substring(0, sl);
  315. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  316. }
  317. return rs + "...";
  318. }
  319. return str;
  320. }
  321. function getCoinString(coin) {
  322. if (coin < 10000)
  323. return coin.toString();
  324. else if (coin < 1000000) {
  325. let vh = Math.ceil(coin / 100);
  326. return (vh / 10) + "k";
  327. }
  328. else if (coin < 1000000000) {
  329. var vh = Math.ceil(coin / 100000);
  330. return (vh / 10) + "m";
  331. }
  332. else if (coin < 1000000000000) {
  333. var vh = Math.ceil(coin / 100000000);
  334. return (vh / 10) + "b";
  335. }
  336. else if (coin < 1000000000000000) {
  337. var vh = Math.ceil(coin / 100000000000);
  338. return (vh / 10) + "t";
  339. }
  340. }
  341. function getV3Dest(pos, dir, dis, dest) {
  342. dir.x *= dis;
  343. dir.y *= dis;
  344. dir.z *= dis;
  345. Laya.Vector3.add(pos, dir, dest);
  346. return dest;
  347. }
  348. function getV2Dest(x1, y1, dir, dis, dest) {
  349. dest.x = x1 + dir.x * dis;
  350. dest.y = y1 + dir.y * dis;
  351. return dest;
  352. }
  353. function getV2Dir(x1, y1, x2, y2, dir) {
  354. dir.x = x2 - x1;
  355. dir.y = y2 - y1;
  356. Laya.Vector2.normalize(dir, dir);
  357. return dir;
  358. }
  359. function getV3Dir(p1, p2, dir) {
  360. Laya.Vector3.subtract(p1, p2, dir);
  361. Laya.Vector3.normalize(dir, dir);
  362. return dir;
  363. }
  364. function copyPos(ip, op) {
  365. op.x = ip.x;
  366. op.y = ip.y;
  367. if (ip.z)
  368. op.z = ip.z;
  369. return op;
  370. }
  371. function getScreenImg() {
  372. let gl = Laya.WebGLContext.mainContext;
  373. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  374. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  375. let w = gl.drawingBufferWidth;
  376. let h = gl.drawingBufferHeight;
  377. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  378. texture2d.setPixels(pixels);
  379. return new Laya.Texture(texture2d);
  380. }
  381. function playMoveByPositions(sp, positions, v, completeCallback) {
  382. let p;
  383. let play = () => {
  384. if (positions.length == 0) {
  385. completeCallback();
  386. return;
  387. }
  388. p = positions[0];
  389. positions.splice(0, 1);
  390. 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, () => {
  391. play();
  392. }));
  393. };
  394. play();
  395. }
  396. function setStarPos(node, num, max) {
  397. for (let i = 1; i <= 5; i++) {
  398. let img = node.getChildAt(i - 1);
  399. img.width = img.height = 30;
  400. img.pivotX = img.pivotY = 0.5;
  401. img.gray = i > num;
  402. img.visible = i <= max;
  403. if (max == 3) {
  404. img.x = node.width / 2 + (i - 2) * 30 - 15;
  405. img.y = node.height - 40;
  406. if (i == 2)
  407. img.y = node.height - 30;
  408. }
  409. else if (max == 5) {
  410. let ly = Math.abs(i - 3);
  411. img.x = node.width / 2 + (i - 3) * 20 - 15;
  412. img.y = node.height - ly * 8 - 30;
  413. }
  414. }
  415. }
  416. function playLoopAnimRotate(sp, time, clockwise = true) {
  417. let rotation;
  418. sp.rotation = sp.rotation % 360;
  419. if (clockwise) {
  420. rotation = -360;
  421. }
  422. else {
  423. rotation = 360;
  424. }
  425. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  426. this.playLoopAnimRotate(sp, time, clockwise);
  427. }));
  428. }
  429. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  430. let x, y;
  431. if (isBig) {
  432. x = valueXMin;
  433. y = valueYMin;
  434. }
  435. else {
  436. x = valueXMax;
  437. y = valueYMax;
  438. }
  439. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  440. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  441. }));
  442. }
  443. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  444. let scale;
  445. if (isBig) {
  446. scale = valueMin;
  447. }
  448. else {
  449. scale = valueMax;
  450. }
  451. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  452. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  453. }));
  454. }
  455. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  456. let value;
  457. if (isBig) {
  458. value = valueMin;
  459. }
  460. else {
  461. value = valueMax;
  462. }
  463. if (count) {
  464. count--;
  465. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  466. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  467. }));
  468. }
  469. else {
  470. sp.rotation = 0;
  471. }
  472. }
  473. function inRect(rect, p) {
  474. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  475. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  476. return true;
  477. }
  478. }
  479. return false;
  480. }
  481. function getNumberK(number) {
  482. if (number < 1000) {
  483. return number.toString();
  484. }
  485. else {
  486. return (number / 1000).toFixed(1) + "k";
  487. }
  488. }
  489. function pointInsideCircle(point, circle, r) {
  490. if (r === 0)
  491. return false;
  492. var dx = circle.x - point.x;
  493. var dy = circle.y - point.y;
  494. return dx * dx + dy * dy <= r * r;
  495. }
  496. function formatString(str, data) {
  497. if (!str || data == undefined) {
  498. return str;
  499. }
  500. if (typeof data === "object") {
  501. for (var key in data) {
  502. if (data.hasOwnProperty(key)) {
  503. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  504. }
  505. }
  506. }
  507. else {
  508. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  509. return str.replace(reg, function (match, index) {
  510. return args[index - (-1)];
  511. });
  512. }
  513. return str;
  514. }
  515. function getIntersection(a, b) {
  516. let t = [];
  517. for (var i = 0; i < a.length; i++) {
  518. for (var j = 0; j < b.length; j++) {
  519. if (a[i] == b[j]) {
  520. t.push(a[i]);
  521. }
  522. }
  523. }
  524. return t;
  525. }
  526. function getComplement(a, b) {
  527. let t = [];
  528. let count = false;
  529. for (var i = 0; i < a.length; i++) {
  530. count = false;
  531. for (var j = 0; j < b.length; j++) {
  532. if (a[i] == b[j]) {
  533. count = true;
  534. break;
  535. }
  536. }
  537. if (!count) {
  538. t.push(a[i]);
  539. }
  540. }
  541. return t;
  542. }
  543. function geSpriteStageRect(sp) {
  544. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  545. let rect = {
  546. x: point.x,
  547. y: point.y,
  548. width: sp.width * sp.globalScaleX,
  549. height: sp.height * sp.globalScaleY
  550. };
  551. return rect;
  552. }
  553. function touchButton(button) {
  554. let event = new Laya.Event();
  555. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  556. }
  557. function setColor(sprite, r, g, b) {
  558. var redMat = [
  559. r / 255, 0, 0, 0, 0,
  560. g / 255, 0, 0, 0, 0,
  561. b / 255, 0, 0, 0, 0,
  562. 0, 0, 0, 1, 0,
  563. ];
  564. var filter = new Laya.ColorFilter(redMat);
  565. sprite.filters = [filter];
  566. }
  567. function clone(obj, newobj = {}) {
  568. for (var attr in obj) {
  569. if (typeof obj[attr] == "object") {
  570. newobj[attr] = clone(obj[attr], newobj[attr]);
  571. }
  572. else {
  573. newobj[attr] = obj[attr];
  574. }
  575. }
  576. return newobj;
  577. }
  578. function _ms(arr, compare, begin, end) {
  579. const size = end - begin;
  580. if (size <= 1) {
  581. return;
  582. }
  583. const middle = (end + begin) >> 1;
  584. _ms(arr, compare, begin, middle);
  585. _ms(arr, compare, middle, end);
  586. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  587. return;
  588. }
  589. const merged = [];
  590. let leftIndex = begin, rightIndex = middle;
  591. while (merged.length < size) {
  592. if (leftIndex === middle) {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. else if (rightIndex === end) {
  596. merged.push(arr[leftIndex++]);
  597. }
  598. else {
  599. const c = compare(arr[leftIndex], arr[rightIndex]);
  600. if (c <= 0) {
  601. merged.push(arr[leftIndex++]);
  602. }
  603. else {
  604. merged.push(arr[rightIndex++]);
  605. }
  606. }
  607. }
  608. arr.splice(begin, size, ...merged);
  609. }
  610. function sort(arr, compare) {
  611. if (!Array.isArray(arr)) {
  612. throw new Error('sort的参数必须为数组');
  613. }
  614. _ms(arr, compare, 0, arr.length);
  615. return arr;
  616. }
  617. function getLanguage(id) {
  618. }
  619. function getLanguageByTip(id) {
  620. }
  621. function toWeights(array) {
  622. let max = 0;
  623. for (var i = 0; i < array.length; i++) {
  624. max = max + array[i];
  625. if (array[i] == 0) {
  626. array[i] = 0;
  627. }
  628. else {
  629. array[i] = max;
  630. }
  631. }
  632. return array;
  633. }
  634. function unique(array) {
  635. var n = {}, r = [], len = array.length, val, type;
  636. for (var i = 0; i < array.length; i++) {
  637. val = array[i];
  638. type = typeof val;
  639. if (!n[val]) {
  640. n[val] = [type];
  641. r.push(val);
  642. }
  643. else if (n[val].indexOf(type) < 0) {
  644. n[val].push(type);
  645. r.push(val);
  646. }
  647. }
  648. return r;
  649. }
  650. function unique1(array) {
  651. var r = [];
  652. for (var i = 0, l = array.length; i < l; i++) {
  653. for (var j = i + 1; j < l; j++)
  654. if (array[i] == array[j])
  655. j == ++i;
  656. r.push(array[i]);
  657. }
  658. return r;
  659. }
  660. function getDistance(x1, y1, x2, y2) {
  661. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  662. }
  663. function getV2Dis(pos1, pos2) {
  664. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  665. }
  666. function getV2SqDis(pos1, pos2) {
  667. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  668. }
  669. function getDis(x1, y1, x2, y2) {
  670. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  671. }
  672. function getDeltaxy(x1, y1, x2, y2) {
  673. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  674. }
  675. function getSymbolNumber(num) {
  676. if (num > 0) {
  677. return "+" + num;
  678. }
  679. else if (num < 0) {
  680. return num.toString();
  681. }
  682. return num.toString();
  683. }
  684. function fixNumber(num, length) {
  685. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  686. }
  687. function toThousands(num) {
  688. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  689. }
  690. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  691. function fmtMoney(money) {
  692. money = toThousands(money.replace(/^0+/, ''));
  693. if (money.length == 0) {
  694. money = "0";
  695. }
  696. let unit = 0;
  697. for (var i = 0; i < money.length; i++) {
  698. if (money.charAt(i) == ",") {
  699. unit++;
  700. }
  701. }
  702. if (unit == 0) {
  703. return money;
  704. }
  705. else {
  706. let idx = money.indexOf(",");
  707. if (idx) {
  708. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  709. }
  710. return money.replace(",", ".");
  711. }
  712. }
  713. function flatten(arr) {
  714. while (arr.some(item => Array.isArray(item))) {
  715. arr = [].concat(...arr);
  716. }
  717. return arr;
  718. }
  719. function getDistanceByPoint(p1, p2) {
  720. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  721. }
  722. function getAngleByPoint(p1, p2) {
  723. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  724. }
  725. function toIntByArray(array) {
  726. for (var index = 0; index < array.length; index++) {
  727. array[index] = parseInt(array[index]);
  728. }
  729. return array;
  730. }
  731. function getAngle0To360(angle) {
  732. while (angle < 0) {
  733. angle += 360;
  734. }
  735. while (angle >= 360) {
  736. angle -= 360;
  737. }
  738. return angle;
  739. }
  740. function toAngle(radian) {
  741. return radian * 180 / Math.PI;
  742. }
  743. function toRadian(angle) {
  744. return angle * Math.PI / 180;
  745. }
  746. function getArrayValueRandom(array) {
  747. return array[random(0, array.length - 1)];
  748. }
  749. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  750. }
  751. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  752. }
  753. function fmtTimeMMSS(time) {
  754. if (time < 0) {
  755. time = 0;
  756. }
  757. else
  758. time = Math.floor(time);
  759. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  760. }
  761. function fmtTimeMS(time) {
  762. if (time < 0) {
  763. time = 0;
  764. }
  765. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  766. }
  767. function fmtTimeHHMM(time) {
  768. if (time < 0) {
  769. time = 0;
  770. }
  771. time = Math.floor(time / 1000);
  772. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  773. }
  774. let severTime = 0;
  775. function getServerTime() {
  776. return new Date(new Date().getTime() - severTime);
  777. }
  778. function setServerTime(data) {
  779. severTime = (new Date().getTime() - data);
  780. }
  781. var tools = /*#__PURE__*/Object.freeze({
  782. playClickEffect: playClickEffect,
  783. getNumList: getNumList,
  784. getStrList: getStrList,
  785. getRandStr: getRandStr,
  786. getUserId: getUserId,
  787. formatPos: formatPos,
  788. setPosInt: setPosInt,
  789. random: random,
  790. randomList: randomList,
  791. worldToScreen: worldToScreen,
  792. getStringLenght: getStringLenght,
  793. reviseString: reviseString,
  794. getCoinString: getCoinString,
  795. getV3Dest: getV3Dest,
  796. getV2Dest: getV2Dest,
  797. getV2Dir: getV2Dir,
  798. getV3Dir: getV3Dir,
  799. copyPos: copyPos,
  800. getScreenImg: getScreenImg,
  801. playMoveByPositions: playMoveByPositions,
  802. setStarPos: setStarPos,
  803. playLoopAnimRotate: playLoopAnimRotate,
  804. playLoopAnimPosition: playLoopAnimPosition,
  805. playLoopAnimScale: playLoopAnimScale,
  806. playLoopAnimRotation: playLoopAnimRotation,
  807. inRect: inRect,
  808. getNumberK: getNumberK,
  809. pointInsideCircle: pointInsideCircle,
  810. formatString: formatString,
  811. getIntersection: getIntersection,
  812. getComplement: getComplement,
  813. geSpriteStageRect: geSpriteStageRect,
  814. touchButton: touchButton,
  815. setColor: setColor,
  816. clone: clone,
  817. sort: sort,
  818. getLanguage: getLanguage,
  819. getLanguageByTip: getLanguageByTip,
  820. toWeights: toWeights,
  821. unique: unique,
  822. unique1: unique1,
  823. getDistance: getDistance,
  824. getV2Dis: getV2Dis,
  825. getV2SqDis: getV2SqDis,
  826. getDis: getDis,
  827. getDeltaxy: getDeltaxy,
  828. getSymbolNumber: getSymbolNumber,
  829. fixNumber: fixNumber,
  830. toThousands: toThousands,
  831. fmtMoney: fmtMoney,
  832. flatten: flatten,
  833. getDistanceByPoint: getDistanceByPoint,
  834. getAngleByPoint: getAngleByPoint,
  835. toIntByArray: toIntByArray,
  836. getAngle0To360: getAngle0To360,
  837. toAngle: toAngle,
  838. toRadian: toRadian,
  839. getArrayValueRandom: getArrayValueRandom,
  840. promptByTip: promptByTip,
  841. promptByErrorCode: promptByErrorCode,
  842. fmtTimeMMSS: fmtTimeMMSS,
  843. fmtTimeMS: fmtTimeMS,
  844. fmtTimeHHMM: fmtTimeHHMM,
  845. getServerTime: getServerTime,
  846. setServerTime: setServerTime
  847. });
  848. class HttpMgr {
  849. constructor() {
  850. this.isDev = false;
  851. HttpMgr._instance = this;
  852. }
  853. static getInstance() {
  854. if (!this._instance) {
  855. this._instance = new HttpMgr();
  856. }
  857. return this._instance;
  858. }
  859. sendPost(url, data, call) {
  860. let httpObj = new Laya.HttpRequest();
  861. httpObj.http.timeout = 5000;
  862. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  863. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  864. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  865. function errorHandler(error) {
  866. console.log("errorHandler:" + error);
  867. alert("Please check your network connection.");
  868. }
  869. function completeHandler(data) {
  870. if (data && data.length > 0) {
  871. let jsonData = JSON.parse(data);
  872. if (call)
  873. call(jsonData);
  874. }
  875. }
  876. }
  877. getReqData() {
  878. let reqData = JSON.stringify({
  879. gameName: "TQ",
  880. gameUserName: "zhangSan",
  881. isDev: this.isDev
  882. });
  883. return reqData;
  884. }
  885. sendPost2025(reqUrl, data, call) {
  886. let isDev = this.isDev;
  887. let urlTop = "https://api.kessongame.site/";
  888. let urlMid = urlTop + "prod-api/api/";
  889. if (isDev) {
  890. urlTop = "http://192.168.1.13:8090/";
  891. urlMid = urlTop + "api/";
  892. }
  893. let url = urlMid + reqUrl;
  894. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  895. if (isDev) {
  896. url = urlTop + reqUrl;
  897. }
  898. else {
  899. url = urlTop + "prod-api/" + reqUrl;
  900. }
  901. }
  902. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  903. if (reqUrl.indexOf("/api/game/") >= 0) {
  904. }
  905. const keyForLoginInfo = "userInfo";
  906. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  907. if (userInfoData != null) {
  908. try {
  909. let bb = JSON.parse(userInfoData);
  910. if (bb) {
  911. let token = bb.token;
  912. headers.push("Authorization");
  913. headers.push(`Bearer ${token}`);
  914. }
  915. }
  916. catch (e) {
  917. }
  918. }
  919. let httpObj = new Laya.HttpRequest();
  920. httpObj.http.timeout = 5000;
  921. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  922. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  923. httpObj.send(url, data, 'post', 'text', headers);
  924. console.log('zh: http url = ' + url);
  925. function errorHandler(error) {
  926. if (call) {
  927. call("{'msg':'Network exception','code':500}");
  928. }
  929. else {
  930. alert("Tip:Please check your network connection.");
  931. }
  932. }
  933. function completeHandler(data) {
  934. if (data && data.length > 0) {
  935. let jsonData = JSON.parse(data);
  936. if (call)
  937. call(jsonData);
  938. }
  939. }
  940. }
  941. sendGet(url, call) {
  942. let httpObj = new Laya.HttpRequest();
  943. httpObj.http.timeout = 5000;
  944. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  945. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  946. httpObj.send(url, '', 'get');
  947. function errorHandler(error) {
  948. console.log("errorHandler:" + error);
  949. }
  950. function completeHandler(data) {
  951. if (data && data.length > 0) {
  952. if (call)
  953. call(data);
  954. }
  955. }
  956. }
  957. }
  958. HttpMgr._instance = null;
  959. class LightShader extends Laya.Sprite {
  960. constructor() {
  961. super();
  962. this._time = 0;
  963. this._sin = 0;
  964. this.initShader();
  965. }
  966. initShader() {
  967. var vs = `
  968. #define FSHIGHPRECISION
  969. attribute vec4 posuv;
  970. uniform vec2 size;
  971. varying vec4 v_texcoord;
  972. void main() {
  973. vec4 pos = vec4(posuv.xy,0.,1.);
  974. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  975. gl_Position=pos1;
  976. v_texcoord.xy = posuv.xy;
  977. }
  978. `;
  979. var ps = `
  980. #define FSHIGHPRECISION
  981. precision highp float;
  982. varying vec4 v_texcoord;
  983. uniform vec2 size;
  984. uniform sampler2D texture;
  985. uniform float u_Time;
  986. void main() {
  987. vec4 color= texture2D(texture, v_texcoord.xy);
  988. float width = 0.2;
  989. float start = u_Time;
  990. float offset = 1.0;
  991. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  992. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  993. {
  994. color.r=1.1;
  995. color.g=1.1;
  996. color.b=1.1;
  997. gl_FragColor = color;
  998. } else {
  999. gl_FragColor = color;
  1000. }
  1001. }
  1002. `;
  1003. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1004. this.customRenderEnable = true;
  1005. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1006. }
  1007. customRender(context, x, y) {
  1008. this.onUpdate();
  1009. if (!this.texture)
  1010. return;
  1011. let xx = x - this.pivotX;
  1012. let yy = y - this.pivotY;
  1013. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1014. }
  1015. onUpdate() {
  1016. this._time += 2 * Laya.timer.delta * 0.001;
  1017. this._sin = Math.sin(this._time);
  1018. if (this._sin > 0.99) {
  1019. this._sin = 0;
  1020. this._time = 0;
  1021. }
  1022. this.shaderValue['u_Time'] = this._sin;
  1023. }
  1024. }
  1025. LightShader.DissolveSurfaceSaveName = 9997;
  1026. class UIBase extends fairygui.Window {
  1027. constructor() {
  1028. super();
  1029. this.isEject = true;
  1030. this.isHide = true;
  1031. this.showbanner = true;
  1032. this.className = "";
  1033. this.isMuti = false;
  1034. this.showbanner = false;
  1035. this.onConstructor();
  1036. }
  1037. checkActive(show) {
  1038. }
  1039. getUIName() {
  1040. return UIBase.uiName;
  1041. }
  1042. onConstructor() {
  1043. }
  1044. onInit() {
  1045. if (!!this.contentPane) {
  1046. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1047. }
  1048. this.setPivot(0.5, 0.5, false);
  1049. }
  1050. doShowAnimation() {
  1051. if (!this.isEject)
  1052. return;
  1053. super.doShowAnimation();
  1054. Laya.Tween.clearTween(this);
  1055. this.scaleX = this.scaleY = 0.8;
  1056. let tweenFunc1 = (func) => {
  1057. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1058. };
  1059. let tweenFunc2 = (func) => {
  1060. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1061. };
  1062. tweenFunc1(tweenFunc2);
  1063. }
  1064. show(...args) {
  1065. super.show();
  1066. this._openParam = args;
  1067. this.isHide = false;
  1068. xGame.uiMgr.checkUIState();
  1069. }
  1070. moveBannerButton() {
  1071. }
  1072. showBannerButton() {
  1073. this.bannerButton.visible = true;
  1074. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1075. this.bannerButton.touchable = true;
  1076. }));
  1077. }
  1078. hide() {
  1079. super.hide();
  1080. this.isHide = true;
  1081. xGame.uiMgr.checkUIState();
  1082. }
  1083. Dispose() {
  1084. super.dispose();
  1085. }
  1086. myUpdate(delay) {
  1087. }
  1088. refresh() { }
  1089. addUIClick(obj, func, arr = null) {
  1090. obj.onClick(this, func, arr);
  1091. obj.onClick(this, this.playBtnSound);
  1092. }
  1093. offUIClick(obj, func) {
  1094. obj.offClick(this, func);
  1095. }
  1096. playBtnSound() {
  1097. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1098. }
  1099. }
  1100. UIBase.lastShowBanner = 0;
  1101. UIBase.showBannerNum = 0;
  1102. UIBase.uiName = "";
  1103. class ui_UIDraw extends fgui.GComponent {
  1104. static createInstance() {
  1105. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1106. }
  1107. onConstruct() {
  1108. this.n_bj = (this.getChild("n_bj"));
  1109. this.n1 = (this.getChild("n1"));
  1110. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  1111. this.myNode = (this.getChild("myNode"));
  1112. this.extraNode = (this.getChild("extraNode"));
  1113. this.closeNode = (this.getChild("closeNode"));
  1114. this.moneyNode = (this.getChild("moneyNode"));
  1115. this.n38 = (this.getChild("n38"));
  1116. this.talkNode = (this.getChild("talkNode"));
  1117. this.secretary = (this.getChild("secretary"));
  1118. this.drawBtn = (this.getChild("drawBtn"));
  1119. this.t0 = this.getTransition("t0");
  1120. }
  1121. }
  1122. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1123. class ui_UIBox extends fgui.GComponent {
  1124. static createInstance() {
  1125. return (fgui.UIPackage.createObject("game", "UIBox"));
  1126. }
  1127. onConstruct() {
  1128. this.n0 = (this.getChild("n0"));
  1129. this.n12 = (this.getChild("n12"));
  1130. this.n1 = (this.getChild("n1"));
  1131. this.n2 = (this.getChild("n2"));
  1132. this.bar = (this.getChild("bar"));
  1133. this.closeBtn = (this.getChild("closeBtn"));
  1134. this.openBtn = (this.getChild("openBtn"));
  1135. this.t0 = this.getTransition("t0");
  1136. this.t1 = this.getTransition("t1");
  1137. }
  1138. }
  1139. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1140. class LocalStorageManager {
  1141. test1() {
  1142. LocalStorageManager.setItem("playerName", "Tom");
  1143. LocalStorageManager.setItem("playerLevel", 5);
  1144. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1145. const name = LocalStorageManager.getItem("playerName");
  1146. const level = LocalStorageManager.getItem("playerLevel");
  1147. const data = LocalStorageManager.getItem("playerData");
  1148. console.log(name);
  1149. console.log(level);
  1150. console.log(data);
  1151. LocalStorageManager.removeItem("playerLevel");
  1152. }
  1153. static setItem(key, value) {
  1154. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1155. }
  1156. static getItem(key) {
  1157. const data = Laya.LocalStorage.getItem(key);
  1158. if (data === null)
  1159. return null;
  1160. try {
  1161. return JSON.parse(data);
  1162. }
  1163. catch (e) {
  1164. return data;
  1165. }
  1166. }
  1167. static removeItem(key) {
  1168. Laya.LocalStorage.removeItem(key);
  1169. }
  1170. static clear() {
  1171. Laya.LocalStorage.clear();
  1172. }
  1173. static hasJosnKey(key) {
  1174. var value = Laya.LocalStorage.getJSON(key);
  1175. if (value != null) {
  1176. return true;
  1177. }
  1178. else {
  1179. return false;
  1180. }
  1181. }
  1182. static hasKey(key) {
  1183. return Laya.LocalStorage.getItem(key) !== null;
  1184. }
  1185. }
  1186. class GlobalManager {
  1187. constructor() {
  1188. }
  1189. registerMethod(name, method) {
  1190. console.log('zh: 注册全局方法', name);
  1191. this[name] = method;
  1192. }
  1193. callMethod(name, ...args) {
  1194. console.log('zh: 调用全局方法', name);
  1195. if (this[name]) {
  1196. return this[name](...args);
  1197. }
  1198. else {
  1199. console.error(`zh: 全局方法 Method ${name} not found`);
  1200. }
  1201. }
  1202. }
  1203. GlobalManager.instance = new GlobalManager();
  1204. class JSBridgeUtils {
  1205. constructor() { }
  1206. static get instance() {
  1207. if (!this._instance) {
  1208. this._instance = new JSBridgeUtils();
  1209. }
  1210. return this._instance;
  1211. }
  1212. initBridge() {
  1213. if (!Laya.Browser.onAndroid) {
  1214. console.log('zh:非android dev');
  1215. return;
  1216. }
  1217. let cfg = window['conchConfig'];
  1218. if (cfg) {
  1219. var os = cfg.getOS();
  1220. if (os == "Conch-android") {
  1221. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1222. if (this.bridge) {
  1223. return true;
  1224. }
  1225. else {
  1226. return false;
  1227. }
  1228. }
  1229. else {
  1230. return false;
  1231. }
  1232. }
  1233. else {
  1234. return false;
  1235. }
  1236. }
  1237. testAd1() {
  1238. if (!Laya.Browser.onAndroid) {
  1239. console.log('zh:非android dev');
  1240. return;
  1241. }
  1242. if (!this.initBridge()) {
  1243. return;
  1244. }
  1245. let rs = this.bridge.call("testString", "hello");
  1246. console.log('zh:testString rs=' + rs);
  1247. }
  1248. testAdCallBack() {
  1249. if (!this.initBridge()) {
  1250. return;
  1251. }
  1252. console.log("zh:testAdCallBack start");
  1253. const defaultObj = { code: 200, msg: "req update Ui" };
  1254. const reqObj = { code: 300, msg: "hello java ui" };
  1255. this.bridge.callWithBack((rsStr) => {
  1256. const rsObj = JSON.parse(rsStr);
  1257. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1258. }, "testAsyncCallback", JSON.stringify(reqObj));
  1259. }
  1260. showInternAd(mark) {
  1261. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1262. if (boo1) {
  1263. console.log('zh: VIP SPID = 1,免除插页AD');
  1264. return false;
  1265. }
  1266. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1267. if (boo7) {
  1268. console.log('zh: VIP SPID = 7,免除任何AD');
  1269. return false;
  1270. }
  1271. console.log('zh:showInternAd start');
  1272. if (!Laya.Browser.onAndroid) {
  1273. console.log('zh:showInternAd 非android dev');
  1274. return false;
  1275. }
  1276. if (!this.initBridge()) {
  1277. return false;
  1278. }
  1279. let rs = this.bridge.call("showInternAd", mark);
  1280. try {
  1281. const result = JSON.parse(rs);
  1282. if (result.code === 200) {
  1283. console.log("zh:showInternAd OK");
  1284. return true;
  1285. }
  1286. else {
  1287. console.warn("zh:showInternAd FAILL:", result.msg);
  1288. return false;
  1289. }
  1290. }
  1291. catch (e) {
  1292. console.error("zh:解析桥接返回值失败:", e);
  1293. return false;
  1294. }
  1295. }
  1296. exitAndCloseGame() {
  1297. if (!Laya.Browser.onAndroid) {
  1298. return;
  1299. }
  1300. if (!this.initBridge()) {
  1301. return;
  1302. }
  1303. console.log('zh:开始关闭游戏-');
  1304. this.bridge.call("exitAndCloseGame");
  1305. }
  1306. checkAdForUserOrderForSpid17(spid) {
  1307. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1308. if (userInfo != null) {
  1309. if (!userInfo.buySpids) {
  1310. userInfo.buySpids = { 1: false, 7: false };
  1311. }
  1312. else {
  1313. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1314. }
  1315. let boo = userInfo.buySpids[spid];
  1316. if (!boo) {
  1317. console.log('zh:刷新一下用户的AD权利');
  1318. DataMgr.loadUserSpOrderForAd();
  1319. }
  1320. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1321. return boo;
  1322. }
  1323. return false;
  1324. }
  1325. showRewardAd(mark) {
  1326. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1327. if (boo7) {
  1328. console.log('zh: VIP SPID = 7,免除任何AD');
  1329. return false;
  1330. }
  1331. if (!Laya.Browser.onAndroid) {
  1332. return false;
  1333. }
  1334. if (!this.initBridge()) {
  1335. return false;
  1336. }
  1337. let rs = this.bridge.call("showRewardAd", mark);
  1338. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1339. try {
  1340. const result = JSON.parse(rs);
  1341. if (result.code === 200) {
  1342. console.log("zh:广告显示成功");
  1343. return true;
  1344. }
  1345. else {
  1346. console.warn("zh:广告显示失败:", result.msg);
  1347. return false;
  1348. }
  1349. }
  1350. catch (e) {
  1351. console.error("zh:解析桥接返回值失败:", e);
  1352. return false;
  1353. }
  1354. }
  1355. logEventForAdNoParams(eventName) {
  1356. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1357. if (!Laya.Browser.onAndroid) {
  1358. return;
  1359. }
  1360. if (!this.initBridge()) {
  1361. return;
  1362. }
  1363. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1364. this.bridge.call("logEventForAdNoParams", eventName);
  1365. }
  1366. logEventForAdHaveParams(eventName, jsonStr) {
  1367. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1368. if (!Laya.Browser.onAndroid) {
  1369. return;
  1370. }
  1371. if (!this.initBridge()) {
  1372. return;
  1373. }
  1374. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1375. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1376. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1377. }
  1378. logEventForFirebase(eventName, jsonStr) {
  1379. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1380. if (!Laya.Browser.onAndroid) {
  1381. return;
  1382. }
  1383. if (!this.initBridge()) {
  1384. return;
  1385. }
  1386. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1387. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1388. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1389. }
  1390. testNetTip() {
  1391. if (Laya.Browser.onAndroid) {
  1392. let boo = this.getNetworkAvailable();
  1393. this.showToast2("Network error, reward unavailable");
  1394. return;
  1395. }
  1396. }
  1397. getNetworkAvailable() {
  1398. if (!Laya.Browser.onAndroid) {
  1399. return;
  1400. }
  1401. if (!this.initBridge()) {
  1402. return;
  1403. }
  1404. let boo = this.bridge.call("getNetworkAvailable");
  1405. console.log("zh:getNetworkAvailable boo=" + boo);
  1406. return boo;
  1407. }
  1408. showToast2(msg) {
  1409. if (!Laya.Browser.onAndroid) {
  1410. return;
  1411. }
  1412. if (!this.initBridge()) {
  1413. return;
  1414. }
  1415. this.bridge.call("showToast2", msg);
  1416. }
  1417. loginOutForApp() {
  1418. if (!Laya.Browser.onAndroid) {
  1419. return;
  1420. }
  1421. if (!this.initBridge()) {
  1422. return;
  1423. }
  1424. this.bridge.call("loginOutForApp");
  1425. }
  1426. startGgPay(token, ggSpid, spid) {
  1427. if (!Laya.Browser.onAndroid) {
  1428. return;
  1429. }
  1430. if (!this.initBridge()) {
  1431. return;
  1432. }
  1433. let jsonObj = {
  1434. token: token,
  1435. ggSpid: ggSpid,
  1436. spid: spid,
  1437. spsl: 1
  1438. };
  1439. let reqData = JSON.stringify(jsonObj);
  1440. console.log("zh:startGgPay ts reqData=" + reqData);
  1441. this.bridge.call("startGgPay", reqData);
  1442. }
  1443. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1444. if (!Laya.Browser.onAndroid) {
  1445. return;
  1446. }
  1447. if (!this.initBridge()) {
  1448. return;
  1449. }
  1450. let jsonObj = {
  1451. token: token,
  1452. ggSpid: ggSpid,
  1453. spid: spid,
  1454. spsl: 1
  1455. };
  1456. let reqData = JSON.stringify(jsonObj);
  1457. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1458. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1459. }
  1460. nativeCallJs(msg) {
  1461. console.log("zh:nativeCallJs received data: 1111", msg);
  1462. if (msg === 'Ad1') {
  1463. GlobalManager.instance.callMethod('Ad1');
  1464. console.log("zh: Ad1 奖励发送成功");
  1465. }
  1466. else if (msg === 'Ad2') {
  1467. GlobalManager.instance.callMethod('Ad2');
  1468. console.log("zh: Ad2 奖励发送成功");
  1469. }
  1470. else if (msg === 'Ad3') {
  1471. GlobalManager.instance.callMethod('Ad3');
  1472. console.log("zh: Ad3 奖励发送成功");
  1473. }
  1474. else if (msg === 'Ad4') {
  1475. GlobalManager.instance.callMethod('Ad4');
  1476. console.log("zh: Ad4 奖励发送成功");
  1477. }
  1478. else if (msg === 'Ad5') {
  1479. console.log("zh: Ad5 奖励发送成功");
  1480. GlobalManager.instance.callMethod('Ad5');
  1481. }
  1482. }
  1483. }
  1484. class UIBox extends UIBase {
  1485. constructor() {
  1486. super();
  1487. this.boxNum = 0;
  1488. this.boxMax = 10;
  1489. this.inAd = false;
  1490. this.isClose = false;
  1491. }
  1492. onConstructor() {
  1493. this.ui = ui_UIBox.createInstance();
  1494. this.contentPane = this.ui;
  1495. this.isEject = false;
  1496. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1497. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1498. Laya.timer.loop(1000, this, this.update);
  1499. }
  1500. update() {
  1501. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1502. this.boxNum -= 1;
  1503. this.upBar();
  1504. }
  1505. }
  1506. upBar() {
  1507. if (this.boxNum > this.boxMax)
  1508. this.boxNum = this.boxMax;
  1509. this.ui.bar.value = this.boxNum * 10;
  1510. }
  1511. show() {
  1512. super.show();
  1513. this.isClose = false;
  1514. this.boxNum = 0;
  1515. this.inAd = false;
  1516. this.upBar();
  1517. this.ui.t0.play();
  1518. this.ui.closeBtn.visible = false;
  1519. Laya.timer.once(3000, this, () => {
  1520. this.ui.closeBtn.visible = true;
  1521. this.ui.bar.alpha = 1;
  1522. });
  1523. Laya.timer.once(500, this, () => {
  1524. this.ui.t1.play();
  1525. });
  1526. }
  1527. hide() {
  1528. Laya.timer.clearAll(this);
  1529. Moyu.showBannerAd(false);
  1530. super.hide();
  1531. }
  1532. onOpenBox() {
  1533. this.boxNum++;
  1534. if (this.boxNum < this.boxMax) {
  1535. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1536. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1537. }
  1538. }
  1539. else if (this.boxNum == this.boxMax) {
  1540. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1541. this.ui.openBtn.c1.selectedIndex = 13;
  1542. this.inAd = true;
  1543. }
  1544. else
  1545. this.getAward();
  1546. }
  1547. else if (this.inAd) {
  1548. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1549. if (Laya.Browser.onAndroid) {
  1550. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1551. if (!boo) {
  1552. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1553. return;
  1554. }
  1555. }
  1556. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1557. }
  1558. else {
  1559. console.log('zh:AD 失败,直接发放奖励');
  1560. this.qjff_AD_for_UIBOX_onOpenBox();
  1561. }
  1562. }
  1563. this.upBar();
  1564. }
  1565. qjff_AD_for_UIBOX_onOpenBox() {
  1566. this.getAward();
  1567. }
  1568. onCloseBox() {
  1569. if (this.isClose)
  1570. this.hide();
  1571. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1572. this.isClose = true;
  1573. PlatMgr.showBanner(true, 0, 3000);
  1574. }
  1575. else
  1576. this.hide();
  1577. }
  1578. getAward() {
  1579. let str = "";
  1580. if (Math.random() < 0.5) {
  1581. let max = Moyu.isLegal ? 500 : 2500;
  1582. let num = xGame.tools.random(max, 500 + max);
  1583. DataMgr.setCoin(num);
  1584. str = "金币x" + num;
  1585. }
  1586. else {
  1587. let max = Moyu.isLegal ? 10 : 30;
  1588. let num = xGame.tools.random(max, 30 + max);
  1589. DataMgr.setDiamond(num);
  1590. str = "钻石x" + num;
  1591. }
  1592. xGame.showTip("恭喜获得-" + str);
  1593. this.hide();
  1594. }
  1595. }
  1596. UIBox.uiName = "UIBox";
  1597. class ui_UITry extends fgui.GComponent {
  1598. static createInstance() {
  1599. return (fgui.UIPackage.createObject("game", "UITry"));
  1600. }
  1601. onConstruct() {
  1602. this.n11 = (this.getChild("n11"));
  1603. this.myNode = (this.getChild("myNode"));
  1604. this.t0 = this.getTransition("t0");
  1605. }
  1606. }
  1607. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1608. class UITry extends UIBase {
  1609. constructor() {
  1610. super();
  1611. this.closeTime = 0;
  1612. this.closeNum = 0;
  1613. this.skillUrl = xGame.common.skillIconList;
  1614. }
  1615. onConstructor() {
  1616. this.ui = ui_UITry.createInstance();
  1617. this.contentPane = this.ui;
  1618. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1619. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1620. }
  1621. show() {
  1622. super.show();
  1623. this.closeNum = 0;
  1624. this.closeTime = 15;
  1625. this.ui.t0.play();
  1626. PlatMgr.showRateBanner();
  1627. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1628. Laya.timer.loop(1000, this, this.updateTime);
  1629. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1630. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1631. xGame.common.gameMgr.gamePause = true;
  1632. }
  1633. updateTime() {
  1634. if (this.closeTime > 1) {
  1635. this.closeTime--;
  1636. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1637. }
  1638. else
  1639. this.hide();
  1640. }
  1641. hide() {
  1642. Laya.timer.clearAll(this);
  1643. Moyu.showBannerAd(false);
  1644. super.hide();
  1645. xGame.common.gameMgr.gamePause = false;
  1646. }
  1647. onTry() {
  1648. console.log('zh:qjff_AD_for_uitry');
  1649. if (Laya.Browser.onAndroid) {
  1650. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1651. if (!boo) {
  1652. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1653. return;
  1654. }
  1655. }
  1656. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1657. }
  1658. else {
  1659. console.log('zh:AD 失败,直接发放奖励');
  1660. this.qjff_AD_for_uitry();
  1661. }
  1662. }
  1663. qjff_AD_for_uitry() {
  1664. let select = xGame.common.curPlayerSkillType;
  1665. DataMgr.gameData.trySkill = select;
  1666. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1667. DataMgr.saveGameData();
  1668. DataMgr.setBigSkill(select, 1);
  1669. xGame.showTip("Trial Successful");
  1670. this.hide();
  1671. }
  1672. onCancel() {
  1673. if (this.closeNum > 0) {
  1674. this.closeNum--;
  1675. if (this.closeNum < 2)
  1676. this.hide();
  1677. return;
  1678. }
  1679. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1680. this.onTry();
  1681. }
  1682. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1683. this.closeNum = 3;
  1684. }
  1685. else
  1686. this.hide();
  1687. }
  1688. }
  1689. UITry.uiName = "UITry";
  1690. class PlatMgr {
  1691. static initConfig() {
  1692. this.lastVt = 0;
  1693. if (!Moyu.platConfig)
  1694. return;
  1695. for (let k in Moyu.platConfig) {
  1696. let pd = this[k];
  1697. let pc = Moyu.platConfig[k];
  1698. if (pd != undefined && pc != undefined)
  1699. this[k] = pc;
  1700. }
  1701. Moyu.setBannerPos(0.5, 1);
  1702. }
  1703. static rand100(num) {
  1704. return xGame.tools.random(0, 100) < num;
  1705. }
  1706. static isMisVideo() {
  1707. let dt = Laya.timer.currTimer - this.lastVt;
  1708. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1709. this.lastVt = Laya.timer.currTimer;
  1710. return true;
  1711. }
  1712. else {
  1713. if (this.rand100(this.fullVideoRate)) {
  1714. console.log('zh:插屏 ad start');
  1715. JSBridgeUtils.instance.showInternAd('platMgr');
  1716. }
  1717. return false;
  1718. }
  1719. }
  1720. static showVideo(call, type) {
  1721. Moyu.showVideoAd(() => {
  1722. this.lastVt = Laya.timer.currTimer;
  1723. call && call();
  1724. }, type);
  1725. }
  1726. static showInsert(delay = false) {
  1727. if (this.getRand() < this.insertRate) {
  1728. let dt = delay ? this.insertDelay : 0;
  1729. console.log('zh:插屏 ad start');
  1730. JSBridgeUtils.instance.showInternAd('gameInsert');
  1731. }
  1732. }
  1733. static gameInsert() {
  1734. let t = this.getRand();
  1735. let r = this.gameInsertRate;
  1736. if (t < r) {
  1737. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1738. }
  1739. }
  1740. static showRateBanner() {
  1741. if (this.getRand() < this.bannerRate)
  1742. this.showBanner(true, this.bannerDelay, 3000);
  1743. }
  1744. static showBanner(show, delay = 0, hide = 0) {
  1745. if (2 > 1) {
  1746. console.log('zh:显示showBanner广告 直接返回');
  1747. return;
  1748. }
  1749. if (!show)
  1750. Moyu.showBannerAd(false);
  1751. else {
  1752. Laya.timer.clear(this, this.bannerShow);
  1753. if (delay > 0)
  1754. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1755. else
  1756. this.bannerShow(true);
  1757. if (hide > 0)
  1758. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1759. }
  1760. }
  1761. static bannerShow(show) {
  1762. if (2 > 1) {
  1763. console.log('zh:显示showBanner广告 直接返回');
  1764. return;
  1765. }
  1766. Moyu.showBannerAd(show);
  1767. console.log("showBanner" + show);
  1768. }
  1769. static getRand() {
  1770. return xGame.tools.random(0, 100);
  1771. }
  1772. static openBox() {
  1773. if (this.getRand() < this.boxRate)
  1774. xGame.uiMgr.Show(UIBox);
  1775. }
  1776. static openTry() {
  1777. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1778. return;
  1779. if (this.getRand() < this.tryRate)
  1780. xGame.uiMgr.Show(UITry);
  1781. else if (DataMgr.gameData.gameCount == 1)
  1782. xGame.uiMgr.Show(UITry);
  1783. }
  1784. }
  1785. PlatMgr.forceShare = 0;
  1786. PlatMgr.signAdRate = 0;
  1787. PlatMgr.forceVideoRate = 0;
  1788. PlatMgr.forceVideoGap = 0;
  1789. PlatMgr.fullVideoRate = 0;
  1790. PlatMgr.gameInsertRate = 0;
  1791. PlatMgr.insertGap = 0;
  1792. PlatMgr.insertDelay = 0;
  1793. PlatMgr.insertRate = 0;
  1794. PlatMgr.boxRate = 0;
  1795. PlatMgr.boxVideoRate = 0;
  1796. PlatMgr.boxInsertRate = 0;
  1797. PlatMgr.boxBannerRate = 0;
  1798. PlatMgr.tryRate = 0;
  1799. PlatMgr.tryClose3Rate = 0;
  1800. PlatMgr.tryVideoRate = 0;
  1801. PlatMgr.bannerRate = 0;
  1802. PlatMgr.lastVt = 0;
  1803. class ui_UIAddProp extends fgui.GComponent {
  1804. static createInstance() {
  1805. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1806. }
  1807. onConstruct() {
  1808. this.n11 = (this.getChild("n11"));
  1809. this.myNode = (this.getChild("myNode"));
  1810. this.closeBtn = (this.getChild("closeBtn"));
  1811. this.t0 = this.getTransition("t0");
  1812. }
  1813. }
  1814. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1815. class SpineMgr {
  1816. constructor(name, loadCb = null) {
  1817. this.loaded = false;
  1818. this.spineName = '';
  1819. this.loadedCallback = loadCb;
  1820. this.templet = new Laya.Templet();
  1821. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1822. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1823. if (name === 'mishu') {
  1824. this.templet.loadAni('spine/nvmishu.sk');
  1825. }
  1826. else {
  1827. this.templet.loadAni(`spine/${name}.sk`);
  1828. }
  1829. this.templet.lock = true;
  1830. this.spineName = name;
  1831. }
  1832. onError() {
  1833. console.log("zh:spine加载出错");
  1834. }
  1835. parseComplete() {
  1836. this.loaded = true;
  1837. this.loadedCallback && this.loadedCallback();
  1838. }
  1839. dispose() {
  1840. if (this.templet && !this.templet.destroyed) {
  1841. this.templet.destroy();
  1842. }
  1843. this.templet = null;
  1844. }
  1845. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1846. if (!this.loaded) {
  1847. return;
  1848. }
  1849. let spine;
  1850. if (mySpine) {
  1851. spine = mySpine;
  1852. }
  1853. else {
  1854. spine = this.createSpine(data, parent);
  1855. }
  1856. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1857. if (!isLoop) {
  1858. spine.on(Laya.Event.STOPPED, this, () => {
  1859. spine.offAll(Laya.Event.STOPPED);
  1860. callback && callback(spine);
  1861. });
  1862. }
  1863. return spine;
  1864. }
  1865. createSpine(data, parent, type = 1) {
  1866. let spine;
  1867. spine = this.templet.buildArmature(type);
  1868. spine.showSkinByIndex(0);
  1869. parent.addChild(spine);
  1870. spine.pos(data.x, data.y);
  1871. spine.scale(data.scaleX, data.scaleY, true);
  1872. return spine;
  1873. }
  1874. }
  1875. var AIState;
  1876. (function (AIState) {
  1877. AIState[AIState["none"] = 0] = "none";
  1878. AIState[AIState["idle"] = 1] = "idle";
  1879. AIState[AIState["reset"] = 2] = "reset";
  1880. AIState[AIState["move"] = 3] = "move";
  1881. AIState[AIState["wait"] = 4] = "wait";
  1882. AIState[AIState["select"] = 5] = "select";
  1883. AIState[AIState["turn"] = 6] = "turn";
  1884. AIState[AIState["shoot"] = 7] = "shoot";
  1885. AIState[AIState["leave"] = 8] = "leave";
  1886. })(AIState || (AIState = {}));
  1887. class AIPlayer {
  1888. constructor() {
  1889. this.dtime = 30;
  1890. this.awayTime = 0;
  1891. this.awayNum = 0;
  1892. this.hideTime = 0;
  1893. this.rootMoveTime = 0;
  1894. this.isGuide = false;
  1895. this.state = AIState.none;
  1896. this.waitTime = 0;
  1897. this.forceNum = 0;
  1898. this.forceMax = 0;
  1899. this.ballSize = 33;
  1900. this.selectNum = 0;
  1901. this.destRot = 0;
  1902. this.aiLv = 10;
  1903. this.kickBall = [];
  1904. this.lineBall = [];
  1905. this.scoreBall = [];
  1906. this.holeBall = [];
  1907. this.turnNum = 0;
  1908. this.setNum = 0;
  1909. this.setMax = 0;
  1910. this.setRate = 0;
  1911. this.rectL = 0;
  1912. this.rectR = 0;
  1913. this.rectT = 0;
  1914. this.rectB = 0;
  1915. this.rootPos = { x: 0, y: 0 };
  1916. this.bestForce = 0;
  1917. this.bestAngle = 180;
  1918. this.bestPos = { x: 0, y: 0 };
  1919. this.bestKick = { x: 0, y: 0 };
  1920. this.posList = [];
  1921. this.posIdx = 0;
  1922. this.chatTime = 3000;
  1923. this.tempDir1 = new Laya.Vector2();
  1924. this.tempDir2 = new Laya.Vector2();
  1925. this.tempDir3 = new Laya.Vector2();
  1926. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1927. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1928. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1929. this.gameSrc = xGame.common.gameUI;
  1930. this.hideTime = Laya.timer.currTimer;
  1931. Moyu.setOnTipCall((id) => {
  1932. if (id == 20012)
  1933. this.hideTime = Laya.timer.currTimer;
  1934. else
  1935. (id == 20011);
  1936. {
  1937. let dt = Laya.timer.currTimer - this.hideTime;
  1938. console.log("onshow" + dt);
  1939. if (dt > 30000 && this.state > AIState.none)
  1940. xGame.common.gameMgr.aiGameEnd(false);
  1941. }
  1942. }, this);
  1943. }
  1944. init() {
  1945. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1946. this.awayTime = xGame.tools.random(5000, 10000);
  1947. this.awayNum = 0;
  1948. this.hideTime = Laya.timer.currTimer;
  1949. let rect = xGame.common.d2World.borderRect;
  1950. this.rectL = Math.ceil(rect.x) + 17;
  1951. this.rectT = Math.ceil(rect.y) + 17;
  1952. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1953. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1954. this.wBall = xGame.common.d2World.rootBall;
  1955. this.ballSize = this.wBall.gameObj.width - 1;
  1956. if (this.posList.length < 1) {
  1957. let dp = 40;
  1958. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1959. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1960. let dx = i < this.rectR ? i : this.rectR;
  1961. let dy = j < this.rectB ? j : this.rectB;
  1962. let order = xGame.tools.random(0, 1000);
  1963. this.posList.push({ x: dx, y: dy, order: order });
  1964. }
  1965. }
  1966. this.posList.sort(function (a, b) {
  1967. return a.order - b.order;
  1968. });
  1969. this.setMax = this.posList.length;
  1970. }
  1971. this.state = AIState.idle;
  1972. }
  1973. setAiLevel(num) {
  1974. this.aiLv = num;
  1975. }
  1976. initBall() {
  1977. this.rootPos.x = this.wBall.gameObj.x;
  1978. this.rootPos.y = this.wBall.gameObj.y;
  1979. this.initHoleBall();
  1980. }
  1981. initHoleBall() {
  1982. this.kickBall = [];
  1983. this.lineBall = [];
  1984. this.scoreBall = [];
  1985. this.holeBall = [];
  1986. this.selectNum = 0;
  1987. this.forceNum = 0;
  1988. this.forceMax = 0;
  1989. this.turnNum = 0;
  1990. let list = xGame.common.d2World.ballArr;
  1991. if (list.length < 20 && !this.isGuide) {
  1992. let holes = xGame.common.gameMgr.holePosList;
  1993. for (let i = 0; i < list.length; i++) {
  1994. let obj = list[i];
  1995. if (!obj)
  1996. continue;
  1997. obj.kickPos.x = 0;
  1998. obj.kickPos.y = 0;
  1999. obj.poleAngle = 0;
  2000. obj.hard = 0;
  2001. obj.borderDis = 0;
  2002. obj.kickAngle = 180;
  2003. if (obj.number == 0)
  2004. continue;
  2005. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  2006. continue;
  2007. if (obj.number == 8 && xGame.common.gameMode == 0) {
  2008. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2009. continue;
  2010. }
  2011. let b = obj.gameObj;
  2012. let wbp = this.rootPos;
  2013. let bx = wbp.x - b.x;
  2014. let by = wbp.y - b.y;
  2015. obj.borderDis = xGame.tools.random(0, 100);
  2016. this.kickBall.push(obj);
  2017. if (!this.isLine(wbp, obj))
  2018. continue;
  2019. obj.kickAngle = xGame.tools.random(90, 180);
  2020. obj.kickPos.x = b.x;
  2021. obj.kickPos.y = b.y;
  2022. this.lineBall.push(obj);
  2023. let minDis = 999999;
  2024. let hole = false;
  2025. for (let j = 0; j < holes.length; j++) {
  2026. let hp = holes[j];
  2027. if (bx >= 0 && hp.x > b.x + 100)
  2028. continue;
  2029. if (bx <= 0 && hp.x < b.x - 100)
  2030. continue;
  2031. if (by < -10 && hp.y < wbp.y)
  2032. continue;
  2033. if (by > 10 && hp.y > wbp.y)
  2034. continue;
  2035. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2036. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2037. if (dis < minDis) {
  2038. let dx = b.x - this.tempDir1.x * this.ballSize;
  2039. let dy = b.y - this.tempDir1.y * this.ballSize;
  2040. this.tempDir3.x = this.tempDir1.x;
  2041. this.tempDir3.y = this.tempDir1.y;
  2042. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2043. obj.kickPos.x = dx;
  2044. obj.kickPos.y = dy;
  2045. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2046. if (num > 1)
  2047. num = 1;
  2048. obj.kickAngle = Math.acos(num) * 57.3;
  2049. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2050. dis = dis * 2;
  2051. if (Math.abs(hp.x - 600) < 100)
  2052. dis += 50;
  2053. obj.hard = dis + obj.kickAngle * 3;
  2054. hole = true;
  2055. }
  2056. }
  2057. }
  2058. }
  2059. if (hole) {
  2060. this.scoreBall.push(obj);
  2061. this.holeBall.push(obj);
  2062. }
  2063. }
  2064. this.scoreBall.sort(function (a, b) {
  2065. return a.hard - b.hard;
  2066. });
  2067. this.holeBall.sort(function (a, b) {
  2068. return a.kickAngle - b.kickAngle;
  2069. });
  2070. this.kickBall.sort(function (a, b) {
  2071. return a.borderDis - b.borderDis;
  2072. });
  2073. }
  2074. else {
  2075. let max = list.length - 1;
  2076. let i = xGame.tools.random(0, max);
  2077. for (i; i <= max; i++) {
  2078. let idx = i >= max ? i -= max : i;
  2079. let obj = list[idx];
  2080. if (obj && obj.number != 0) {
  2081. obj.kickAngle = xGame.tools.random(90, 180);
  2082. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2083. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2084. this.lineBall.push(obj);
  2085. break;
  2086. }
  2087. }
  2088. }
  2089. }
  2090. selectBall() {
  2091. let ball = null;
  2092. this.destRot = 0;
  2093. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2094. let ai = 110 - this.aiLv * 10;
  2095. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2096. let score = false;
  2097. if (this.scoreBall.length < 1) {
  2098. if (this.lineBall.length < 1) {
  2099. for (let i = 0; i < this.kickBall.length; i++) {
  2100. let list = [];
  2101. let bo = this.kickBall[i];
  2102. let bobj = bo.gameObj;
  2103. let rect = xGame.common.d2World.borderRect;
  2104. let mobj = this.wBall.gameObj;
  2105. let minb = bobj.y - rect.y - 20;
  2106. let minw = mobj.y - rect.y - 50;
  2107. if (minb > 0 && minw > 0) {
  2108. let dlenx = 0;
  2109. let dleny = mobj.y - rect.y;
  2110. let spx = mobj.x;
  2111. let spy = rect.y - dleny;
  2112. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2113. }
  2114. minb = rect.y + rect.height - bobj.y - 20;
  2115. minw = rect.y + rect.height - mobj.y - 50;
  2116. if (minb > 0 && minw > 0) {
  2117. let dlenx = 0;
  2118. let dleny = rect.y + rect.height - mobj.y;
  2119. let spx = mobj.x;
  2120. let spy = rect.y + rect.height + dleny;
  2121. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2122. }
  2123. minb = bobj.x - rect.x - 20;
  2124. minw = mobj.x - rect.x - 50;
  2125. if (minb > 0 && minw > 0) {
  2126. let dlenx = mobj.x - rect.x;
  2127. let dleny = 0;
  2128. let spx = rect.x - dlenx;
  2129. let spy = mobj.y;
  2130. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2131. }
  2132. minb = rect.x + rect.width - bobj.x - 20;
  2133. minw = rect.x + rect.width - mobj.x - 50;
  2134. if (minb > 0 && minw > 0) {
  2135. let dlenx = rect.x + rect.width - mobj.x;
  2136. let dleny = 0;
  2137. let spx = rect.x + rect.width + dlenx;
  2138. let spy = mobj.y;
  2139. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2140. }
  2141. list.sort(function (a, b) {
  2142. return a.order - b.order;
  2143. });
  2144. for (let i = 0; i < list.length; i++) {
  2145. let data = list[i];
  2146. let mx = mobj.x - bobj.x;
  2147. let my = mobj.y - bobj.y;
  2148. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2149. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2150. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2151. if (num > 1)
  2152. num = 1;
  2153. let cos = Math.acos(num);
  2154. if (cos > 1.57)
  2155. cos = 1.57;
  2156. else if (cos < 0.01)
  2157. cos = 0.01;
  2158. let tan = Math.tan(cos);
  2159. let dx = tan * data.dleny;
  2160. let dy = tan * data.dlenx;
  2161. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2162. if (Math.abs(bx - 667) < 40)
  2163. continue;
  2164. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2165. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2166. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2167. this.forceMax = dis * 0.08;
  2168. this.destRot += mis * 0.1;
  2169. this.setKick(bx, by);
  2170. return true;
  2171. }
  2172. }
  2173. }
  2174. }
  2175. else {
  2176. ball = xGame.common.getRandArrEle(this.lineBall);
  2177. }
  2178. }
  2179. else {
  2180. for (let i = 0; i < this.scoreBall.length; i++) {
  2181. if (i < this.scoreBall.length - 1) {
  2182. let rand = 70 + this.aiLv * 10 + i * 10;
  2183. if (xGame.tools.random(0, 100) < rand) {
  2184. ball = this.scoreBall[i];
  2185. break;
  2186. }
  2187. }
  2188. else {
  2189. ball = this.scoreBall[i];
  2190. break;
  2191. }
  2192. }
  2193. score = true;
  2194. this.selectNum++;
  2195. }
  2196. if (!ball)
  2197. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2198. if (this.selectNum >= max) {
  2199. let dx = ball.gameObj.x;
  2200. let dy = ball.gameObj.y;
  2201. let kickAngle = 0;
  2202. if (score) {
  2203. dx = ball.kickPos.x;
  2204. dy = ball.kickPos.y;
  2205. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2206. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2207. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2208. if (adot > 1)
  2209. adot = 1;
  2210. kickAngle = Math.acos(adot) * 57.3;
  2211. if (kickAngle > 45) {
  2212. let kdx = ball.kickPos.x - ball.gameObj.x;
  2213. let kdy = ball.kickPos.y - ball.gameObj.y;
  2214. dx = ball.kickPos.x - kdx * mis * 0.3;
  2215. dy = ball.kickPos.y - kdy * mis * 0.3;
  2216. }
  2217. else
  2218. this.destRot += mis;
  2219. }
  2220. else if (ball.poleAngle != 0) {
  2221. this.destRot += ball.poleAngle;
  2222. }
  2223. if (xGame.common.gameMode == 0) {
  2224. let af = kickAngle * 0.08;
  2225. this.forceMax = ball.hard * 0.1 + af * af;
  2226. }
  2227. this.setKick(dx, dy);
  2228. }
  2229. else {
  2230. let rand = this.aiLv * 5 + 40;
  2231. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2232. ball = xGame.common.getRandArrEle(this.scoreBall);
  2233. else
  2234. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2235. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2236. if (xGame.tools.random(0, 100) > rand) {
  2237. this.selectNum = max;
  2238. }
  2239. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2240. this.selectNum++;
  2241. }
  2242. ball.onClick(0, true);
  2243. }
  2244. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2245. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2246. let balls = xGame.common.d2World.ballArr;
  2247. let max = xGame.tools.getDis(hx, hy, bx, by);
  2248. for (let index = 0; index < balls.length; index++) {
  2249. let obj = balls[index];
  2250. if (obj.number == 0)
  2251. continue;
  2252. if (obj.number == bn || obj.number == dn)
  2253. continue;
  2254. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2255. if (dis * dis > max)
  2256. continue;
  2257. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2258. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2259. if (num > 1)
  2260. num = 1;
  2261. if (num < 0)
  2262. continue;
  2263. let gap = Math.sin(Math.acos(num)) * dis;
  2264. if (gap < this.ballSize)
  2265. return true;
  2266. }
  2267. return false;
  2268. }
  2269. isLine(xy, ball) {
  2270. let bx = xy.x;
  2271. let by = xy.y;
  2272. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2273. let dis = ball.getDestDis(xy);
  2274. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2275. let sin = Math.sin(angle);
  2276. let cos = Math.cos(angle);
  2277. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2278. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2279. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2280. let dx = bx + this.tempDir2.x * dis;
  2281. let dy = by + this.tempDir2.y * dis;
  2282. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2283. sin = Math.sin(-angle);
  2284. cos = Math.cos(-angle);
  2285. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2286. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2287. dx = bx + this.tempDir2.x * dis;
  2288. dy = by + this.tempDir2.y * dis;
  2289. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2290. if (isr && isl)
  2291. return false;
  2292. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2293. }
  2294. return true;
  2295. }
  2296. turnPole() {
  2297. this.turnNum++;
  2298. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2299. let dr = rot - this.destRot;
  2300. let abs = Math.abs(dr) % 360;
  2301. if (abs > 180) {
  2302. if (rot > 180)
  2303. rot -= 360;
  2304. if (this.destRot > 180)
  2305. this.destRot -= 360;
  2306. }
  2307. let max = this.turnNum * 5 + this.aiLv * 5;
  2308. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2309. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2310. let at = xGame.tools.random(1000, 2000);
  2311. if (!this.onAway(3))
  2312. at += xGame.tools.random(10000, 15000);
  2313. this.setState(AIState.shoot, at);
  2314. }
  2315. else {
  2316. let mr = 0;
  2317. if (abs > 3)
  2318. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2319. else if (Math.random() > 0.6)
  2320. mr = xGame.tools.random(1, 10) * 0.1;
  2321. mr = dr > 0 ? -mr : mr;
  2322. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2323. }
  2324. }
  2325. setKick(dx, dy) {
  2326. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2327. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2328. this.tempDir1.x = 0;
  2329. this.tempDir1.y = 1;
  2330. this.tempDir2.y = -this.tempDir2.y;
  2331. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2332. if (num > 1)
  2333. num = 1;
  2334. let rot = Math.acos(num) * 57.3;
  2335. if (this.tempDir2.x < 0)
  2336. rot = 360 - rot;
  2337. this.destRot += rot;
  2338. if (!xGame.common.gameMgr.finishOneShoot) {
  2339. this.forceMax += xGame.tools.random(10, 50);
  2340. this.forceMax -= this.aiLv * 2;
  2341. if (this.forceMax < 20)
  2342. this.forceMax = 20;
  2343. }
  2344. if (this.forceMax > 100)
  2345. this.forceMax = 101;
  2346. else if (this.forceMax < 10)
  2347. this.forceMax += xGame.tools.random(0, 10);
  2348. if (xGame.common.gameMode == 1)
  2349. this.forceMax = xGame.tools.random(80, 100);
  2350. else
  2351. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2352. let max = 2000 - this.aiLv * 100;
  2353. if (Math.random() > 0.8)
  2354. max += xGame.tools.random(100, 2000);
  2355. this.setState(AIState.turn, xGame.tools.random(500, max));
  2356. }
  2357. shoot() {
  2358. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2359. if (Math.random() > 0.8) {
  2360. this.gameSrc.aiForce(1);
  2361. this.setState(AIState.wait);
  2362. }
  2363. }
  2364. else {
  2365. let df = xGame.tools.random(3, 8);
  2366. if (this.forceNum < this.forceMax)
  2367. this.forceNum += df;
  2368. else
  2369. this.forceNum -= df;
  2370. let startY = this.gameSrc.ui.powerNode.y;
  2371. let height = this.gameSrc.ui.powerNode.height;
  2372. let force = startY + height * this.forceNum * 0.01;
  2373. this.gameSrc.aiForce(2, force);
  2374. }
  2375. }
  2376. reset() {
  2377. for (let i = 0; i < 4; i++) {
  2378. this.setRate--;
  2379. this.setNum++;
  2380. let pos = this.posList[this.posIdx];
  2381. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2382. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2383. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2384. this.rootPos.x = 387;
  2385. if (this.rootPos.x < this.rectL)
  2386. this.rootPos.x = this.rectL;
  2387. else if (this.rootPos.x > this.rectR)
  2388. this.rootPos.x = this.rectR;
  2389. if (this.rootPos.y < this.rectT)
  2390. this.rootPos.y = this.rectT;
  2391. else if (this.rootPos.y > this.rectB)
  2392. this.rootPos.y = this.rectB;
  2393. this.posIdx++;
  2394. let max = this.posList.length;
  2395. if (this.posIdx >= max)
  2396. this.posIdx -= max;
  2397. this.initHoleBall();
  2398. let ball = null;
  2399. if (this.scoreBall.length > 0)
  2400. ball = this.scoreBall[0];
  2401. else if (this.lineBall.length > 0)
  2402. ball = xGame.common.getRandArrEle(this.lineBall);
  2403. if (ball && ball.kickAngle < this.bestAngle) {
  2404. this.bestAngle = ball.kickAngle;
  2405. this.bestKick.x = ball.kickPos.x;
  2406. this.bestKick.y = ball.kickPos.y;
  2407. this.bestPos.x = this.rootPos.x;
  2408. this.bestPos.y = this.rootPos.y;
  2409. this.bestForce = ball.hard * 0.08;
  2410. }
  2411. }
  2412. if (this.setNum >= this.setMax)
  2413. this.setMax = 0;
  2414. if (this.setRate < 1) {
  2415. this.setState(AIState.move, 0);
  2416. this.rootMoveTime = Laya.timer.currTimer;
  2417. this.gameSrc.aiRootMove(true);
  2418. }
  2419. }
  2420. delayLine() {
  2421. this.gameSrc.aiRootMove(false);
  2422. }
  2423. move() {
  2424. if (this.bestPos.x < 1)
  2425. this.bestPos = this.rootPos;
  2426. let wObj = this.wBall.gameObj;
  2427. let destx = wObj.x;
  2428. let desty = wObj.y;
  2429. let dx = Math.abs(destx - this.bestPos.x);
  2430. let dy = Math.abs(desty - this.bestPos.y);
  2431. let mx = 3 + dx * 0.03;
  2432. let my = 3 + dy * 0.03;
  2433. if (dx < 4 && dy < 4) {
  2434. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2435. dt = dt < 1000 ? 1000 - dt : 0;
  2436. if (this.setMax > 0) {
  2437. let min = this.setMax * 0.3 + this.aiLv * 5;
  2438. this.setRate = xGame.tools.random(min, this.setMax);
  2439. this.setState(AIState.reset, 0);
  2440. }
  2441. else {
  2442. this.destRot = 0;
  2443. this.forceMax = this.bestForce;
  2444. this.setKick(this.bestKick.x, this.bestKick.y);
  2445. }
  2446. if (dt > 100) {
  2447. Laya.timer.clear(this, this.delayLine);
  2448. Laya.timer.once(dt, this, this.delayLine);
  2449. }
  2450. else
  2451. this.gameSrc.aiRootMove(false);
  2452. }
  2453. else {
  2454. if (dx > 4)
  2455. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2456. if (dy > 4)
  2457. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2458. this.gameSrc.onRootMove({ x: destx, y: desty });
  2459. }
  2460. }
  2461. resetRoot() {
  2462. this.bestAngle = 180;
  2463. this.bestForce = 0;
  2464. this.setMax = this.posList.length;
  2465. this.posIdx = xGame.tools.random(0, this.setMax);
  2466. let min = this.setMax * 0.3 + this.aiLv * 5;
  2467. this.setRate = xGame.tools.random(min, this.setMax);
  2468. let max = 2000 - this.aiLv * 100;
  2469. if (Math.random() > 0.8)
  2470. max += xGame.tools.random(100, 1000);
  2471. if (this.isGuide)
  2472. this.setState(AIState.select, 500);
  2473. else if (this.onAway(2))
  2474. this.setState(AIState.reset, xGame.tools.random(400, max));
  2475. else
  2476. this.setState(AIState.none);
  2477. if (xGame.common.gameMgr.finishOneShoot)
  2478. this.chat();
  2479. }
  2480. runAI() {
  2481. if (this.state > AIState.idle)
  2482. return;
  2483. this.initBall();
  2484. this.onGame(2500);
  2485. if (Math.random() > 0.6)
  2486. this.chat();
  2487. }
  2488. stopRun() {
  2489. this.setState(AIState.idle);
  2490. }
  2491. onGame(base) {
  2492. let max = base - this.aiLv * 100;
  2493. if (Math.random() > 0.8)
  2494. max += xGame.tools.random(100, 1000);
  2495. if (this.onAway(2))
  2496. this.setState(AIState.select, xGame.tools.random(500, max));
  2497. else
  2498. this.setState(AIState.none);
  2499. }
  2500. setState(sta, wt = 0) {
  2501. if (this.state == AIState.none)
  2502. return;
  2503. this.state = sta;
  2504. this.waitTime = wt;
  2505. }
  2506. onUpdate() {
  2507. if (this.state == AIState.none)
  2508. return;
  2509. this.awayTime -= this.dtime;
  2510. if (this.awayTime < 1) {
  2511. this.awayTime = xGame.tools.random(6000, 10000);
  2512. this.awayNum += (11 - this.aiLv);
  2513. this.onAway(1);
  2514. }
  2515. if (this.waitTime >= 0) {
  2516. this.waitTime -= this.dtime;
  2517. return;
  2518. }
  2519. switch (this.state) {
  2520. case AIState.idle:
  2521. this.chat();
  2522. break;
  2523. case AIState.reset:
  2524. this.reset();
  2525. break;
  2526. case AIState.move:
  2527. this.move();
  2528. break;
  2529. case AIState.leave:
  2530. this.state = AIState.none;
  2531. xGame.common.gameMgr.aiGameEnd(true);
  2532. break;
  2533. case AIState.select:
  2534. this.selectBall();
  2535. break;
  2536. case AIState.turn:
  2537. this.turnPole();
  2538. break;
  2539. case AIState.shoot:
  2540. this.shoot();
  2541. break;
  2542. }
  2543. }
  2544. onAway(type) {
  2545. if (type == 1) {
  2546. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2547. let num = this.awayNum + db * 20;
  2548. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2549. xGame.common.gameMgr.aiLeave();
  2550. this.setState(AIState.leave, 6666);
  2551. }
  2552. }
  2553. else if (type == 2) {
  2554. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2555. let num = this.awayNum + db * 30;
  2556. if (xGame.tools.random(0, 10000) < num)
  2557. return false;
  2558. }
  2559. else if (type == 3) {
  2560. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2561. let num = this.awayNum + db * 10;
  2562. if (xGame.tools.random(0, 4000) < num)
  2563. return false;
  2564. }
  2565. return true;
  2566. }
  2567. chat() {
  2568. if (this.chatTime > 0) {
  2569. this.chatTime -= this.dtime;
  2570. return;
  2571. }
  2572. this.chatTime = xGame.tools.random(2000, 10000);
  2573. let rand = xGame.tools.random(0, 100);
  2574. if (rand < 15)
  2575. this.talk();
  2576. else if (rand < 35)
  2577. this.emotion();
  2578. }
  2579. talk() {
  2580. xGame.common.talkMgr.showAITalk(0);
  2581. }
  2582. emotion() {
  2583. xGame.common.talkMgr.showAIEmotion(0);
  2584. }
  2585. resetAI() {
  2586. this.stopRun();
  2587. this.state = AIState.none;
  2588. }
  2589. }
  2590. class Partical extends Laya.Script3D {
  2591. constructor() {
  2592. super();
  2593. this.duration = 2000;
  2594. }
  2595. ;
  2596. onAwake() {
  2597. this.gameObj = this.owner;
  2598. }
  2599. onEnable() {
  2600. this.openTimer();
  2601. }
  2602. openTimer() {
  2603. Laya.timer.once(this.duration, this, this.disappear);
  2604. }
  2605. setCallback(obj, callback) {
  2606. this.obj = obj;
  2607. this.callback = callback;
  2608. Laya.timer.clearAll(this);
  2609. Laya.timer.once(this.duration, this, this.disappear);
  2610. }
  2611. disappear() {
  2612. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2613. this.callback && this.callback(this.obj);
  2614. }
  2615. }
  2616. class Ball extends Laya.Script3D {
  2617. constructor() {
  2618. super();
  2619. this.posV3 = new Laya.Vector3();
  2620. this.rotRate = 2.1;
  2621. this.rotSpeed = new Laya.Vector3();
  2622. this.myIndex = 0;
  2623. }
  2624. onAwake() {
  2625. this.gameObj = this.owner;
  2626. this.transform = this.gameObj.transform;
  2627. this.ballNode = this.gameObj.getChildByName("Ball");
  2628. this.shadowNode = this.gameObj.getChildByName("shadow");
  2629. }
  2630. initSelf(index, x, y, owner) {
  2631. this.d2BallSrc = owner;
  2632. this.myIndex = index;
  2633. this.setAlbedoTexture();
  2634. this.setTransPos(x, y);
  2635. this.setScale();
  2636. this.ballNode.transform.localRotationEulerX = 90;
  2637. if (index == 0) {
  2638. }
  2639. }
  2640. setAlbedoTexture(isIce = false) {
  2641. let url;
  2642. if (isIce) {
  2643. url = `res/d3Res/ballTexture/ice.jpg`;
  2644. }
  2645. else {
  2646. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2647. }
  2648. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2649. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2650. }));
  2651. }
  2652. runFireworks(obj, delay, callback) {
  2653. Laya.timer.clearAll(this);
  2654. Laya.timer.once(delay + 1, this, () => {
  2655. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2656. fire.transform.localPositionX = this.transform.localPositionX;
  2657. fire.transform.localPositionY = this.transform.localPositionY;
  2658. fire.transform.localPositionZ = this.transform.localPositionZ;
  2659. let src = fire.getComponent(Partical);
  2660. src.duration = 1000;
  2661. src.setCallback(obj, callback);
  2662. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2663. eft.transform.localPositionX = this.transform.localPositionX;
  2664. eft.transform.localPositionY = this.transform.localPositionY;
  2665. eft.transform.localPositionZ = this.transform.localPositionZ;
  2666. });
  2667. }
  2668. setTransPos(x, y) {
  2669. this.setRotation();
  2670. xGame.common.pos2to3Convert(x, y, this.posV3);
  2671. this.transform.localPositionX = this.posV3.x;
  2672. this.transform.localPositionY = 0;
  2673. this.transform.localPositionZ = this.posV3.z;
  2674. this.transform.localRotationEulerX = 0;
  2675. this.transform.localRotationEulerY = 0;
  2676. this.transform.localRotationEulerZ = 0;
  2677. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2678. this.shadowNode.transform.localPositionY = 0.1;
  2679. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2680. }
  2681. setRotation() {
  2682. if (this.d2BallSrc.canRot) {
  2683. let speed = this.d2BallSrc.rigy.linearVelocity;
  2684. this.rotSpeed.x = speed.x * this.rotRate;
  2685. this.rotSpeed.z = speed.y * this.rotRate;
  2686. this.rotSpeed.y = this.d2BallSrc.rotY;
  2687. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2688. }
  2689. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2690. this.rotSpeed.x = this.rotSpeed.y = 0;
  2691. this.rotSpeed.y = this.d2BallSrc.rotY;
  2692. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2693. }
  2694. }
  2695. setScale() {
  2696. let radius = xGame.common.d2World.rootBall.ui.width;
  2697. let scale = xGame.common.scale2to3Convert(radius);
  2698. this.transform.localScaleX = scale;
  2699. this.transform.localScaleY = scale;
  2700. this.transform.localScaleZ = scale;
  2701. }
  2702. playInHoleEft() {
  2703. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2704. eft.transform.position = this.transform.position;
  2705. }
  2706. playIceEft() {
  2707. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2708. eft.transform.position = this.transform.position;
  2709. }
  2710. get scaleXYZ() {
  2711. return this.transform.localScaleX;
  2712. }
  2713. set scaleXYZ(val) {
  2714. this.transform.localScaleX = val;
  2715. this.transform.localScaleY = val;
  2716. this.transform.localScaleZ = val;
  2717. }
  2718. get posX() {
  2719. return this.transform.localPositionX;
  2720. }
  2721. set posX(val) {
  2722. this.transform.localPositionX = val;
  2723. }
  2724. get posY() {
  2725. return this.transform.localPositionY;
  2726. }
  2727. set posY(val) {
  2728. this.transform.localPositionY = val;
  2729. }
  2730. get posZ() {
  2731. return this.transform.localPositionZ;
  2732. }
  2733. set posZ(val) {
  2734. this.transform.localPositionZ = val;
  2735. }
  2736. destroySelf() {
  2737. this.posV3 = null;
  2738. this.rotSpeed = null;
  2739. this.d2BallSrc = null;
  2740. this.ballNode = null;
  2741. this.gameObj.destroy(true);
  2742. this.transform = null;
  2743. this.destroy();
  2744. }
  2745. }
  2746. class ui_D2Ball extends fgui.GComponent {
  2747. static createInstance() {
  2748. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2749. }
  2750. onConstruct() {
  2751. this.myIcon = (this.getChild("myIcon"));
  2752. this.inner = (this.getChild("inner"));
  2753. this.n8 = (this.getChild("n8"));
  2754. this.n4 = (this.getChild("n4"));
  2755. this.wrongTips = (this.getChild("wrongTips"));
  2756. this.rightTips = (this.getChild("rightTips"));
  2757. this.breathAni = this.getTransition("breathAni");
  2758. }
  2759. }
  2760. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2761. class D2BallSrc extends Laya.Script {
  2762. constructor() {
  2763. super();
  2764. this.number = 0;
  2765. this.startX = 0;
  2766. this.startY = 0;
  2767. this.angleV2 = new Laya.Vector2();
  2768. this.isRootBall = false;
  2769. this.isBlackBall = false;
  2770. this.ballType = "";
  2771. this.canRot = true;
  2772. this.rotY = 0;
  2773. this.poleAngle = 0;
  2774. this.kickPos = { x: 0, y: 0 };
  2775. this.hard = 0;
  2776. this.kickAngle = 0;
  2777. this.borderDis = 0;
  2778. this.speedP10 = 5.6;
  2779. this.lastSpeed = { x: 0, y: 0 };
  2780. this.stillSpeed = 0.12;
  2781. this.ballFunc = "normal";
  2782. this.isRunSkillAni = false;
  2783. this.isInHole = false;
  2784. this.iceOwner = "";
  2785. this.forceRun = false;
  2786. this.myUNID = "";
  2787. this.rectL = 0;
  2788. this.rectR = 0;
  2789. this.rectT = 0;
  2790. this.rectB = 0;
  2791. this.forceVec = new Laya.Vector2();
  2792. this.lastDis = 0;
  2793. this.helpOut = { type: "", x: 0, y: 0 };
  2794. }
  2795. initSelf(number, x, y, d3Ball) {
  2796. if (!this.gameObj)
  2797. this.gameObj = this.owner;
  2798. this.number = number;
  2799. this.startX = x;
  2800. this.startY = y;
  2801. this.d3Ball = d3Ball;
  2802. this.isRootBall = false;
  2803. this.isBlackBall = false;
  2804. this.ballType = "";
  2805. if (number == 0) {
  2806. this.isRootBall = true;
  2807. }
  2808. else if (number == 8) {
  2809. this.isBlackBall = true;
  2810. }
  2811. else {
  2812. if (number <= 7) {
  2813. this.ballType = ballCamp.full;
  2814. }
  2815. else {
  2816. this.ballType = ballCamp.flower;
  2817. }
  2818. }
  2819. this.setInfo();
  2820. this.setD3Ball();
  2821. this.owner["mySrc"] = this;
  2822. this.rigy.linearDamping = 1;
  2823. D2BallSrc._unid++;
  2824. this.myUNID = "d2ball" + D2BallSrc._unid;
  2825. let rect = xGame.common.d2World.borderRect;
  2826. this.rectL = Math.ceil(rect.x) + 20;
  2827. this.rectT = Math.ceil(rect.y) + 20;
  2828. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2829. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2830. }
  2831. setInfo() {
  2832. this.gameObj.x = this.startX;
  2833. this.gameObj.y = this.startY;
  2834. let radius = this.ui.width / 2;
  2835. this.gameObj.width = radius * 2;
  2836. this.gameObj.height = radius * 2;
  2837. if (xGame.common.showDebug) {
  2838. this.ui.myIcon.alpha = 1;
  2839. this.ui.inner.alpha = 1;
  2840. }
  2841. else {
  2842. this.ui.myIcon.alpha = 0;
  2843. this.ui.inner.alpha = 0;
  2844. }
  2845. }
  2846. setD3Ball() {
  2847. this.d3Ball = this.d3Ball;
  2848. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2849. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2850. }
  2851. onUpdate() {
  2852. if (xGame.common.gameMgr.gamePause)
  2853. return;
  2854. if (this.isInHole)
  2855. return;
  2856. if (!xGame.common.d2World.openCheckStill)
  2857. return;
  2858. this.runBall();
  2859. }
  2860. runBall() {
  2861. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2862. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2863. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2864. this.judgeBorder();
  2865. }
  2866. getDestDis(dest) {
  2867. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2868. }
  2869. setmyXY(x, y) {
  2870. this.d3BallSrc.setTransPos(x, y);
  2871. }
  2872. getSpeed() {
  2873. let speed = this.rigy.linearVelocity;
  2874. return speed.x * speed.x + speed.y * speed.y;
  2875. }
  2876. onTriggerEnter(collider) {
  2877. if (!collider || !collider.owner)
  2878. return;
  2879. let coll = "collide";
  2880. let speed = this.getSpeed();
  2881. let sv2 = this.speedP10 * this.speedP10;
  2882. if (collider.label == "ball") {
  2883. if (speed < 9 && this.number != 0)
  2884. coll = "";
  2885. else if (speed < sv2)
  2886. coll = "collide_4";
  2887. else if (speed < sv2 * 6.2)
  2888. coll = "collide_3";
  2889. else if (speed < sv2 * 25)
  2890. coll = "collide_2";
  2891. else if (speed < sv2 * 56)
  2892. coll = "collide_1";
  2893. xGame.soundMgr.playSound(coll);
  2894. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2895. if (collider.owner) {
  2896. let rig = collider.owner.getComponent(D2BallSrc);
  2897. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2898. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2899. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2900. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2901. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2902. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2903. let rx = 0;
  2904. let ry = 0;
  2905. if (this.gameObj.x < this.rectL)
  2906. rx = vx;
  2907. else if (this.gameObj.x > this.rectR)
  2908. rx = -vx;
  2909. else if (this.gameObj.y < this.rectT)
  2910. ry = vy;
  2911. else if (this.gameObj.y > this.rectB)
  2912. ry = -vy;
  2913. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2914. }
  2915. }
  2916. if (this.number != 0) {
  2917. return;
  2918. }
  2919. else {
  2920. if (this.forceRun) {
  2921. console.log("randon force");
  2922. this.applyForce(collider);
  2923. }
  2924. }
  2925. if (xGame.common.d2World.isOnSameLine) {
  2926. xGame.common.d2World.isOnSameLine = false;
  2927. this.rigy.linearVelocity = { x: 0, y: 0 };
  2928. }
  2929. if (xGame.common.gameMgr.firstColliObj == null) {
  2930. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2931. xGame.common.gameMgr.isTouchedBall = true;
  2932. }
  2933. }
  2934. else {
  2935. xGame.common.recoverCameraView();
  2936. let wallStr = "";
  2937. if (speed < 9) { }
  2938. else if (speed < sv2) { }
  2939. else if (speed < sv2 * 6.2)
  2940. wallStr = "wall_30";
  2941. else if (speed < sv2 * 25)
  2942. wallStr = "wall_50";
  2943. else if (speed < sv2 * 56)
  2944. wallStr = "wall_80";
  2945. xGame.soundMgr.playSound(wallStr);
  2946. }
  2947. }
  2948. applyForce(collider) {
  2949. let src = collider.owner.mySrc;
  2950. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2951. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2952. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2953. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2954. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2955. }
  2956. checkWrongBall(playEft = true) {
  2957. if (this.isInHole)
  2958. return;
  2959. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2960. if (this.number != 0 && playEft)
  2961. this.d3BallSrc.playInHoleEft();
  2962. let coll = "inpocket_1";
  2963. let speed = this.getSpeed();
  2964. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2965. if (speed < 9 && this.number != 0)
  2966. coll = "";
  2967. else if (speed < sv2 * 6.2)
  2968. coll = "inpocket_4";
  2969. else if (speed < sv2 * 25)
  2970. coll = "collide_3";
  2971. else if (speed < sv2 * 56)
  2972. coll = "collide_2";
  2973. xGame.soundMgr.playSound(coll);
  2974. this.isInHole = true;
  2975. if (this.number == 0) {
  2976. console.log("白球进了。。");
  2977. this.reset();
  2978. this.rigy.linearVelocity = { x: 0, y: 0 };
  2979. this.hideSelf();
  2980. xGame.common.gameUI.ui.whiteAni.visible = true;
  2981. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2982. xGame.common.gameUI.ui.whiteAni.visible = false;
  2983. }));
  2984. }
  2985. else {
  2986. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2987. xGame.common.d2World.removeOneBall(this);
  2988. this.destroySelf();
  2989. xGame.common.playHappySound(this.number);
  2990. this.runFlyEft();
  2991. }
  2992. }
  2993. runFlyEft() {
  2994. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2995. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2996. }
  2997. }
  2998. hideSelf() {
  2999. if (this.d3Ball)
  3000. this.d3Ball.active = false;
  3001. }
  3002. showSelf() {
  3003. this.isInHole = false;
  3004. if (this.d3Ball && !this.d3Ball.active)
  3005. this.d3Ball.active = true;
  3006. }
  3007. isStill() {
  3008. let speed = this.rigy.linearVelocity;
  3009. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3010. this.rigy.linearVelocity = { x: 0, y: 0 };
  3011. return true;
  3012. }
  3013. return false;
  3014. }
  3015. reset() {
  3016. }
  3017. destroySelf() {
  3018. this.d3BallSrc.destroySelf();
  3019. if (!this.ui.isDisposed) {
  3020. this.ui.removeFromParent();
  3021. this.ui.dispose();
  3022. this.ui = null;
  3023. }
  3024. this.outColli = null;
  3025. this.innerColli = null;
  3026. this.rigy = null;
  3027. this.d3Ball = null;
  3028. this.d3BallSrc = null;
  3029. this.angleV2 = null;
  3030. this.gameObj.destroy(true);
  3031. this.destroy();
  3032. }
  3033. judgeBorder() {
  3034. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3035. return;
  3036. }
  3037. if (this.destroyed)
  3038. return;
  3039. if (xGame.common.gameMode == GameMode.classic)
  3040. return;
  3041. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3042. if (isOver) {
  3043. this.checkWrongBall();
  3044. }
  3045. }
  3046. onClick(e, force = false) {
  3047. if (this.number == 0)
  3048. return;
  3049. if (force) {
  3050. }
  3051. else {
  3052. if (xGame.common.d2World.openCheckStill)
  3053. return;
  3054. if (!xGame.common.gameMgr.selfTurn) {
  3055. return;
  3056. }
  3057. }
  3058. if (!xGame.common.gameMgr.finishOneShoot)
  3059. return;
  3060. let root = xGame.common.d2World.rootBall.gameObj;
  3061. let x = this.gameObj.x - root.x;
  3062. let y = this.gameObj.y - root.y;
  3063. let angle = xGame.common.getfguiRotation(x, y);
  3064. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3065. xGame.common.d2World.getHelpLine();
  3066. xGame.common.clickedBall = true;
  3067. this.checkGuide();
  3068. }
  3069. checkGuide() {
  3070. let guide = DataMgr.getSkillGuide();
  3071. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3072. xGame.common.guideStep++;
  3073. xGame.common.gameUI.ui.guide1.visible = false;
  3074. xGame.common.gameUI.ui.guide2.visible = true;
  3075. }
  3076. }
  3077. checkDistance(disX, disY, angle) {
  3078. let diameter = this.gameObj.width - 1;
  3079. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3080. if (!this.lastDis)
  3081. this.lastDis = dis;
  3082. else {
  3083. if (dis > this.lastDis) {
  3084. this.helpOut.type = "remove";
  3085. return this.helpOut;
  3086. }
  3087. }
  3088. if (dis <= Math.pow(diameter, 2)) {
  3089. let del = 0.01;
  3090. let offest = 0;
  3091. let realX = disX - this.gameObj.x;
  3092. let realY = disY - this.gameObj.y;
  3093. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3094. offest += del;
  3095. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3096. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3097. }
  3098. this.helpOut.type = "ok";
  3099. this.helpOut.x = realX + this.gameObj.x;
  3100. this.helpOut.y = realY + this.gameObj.y;
  3101. return this.helpOut;
  3102. }
  3103. else {
  3104. this.helpOut.type = "no";
  3105. return this.helpOut;
  3106. }
  3107. }
  3108. clearBallEft() {
  3109. this.clearBallRightEft();
  3110. this.clearBallWrongEft();
  3111. }
  3112. clearBallRightEft() {
  3113. this.ui.breathAni.stop();
  3114. this.ui.rightTips.visible = false;
  3115. }
  3116. clearBallWrongEft() {
  3117. this.ui.wrongTips.visible = false;
  3118. }
  3119. showWrongEft() {
  3120. if (!xGame.common.gameMgr.selfTurn)
  3121. return;
  3122. this.ui.wrongTips.visible = true;
  3123. }
  3124. showRightEft() {
  3125. if (!xGame.common.gameMgr.selfTurn)
  3126. return;
  3127. this.ui.rightTips.visible = true;
  3128. this.ui.rightTips.scaleX = 1;
  3129. this.ui.rightTips.scaleY = 1;
  3130. this.ui.breathAni.play();
  3131. }
  3132. setBallFunc(type, owner) {
  3133. if (type == "ice") {
  3134. this.ballFunc = type;
  3135. this.d3BallSrc.setAlbedoTexture(true);
  3136. this.rigy.type = "static";
  3137. this.iceOwner = owner;
  3138. }
  3139. else {
  3140. if (owner == this.iceOwner) {
  3141. this.ballFunc = type;
  3142. this.d3BallSrc.setAlbedoTexture(false);
  3143. this.rigy.type = "dynamic";
  3144. }
  3145. }
  3146. }
  3147. }
  3148. D2BallSrc._unid = 0;
  3149. class D2RootBallSrc extends D2BallSrc {
  3150. constructor() {
  3151. super();
  3152. this.maxSpeed = 0;
  3153. this.classicMaxSpeed = 2.2;
  3154. this.bigSkillMaxSpeed = 4;
  3155. this.angle = 0;
  3156. this.allPercent = 0;
  3157. this.linearPercent = 0;
  3158. this.anglePercent = 0;
  3159. this.maxAngleRate = 0.6;
  3160. this.baseRot = 7;
  3161. this.angleMax = 0;
  3162. this.speed = new Laya.Vector2();
  3163. this.rotSpeed = new Laya.Vector2();
  3164. }
  3165. isStill() {
  3166. let speed = this.rigy.linearVelocity;
  3167. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3168. if (this.anglePercent <= 0.1) {
  3169. this.rigy.linearVelocity = { x: 0, y: 0 };
  3170. return true;
  3171. }
  3172. }
  3173. return false;
  3174. }
  3175. reset() {
  3176. this.linearPercent = 0;
  3177. this.anglePercent = 0;
  3178. }
  3179. setSpeed(percent, angle) {
  3180. this.allPercent = percent;
  3181. this.angle = angle;
  3182. this.setAngleSpeed();
  3183. this.setLinearSpeed();
  3184. let hit = "hit";
  3185. if (percent < 25)
  3186. hit = "hit03";
  3187. else if (percent < 50)
  3188. hit = "hit02";
  3189. else if (percent < 75)
  3190. hit = "hit01";
  3191. xGame.soundMgr.playSound(hit);
  3192. }
  3193. setAngleSpeed() {
  3194. let offest = xGame.common.rodOffest;
  3195. let radius = 82;
  3196. let rate = Math.abs(offest.y / radius) * 0.5;
  3197. if (offest.y > 0)
  3198. this.angleMax = -this.baseRot * 2;
  3199. else
  3200. this.angleMax = this.baseRot;
  3201. this.rotY = -offest.x / radius * 100;
  3202. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3203. this.linearPercent = this.allPercent - this.anglePercent;
  3204. }
  3205. setLinearSpeed() {
  3206. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3207. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3208. if (!xGame.common.longHelpLine) {
  3209. let offset = -150 + xGame.common.randomNum(0, 300);
  3210. offset /= 100;
  3211. this.angle += offset;
  3212. }
  3213. }
  3214. }
  3215. let sin = Math.sin(this.angle * Math.PI / 180);
  3216. let cos = Math.cos(this.angle * Math.PI / 180);
  3217. switch (xGame.common.gameMode) {
  3218. case GameMode.classic:
  3219. this.maxSpeed = this.classicMaxSpeed;
  3220. break;
  3221. case GameMode.bigMove:
  3222. this.maxSpeed = this.bigSkillMaxSpeed;
  3223. break;
  3224. case GameMode.placeBall:
  3225. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3226. if (data.type == 1) {
  3227. this.maxSpeed = this.bigSkillMaxSpeed;
  3228. }
  3229. else {
  3230. this.maxSpeed = this.classicMaxSpeed;
  3231. }
  3232. break;
  3233. default:
  3234. break;
  3235. }
  3236. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3237. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3238. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3239. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3240. this.rigy.applyLinearImpulseToCenter(this.speed);
  3241. }
  3242. onUpdate() {
  3243. if (this.anglePercent > 0.1) {
  3244. this.anglePercent *= 0.97;
  3245. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3246. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3247. this.rigy.applyForceToCenter(this.rotSpeed);
  3248. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3249. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3250. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3251. if (num > 0.9)
  3252. this.canRot = true;
  3253. }
  3254. else
  3255. this.canRot = true;
  3256. if (Math.abs(this.rotY) > 0.1)
  3257. this.rotY *= 0.98;
  3258. super.onUpdate();
  3259. }
  3260. destroySelf() {
  3261. super.destroySelf();
  3262. this.speed = null;
  3263. }
  3264. }
  3265. class D2Ball extends Laya.Sprite {
  3266. constructor(isRootBall = false) {
  3267. super();
  3268. this.ui = ui_D2Ball.createInstance();
  3269. this.pivotX = this.ui.width / 2;
  3270. this.pivotY = this.ui.width / 2;
  3271. this.x = 0;
  3272. this.y = 0;
  3273. this.addChild(this.ui.displayObject);
  3274. this.ui.displayObject.x += this.ui.width / 2;
  3275. this.ui.displayObject.y += this.ui.width / 2;
  3276. if (isRootBall) {
  3277. this.d2Src = this.addComponent(D2RootBallSrc);
  3278. }
  3279. else {
  3280. this.d2Src = this.addComponent(D2BallSrc);
  3281. }
  3282. this.d2Src.ui = this.ui;
  3283. this.addCircleCollider();
  3284. this.addInnerCircleCollider();
  3285. this.addRigyBody();
  3286. }
  3287. addCircleCollider() {
  3288. let colli = xGame.common.getCollider("circle");
  3289. colli.radius = this.ui.width / 2;
  3290. this.addComponentIntance(colli);
  3291. this.d2Src.outColli = colli;
  3292. colli.label = "ball";
  3293. }
  3294. addInnerCircleCollider() {
  3295. let colli = xGame.common.getCollider("circle");
  3296. colli.radius = this.ui.inner.width / 2;
  3297. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3298. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3299. this.addComponentIntance(colli);
  3300. this.d2Src.innerColli = colli;
  3301. colli.label = "inner";
  3302. }
  3303. addRigyBody() {
  3304. let rigy = xGame.common.getRigbody();
  3305. rigy.type = "dynamic";
  3306. this.addComponentIntance(rigy);
  3307. this.d2Src.rigy = rigy;
  3308. }
  3309. disposeSelf() {
  3310. if (!this.ui.isDisposed) {
  3311. this.ui.dispose();
  3312. this.ui.removeFromParent();
  3313. this.ui = null;
  3314. }
  3315. }
  3316. }
  3317. class ui_D2Gan extends fgui.GComponent {
  3318. static createInstance() {
  3319. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3320. }
  3321. onConstruct() {
  3322. this.myIcon = (this.getChild("myIcon"));
  3323. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3324. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3325. this.self = (this.getChild("self"));
  3326. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3327. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3328. this.ai = (this.getChild("ai"));
  3329. }
  3330. }
  3331. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3332. class D2Gan {
  3333. constructor() {
  3334. this.offset = 0.15;
  3335. this.cell = 1.5;
  3336. this.onBallCell = 0.4;
  3337. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3338. this.moveNum = 70;
  3339. this.rulerRate = 0.1;
  3340. this.ui = ui_D2Gan.createInstance();
  3341. this.changeSelfRod();
  3342. this.changeAIRod();
  3343. }
  3344. changeSelfRod() {
  3345. let index = DataMgr.getCurBallRod();
  3346. let data = cfgTable.ballrodData[index + 1];
  3347. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3348. this.selfMySpine && this.selfMySpine.dispose();
  3349. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3350. if (data.spine) {
  3351. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3352. this.selfMySpine = new SpineMgr(data.spine, () => {
  3353. let xx = this.ui.selfEftRoot.width / 2;
  3354. let yy = this.ui.selfEftRoot.height / 2;
  3355. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3356. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3357. outSpine.rotation = -90;
  3358. });
  3359. }
  3360. }
  3361. changeAIRod() {
  3362. let length = Object.keys(cfgTable.ballrodData).length;
  3363. let rand = Math.floor(length * Math.random()) + 1;
  3364. let data = cfgTable.ballrodData[rand];
  3365. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3366. this.aiMySpine && this.aiMySpine.dispose();
  3367. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3368. if (data.spine) {
  3369. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3370. this.aiMySpine = new SpineMgr(data.spine, () => {
  3371. let xx = this.ui.aiEftRoot.width / 2;
  3372. let yy = this.ui.aiEftRoot.height / 2;
  3373. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3374. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3375. outSpine.rotation = -90;
  3376. });
  3377. }
  3378. }
  3379. setGanLastInfo() {
  3380. this.lastInfo.rotation = this.ui.rotation;
  3381. this.lastInfo.x = this.ui.x;
  3382. this.lastInfo.y = this.ui.y;
  3383. }
  3384. rotateSelf(flag, isRuler = false) {
  3385. let angle;
  3386. flag = flag * this.offset;
  3387. if (xGame.common.d2World.isHelpLineOnBall) {
  3388. angle = flag * this.onBallCell;
  3389. }
  3390. else {
  3391. angle = flag * this.cell;
  3392. }
  3393. if (isRuler) {
  3394. angle *= this.rulerRate;
  3395. }
  3396. this.ui.rotation += angle;
  3397. xGame.common.d2World.getHelpLine();
  3398. }
  3399. checkDistance() {
  3400. let target = xGame.common.d2World.targetBall;
  3401. let root = xGame.common.d2World.rootBall;
  3402. if (target == null) {
  3403. return 1;
  3404. }
  3405. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3406. if (dis <= 2500) {
  3407. return 5;
  3408. }
  3409. return 1;
  3410. }
  3411. rotDest(rot) {
  3412. this.ui.rotation = rot;
  3413. xGame.common.d2World.getHelpLine();
  3414. }
  3415. storagePower(powerNum) {
  3416. let pos = (powerNum / 100) * this.moveNum;
  3417. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3418. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3419. this.ui.x = this.lastInfo.x + xx;
  3420. this.ui.y = this.lastInfo.y + yy;
  3421. }
  3422. shoot() {
  3423. this.storagePower(0);
  3424. this.ui.visible = false;
  3425. }
  3426. destroySelf() {
  3427. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3428. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3429. this.selfMySpine && this.selfMySpine.dispose();
  3430. this.aiMySpine && this.aiMySpine.dispose();
  3431. this.lastInfo = null;
  3432. if (!this.ui.isDisposed) {
  3433. this.ui.removeFromParent();
  3434. this.ui.dispose();
  3435. }
  3436. }
  3437. }
  3438. class ui_HelpLine extends fgui.GComponent {
  3439. static createInstance() {
  3440. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3441. }
  3442. onConstruct() {
  3443. this.n10 = (this.getChild("n10"));
  3444. this.rect = (this.getChild("rect"));
  3445. this.dir11 = (this.getChild("dir11"));
  3446. this.dir = (this.getChild("dir"));
  3447. this.rootDir = (this.getChild("rootDir"));
  3448. this.dirDot = (this.getChild("dirDot"));
  3449. }
  3450. }
  3451. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3452. class D2HelpLine {
  3453. constructor() {
  3454. this.starX = 0;
  3455. this.starY = 0;
  3456. this.ui = ui_HelpLine.createInstance();
  3457. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3458. this.starX = this.ui.rect.x;
  3459. this.starY = this.ui.rect.y;
  3460. }
  3461. shoot() {
  3462. this.ui.visible = false;
  3463. }
  3464. destroySelf() {
  3465. if (this.ui.isDisposed) {
  3466. this.ui.removeFromParent();
  3467. this.ui.dispose();
  3468. }
  3469. }
  3470. }
  3471. class D2World extends Laya.Script {
  3472. constructor() {
  3473. super();
  3474. this.ballArr = [];
  3475. this.openCheckStill = false;
  3476. this.checkArr = [];
  3477. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3478. this.isHelpLineOnBall = false;
  3479. this.isOnSameLine = false;
  3480. this.reflectAngle = 0;
  3481. this.powerPercent = 0;
  3482. this.inHolesSpeed = [];
  3483. this.outDir = new Laya.Vector2();
  3484. this.rootDir = new Laya.Vector2();
  3485. this.aiLv = 0;
  3486. this.rootPos = new Laya.Vector2();
  3487. this.tempDir1 = new Laya.Vector2();
  3488. this.tempDir2 = new Laya.Vector2();
  3489. this.tempDir3 = new Laya.Vector2();
  3490. this.ballSize = 33;
  3491. this.destRot = 0;
  3492. }
  3493. initSelf() {
  3494. this.createBalls();
  3495. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3496. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3497. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3498. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3499. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3500. }
  3501. setBorderRect() {
  3502. let ui = xGame.common.gameUI.ui;
  3503. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3504. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3505. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3506. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3507. this.borderRect.x = starX;
  3508. this.borderRect.y = starY;
  3509. this.borderRect.width = width;
  3510. this.borderRect.height = height;
  3511. }
  3512. resetGame() {
  3513. this.openCheckStill = false;
  3514. let temp;
  3515. for (let index = 0; index < this.ballArr.length; index++) {
  3516. temp = this.ballArr[index];
  3517. temp.destroySelf();
  3518. }
  3519. xGame.common.d3World.ballRoot.destroyChildren();
  3520. xGame.common.gameUI.ui.ballNode.removeChildren();
  3521. console.log("进入摧毁逻辑");
  3522. this.d2Gan.destroySelf();
  3523. this.d2HelpLine.destroySelf();
  3524. this.ballArr = [];
  3525. }
  3526. setD2Gan() {
  3527. let ballNode = this.rootBall.ui;
  3528. let d2Gan = new D2Gan();
  3529. this.d2Gan = d2Gan;
  3530. let ganNode = d2Gan.ui;
  3531. ballNode.addChild(ganNode);
  3532. ganNode.pivotX = ganNode.pivotX;
  3533. ganNode.pivotY = ganNode.pivotY;
  3534. ganNode.x = ganNode.myIcon.width / 2;
  3535. ganNode.y = this.rootBall.gameObj.width;
  3536. d2Gan.setGanLastInfo();
  3537. }
  3538. setHelpLine() {
  3539. let d2Help = new D2HelpLine();
  3540. this.d2HelpLine = d2Help;
  3541. }
  3542. createBalls() {
  3543. let cfg;
  3544. switch (xGame.common.gameMode) {
  3545. case GameMode.classic:
  3546. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3547. break;
  3548. case GameMode.bigMove:
  3549. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3550. break;
  3551. case GameMode.placeBall:
  3552. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3553. break;
  3554. default:
  3555. break;
  3556. }
  3557. cfg = JSON.parse(JSON.stringify(cfg));
  3558. for (const key in cfg) {
  3559. if (cfg[key].value == 0) {
  3560. this.createRootBall(cfg[key]);
  3561. delete cfg[key];
  3562. break;
  3563. }
  3564. }
  3565. this.createOtherBalls(cfg);
  3566. }
  3567. createRootBall(data) {
  3568. let root = new D2Ball(true);
  3569. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3570. this.rootBall = root.d2Src;
  3571. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3572. let d3BallSrc = d3Ball.getComponent(Ball);
  3573. xGame.common.d3World.rootBall = d3Ball;
  3574. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3575. let xx = data.x;
  3576. let yy = data.y;
  3577. let numer = data.value;
  3578. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3579. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3580. this.ballArr.push(this.rootBall);
  3581. this.setD2Gan();
  3582. this.setHelpLine();
  3583. }
  3584. createOtherBalls(cfg) {
  3585. let temp;
  3586. let src;
  3587. let data;
  3588. for (const key in cfg) {
  3589. data = cfg[key];
  3590. temp = new D2Ball();
  3591. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3592. src = temp.d2Src;
  3593. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3594. src.initSelf(data.value, data.x, data.y, d3Ball);
  3595. this.ballArr.push(src);
  3596. }
  3597. }
  3598. shoot(percent) {
  3599. this.powerPercent = percent;
  3600. this.openCheckStill = true;
  3601. let d2Angle = this.d2Gan.ui.rotation;
  3602. this.rootBall.setSpeed(percent, d2Angle);
  3603. this.clearBallAllEft();
  3604. this.changePlayerView();
  3605. }
  3606. onUpdate() {
  3607. if (!this.openCheckStill)
  3608. return;
  3609. this.checkStill();
  3610. }
  3611. checkStill() {
  3612. for (let index = 0; index < this.ballArr.length; index++) {
  3613. if (!this.ballArr[index].isStill()) {
  3614. return;
  3615. }
  3616. }
  3617. xGame.eventMgr.event(ALL_BALL_STOP);
  3618. }
  3619. allBallStop() {
  3620. this.openCheckStill = false;
  3621. xGame.common.recoverCameraView();
  3622. }
  3623. waitShoot() {
  3624. if (!this.d2Gan.ui.isDisposed) {
  3625. this.d2Gan.ui.visible = true;
  3626. }
  3627. if (!this.d2HelpLine.ui.isDisposed) {
  3628. this.d2HelpLine.ui.visible = true;
  3629. }
  3630. this.clearBallAllEft();
  3631. this.showBallRightEft();
  3632. this.getHelpLine();
  3633. this.inHolesSpeed = [];
  3634. this.selectOneBall();
  3635. }
  3636. _getAllBallArr() {
  3637. let arr = this.ballArr;
  3638. let outArr = [];
  3639. for (let index = 0; index < arr.length; index++) {
  3640. if (arr[index] instanceof D2RootBallSrc)
  3641. continue;
  3642. if (arr[index].ballFunc == "ice")
  3643. continue;
  3644. if (arr[index].destroyed)
  3645. continue;
  3646. outArr.push(arr[index]);
  3647. }
  3648. return outArr;
  3649. }
  3650. _getBlackObj() {
  3651. let arr = this.ballArr;
  3652. for (let index = 0; index < arr.length; index++) {
  3653. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3654. return arr[index];
  3655. }
  3656. }
  3657. }
  3658. selectOneBall() {
  3659. let all = this._getAllBallArr();
  3660. let target;
  3661. switch (xGame.common.gameMode) {
  3662. case GameMode.classic:
  3663. if (xGame.common.gameMgr.selfTurn) {
  3664. let self = xGame.common.gameMgr.selfBallArr;
  3665. let black = this._getBlackObj();
  3666. if (xGame.common.gameMgr.ensureBallType) {
  3667. if (self.length > 0) {
  3668. let out = [];
  3669. for (let j = 0; j < all.length; j++) {
  3670. if (self.indexOf(all[j].number) > -1) {
  3671. out.push(all[j]);
  3672. }
  3673. }
  3674. target = this.selectBestEnterOne(out);
  3675. }
  3676. else {
  3677. target = this.selectBestEnterOne([black]);
  3678. }
  3679. }
  3680. else {
  3681. target = this.selectBestEnterOne(all);
  3682. }
  3683. }
  3684. else {
  3685. target = this.selectBestEnterOne(all);
  3686. }
  3687. break;
  3688. case GameMode.bigMove:
  3689. target = this.selectBestEnterOne(all);
  3690. break;
  3691. case GameMode.placeBall:
  3692. if (all.length > 0) {
  3693. target = this.selectBestEnterOne(all);
  3694. }
  3695. break;
  3696. default:
  3697. break;
  3698. }
  3699. if (target && !target.destroyed && target.onClick) {
  3700. target.onClick(0, true);
  3701. let num = -200 + xGame.common.randomNum(0, 400);
  3702. num /= 150;
  3703. if (xGame.common.longHelpLine) {
  3704. num = 0;
  3705. }
  3706. this.destRot += num;
  3707. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3708. }
  3709. }
  3710. removeOneBall(ball) {
  3711. for (let index = 0; index < this.ballArr.length; index++) {
  3712. if (this.ballArr[index].id == ball.id) {
  3713. this.ballArr.splice(index, 1);
  3714. break;
  3715. }
  3716. }
  3717. }
  3718. getHelpLine() {
  3719. this.d2HelpLine.ui.dirDot.visible = false;
  3720. this.isOnSameLine = false;
  3721. let startX = this.rootBall.gameObj.x;
  3722. let startY = this.rootBall.gameObj.y;
  3723. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3724. if (dis == null) {
  3725. this.d2HelpLine.ui.visible = false;
  3726. console.error("辅助线异常");
  3727. return;
  3728. }
  3729. this.d2HelpLine.ui.visible = true;
  3730. let angle = this.d2Gan.ui.rotation;
  3731. let radius = 16.5;
  3732. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3733. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3734. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3735. if (colliObj == null) {
  3736. this.getColliPos(disX, disY, radius, angle);
  3737. xGame.common.d2World.isHelpLineOnBall = false;
  3738. this.targetBall = null;
  3739. this.reflectAngle = 0;
  3740. this.showBallWrongEft();
  3741. }
  3742. else {
  3743. let target = colliObj.src;
  3744. let radius = 16.5;
  3745. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3746. dis1 = Math.sqrt(dis1);
  3747. let realDis = colliObj.disHon - dis1;
  3748. let dir = colliObj.dir;
  3749. let xx = startX + dir.x * realDis;
  3750. let yy = startY + dir.y * realDis;
  3751. this.getColliPos(xx, yy, radius, angle);
  3752. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3753. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3754. let offset = xGame.common.rodOffest;
  3755. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3756. this.isOnSameLine = true;
  3757. }
  3758. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3759. xGame.common.d2World.isHelpLineOnBall = true;
  3760. this.targetBall = target;
  3761. this.reflectAngle = reflectAngle;
  3762. this.showBallWrongEft();
  3763. if (xGame.common.longHelpLine) {
  3764. this.delayReflectLine(target, reflectAngle);
  3765. }
  3766. }
  3767. }
  3768. getBorderDot(startX, startY, angle) {
  3769. let radius = 17;
  3770. let distance;
  3771. let isDone;
  3772. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3773. isDone = this.judgeUpDown(distance, angle, startX);
  3774. if (isDone != null) {
  3775. return isDone;
  3776. }
  3777. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3778. isDone = this.judgeUpDown(distance, angle, startX);
  3779. if (isDone != null) {
  3780. return isDone;
  3781. }
  3782. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3783. isDone = this.judgeLeftRight(distance, angle, startY);
  3784. if (isDone != null) {
  3785. return isDone;
  3786. }
  3787. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3788. isDone = this.judgeLeftRight(distance, angle, startY);
  3789. if (isDone != null) {
  3790. return isDone;
  3791. }
  3792. }
  3793. judgeUpDown(distance, angle, startX) {
  3794. let flag = Math.sin(angle * Math.PI / 180);
  3795. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3796. if (distance >= 0) {
  3797. if (flag > 0) {
  3798. if (temp < this.borderRect.x + this.borderRect.width) {
  3799. return distance;
  3800. }
  3801. }
  3802. else {
  3803. if (temp > this.borderRect.x) {
  3804. return distance;
  3805. }
  3806. }
  3807. }
  3808. }
  3809. judgeLeftRight(distance, angle, starY) {
  3810. let flag = -Math.cos(angle * Math.PI / 180);
  3811. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3812. if (distance >= 0) {
  3813. if (flag > 0) {
  3814. if (temp < this.borderRect.y + this.borderRect.height) {
  3815. return distance;
  3816. }
  3817. }
  3818. else {
  3819. if (temp > this.borderRect.y) {
  3820. return distance;
  3821. }
  3822. }
  3823. }
  3824. }
  3825. clearBallAllEft() {
  3826. let temp;
  3827. for (let index = 0; index < this.ballArr.length; index++) {
  3828. temp = this.ballArr[index];
  3829. temp.clearBallEft();
  3830. }
  3831. }
  3832. showBallRightEft() {
  3833. let gameMgr = xGame.common.gameMgr;
  3834. let temp;
  3835. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3836. if (targetArr.length <= 0)
  3837. return;
  3838. for (let index = 0; index < this.ballArr.length; index++) {
  3839. temp = this.ballArr[index];
  3840. if (targetArr.indexOf(temp.number) > -1) {
  3841. temp.showRightEft();
  3842. }
  3843. }
  3844. }
  3845. showBallWrongEft() {
  3846. let gameMgr = xGame.common.gameMgr;
  3847. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3848. if (targetArr.length <= 0)
  3849. return;
  3850. let temp;
  3851. for (let index = 0; index < this.ballArr.length; index++) {
  3852. temp = this.ballArr[index];
  3853. if (this.targetBall && this.targetBall.number == temp.number) {
  3854. if (targetArr.indexOf(temp.number) <= -1) {
  3855. temp.showWrongEft();
  3856. }
  3857. else {
  3858. temp.clearBallWrongEft();
  3859. }
  3860. }
  3861. else {
  3862. temp.clearBallWrongEft();
  3863. }
  3864. }
  3865. }
  3866. getColliPos(x, y, radius, angle) {
  3867. this.d2HelpLine.ui.x = x;
  3868. this.d2HelpLine.ui.y = y;
  3869. let dirX = x - this.rootBall.gameObj.x;
  3870. let dirY = y - this.rootBall.gameObj.y;
  3871. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3872. if (rectH <= 0)
  3873. rectH = 0;
  3874. this.d2HelpLine.ui.rect.height = 0;
  3875. this.d2HelpLine.ui.rect.height = rectH;
  3876. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3877. if (rectH < this.rootBall.gameObj.width) {
  3878. this.d2HelpLine.ui.rect.visible = false;
  3879. }
  3880. else {
  3881. this.d2HelpLine.ui.rect.visible = true;
  3882. }
  3883. this.d2HelpLine.ui.dir.visible = false;
  3884. this.d2HelpLine.ui.rootDir.visible = false;
  3885. }
  3886. getReflectLine(x, y, radius, target) {
  3887. this.d2HelpLine.ui.dir.visible = true;
  3888. let dirX = target.x - x;
  3889. let dirY = target.y - y;
  3890. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3891. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3892. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3893. this.d2HelpLine.ui.dir.height = 48;
  3894. this.d2HelpLine.ui.dir.rotation = angle;
  3895. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3896. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3897. return angle;
  3898. }
  3899. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3900. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3901. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3902. let targetX = target.gameObj.x;
  3903. let targetY = target.gameObj.y;
  3904. this.outDir.setValue(targetX - xx, targetY - yy);
  3905. this.rootDir.setValue(rtX - xx, rtY - yy);
  3906. let ver = Math.PI / 2;
  3907. let sin = Math.sin(ver);
  3908. let cos = Math.cos(ver);
  3909. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3910. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3911. this.outDir.setValue(outX, outY);
  3912. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3913. Laya.Vector2.normalize(this.outDir, this.outDir);
  3914. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3915. if (Math.abs(result) <= 0.08) {
  3916. this.d2HelpLine.ui.rootDir.visible = false;
  3917. return;
  3918. }
  3919. if (result > 0) {
  3920. angle += 90;
  3921. }
  3922. else if (result < 0) {
  3923. angle -= 90;
  3924. }
  3925. this.d2HelpLine.ui.rootDir.visible = true;
  3926. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3927. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3928. this.d2HelpLine.ui.rootDir.rotation = angle;
  3929. }
  3930. delayReflectLine(obj, angle) {
  3931. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3932. return;
  3933. }
  3934. this.isOnSameLine = false;
  3935. let startX = obj.gameObj.x;
  3936. let startY = obj.gameObj.y;
  3937. let dis = this.getBorderDot(startX, startY, angle);
  3938. if (dis == null) {
  3939. this.d2HelpLine.ui.dirDot.visible = false;
  3940. return;
  3941. }
  3942. this.d2HelpLine.ui.visible = true;
  3943. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3944. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3945. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3946. if (colliObj == null) {
  3947. this.setDelayLine(disX, disY, obj, angle);
  3948. }
  3949. else {
  3950. let radius = 16;
  3951. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3952. dis1 = Math.sqrt(dis1);
  3953. let realDis = colliObj.disHon - dis1;
  3954. let dir = colliObj.dir;
  3955. let xx = startX + dir.x * realDis;
  3956. let yy = startY + dir.y * realDis;
  3957. this.setDelayLine(xx, yy, obj, angle);
  3958. }
  3959. }
  3960. setDelayLine(x, y, obj, angle) {
  3961. let dirX = x - obj.gameObj.x;
  3962. let dirY = y - obj.gameObj.y;
  3963. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3964. if (rectH <= 0)
  3965. rectH = 0;
  3966. this.d2HelpLine.ui.dir.height = rectH;
  3967. this.d2HelpLine.ui.dirDot.visible = true;
  3968. this.d2HelpLine.ui.dirDot.x = 17;
  3969. this.d2HelpLine.ui.dirDot.y = 17;
  3970. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3971. ;
  3972. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3973. }
  3974. changePlayerView() {
  3975. if (Math.random() >= 0.7)
  3976. return;
  3977. if (!this.targetBall) {
  3978. return;
  3979. }
  3980. if (!xGame.common.gameMgr.selfTurn)
  3981. return;
  3982. switch (xGame.common.gameMode) {
  3983. case GameMode.classic:
  3984. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3985. if (this.targetBall.number != 8) {
  3986. return;
  3987. }
  3988. }
  3989. break;
  3990. case GameMode.bigMove:
  3991. return;
  3992. case GameMode.placeBall:
  3993. break;
  3994. default:
  3995. break;
  3996. }
  3997. let startX = this.targetBall.gameObj.x;
  3998. let startY = this.targetBall.gameObj.y;
  3999. let angle = this.reflectAngle;
  4000. let dis = this.getBorderDot(startX, startY, angle);
  4001. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4002. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4003. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4004. if (colliObj) {
  4005. return;
  4006. }
  4007. let offset = 40;
  4008. let posObj = xGame.common.gameMgr.posObj;
  4009. let temp;
  4010. let radius;
  4011. let tarX, tarY;
  4012. for (const key in posObj) {
  4013. temp = posObj[key];
  4014. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4015. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4016. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4017. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4018. xGame.common.showOneCamera("angle" + key);
  4019. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4020. Laya.physicsTimer.scale = 0.7;
  4021. break;
  4022. }
  4023. }
  4024. }
  4025. selectBestEnterOne(arr) {
  4026. this.aiLv = xGame.tools.random(1, 11);
  4027. this.aiLv = 10;
  4028. this.wBall = xGame.common.d2World.rootBall;
  4029. this.rootPos.x = this.wBall.gameObj.x;
  4030. this.rootPos.y = this.wBall.gameObj.y;
  4031. this.initHoleBall(arr);
  4032. return this.selectBall();
  4033. }
  4034. selectBall() {
  4035. let ball = null;
  4036. this.destRot = 0;
  4037. let ai = 110 - this.aiLv * 10;
  4038. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4039. let score = false;
  4040. if (this.scoreBall.length < 1) {
  4041. if (this.lineBall.length < 1) {
  4042. for (let i = 0; i < this.kickBall.length; i++) {
  4043. let list = [];
  4044. let bo = this.kickBall[i];
  4045. let bobj = bo.gameObj;
  4046. let rect = xGame.common.d2World.borderRect;
  4047. let mobj = this.wBall.gameObj;
  4048. let minb = bobj.y - rect.y - 20;
  4049. let minw = mobj.y - rect.y - 50;
  4050. if (minb > 0 && minw > 0) {
  4051. let dlenx = 0;
  4052. let dleny = mobj.y - rect.y;
  4053. let spx = mobj.x;
  4054. let spy = rect.y - dleny;
  4055. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4056. }
  4057. minb = rect.y + rect.height - bobj.y - 20;
  4058. minw = rect.y + rect.height - mobj.y - 50;
  4059. if (minb > 0 && minw > 0) {
  4060. let dlenx = 0;
  4061. let dleny = rect.y + rect.height - mobj.y;
  4062. let spx = mobj.x;
  4063. let spy = rect.y + rect.height + dleny;
  4064. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4065. }
  4066. minb = bobj.x - rect.x - 20;
  4067. minw = mobj.x - rect.x - 50;
  4068. if (minb > 0 && minw > 0) {
  4069. let dlenx = mobj.x - rect.x;
  4070. let dleny = 0;
  4071. let spx = rect.x - dlenx;
  4072. let spy = mobj.y;
  4073. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4074. }
  4075. minb = rect.x + rect.width - bobj.x - 20;
  4076. minw = rect.x + rect.width - mobj.x - 50;
  4077. if (minb > 0 && minw > 0) {
  4078. let dlenx = rect.x + rect.width - mobj.x;
  4079. let dleny = 0;
  4080. let spx = rect.x + rect.width + dlenx;
  4081. let spy = mobj.y;
  4082. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4083. }
  4084. list.sort(function (a, b) {
  4085. return a.order - b.order;
  4086. });
  4087. for (let i = 0; i < list.length; i++) {
  4088. let data = list[i];
  4089. let mx = mobj.x - bobj.x;
  4090. let my = mobj.y - bobj.y;
  4091. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4092. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4093. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4094. if (num > 1)
  4095. num = 1;
  4096. let cos = Math.acos(num);
  4097. if (cos > 1.57)
  4098. cos = 1.57;
  4099. else if (cos < 0.01)
  4100. cos = 0.01;
  4101. let tan = Math.tan(cos);
  4102. let dx = tan * data.dleny;
  4103. let dy = tan * data.dlenx;
  4104. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4105. if (Math.abs(bx - 667) < 40)
  4106. continue;
  4107. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4108. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4109. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4110. this.forceMax = dis * 0.08;
  4111. this.destRot += mis * 0.1;
  4112. this.setKick(bx, by);
  4113. return true;
  4114. }
  4115. }
  4116. }
  4117. }
  4118. else {
  4119. ball = xGame.common.getRandArrEle(this.lineBall);
  4120. }
  4121. }
  4122. else {
  4123. for (let i = 0; i < this.scoreBall.length; i++) {
  4124. if (i < this.scoreBall.length - 1) {
  4125. let rand = 70 + this.aiLv * 10 + i * 10;
  4126. if (xGame.tools.random(0, 100) < rand) {
  4127. ball = this.scoreBall[i];
  4128. break;
  4129. }
  4130. }
  4131. else {
  4132. ball = this.scoreBall[i];
  4133. break;
  4134. }
  4135. }
  4136. score = true;
  4137. this.selectNum++;
  4138. }
  4139. if (!ball)
  4140. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4141. let dx = ball.gameObj.x;
  4142. let dy = ball.gameObj.y;
  4143. let kickAngle = 0;
  4144. if (score) {
  4145. dx = ball.kickPos.x;
  4146. dy = ball.kickPos.y;
  4147. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4148. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4149. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4150. if (adot > 1)
  4151. adot = 1;
  4152. kickAngle = Math.acos(adot) * 57.3;
  4153. if (kickAngle > 45) {
  4154. let kdx = ball.kickPos.x - ball.gameObj.x;
  4155. let kdy = ball.kickPos.y - ball.gameObj.y;
  4156. dx = ball.kickPos.x - kdx * mis * 0.3;
  4157. dy = ball.kickPos.y - kdy * mis * 0.3;
  4158. }
  4159. else
  4160. this.destRot += mis;
  4161. }
  4162. else if (ball.poleAngle != 0) {
  4163. this.destRot += ball.poleAngle;
  4164. }
  4165. if (xGame.common.gameMode == 0) {
  4166. let af = kickAngle * 0.08;
  4167. this.forceMax = ball.hard * 0.1 + af * af;
  4168. }
  4169. this.setKick(dx, dy);
  4170. return ball;
  4171. }
  4172. initHoleBall(arr) {
  4173. this.kickBall = [];
  4174. this.lineBall = [];
  4175. this.scoreBall = [];
  4176. this.holeBall = [];
  4177. this.selectNum = 0;
  4178. this.forceNum = 0;
  4179. this.forceMax = 0;
  4180. this.turnNum = 0;
  4181. let list = arr;
  4182. let holes = xGame.common.gameMgr.holePosList;
  4183. let self = xGame.common.aiPlayer;
  4184. for (let i = 0; i < list.length; i++) {
  4185. let obj = list[i];
  4186. if (!obj)
  4187. continue;
  4188. obj.kickPos.x = 0;
  4189. obj.kickPos.y = 0;
  4190. obj.poleAngle = 0;
  4191. obj.hard = 0;
  4192. obj.borderDis = 0;
  4193. obj.kickAngle = 180;
  4194. let b = obj.gameObj;
  4195. let wbp = this.rootPos;
  4196. let bx = wbp.x - b.x;
  4197. let by = wbp.y - b.y;
  4198. obj.borderDis = xGame.tools.random(0, 100);
  4199. this.kickBall.push(obj);
  4200. if (!this.isLine(wbp, obj))
  4201. continue;
  4202. obj.kickAngle = xGame.tools.random(90, 180);
  4203. obj.kickPos.x = b.x;
  4204. obj.kickPos.y = b.y;
  4205. this.lineBall.push(obj);
  4206. let minDis = 999999;
  4207. let hole = false;
  4208. for (let j = 0; j < holes.length; j++) {
  4209. let hp = holes[j];
  4210. if (bx >= 0 && hp.x > b.x + 100)
  4211. continue;
  4212. if (bx <= 0 && hp.x < b.x - 100)
  4213. continue;
  4214. if (by < -10 && hp.y < wbp.y)
  4215. continue;
  4216. if (by > 10 && hp.y > wbp.y)
  4217. continue;
  4218. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4219. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4220. if (dis < minDis) {
  4221. let dx = b.x - this.tempDir1.x * this.ballSize;
  4222. let dy = b.y - this.tempDir1.y * this.ballSize;
  4223. this.tempDir3.x = this.tempDir1.x;
  4224. this.tempDir3.y = this.tempDir1.y;
  4225. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4226. obj.kickPos.x = dx;
  4227. obj.kickPos.y = dy;
  4228. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4229. if (num > 1)
  4230. num = 1;
  4231. obj.kickAngle = Math.acos(num) * 57.3;
  4232. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4233. dis = dis * 2;
  4234. if (Math.abs(hp.x - 600) < 100)
  4235. dis += 50;
  4236. obj.hard = dis + obj.kickAngle * 3;
  4237. hole = true;
  4238. }
  4239. }
  4240. }
  4241. }
  4242. if (hole) {
  4243. this.scoreBall.push(obj);
  4244. this.holeBall.push(obj);
  4245. }
  4246. }
  4247. this.scoreBall.sort(function (a, b) {
  4248. return a.hard - b.hard;
  4249. });
  4250. this.holeBall.sort(function (a, b) {
  4251. return a.kickAngle - b.kickAngle;
  4252. });
  4253. this.kickBall.sort(function (a, b) {
  4254. return a.borderDis - b.borderDis;
  4255. });
  4256. }
  4257. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4258. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4259. let balls = xGame.common.d2World.ballArr;
  4260. let max = xGame.tools.getDis(hx, hy, bx, by);
  4261. for (let index = 0; index < balls.length; index++) {
  4262. let obj = balls[index];
  4263. if (obj.number == 0)
  4264. continue;
  4265. if (obj.number == bn || obj.number == dn)
  4266. continue;
  4267. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4268. if (dis * dis > max)
  4269. continue;
  4270. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4271. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4272. if (num > 1)
  4273. num = 1;
  4274. if (num < 0)
  4275. continue;
  4276. let gap = Math.sin(Math.acos(num)) * dis;
  4277. if (gap < this.ballSize)
  4278. return true;
  4279. }
  4280. return false;
  4281. }
  4282. isLine(xy, ball) {
  4283. let bx = xy.x;
  4284. let by = xy.y;
  4285. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4286. let dis = ball.getDestDis(xy);
  4287. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4288. let sin = Math.sin(angle);
  4289. let cos = Math.cos(angle);
  4290. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4291. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4292. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4293. let dx = bx + this.tempDir2.x * dis;
  4294. let dy = by + this.tempDir2.y * dis;
  4295. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4296. sin = Math.sin(-angle);
  4297. cos = Math.cos(-angle);
  4298. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4299. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4300. dx = bx + this.tempDir2.x * dis;
  4301. dy = by + this.tempDir2.y * dis;
  4302. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4303. if (isr && isl)
  4304. return false;
  4305. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4306. }
  4307. return true;
  4308. }
  4309. setKick(dx, dy) {
  4310. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4311. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4312. this.tempDir1.x = 0;
  4313. this.tempDir1.y = 1;
  4314. this.tempDir2.y = -this.tempDir2.y;
  4315. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4316. if (num > 1)
  4317. num = 1;
  4318. let rot = Math.acos(num) * 57.3;
  4319. if (this.tempDir2.x < 0)
  4320. rot = 360 - rot;
  4321. this.destRot += rot;
  4322. }
  4323. }
  4324. class ui_UIGame extends fgui.GComponent {
  4325. static createInstance() {
  4326. return (fgui.UIPackage.createObject("game", "UIGame"));
  4327. }
  4328. onConstruct() {
  4329. this.c1 = this.getController("c1");
  4330. this.d3Root = (this.getChild("d3Root"));
  4331. this.clickNode = (this.getChild("clickNode"));
  4332. this.d2Root = (this.getChild("d2Root"));
  4333. this.topNode = (this.getChild("topNode"));
  4334. this.n72 = (this.getChild("n72"));
  4335. this.n40 = (this.getChild("n40"));
  4336. this.rulerNode = (this.getChild("rulerNode"));
  4337. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4338. this.n50 = (this.getChild("n50"));
  4339. this.keduNode = (this.getChild("keduNode"));
  4340. this.powerTxt = (this.getChild("powerTxt"));
  4341. this.powerNode = (this.getChild("powerNode"));
  4342. this.colorNode = (this.getChild("colorNode"));
  4343. this.powerEft = (this.getChild("powerEft"));
  4344. this.myPowerNode = (this.getChild("myPowerNode"));
  4345. this.ganNode = (this.getChild("ganNode"));
  4346. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4347. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4348. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4349. this.skillRod = (this.getChild("skillRod"));
  4350. this.border = (this.getChild("border"));
  4351. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4352. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4353. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4354. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4355. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4356. this.guanyuNode = (this.getChild("guanyuNode"));
  4357. this.helpBtn = (this.getChild("helpBtn"));
  4358. this.wordsBtn = (this.getChild("wordsBtn"));
  4359. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4360. this.returnBtn = (this.getChild("returnBtn"));
  4361. this.ballNode = (this.getChild("ballNode"));
  4362. this.whiteAni = (this.getChild("whiteAni"));
  4363. this.blackAni = (this.getChild("blackAni"));
  4364. this.selfTurn = (this.getChild("selfTurn"));
  4365. this.aiTurn = (this.getChild("aiTurn"));
  4366. this.deskNode = (this.getChild("deskNode"));
  4367. this.moveNode = (this.getChild("moveNode"));
  4368. this.selfTalk = (this.getChild("selfTalk"));
  4369. this.aiTalk = (this.getChild("aiTalk"));
  4370. this.d2Node = (this.getChild("d2Node"));
  4371. this.snowNode = (this.getChild("snowNode"));
  4372. this.guide2 = (this.getChild("guide2"));
  4373. this.guide1 = (this.getChild("guide1"));
  4374. this.guide3 = (this.getChild("guide3"));
  4375. this.guideNode = (this.getChild("guideNode"));
  4376. }
  4377. }
  4378. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4379. class ui_UIGameEnd extends fgui.GComponent {
  4380. static createInstance() {
  4381. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4382. }
  4383. onConstruct() {
  4384. this.c1 = this.getController("c1");
  4385. this.n22 = (this.getChild("n22"));
  4386. this.n2 = (this.getChild("n2"));
  4387. this.n52 = (this.getChild("n52"));
  4388. this.n53 = (this.getChild("n53"));
  4389. this.coinNode = (this.getChild("coinNode"));
  4390. this.closeNode = (this.getChild("closeNode"));
  4391. this.moneyNode = (this.getChild("moneyNode"));
  4392. this.secretary = (this.getChild("secretary"));
  4393. this.n27 = (this.getChild("n27"));
  4394. this.n29 = (this.getChild("n29"));
  4395. this.talkNode = (this.getChild("talkNode"));
  4396. this.n38 = (this.getChild("n38"));
  4397. this.n39 = (this.getChild("n39"));
  4398. this.n40 = (this.getChild("n40"));
  4399. this.awardNode = (this.getChild("awardNode"));
  4400. this.starNumNode = (this.getChild("starNumNode"));
  4401. this.n47 = (this.getChild("n47"));
  4402. this.conditionNode = (this.getChild("conditionNode"));
  4403. this.isGetAward = (this.getChild("isGetAward"));
  4404. this.leftBtn = (this.getChild("leftBtn"));
  4405. this.rightBtn = (this.getChild("rightBtn"));
  4406. this.btnNode = (this.getChild("btnNode"));
  4407. }
  4408. }
  4409. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4410. class ui_UIAddCoin extends fgui.GComponent {
  4411. static createInstance() {
  4412. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4413. }
  4414. onConstruct() {
  4415. this.n11 = (this.getChild("n11"));
  4416. this.myNode = (this.getChild("myNode"));
  4417. this.t0 = this.getTransition("t0");
  4418. }
  4419. }
  4420. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4421. class UIAddCoin extends UIBase {
  4422. constructor() {
  4423. super();
  4424. this.coinNum = 2000;
  4425. }
  4426. onConstructor() {
  4427. this.ui = ui_UIAddCoin.createInstance();
  4428. this.contentPane = this.ui;
  4429. this.isEject = false;
  4430. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4431. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4432. }
  4433. show() {
  4434. super.show();
  4435. this.ui.t0.play();
  4436. }
  4437. videoAddCoin() {
  4438. console.log('zh:qjff_AD_for_UIAddCoin');
  4439. if (Laya.Browser.onAndroid) {
  4440. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4441. if (!boo) {
  4442. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4443. return;
  4444. }
  4445. }
  4446. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4447. }
  4448. else {
  4449. console.log('zh:AD 失败,直接发放奖励');
  4450. this.qjff_AD_for_UIAddCoin();
  4451. }
  4452. }
  4453. qjff_AD_for_UIAddCoin() {
  4454. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4455. this.hide();
  4456. }
  4457. }
  4458. UIAddCoin.uiName = "UIAddCoin";
  4459. class ui_UIInvitation extends fgui.GComponent {
  4460. static createInstance() {
  4461. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4462. }
  4463. onConstruct() {
  4464. this.n14 = (this.getChild("n14"));
  4465. this.myNode = (this.getChild("myNode"));
  4466. this.t0 = this.getTransition("t0");
  4467. }
  4468. }
  4469. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4470. class UIInvitation extends UIBase {
  4471. constructor() {
  4472. super();
  4473. }
  4474. onConstructor() {
  4475. this.ui = ui_UIInvitation.createInstance();
  4476. this.contentPane = this.ui;
  4477. this.isEject = false;
  4478. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4479. }
  4480. show() {
  4481. super.show();
  4482. }
  4483. enterGame() {
  4484. xGame.common.gameMode = GameMode.classic;
  4485. DataMgr.setChallengeTimes(1);
  4486. xGame.common.passAwardCoin = 2000;
  4487. let need = xGame.common.classicNiceNeddCoin;
  4488. if (DataMgr.coinEnough(need)) {
  4489. DataMgr.setCoin(-need);
  4490. xGame.eventMgr.event(RESTART_GAME, true);
  4491. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4492. }
  4493. else {
  4494. xGame.eventMgr.event(RESTART_GAME, true);
  4495. }
  4496. this.hide();
  4497. }
  4498. hide() {
  4499. super.hide();
  4500. }
  4501. }
  4502. UIInvitation.uiName = "UIInvitation";
  4503. class ui_UIMain extends fgui.GComponent {
  4504. static createInstance() {
  4505. return (fgui.UIPackage.createObject("game", "UIMain"));
  4506. }
  4507. onConstruct() {
  4508. this.n47 = (this.getChild("n47"));
  4509. this.n10 = (this.getChild("n10"));
  4510. this.secretary = (this.getChild("secretary"));
  4511. this.moneyNode = (this.getChild("moneyNode"));
  4512. this.headNode = (this.getChild("headNode"));
  4513. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4514. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4515. this.classicBtn = (this.getChild("classicBtn"));
  4516. this.globalBtn = (this.getChild("globalBtn"));
  4517. this.n44 = (this.getChild("n44"));
  4518. this.n_dengLu = (this.getChild("n_dengLu"));
  4519. this.settingNode = (this.getChild("settingNode"));
  4520. this.drawBtn = (this.getChild("drawBtn"));
  4521. this.signBtn = (this.getChild("signBtn"));
  4522. this.shopBtn = (this.getChild("shopBtn"));
  4523. this.n45 = (this.getChild("n45"));
  4524. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4525. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4526. this.rankBtn = (this.getChild("rankBtn"));
  4527. this.n46 = (this.getChild("n46"));
  4528. this.liucheng1 = (this.getChild("liucheng1"));
  4529. this.rightBtn = (this.getChild("rightBtn"));
  4530. this.n75 = (this.getChild("n75"));
  4531. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4532. this.liucheng2 = (this.getChild("liucheng2"));
  4533. this.guideBtn = (this.getChild("guideBtn"));
  4534. this.n73 = (this.getChild("n73"));
  4535. this.wordsNode = (this.getChild("wordsNode"));
  4536. this.enterGuide = (this.getChild("enterGuide"));
  4537. this.talkNode = (this.getChild("talkNode"));
  4538. this.n83 = (this.getChild("n83"));
  4539. this.n84 = (this.getChild("n84"));
  4540. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4541. }
  4542. }
  4543. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4544. class ui_UIMoyu extends fgui.GComponent {
  4545. static createInstance() {
  4546. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4547. }
  4548. onConstruct() {
  4549. this.ageTip = (this.getChild("ageTip"));
  4550. this.mainBg = (this.getChild("mainBg"));
  4551. this.xyNode = (this.getChild("xyNode"));
  4552. this.rnNode = (this.getChild("rnNode"));
  4553. this.fcmNode = (this.getChild("fcmNode"));
  4554. this.ageNode = (this.getChild("ageNode"));
  4555. this.tipNode = (this.getChild("tipNode"));
  4556. this.msgNode = (this.getChild("msgNode"));
  4557. }
  4558. }
  4559. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4560. class MoyuMgr {
  4561. static initMoyu() {
  4562. this.moyuView = new MoyuView();
  4563. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4564. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4565. this.moyuView.ui.displayObject.zOrder = 1000;
  4566. this.moyuView.init();
  4567. this.moyuView.showTip(true);
  4568. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4569. window['XApk'] = this;
  4570. }
  4571. static showAge(show) {
  4572. if (this.moyuView)
  4573. this.moyuView.showAge(show);
  4574. }
  4575. static onPlatMsg(idx) {
  4576. if (!MoyuMgr.moyuView)
  4577. return;
  4578. if (idx == '0') {
  4579. MoyuMgr.moyuView.showTip(false);
  4580. }
  4581. }
  4582. static showAgree(call) {
  4583. if (this.moyuView)
  4584. this.moyuView.showAgree(call);
  4585. else
  4586. call && call();
  4587. }
  4588. static showXy(type = 1) {
  4589. if (this.moyuView)
  4590. this.moyuView.showXy(type);
  4591. }
  4592. }
  4593. MoyuMgr.isAdvise = false;
  4594. class MoyuView {
  4595. constructor() {
  4596. this.ysxyNum = 1;
  4597. this.ysJson = null;
  4598. this.ui = ui_UIMoyu.createInstance();
  4599. }
  4600. init() {
  4601. this.ui.mainBg.visible = false;
  4602. this.ui.xyNode.visible = false;
  4603. this.ui.ageNode.visible = false;
  4604. this.ui.tipNode.visible = false;
  4605. this.ui.rnNode.visible = false;
  4606. this.ui.fcmNode.visible = false;
  4607. this.ui.ageTip.visible = false;
  4608. this.ui.msgNode.visible = false;
  4609. this.ui.visible = false;
  4610. this.ui.xyNode.xyList.setVirtual();
  4611. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4612. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4613. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4614. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4615. this.ui.xyNode.btnKnown.visible = false;
  4616. this.ui.xyNode.xy1.visible = false;
  4617. this.ui.xyNode.xy2.visible = false;
  4618. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4619. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4620. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4621. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4622. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4623. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4624. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4625. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4626. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4627. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4628. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4629. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4630. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4631. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4632. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4633. this.ysxyNum = 2;
  4634. }
  4635. }
  4636. onClick(obj) {
  4637. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4638. switch (obj) {
  4639. case this.ui.ageTip:
  4640. if (Moyu.isTTApk) {
  4641. this.ui.ageNode.visible = true;
  4642. this.ui.mainBg.visible = true;
  4643. }
  4644. break;
  4645. case this.ui.tipNode:
  4646. this.showTip(false);
  4647. break;
  4648. case this.ui.ageNode.btnAge:
  4649. this.ui.ageNode.visible = false;
  4650. this.ui.mainBg.visible = false;
  4651. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4652. this.ui.visible = false;
  4653. break;
  4654. case this.ui.xyNode.btnXy3:
  4655. case this.ui.xyNode.btnXy1:
  4656. this.loadXy(1);
  4657. break;
  4658. case this.ui.xyNode.btnXy2:
  4659. this.loadXy(2);
  4660. break;
  4661. case this.ui.xyNode.btnBack:
  4662. this.ui.xyNode.xy1.visible = true;
  4663. this.ui.xyNode.xy2.visible = false;
  4664. break;
  4665. case this.ui.xyNode.btnKnown:
  4666. this.ui.xyNode.visible = false;
  4667. this.ui.mainBg.visible = false;
  4668. this.ui.visible = false;
  4669. break;
  4670. case this.ui.rnNode.btnCheck:
  4671. this.check();
  4672. break;
  4673. case this.ui.rnNode.btnExit:
  4674. case this.ui.xyNode.btnNo:
  4675. this.ysxyNum--;
  4676. if (this.ysxyNum > 0)
  4677. this.showMsg("Refuse to quit the game once again");
  4678. else {
  4679. Moyu.userAgree(false);
  4680. Moyu.exit();
  4681. }
  4682. break;
  4683. case this.ui.xyNode.btnSure:
  4684. case this.ui.xyNode.btnYes:
  4685. DataMgr.userData.isAgree = true;
  4686. DataMgr.saveUserData();
  4687. this.onAgree();
  4688. break;
  4689. case this.ui.rnNode.btnDone:
  4690. this.ui.rnNode.visible = false;
  4691. this.ui.visible = false;
  4692. break;
  4693. case this.ui.fcmNode.btnRn:
  4694. this.showRn();
  4695. break;
  4696. }
  4697. }
  4698. showTip(show) {
  4699. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4700. return;
  4701. if (show) {
  4702. MoyuMgr.isAdvise = true;
  4703. this.ui.visible = true;
  4704. this.ui.tipNode.visible = true;
  4705. this.ui.tipNode.alpha = 1;
  4706. Laya.timer.once(1000, this, this.showTip, [false]);
  4707. }
  4708. else {
  4709. this.ui.tipNode.alpha = 1;
  4710. this.ui.tipNode.visible = true;
  4711. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4712. this.ui.tipNode.visible = false;
  4713. MoyuMgr.isAdvise = false;
  4714. }), 1000);
  4715. }
  4716. }
  4717. showAge(show, px = 0, py = 0) {
  4718. if (Moyu.platType > 10 && !Moyu.isIos) {
  4719. this.ui.ageTip.x = px;
  4720. this.ui.ageTip.y = py;
  4721. this.ui.ageTip.visible = show;
  4722. if (show)
  4723. this.ui.visible = true;
  4724. }
  4725. }
  4726. showAgree(call) {
  4727. this.agreeCall = call;
  4728. this.onAgree();
  4729. return;
  4730. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4731. this.showXy(0);
  4732. }
  4733. else
  4734. this.onAgree();
  4735. }
  4736. onAgree() {
  4737. if (!this.ui.ageNode.visible)
  4738. this.ui.visible = false;
  4739. this.ui.xyNode.visible = false;
  4740. Moyu.userAgree(true);
  4741. this.showAge(false);
  4742. this.agreeCall && this.agreeCall();
  4743. this.showRn();
  4744. }
  4745. showMsg(txt) {
  4746. this.ui.msgNode.txtMsg.text = txt;
  4747. this.ui.msgNode.visible = true;
  4748. this.ui.msgNode.alpha = 1;
  4749. this.ui.visible = true;
  4750. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4751. this.ui.msgNode.visible = false;
  4752. }), 2500, true);
  4753. }
  4754. showRn() {
  4755. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4756. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4757. this.ui.rnNode.rn1.visible = true;
  4758. this.ui.rnNode.rn2.visible = false;
  4759. this.ui.rnNode.rn3.visible = false;
  4760. this.ui.rnNode.rn4.visible = false;
  4761. this.ui.rnNode.visible = true;
  4762. this.ui.mainBg.visible = true;
  4763. this.ui.rnNode.btnDone.visible = false;
  4764. this.ui.rnNode.btnExit.visible = true;
  4765. this.ui.rnNode.btnCheck.visible = true;
  4766. this.ui.fcmNode.visible = false;
  4767. this.ui.visible = true;
  4768. return;
  4769. }
  4770. }
  4771. this.showFcm();
  4772. }
  4773. showFcm() {
  4774. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4775. Moyu.initFCM(true);
  4776. if (Moyu.gameTime < 1)
  4777. this.fcmLoop();
  4778. else if (Moyu.gameTime < 999)
  4779. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4780. }
  4781. }
  4782. fcmLoop() {
  4783. if (Moyu.gameTime < 1) {
  4784. this.ui.rnNode.visible = false;
  4785. this.ui.fcmNode.visible = true;
  4786. this.ui.mainBg.visible = true;
  4787. this.ui.visible = true;
  4788. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4789. Laya.timer.clear(this.ui, this.fcmLoop);
  4790. }
  4791. }
  4792. check() {
  4793. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4794. this.ui.rnNode.rn1.visible = false;
  4795. this.ui.rnNode.rn2.visible = false;
  4796. this.ui.rnNode.rn4.visible = true;
  4797. }
  4798. else if (this.ui.rnNode.rn4.visible) {
  4799. let name = this.ui.rnNode.inputName.text;
  4800. let code = this.ui.rnNode.inputCode.text;
  4801. if (code && code.length == 18) {
  4802. this.ui.rnNode.rn1.visible = false;
  4803. this.ui.rnNode.rn4.visible = false;
  4804. Moyu.authenticate(name, code, (res) => {
  4805. this.ui.rnNode.rn2.visible = !res;
  4806. this.ui.rnNode.rn3.visible = res;
  4807. this.ui.rnNode.btnDone.visible = res;
  4808. this.ui.rnNode.btnExit.visible = !res;
  4809. this.ui.rnNode.btnCheck.visible = !res;
  4810. if (res)
  4811. this.showFcm();
  4812. });
  4813. }
  4814. else
  4815. this.showMsg("信息填写不完整");
  4816. }
  4817. }
  4818. loadXy(type = 0) {
  4819. this.ui.xyNode.xy1.visible = false;
  4820. this.ui.xyNode.xy2.visible = true;
  4821. this.ui.xyNode.xyList.scrollToView(0);
  4822. if (type == 1) {
  4823. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4824. }
  4825. else if (type == 2) {
  4826. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4827. }
  4828. }
  4829. showXy(type = 0) {
  4830. this.xyBtn();
  4831. if (type == 0) {
  4832. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4833. this.ui.xyNode.btnSure.visible = true;
  4834. }
  4835. else {
  4836. this.ui.xyNode.btnYes.visible = true;
  4837. this.ui.xyNode.btnNo.visible = true;
  4838. }
  4839. }
  4840. else {
  4841. this.ui.xyNode.btnKnown.visible = true;
  4842. this.ui.mainBg.visible = true;
  4843. }
  4844. this.ui.xyNode.xy1.visible = true;
  4845. this.ui.xyNode.xy2.visible = false;
  4846. this.ui.xyNode.visible = true;
  4847. this.ui.visible = true;
  4848. }
  4849. xyBtn() {
  4850. this.ui.xyNode.btnSure.visible = false;
  4851. this.ui.xyNode.btnYes.visible = false;
  4852. this.ui.xyNode.btnNo.visible = false;
  4853. this.ui.xyNode.btnKnown.visible = false;
  4854. {
  4855. this.ui.xyNode.btnXy3.visible = false;
  4856. this.ui.xyNode.btnXy2.visible = true;
  4857. this.ui.xyNode.btnXy1.visible = true;
  4858. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4859. }
  4860. }
  4861. createXY(json) {
  4862. this.ysJson = json.content;
  4863. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4864. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4865. this.ui.xyNode.xy2.visible = true;
  4866. }
  4867. renderListItem(idx, cell) {
  4868. let xy = this.ysJson[idx];
  4869. cell.height = xy.line * 30;
  4870. cell.xyItem.text = xy.text;
  4871. }
  4872. onDestroy() {
  4873. this.agreeCall = null;
  4874. }
  4875. }
  4876. class SettingNode {
  4877. constructor(ui) {
  4878. this.showSetting = false;
  4879. this.openSound = true;
  4880. this.openShake = true;
  4881. this.ui = ui;
  4882. this.ui.soundBtn.onClick(this, this.switchSound);
  4883. this.ui.shakeBtn.onClick(this, this.switchShake);
  4884. this.ui.xyBtn.onClick(this, this.onXy);
  4885. this.ui.clickNode.onClick(this, this.changeSetting);
  4886. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4887. this.ui.xyBtn.visible = false;
  4888. this.ui.shakeBtn.visible = false;
  4889. }
  4890. changeSetting() {
  4891. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4892. this.showSetting = !this.showSetting;
  4893. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4894. }
  4895. switchSound() {
  4896. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4897. this.openSound = !this.openSound;
  4898. Moyu.onSetting(this.openSound, this.openShake);
  4899. xGame.soundMgr.onSetting(this.openSound);
  4900. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4901. }
  4902. switchShake() {
  4903. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4904. this.openShake = !this.openShake;
  4905. Moyu.onSetting(this.openSound, this.openShake);
  4906. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4907. }
  4908. onXy() {
  4909. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4910. MoyuMgr.showXy(1);
  4911. }
  4912. }
  4913. class ui_UILevelDisplay extends fgui.GComponent {
  4914. static createInstance() {
  4915. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4916. }
  4917. onConstruct() {
  4918. this.n9 = (this.getChild("n9"));
  4919. this.myNode = (this.getChild("myNode"));
  4920. this.closeNode = (this.getChild("closeNode"));
  4921. }
  4922. }
  4923. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4924. class ui_UILevelProp extends fgui.GComponent {
  4925. static createInstance() {
  4926. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4927. }
  4928. onConstruct() {
  4929. this.n16 = (this.getChild("n16"));
  4930. this.myNode = (this.getChild("myNode"));
  4931. this.closeBtn = (this.getChild("closeBtn"));
  4932. this.moneyNode = (this.getChild("moneyNode"));
  4933. this.t1 = this.getTransition("t1");
  4934. }
  4935. }
  4936. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4937. class ui_ShowItem extends fgui.GComponent {
  4938. static createInstance() {
  4939. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4940. }
  4941. onConstruct() {
  4942. this.myImg = (this.getChild("myImg"));
  4943. }
  4944. }
  4945. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4946. class ShowItem {
  4947. constructor() {
  4948. this.ui = ui_ShowItem.createInstance();
  4949. }
  4950. destroySelf() {
  4951. if (!this.ui.isDisposed) {
  4952. this.ui.removeFromParent();
  4953. this.ui.dispose();
  4954. }
  4955. }
  4956. setParent(parent) {
  4957. parent.addChild(this.ui);
  4958. }
  4959. setPos(x, y) {
  4960. this.ui.x = x;
  4961. this.ui.y = y;
  4962. }
  4963. setUrl(index) {
  4964. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4965. }
  4966. }
  4967. class ui_UIPower extends fgui.GComponent {
  4968. static createInstance() {
  4969. return (fgui.UIPackage.createObject("game", "UIPower"));
  4970. }
  4971. onConstruct() {
  4972. this.n11 = (this.getChild("n11"));
  4973. this.myNode = (this.getChild("myNode"));
  4974. this.t0 = this.getTransition("t0");
  4975. }
  4976. }
  4977. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4978. class UIPower extends UIBase {
  4979. constructor() {
  4980. super();
  4981. }
  4982. onConstructor() {
  4983. this.ui = ui_UIPower.createInstance();
  4984. this.contentPane = this.ui;
  4985. this.isEject = false;
  4986. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4987. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4988. }
  4989. show() {
  4990. super.show();
  4991. this.ui.t0.play();
  4992. }
  4993. videoGetPower() {
  4994. console.log('zh:qjff_AD_for_uipower');
  4995. if (Laya.Browser.onAndroid) {
  4996. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4997. if (!boo) {
  4998. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4999. return;
  5000. }
  5001. }
  5002. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5003. }
  5004. else {
  5005. console.log('zh:AD 失败,直接发放奖励');
  5006. this.qjff_AD_for_uipower();
  5007. }
  5008. }
  5009. qjff_AD_for_uipower() {
  5010. DataMgr.setPower(xGame.common.videoPower, true);
  5011. xGame.eventMgr.event(POWER_TIME);
  5012. this.hide();
  5013. }
  5014. }
  5015. UIPower.uiName = "UIPower";
  5016. class UILevelProp extends UIBase {
  5017. constructor() {
  5018. super();
  5019. this.firstPos = 385;
  5020. this.secondPos = 467;
  5021. this.showItemArr = [];
  5022. try {
  5023. Laya.loader.load("res/font/arial.fnt", Laya.Handler.create(this, this.onFontLoaded));
  5024. console.log("zh: constructor加载arial字体成功");
  5025. }
  5026. catch (error) {
  5027. console.log("zh: constructor加载arial字体失败");
  5028. }
  5029. }
  5030. onFontLoaded() {
  5031. try {
  5032. Laya.Text.defaultFont = "arial";
  5033. this.ui.myNode.conditionTxt.font = "arial";
  5034. console.log("zh: onFontLoaded 设置arial字体成功");
  5035. }
  5036. catch (error) {
  5037. console.log("zh: constructor onFontLoaded加载arial字体失败");
  5038. }
  5039. }
  5040. onConstructor() {
  5041. this.ui = ui_UILevelProp.createInstance();
  5042. this.contentPane = this.ui;
  5043. this.isEject = false;
  5044. this.addUIClick(this.ui.closeBtn, this.hide);
  5045. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5046. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5047. }
  5048. show(level) {
  5049. super.show();
  5050. this.ui.t1.play();
  5051. this.level = level;
  5052. this.data = cfgTable.placeballData[this.level];
  5053. this.updateSelf();
  5054. this.showPreView();
  5055. this.moneyNode.ui.c1.selectedIndex = 2;
  5056. this.moneyNode.checkPowerTime();
  5057. this.moneyNode.powerChange();
  5058. }
  5059. showPreView() {
  5060. let item;
  5061. let data;
  5062. for (let index = 0; index < this.showItemArr.length; index++) {
  5063. item = this.showItemArr[index];
  5064. item.destroySelf();
  5065. }
  5066. this.showItemArr = [];
  5067. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5068. for (const key in cfgData) {
  5069. data = cfgData[key];
  5070. item = new ShowItem();
  5071. item.setParent(this.ui.myNode.displayRoot);
  5072. item.setPos(data.x, data.y);
  5073. item.setUrl(data.value);
  5074. this.showItemArr.push(item);
  5075. }
  5076. }
  5077. updateSelf() {
  5078. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5079. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5080. if (this.data.ball == -1) {
  5081. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5082. }
  5083. else {
  5084. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5085. }
  5086. let localData = DataMgr.getPlaceBallLevel(this.level);
  5087. let getAward = localData.getAward;
  5088. let cfg = cfgTable.placeballData[this.level];
  5089. let coin = this.data.award[0];
  5090. let diamond = this.data.award[1];
  5091. if (cfg.type == PlaceBallType.challenge) {
  5092. diamond = 0;
  5093. coin = 100;
  5094. }
  5095. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5096. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5097. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5098. if (cfg.type == PlaceBallType.challenge) {
  5099. this.ui.myNode.coinNode.numTxt.text = "";
  5100. }
  5101. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5102. if (coin > 0 && diamond > 0) {
  5103. this.ui.myNode.diamondNode.x = 385;
  5104. this.ui.myNode.coinNode.x = 467;
  5105. }
  5106. else {
  5107. this.ui.myNode.diamondNode.x = 385;
  5108. this.ui.myNode.coinNode.x = 385;
  5109. }
  5110. if (!getAward) {
  5111. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5112. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5113. }
  5114. else {
  5115. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5116. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5117. }
  5118. }
  5119. startGame() {
  5120. if (DataMgr.powerEnough()) {
  5121. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5122. this.ui.myNode.startBtn.touchable = false;
  5123. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5124. console.log('zh:startGame ');
  5125. this.ui.myNode.startBtn.touchable = true;
  5126. DataMgr.setPower(-1);
  5127. xGame.eventMgr.event(POWER_TIME);
  5128. xGame.common.gameMode = GameMode.placeBall;
  5129. xGame.common.placeBallCurLevel = this.level;
  5130. xGame.uiMgr.Show(UIGame);
  5131. this.logEventForChallenge_level_start(this.level);
  5132. xGame.uiMgr.Hide(UILevelDisplay);
  5133. xGame.uiMgr.Hide(UIMain);
  5134. this.hide();
  5135. }));
  5136. }
  5137. else {
  5138. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5139. xGame.uiMgr.Show(UIPower);
  5140. }
  5141. }
  5142. logEventForChallenge_level_start(level) {
  5143. let keyStr = 'sjmd_challenge_level_start';
  5144. let jsonStr = {
  5145. "count": 1,
  5146. "gold_balance ": DataMgr.getCoin(),
  5147. "level": level,
  5148. "diamond_balance ": DataMgr.getDiamond()
  5149. };
  5150. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5151. const d = LocalStorageManager.getItem(keyStr);
  5152. if (level > d.level) {
  5153. jsonStr.count = d.count + 1;
  5154. LocalStorageManager.setItem(keyStr, jsonStr);
  5155. }
  5156. else {
  5157. }
  5158. }
  5159. else {
  5160. LocalStorageManager.setItem(keyStr, jsonStr);
  5161. }
  5162. const reqStr = JSON.stringify(jsonStr);
  5163. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5164. }
  5165. hide() {
  5166. super.hide();
  5167. }
  5168. }
  5169. UILevelProp.uiName = "UILevelProp";
  5170. class PutBallLevelDisplay {
  5171. constructor(ui, index) {
  5172. this.index = 0;
  5173. this.ui = ui;
  5174. this.index = index;
  5175. this.ui.onClick(this, this.clickSelf);
  5176. this.updateSelf();
  5177. this.ui.levelTxt.text = (this.index + 1) + "";
  5178. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5179. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5180. }
  5181. updateSelf() {
  5182. let level = this.index + 1;
  5183. this.data = DataMgr.getPlaceBallLevel(level);
  5184. this.ui.starNode.c1.selectedIndex = this.data.star;
  5185. let isChallenge = cfgTable.placeballData[level].type;
  5186. if (this.data.isCur) {
  5187. if (isChallenge) {
  5188. this.ui.c1.selectedIndex = 5;
  5189. }
  5190. else {
  5191. this.ui.c1.selectedIndex = 2;
  5192. }
  5193. }
  5194. else {
  5195. if (this.data.play) {
  5196. if (this.data.star == 3) {
  5197. this.ui.c1.selectedIndex = 0;
  5198. }
  5199. else {
  5200. this.ui.c1.selectedIndex = 1;
  5201. }
  5202. }
  5203. else {
  5204. if (isChallenge) {
  5205. this.ui.c1.selectedIndex = 4;
  5206. }
  5207. else {
  5208. this.ui.c1.selectedIndex = 3;
  5209. }
  5210. }
  5211. }
  5212. }
  5213. clickSelf() {
  5214. if (!this.data.play)
  5215. return;
  5216. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5217. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5218. }
  5219. }
  5220. class UILevelDisplay extends UIBase {
  5221. constructor() {
  5222. super();
  5223. }
  5224. onConstructor() {
  5225. this.ui = ui_UILevelDisplay.createInstance();
  5226. this.contentPane = this.ui;
  5227. this.isEject = false;
  5228. this.myList = this.ui.myNode.myList;
  5229. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5230. this.levelItemArr = [];
  5231. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5232. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5233. this.myList.numItems = levelNum;
  5234. }
  5235. levelItemRender(index, target) {
  5236. let item = new PutBallLevelDisplay(target, index);
  5237. this.levelItemArr.push(item);
  5238. }
  5239. show() {
  5240. super.show();
  5241. this.updateLevel();
  5242. this.scrollToPlace();
  5243. }
  5244. updateLevel() {
  5245. let temp;
  5246. for (let index = 0; index < this.levelItemArr.length; index++) {
  5247. temp = this.levelItemArr[index];
  5248. temp.updateSelf();
  5249. }
  5250. }
  5251. scrollToPlace() {
  5252. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5253. let passArr = DataMgr.getPlaceBallLevelList();
  5254. let offest = passArr.length;
  5255. if (offest >= maxNum - 1)
  5256. offest = maxNum - 1;
  5257. this.myList.scrollToView(offest, true, true);
  5258. }
  5259. hide() {
  5260. super.hide();
  5261. }
  5262. }
  5263. UILevelDisplay.uiName = "UILevelDisplay";
  5264. class ui_UIMatching extends fgui.GComponent {
  5265. static createInstance() {
  5266. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5267. }
  5268. onConstruct() {
  5269. this.n5 = (this.getChild("n5"));
  5270. this.n49 = (this.getChild("n49"));
  5271. this.n51 = (this.getChild("n51"));
  5272. this.n64 = (this.getChild("n64"));
  5273. this.n2 = (this.getChild("n2"));
  5274. this.n53 = (this.getChild("n53"));
  5275. this.n54 = (this.getChild("n54"));
  5276. this.n56 = (this.getChild("n56"));
  5277. this.n58 = (this.getChild("n58"));
  5278. this.n59 = (this.getChild("n59"));
  5279. this.n57 = (this.getChild("n57"));
  5280. this.n60 = (this.getChild("n60"));
  5281. this.n62 = (this.getChild("n62"));
  5282. this.awardTxt = (this.getChild("awardTxt"));
  5283. this.n61 = (this.getChild("n61"));
  5284. this.selfHead = (this.getChild("selfHead"));
  5285. this.aiHead = (this.getChild("aiHead"));
  5286. this.n82 = (this.getChild("n82"));
  5287. this.n84 = (this.getChild("n84"));
  5288. this.n83 = (this.getChild("n83"));
  5289. this.t1 = this.getTransition("t1");
  5290. this.t2 = this.getTransition("t2");
  5291. this.t3 = this.getTransition("t3");
  5292. this.t4 = this.getTransition("t4");
  5293. }
  5294. }
  5295. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5296. class UIMatching extends UIBase {
  5297. constructor() {
  5298. super();
  5299. }
  5300. onConstructor() {
  5301. this.ui = ui_UIMatching.createInstance();
  5302. this.contentPane = this.ui;
  5303. this.isEject = false;
  5304. }
  5305. show(callback) {
  5306. super.show();
  5307. PlatMgr.showBanner(true);
  5308. this.callback = callback;
  5309. let user = Moyu.getUserInfo();
  5310. if (!this.selfPot) {
  5311. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5312. }
  5313. if (!this.aiPot) {
  5314. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5315. }
  5316. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5317. this.ui.selfHead.nameTxt.text = user.nickName;
  5318. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5319. this.ui.aiHead.nameTxt.text = "???";
  5320. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5321. this.ui.selfHead.c1.selectedIndex = 0;
  5322. this.ui.aiHead.c1.selectedIndex = 0;
  5323. this.ui.selfHead.x = this.selfPot.x;
  5324. this.ui.selfHead.y = this.selfPot.y;
  5325. this.ui.aiHead.x = this.aiPot.x;
  5326. this.ui.aiHead.y = this.aiPot.y;
  5327. switch (xGame.common.gameMode) {
  5328. case GameMode.classic:
  5329. break;
  5330. case GameMode.bigMove:
  5331. this.initSkillData();
  5332. break;
  5333. default:
  5334. break;
  5335. }
  5336. this.ui.t1.play(Laya.Handler.create(this, () => {
  5337. this.ui.t2.play(Laya.Handler.create(this, () => {
  5338. switch (xGame.common.gameMode) {
  5339. case GameMode.classic:
  5340. this.waitingPeople();
  5341. break;
  5342. case GameMode.bigMove:
  5343. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5344. break;
  5345. default:
  5346. break;
  5347. }
  5348. }));
  5349. }));
  5350. }
  5351. initSkillData() {
  5352. this.skillSelectData = [];
  5353. let skillUrl = xGame.common.skillIconList;
  5354. let skillName = xGame.common.skillNameList;
  5355. let skillLevel = DataMgr.getBigSkillList();
  5356. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5357. for (let index = 0; index < 5; index++) {
  5358. let obj = {};
  5359. obj.skillImg = skillUrl[index];
  5360. obj.skillName = skillName[index];
  5361. obj.skillType = skillType[index];
  5362. obj.skillLevel = skillLevel[index];
  5363. this.skillSelectData.push(obj);
  5364. }
  5365. }
  5366. getAISkillLevel(myLevel) {
  5367. let video = xGame.common.upSkillLevel;
  5368. let aiLevel;
  5369. let temp;
  5370. if (video) {
  5371. temp = xGame.common.randomNum(-2, -1);
  5372. }
  5373. else {
  5374. if (myLevel <= 5) {
  5375. temp = xGame.common.randomNum(1, 3);
  5376. }
  5377. else if (myLevel <= 9) {
  5378. temp = xGame.common.randomNum(-2, 1);
  5379. }
  5380. else {
  5381. temp = xGame.common.randomNum(-4, 0);
  5382. }
  5383. }
  5384. aiLevel = temp + myLevel;
  5385. if (aiLevel <= 1)
  5386. aiLevel = 1;
  5387. if (aiLevel >= 10)
  5388. aiLevel = 10;
  5389. return aiLevel;
  5390. }
  5391. getAISkillType() {
  5392. return xGame.common.randomNum(1, 4);
  5393. let successTimes = DataMgr.getSkillSuccessTimes();
  5394. let info = cfgTable.aiskillData[successTimes];
  5395. if (!info) {
  5396. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5397. info = cfgTable.aiskillData[max];
  5398. }
  5399. let dataArr = info.skillselect;
  5400. let myCfg = {};
  5401. for (let index = 0; index < dataArr.length; index++) {
  5402. let temp = dataArr[index].split('-');
  5403. myCfg[temp[0]] = {};
  5404. myCfg[temp[0]].id = parseInt(temp[0]);
  5405. myCfg[temp[0]].weight = parseInt(temp[1]);
  5406. }
  5407. let aiCfg = xGame.common.initWeight(myCfg);
  5408. let curData = xGame.common.getRandomWeightData(aiCfg);
  5409. return parseInt(curData.id);
  5410. }
  5411. getAISkillData(index) {
  5412. let myLevel = this.skillSelectData[index].skillLevel;
  5413. let aiLevel = this.getAISkillLevel(myLevel);
  5414. let aiType = this.getAISkillType() - 1;
  5415. return { aiLevel, aiType } = { aiLevel, aiType };
  5416. }
  5417. skillSelectFinish(index) {
  5418. let aiInfo = this.getAISkillData(index);
  5419. xGame.common.gameMgr.selfCurSkill = index;
  5420. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5421. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5422. this.ui.selfHead.c1.selectedIndex = 1;
  5423. this.ui.aiHead.c1.selectedIndex = 1;
  5424. let myData = this.skillSelectData[index];
  5425. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5426. let guide = DataMgr.getSkillGuide();
  5427. if (guide == 0) {
  5428. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5429. }
  5430. else {
  5431. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5432. }
  5433. let aiData = this.skillSelectData[aiInfo.aiType];
  5434. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5435. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5436. this.waitingPeople();
  5437. }
  5438. waitingPeople() {
  5439. let time = xGame.common.randomNum(1000, 3000);
  5440. time += 1000;
  5441. Laya.timer.once(time, this, () => {
  5442. this.matchingSuccess();
  5443. });
  5444. }
  5445. matchingSuccess() {
  5446. let gameUI = xGame.common.gameUI;
  5447. let name = gameUI.ui.topNode.aiNameTxt.text;
  5448. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5449. this.ui.aiHead.nameTxt.text = name;
  5450. this.ui.aiHead.headImg.url = url;
  5451. name = gameUI.ui.topNode.selfNameTxt.text;
  5452. url = gameUI.ui.topNode.selfHeadLoader.url;
  5453. this.ui.selfHead.nameTxt.text = name;
  5454. this.ui.selfHead.headImg.url = url;
  5455. this.ui.t3.play(Laya.Handler.create(this, () => {
  5456. this.callback && this.callback();
  5457. this.ui.t4.play(Laya.Handler.create(this, () => {
  5458. this.destroySelf();
  5459. }));
  5460. }));
  5461. }
  5462. destroySelf() {
  5463. this.callback = null;
  5464. this.skillSelectData = null;
  5465. this.selfPot = null;
  5466. this.aiPot = null;
  5467. if (!this.ui.isDisposed) {
  5468. this.ui.removeFromParent();
  5469. this.ui.dispose();
  5470. }
  5471. xGame.uiMgr.destroyUI(this);
  5472. }
  5473. }
  5474. UIMatching.uiName = "UIMatching";
  5475. class ui_UIRanking extends fgui.GComponent {
  5476. static createInstance() {
  5477. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5478. }
  5479. onConstruct() {
  5480. this.n26 = (this.getChild("n26"));
  5481. this.myNode = (this.getChild("myNode"));
  5482. }
  5483. }
  5484. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5485. class UIRanking extends UIBase {
  5486. constructor() {
  5487. super();
  5488. this.showSelf = true;
  5489. this.rankType = 1;
  5490. this.rankList = [];
  5491. this.topX = 10;
  5492. this.myIndex = this.topX + 1;
  5493. this.myStar = 0;
  5494. }
  5495. onConstructor() {
  5496. this.ui = ui_UIRanking.createInstance();
  5497. this.contentPane = this.ui;
  5498. this.isEject = false;
  5499. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5500. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5501. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5502. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5503. this.ui.myNode.myList.setVirtual();
  5504. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5505. }
  5506. show() {
  5507. super.show();
  5508. this.getPaiHangBangDataFormJosnFile();
  5509. this.updateSelf();
  5510. let self = Moyu.getUserInfo();
  5511. if (!self.isAuth) {
  5512. Moyu.initUser(this, () => {
  5513. DataMgr.upRankData();
  5514. });
  5515. }
  5516. }
  5517. getPaiHangBangDataFormJosnFile() {
  5518. const rankingList = cfgTable.paiHangBangData.list;
  5519. this.updateItemData(rankingList);
  5520. }
  5521. updateSelfItem() {
  5522. console.log('zh:Moyu.platType =' + Moyu.platType);
  5523. let self = Moyu.getUserInfo();
  5524. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5525. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5526. if (this.myIndex > this.topX) {
  5527. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5528. }
  5529. else {
  5530. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5531. }
  5532. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5533. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5534. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5535. }
  5536. updateItemData(data) {
  5537. this.myStar = xGame.common.getAllStarNum();
  5538. if (this.rankList.length < 2) {
  5539. this.rankList = data;
  5540. let self = Moyu.getUserInfo();
  5541. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5542. self.headIcon = self.headIcon;
  5543. for (let i = 0; i < data.length; i++) {
  5544. let data = this.rankList[i];
  5545. if (data.userId == self.userId) {
  5546. this.rankList.splice(i, 1);
  5547. break;
  5548. }
  5549. }
  5550. for (let i = 0; i < data.length; i++) {
  5551. let data = this.rankList[i];
  5552. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5553. this.myIndex = i + 1;
  5554. let user = { headIcon: self.headIcon, nickName: "myself" };
  5555. let ud = { user: user, data: {} };
  5556. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5557. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5558. if (Moyu.platType < 11) {
  5559. user.headIcon = self.headIcon;
  5560. user.nickName = self.nickName;
  5561. }
  5562. this.rankList.splice(i, 0, md);
  5563. break;
  5564. }
  5565. }
  5566. }
  5567. this.updateSelfItem();
  5568. this.ui.myNode.myList.numItems = this.rankList.length;
  5569. }
  5570. updateItemUI(index, obj) {
  5571. let data = this.rankList[index];
  5572. let userData = JSON.parse(data.userData).user;
  5573. obj.nameTxt.text = userData.nickName.toString();
  5574. obj.valueTxt.text = data.rankScore;
  5575. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5576. obj.rankTxt.text = index + 1;
  5577. switch (index) {
  5578. case 0:
  5579. this.setImg(obj, 1, 0, 0);
  5580. obj.rankTxt.color = "#FFC047";
  5581. break;
  5582. case 1:
  5583. this.setImg(obj, 0, 1, 0);
  5584. obj.rankTxt.color = "#ACACAC";
  5585. break;
  5586. case 2:
  5587. this.setImg(obj, 0, 0, 1);
  5588. obj.rankTxt.color = "#D09672";
  5589. break;
  5590. default:
  5591. this.setImg(obj, 0, 0, 0);
  5592. obj.rankTxt.color = "#496FAB";
  5593. break;
  5594. }
  5595. }
  5596. setImg(obj, a, b, c) {
  5597. obj.img1.visible = a ? true : false;
  5598. obj.img2.visible = b ? true : false;
  5599. obj.img3.visible = c ? true : false;
  5600. }
  5601. changeList(type) {
  5602. this.rankType = type;
  5603. this.updateSelf();
  5604. }
  5605. changeSelfNode() {
  5606. this.showSelf = !this.showSelf;
  5607. this.updateSelf();
  5608. }
  5609. updateSelf() {
  5610. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5611. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5612. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5613. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5614. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5615. }
  5616. }
  5617. UIRanking.uiName = "UIRanking";
  5618. class ui_UISecretary extends fgui.GComponent {
  5619. static createInstance() {
  5620. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5621. }
  5622. onConstruct() {
  5623. this.n0 = (this.getChild("n0"));
  5624. this.myNode = (this.getChild("myNode"));
  5625. this.closeBtn = (this.getChild("closeBtn"));
  5626. this.t0 = this.getTransition("t0");
  5627. }
  5628. }
  5629. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5630. class UISecretary extends UIBase {
  5631. constructor() {
  5632. super();
  5633. this.curIndex = 1;
  5634. }
  5635. onConstructor() {
  5636. this.ui = ui_UISecretary.createInstance();
  5637. this.contentPane = this.ui;
  5638. this.isEject = false;
  5639. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5640. this.nodeObj = { left: null, right: null, cur: null };
  5641. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5642. }
  5643. show() {
  5644. super.show();
  5645. this.ui.t0.play();
  5646. this.updateData();
  5647. }
  5648. addSecretarySpine(node, spineName) {
  5649. if (spineName == "mishu") {
  5650. if (this.secretarySpine1) {
  5651. node.displayObject.destroyChildren();
  5652. this.playWoman(this.secretarySpine1, node.displayObject);
  5653. }
  5654. else {
  5655. let spine1 = new SpineMgr("mishu", () => {
  5656. this.secretarySpine1 = spine1;
  5657. this.playWoman(this.secretarySpine1, node.displayObject);
  5658. });
  5659. }
  5660. }
  5661. else {
  5662. if (this.secretarySpine2) {
  5663. node.displayObject.destroyChildren();
  5664. this.playWoman(this.secretarySpine2, node.displayObject);
  5665. }
  5666. else {
  5667. let spine2 = new SpineMgr("xiaomishu2", () => {
  5668. this.secretarySpine2 = spine2;
  5669. this.playWoman(this.secretarySpine2, node.displayObject);
  5670. });
  5671. }
  5672. }
  5673. }
  5674. playWoman(node, parent) {
  5675. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5676. let yy = this.ui.myNode.gameNode3.secretary.height;
  5677. let scale = 1.5;
  5678. if (node == this.secretarySpine2) {
  5679. scale = 1.2;
  5680. }
  5681. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5682. node.play(data, 0, true, parent);
  5683. }
  5684. turnLeft() {
  5685. this.curIndex--;
  5686. if (this.curIndex < 1) {
  5687. this.curIndex = 2;
  5688. }
  5689. let left = this.nodeObj.left;
  5690. let right = this.nodeObj.right;
  5691. let cur = this.nodeObj.cur;
  5692. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5693. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5694. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5695. this.updateData();
  5696. }));
  5697. this.ui.myNode.setChildIndex(right, 2);
  5698. this.nodeObj.left = cur;
  5699. this.nodeObj.right = left;
  5700. this.nodeObj.cur = right;
  5701. }
  5702. turnRight() {
  5703. this.curIndex++;
  5704. if (this.curIndex > 2) {
  5705. this.curIndex = 1;
  5706. }
  5707. let left = this.nodeObj.left;
  5708. let right = this.nodeObj.right;
  5709. let cur = this.nodeObj.cur;
  5710. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5711. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5712. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5713. this.updateData();
  5714. }));
  5715. this.ui.myNode.setChildIndex(left, 2);
  5716. this.nodeObj.left = right;
  5717. this.nodeObj.right = cur;
  5718. this.nodeObj.cur = left;
  5719. }
  5720. updateData() {
  5721. console.log('zh: updateData FFFFFFFFFF');
  5722. let data = cfgTable.secretaryshopData;
  5723. let children = this.ui.myNode._children;
  5724. let temp;
  5725. let curData;
  5726. for (let index = 0; index < children.length; index++) {
  5727. temp = children[index];
  5728. curData = data[1];
  5729. temp.heightTxt.text = curData.height;
  5730. temp.foodTxt.text = curData.food;
  5731. temp.historyTxt.text = curData.history;
  5732. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5733. this.addSecretarySpine(temp.secretary, curData.spine);
  5734. let womanIndex = curData.id - 1;
  5735. let getWoman = DataMgr.getSecretary(womanIndex);
  5736. let curUse = DataMgr.getCurSecretary();
  5737. if (getWoman) {
  5738. if (curUse == womanIndex) {
  5739. temp.purchaseBtn.c1.selectedIndex = 1;
  5740. }
  5741. else {
  5742. temp.purchaseBtn.c1.selectedIndex = 2;
  5743. }
  5744. }
  5745. else {
  5746. temp.purchaseBtn.c1.selectedIndex = 0;
  5747. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5748. }
  5749. temp.purchaseBtn.visible = false;
  5750. }
  5751. }
  5752. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5753. console.log('zh: 点击了clickSecretary ');
  5754. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5755. if (getWoman) {
  5756. if (curUse != womanIndex) {
  5757. console.log();
  5758. DataMgr.setCurSecretary(womanIndex);
  5759. this.updateData();
  5760. }
  5761. }
  5762. else {
  5763. console.log('zh:点击购买了');
  5764. let need = needDiamond;
  5765. if (DataMgr.diamondEnough(need)) {
  5766. DataMgr.setDiamond(-need);
  5767. DataMgr.setSecretary(womanIndex, 1);
  5768. DataMgr.setCurSecretary(womanIndex);
  5769. this.updateData();
  5770. }
  5771. else {
  5772. xGame.uiMgr.Show(UIAddProp, 1);
  5773. }
  5774. }
  5775. }
  5776. closeSelf() {
  5777. this.hide();
  5778. }
  5779. }
  5780. UISecretary.uiName = "UISecretary";
  5781. class ui_UIShop extends fgui.GComponent {
  5782. static createInstance() {
  5783. return (fgui.UIPackage.createObject("game", "UIShop"));
  5784. }
  5785. onConstruct() {
  5786. this.n48 = (this.getChild("n48"));
  5787. this.n0 = (this.getChild("n0"));
  5788. this.secretary = (this.getChild("secretary"));
  5789. this.talkNode = (this.getChild("talkNode"));
  5790. this.closeNode = (this.getChild("closeNode"));
  5791. this.moneyNode = (this.getChild("moneyNode"));
  5792. this.myNode = (this.getChild("myNode"));
  5793. }
  5794. }
  5795. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5796. class ui_UIMsg extends fgui.GComponent {
  5797. static createInstance() {
  5798. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5799. }
  5800. onConstruct() {
  5801. this.tipsNode = (this.getChild("tipsNode"));
  5802. }
  5803. }
  5804. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5805. class UIMsg extends UIBase {
  5806. constructor() {
  5807. super();
  5808. }
  5809. onConstructor() {
  5810. this.ui = ui_UIMsg.createInstance();
  5811. this.contentPane = this.ui;
  5812. this.isEject = false;
  5813. this.isMuti = true;
  5814. }
  5815. show(msg, callback) {
  5816. super.show();
  5817. this.ui.tipsNode.msgTxt.text = msg;
  5818. this.ui.alpha = 1;
  5819. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5820. this.hide();
  5821. callback && callback();
  5822. }), 1000);
  5823. }
  5824. }
  5825. UIMsg.uiName = "UIMsg";
  5826. class BallRodDisplay {
  5827. constructor(ui, index) {
  5828. this.index = 0;
  5829. this.uiIndex = 0;
  5830. this.ui = ui;
  5831. this.index = index;
  5832. this.initData();
  5833. }
  5834. initData() {
  5835. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5836. let data = cfgTable.ballrodData[this.index + 1];
  5837. this.ui.nameTxt.text = data.name;
  5838. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5839. this.ui.levelNode.c1.selectedIndex = data.quality;
  5840. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5841. if (data.spine) {
  5842. this.mySpine = new SpineMgr(data.spine, () => {
  5843. let xx = 150;
  5844. let yy = 70;
  5845. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5846. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5847. });
  5848. }
  5849. }
  5850. updateSelf() {
  5851. console.log('zh:updateSelf -------------- ');
  5852. let get = DataMgr.getBallRod(this.index);
  5853. if (get == null)
  5854. get = 1;
  5855. let curUse = DataMgr.getCurBallRod();
  5856. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5857. if (get) {
  5858. if (curUse == this.index) {
  5859. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5860. }
  5861. else {
  5862. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5863. }
  5864. }
  5865. else {
  5866. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5867. }
  5868. }
  5869. buyBallRod() {
  5870. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5871. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5872. switch (selectedIndex) {
  5873. case 0:
  5874. break;
  5875. case 1:
  5876. console.log('zh:点击了 USE THIS');
  5877. DataMgr.setCurBallRod(this.index);
  5878. let curUse = DataMgr.getCurBallRod();
  5879. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5880. let ui = xGame.uiMgr.getUI(UIShop);
  5881. ui.updateBallRod();
  5882. break;
  5883. case 2:
  5884. let data = cfgTable.ballrodData[this.index + 1];
  5885. let need = data.price;
  5886. if (DataMgr.diamondEnough(need)) {
  5887. this.buyQiuGan(data);
  5888. DataMgr.setDiamond(-need);
  5889. DataMgr.setBallRod(this.index, 1);
  5890. DataMgr.setCurBallRod(this.index);
  5891. let ui = xGame.uiMgr.getUI(UIShop);
  5892. ui.updateBallRod();
  5893. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5894. }
  5895. else {
  5896. xGame.uiMgr.Show(UIAddProp, 1);
  5897. }
  5898. break;
  5899. default:
  5900. break;
  5901. }
  5902. }
  5903. buyQiuGan(qgItem) {
  5904. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5905. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5906. if (userInfo == null) {
  5907. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5908. return;
  5909. }
  5910. let reqData = xGame.httpMgr.getReqData();
  5911. let pd = JSON.parse(reqData);
  5912. pd.qiuGanData = qgItem;
  5913. reqData = JSON.stringify(pd);
  5914. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5915. try {
  5916. console.log('zh:buySp res = ' + JSON.stringify(res));
  5917. let code = res.code;
  5918. let msg = res.msg;
  5919. if (code == 401) {
  5920. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5921. alert(TIP_MSG_key.loginTimeOut);
  5922. xGame.uiMgr.Show(UIMsg, msg);
  5923. return;
  5924. }
  5925. if (code == 200) {
  5926. xGame.uiMgr.Show(UIMsg, msg);
  5927. DataMgr.getUserZiChanInfo();
  5928. }
  5929. else {
  5930. xGame.uiMgr.Show(UIMsg, msg);
  5931. }
  5932. }
  5933. catch (error) {
  5934. console.log('error=' + error);
  5935. alert(error);
  5936. }
  5937. finally {
  5938. }
  5939. });
  5940. }
  5941. logEventForGouMaiGan(qiuGanName) {
  5942. const ev = {
  5943. value: qiuGanName
  5944. };
  5945. const jsonStr = JSON.stringify(ev);
  5946. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5947. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5948. }
  5949. }
  5950. class DaoJuDisplay {
  5951. constructor(ui, index) {
  5952. this.index = 0;
  5953. this.uiIndex = 0;
  5954. this.ggSpid = "";
  5955. this.spid = 0;
  5956. this.ui = ui;
  5957. this.index = index;
  5958. this.initData();
  5959. }
  5960. initData() {
  5961. this.ui.btn_buy.onClick(this, this.gotoBuy);
  5962. let data = cfgTable.daoJuData[this.index + 1];
  5963. console.log('zh:' + JSON.stringify(data));
  5964. this.ui.nameTxt.text = data.spbt;
  5965. this.ui.n_jiaGe.text = data.spjg + "";
  5966. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5967. this.ggSpid = data.ggSpid;
  5968. this.spid = data.spid;
  5969. let baseUrl = "asset/sound/ogg/";
  5970. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5971. }
  5972. gotoBuy() {
  5973. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5974. if (userInfo != null) {
  5975. let token = userInfo.token;
  5976. let ggSpid = this.ggSpid;
  5977. let spid = this.spid;
  5978. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  5979. console.log('zh:gotoBuy1 spid =' + spid);
  5980. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  5981. return;
  5982. }
  5983. else {
  5984. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5985. }
  5986. }
  5987. gotoBuy1() {
  5988. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5989. let djItem = cfgTable.daoJuData[this.index + 1];
  5990. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5991. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5992. if (userInfo == null) {
  5993. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5994. return;
  5995. }
  5996. let reqData = xGame.httpMgr.getReqData();
  5997. let pd = JSON.parse(reqData);
  5998. pd.spItem = djItem;
  5999. reqData = JSON.stringify(pd);
  6000. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6001. try {
  6002. console.log('zh:buySp res = ' + JSON.stringify(res));
  6003. let code = res.code;
  6004. let msg = res.msg;
  6005. if (code == 401) {
  6006. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6007. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6008. return;
  6009. }
  6010. if (code == 200) {
  6011. xGame.uiMgr.Show(UIMsg, msg);
  6012. DataMgr.getUserZiChanInfo();
  6013. }
  6014. else {
  6015. xGame.uiMgr.Show(UIMsg, msg);
  6016. }
  6017. }
  6018. catch (error) {
  6019. console.log('error=' + error);
  6020. alert(error);
  6021. }
  6022. finally {
  6023. }
  6024. });
  6025. }
  6026. }
  6027. class UIShop extends UIBase {
  6028. constructor() {
  6029. super();
  6030. this.itemNums = 0;
  6031. this.itemNumsForDj = 0;
  6032. this.curType = "";
  6033. }
  6034. onConstructor() {
  6035. this.ui = ui_UIShop.createInstance();
  6036. this.contentPane = this.ui;
  6037. this.isEject = false;
  6038. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6039. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6040. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6041. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6042. this.addUIClick(this.ui, this.interuptSecretary);
  6043. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6044. this.ballRodArr = [];
  6045. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6046. this.ui.myNode.myList.numItems = this.itemNums;
  6047. this.loadDjdata_old();
  6048. }
  6049. loadDjdata_old() {
  6050. let fff = cfgTable.daoJuData;
  6051. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6052. this.daoJuArr = [];
  6053. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6054. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6055. }
  6056. getProductList() {
  6057. let reqData = xGame.httpMgr.getReqData();
  6058. let pd = JSON.parse(reqData);
  6059. pd.splx = "Consumable";
  6060. reqData = JSON.stringify(pd);
  6061. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6062. try {
  6063. let code = res.code;
  6064. let msg = res.msg;
  6065. if (code == 401) {
  6066. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6067. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6068. return;
  6069. }
  6070. if (code == 200) {
  6071. let data = res.data;
  6072. for (let index = 0; index < data.length; index++) {
  6073. let element = data[index];
  6074. cfgTable.daoJuData[element.spid] = element;
  6075. }
  6076. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6077. }
  6078. else {
  6079. xGame.uiMgr.Show(UIMsg, msg);
  6080. }
  6081. }
  6082. catch (error) {
  6083. console.log('error=' + error);
  6084. alert(error);
  6085. }
  6086. finally {
  6087. }
  6088. });
  6089. }
  6090. show(type) {
  6091. super.show();
  6092. this.curType = type == 0 ? "qiugan" : "daoju";
  6093. this.switchBtn("");
  6094. this.playSecretaryIdle();
  6095. this.updateBallRod();
  6096. }
  6097. test123() {
  6098. console.log('zh:test123 ');
  6099. }
  6100. switchBtn(type) {
  6101. console.log('zh:1111切換 sel type=' + type);
  6102. if (type == "") {
  6103. type = this.curType;
  6104. }
  6105. else {
  6106. if (this.curType == type) {
  6107. return;
  6108. }
  6109. else {
  6110. this.curType = type;
  6111. }
  6112. }
  6113. if (type == "qiugan") {
  6114. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6115. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6116. this.ui.myNode.c1.selectedIndex = 0;
  6117. this.ui.myNode.myList.visible = true;
  6118. this.ui.myNode.djList.visible = false;
  6119. }
  6120. else {
  6121. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6122. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6123. this.ui.myNode.c1.selectedIndex = 1;
  6124. this.ui.myNode.myList.visible = false;
  6125. this.ui.myNode.djList.visible = true;
  6126. }
  6127. }
  6128. updateBallRod() {
  6129. for (let index = 0; index < this.ballRodArr.length; index++) {
  6130. this.ballRodArr[index].updateSelf();
  6131. }
  6132. }
  6133. renderBallRod(sort, obj) {
  6134. let index = this.getIndexBySort(sort + 1) - 1;
  6135. let ballRod = new BallRodDisplay(obj, index);
  6136. this.ballRodArr.push(ballRod);
  6137. }
  6138. renderDaoJu(idx, obj) {
  6139. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6140. let b = new DaoJuDisplay(obj, index);
  6141. this.daoJuArr.push(b);
  6142. }
  6143. getIndexBySort(sort) {
  6144. let object = cfgTable.ballrodData;
  6145. for (const key in object) {
  6146. if (object[key].sort == sort) {
  6147. return parseInt(key);
  6148. }
  6149. }
  6150. }
  6151. getIndexBySortForDj(idx) {
  6152. let object = cfgTable.daoJuData;
  6153. for (const key in object) {
  6154. if (object[key].idx == idx) {
  6155. return parseInt(key);
  6156. }
  6157. }
  6158. }
  6159. playSecretaryIdle() {
  6160. let parent = this.ui.secretary.displayObject;
  6161. parent.destroyChildren();
  6162. let xx = this.ui.secretary.width / 2;
  6163. let yy = this.ui.secretary.height;
  6164. let scale = xGame.common.getSecretaryScale();
  6165. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6166. xGame.common.secretary.play(data, 0, true, parent);
  6167. }
  6168. interuptSecretary() {
  6169. Laya.timer.clearAll(this);
  6170. this.playSecretaryRandomSound();
  6171. }
  6172. playSecretaryRandomSound() {
  6173. if (this.isHide)
  6174. return;
  6175. let time = xGame.common.randomNum(45000, 60000);
  6176. Laya.timer.once(time, this, () => {
  6177. if (this.isHide)
  6178. return;
  6179. let index = xGame.common.randomNum(4, 7);
  6180. xGame.soundMgr.playSound("s_main0" + index);
  6181. let words = 1;
  6182. switch (index) {
  6183. case 4:
  6184. words = 5;
  6185. break;
  6186. case 5:
  6187. words = 3;
  6188. break;
  6189. case 6:
  6190. words = 6;
  6191. break;
  6192. case 7:
  6193. words = 7;
  6194. break;
  6195. default:
  6196. break;
  6197. }
  6198. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6199. this.playSecretaryRandomSound();
  6200. });
  6201. }
  6202. closeSelf() {
  6203. this.hide();
  6204. }
  6205. }
  6206. UIShop.uiName = "UIShop";
  6207. class ui_UISign extends fgui.GComponent {
  6208. static createInstance() {
  6209. return (fgui.UIPackage.createObject("game", "UISign"));
  6210. }
  6211. onConstruct() {
  6212. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6213. this.n6 = (this.getChild("n6"));
  6214. this.closeNode = (this.getChild("closeNode"));
  6215. this.myNode = (this.getChild("myNode"));
  6216. this.moneyNode = (this.getChild("moneyNode"));
  6217. this.secretary = (this.getChild("secretary"));
  6218. this.talkNode = (this.getChild("talkNode"));
  6219. this.tripleBtn = (this.getChild("tripleBtn"));
  6220. this.normalBtn = (this.getChild("normalBtn"));
  6221. this.tipsNode = (this.getChild("tipsNode"));
  6222. this.againBtn = (this.getChild("againBtn"));
  6223. this.t0 = this.getTransition("t0");
  6224. }
  6225. }
  6226. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6227. class SignMax {
  6228. constructor(ui) {
  6229. this.ui = ui;
  6230. }
  6231. updateSelf(index, sameDay, curDayIndex) {
  6232. let data = cfgTable.signData[index + 1];
  6233. this.ui.titleTxt.text = data.title;
  6234. let arr1 = data.award[0].split('-');
  6235. let arr2 = data.award[1].split('-');
  6236. let num1 = parseInt(arr1[1]);
  6237. let num2 = parseInt(arr2[1]);
  6238. this.ui.numTxt1.text = num1 + "";
  6239. this.ui.numTxt2.text = num2 + "";
  6240. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6241. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6242. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6243. this.ui.numTxt1.visible = false;
  6244. }
  6245. else {
  6246. this.ui.numTxt1.visible = true;
  6247. }
  6248. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6249. this.ui.numTxt2.visible = false;
  6250. }
  6251. else {
  6252. this.ui.numTxt2.visible = true;
  6253. }
  6254. if (index < curDayIndex) {
  6255. this.ui.c1.selectedIndex = 1;
  6256. }
  6257. else if (index == curDayIndex) {
  6258. if (sameDay) {
  6259. this.ui.c1.selectedIndex = 2;
  6260. }
  6261. else {
  6262. this.ui.c1.selectedIndex = 2;
  6263. }
  6264. }
  6265. else {
  6266. this.ui.c1.selectedIndex = 0;
  6267. }
  6268. }
  6269. }
  6270. class SignNormal {
  6271. constructor(ui) {
  6272. this.ui = ui;
  6273. }
  6274. updateSelf(index, sameDay, curDayIndex) {
  6275. let data = cfgTable.signData[index + 1];
  6276. this.ui.titleTxt.text = data.title;
  6277. let arr = data.award[0].split('-');
  6278. let type = parseInt(arr[0]);
  6279. let num = parseInt(arr[1]);
  6280. this.ui.numTxt.text = num + "";
  6281. if (type > 2) {
  6282. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6283. this.ui.myIcon.rotation = 0;
  6284. }
  6285. else {
  6286. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6287. this.ui.myIcon.rotation = 0;
  6288. }
  6289. if (xGame.common.signAwardContainsRod(data.award)) {
  6290. this.ui.numTxt.visible = false;
  6291. }
  6292. else {
  6293. this.ui.numTxt.visible = true;
  6294. }
  6295. if (index < curDayIndex) {
  6296. this.ui.c1.selectedIndex = 1;
  6297. }
  6298. else if (index == curDayIndex) {
  6299. if (sameDay) {
  6300. this.ui.c1.selectedIndex = 2;
  6301. }
  6302. else {
  6303. this.ui.c1.selectedIndex = 2;
  6304. }
  6305. }
  6306. else {
  6307. this.ui.c1.selectedIndex = 0;
  6308. }
  6309. }
  6310. }
  6311. class UISign extends UIBase {
  6312. constructor() {
  6313. super();
  6314. this.curDayIndex = 0;
  6315. this.starX = 0;
  6316. }
  6317. onConstructor() {
  6318. this.ui = ui_UISign.createInstance();
  6319. this.contentPane = this.ui;
  6320. this.isEject = false;
  6321. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6322. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6323. this.initSignItem();
  6324. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6325. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6326. }
  6327. show() {
  6328. super.show();
  6329. this.ui.t0.play();
  6330. this.playSecretaryIdle();
  6331. this.updateSign();
  6332. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6333. }
  6334. initSignItem() {
  6335. this.signArr = [];
  6336. for (let index = 0; index < 6; index++) {
  6337. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6338. this.signArr.push(temp);
  6339. }
  6340. this.signMax = new SignMax(this.ui.myNode.day7);
  6341. if (Moyu.isKs)
  6342. this.ui.closeNode.closeBtn.x += 100;
  6343. }
  6344. updateSign() {
  6345. let sameDay = xGame.common.judgeSameDay();
  6346. let max = 7;
  6347. this.curDayIndex = DataMgr.getSignData();
  6348. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6349. this.curDayIndex = 0;
  6350. if (!sameDay) {
  6351. this.ui.normalBtn.visible = true;
  6352. this.ui.tipsNode.visible = false;
  6353. this.ui.againBtn.visible = false;
  6354. }
  6355. else {
  6356. this.ui.normalBtn.visible = false;
  6357. let again = DataMgr.getExtraSign();
  6358. let isCurrency = false;
  6359. let index = this.curDayIndex;
  6360. if (index == 0)
  6361. index = 7;
  6362. let award = cfgTable.signData[index].award;
  6363. let num = award[0].split("-")[0];
  6364. if (num == "1" || num == "2")
  6365. isCurrency = true;
  6366. let showAgain = again == 0 && isCurrency;
  6367. this.ui.againBtn.visible = showAgain;
  6368. this.ui.tipsNode.visible = !showAgain;
  6369. }
  6370. for (let index = 0; index < this.signArr.length; index++) {
  6371. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6372. }
  6373. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6374. }
  6375. playSecretaryIdle() {
  6376. let parent = this.ui.secretary.displayObject;
  6377. parent.destroyChildren();
  6378. let xx = this.ui.secretary.width / 2;
  6379. let yy = this.ui.secretary.height;
  6380. let scale = xGame.common.getSecretaryScale();
  6381. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6382. xGame.common.secretary.play(data, 0, true, parent);
  6383. }
  6384. closeSelf() {
  6385. this.hide();
  6386. }
  6387. normalGetAward() {
  6388. let sameDay = xGame.common.judgeSameDay();
  6389. if (!sameDay) {
  6390. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6391. let temp;
  6392. let type;
  6393. let num;
  6394. let arr = [];
  6395. for (let index = 0; index < award.length; index++) {
  6396. temp = award[index].split("-");
  6397. type = parseInt(temp[0]);
  6398. num = parseInt(temp[1]);
  6399. let awardType = new AwardType();
  6400. awardType.num = num;
  6401. awardType.type = type;
  6402. arr.push(awardType);
  6403. }
  6404. xGame.common.getAward(arr, (watchVideo) => {
  6405. this.curDayIndex++;
  6406. if (this.curDayIndex > 7)
  6407. this.curDayIndex = 0;
  6408. DataMgr.setSignData(this.curDayIndex);
  6409. this.updateSignData2Server(this.curDayIndex);
  6410. DataMgr.setSignTime(new Date().getTime());
  6411. if (watchVideo) {
  6412. DataMgr.setExtraSign(1);
  6413. Moyu.sendDataEvent("signIn1");
  6414. }
  6415. this.updateSign();
  6416. });
  6417. }
  6418. }
  6419. againGetAward() {
  6420. Moyu.sendDataEvent("signIn2");
  6421. console.log('zh:qjff_AD_for_uisign');
  6422. if (Laya.Browser.onAndroid) {
  6423. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6424. if (!boo) {
  6425. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6426. return;
  6427. }
  6428. }
  6429. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6430. }
  6431. else {
  6432. console.log('zh:AD 失败,直接发放奖励');
  6433. this.qjff_AD_for_uisign();
  6434. }
  6435. }
  6436. qjff_AD_for_uisign() {
  6437. let index = this.curDayIndex;
  6438. if (index == 0)
  6439. index = 7;
  6440. let award = cfgTable.signData[index].award;
  6441. let temp;
  6442. let type;
  6443. let num;
  6444. for (let index = 0; index < award.length; index++) {
  6445. temp = award[index].split("-");
  6446. type = parseInt(temp[0]);
  6447. num = parseInt(temp[1]) * 3;
  6448. xGame.common.playObjFlyAnim(num, type);
  6449. }
  6450. DataMgr.setExtraSign(1);
  6451. this.updateSign();
  6452. }
  6453. updateSignData2Server(day) {
  6454. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6455. if (userInfo == null) {
  6456. return;
  6457. }
  6458. let reqData = xGame.httpMgr.getReqData();
  6459. let pd = JSON.parse(reqData);
  6460. pd.signData = day;
  6461. reqData = JSON.stringify(pd);
  6462. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6463. try {
  6464. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6465. let code = res.code;
  6466. let msg = res.msg;
  6467. if (code == 401) {
  6468. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6469. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6470. return;
  6471. }
  6472. if (code == 200) {
  6473. let data = res.data;
  6474. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6475. }
  6476. else {
  6477. xGame.uiMgr.Show(UIMsg, msg);
  6478. }
  6479. }
  6480. catch (error) {
  6481. console.log('error=' + error);
  6482. alert(error);
  6483. }
  6484. finally {
  6485. }
  6486. });
  6487. }
  6488. }
  6489. UISign.uiName = "UISign";
  6490. class ui_UISkill extends fgui.GComponent {
  6491. static createInstance() {
  6492. return (fgui.UIPackage.createObject("game", "UISkill"));
  6493. }
  6494. onConstruct() {
  6495. this.n48 = (this.getChild("n48"));
  6496. this.n0 = (this.getChild("n0"));
  6497. this.secretary = (this.getChild("secretary"));
  6498. this.talkNode = (this.getChild("talkNode"));
  6499. this.closeNode = (this.getChild("closeNode"));
  6500. this.moneyNode = (this.getChild("moneyNode"));
  6501. this.skillNode = (this.getChild("skillNode"));
  6502. this.guideNode = (this.getChild("guideNode"));
  6503. }
  6504. }
  6505. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6506. class SkillDisplay {
  6507. constructor(ui, data, uiIndex) {
  6508. this.starX = 0;
  6509. this.starY = 0;
  6510. this.index = 0;
  6511. this.ui = ui;
  6512. this.data = data;
  6513. this.index = uiIndex;
  6514. this.initSelf();
  6515. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6516. }
  6517. initSelf() {
  6518. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6519. this.ui.nameTxt.text = this.data.name;
  6520. this.ui.describeTxt.text = this.data.describe;
  6521. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6522. this.ui.startBtn.onClick(this, this.startGame);
  6523. this.updateSelf();
  6524. }
  6525. updateSelf() {
  6526. this.checkTry();
  6527. let level = DataMgr.getBigSkillByIndex(this.index);
  6528. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6529. }
  6530. checkTry() {
  6531. let index = this.index;
  6532. let level = DataMgr.getBigSkillByIndex(index);
  6533. if (level == null) {
  6534. DataMgr.setBigSkill(index, 1, false);
  6535. level = 1;
  6536. }
  6537. this.ui.levelTxt.text = "LV." + level;
  6538. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6539. this.ui.tryNode.visible = true;
  6540. else
  6541. this.ui.tryNode.visible = false;
  6542. }
  6543. clickAddLevel() {
  6544. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6545. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6546. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6547. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6548. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6549. }
  6550. else {
  6551. console.log('zh:AD 失败,直接发放奖励');
  6552. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6553. }
  6554. }
  6555. qjff_AD_for_skilldisplay_clickAddLevel() {
  6556. DataMgr.setBigSkill(this.data.index, 1);
  6557. this.updateSelf();
  6558. xGame.common.upSkillLevel = true;
  6559. }
  6560. startGame() {
  6561. console.log('zh:rod skill startgame');
  6562. if (this.data.index == 3) {
  6563. alert('Coming soon!');
  6564. return;
  6565. }
  6566. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6567. let needCoin = xGame.common.bigMoveNeedCoin;
  6568. xGame.common.passAwardCoin = 2000;
  6569. let guide = DataMgr.getSkillGuide();
  6570. console.log('zh:startGame guide=' + guide);
  6571. xGame.common.temSelfLevel = 0;
  6572. if (guide == 0) {
  6573. needCoin = 0;
  6574. xGame.common.temSelfLevel = 100;
  6575. }
  6576. if (DataMgr.coinEnough(needCoin)) {
  6577. DataMgr.setCoin(-needCoin);
  6578. xGame.common.curPlayerSkillType = this.index;
  6579. if (guide == 0)
  6580. xGame.common.curPlayerSkillType = 0;
  6581. console.log('zh: skilldisplay 1');
  6582. xGame.uiMgr.Show(UIGame);
  6583. xGame.uiMgr.Hide(UIMain);
  6584. xGame.uiMgr.Show(UIMatching, () => {
  6585. xGame.common.gameUI.ui.alpha = 1;
  6586. xGame.common.gameUI.startGame();
  6587. xGame.uiMgr.Hide(UISkill);
  6588. });
  6589. this.logEventForRod_start();
  6590. }
  6591. else {
  6592. console.log('zh: skilldisplay 2');
  6593. xGame.uiMgr.Show(UIAddProp, 0);
  6594. Moyu.sendDataEvent("AddCoinVideo");
  6595. }
  6596. }
  6597. logEventForRod_start() {
  6598. let gfmsIdx = xGame.common.curPlayerSkillType;
  6599. console.log('zh:选择的技能=' + gfmsIdx);
  6600. let gfmc = 'Skyfall Shot';
  6601. if (gfmsIdx == 0) {
  6602. gfmc = 'Skyfall Shot';
  6603. }
  6604. if (gfmsIdx == 1) {
  6605. gfmc = 'Surging break';
  6606. }
  6607. if (gfmsIdx == 2) {
  6608. gfmc = 'Frost Lock';
  6609. }
  6610. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6611. let jsonStr = {
  6612. "count": 0,
  6613. "name": gfmc
  6614. };
  6615. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6616. const d = LocalStorageManager.getItem(keyStr);
  6617. jsonStr.count = d.count + 1;
  6618. LocalStorageManager.setItem(keyStr, jsonStr);
  6619. }
  6620. else {
  6621. LocalStorageManager.setItem(keyStr, jsonStr);
  6622. }
  6623. const reqStr = JSON.stringify(jsonStr);
  6624. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6625. }
  6626. }
  6627. class UISkill extends UIBase {
  6628. constructor() {
  6629. super();
  6630. this.skillData = [];
  6631. }
  6632. onConstructor() {
  6633. this.ui = ui_UISkill.createInstance();
  6634. this.contentPane = this.ui;
  6635. this.isEject = false;
  6636. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6637. this.initSkillData();
  6638. console.log('zh:aaaaaa1111111111');
  6639. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6640. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6641. console.log('zh:aaaaaa22222222');
  6642. this.displayList = [];
  6643. this.ui.skillNode.skillList.numItems = 3;
  6644. this.addUIClick(this.ui, this.interuptSecretary);
  6645. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6646. this.ui.talkNode.visible = false;
  6647. if (Moyu.isKs)
  6648. this.ui.closeNode.closeBtn.x += 100;
  6649. }
  6650. show() {
  6651. super.show();
  6652. this.playSecretaryIdle();
  6653. this.moneyNode.ui.c1.selectedIndex = 1;
  6654. Laya.timer.clearAll(this);
  6655. xGame.soundMgr.playSound("s_start");
  6656. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6657. let guide = DataMgr.getSkillGuide();
  6658. this.ui.guideNode.visible = guide == 0;
  6659. let item = this.getSkillItemByUIIndex(0);
  6660. if (guide == 0) {
  6661. item.ui.c1.selectedIndex = 1;
  6662. }
  6663. else {
  6664. item.ui.c1.selectedIndex = 0;
  6665. }
  6666. this.ui.guideNode.guideBtn.visible = guide == 0;
  6667. for (let index = 0; index < this.displayList.length; index++) {
  6668. this.displayList[index].checkTry();
  6669. }
  6670. }
  6671. getSkillItemByUIIndex(cur) {
  6672. for (let index = 0; index < this.displayList.length; index++) {
  6673. if (this.displayList[index].index == cur) {
  6674. return this.displayList[index];
  6675. }
  6676. }
  6677. }
  6678. enterGuideLevel() {
  6679. let item = this.getSkillItemByUIIndex(0);
  6680. item.startGame();
  6681. if (DataMgr.getNewUser())
  6682. Moyu.sendDataEvent("gameStart1");
  6683. }
  6684. initSkillData() {
  6685. this.skillData = [];
  6686. let nameList = xGame.common.skillNameList;
  6687. let iconList = xGame.common.skillIconList;
  6688. let describeList = [
  6689. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6690. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6691. "The power of frost descends—freezing the flow and taking full control of the game!"
  6692. ];
  6693. console.log('zh:initSkillData 111111111');
  6694. let data;
  6695. for (let index = 0; index < nameList.length; index++) {
  6696. data = {};
  6697. data.name = nameList[index];
  6698. data.icon = iconList[index];
  6699. data.describe = describeList[index];
  6700. data.index = index;
  6701. this.skillData.push(data);
  6702. }
  6703. }
  6704. updateSkillItem(index, target) {
  6705. if (this.displayList[index] == null) {
  6706. let uiIndex;
  6707. switch (index) {
  6708. case 0:
  6709. uiIndex = 1;
  6710. break;
  6711. case 1:
  6712. uiIndex = 0;
  6713. break;
  6714. case 2:
  6715. uiIndex = 2;
  6716. break;
  6717. case 3:
  6718. uiIndex = 3;
  6719. break;
  6720. default:
  6721. break;
  6722. }
  6723. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6724. this.displayList.push(temp);
  6725. }
  6726. }
  6727. playSecretaryIdle() {
  6728. let parent = this.ui.secretary.displayObject;
  6729. parent.destroyChildren();
  6730. let xx = this.ui.secretary.width / 2;
  6731. let yy = this.ui.secretary.height;
  6732. let scale = xGame.common.getSecretaryScale();
  6733. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6734. xGame.common.secretary.play(data, 0, true, parent);
  6735. }
  6736. returnUIMain() {
  6737. this.hide();
  6738. xGame.common.stopGirlPop(this.ui.talkNode);
  6739. xGame.uiMgr.Show(UIMain);
  6740. }
  6741. interuptSecretary() {
  6742. Laya.timer.clearAll(this);
  6743. this.playSecretaryRandomSound();
  6744. }
  6745. playSecretaryRandomSound() {
  6746. if (this.isHide)
  6747. return;
  6748. let time = xGame.common.randomNum(45000, 60000);
  6749. Laya.timer.once(time, this, () => {
  6750. if (this.isHide)
  6751. return;
  6752. let index = xGame.common.randomNum(4, 7);
  6753. xGame.soundMgr.playSound("s_main0" + index);
  6754. let words = 1;
  6755. switch (index) {
  6756. case 4:
  6757. words = 5;
  6758. break;
  6759. case 5:
  6760. words = 3;
  6761. break;
  6762. case 6:
  6763. words = 6;
  6764. break;
  6765. case 7:
  6766. words = 7;
  6767. break;
  6768. default:
  6769. break;
  6770. }
  6771. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6772. this.playSecretaryRandomSound();
  6773. });
  6774. }
  6775. }
  6776. UISkill.uiName = "UISkill";
  6777. class ui_UIModeSelection extends fgui.GComponent {
  6778. static createInstance() {
  6779. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6780. }
  6781. onConstruct() {
  6782. this.n19 = (this.getChild("n19"));
  6783. this.closeBtn = (this.getChild("closeBtn"));
  6784. this.myNode = (this.getChild("myNode"));
  6785. this.t0 = this.getTransition("t0");
  6786. }
  6787. }
  6788. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6789. class UIModeSelection extends UIBase {
  6790. constructor() {
  6791. super();
  6792. }
  6793. onConstructor() {
  6794. this.ui = ui_UIModeSelection.createInstance();
  6795. this.contentPane = this.ui;
  6796. this.isEject = false;
  6797. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6798. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6799. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6800. this.addUIClick(this.ui.closeBtn, this.hide);
  6801. this.peopleArr = [65, 990, 580];
  6802. this.peopleOffest = [5, 10, 10];
  6803. }
  6804. show(callback) {
  6805. this.updateSelf();
  6806. super.show();
  6807. this.ui.t0.play();
  6808. this.callback = callback;
  6809. }
  6810. updateSelf() {
  6811. let cfg = cfgTable.modeselectData;
  6812. for (let index = 1; index <= 3; index++) {
  6813. let node = this.ui.myNode["type" + index];
  6814. node.need.text = cfg[index].need;
  6815. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6816. node.peopleTxt.text = this.getRandPeople(index - 1);
  6817. }
  6818. }
  6819. enterGame(type) {
  6820. console.log('zh: 进入经典模式 type: ' + type);
  6821. xGame.common.classicRoomType = type;
  6822. let cfg = cfgTable.modeselectData[type];
  6823. let need = cfg.need;
  6824. xGame.common.passAwardCoin = cfg.award;
  6825. if (DataMgr.coinEnough(need)) {
  6826. DataMgr.setCoin(-need);
  6827. this.ui.myNode["type" + type].t0.play();
  6828. Laya.timer.once(200, this, () => {
  6829. this.callback && this.callback();
  6830. });
  6831. this.logEventForClassic_start();
  6832. }
  6833. else {
  6834. Moyu.sendDataEvent("AddCoinVideo");
  6835. xGame.uiMgr.Show(UIAddProp, 0);
  6836. }
  6837. }
  6838. getRandPeople(index) {
  6839. let rand = this.peopleOffest[index];
  6840. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6841. }
  6842. logEventForClassic_start() {
  6843. let rtype = xGame.common.classicRoomType;
  6844. let msmc = '';
  6845. if (rtype == 1) {
  6846. msmc = 'beginner';
  6847. }
  6848. if (rtype == 2) {
  6849. msmc = 'expert';
  6850. }
  6851. if (rtype == 3) {
  6852. msmc = 'master';
  6853. }
  6854. let keyStr = 'sjmd_classic_start_' + rtype;
  6855. let jsonStr = {
  6856. "difficulty": msmc,
  6857. "classic_count": 1,
  6858. "difficulty_count": 1
  6859. };
  6860. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6861. const d = LocalStorageManager.getItem(keyStr);
  6862. jsonStr.classic_count = d.classic_count + 1;
  6863. jsonStr.difficulty_count = d.difficulty_count + 1;
  6864. LocalStorageManager.setItem(keyStr, jsonStr);
  6865. }
  6866. else {
  6867. LocalStorageManager.setItem(keyStr, jsonStr);
  6868. }
  6869. const reqStr = JSON.stringify(jsonStr);
  6870. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6871. }
  6872. }
  6873. UIModeSelection.uiName = "UIModeSelection";
  6874. class ui_UIReg extends fgui.GComponent {
  6875. static createInstance() {
  6876. return (fgui.UIPackage.createObject("game", "UIReg"));
  6877. }
  6878. onConstruct() {
  6879. this.n38 = (this.getChild("n38"));
  6880. this.n9 = (this.getChild("n9"));
  6881. this.n14 = (this.getChild("n14"));
  6882. this.n15 = (this.getChild("n15"));
  6883. this.n34 = (this.getChild("n34"));
  6884. this.closeBtn = (this.getChild("closeBtn"));
  6885. this.lab_tip = (this.getChild("lab_tip"));
  6886. this.n43 = (this.getChild("n43"));
  6887. this.txt_ua = (this.getChild("txt_ua"));
  6888. this.n44 = (this.getChild("n44"));
  6889. this.txt_up1 = (this.getChild("txt_up1"));
  6890. this.n45 = (this.getChild("n45"));
  6891. this.txt_up2 = (this.getChild("txt_up2"));
  6892. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6893. this.btn_reg = (this.getChild("btn_reg"));
  6894. this.n50 = (this.getChild("n50"));
  6895. }
  6896. }
  6897. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6898. class ui_UILogin extends fgui.GComponent {
  6899. static createInstance() {
  6900. return (fgui.UIPackage.createObject("game", "UILogin"));
  6901. }
  6902. onConstruct() {
  6903. this.c1 = this.getController("c1");
  6904. this.n18 = (this.getChild("n18"));
  6905. this.n7 = (this.getChild("n7"));
  6906. this.n5 = (this.getChild("n5"));
  6907. this.n6 = (this.getChild("n6"));
  6908. this.closeBtn = (this.getChild("closeBtn"));
  6909. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6910. this.btn_login = (this.getChild("btn_login"));
  6911. this.n31 = (this.getChild("n31"));
  6912. this.txt_up = (this.getChild("txt_up"));
  6913. this.n32 = (this.getChild("n32"));
  6914. this.txt_ua = (this.getChild("txt_ua"));
  6915. this.n40 = (this.getChild("n40"));
  6916. }
  6917. }
  6918. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6919. class UILogin extends UIBase {
  6920. constructor() {
  6921. super();
  6922. }
  6923. onConstructor() {
  6924. this.ui = ui_UILogin.createInstance();
  6925. this.contentPane = this.ui;
  6926. this.isEject = false;
  6927. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6928. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6929. this.addUIClick(this.ui.btn_login, this.userLogin);
  6930. }
  6931. show() {
  6932. super.show();
  6933. this.x = (Laya.stage.width - this.width) / 2;
  6934. this.y = (Laya.stage.height - this.height) / 2;
  6935. }
  6936. closeSelf() {
  6937. this.hide();
  6938. }
  6939. userLogin() {
  6940. let ua = this.ui.txt_ua.text;
  6941. let up = this.ui.txt_up.text;
  6942. if (ua && up) {
  6943. let reqData = JSON.stringify({
  6944. username: ua.trim(),
  6945. password: up.trim(),
  6946. fromMark: 'app_game'
  6947. });
  6948. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6949. try {
  6950. console.log('zh:res = ' + JSON.stringify(res));
  6951. let code = res.code;
  6952. let msg = res.msg;
  6953. if (code == 200) {
  6954. let keyStr = keyForLoginInfo;
  6955. let jsonStr = {
  6956. "username": res.username,
  6957. "token": res.token,
  6958. "buySpids": { 1: false, 7: false }
  6959. };
  6960. LocalStorageManager.setItem(keyStr, jsonStr);
  6961. let myu = Moyu.getUserInfo();
  6962. console.log('zh:myu = ' + JSON.stringify(myu));
  6963. DataMgr.updateUserNickName(res.username);
  6964. Moyu.updateUserInfo(res.username);
  6965. xGame.uiMgr.Show(UIMsg, msg);
  6966. DataMgr.loadUserSpOrderForAd();
  6967. DataMgr.getUserZiChanInfo();
  6968. xGame.eventMgr.event(LOGIN_IN);
  6969. this.closeSelf();
  6970. }
  6971. else {
  6972. xGame.uiMgr.Show(UIMsg, msg);
  6973. }
  6974. }
  6975. catch (error) {
  6976. console.log('error=' + error);
  6977. alert(error);
  6978. }
  6979. finally {
  6980. }
  6981. });
  6982. }
  6983. else {
  6984. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6985. }
  6986. }
  6987. gotoRegPage() {
  6988. this.closeSelf();
  6989. xGame.uiMgr.Show(UIReg);
  6990. }
  6991. }
  6992. UILogin.uiName = "UILogin";
  6993. class UIReg extends UIBase {
  6994. constructor() {
  6995. super();
  6996. }
  6997. onConstructor() {
  6998. this.ui = ui_UIReg.createInstance();
  6999. this.contentPane = this.ui;
  7000. this.isEject = false;
  7001. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7002. this.addUIClick(this.ui.btn_reg, this.regUser);
  7003. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7004. }
  7005. show() {
  7006. super.show();
  7007. this.x = (Laya.stage.width - this.width) / 2;
  7008. this.y = (Laya.stage.height - this.height) / 2;
  7009. }
  7010. closeSelf() {
  7011. this.hide();
  7012. }
  7013. regUser() {
  7014. this.ui.lab_tip.visible = false;
  7015. let ua = this.ui.txt_ua.text;
  7016. let up1 = this.ui.txt_up1.text;
  7017. let up2 = this.ui.txt_up2.text;
  7018. if (ua && up1 && up2 && up1 == up2) {
  7019. let reqData = JSON.stringify({
  7020. username: ua.trim(),
  7021. password: up1.trim(),
  7022. fromMark: 'app_game'
  7023. });
  7024. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7025. try {
  7026. console.log('zh:res = ' + JSON.stringify(res));
  7027. let code = res.code;
  7028. let msg = res.msg;
  7029. xGame.uiMgr.Show(UIMsg, msg);
  7030. if (code == 200) {
  7031. this.ui.lab_tip.color = "#FFFFFF";
  7032. xGame.uiMgr.Show(UIMsg, msg);
  7033. this.closeSelf();
  7034. }
  7035. else {
  7036. this.ui.lab_tip.color = "#FF0000";
  7037. xGame.uiMgr.Show(UIMsg, msg);
  7038. }
  7039. }
  7040. catch (error) {
  7041. console.log('error=' + error);
  7042. alert(error);
  7043. }
  7044. finally {
  7045. }
  7046. });
  7047. }
  7048. else {
  7049. if (up1 != up2) {
  7050. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7051. }
  7052. else {
  7053. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7054. }
  7055. }
  7056. }
  7057. gotoLogin() {
  7058. this.closeSelf();
  7059. xGame.uiMgr.Show(UILogin);
  7060. }
  7061. }
  7062. UIReg.uiName = "UIReg";
  7063. class ui_UIFuli1 extends fgui.GComponent {
  7064. static createInstance() {
  7065. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  7066. }
  7067. onConstruct() {
  7068. this.n1 = (this.getChild("n1"));
  7069. this.n2 = (this.getChild("n2"));
  7070. }
  7071. }
  7072. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  7073. class UIFuli1 extends UIBase {
  7074. constructor() {
  7075. super();
  7076. this.jiage = 4.99;
  7077. }
  7078. onConstructor() {
  7079. this.ui = ui_UIFuli1.createInstance();
  7080. this.contentPane = this.ui;
  7081. this.isEject = false;
  7082. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7083. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7084. }
  7085. show() {
  7086. super.show();
  7087. this.x = (Laya.stage.width - this.width) / 2;
  7088. this.y = (Laya.stage.height - this.height) / 2;
  7089. this.ui.n2.txt_price.text = "$" + this.jiage;
  7090. }
  7091. closeSelf() {
  7092. DataMgr.loadUserSpOrderForAd();
  7093. this.hide();
  7094. }
  7095. gotoBuy() {
  7096. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7097. if (userInfo != null) {
  7098. let token = userInfo.token;
  7099. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7100. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  7101. DataMgr.loadUserSpOrderForAd();
  7102. return;
  7103. }
  7104. else {
  7105. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7106. }
  7107. }
  7108. gotoBuy2() {
  7109. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7110. if (userInfo == null) {
  7111. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7112. return;
  7113. }
  7114. let reqData = xGame.httpMgr.getReqData();
  7115. let pd = JSON.parse(reqData);
  7116. pd.productId = 1;
  7117. reqData = JSON.stringify(pd);
  7118. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7119. try {
  7120. console.log('zh:buySp res = ' + JSON.stringify(res));
  7121. let code = res.code;
  7122. let msg = res.msg;
  7123. if (code == 401) {
  7124. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7125. alert(TIP_MSG_key.loginTimeOut);
  7126. xGame.uiMgr.Show(UIMsg, msg);
  7127. return;
  7128. }
  7129. if (code == 200) {
  7130. xGame.uiMgr.Show(UIMsg, msg);
  7131. DataMgr.loadUserSpOrderForAd();
  7132. DataMgr.getUserZiChanInfo();
  7133. this.closeSelf();
  7134. }
  7135. else {
  7136. xGame.uiMgr.Show(UIMsg, msg);
  7137. }
  7138. }
  7139. catch (error) {
  7140. console.log('error=' + error);
  7141. alert(error);
  7142. }
  7143. finally {
  7144. }
  7145. });
  7146. }
  7147. }
  7148. UIFuli1.uiName = "UIFuli1";
  7149. class ui_UIFuli2 extends fgui.GComponent {
  7150. static createInstance() {
  7151. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7152. }
  7153. onConstruct() {
  7154. this.n1 = (this.getChild("n1"));
  7155. this.n2 = (this.getChild("n2"));
  7156. }
  7157. }
  7158. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7159. class UIFuli2 extends UIBase {
  7160. constructor() {
  7161. super();
  7162. this.jiage = 14.99;
  7163. }
  7164. onConstructor() {
  7165. this.ui = ui_UIFuli2.createInstance();
  7166. this.contentPane = this.ui;
  7167. this.isEject = false;
  7168. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7169. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7170. }
  7171. show() {
  7172. super.show();
  7173. this.x = (Laya.stage.width - this.width) / 2;
  7174. this.y = (Laya.stage.height - this.height) / 2;
  7175. this.ui.n2.txt_price.text = "$" + this.jiage;
  7176. }
  7177. closeSelf() {
  7178. DataMgr.loadUserSpOrderForAd();
  7179. this.hide();
  7180. }
  7181. gotoBuy() {
  7182. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7183. if (userInfo != null) {
  7184. let token = userInfo.token;
  7185. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7186. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  7187. DataMgr.loadUserSpOrderForAd();
  7188. return;
  7189. }
  7190. else {
  7191. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7192. }
  7193. }
  7194. gotoBuy1() {
  7195. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7196. if (userInfo == null) {
  7197. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7198. return;
  7199. }
  7200. let reqData = xGame.httpMgr.getReqData();
  7201. let pd = JSON.parse(reqData);
  7202. pd.productId = 2;
  7203. reqData = JSON.stringify(pd);
  7204. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7205. try {
  7206. console.log('zh:buySp res = ' + JSON.stringify(res));
  7207. let code = res.code;
  7208. let msg = res.msg;
  7209. if (code == 401) {
  7210. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7211. alert(TIP_MSG_key.loginTimeOut);
  7212. xGame.uiMgr.Show(UIMsg, msg);
  7213. return;
  7214. }
  7215. if (code == 200) {
  7216. xGame.uiMgr.Show(UIMsg, msg);
  7217. DataMgr.loadUserSpOrderForAd();
  7218. DataMgr.getUserZiChanInfo();
  7219. this.closeSelf();
  7220. }
  7221. else {
  7222. xGame.uiMgr.Show(UIMsg, msg);
  7223. }
  7224. }
  7225. catch (error) {
  7226. console.log('error=' + error);
  7227. alert(error);
  7228. }
  7229. finally {
  7230. }
  7231. });
  7232. }
  7233. }
  7234. UIFuli2.uiName = "UIFuli2";
  7235. class ui_UIGetAward extends fgui.GComponent {
  7236. static createInstance() {
  7237. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7238. }
  7239. onConstruct() {
  7240. this.n4 = (this.getChild("n4"));
  7241. this.n0 = (this.getChild("n0"));
  7242. this.myList = (this.getChild("myList"));
  7243. this.n1 = (this.getChild("n1"));
  7244. this.eftNode = (this.getChild("eftNode"));
  7245. this.btnNode = (this.getChild("btnNode"));
  7246. this.t0 = this.getTransition("t0");
  7247. }
  7248. }
  7249. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7250. class UIGetAward extends UIBase {
  7251. constructor() {
  7252. super();
  7253. this.showTriple = true;
  7254. }
  7255. onConstructor() {
  7256. this.ui = ui_UIGetAward.createInstance();
  7257. this.contentPane = this.ui;
  7258. this.isEject = false;
  7259. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7260. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7261. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7262. }
  7263. show(arr, showTriple, callback) {
  7264. super.show();
  7265. this.ui.t0.play();
  7266. this.ui.eftNode.visible = true;
  7267. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7268. this.ui.eftNode.visible = false;
  7269. }), 1, 0, 0, 0.9);
  7270. this.awardArr = arr;
  7271. this.showTriple = showTriple;
  7272. this.callback = callback;
  7273. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7274. this.ui.myList.numItems = arr.length;
  7275. xGame.soundMgr.playSound("getaward");
  7276. }
  7277. updateSelf(index, obj) {
  7278. let temp = this.awardArr[index];
  7279. let icon = this.getIcon(temp.type);
  7280. let str = icon;
  7281. if (temp.type > 2) {
  7282. str = "s" + icon;
  7283. }
  7284. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7285. obj.myIcon.rotation = 0;
  7286. obj.numTxt.text = temp.num + "";
  7287. obj.numTxt.visible = temp.type > 2 ? false : true;
  7288. obj.nameTxt.text = this.getNameStr(temp.type);
  7289. }
  7290. renderItem(index, obj) {
  7291. this.updateSelf(index, obj);
  7292. }
  7293. tripleGetAward() {
  7294. console.log('zh:qjff_AD_for_uigetAward');
  7295. if (Laya.Browser.onAndroid) {
  7296. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7297. if (!boo) {
  7298. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7299. return;
  7300. }
  7301. }
  7302. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7303. }
  7304. else {
  7305. console.log('zh:AD 失败,直接发放奖励');
  7306. this.qjff_AD_for_uigetAward();
  7307. }
  7308. }
  7309. qjff_AD_for_uigetAward() {
  7310. this.getAward(3);
  7311. }
  7312. normalGetAward() {
  7313. if (PlatMgr.isMisVideo())
  7314. this.tripleGetAward();
  7315. else
  7316. this.getAward();
  7317. }
  7318. getAward(times = 1) {
  7319. this.hide();
  7320. for (let index = 0; index < this.awardArr.length; index++) {
  7321. this.awardArr[index].num *= times;
  7322. }
  7323. this.callback && this.callback(times != 1);
  7324. }
  7325. getIcon(type) {
  7326. switch (type) {
  7327. case Prop.diamond:
  7328. return "ty_zs";
  7329. case Prop.coin:
  7330. return "ty_jb";
  7331. case Prop.gan1:
  7332. return "qg1";
  7333. case Prop.gan2:
  7334. return "qg2";
  7335. case Prop.gan3:
  7336. return "qg3";
  7337. case Prop.gan4:
  7338. return "qg4";
  7339. default:
  7340. break;
  7341. }
  7342. }
  7343. getNameStr(type) {
  7344. switch (type) {
  7345. case Prop.diamond:
  7346. return "Diamond";
  7347. case Prop.coin:
  7348. return "Coins";
  7349. case Prop.gan1:
  7350. case Prop.gan2:
  7351. case Prop.gan3:
  7352. case Prop.gan4:
  7353. return cfgTable.ballrodData[type - 1].name;
  7354. default:
  7355. break;
  7356. }
  7357. }
  7358. }
  7359. UIGetAward.uiName = "UIGetAward";
  7360. class ui_UIRepentProp extends fgui.GComponent {
  7361. static createInstance() {
  7362. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7363. }
  7364. onConstruct() {
  7365. this.c1 = this.getController("c1");
  7366. this.n11 = (this.getChild("n11"));
  7367. this.regretNode = (this.getChild("regretNode"));
  7368. this.helpLineNode = (this.getChild("helpLineNode"));
  7369. this.t0 = this.getTransition("t0");
  7370. }
  7371. }
  7372. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7373. class UIRepentProp extends UIBase {
  7374. constructor() {
  7375. super();
  7376. this.viewType = 0;
  7377. this.regretType = 0;
  7378. }
  7379. onConstructor() {
  7380. this.ui = ui_UIRepentProp.createInstance();
  7381. this.contentPane = this.ui;
  7382. this.isEject = false;
  7383. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7384. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7385. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7386. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7387. }
  7388. show(viewType, regretType, callback) {
  7389. PlatMgr.showInsert(true);
  7390. this.viewType = viewType;
  7391. this.regretType = regretType;
  7392. this.callback = callback;
  7393. super.show();
  7394. this.ui.t0.play();
  7395. this.ui.c1.selectedIndex = this.viewType;
  7396. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7397. if (this.viewType == 0) {
  7398. let guide = DataMgr.getGuideHelpLine();
  7399. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7400. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7401. }
  7402. xGame.common.gameMgr.gamePause = true;
  7403. }
  7404. hideSelf() {
  7405. xGame.common.gameMgr.gamePause = false;
  7406. this.callback && this.callback(false);
  7407. this.hide();
  7408. }
  7409. videoRegret() {
  7410. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7411. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7412. }
  7413. else {
  7414. console.log('zh:AD 失败,直接发放奖励');
  7415. this.qjff_AD_for_UIrepentProp_videoRegret();
  7416. }
  7417. }
  7418. qjff_AD_for_UIrepentProp_videoRegret() {
  7419. this.callback && this.callback(true);
  7420. this.hideSelf();
  7421. }
  7422. videoAddHelpLine() {
  7423. let guide = DataMgr.getGuideHelpLine();
  7424. if (guide == 0) {
  7425. this.callback && this.callback(true);
  7426. this.hideSelf();
  7427. DataMgr.setGuideHelpLine();
  7428. xGame.common.gameUI.ui.guideNode.visible = false;
  7429. }
  7430. else {
  7431. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7432. if (Laya.Browser.onAndroid) {
  7433. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7434. if (!boo) {
  7435. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7436. return;
  7437. }
  7438. }
  7439. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7440. }
  7441. else {
  7442. console.log('zh:AD 失败,直接发放奖励');
  7443. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7444. }
  7445. }
  7446. }
  7447. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7448. this.callback && this.callback(true);
  7449. this.hideSelf();
  7450. }
  7451. }
  7452. UIRepentProp.uiName = "UIRepentProp";
  7453. class UIMain extends UIBase {
  7454. constructor() {
  7455. super();
  7456. this.firstEnter = true;
  7457. }
  7458. nativeCallJs(msg) {
  7459. let t = msg;
  7460. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7461. switch (t) {
  7462. case 'qjff_chouJiang':
  7463. let dui = xGame.uiMgr.getUI(UIDraw);
  7464. dui.qjff_chouJiang();
  7465. break;
  7466. case 'qjff_AD_for_uisign':
  7467. let dui2 = xGame.uiMgr.getUI(UISign);
  7468. dui2.qjff_AD_for_uisign();
  7469. break;
  7470. case 'qjff_AD_for_uitry':
  7471. let dui3 = xGame.uiMgr.getUI(UITry);
  7472. dui3.qjff_AD_for_uitry();
  7473. break;
  7474. case 'qjff_AD_for_uipower':
  7475. let dui4 = xGame.uiMgr.getUI(UIPower);
  7476. dui4.qjff_AD_for_uipower();
  7477. break;
  7478. case 'qjff_AD_for_uigetAward':
  7479. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7480. dui5.qjff_AD_for_uigetAward();
  7481. break;
  7482. case 'qjff_AD_for_uiGameEnd':
  7483. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7484. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7485. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7486. break;
  7487. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7488. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7489. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7490. break;
  7491. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7492. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7493. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7494. break;
  7495. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7496. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7497. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7498. break;
  7499. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7500. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7501. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7502. break;
  7503. case 'qjff_AD_for_UIBOX_onOpenBox':
  7504. let dui11 = xGame.uiMgr.getUI(UIBox);
  7505. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7506. break;
  7507. case 'qjff_AD_for_UIAddCoin':
  7508. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7509. dui12.qjff_AD_for_UIAddCoin();
  7510. break;
  7511. case 'app_sign_for_buyProduct_onSuccess':
  7512. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7513. DataMgr.getUserZiChanInfo();
  7514. break;
  7515. case '222axxxxxx':
  7516. let dui15 = xGame.uiMgr.getUI(UISign);
  7517. dui15.qjff_AD_for_uisign();
  7518. break;
  7519. case '333axsxxxxxx':
  7520. let dui16 = xGame.uiMgr.getUI(UISign);
  7521. dui16.qjff_AD_for_uisign();
  7522. break;
  7523. default:
  7524. console.log('zh:未知的方法名字' + t);
  7525. break;
  7526. }
  7527. }
  7528. onConstructor() {
  7529. console.log('zh: UIMain onConstructor');
  7530. this.ui = ui_UIMain.createInstance();
  7531. this.contentPane = this.ui;
  7532. this.isEject = false;
  7533. this.addEvent();
  7534. this.addClickSpine();
  7535. this.settingNode = new SettingNode(this.ui.settingNode);
  7536. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7537. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7538. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7539. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7540. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7541. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7542. let curUse = DataMgr.getCurSecretary();
  7543. this.changeSecretary(curUse);
  7544. this.ui.talkNode.visible = false;
  7545. let guide = DataMgr.getSkillGuide();
  7546. if (xGame.common.isNewDay && guide == 1) {
  7547. xGame.common.isNewDay = false;
  7548. xGame.soundMgr.playSound("s_main01");
  7549. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7550. console.log("zh:播放小秘书每天语音");
  7551. }
  7552. this.onGetUserInfo();
  7553. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7554. DataMgr.getUserZiChanInfo();
  7555. }
  7556. this.ui.n83.visible = false;
  7557. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7558. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7559. let ua = d.username;
  7560. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7561. }
  7562. this.c_btn_for_user();
  7563. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7564. }
  7565. Logout() {
  7566. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7567. LocalStorageManager.removeItem(keyForLoginInfo);
  7568. this.freshUser();
  7569. }
  7570. JSBridgeUtils.instance.loginOutForApp();
  7571. this.setUserDefaultNickname();
  7572. DataMgr.setCoin2(4000);
  7573. DataMgr.setDiamond2(0);
  7574. this.setDefaultQiuGanInfo();
  7575. DataMgr.setPlaceBallLevelList("");
  7576. DataMgr.setChallengeMode_overLev(1);
  7577. this.setDefaultSignData();
  7578. }
  7579. setDefaultSignData() {
  7580. DataMgr.setSignData(1);
  7581. DataMgr.setSignTime(new Date().getTime());
  7582. }
  7583. setDefaultQiuGanInfo() {
  7584. DataMgr.setBallRod(0, 1);
  7585. DataMgr.setBallRod(1, 0);
  7586. DataMgr.setBallRod(2, 0);
  7587. DataMgr.setBallRod(3, 0);
  7588. DataMgr.setBallRod(4, 0);
  7589. DataMgr.setBallRod(5, 1);
  7590. }
  7591. setUserDefaultNickname() {
  7592. let defUsername = "player";
  7593. this.ui.headNode.nameTxt.text = defUsername;
  7594. DataMgr.updateUserNickName(defUsername);
  7595. Moyu.updateUserInfo(defUsername);
  7596. }
  7597. gotoLogin() {
  7598. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7599. xGame.uiMgr.Show(UILogin);
  7600. }
  7601. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7602. this.Logout();
  7603. }
  7604. }
  7605. gotoRegUser() {
  7606. xGame.uiMgr.Show(UIReg);
  7607. }
  7608. showFuLiSp1() {
  7609. console.log('zh:福利1');
  7610. this.checkForShowFuLi17(1);
  7611. }
  7612. showFuLiSp7() {
  7613. console.log('zh:福利7');
  7614. this.checkForShowFuLi17(7);
  7615. }
  7616. checkForShowFuLi17(spid) {
  7617. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7618. if (userInfo == null) {
  7619. if (spid === 1) {
  7620. xGame.uiMgr.Show(UIFuli1);
  7621. }
  7622. if (spid === 7) {
  7623. xGame.uiMgr.Show(UIFuli2);
  7624. }
  7625. return;
  7626. }
  7627. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  7628. let reqData = xGame.httpMgr.getReqData();
  7629. let pd = JSON.parse(reqData);
  7630. pd.productId = spid;
  7631. reqData = JSON.stringify(pd);
  7632. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  7633. try {
  7634. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  7635. let code = res.code;
  7636. let msg = res.msg;
  7637. if (code == 401) {
  7638. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7639. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7640. return;
  7641. }
  7642. if (code == 200) {
  7643. let isBuyOk = res.data;
  7644. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  7645. if (isBuyOk === false) {
  7646. if (spid === 1) {
  7647. xGame.uiMgr.Show(UIFuli1);
  7648. }
  7649. if (spid === 7) {
  7650. xGame.uiMgr.Show(UIFuli2);
  7651. }
  7652. }
  7653. else {
  7654. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  7655. }
  7656. }
  7657. else {
  7658. xGame.uiMgr.Show(UIMsg, msg);
  7659. }
  7660. }
  7661. catch (error) {
  7662. console.log('error=' + error);
  7663. alert(error);
  7664. }
  7665. finally {
  7666. }
  7667. });
  7668. }
  7669. c_btn_for_user() {
  7670. this.ui.n_dengLu.c1.selectedIndex = 0;
  7671. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7672. this.ui.n_dengLu.c1.selectedIndex = 1;
  7673. }
  7674. else {
  7675. this.ui.n_dengLu.c1.selectedIndex = 0;
  7676. }
  7677. }
  7678. changeSecretary(curUse) {
  7679. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7680. xGame.common.secretary && xGame.common.secretary.dispose();
  7681. this.addSecretarySpine(name);
  7682. }
  7683. addSecretarySpine(name) {
  7684. let spine = new SpineMgr(name, () => {
  7685. this.playSecretaryIdle();
  7686. });
  7687. xGame.common.secretary = spine;
  7688. }
  7689. addClickSpine() {
  7690. let clickSpine = new SpineMgr("dianji", () => {
  7691. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7692. let parent = Laya.stage;
  7693. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7694. clickSpine.play(data, 0, false, parent, (spine) => {
  7695. spine.destroy(true);
  7696. });
  7697. });
  7698. });
  7699. }
  7700. addEvent() {
  7701. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7702. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7703. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7704. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7705. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7706. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7707. this.addUIClick(this.ui, this.interuptSecretary);
  7708. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7709. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7710. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7711. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7712. this.addUIClick(this.ui.signBtn, this.openSignView);
  7713. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7714. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7715. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7716. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7717. }
  7718. show(showFailWords) {
  7719. super.show();
  7720. DataMgr.loadUserSpOrderForAd();
  7721. this.moneyNode.ui.c1.selectedIndex = 1;
  7722. this.playSecretaryIdle();
  7723. xGame.soundMgr.playMusic("caromhall01", 0);
  7724. Laya.timer.clearAll(this);
  7725. this.playSecretaryRandomSound();
  7726. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7727. if (showFailWords) {
  7728. console.log('zh:uimain.ts ');
  7729. setTimeout(() => {
  7730. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7731. let words = -1;
  7732. if (str == "s_main02") {
  7733. words = 2;
  7734. }
  7735. else {
  7736. words = 3;
  7737. }
  7738. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7739. xGame.soundMgr.playSound(str);
  7740. }, 300);
  7741. }
  7742. this.showGuide();
  7743. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7744. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7745. let guide = DataMgr.getSkillGuide();
  7746. if (guide == 1) {
  7747. let randTime = xGame.common.randomNum(300, 800);
  7748. if (this.firstEnter) {
  7749. console.log("zh: firstEnter");
  7750. this.firstEnter = false;
  7751. randTime += 900;
  7752. }
  7753. else {
  7754. console.log("zh: no firstEnter");
  7755. }
  7756. Laya.timer.once(randTime, this, () => {
  7757. });
  7758. Laya.timer.once(1000, this, () => {
  7759. console.log('zh: 1秒后 showFuLiSp1');
  7760. this.showFuLiSp1();
  7761. });
  7762. Laya.timer.once(10000, this, () => {
  7763. console.log('zh: 10秒后 showFuLiSp1');
  7764. this.showFuLiSp7();
  7765. });
  7766. }
  7767. }
  7768. checkActive(show) {
  7769. }
  7770. showGuide() {
  7771. let guide = DataMgr.getSkillGuide();
  7772. this.ui.guideBtn.visible = guide == 0;
  7773. this.ui.enterGuide.visible = false;
  7774. this.ui.secretaryGuide.visible = guide == 0;
  7775. if (guide == 0) {
  7776. console.log("zh:显示引导");
  7777. xGame.soundMgr.playSound("s_guide");
  7778. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7779. }
  7780. else {
  7781. console.log("zh:不需要显示引导");
  7782. }
  7783. }
  7784. ensureSecretary() {
  7785. console.log('zh: ensureSecretary ');
  7786. this.ui.secretaryGuide.visible = false;
  7787. this.ui.enterGuide.visible = true;
  7788. this.ui.wordsNode.t0.play();
  7789. if (DataMgr.getNewUser())
  7790. Moyu.sendDataEvent("gameReady");
  7791. }
  7792. playSecretaryIdle() {
  7793. let parent = this.ui.secretary.displayObject;
  7794. parent.destroyChildren();
  7795. let xx = this.ui.secretary.width / 2;
  7796. let yy = this.ui.secretary.height;
  7797. let scale = xGame.common.getSecretaryScale();
  7798. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7799. xGame.common.secretary.play(data, 0, true, parent);
  7800. }
  7801. startGame(type) {
  7802. if (!this.isReadyForLoadNetSource()) {
  7803. return;
  7804. }
  7805. xGame.common.gameMode = type;
  7806. Moyu.sendDataEvent("PlayGame", { type: type });
  7807. let gm = xGame.common.gameMode;
  7808. console.log('zh:进入游戏gameMode =' + gm);
  7809. switch (gm) {
  7810. case GameMode.classic:
  7811. console.log('zh:进入经典模式111111111');
  7812. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7813. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7814. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7815. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7816. console.log('zh:判断是否可以玩该模式classic =NO');
  7817. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7818. xGame.uiMgr.Show(UIMsg, tipStr);
  7819. return;
  7820. }
  7821. else {
  7822. console.log('zh:可以玩该模式classic');
  7823. this.beginGame();
  7824. }
  7825. }
  7826. else {
  7827. console.log('zh:不需要判断是否可以玩该classic');
  7828. let challengeTimes = DataMgr.getChallengeTimes();
  7829. if (challengeTimes == 0) {
  7830. xGame.uiMgr.Show(UIInvitation);
  7831. }
  7832. else {
  7833. this.beginGame();
  7834. }
  7835. }
  7836. break;
  7837. case GameMode.bigMove:
  7838. console.info('zh:bigMove check 大招');
  7839. let guide = DataMgr.getSkillGuide();
  7840. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7841. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7842. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7843. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7844. console.log('zh:提示不可以玩');
  7845. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7846. xGame.uiMgr.Show(UIMsg, tipStr);
  7847. return;
  7848. }
  7849. else {
  7850. console.log('zh:可以玩该模式 bigMove');
  7851. this.beginGame();
  7852. if (DataMgr.getNewUser())
  7853. Moyu.sendDataEvent("gameStart0");
  7854. }
  7855. }
  7856. else {
  7857. this.beginGame();
  7858. if (DataMgr.getNewUser())
  7859. Moyu.sendDataEvent("gameStart0");
  7860. }
  7861. break;
  7862. default:
  7863. console.error('zh:未知错误!!!!');
  7864. break;
  7865. }
  7866. }
  7867. beginGame(isNice = false) {
  7868. console.log('zh:beginGame ');
  7869. let guide = DataMgr.getSkillGuide();
  7870. if (guide == 1) {
  7871. console.log('zh:非新手引导,showInternAd ');
  7872. JSBridgeUtils.instance.showInternAd('beginGame');
  7873. }
  7874. else {
  7875. console.log('zh:新手引导,不显示AD ');
  7876. }
  7877. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7878. console.log('zh:beginGame 1');
  7879. if (xGame.common.gameMode == GameMode.classic) {
  7880. console.log('zh:beginGame 2');
  7881. if (isNice) {
  7882. console.log('zh:进入巅峰赛');
  7883. this.enterClassic();
  7884. }
  7885. else {
  7886. console.log('zh:beginGame 3-1');
  7887. xGame.uiMgr.Show(UIModeSelection, () => {
  7888. console.log('zh:beginGame 3-2');
  7889. this.enterClassic();
  7890. });
  7891. }
  7892. }
  7893. else if (xGame.common.gameMode == GameMode.bigMove) {
  7894. console.log('zh:beginGame 5');
  7895. this.ui.enterGuide.visible = false;
  7896. xGame.uiMgr.Show(UISkill);
  7897. }
  7898. }
  7899. enterClassic() {
  7900. console.log('zh:beginGame 7');
  7901. xGame.uiMgr.Show(UIGame);
  7902. xGame.uiMgr.Show(UIMatching, () => {
  7903. if (!this.isHide)
  7904. this.hide();
  7905. xGame.common.gameUI.ui.alpha = 1;
  7906. console.log('zh:beginGame 8');
  7907. xGame.common.gameUI.startGame();
  7908. xGame.uiMgr.Hide(UIGameEnd);
  7909. });
  7910. }
  7911. start_debug_for_moni_payOk() {
  7912. console.log('zh:start_debug_for_moni_payOk');
  7913. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7914. if (userInfo != null) {
  7915. let token = userInfo.token;
  7916. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7917. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7918. alert('模拟支付OK');
  7919. return;
  7920. }
  7921. else {
  7922. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7923. }
  7924. }
  7925. startGlobal() {
  7926. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7927. }
  7928. startWeekly() {
  7929. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7930. }
  7931. zhouSaiMonth() {
  7932. console.log('zh: zhouSaiMonth 被调用');
  7933. }
  7934. isReadyForLoadNetSource() {
  7935. let reqCount = xGame.cfgMgr.httpReqCount;
  7936. let ok = xGame.cfgMgr.httpReqOkCount;
  7937. if (reqCount > ok) {
  7938. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7939. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7940. Laya.timer.once(5000, this, () => {
  7941. let retryCount = 0;
  7942. const maxRetries = 3;
  7943. const tryFetchConfig = () => {
  7944. try {
  7945. xGame.cfgMgr.getConfigFromServer();
  7946. }
  7947. catch (error) {
  7948. if (retryCount < maxRetries) {
  7949. retryCount++;
  7950. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7951. Laya.timer.once(5000, this, tryFetchConfig);
  7952. }
  7953. else {
  7954. console.error("❌ 达到最大重试次数,配置获取失败");
  7955. }
  7956. }
  7957. };
  7958. tryFetchConfig();
  7959. });
  7960. return false;
  7961. }
  7962. return true;
  7963. }
  7964. startPlaceBall() {
  7965. if (!this.isReadyForLoadNetSource()) {
  7966. return;
  7967. }
  7968. xGame.uiMgr.Show(UILevelDisplay);
  7969. }
  7970. hide() {
  7971. console.log('zh:uimain hide ...');
  7972. super.hide();
  7973. xGame.common.stopGirlPop(this.ui.talkNode);
  7974. }
  7975. onGetUserInfo(force = false) {
  7976. if (Moyu.isWx) {
  7977. let info = Moyu.getSystemInfo();
  7978. if (info)
  7979. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7980. }
  7981. else {
  7982. Moyu.initUser(this, this.freshUser, force);
  7983. }
  7984. this.freshUser();
  7985. console.log('zh:5秒后更新用户信息');
  7986. setTimeout(() => {
  7987. DataMgr.getUserZiChanInfo();
  7988. }, 5000);
  7989. }
  7990. event_login_in() {
  7991. console.log("zh:event_login_in被触发");
  7992. this.freshUser();
  7993. }
  7994. freshUser() {
  7995. let user = Moyu.getUserInfo();
  7996. if (!user.isAuth) {
  7997. user.headIcon = 'res/ty_touxiang.png';
  7998. }
  7999. else {
  8000. DataMgr.upRankData();
  8001. }
  8002. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8003. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8004. let keyStr = keyForLoginInfo;
  8005. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8006. const d = LocalStorageManager.getItem(keyStr);
  8007. let ua = d.username;
  8008. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8009. }
  8010. else {
  8011. }
  8012. this.c_btn_for_user();
  8013. }
  8014. interuptSecretary() {
  8015. Laya.timer.clearAll(this);
  8016. this.playSecretaryRandomSound();
  8017. }
  8018. playSecretaryRandomSound() {
  8019. if (this.isHide)
  8020. return;
  8021. let time = xGame.common.randomNum(45000, 60000);
  8022. Laya.timer.once(time, this, () => {
  8023. if (this.isHide)
  8024. return;
  8025. let index = xGame.common.randomNum(4, 7);
  8026. xGame.soundMgr.playSound("s_main0" + index);
  8027. let words = 1;
  8028. switch (index) {
  8029. case 4:
  8030. words = 5;
  8031. break;
  8032. case 5:
  8033. words = 3;
  8034. break;
  8035. case 6:
  8036. words = 6;
  8037. break;
  8038. case 7:
  8039. words = 7;
  8040. break;
  8041. default:
  8042. break;
  8043. }
  8044. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8045. this.playSecretaryRandomSound();
  8046. });
  8047. }
  8048. openSecretaryView() {
  8049. xGame.uiMgr.Show(UISecretary);
  8050. Moyu.sendDataEvent("secretary");
  8051. }
  8052. openShopView() {
  8053. xGame.uiMgr.Show(UIShop, 1);
  8054. }
  8055. openShopView0() {
  8056. xGame.uiMgr.Show(UIShop, 0);
  8057. }
  8058. openSignView() {
  8059. xGame.uiMgr.Show(UISign);
  8060. }
  8061. openDrawView() {
  8062. xGame.uiMgr.Show(UIDraw);
  8063. }
  8064. openRanking() {
  8065. console.log('zh:phb openRanking');
  8066. xGame.uiMgr.Show(UIRanking);
  8067. Moyu.sendDataEvent("rankingList");
  8068. }
  8069. }
  8070. UIMain.uiName = "UIMain";
  8071. class UIGameEnd extends UIBase {
  8072. constructor() {
  8073. super();
  8074. this.success = false;
  8075. this.awardCoinNum = 1000;
  8076. this.awardDiamondNum = 10;
  8077. }
  8078. onConstructor() {
  8079. this.ui = ui_UIGameEnd.createInstance();
  8080. this.contentPane = this.ui;
  8081. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8082. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8083. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8084. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8085. this.ui.talkNode.visible = false;
  8086. if (Moyu.isKs)
  8087. this.ui.closeNode.closeBtn.x += 100;
  8088. }
  8089. updateType() {
  8090. switch (xGame.common.gameMode) {
  8091. case GameMode.classic:
  8092. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8093. this.ui.coinNode.visible = this.success;
  8094. if (!this.success) {
  8095. Laya.timer.once(500, this, () => {
  8096. xGame.uiMgr.Show(UIAddCoin);
  8097. });
  8098. }
  8099. else {
  8100. this.logEventForClassic_win();
  8101. }
  8102. this.logEventForClassic_complete();
  8103. this.ui.isGetAward.visible = false;
  8104. this.ui.leftBtn.c1.selectedIndex = 3;
  8105. this.ui.rightBtn.c1.selectedIndex = 0;
  8106. this.moneyNode.ui.c1.selectedIndex = 1;
  8107. break;
  8108. case GameMode.bigMove:
  8109. console.log('zh:招法模式 aaaaaa bigMove');
  8110. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8111. this.ui.coinNode.visible = this.success;
  8112. if (xGame.common.gameMode == GameMode.bigMove) {
  8113. if (this.success) {
  8114. DataMgr.setSkillSuccessTimes(1, true);
  8115. DataMgr.setSkillAccTimes(1);
  8116. }
  8117. else {
  8118. DataMgr.setSkillSuccessTimes(0, false);
  8119. }
  8120. }
  8121. this.logEventForRod_complete_N();
  8122. if (!this.success) {
  8123. Laya.timer.once(500, this, () => {
  8124. xGame.uiMgr.Show(UIAddCoin);
  8125. });
  8126. }
  8127. else {
  8128. this.logEventForRod_win();
  8129. }
  8130. this.ui.isGetAward.visible = false;
  8131. this.ui.leftBtn.c1.selectedIndex = 3;
  8132. this.ui.rightBtn.c1.selectedIndex = 0;
  8133. this.moneyNode.ui.c1.selectedIndex = 1;
  8134. break;
  8135. case GameMode.placeBall:
  8136. this.ui.coinNode.visible = false;
  8137. if (this.success) {
  8138. if (xGame.common.placeBallStarNum == 3) {
  8139. this.ui.c1.selectedIndex = 2;
  8140. }
  8141. else {
  8142. this.ui.c1.selectedIndex = 3;
  8143. }
  8144. let level = xGame.common.placeBallCurLevel;
  8145. if (level > 59) {
  8146. this.logEventForChallenge_level_complete(level);
  8147. }
  8148. else {
  8149. this.logEventForChallenge_level_N(level);
  8150. }
  8151. }
  8152. else {
  8153. this.ui.c1.selectedIndex = 4;
  8154. }
  8155. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8156. if (cfg.type == PlaceBallType.challenge) {
  8157. this.ui.c1.selectedIndex = 2;
  8158. }
  8159. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8160. this.updatePlaceBallBtn();
  8161. this.updatePlaceBallStarNum();
  8162. this.updatePlaceBallAwardState();
  8163. this.moneyNode.ui.c1.selectedIndex = 2;
  8164. this.moneyNode.checkPowerTime();
  8165. this.moneyNode.powerChange();
  8166. DataMgr.upRankData();
  8167. break;
  8168. default:
  8169. break;
  8170. }
  8171. }
  8172. logEventForRod_complete_N() {
  8173. let gfmsIdx = xGame.common.curPlayerSkillType;
  8174. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8175. let gfmc = 'Skyfall Shot';
  8176. if (gfmsIdx == 0) {
  8177. gfmc = 'Skyfall Shot';
  8178. }
  8179. if (gfmsIdx == 1) {
  8180. gfmc = 'Surging break';
  8181. }
  8182. if (gfmsIdx == 2) {
  8183. gfmc = 'Frost Lock';
  8184. }
  8185. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8186. console.log('zh:logEventForRod_complete_N level = ' + level);
  8187. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8188. let jsonStr = {
  8189. "count": 0,
  8190. "name": gfmc
  8191. };
  8192. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8193. const d = LocalStorageManager.getItem(keyStr);
  8194. jsonStr.count = d.count + 1;
  8195. LocalStorageManager.setItem(keyStr, jsonStr);
  8196. }
  8197. else {
  8198. LocalStorageManager.setItem(keyStr, jsonStr);
  8199. }
  8200. const d2 = LocalStorageManager.getItem(keyStr);
  8201. let count = d2.count;
  8202. console.log('zh:logEventForRod_complete_N count = ' + count);
  8203. if (count % 5 == 0) {
  8204. const reqStr = JSON.stringify(jsonStr);
  8205. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8206. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8207. }
  8208. }
  8209. logEventForRod_win() {
  8210. console.log('zh:logEventForRod_win,胜利');
  8211. let gfmsIdx = xGame.common.curPlayerSkillType;
  8212. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8213. let gfmc = 'Skyfall Shot';
  8214. if (gfmsIdx == 0) {
  8215. gfmc = 'Skyfall Shot';
  8216. }
  8217. if (gfmsIdx == 1) {
  8218. gfmc = 'Surging break';
  8219. }
  8220. if (gfmsIdx == 2) {
  8221. gfmc = 'Frost Lock';
  8222. }
  8223. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8224. console.log('zh:logEventForRod_win level = ' + level);
  8225. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8226. let jsonStr = {
  8227. "count": 1,
  8228. "name": gfmc + ' Lev' + level
  8229. };
  8230. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8231. const d = LocalStorageManager.getItem(keyStr);
  8232. jsonStr.count = d.count + 1;
  8233. LocalStorageManager.setItem(keyStr, jsonStr);
  8234. }
  8235. else {
  8236. LocalStorageManager.setItem(keyStr, jsonStr);
  8237. }
  8238. const reqStr = JSON.stringify(jsonStr);
  8239. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8240. }
  8241. logEventForClassic_win() {
  8242. console.log('zh:logEventForClassic_win,胜利');
  8243. let rtype = xGame.common.classicRoomType;
  8244. let msmc = '';
  8245. if (rtype == 1) {
  8246. msmc = 'beginner';
  8247. }
  8248. if (rtype == 2) {
  8249. msmc = 'expert';
  8250. }
  8251. if (rtype == 3) {
  8252. msmc = 'master';
  8253. }
  8254. let keyStr = 'sjmd_classic_win_' + rtype;
  8255. let jsonStr = {
  8256. "difficulty": msmc,
  8257. "classic_count": 1,
  8258. "difficulty_count": 1
  8259. };
  8260. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8261. const d = LocalStorageManager.getItem(keyStr);
  8262. jsonStr.classic_count = d.classic_count + 1;
  8263. jsonStr.difficulty_count = d.difficulty_count + 1;
  8264. LocalStorageManager.setItem(keyStr, jsonStr);
  8265. }
  8266. else {
  8267. LocalStorageManager.setItem(keyStr, jsonStr);
  8268. }
  8269. const reqStr = JSON.stringify(jsonStr);
  8270. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8271. }
  8272. logEventForClassic_complete() {
  8273. console.log('zh:logEventForClassic_complete,胜利');
  8274. let rtype = xGame.common.classicRoomType;
  8275. let msmc = '';
  8276. if (rtype == 1) {
  8277. msmc = 'beginner';
  8278. }
  8279. if (rtype == 2) {
  8280. msmc = 'expert';
  8281. }
  8282. if (rtype == 3) {
  8283. msmc = 'master';
  8284. }
  8285. let keyStr = 'sjmd_classic_complete_' + rtype;
  8286. let jsonStr = {
  8287. "msmc": msmc,
  8288. "count": 0
  8289. };
  8290. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8291. const d = LocalStorageManager.getItem(keyStr);
  8292. jsonStr.count = d.count + 1;
  8293. LocalStorageManager.setItem(keyStr, jsonStr);
  8294. }
  8295. else {
  8296. LocalStorageManager.setItem(keyStr, jsonStr);
  8297. }
  8298. if (jsonStr.count % 5 == 0) {
  8299. const reqStr = JSON.stringify(jsonStr);
  8300. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8301. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8302. }
  8303. }
  8304. updatePlaceBallBtn() {
  8305. this.ui.leftBtn.c1.selectedIndex = 5;
  8306. if (this.success) {
  8307. this.ui.rightBtn.c1.selectedIndex = 14;
  8308. }
  8309. else {
  8310. if (xGame.common.placeBallStarNum == 3) {
  8311. this.ui.rightBtn.c1.selectedIndex = 14;
  8312. }
  8313. else {
  8314. this.ui.rightBtn.c1.selectedIndex = 1;
  8315. }
  8316. }
  8317. }
  8318. updatePlaceBallStarNum() {
  8319. let starNum = xGame.common.placeBallStarNum;
  8320. if (starNum == 0)
  8321. this.ui.starNumNode.c1.selectedIndex = 3;
  8322. else {
  8323. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8324. }
  8325. }
  8326. updatePlaceBallAwardState() {
  8327. let level = xGame.common.placeBallCurLevel;
  8328. let starNum = xGame.common.placeBallStarNum;
  8329. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8330. let data = cfgTable.placeballData[level].award;
  8331. let cfg = cfgTable.placeballData[level];
  8332. this.awardDiamondNum = data[1];
  8333. this.awardCoinNum = data[0];
  8334. if (cfg.type == PlaceBallType.challenge) {
  8335. this.awardDiamondNum = 0;
  8336. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8337. }
  8338. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8339. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8340. if (cfg.type == PlaceBallType.challenge) {
  8341. this.ui.awardNode.coinNode.visible = true;
  8342. }
  8343. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8344. this.ui.awardNode.diamondNode.x = 265;
  8345. this.ui.awardNode.coinNode.x = 354;
  8346. }
  8347. else {
  8348. this.ui.awardNode.diamondNode.x = 291;
  8349. this.ui.awardNode.coinNode.x = 291;
  8350. }
  8351. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8352. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8353. if (this.awardCoinNum == 0) {
  8354. this.ui.awardNode.coinNode.numTxt.text = "";
  8355. }
  8356. if (getAward) {
  8357. this.ui.isGetAward.visible = true;
  8358. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8359. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8360. }
  8361. else {
  8362. this.ui.isGetAward.visible = false;
  8363. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8364. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8365. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8366. }
  8367. else {
  8368. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8369. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8370. }
  8371. }
  8372. }
  8373. show(success) {
  8374. super.show();
  8375. xGame.eventMgr.event(RESET_GAME);
  8376. this.success = success;
  8377. Laya.timer.clearAll(this);
  8378. this.playSecretaryAni();
  8379. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8380. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8381. offsetTime = Math.floor(offsetTime / 1000);
  8382. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8383. this.updateType();
  8384. Laya.timer.once(200, this, () => {
  8385. this.addAward(() => {
  8386. this.updateType();
  8387. Laya.timer.once(500, this, () => {
  8388. this.showChallengeLevel();
  8389. });
  8390. });
  8391. });
  8392. if (this.success) {
  8393. JSBridgeUtils.instance.showInternAd('gameend_success');
  8394. console.log('zh:game end 成功');
  8395. xGame.soundMgr.playSound('slots_roll01');
  8396. xGame.soundMgr.playSound("s_win");
  8397. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8398. this.diyGameDataUtilForGameWin();
  8399. this.updateGamePlaceBallData2Server();
  8400. }
  8401. else {
  8402. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8403. console.log('zh:game end失败');
  8404. xGame.soundMgr.playSound('matchwin01');
  8405. xGame.soundMgr.playSound("s_lose");
  8406. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8407. }
  8408. let challengeNum = DataMgr.getChallengeTimes();
  8409. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8410. DataMgr.setChallengeTimes(1);
  8411. }
  8412. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8413. DataMgr.setClassicTimes();
  8414. }
  8415. }
  8416. diyGameDataUtilForGameWin() {
  8417. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8418. switch (xGame.common.gameMode) {
  8419. case GameMode.classic:
  8420. console.log('zh:DiyGameDataUtilForGameWin 111');
  8421. case GameMode.bigMove:
  8422. console.log('zh:DiyGameDataUtilForGameWin 222');
  8423. this.restartGame();
  8424. break;
  8425. case GameMode.placeBall:
  8426. console.log('zh:DiyGameDataUtilForGameWin 333');
  8427. var level = xGame.common.placeBallCurLevel;
  8428. console.log('zh:练习模式 联系了多少LEV=' + level);
  8429. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8430. if (level > db_over_lev) {
  8431. DataMgr.setChallengeMode_overLev(level);
  8432. }
  8433. break;
  8434. default:
  8435. console.log('zh:DiyGameDataUtilForGameWin 444');
  8436. break;
  8437. }
  8438. }
  8439. updateGamePlaceBallData2Server() {
  8440. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8441. if (userInfo == null) {
  8442. return;
  8443. }
  8444. let pbdObj = DataMgr.getPlaceBallLevelList();
  8445. let reqData = xGame.httpMgr.getReqData();
  8446. let pd = JSON.parse(reqData);
  8447. pd.placeBallData = JSON.stringify(pbdObj);
  8448. reqData = JSON.stringify(pd);
  8449. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8450. try {
  8451. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8452. let code = res.code;
  8453. let msg = res.msg;
  8454. if (code == 401) {
  8455. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  8456. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8457. return;
  8458. }
  8459. if (code == 200) {
  8460. let data = res.data;
  8461. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8462. }
  8463. else {
  8464. xGame.uiMgr.Show(UIMsg, msg);
  8465. }
  8466. }
  8467. catch (error) {
  8468. console.log('error=' + error);
  8469. alert(error);
  8470. }
  8471. finally {
  8472. }
  8473. });
  8474. }
  8475. showChallengeLevel() {
  8476. if (DataMgr.getChallengeTimes() != 0)
  8477. return;
  8478. let skill = DataMgr.getSkillAccTimes();
  8479. let put = DataMgr.getPlaceBallLevelList().length;
  8480. if (skill >= 3 || put >= 5) {
  8481. xGame.uiMgr.Show(UIInvitation);
  8482. this.hide();
  8483. }
  8484. }
  8485. addAward(callback) {
  8486. if (!this.success) {
  8487. callback && callback();
  8488. return;
  8489. }
  8490. switch (xGame.common.gameMode) {
  8491. case GameMode.classic:
  8492. this.awardCoinNum = xGame.common.passAwardCoin;
  8493. this.awardDiamondNum = 0;
  8494. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8495. break;
  8496. case GameMode.bigMove:
  8497. this.awardCoinNum = xGame.common.passAwardCoin;
  8498. this.awardDiamondNum = 0;
  8499. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8500. callback && callback();
  8501. break;
  8502. case GameMode.placeBall:
  8503. let level = xGame.common.placeBallCurLevel;
  8504. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8505. if (xGame.common.placeBallStarNum != 3) {
  8506. callback && callback();
  8507. return;
  8508. }
  8509. else {
  8510. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8511. if (getAward) {
  8512. callback && callback();
  8513. return;
  8514. }
  8515. }
  8516. let cfg = cfgTable.placeballData[level];
  8517. let data = cfgTable.placeballData[level].award;
  8518. this.awardCoinNum = data[0];
  8519. this.awardDiamondNum = data[1];
  8520. if (cfg.type == PlaceBallType.challenge) {
  8521. this.awardDiamondNum = 0;
  8522. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8523. }
  8524. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8525. let diamondAward;
  8526. if (this.awardDiamondNum > 0) {
  8527. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8528. xGame.common.getAward([diamondAward, coinAward], callback);
  8529. }
  8530. else {
  8531. xGame.common.getAward([coinAward], callback);
  8532. }
  8533. if (cfg.type == PlaceBallType.normal) {
  8534. DataMgr.setPlaceBallAward(level);
  8535. }
  8536. break;
  8537. default:
  8538. break;
  8539. }
  8540. }
  8541. playSecretaryAni_old() {
  8542. let parent = this.ui.secretary.displayObject;
  8543. parent.destroyChildren();
  8544. let xx = this.ui.secretary.width / 2;
  8545. let yy = this.ui.secretary.height;
  8546. let scale = xGame.common.getSecretaryScale();
  8547. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8548. if (this.success) {
  8549. let rand = Math.random() <= 0.5 ? 2 : 3;
  8550. xGame.common.secretary.play(data, rand, false, parent, () => {
  8551. xGame.common.secretary.play(data, 1, true, parent);
  8552. });
  8553. }
  8554. else {
  8555. xGame.common.secretary.play(data, 0, true, parent);
  8556. }
  8557. }
  8558. playSecretaryAni() {
  8559. let parent = this.ui.secretary.displayObject;
  8560. parent.destroyChildren();
  8561. let xx = this.ui.secretary.width / 2;
  8562. let yy = this.ui.secretary.height;
  8563. let scale = xGame.common.getSecretaryScale();
  8564. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8565. if (this.success) {
  8566. let rand = 0;
  8567. xGame.common.secretary.play(data, 0, true, parent);
  8568. }
  8569. else {
  8570. xGame.common.secretary.play(data, 0, true, parent);
  8571. }
  8572. }
  8573. restartGame() {
  8574. switch (xGame.common.gameMode) {
  8575. case GameMode.classic:
  8576. xGame.eventMgr.event(RESTART_GAME);
  8577. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8578. break;
  8579. case GameMode.bigMove:
  8580. this.hide();
  8581. xGame.eventMgr.event(RESTART_GAME);
  8582. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8583. break;
  8584. default:
  8585. break;
  8586. }
  8587. }
  8588. hide() {
  8589. super.hide();
  8590. xGame.common.stopGirlPop(this.ui.talkNode);
  8591. PlatMgr.showBanner(false);
  8592. }
  8593. returnHome() {
  8594. this.hide();
  8595. let showFailWords = !this.success;
  8596. xGame.uiMgr.Show(UIMain, showFailWords);
  8597. }
  8598. clickLeftBtn() {
  8599. switch (xGame.common.gameMode) {
  8600. case GameMode.classic:
  8601. case GameMode.bigMove:
  8602. this.returnHome();
  8603. break;
  8604. case GameMode.placeBall:
  8605. let level = xGame.common.placeBallCurLevel;
  8606. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8607. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8608. break;
  8609. default:
  8610. break;
  8611. }
  8612. }
  8613. powerStartPlaceBallLevel(level, btn) {
  8614. if (DataMgr.powerEnough()) {
  8615. btn.touchable = false;
  8616. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8617. btn.touchable = true;
  8618. DataMgr.setPower(-1);
  8619. xGame.eventMgr.event(POWER_TIME);
  8620. this.startPlaceBallLevel(level);
  8621. this.logEventForChallenge_level_start(level);
  8622. }));
  8623. }
  8624. else {
  8625. xGame.uiMgr.Show(UIPower, 0);
  8626. }
  8627. }
  8628. clickRightBtn() {
  8629. switch (xGame.common.gameMode) {
  8630. case GameMode.classic:
  8631. console.log('zh:clickRightBtn 111');
  8632. case GameMode.bigMove:
  8633. console.log('zh:clickRightBtn 222');
  8634. this.restartGame();
  8635. break;
  8636. case GameMode.placeBall:
  8637. console.log('zh:clickRightBtn 333');
  8638. let level = xGame.common.placeBallCurLevel;
  8639. let data = DataMgr.getPlaceBallLevel(level);
  8640. let curPss = data.play && !data.isCur;
  8641. if (curPss) {
  8642. console.log('zh:clickRightBtn 333-111');
  8643. console.log('zh:当前LV=' + level);
  8644. if (level == 60) {
  8645. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8646. Laya.timer.once(3000, this, () => {
  8647. this.returnHome();
  8648. });
  8649. }
  8650. else {
  8651. let lev = level + 1;
  8652. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8653. }
  8654. }
  8655. else {
  8656. console.log('zh:clickRightBtn 333-000');
  8657. Moyu.sendDataEvent("placeBallNextLevel");
  8658. console.log('zh:qjff_AD_for_uiGameEnd');
  8659. if (Laya.Browser.onAndroid) {
  8660. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8661. if (!boo) {
  8662. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8663. return;
  8664. }
  8665. }
  8666. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8667. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8668. }
  8669. else {
  8670. console.log('zh:AD 失败,直接发放奖励');
  8671. this.qjff_AD_for_uiGameEnd(level);
  8672. }
  8673. }
  8674. break;
  8675. default:
  8676. console.log('zh:clickRightBtn 444');
  8677. break;
  8678. }
  8679. }
  8680. logEventForChallenge_level_start(level) {
  8681. let keyStr = 'sjmd_challenge_level_start';
  8682. let jsonStr = {
  8683. "count": 0,
  8684. "gold_balance ": DataMgr.getCoin(),
  8685. "level": level,
  8686. "diamond_balance ": DataMgr.getDiamond()
  8687. };
  8688. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8689. const d = LocalStorageManager.getItem(keyStr);
  8690. if (level > d.level) {
  8691. jsonStr.count = d.count + 1;
  8692. LocalStorageManager.setItem(keyStr, jsonStr);
  8693. }
  8694. else {
  8695. }
  8696. }
  8697. else {
  8698. LocalStorageManager.setItem(keyStr, jsonStr);
  8699. }
  8700. const reqStr = JSON.stringify(jsonStr);
  8701. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8702. }
  8703. qjff_AD_for_uiGameEnd(level) {
  8704. DataMgr.setPlaceBallLevel(level, 1);
  8705. this.startPlaceBallLevel(level + 1);
  8706. }
  8707. startPlaceBallLevel(level) {
  8708. xGame.common.gameMode = GameMode.placeBall;
  8709. xGame.common.placeBallCurLevel = level;
  8710. xGame.uiMgr.Show(UIGame);
  8711. this.hide();
  8712. }
  8713. logEventForChallenge_level_complete(level) {
  8714. let keyStr = 'sjmd_challenge_level_complete';
  8715. let jsonStr = {
  8716. "count": 1,
  8717. "gold_balance ": DataMgr.getCoin(),
  8718. "level": level,
  8719. "diamond_balance ": DataMgr.getDiamond()
  8720. };
  8721. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8722. const d = LocalStorageManager.getItem(keyStr);
  8723. jsonStr.count = d.count + 1;
  8724. LocalStorageManager.setItem(keyStr, jsonStr);
  8725. }
  8726. else {
  8727. LocalStorageManager.setItem(keyStr, jsonStr);
  8728. }
  8729. const reqStr = JSON.stringify(jsonStr);
  8730. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8731. }
  8732. logEventForChallenge_level_N(level) {
  8733. console.log('zh:logEventForChallenge_level_N ' + level);
  8734. let keyStr = 'sjmd_challenge_level_N';
  8735. if (LocalStorageManager.hasKey(keyStr)) {
  8736. let lev = LocalStorageManager.getItem(keyStr);
  8737. if (level > lev) {
  8738. LocalStorageManager.setItem(keyStr, level);
  8739. }
  8740. if ((level) % 5 == 0) {
  8741. console.log('zh:每5关上报1次');
  8742. let sjmc = 'challenge_level_' + level;
  8743. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8744. let sjmcForFirebase = 'challenge_level_' + level;
  8745. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8746. }
  8747. else {
  8748. console.log('zh:5 no 上报');
  8749. }
  8750. }
  8751. else {
  8752. LocalStorageManager.setItem(keyStr, level);
  8753. }
  8754. }
  8755. }
  8756. UIGameEnd.uiName = "UIGameEnd";
  8757. class ui_UIVideoShare extends fgui.GComponent {
  8758. static createInstance() {
  8759. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8760. }
  8761. onConstruct() {
  8762. this.n10 = (this.getChild("n10"));
  8763. this.myNode = (this.getChild("myNode"));
  8764. this.t0 = this.getTransition("t0");
  8765. }
  8766. }
  8767. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8768. class UIVideoShare extends UIBase {
  8769. constructor() {
  8770. super();
  8771. this.success = false;
  8772. this.awardNum = 0;
  8773. this.isShared = true;
  8774. }
  8775. onConstructor() {
  8776. this.ui = ui_UIVideoShare.createInstance();
  8777. this.contentPane = this.ui;
  8778. this.isEject = false;
  8779. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8780. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8781. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8782. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8783. }
  8784. show(success) {
  8785. super.show();
  8786. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8787. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8788. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8789. this.success = success;
  8790. let time = xGame.common.randomNum(600, 1500);
  8791. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8792. if (success)
  8793. xGame.soundMgr.playSound("applause");
  8794. this.ui.t0.play();
  8795. this.checkShareState();
  8796. let times = DataMgr.getDailyVideoShareTimes();
  8797. this.awardNum = times == 0 ? 2000 : 200;
  8798. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8799. }
  8800. checkShareState() {
  8801. if (PlatMgr.forceShare == 0) {
  8802. this.ui.myNode.closeBtn.visible = true;
  8803. this.ui.myNode.tipsNode.visible = false;
  8804. this.ui.myNode.closeBtn.x = 90;
  8805. this.ui.myNode.shareBtn.x = 342;
  8806. }
  8807. else if (PlatMgr.forceShare == 1) {
  8808. this.ui.myNode.closeBtn.visible = false;
  8809. this.ui.myNode.tipsNode.visible = true;
  8810. this.ui.myNode.shareBtn.x = 218;
  8811. this.isShared = true;
  8812. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8813. }
  8814. }
  8815. checkForceShare() {
  8816. this.isShared = !this.isShared;
  8817. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8818. }
  8819. videoShare() {
  8820. if (PlatMgr.forceShare == 1) {
  8821. if (this.isShared) {
  8822. this.shareGame();
  8823. }
  8824. else {
  8825. this.hideSelf();
  8826. }
  8827. }
  8828. else {
  8829. this.shareGame();
  8830. }
  8831. }
  8832. shareGame() {
  8833. Moyu.sendDataEvent("VideoShare");
  8834. if (Moyu.canShare() > 100) {
  8835. Moyu.shareGame((success) => {
  8836. if (success) {
  8837. DataMgr.setDailyVideoShareTimes(1);
  8838. DataMgr.setCoin(this.awardNum);
  8839. }
  8840. this.hideSelf();
  8841. }, this);
  8842. }
  8843. else {
  8844. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8845. this.hideSelf();
  8846. }
  8847. }
  8848. hideSelf() {
  8849. this.hide();
  8850. xGame.uiMgr.Show(UIGameEnd, this.success);
  8851. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8852. xGame.common.screenImg.destroy();
  8853. xGame.common.screenImg = null;
  8854. }
  8855. }
  8856. }
  8857. UIVideoShare.uiName = "UIVideoShare";
  8858. class ui_UITips extends fgui.GComponent {
  8859. static createInstance() {
  8860. return (fgui.UIPackage.createObject("game", "UITips"));
  8861. }
  8862. onConstruct() {
  8863. this.n0 = (this.getChild("n0"));
  8864. this.myNode = (this.getChild("myNode"));
  8865. this.t0 = this.getTransition("t0");
  8866. }
  8867. }
  8868. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8869. class UITips extends UIBase {
  8870. constructor() {
  8871. super();
  8872. this.type = 0;
  8873. }
  8874. onConstructor() {
  8875. this.ui = ui_UITips.createInstance();
  8876. this.contentPane = this.ui;
  8877. this.isEject = false;
  8878. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8879. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8880. }
  8881. show(tipsTxt, womanTxt, type) {
  8882. super.show();
  8883. this.ui.t0.play();
  8884. this.ui.myNode.tipsTxt.text = tipsTxt;
  8885. this.ui.myNode.womanTxt.text = womanTxt;
  8886. PlatMgr.showInsert(true);
  8887. this.ui.myNode.c1.selectedIndex = type;
  8888. this.type = type;
  8889. switch (this.type) {
  8890. case TipsType.exitGame:
  8891. xGame.common.gameMgr.gamePause = true;
  8892. break;
  8893. case TipsType.foul:
  8894. Laya.timer.once(200, this, () => {
  8895. xGame.common.gameMgr.gamePause = true;
  8896. });
  8897. break;
  8898. default:
  8899. break;
  8900. }
  8901. }
  8902. clickLeftBtn() {
  8903. this.hide();
  8904. xGame.common.gameMgr.gamePause = false;
  8905. switch (this.type) {
  8906. case TipsType.exitGame:
  8907. break;
  8908. case TipsType.foul:
  8909. break;
  8910. default:
  8911. break;
  8912. }
  8913. }
  8914. clickRightBtn() {
  8915. this.hide();
  8916. switch (this.type) {
  8917. case TipsType.exitGame:
  8918. xGame.eventMgr.event(RESET_GAME);
  8919. xGame.uiMgr.Show(UIMain);
  8920. Moyu.recordEnd(this, null);
  8921. xGame.common.longHelpLine = false;
  8922. break;
  8923. case TipsType.foul:
  8924. xGame.common.gameMgr.gamePause = false;
  8925. Laya.timer.clearAll(this);
  8926. break;
  8927. default:
  8928. break;
  8929. }
  8930. }
  8931. }
  8932. UITips.uiName = "UITips";
  8933. class GameMgr {
  8934. constructor() {
  8935. this.selfCamp = "";
  8936. this.selfFoulNum = 0;
  8937. this.selfBallArr = [];
  8938. this.selfTimer = 0;
  8939. this.selfScore = 0;
  8940. this.aiCamp = "";
  8941. this.aiFoulNum = 0;
  8942. this.aiBallArr = [];
  8943. this.aiTimer = 0;
  8944. this.aiScore = 0;
  8945. this.aiSkillLevelNum = 1;
  8946. this.targertScore = 0;
  8947. this.setTime = 30;
  8948. this.selfTurnRate = 0.5;
  8949. this.accTime = 0;
  8950. this.curFoul = "";
  8951. this.maxFoulTimes = 3;
  8952. this.isFirstInGame = true;
  8953. this.firstColliObj = null;
  8954. this.inHoleBalls = [];
  8955. this.blackNum = 8;
  8956. this.success = false;
  8957. this.holePosList = [];
  8958. this.posObj = {};
  8959. this._selfTurn = false;
  8960. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8961. this.ensureBallType = false;
  8962. this.isOpenBall = true;
  8963. this.finishOneShoot = true;
  8964. this.isEnd = false;
  8965. this.isChangeTurn = false;
  8966. this.isInterrupt = false;
  8967. this.aiPlayedBreakArmy = false;
  8968. this.isTouchedBall = false;
  8969. this.finishBalls = 0;
  8970. this.needBalls = 0;
  8971. this.allBallNum = 0;
  8972. this.placeBallPosData = {};
  8973. this.curHP = 0;
  8974. this.showLongView = false;
  8975. this.firstShoot = true;
  8976. this._gamePause = false;
  8977. this.trunCount = 0;
  8978. this.isBlackInHole = false;
  8979. this.isEnter = true;
  8980. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8981. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8982. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8983. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8984. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8985. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8986. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8987. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8988. }
  8989. get gamePause() {
  8990. return this._gamePause;
  8991. }
  8992. set gamePause(v) {
  8993. if (v) {
  8994. Laya.physicsTimer.pause();
  8995. }
  8996. else {
  8997. Laya.physicsTimer.resume();
  8998. }
  8999. this._gamePause = v;
  9000. }
  9001. get selfTurn() {
  9002. return this._selfTurn;
  9003. }
  9004. set selfTurn(val) {
  9005. this.trunCount++;
  9006. this._selfTurn = val;
  9007. if (val) {
  9008. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9009. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9010. }
  9011. else {
  9012. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9013. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9014. if (this.trunCount > 1)
  9015. PlatMgr.openBox();
  9016. }
  9017. }
  9018. resetGame() {
  9019. this.inHoleBalls = [];
  9020. this.isFirstInGame = true;
  9021. this.firstColliObj = null;
  9022. this.aiCamp = "";
  9023. this.selfCamp = "";
  9024. this.aiFoulNum = 0;
  9025. this.selfFoulNum = 0;
  9026. this.selfBallArr = [];
  9027. this.aiBallArr = [];
  9028. this.gamePause = false;
  9029. this.ensureBallType = false;
  9030. this.isInterrupt = false;
  9031. this.updateLeftBall();
  9032. this.clearTime();
  9033. this.aiPlayedBreakArmy = false;
  9034. this.isBlackInHole = false;
  9035. this.placeBallPosData = {};
  9036. if (xGame.common.d3World.knifeRoot) {
  9037. xGame.common.d3World.knifeRoot.destroyChildren();
  9038. }
  9039. }
  9040. gameReady() {
  9041. this.trunCount = 0;
  9042. this.firstColliObj = null;
  9043. this.isFirstInGame = true;
  9044. this.selfTurn = Math.random() <= this.selfTurnRate;
  9045. let challengeNum = DataMgr.getChallengeTimes();
  9046. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9047. this.selfTurn = true;
  9048. }
  9049. if (xGame.common.gameMode == GameMode.placeBall)
  9050. this.selfTurn = true;
  9051. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9052. this.selfTurn = true;
  9053. }
  9054. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9055. this.checkGuide();
  9056. if (xGame.common.uiRodMethod)
  9057. xGame.common.uiRodMethod.resetRod();
  9058. xGame.common.d2World.getHelpLine();
  9059. this.isOpenBall = true;
  9060. this.isTouchedBall = false;
  9061. xGame.common.aiPlayer.stopRun();
  9062. this.setTime = 30;
  9063. let ui = xGame.common.gameUI.ui;
  9064. switch (xGame.common.gameMode) {
  9065. case GameMode.classic:
  9066. xGame.common.aiPlayer.init();
  9067. this.blackNum = 8;
  9068. this.placeRootBall();
  9069. this.peoplePlay(9, 10);
  9070. ui.wordsBtn.visible = true;
  9071. ui.aiWordsBtn.visible = true;
  9072. xGame.common.talkMgr.changeAIState(true);
  9073. DataMgr.gameData.gameCount++;
  9074. DataMgr.saveGameData();
  9075. break;
  9076. case GameMode.bigMove:
  9077. this.blackNum = -1;
  9078. this.selfScore = 0;
  9079. this.aiScore = 0;
  9080. xGame.common.aiPlayer.init();
  9081. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9082. this.updateSelfScore();
  9083. this.updateAIScore();
  9084. this.updateTargetSroce();
  9085. this.placeRootBall();
  9086. this.peoplePlay(9, 10);
  9087. ui.wordsBtn.visible = true;
  9088. ui.aiWordsBtn.visible = true;
  9089. xGame.common.talkMgr.changeAIState(true);
  9090. if (DataMgr.getSkillGuide() < 1)
  9091. DataMgr.gameData.gameCount = 0;
  9092. else {
  9093. DataMgr.gameData.gameCount++;
  9094. DataMgr.saveGameData();
  9095. PlatMgr.openTry();
  9096. }
  9097. if (xGame.common.d3World.knifeRoot) {
  9098. xGame.common.d3World.knifeRoot.destroyChildren();
  9099. }
  9100. break;
  9101. case GameMode.placeBall:
  9102. this.blackNum = -1;
  9103. this.selfTurn = true;
  9104. this.setTime = 10000;
  9105. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9106. this.curHP = this.placeBallData.hp;
  9107. if (this.placeBallData.ball == -1)
  9108. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9109. else
  9110. this.needBalls = this.placeBallData.ball;
  9111. console.log("需要的进球数目", this.needBalls);
  9112. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9113. this.finishBalls = 0;
  9114. this.placeBallPosData = {};
  9115. this.updatePlaceBallPos();
  9116. this.updatePlaceBallState();
  9117. this.finishOneShoot = true;
  9118. xGame.common.gameUI.ui.moveNode.visible = false;
  9119. this.isOpenBall = false;
  9120. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9121. ui.wordsBtn.visible = false;
  9122. ui.aiWordsBtn.visible = false;
  9123. xGame.common.talkMgr.changeAIState(false);
  9124. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9125. PlatMgr.openBox();
  9126. });
  9127. break;
  9128. default:
  9129. break;
  9130. }
  9131. this.showLongView = false;
  9132. xGame.common.wordsMgr.comboTimes = 1;
  9133. let guide = DataMgr.getSkillGuide();
  9134. if (guide)
  9135. xGame.eventMgr.event(WAIT_SHOOT);
  9136. xGame.common.upSkillLevel = false;
  9137. xGame.common.gameStartTime = new Date().getTime();
  9138. this.firstShoot = true;
  9139. }
  9140. checkGuide() {
  9141. let guide = DataMgr.getSkillGuide();
  9142. let gameUI = xGame.common.gameUI.ui;
  9143. gameUI.guide1.visible = false;
  9144. gameUI.guide2.visible = false;
  9145. gameUI.guide3.visible = false;
  9146. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9147. this.selfTurn = true;
  9148. }
  9149. else {
  9150. return;
  9151. }
  9152. let oneBall = this.getOneBall();
  9153. gameUI.guide1.visible = true;
  9154. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9155. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9156. }
  9157. getOneBall() {
  9158. let arr = xGame.common.d2World.ballArr;
  9159. for (let index = 0; index < arr.length; index++) {
  9160. if (arr[index].number == 0)
  9161. continue;
  9162. return arr[index];
  9163. }
  9164. }
  9165. updateSelfScore() {
  9166. let ui = xGame.common.gameUI.ui.topNode;
  9167. ui.selfScoreTxt.text = this.selfScore + "";
  9168. }
  9169. updateAIScore() {
  9170. let ui = xGame.common.gameUI.ui.topNode;
  9171. ui.aiScoreTxt.text = this.aiScore + "";
  9172. }
  9173. updateTargetSroce() {
  9174. let ui = xGame.common.gameUI.ui.topNode;
  9175. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9176. }
  9177. updateLeftBall() {
  9178. let topUI = xGame.common.gameUI.ui.topNode;
  9179. topUI.selfBallList.numItems = this.selfBallArr.length;
  9180. topUI.aiBallList.numItems = this.aiBallArr.length;
  9181. }
  9182. ballShoot() {
  9183. this.clearTime();
  9184. this.finishOneShoot = false;
  9185. xGame.common.gameUI.ui.moveNode.visible = false;
  9186. if (xGame.common.gameUI.ui.guideNode.visible) {
  9187. xGame.common.gameUI.ui.guideNode.visible = false;
  9188. }
  9189. if (this.firstShoot) {
  9190. this.firstShoot = false;
  9191. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9192. }
  9193. }
  9194. ensureCamp(number) {
  9195. this.ensureBallType = true;
  9196. this.isOpenBall = false;
  9197. if (xGame.common.gameMode != GameMode.classic)
  9198. return;
  9199. let full = [1, 2, 3, 4, 5, 6, 7];
  9200. let flower = [9, 10, 11, 12, 13, 14, 15];
  9201. let sayWords = "";
  9202. if (this.selfTurn) {
  9203. if (number <= 7) {
  9204. this.selfCamp = ballCamp.full;
  9205. this.selfBallArr = full;
  9206. this.aiCamp = ballCamp.flower;
  9207. this.aiBallArr = flower;
  9208. sayWords = cfgTable.wordsData[3].msg;
  9209. }
  9210. else {
  9211. this.selfCamp = ballCamp.flower;
  9212. this.selfBallArr = flower;
  9213. this.aiCamp = ballCamp.full;
  9214. this.aiBallArr = full;
  9215. sayWords = cfgTable.wordsData[4].msg;
  9216. }
  9217. }
  9218. else {
  9219. if (number <= 7) {
  9220. this.selfCamp = ballCamp.flower;
  9221. this.selfBallArr = flower;
  9222. this.aiCamp = ballCamp.full;
  9223. this.aiBallArr = full;
  9224. sayWords = cfgTable.wordsData[2].msg;
  9225. }
  9226. else {
  9227. this.selfCamp = ballCamp.full;
  9228. this.selfBallArr = full;
  9229. this.aiCamp = ballCamp.flower;
  9230. this.aiBallArr = flower;
  9231. sayWords = cfgTable.wordsData[1].msg;
  9232. }
  9233. }
  9234. this.updateLeftBall();
  9235. xGame.uiMgr.Show(UIMsg, sayWords);
  9236. }
  9237. updatePlaceBallState() {
  9238. let ui = xGame.common.gameUI.ui;
  9239. switch (this.placeBallData.type) {
  9240. case PlaceBallType.normal:
  9241. let normal = ui.placeNormalNode;
  9242. normal.hpTxt.text = this.curHP + "";
  9243. this.updatePlaceBallStar(normal);
  9244. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9245. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9246. break;
  9247. case PlaceBallType.challenge:
  9248. let challenge = ui.placeChallengeNode;
  9249. challenge.hpTxt.text = "Shots:" + this.curHP;
  9250. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9251. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9252. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9253. break;
  9254. default:
  9255. break;
  9256. }
  9257. }
  9258. playSubHpAni() {
  9259. let ui = xGame.common.gameUI.ui;
  9260. switch (this.placeBallData.type) {
  9261. case PlaceBallType.normal:
  9262. let normal = ui.placeNormalNode;
  9263. normal.hpTxt.visible = false;
  9264. normal.starAni.c1.selectedIndex = 1;
  9265. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9266. normal.hpTxt.visible = true;
  9267. normal.starAni.c1.selectedIndex = 0;
  9268. }));
  9269. break;
  9270. default:
  9271. break;
  9272. }
  9273. }
  9274. getEndStarNum() {
  9275. let num;
  9276. let level = xGame.common.placeBallCurLevel;
  9277. if (this.curHP == this.placeBallData.hp) {
  9278. num = 3;
  9279. }
  9280. else if (this.curHP <= 1) {
  9281. num = 1;
  9282. }
  9283. else {
  9284. num = 2;
  9285. }
  9286. if (!this.success) {
  9287. num = 0;
  9288. }
  9289. else {
  9290. DataMgr.setPlaceBallLevel(level, num);
  9291. }
  9292. let myType = cfgTable.placeballData[level].type;
  9293. if (this.success && myType == 1) {
  9294. num = 3;
  9295. }
  9296. xGame.common.placeBallStarNum = num;
  9297. }
  9298. updatePlaceBallStar(node) {
  9299. let star = 0;
  9300. if (this.curHP == this.placeBallData.hp) {
  9301. star = 3;
  9302. }
  9303. else if (this.curHP >= 2) {
  9304. star = 2;
  9305. }
  9306. else if (this.curHP == 1) {
  9307. star = 1;
  9308. }
  9309. else {
  9310. star = 0;
  9311. }
  9312. let temp;
  9313. for (let index = 1; index <= 3; index++) {
  9314. temp = node["star" + index];
  9315. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9316. }
  9317. node.myProgress.value = (star / 3) * 100;
  9318. }
  9319. openRegretView(isFoul, GoalNum, challenge = false) {
  9320. let regretType = -1;
  9321. if (isFoul) {
  9322. regretType = 1;
  9323. }
  9324. else {
  9325. if (GoalNum <= 0) {
  9326. regretType = 0;
  9327. }
  9328. }
  9329. if (challenge) {
  9330. regretType = 1;
  9331. }
  9332. if (regretType != -1) {
  9333. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9334. if (success) {
  9335. this.curHP++;
  9336. this.updatePlaceBallState();
  9337. this.setPlaceBallAllPos();
  9338. xGame.common.gameUI.ui.moveNode.visible = false;
  9339. }
  9340. else {
  9341. if (this.curHP <= 0) {
  9342. this.success = false;
  9343. this.gameEnd();
  9344. }
  9345. this.playSubHpAni();
  9346. }
  9347. this.updatePlaceBallState();
  9348. this.updatePlaceBallPos();
  9349. });
  9350. }
  9351. }
  9352. setPlaceBallAllPos() {
  9353. let allBall = xGame.common.d2World.ballArr;
  9354. let cfgArr = this.placeBallPosData;
  9355. let temp;
  9356. let obj;
  9357. for (let index = 0; index < allBall.length; index++) {
  9358. temp = allBall[index];
  9359. if (temp.destroyed)
  9360. continue;
  9361. obj = cfgArr[temp.myUNID];
  9362. if (obj && obj.src && !obj.src.destroyed) {
  9363. temp.gameObj.x = obj.posX;
  9364. temp.gameObj.y = obj.posY;
  9365. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9366. }
  9367. }
  9368. xGame.common.d2World.getHelpLine();
  9369. }
  9370. updatePlaceBallPos() {
  9371. let arr = xGame.common.d2World.ballArr;
  9372. let temp;
  9373. for (let index = 0; index < arr.length; index++) {
  9374. temp = arr[index];
  9375. if (!this.placeBallPosData[temp.myUNID]) {
  9376. this.placeBallPosData[temp.myUNID] = {
  9377. src: temp,
  9378. posX: temp.gameObj.x,
  9379. posY: temp.gameObj.y
  9380. };
  9381. }
  9382. else {
  9383. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9384. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9385. }
  9386. }
  9387. let check;
  9388. for (const key in this.placeBallPosData) {
  9389. check = this.placeBallPosData[key];
  9390. if (check.src.destroyed) {
  9391. delete this.placeBallPosData[key];
  9392. }
  9393. }
  9394. }
  9395. gameRun(type) {
  9396. if (this.gamePause)
  9397. return;
  9398. this.curFoul = this.getFoulType();
  9399. if (type) {
  9400. xGame.common.d2World.d2Gan.shoot();
  9401. xGame.common.gameUI.forceCancel();
  9402. this.curFoul = type;
  9403. }
  9404. this.isEnd = false;
  9405. this.isChangeTurn = true;
  9406. if (xGame.common.gameMode == GameMode.classic) {
  9407. this.judgeClassic(this.curFoul);
  9408. this.checkClassicWords(() => {
  9409. xGame.common.destroyClassicEmotion();
  9410. if (this.isEnd) {
  9411. if (this.isBlackInHole) {
  9412. xGame.common.gameUI.ui.blackAni.visible = true;
  9413. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9414. xGame.common.gameUI.ui.blackAni.visible = false;
  9415. this.gameEnd();
  9416. }));
  9417. }
  9418. else {
  9419. this.gameEnd();
  9420. }
  9421. }
  9422. else {
  9423. this.waitShoot();
  9424. xGame.eventMgr.event(WAIT_SHOOT);
  9425. }
  9426. });
  9427. }
  9428. else if (xGame.common.gameMode == GameMode.bigMove) {
  9429. xGame.common.aiPlayer.stopRun();
  9430. let scoreArr = this.getScore(this.curFoul);
  9431. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9432. this.isEnd = true;
  9433. }
  9434. this.checkBigSkillWords(() => {
  9435. if (this.isEnd) {
  9436. this.gameEnd();
  9437. }
  9438. else {
  9439. this.waitShoot();
  9440. xGame.eventMgr.event(WAIT_SHOOT);
  9441. }
  9442. });
  9443. }
  9444. else if (xGame.common.gameMode == GameMode.placeBall) {
  9445. xGame.common.destroyAwardSpine();
  9446. let isFoul = this.curFoul == FoulType.rootHole;
  9447. let GoalNum = this.inHoleBalls.length;
  9448. if (this.inHoleBalls.indexOf(0) > -1)
  9449. GoalNum -= 1;
  9450. if (isFoul) {
  9451. this.placeRootBall();
  9452. }
  9453. console.log("neeballs", this.needBalls);
  9454. console.log("当前完成的goalNum", GoalNum);
  9455. this.finishBalls += GoalNum;
  9456. console.log("当前完成的finishballs", this.finishBalls);
  9457. let need = this.needBalls;
  9458. if (this.placeBallData.type == PlaceBallType.challenge) {
  9459. need += 100;
  9460. }
  9461. if (this.finishBalls >= need) {
  9462. this.success = true;
  9463. this.gameEnd();
  9464. }
  9465. else {
  9466. switch (this.placeBallData.type) {
  9467. case PlaceBallType.normal:
  9468. if (!isFoul && GoalNum > 0) {
  9469. this.updatePlaceBallPos();
  9470. this.updatePlaceBallState();
  9471. }
  9472. else {
  9473. this.curHP--;
  9474. this.openRegretView(isFoul, GoalNum);
  9475. }
  9476. this.waitShoot();
  9477. xGame.eventMgr.event(WAIT_SHOOT);
  9478. break;
  9479. case PlaceBallType.challenge:
  9480. this.curHP--;
  9481. this.updatePlaceBallState();
  9482. if (isFoul) {
  9483. this.openRegretView(isFoul, GoalNum, true);
  9484. }
  9485. else {
  9486. this.updatePlaceBallPos();
  9487. if (this.curHP <= 0) {
  9488. this.success = true;
  9489. this.gameEnd();
  9490. }
  9491. }
  9492. this.waitShoot();
  9493. xGame.eventMgr.event(WAIT_SHOOT);
  9494. break;
  9495. default:
  9496. break;
  9497. }
  9498. }
  9499. }
  9500. }
  9501. checkClassicWords(callback) {
  9502. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9503. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9504. let type = this.getClassicWordsType();
  9505. if (condition && type != -1) {
  9506. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9507. xGame.soundMgr.playSound(str);
  9508. xGame.common.wordsMgr.playClassicWords(type, callback);
  9509. }
  9510. else {
  9511. Laya.timer.once(300, this, () => {
  9512. callback && callback();
  9513. });
  9514. }
  9515. }
  9516. getClassicWordsType() {
  9517. let d2world = xGame.common.d2World;
  9518. let type = -1;
  9519. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9520. type = ClassicWordsType.perfectShow;
  9521. return type;
  9522. }
  9523. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9524. type = ClassicWordsType.directShoot;
  9525. return type;
  9526. }
  9527. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9528. type = ClassicWordsType.anotherShoot;
  9529. return type;
  9530. }
  9531. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9532. type = ClassicWordsType.bigPower;
  9533. return type;
  9534. }
  9535. let minSpeed = 1;
  9536. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9537. type = ClassicWordsType.hardShoot;
  9538. return type;
  9539. }
  9540. if (this.inHoleBalls.length > 0) {
  9541. type = ClassicWordsType.directShoot;
  9542. return type;
  9543. }
  9544. return type;
  9545. }
  9546. checkBigSkillWords(callback) {
  9547. if (this.curFoul == FoulType.timeOut) {
  9548. callback && callback();
  9549. }
  9550. else {
  9551. let playSkill = false;
  9552. if (this.selfTurn) {
  9553. playSkill = true;
  9554. }
  9555. else {
  9556. if (!this.aiPlayedBreakArmy) {
  9557. this.aiPlayedBreakArmy = true;
  9558. playSkill = true;
  9559. }
  9560. if (this.aiCurSkill != SkillType.breakArmy) {
  9561. playSkill = true;
  9562. }
  9563. }
  9564. if (xGame.common.skillMgr.playedLastSkill) {
  9565. xGame.common.skillMgr.playedLastSkill = false;
  9566. playSkill = false;
  9567. }
  9568. if (playSkill) {
  9569. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9570. let selfExtra = 0;
  9571. let aiExtra = 0;
  9572. if (this.selfTurn)
  9573. selfExtra += extraScore;
  9574. else
  9575. aiExtra += extraScore;
  9576. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9577. this.isEnd = true;
  9578. }
  9579. this.playBigSkillTimes(callback);
  9580. });
  9581. }
  9582. else {
  9583. this.playBigSkillTimes(callback);
  9584. }
  9585. }
  9586. }
  9587. playBigSkillTimes(callback) {
  9588. let length = this.inHoleBalls.length;
  9589. if (this.inHoleBalls.indexOf(0) > -1) {
  9590. length = this.inHoleBalls.length - 1;
  9591. }
  9592. if (length <= 0) {
  9593. callback && callback();
  9594. return;
  9595. }
  9596. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9597. callback && callback();
  9598. });
  9599. }
  9600. playSkillTips() {
  9601. let levelNum = 0;
  9602. let curType;
  9603. if (this.selfTurn) {
  9604. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9605. curType = this.selfCurSkill;
  9606. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9607. levelNum += 5;
  9608. }
  9609. }
  9610. else {
  9611. levelNum = this.aiSkillLevelNum;
  9612. curType = this.aiCurSkill;
  9613. }
  9614. let str = ``;
  9615. switch (curType) {
  9616. case SkillType.highSpace:
  9617. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9618. break;
  9619. case SkillType.breakArmy:
  9620. str = `You pocketed ${levelNum} extra balls`;
  9621. break;
  9622. case SkillType.ice:
  9623. str = `${levelNum * 2} extra balls were frozen`;
  9624. break;
  9625. case SkillType.fireworks:
  9626. str = `${levelNum} extra balls exploded `;
  9627. break;
  9628. case SkillType.GuanYu:
  9629. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9630. break;
  9631. default:
  9632. break;
  9633. }
  9634. xGame.uiMgr.Show(UIMsg, str);
  9635. }
  9636. getFoulType() {
  9637. let foulType = "";
  9638. if (this.firstColliObj == null) {
  9639. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9640. return FoulType.rootHole;
  9641. }
  9642. return FoulType.notTouch;
  9643. }
  9644. else {
  9645. if (this.selfTurn) {
  9646. if (this.selfBallArr.length > 0) {
  9647. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9648. foulType = FoulType.wrongTouch;
  9649. }
  9650. }
  9651. else {
  9652. if (this.ensureBallType) {
  9653. }
  9654. else {
  9655. if (this.firstColliObj == this.blackNum) {
  9656. foulType = FoulType.wrongTouch;
  9657. }
  9658. }
  9659. }
  9660. }
  9661. else {
  9662. if (this.aiBallArr.length > 0) {
  9663. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9664. foulType = FoulType.wrongTouch;
  9665. }
  9666. }
  9667. else {
  9668. if (this.ensureBallType) {
  9669. }
  9670. else {
  9671. if (this.firstColliObj == this.blackNum) {
  9672. foulType = FoulType.wrongTouch;
  9673. }
  9674. }
  9675. }
  9676. }
  9677. if (this.inHoleBalls.length <= 0) {
  9678. return foulType;
  9679. }
  9680. let temp;
  9681. if (this.inHoleBalls.indexOf(0) > -1) {
  9682. foulType = FoulType.rootHole;
  9683. }
  9684. else {
  9685. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9686. temp = this.inHoleBalls[index];
  9687. if (this.selfTurn) {
  9688. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9689. foulType = FoulType.wrongHole;
  9690. break;
  9691. }
  9692. }
  9693. else {
  9694. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9695. foulType = FoulType.wrongHole;
  9696. break;
  9697. }
  9698. }
  9699. }
  9700. }
  9701. let foo;
  9702. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9703. temp = this.inHoleBalls[index];
  9704. foo = this.selfBallArr.indexOf(temp);
  9705. if (foo > -1) {
  9706. this.selfBallArr.splice(foo, 1);
  9707. }
  9708. foo = this.aiBallArr.indexOf(temp);
  9709. if (foo > -1) {
  9710. this.aiBallArr.splice(foo, 1);
  9711. }
  9712. }
  9713. this.updateLeftBall();
  9714. }
  9715. return foulType;
  9716. }
  9717. judgeGameEndByBlack(arr) {
  9718. if (this.selfTurn) {
  9719. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9720. this.selfFoulNum = this.maxFoulTimes;
  9721. return true;
  9722. }
  9723. }
  9724. else {
  9725. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9726. this.aiFoulNum = this.maxFoulTimes;
  9727. return true;
  9728. }
  9729. }
  9730. }
  9731. judgeClassic(type) {
  9732. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9733. xGame.common.aiPlayer.stopRun();
  9734. if (this.judgeNormalSuccess()) {
  9735. this.isEnd = true;
  9736. return;
  9737. }
  9738. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9739. if (this.selfTurn) {
  9740. if (isFoul) {
  9741. this.selfFoulNum++;
  9742. }
  9743. if (this.selfFoulNum >= this.maxFoulTimes) {
  9744. this.success = false;
  9745. this.isEnd = true;
  9746. return;
  9747. }
  9748. }
  9749. else {
  9750. if (isFoul)
  9751. this.aiFoulNum++;
  9752. if (this.aiFoulNum >= this.maxFoulTimes) {
  9753. this.success = true;
  9754. this.isEnd = true;
  9755. return;
  9756. }
  9757. }
  9758. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9759. this.isChangeTurn = false;
  9760. }
  9761. else {
  9762. this.isInterrupt = true;
  9763. }
  9764. }
  9765. waitShoot() {
  9766. if (xGame.common.gameMode == GameMode.classic) {
  9767. switch (this.curFoul) {
  9768. case FoulType.timeOut:
  9769. case FoulType.rootHole:
  9770. this.selfTurn = !this.selfTurn;
  9771. this.peoplePlay(5, 6, true);
  9772. break;
  9773. case FoulType.notTouch:
  9774. this.selfTurn = !this.selfTurn;
  9775. this.peoplePlay(7, 7);
  9776. break;
  9777. case FoulType.wrongHole:
  9778. this.selfTurn = !this.selfTurn;
  9779. this.peoplePlay(11, 11);
  9780. break;
  9781. default:
  9782. if (this.inHoleBalls.length > 0) {
  9783. this.peoplePlay(0, 0, false, false);
  9784. }
  9785. else {
  9786. this.selfTurn = !this.selfTurn;
  9787. this.peoplePlay(7, 7);
  9788. }
  9789. break;
  9790. }
  9791. }
  9792. else if (xGame.common.gameMode == GameMode.bigMove) {
  9793. if (this.curFoul == FoulType.timeOut) {
  9794. this.selfTurn = !this.selfTurn;
  9795. this.peoplePlay(14, 15);
  9796. this.placeRootBall();
  9797. }
  9798. else {
  9799. this.selfTurn = !this.selfTurn;
  9800. if (this.curFoul == FoulType.rootHole) {
  9801. this.peoplePlay(12, 13);
  9802. this.placeRootBall();
  9803. }
  9804. else {
  9805. this.peoplePlay(0, 0, false, false);
  9806. }
  9807. }
  9808. }
  9809. else if (xGame.common.gameMode == GameMode.placeBall) {
  9810. this.finishOneShoot = true;
  9811. }
  9812. this.gameResult();
  9813. }
  9814. gameResult() {
  9815. this.firstColliObj = null;
  9816. this.inHoleBalls = [];
  9817. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9818. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9819. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9820. if (xGame.common.uiRodMethod)
  9821. xGame.common.uiRodMethod.resetRod();
  9822. xGame.common.d2World.rootBall.showSelf();
  9823. this.clearIceSkill();
  9824. if (this.selfTurn) {
  9825. PlatMgr.gameInsert();
  9826. }
  9827. xGame.common.d3World.knifeRoot.destroyChildren();
  9828. if (this.selfTurn) {
  9829. xGame.common.gameUI.showHelpLineGuide();
  9830. xGame.common.gameUI.setTurnAlpha(true);
  9831. }
  9832. else {
  9833. xGame.common.gameUI.setTurnAlpha(false);
  9834. }
  9835. }
  9836. getScore(type) {
  9837. let selfAdd = 0;
  9838. let aiAdd = 0;
  9839. if (type == FoulType.timeOut) {
  9840. if (this.selfTurn)
  9841. aiAdd += 3;
  9842. else
  9843. selfAdd += 3;
  9844. }
  9845. else {
  9846. if (this.inHoleBalls.length > 0) {
  9847. if (this.selfTurn) {
  9848. if (type == FoulType.rootHole) {
  9849. aiAdd += 3;
  9850. if (this.inHoleBalls.length - 1 > 0) {
  9851. selfAdd += this.inHoleBalls.length - 1;
  9852. }
  9853. }
  9854. else {
  9855. selfAdd += this.inHoleBalls.length;
  9856. }
  9857. }
  9858. else {
  9859. if (type == FoulType.rootHole) {
  9860. selfAdd += 3;
  9861. if (this.inHoleBalls.length - 1 > 0) {
  9862. aiAdd += this.inHoleBalls.length - 1;
  9863. }
  9864. }
  9865. else {
  9866. aiAdd += this.inHoleBalls.length;
  9867. }
  9868. }
  9869. }
  9870. }
  9871. return [selfAdd, aiAdd];
  9872. }
  9873. judgeScoreEnd(selfAdd, aiAdd) {
  9874. this.selfScore += selfAdd;
  9875. this.aiScore += aiAdd;
  9876. this.updateAIScore();
  9877. this.updateSelfScore();
  9878. if (this.selfScore >= this.targertScore) {
  9879. this.success = true;
  9880. return true;
  9881. }
  9882. if (this.aiScore >= this.targertScore) {
  9883. this.success = false;
  9884. return true;
  9885. }
  9886. let ballArr = xGame.common.d2World.ballArr;
  9887. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9888. if (this.selfScore > this.aiScore) {
  9889. this.success = true;
  9890. return true;
  9891. }
  9892. else if (this.selfScore < this.aiScore) {
  9893. this.success = false;
  9894. return true;
  9895. }
  9896. else {
  9897. if (this.selfTurn) {
  9898. this.success = false;
  9899. }
  9900. else {
  9901. this.success = true;
  9902. }
  9903. return true;
  9904. }
  9905. }
  9906. }
  9907. clearIceSkill() {
  9908. let arr = xGame.common.d2World.ballArr;
  9909. let temp;
  9910. if (this.selfTurn) {
  9911. if (this.selfCurSkill == SkillType.ice) {
  9912. for (let index = 0; index < arr.length; index++) {
  9913. temp = arr[index];
  9914. if (temp.ballFunc == "ice") {
  9915. temp.setBallFunc("normal", "self");
  9916. }
  9917. }
  9918. }
  9919. }
  9920. else {
  9921. if (this.aiCurSkill == SkillType.ice) {
  9922. for (let index = 0; index < arr.length; index++) {
  9923. temp = arr[index];
  9924. if (temp.ballFunc == "ice") {
  9925. temp.setBallFunc("normal", "ai");
  9926. }
  9927. }
  9928. }
  9929. }
  9930. }
  9931. judgeNormalSuccess() {
  9932. if (this.selfTurn) {
  9933. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9934. this.success = true;
  9935. return true;
  9936. }
  9937. }
  9938. else {
  9939. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9940. this.success = false;
  9941. return true;
  9942. }
  9943. }
  9944. }
  9945. gameEnd() {
  9946. if (Moyu.isTT) {
  9947. xGame.common.screenImg = getScreenImg();
  9948. }
  9949. console.log("游戏结束", this.success);
  9950. xGame.common.aiPlayer.stopRun();
  9951. if (xGame.common.gameMode == GameMode.placeBall) {
  9952. this.getEndStarNum();
  9953. this.updatePlaceBallState();
  9954. }
  9955. this.isEnter = false;
  9956. Moyu.recordEnd(this, () => {
  9957. if (this.isEnter)
  9958. return;
  9959. this.isEnter = true;
  9960. console.log("进入录结束回调");
  9961. this.enterNext();
  9962. });
  9963. Laya.timer.once(1000, this, () => {
  9964. if (this.isEnter)
  9965. return;
  9966. this.isEnter = true;
  9967. this.enterNext();
  9968. });
  9969. xGame.common.longHelpLine = false;
  9970. }
  9971. enterNext() {
  9972. Laya.timer.clearAll(this);
  9973. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9974. xGame.uiMgr.Show(UIVideoShare, this.success);
  9975. }
  9976. else {
  9977. xGame.uiMgr.Show(UIGameEnd, this.success);
  9978. }
  9979. }
  9980. aiLeave() {
  9981. let ui = xGame.common.gameUI.ui;
  9982. ui.topNode.aiNameTxt.text = "offline";
  9983. }
  9984. aiGameEnd(suc) {
  9985. this.success = suc;
  9986. xGame.common.aiPlayer.stopRun();
  9987. if (this.success) {
  9988. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9989. Laya.timer.once(1000, this, () => {
  9990. this.clearTime();
  9991. this.gameEnd();
  9992. });
  9993. }
  9994. }
  9995. openTimer() {
  9996. let src = xGame.common.gameUI;
  9997. if (this.selfTurn) {
  9998. src.ui.topNode.selfProgress.visible = true;
  9999. src.ui.topNode.aiProgress.visible = false;
  10000. this.curTimer = src.ui.topNode.selfProgress;
  10001. }
  10002. else {
  10003. src.ui.topNode.selfProgress.visible = false;
  10004. src.ui.topNode.aiProgress.visible = true;
  10005. this.curTimer = src.ui.topNode.aiProgress;
  10006. }
  10007. this.accTime = 0;
  10008. Laya.timer.clearAll(this);
  10009. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10010. this.curTimer.value = 100;
  10011. }
  10012. updateTime(dt) {
  10013. if (this.gamePause)
  10014. return;
  10015. this.accTime += dt;
  10016. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10017. if (this.accTime >= this.setTime) {
  10018. this.clearTime();
  10019. console.log("时钟进入了gameRun");
  10020. this.gameRun(FoulType.timeOut);
  10021. }
  10022. }
  10023. clearTime() {
  10024. let src = xGame.common.gameUI;
  10025. src.ui.topNode.selfProgress.visible = false;
  10026. src.ui.topNode.aiProgress.visible = false;
  10027. Laya.timer.clearAll(this);
  10028. }
  10029. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10030. let ui = xGame.common.gameUI.ui;
  10031. let selfMsg, aiMsg;
  10032. if (sayWords) {
  10033. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10034. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10035. if (Foul) {
  10036. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10037. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10038. this.placeRootBall();
  10039. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10040. if (this.curFoul == FoulType.rootHole) {
  10041. if (!DataMgr.getRootBallFoul()) {
  10042. DataMgr.setRootBallFoul();
  10043. aiMsg = "";
  10044. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10045. let woman = "Boss, pay attention next time~";
  10046. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10047. }
  10048. }
  10049. else if (this.curFoul == FoulType.timeOut) {
  10050. if (!DataMgr.getTimeoutFoul()) {
  10051. DataMgr.setTimeoutFoul();
  10052. aiMsg = "";
  10053. let tips = "Game timeout, 3 fouls, this game failed.";
  10054. let woman = "Boss, pay attention to the timeline~";
  10055. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10056. }
  10057. }
  10058. }
  10059. }
  10060. }
  10061. if (this.selfTurn) {
  10062. if (sayWords) {
  10063. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10064. ui.selfTurn.visible = true;
  10065. ui.aiTurn.visible = false;
  10066. ui.selfTurn.t0.play();
  10067. Moyu.vibration();
  10068. });
  10069. }
  10070. }
  10071. else {
  10072. let aiNum = xGame.tools.random(1, 11);
  10073. let challengeNum = DataMgr.getChallengeTimes();
  10074. let delay = false;
  10075. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10076. aiNum = 9;
  10077. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10078. aiNum = 3;
  10079. if (challengeNum == 3) {
  10080. if (!this.showLongView) {
  10081. this.showLongView = true;
  10082. delay = true;
  10083. }
  10084. }
  10085. }
  10086. }
  10087. if (delay) {
  10088. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10089. if (success) {
  10090. xGame.common.longHelpLine = true;
  10091. xGame.common.d2World.getHelpLine();
  10092. }
  10093. else {
  10094. aiNum = 10;
  10095. }
  10096. xGame.common.aiPlayer.setAiLevel(aiNum);
  10097. if (sayWords) {
  10098. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10099. xGame.common.aiPlayer.runAI();
  10100. ui.selfTurn.visible = false;
  10101. ui.aiTurn.visible = true;
  10102. ui.aiTurn.t0.play();
  10103. });
  10104. }
  10105. else {
  10106. xGame.common.aiPlayer.runAI();
  10107. }
  10108. this.openTimer();
  10109. this.finishOneShoot = true;
  10110. if (this.selfTurn) {
  10111. ui.topNode.selfKuang.visible = true;
  10112. ui.topNode.aiKuang.visible = false;
  10113. ui.topNode.selfTips.visible = true;
  10114. ui.topNode.aiTips.visible = false;
  10115. }
  10116. else {
  10117. ui.topNode.selfKuang.visible = false;
  10118. ui.topNode.aiKuang.visible = true;
  10119. ui.topNode.selfTips.visible = false;
  10120. ui.topNode.aiTips.visible = true;
  10121. }
  10122. });
  10123. return;
  10124. }
  10125. if (xGame.common.gameMode == GameMode.classic) {
  10126. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10127. if (cfg) {
  10128. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10129. aiNum = aiLevel;
  10130. }
  10131. }
  10132. xGame.common.aiPlayer.setAiLevel(aiNum);
  10133. if (sayWords) {
  10134. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10135. xGame.common.aiPlayer.runAI();
  10136. ui.selfTurn.visible = false;
  10137. ui.aiTurn.visible = true;
  10138. ui.aiTurn.t0.play();
  10139. });
  10140. }
  10141. else {
  10142. xGame.common.aiPlayer.runAI();
  10143. }
  10144. }
  10145. this.openTimer();
  10146. this.finishOneShoot = true;
  10147. if (this.selfTurn) {
  10148. ui.topNode.selfKuang.visible = true;
  10149. ui.topNode.aiKuang.visible = false;
  10150. ui.topNode.selfTips.visible = true;
  10151. ui.topNode.aiTips.visible = false;
  10152. }
  10153. else {
  10154. ui.topNode.selfKuang.visible = false;
  10155. ui.topNode.aiKuang.visible = true;
  10156. ui.topNode.selfTips.visible = false;
  10157. ui.topNode.aiTips.visible = true;
  10158. }
  10159. }
  10160. placeRootBall() {
  10161. let rootBall = xGame.common.d2World.rootBall;
  10162. if (!rootBall)
  10163. return;
  10164. rootBall.gameObj.x = this.lastRootBallPos.x;
  10165. rootBall.gameObj.y = this.lastRootBallPos.y;
  10166. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10167. let moveNode = xGame.common.gameUI.ui.moveNode;
  10168. moveNode.visible = true;
  10169. moveNode.x = this.lastRootBallPos.x;
  10170. moveNode.y = this.lastRootBallPos.y;
  10171. if (!this.selfTurn) {
  10172. xGame.common.aiPlayer.resetRoot();
  10173. }
  10174. }
  10175. }
  10176. class ui_guanyuAni extends fgui.GComponent {
  10177. static createInstance() {
  10178. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10179. }
  10180. onConstruct() {
  10181. this.n0 = (this.getChild("n0"));
  10182. }
  10183. }
  10184. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10185. class UIFireworks extends UIBase {
  10186. constructor() {
  10187. super();
  10188. }
  10189. onConstructor() {
  10190. this.isEject = false;
  10191. }
  10192. show(callback) {
  10193. super.show();
  10194. }
  10195. }
  10196. UIFireworks.uiName = "UIFireworks";
  10197. class ui_UIGuanYu extends fgui.GComponent {
  10198. static createInstance() {
  10199. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10200. }
  10201. onConstruct() {
  10202. this.n2 = (this.getChild("n2"));
  10203. this.n1 = (this.getChild("n1"));
  10204. this.n3 = (this.getChild("n3"));
  10205. this.n4 = (this.getChild("n4"));
  10206. this.n5 = (this.getChild("n5"));
  10207. this.n6 = (this.getChild("n6"));
  10208. this.n8 = (this.getChild("n8"));
  10209. this.n7 = (this.getChild("n7"));
  10210. this.t0 = this.getTransition("t0");
  10211. }
  10212. }
  10213. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10214. class UIGuanYu extends UIBase {
  10215. constructor() {
  10216. super();
  10217. }
  10218. onConstructor() {
  10219. this.ui = ui_UIGuanYu.createInstance();
  10220. this.contentPane = this.ui;
  10221. this.isEject = false;
  10222. }
  10223. show(callback) {
  10224. super.show();
  10225. this.ui.t0.play(Laya.Handler.create(this, () => {
  10226. callback && callback();
  10227. this.hide();
  10228. }));
  10229. }
  10230. }
  10231. UIGuanYu.uiName = "UIGuanYu";
  10232. class SkillMgr {
  10233. constructor() {
  10234. this.leveNum = 0;
  10235. this.extraScore = 0;
  10236. this.selfTurn = false;
  10237. this.playedLastSkill = false;
  10238. this.tweenArr = [];
  10239. this._finishNum = 0;
  10240. this._curFinish = 0;
  10241. this._rootX = 0;
  10242. this._rootY = 0;
  10243. this.knifeTimes = 0;
  10244. this.knifeV2 = new Laya.Vector2();
  10245. this.knifeV3 = new Laya.Vector3();
  10246. this.rtStarX = 0;
  10247. this.rtStarY = 0;
  10248. this.addBigSkillSpine();
  10249. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10250. }
  10251. addBigSkillSpine() {
  10252. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10253. console.log("extra2 success");
  10254. });
  10255. }
  10256. runBigSkill(callback) {
  10257. this.tweenArr = [];
  10258. this.callback = callback;
  10259. this.judgeSkill();
  10260. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10261. let guide = DataMgr.getSkillGuide();
  10262. if (!xGame.common.gameMgr.selfTurn) {
  10263. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10264. }
  10265. else {
  10266. if (xGame.common.temSelfLevel != 0) {
  10267. this.leveNum = xGame.common.temSelfLevel;
  10268. }
  10269. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10270. this.leveNum += 5;
  10271. }
  10272. }
  10273. if (guide == 0) {
  10274. DataMgr.setSkillGuide(1);
  10275. if (DataMgr.getNewUser()) {
  10276. Moyu.sendDataEvent("gameFirstPlay");
  10277. DataMgr.setNewUser();
  10278. }
  10279. }
  10280. this.playSpineAni(() => {
  10281. switch (this.curSkill) {
  10282. case SkillType.highSpace:
  10283. this.runHighSpace();
  10284. break;
  10285. case SkillType.breakArmy:
  10286. this.runBreakArmy();
  10287. break;
  10288. case SkillType.ice:
  10289. this.runIce();
  10290. break;
  10291. case SkillType.fireworks:
  10292. this.runFireworks();
  10293. break;
  10294. case SkillType.GuanYu:
  10295. this.runGuanYu();
  10296. break;
  10297. default:
  10298. break;
  10299. }
  10300. });
  10301. }
  10302. judgeSkill() {
  10303. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10304. let gameMgr = xGame.common.gameMgr;
  10305. let type;
  10306. for (let index = 0; index < typeArr.length; index++) {
  10307. type = typeArr[index];
  10308. if (gameMgr.selfTurn) {
  10309. if (gameMgr.selfCurSkill == type) {
  10310. this.selfTurn = true;
  10311. this.curSkill = type;
  10312. return;
  10313. }
  10314. }
  10315. else {
  10316. if (gameMgr.aiCurSkill == type) {
  10317. this.selfTurn = false;
  10318. this.curSkill = type;
  10319. return;
  10320. }
  10321. }
  10322. }
  10323. }
  10324. playSpineAni(callback) {
  10325. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10326. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10327. parent.destroyChildren();
  10328. let aniIndex = 0;
  10329. let skillSpine;
  10330. switch (this.curSkill) {
  10331. case SkillType.highSpace:
  10332. aniIndex = 1;
  10333. xGame.soundMgr.playSound("skill01");
  10334. skillSpine = this.skillSpine2;
  10335. data.scaleX = 0.5;
  10336. data.scaleY = 0.5;
  10337. skillSpine.play(data, 1, false, parent, () => {
  10338. callback && callback();
  10339. });
  10340. break;
  10341. case SkillType.breakArmy:
  10342. aniIndex = 2;
  10343. xGame.soundMgr.playSound("skill02");
  10344. skillSpine = this.skillSpine2;
  10345. data.scaleX = 0.5;
  10346. data.scaleY = 0.5;
  10347. skillSpine.play(data, 2, false, parent, () => {
  10348. callback && callback();
  10349. });
  10350. break;
  10351. case SkillType.ice:
  10352. aniIndex = 0;
  10353. xGame.soundMgr.playSound("skill03");
  10354. skillSpine = this.skillSpine2;
  10355. data.scaleX = 0.5;
  10356. data.scaleY = 0.5;
  10357. skillSpine.play(data, 0, false, parent, () => {
  10358. callback && callback();
  10359. });
  10360. break;
  10361. case SkillType.fireworks:
  10362. xGame.soundMgr.playSound("skill_04_01");
  10363. xGame.soundMgr.playSound("skill04");
  10364. xGame.uiMgr.Show(UIFireworks, callback);
  10365. break;
  10366. case SkillType.GuanYu:
  10367. xGame.soundMgr.playSound("skill05_1");
  10368. xGame.soundMgr.playSound("skill05");
  10369. xGame.uiMgr.Show(UIGuanYu, callback);
  10370. break;
  10371. default:
  10372. break;
  10373. }
  10374. }
  10375. getAllBallArr() {
  10376. let arr = xGame.common.d2World.ballArr;
  10377. let outArr = [];
  10378. for (let index = 0; index < arr.length; index++) {
  10379. if (arr[index] instanceof D2RootBallSrc)
  10380. continue;
  10381. if (arr[index].ballFunc == "ice")
  10382. continue;
  10383. if (arr[index].destroyed)
  10384. continue;
  10385. outArr.push(arr[index]);
  10386. }
  10387. return outArr;
  10388. }
  10389. getOneArr(deletObj) {
  10390. let allArr = this.getAllBallArr();
  10391. let temp;
  10392. for (let index = 0; index < allArr.length; index++) {
  10393. temp = allArr[index];
  10394. if (temp.id == deletObj.id) {
  10395. allArr.splice(index, 1);
  10396. break;
  10397. }
  10398. }
  10399. return allArr;
  10400. }
  10401. getNearBallBag(ball) {
  10402. let ui = xGame.common.gameUI.ui;
  10403. let circleArr = [];
  10404. for (let index = 1; index <= 6; index++) {
  10405. circleArr.push(ui.border["circle" + index]);
  10406. }
  10407. let outIndex = 0;
  10408. let temp;
  10409. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10410. ;
  10411. let dis = 0;
  10412. for (let index = 1; index < circleArr.length; index++) {
  10413. temp = circleArr[index];
  10414. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10415. if (dis < min) {
  10416. min = dis;
  10417. outIndex = index;
  10418. }
  10419. }
  10420. return [circleArr[outIndex], outIndex];
  10421. }
  10422. ballFlyToBag(ballArr, time = 300) {
  10423. let temp;
  10424. let hole;
  10425. this._finishNum = ballArr.length;
  10426. this._curFinish = 0;
  10427. let holeObj = {};
  10428. let holeCfg = {
  10429. "1": 0,
  10430. "2": 0,
  10431. "3": 0,
  10432. "4": 0,
  10433. "5": 0,
  10434. "6": 0
  10435. };
  10436. for (let index = 0; index < ballArr.length; index++) {
  10437. temp = ballArr[index];
  10438. temp.outColli.isSensor = true;
  10439. temp.innerColli.isSensor = true;
  10440. temp.isRunSkillAni = true;
  10441. let holeArr = this.getNearBallBag(temp);
  10442. hole = holeArr[0];
  10443. holeObj[index] = holeArr[1];
  10444. temp.d3BallSrc.scaleXYZ = 0.5;
  10445. this.tweenArr.push(temp.d3BallSrc, temp);
  10446. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10447. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10448. }));
  10449. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10450. let mIndex = holeObj[this._curFinish];
  10451. let isDone = holeCfg[mIndex];
  10452. if (isDone) {
  10453. ballArr[this._curFinish].checkWrongBall(false);
  10454. }
  10455. else {
  10456. holeCfg[mIndex] = 1;
  10457. ballArr[this._curFinish].checkWrongBall();
  10458. }
  10459. this._curFinish++;
  10460. if (this._curFinish >= this._finishNum) {
  10461. if (this.curSkill == SkillType.highSpace) {
  10462. }
  10463. else if (this.curSkill == SkillType.breakArmy) {
  10464. let rootBall = xGame.common.d2World.rootBall;
  10465. rootBall.gameObj.x = this._rootX;
  10466. rootBall.gameObj.y = this._rootY;
  10467. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10468. xGame.common.d2World.d2Gan.ui.visible = true;
  10469. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10470. xGame.common.d2World.getHelpLine();
  10471. this.callback && this.callback(this.extraScore);
  10472. }
  10473. }
  10474. }));
  10475. }
  10476. }
  10477. runHighSpace() {
  10478. let rootBall = xGame.common.d2World.rootBall;
  10479. rootBall.showSelf();
  10480. let d3Src = rootBall.d3BallSrc;
  10481. let allArr = this.getAllBallArr();
  10482. if (allArr.length <= 0) {
  10483. this.callback && this.callback(0);
  10484. return;
  10485. }
  10486. let selectBall = xGame.common.d2World.targetBall;
  10487. let wrong = selectBall && selectBall.destroyed;
  10488. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10489. selectBall = xGame.common.getRandArrEle(allArr);
  10490. }
  10491. let targetD3Src = selectBall.d3BallSrc;
  10492. xGame.common.d2World.d2Gan.ui.visible = false;
  10493. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10494. d3Src.scaleXYZ = 0.5;
  10495. this.tweenArr.push(d3Src);
  10496. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10497. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10498. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10499. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10500. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10501. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10502. let outArr = [selectBall];
  10503. let other = this.leveNum - 1;
  10504. if (other > 0) {
  10505. let nearArr = this.getOneArr(selectBall);
  10506. if (nearArr.length > 0) {
  10507. xGame.common.botherArr(nearArr);
  10508. if (other >= nearArr.length)
  10509. other = nearArr.length;
  10510. for (let index = 0; index < other; index++) {
  10511. outArr.push(nearArr[index]);
  10512. }
  10513. }
  10514. }
  10515. xGame.common.extraMoveNum = other + 1;
  10516. this.extraScore = other + 1;
  10517. this._rootX = selectBall.gameObj.x;
  10518. this._rootY = selectBall.gameObj.y;
  10519. rootBall.gameObj.x = this._rootX;
  10520. rootBall.gameObj.y = this._rootY;
  10521. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10522. Laya.Tween.clearAll(d3Src);
  10523. this.addRandomForce(outArr);
  10524. }));
  10525. }));
  10526. }
  10527. addRandomForce(outArr) {
  10528. if (outArr.length > 0) {
  10529. xGame.common.d2World.openCheckStill = true;
  10530. this.playedLastSkill = true;
  10531. }
  10532. let temp;
  10533. for (let index = 0; index < outArr.length; index++) {
  10534. let angle = xGame.common.randomNum(0, 360);
  10535. let linearPercent = xGame.common.randomNum(65, 100);
  10536. temp = outArr[index];
  10537. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10538. }
  10539. }
  10540. setLinearSpeed(angle, rigy, linearPercent) {
  10541. let sin = Math.sin(angle * Math.PI / 180);
  10542. let cos = Math.cos(angle * Math.PI / 180);
  10543. let maxSpeed = 4;
  10544. let speed = new Laya.Vector2();
  10545. speed.x = maxSpeed * linearPercent * sin;
  10546. speed.y = -maxSpeed * linearPercent * cos;
  10547. rigy.applyLinearImpulseToCenter(speed);
  10548. }
  10549. runBreakArmy() {
  10550. xGame.common.d2World.d2Gan.ui.visible = false;
  10551. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10552. let gameUI = xGame.common.gameUI.ui;
  10553. gameUI.skillRod.visible = true;
  10554. gameUI.skillRod.rotation = 110;
  10555. let outArr = this.getAllBallArr();
  10556. if (outArr.length <= 0) {
  10557. gameUI.skillRod.visible = false;
  10558. this.callback && this.callback(0);
  10559. return;
  10560. }
  10561. xGame.common.botherArr(outArr);
  10562. if (this.leveNum >= outArr.length)
  10563. this.leveNum = outArr.length;
  10564. let deleteNum = outArr.length - this.leveNum;
  10565. outArr.splice(0, deleteNum);
  10566. this.extraScore = this.leveNum;
  10567. let potX = gameUI.skillRod.x;
  10568. let potY = gameUI.skillRod.y;
  10569. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10570. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10571. let disArr = [];
  10572. for (let index = 0; index < outArr.length; index++) {
  10573. let obj = outArr[index];
  10574. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10575. dis = Math.pow(dis, 0.5);
  10576. disArr.push(dis);
  10577. }
  10578. this.tweenArr.push(gameUI.skillRod);
  10579. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10580. })).update = Laya.Handler.create(this, (e, t, c) => {
  10581. let angle = gameUI.skillRod.rotation;
  10582. let xx;
  10583. let yy;
  10584. let temp;
  10585. for (let index = 0; index < outArr.length; index++) {
  10586. temp = outArr[index];
  10587. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10588. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10589. yy -= 20;
  10590. temp.gameObj.x = xx;
  10591. temp.gameObj.y = yy;
  10592. temp.d3BallSrc.setTransPos(xx, yy);
  10593. }
  10594. if (angle <= 60) {
  10595. Laya.Tween.clearAll(gameUI.skillRod);
  10596. this.ballFlyToBag(outArr, 150);
  10597. gameUI.skillRod.visible = false;
  10598. }
  10599. }, null, false);
  10600. }
  10601. runIce() {
  10602. let ballArr = xGame.common.d2World.ballArr;
  10603. this.leveNum *= 2;
  10604. if (this.leveNum >= ballArr.length - 1)
  10605. this.leveNum = ballArr.length - 1;
  10606. let tempArr = [];
  10607. let outArr = [];
  10608. for (let index = 0; index < ballArr.length; index++) {
  10609. if (ballArr[index] instanceof D2RootBallSrc)
  10610. continue;
  10611. tempArr.push(ballArr[index]);
  10612. }
  10613. if (tempArr.length <= 0) {
  10614. this.callback && this.callback(0);
  10615. return;
  10616. }
  10617. xGame.common.botherArr(tempArr);
  10618. for (let index = 0; index < this.leveNum; index++) {
  10619. outArr.push(tempArr[index]);
  10620. }
  10621. this.extraScore = this.leveNum;
  10622. let temp;
  10623. for (let index = 0; index < outArr.length; index++) {
  10624. temp = outArr[index];
  10625. temp.d3BallSrc.playIceEft();
  10626. }
  10627. Laya.timer.once(2000, this, () => {
  10628. for (let index = 0; index < outArr.length; index++) {
  10629. temp = outArr[index];
  10630. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10631. temp.setBallFunc("ice", str);
  10632. }
  10633. this.callback && this.callback(0);
  10634. });
  10635. }
  10636. runFireworks() {
  10637. let allArr = this.getAllBallArr();
  10638. if (allArr.length <= 0) {
  10639. this.callback && this.callback(0);
  10640. return;
  10641. }
  10642. xGame.common.d2World.d2Gan.ui.visible = false;
  10643. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10644. let outArr = [];
  10645. let other = this.leveNum;
  10646. if (other > 0) {
  10647. if (allArr.length > 0) {
  10648. xGame.common.botherArr(allArr);
  10649. if (other >= allArr.length)
  10650. other = allArr.length;
  10651. for (let index = 0; index < other; index++) {
  10652. outArr.push(allArr[index]);
  10653. }
  10654. }
  10655. }
  10656. xGame.common.extraMoveNum = other;
  10657. this.extraScore = other;
  10658. this.addRandmomFireworks(outArr);
  10659. }
  10660. addRandmomFireworks(outArr) {
  10661. Laya.timer.once(1100, this, () => {
  10662. if (outArr.length > 0) {
  10663. xGame.common.d2World.openCheckStill = true;
  10664. this.playedLastSkill = true;
  10665. }
  10666. });
  10667. xGame.soundMgr.playSound("skill_04_02");
  10668. let temp;
  10669. let delay = -200;
  10670. for (let index = 0; index < outArr.length; index++) {
  10671. temp = outArr[index];
  10672. delay += 200;
  10673. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10674. let angle = xGame.common.randomNum(0, 360);
  10675. angle = this.getFireworksAngle(obj);
  10676. let linearPercent = xGame.common.randomNum(45, 80);
  10677. if (!obj.destroyed)
  10678. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10679. });
  10680. }
  10681. }
  10682. getFireworksAngle(obj) {
  10683. let rootBall = xGame.common.d2World.rootBall;
  10684. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10685. }
  10686. resetGame() {
  10687. Laya.timer.clearAll(this);
  10688. if (this.tweenArr) {
  10689. for (let index = 0; index < this.tweenArr.length; index++) {
  10690. Laya.Tween.clearAll(this.tweenArr[index]);
  10691. }
  10692. }
  10693. this.tweenArr = null;
  10694. }
  10695. runGuanYu() {
  10696. xGame.common.d2World.d2Gan.ui.visible = false;
  10697. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10698. let rootBall = xGame.common.d2World.rootBall;
  10699. if (rootBall.isInHole) {
  10700. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10701. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10702. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10703. rootBall.showSelf();
  10704. }
  10705. this.rtStarX = rootBall.gameObj.x;
  10706. this.rtStarY = rootBall.gameObj.y;
  10707. this.knifeTimes = 0;
  10708. this.playedLastSkill = true;
  10709. rootBall.forceRun = true;
  10710. rootBall.rigy.type = "static";
  10711. xGame.common.d2World.openCheckStill = true;
  10712. this.guanyuRandomKnife();
  10713. }
  10714. guanyuRandomKnife() {
  10715. let rootBall = xGame.common.d2World.rootBall;
  10716. let dir = this.getRandDir();
  10717. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10718. console.log("当前angle", angle);
  10719. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10720. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10721. let dis = 324;
  10722. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10723. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10724. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10725. this.rtStarX = rootBall.gameObj.x;
  10726. this.rtStarY = rootBall.gameObj.y;
  10727. this.knifeTimes++;
  10728. let skillLevel;
  10729. if (xGame.common.gameMgr.selfTurn) {
  10730. skillLevel = DataMgr.getBigSkillByIndex(4);
  10731. }
  10732. else {
  10733. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10734. }
  10735. if (!skillLevel)
  10736. skillLevel = 1;
  10737. skillLevel += 2;
  10738. if (this.knifeTimes < skillLevel) {
  10739. Laya.timer.once(400, this, () => {
  10740. this.guanyuRandomKnife();
  10741. });
  10742. }
  10743. else {
  10744. rootBall.forceRun = false;
  10745. rootBall.rigy.type = "dynamic";
  10746. xGame.common.extraMoveNum = skillLevel;
  10747. }
  10748. }));
  10749. }
  10750. getRandDir() {
  10751. let rootBall = xGame.common.d2World.rootBall;
  10752. let allBall = this.getAllBallArr();
  10753. let target = xGame.common.getRandArrEle(allBall);
  10754. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10755. return this.knifeV2;
  10756. }
  10757. cloneKnife(x, y, rotation) {
  10758. let parent = xGame.common.d3World.knifeRoot;
  10759. let prefab = xGame.common.d3World.knife;
  10760. let clone = prefab.clone();
  10761. parent.addChild(clone);
  10762. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10763. clone.transform.localPositionX = this.knifeV3.x;
  10764. clone.transform.localPositionY = 0;
  10765. clone.transform.localPositionZ = this.knifeV3.z;
  10766. clone.transform.localRotationEulerX = 0;
  10767. clone.transform.localRotationEulerY = rotation;
  10768. clone.transform.localRotationEulerZ = 0;
  10769. clone.active = true;
  10770. return clone;
  10771. }
  10772. cloneGuanYuEft(x, y, angle) {
  10773. return;
  10774. let parent = xGame.common.gameUI.ui.guanyuNode;
  10775. let eft = new ui_guanyuAni();
  10776. eft.parent = parent;
  10777. eft.x = x;
  10778. eft.y = y;
  10779. eft.rotation = angle;
  10780. }
  10781. }
  10782. class ui_UIWordsList extends fgui.GComponent {
  10783. static createInstance() {
  10784. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10785. }
  10786. onConstruct() {
  10787. this.c1 = this.getController("c1");
  10788. this.n74 = (this.getChild("n74"));
  10789. this.clickNode = (this.getChild("clickNode"));
  10790. this.myNode = (this.getChild("myNode"));
  10791. this.n68 = (this.getChild("n68"));
  10792. this.n66 = (this.getChild("n66"));
  10793. this.n55 = (this.getChild("n55"));
  10794. this.wordsBtn = (this.getChild("wordsBtn"));
  10795. this.emotionBtn = (this.getChild("emotionBtn"));
  10796. this.mybggg = (this.getChild("mybggg"));
  10797. this.wordsList = (this.getChild("wordsList"));
  10798. this.emotionList = (this.getChild("emotionList"));
  10799. this.myRoot = (this.getChild("myRoot"));
  10800. }
  10801. }
  10802. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10803. class EmotionDisplay {
  10804. constructor(index, ui) {
  10805. this.ui = ui;
  10806. this.index = index;
  10807. this.ui.onClick(this, this.clickSelf);
  10808. this.updateSelf();
  10809. }
  10810. updateSelf() {
  10811. let data = cfgTable.emotionData[this.index + 1];
  10812. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10813. }
  10814. clickSelf() {
  10815. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10816. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10817. xGame.common.talkMgr.closeTalkView();
  10818. }
  10819. }
  10820. class WordsDisplay {
  10821. constructor(index, ui) {
  10822. this.ui = ui;
  10823. this.index = index;
  10824. this.ui.onClick(this, this.clickSelf);
  10825. this.updateSelf();
  10826. }
  10827. updateSelf() {
  10828. let data = cfgTable.talkwordsData[this.index + 1];
  10829. this.ui.txt.text = data.msg;
  10830. }
  10831. clickSelf() {
  10832. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10833. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10834. xGame.common.talkMgr.closeTalkView();
  10835. }
  10836. }
  10837. class UIWordsList extends UIBase {
  10838. constructor() {
  10839. super();
  10840. }
  10841. onConstructor() {
  10842. this.ui = ui_UIWordsList.createInstance();
  10843. this.contentPane = this.ui;
  10844. this.isEject = false;
  10845. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10846. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10847. this.addUIClick(this.ui.clickNode, this.hide);
  10848. this.initTalkList();
  10849. this.initEmotionList();
  10850. }
  10851. show() {
  10852. super.show();
  10853. }
  10854. initTalkList() {
  10855. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10856. let data = cfgTable.talkwordsData;
  10857. let length = Object.keys(data).length;
  10858. this.ui.wordsList.numItems = length;
  10859. }
  10860. initEmotionList() {
  10861. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10862. let data = cfgTable.emotionData;
  10863. let length = Object.keys(data).length;
  10864. this.ui.emotionList.numItems = length;
  10865. }
  10866. renderTalkItem(index, obj) {
  10867. let temp = new WordsDisplay(index, obj);
  10868. }
  10869. renderEmotionItem(index, obj) {
  10870. let temp = new EmotionDisplay(index, obj);
  10871. }
  10872. openTalkList() {
  10873. this.ui.c1.selectedIndex = 0;
  10874. }
  10875. openEmotionList() {
  10876. this.ui.c1.selectedIndex = 1;
  10877. }
  10878. }
  10879. UIWordsList.uiName = "UIWordsList";
  10880. class TalkMgr {
  10881. constructor() {
  10882. this.aiSpeak = true;
  10883. this.emotionList = [];
  10884. this.talkList = [];
  10885. this.addEvent();
  10886. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10887. this.emotionList = [];
  10888. this.talkList = [];
  10889. for (let k in cfgTable.emotionData) {
  10890. this.emotionList.push(cfgTable.emotionData[k].id);
  10891. }
  10892. for (let k in cfgTable.talkwordsData) {
  10893. this.talkList.push(cfgTable.talkwordsData[k].id);
  10894. }
  10895. }
  10896. addEvent() {
  10897. let ui = xGame.common.gameUI.ui;
  10898. ui.wordsBtn.visible = true;
  10899. ui.wordsBtn.onClick(this, this.openTalkView);
  10900. ui.aiWordsBtn.visible = true;
  10901. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10902. }
  10903. openTalkView() {
  10904. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10905. xGame.uiMgr.Show(UIWordsList);
  10906. }
  10907. closeTalkView() {
  10908. xGame.uiMgr.Hide(UIWordsList);
  10909. }
  10910. clickAIState() {
  10911. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10912. this.aiSpeak = !this.aiSpeak;
  10913. this.changeAIState(this.aiSpeak);
  10914. }
  10915. changeAIState(speak) {
  10916. this.aiSpeak = speak;
  10917. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10918. if (speak) {
  10919. btn.c1.selectedIndex = 0;
  10920. }
  10921. else {
  10922. btn.c1.selectedIndex = 1;
  10923. }
  10924. }
  10925. showSelfTalk(wordsId) {
  10926. let ui = xGame.common.gameUI.ui;
  10927. ui.selfTalk.visible = true;
  10928. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10929. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10930. ui.selfTalk.t0.play();
  10931. }
  10932. showSelfEmotion(emotionId) {
  10933. let ui = xGame.common.gameUI.ui;
  10934. ui.selfTalk.visible = true;
  10935. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10936. this.selfSpine && this.selfSpine.dispose();
  10937. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10938. let spineData = cfgTable.emotionData[emotionId].spine;
  10939. this.selfSpine = new SpineMgr(spineData, () => {
  10940. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10941. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10942. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10943. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10944. });
  10945. ui.selfTalk.t0.play();
  10946. }
  10947. showAITalk(wordsId) {
  10948. if (!this.aiSpeak)
  10949. return;
  10950. if (DataMgr.gameData.gameCount < 2)
  10951. return;
  10952. if (wordsId < 1)
  10953. wordsId = this.getRandTalk();
  10954. let ui = xGame.common.gameUI.ui;
  10955. ui.aiTalk.visible = true;
  10956. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10957. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10958. ui.aiTalk.t0.play();
  10959. }
  10960. getRandTalk() {
  10961. let rand = xGame.tools.random(0, this.talkList.length);
  10962. return this.emotionList[rand];
  10963. }
  10964. getRandEmotion() {
  10965. let rand = xGame.tools.random(0, this.emotionList.length);
  10966. return this.emotionList[rand];
  10967. }
  10968. showAIEmotion(emotionId) {
  10969. if (!this.aiSpeak)
  10970. return;
  10971. if (DataMgr.gameData.gameCount < 2)
  10972. return;
  10973. if (emotionId < 1)
  10974. emotionId = this.getRandEmotion();
  10975. let ui = xGame.common.gameUI.ui;
  10976. ui.aiTalk.visible = true;
  10977. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10978. this.aiSpine && this.aiSpine.dispose();
  10979. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10980. let spineData = cfgTable.emotionData[emotionId].spine;
  10981. this.aiSpine = new SpineMgr(spineData, () => {
  10982. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10983. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10984. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10985. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10986. });
  10987. ui.aiTalk.t0.play();
  10988. }
  10989. resetGame() {
  10990. let ui = xGame.common.gameUI.ui;
  10991. ui.aiTalk.visible = false;
  10992. ui.selfTalk.visible = false;
  10993. this.aiSpine && this.aiSpine.dispose();
  10994. this.selfSpine && this.selfSpine.dispose();
  10995. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10996. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10997. this.closeTalkView();
  10998. }
  10999. }
  11000. class WordsMgr {
  11001. constructor() {
  11002. this.comboTimes = 1;
  11003. this.skillTimes = 0;
  11004. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11005. this.comboSpine = new SpineMgr("yxz_liangan");
  11006. this.skillSpine = new SpineMgr("yiganxqiu");
  11007. this.scoreSpine = new SpineMgr("defen");
  11008. }
  11009. setClassicCombo(isInterrupt) {
  11010. if (isInterrupt) {
  11011. this.comboTimes = 0;
  11012. }
  11013. }
  11014. playClassicWords(type, callback) {
  11015. this.callback = callback;
  11016. let aniIndex = type;
  11017. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11018. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11019. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11020. mySpine.destroy(true);
  11021. this.playClassicTimes();
  11022. });
  11023. }
  11024. playClassicTimes() {
  11025. this.comboTimes++;
  11026. if (this.comboTimes <= 1) {
  11027. this.callback && this.callback();
  11028. }
  11029. else {
  11030. let aniIndex = this.comboTimes - 1;
  11031. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11032. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11033. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11034. mySpine.destroy(true);
  11035. this.callback && this.callback();
  11036. });
  11037. }
  11038. }
  11039. playBigSkillTimes(times, callback) {
  11040. if (times <= 0) {
  11041. callback && callback();
  11042. return;
  11043. }
  11044. this.callback = callback;
  11045. let pre = "sz_0";
  11046. let aniIndex = 0;
  11047. this.getWordsImg(times, pre, () => {
  11048. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11049. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11050. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11051. let r1 = ``;
  11052. let r2 = ``;
  11053. if (times <= 9) {
  11054. r1 = `res/d2Res/${pre}${times}.png`;
  11055. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11056. aniIndex = 0;
  11057. }
  11058. else {
  11059. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11060. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11061. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11062. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11063. aniIndex = 1;
  11064. }
  11065. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11066. mySpine.destroy(true);
  11067. xGame.common.gameMgr.playSkillTips();
  11068. this.playScore(times);
  11069. xGame.common.playRandomMutiBallBigSkillSound();
  11070. }, mySpine);
  11071. });
  11072. }
  11073. playScore(score) {
  11074. let pre = "sz_";
  11075. let aniIndex = 0;
  11076. this.getWordsImg(score, pre, () => {
  11077. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11078. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11079. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11080. let r1 = ``;
  11081. let r2 = ``;
  11082. if (score <= 9) {
  11083. r1 = `res/d2Res/${pre}${score}.png`;
  11084. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11085. aniIndex = 0;
  11086. }
  11087. else {
  11088. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11089. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11090. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11091. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11092. aniIndex = 1;
  11093. }
  11094. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11095. mySpine.destroy(true);
  11096. this.callback && this.callback();
  11097. }, mySpine);
  11098. });
  11099. }
  11100. getWordsImg(number, pre = "", callback) {
  11101. let arr = [];
  11102. if (number <= 9) {
  11103. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11104. }
  11105. else {
  11106. 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 });
  11107. }
  11108. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11109. callback && callback();
  11110. }));
  11111. }
  11112. }
  11113. class ui_UIRodMethod extends fgui.GComponent {
  11114. static createInstance() {
  11115. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11116. }
  11117. onConstruct() {
  11118. this.n24 = (this.getChild("n24"));
  11119. this.white = (this.getChild("white"));
  11120. this.dot = (this.getChild("dot"));
  11121. this.sureBtn = (this.getChild("sureBtn"));
  11122. this.n20 = (this.getChild("n20"));
  11123. this.n21 = (this.getChild("n21"));
  11124. this.n22 = (this.getChild("n22"));
  11125. this.n23 = (this.getChild("n23"));
  11126. this.n5 = (this.getChild("n5"));
  11127. this.n14 = (this.getChild("n14"));
  11128. this.t0 = this.getTransition("t0");
  11129. }
  11130. }
  11131. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11132. class UIRodMethod extends UIBase {
  11133. constructor() {
  11134. super();
  11135. this.isPressd = false;
  11136. }
  11137. onConstructor() {
  11138. this.ui = ui_UIRodMethod.createInstance();
  11139. this.contentPane = this.ui;
  11140. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11141. this.moveDir = new Laya.Vector2();
  11142. this.moveDest = new Laya.Vector2();
  11143. this.centerPos = new Laya.Vector2();
  11144. xGame.common.uiRodMethod = this;
  11145. }
  11146. show() {
  11147. super.show();
  11148. xGame.common.gameMgr.gamePause = true;
  11149. this.openPressDotEvent();
  11150. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11151. this.centerPos.x = this.ui.white.x;
  11152. this.centerPos.y = this.ui.white.y;
  11153. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11154. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11155. this.setDot();
  11156. }
  11157. setDot() {
  11158. this.ui.dot.x = this.moveDest.x;
  11159. this.ui.dot.y = this.moveDest.y;
  11160. }
  11161. closeSelf() {
  11162. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11163. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11164. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11165. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11166. xGame.common.gameMgr.gamePause = false;
  11167. this.hide();
  11168. }
  11169. openPressDotEvent() {
  11170. this.closePressDotEvent();
  11171. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11172. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11173. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11174. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11175. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11176. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11177. }
  11178. closePressDotEvent() {
  11179. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11180. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11181. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11182. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11183. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11184. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11185. }
  11186. onDown(e) {
  11187. if (e.type == Laya.Event.MOUSE_DOWN)
  11188. this.isPressd = true;
  11189. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11190. this.isPressd = false;
  11191. if (!this.isPressd)
  11192. return;
  11193. this.moveDest.x = e.stageX;
  11194. this.moveDest.y = e.stageY;
  11195. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11196. if (dis > 6724) {
  11197. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11198. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11199. }
  11200. this.setDot();
  11201. }
  11202. resetRod() {
  11203. this.ui.dot.x = this.ui.white.x;
  11204. this.ui.dot.y = this.ui.white.y;
  11205. this.gameRod.dot.x = this.gameRod.bg.x;
  11206. this.gameRod.dot.y = this.gameRod.bg.y;
  11207. xGame.common.rodOffest.x = 0;
  11208. xGame.common.rodOffest.y = 0;
  11209. }
  11210. }
  11211. UIRodMethod.uiName = "UIRodMethod";
  11212. class UIGame extends UIBase {
  11213. constructor() {
  11214. super();
  11215. this.powerNum = 0;
  11216. this.isD3Inited = false;
  11217. this.isPrePlay = false;
  11218. this.isMoveRod = false;
  11219. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11220. this.rulerDis = 20;
  11221. this.rulerOffset = 0;
  11222. }
  11223. onConstructor() {
  11224. this.ui = ui_UIGame.createInstance();
  11225. this.contentPane = this.ui;
  11226. this.ui.x += xGame.common.sysOffestNum;
  11227. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11228. this.isEject = false;
  11229. xGame.common.gameUI = this;
  11230. this.initSelf();
  11231. }
  11232. isTurnSelf() {
  11233. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11234. return true;
  11235. }
  11236. }
  11237. initSelf() {
  11238. let topUI = this.ui.topNode;
  11239. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11240. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11241. this.barInfo = {};
  11242. this.barInfo.curY = 0;
  11243. this.barInfo.height = this.ui.powerNode.height;
  11244. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11245. this.barInfo.powerStartY = this.ui.powerNode.y;
  11246. xGame.common.aiPlayer = new AIPlayer();
  11247. xGame.common.gameMgr = new GameMgr();
  11248. xGame.common.skillMgr = new SkillMgr();
  11249. xGame.common.wordsMgr = new WordsMgr();
  11250. xGame.common.talkMgr = new TalkMgr();
  11251. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11252. console.log("加载经典模式表情文件chenggon !");
  11253. });
  11254. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11255. console.log("挑战模式奖励模式spine加载成功!");
  11256. });
  11257. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11258. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11259. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11260. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11261. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11262. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11263. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11264. }
  11265. getGanZiImg() {
  11266. let index = DataMgr.getCurBallRod();
  11267. let data = cfgTable.ballrodData[index + 1];
  11268. let gan_url = xGame.common.getGameIconUrl(data.img);
  11269. console.log('zh:getGanZiImg gan_url==' + gan_url);
  11270. this.ui.powerNode.showImg.url = gan_url;
  11271. console.log('zh:修改杆子图标O K');
  11272. }
  11273. returnHome() {
  11274. let tips = "Are you sure to exit the game?";
  11275. let woman = "Boss, why don't you play for a while longer?";
  11276. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11277. }
  11278. addRodMethodClick() {
  11279. if (this.isTurnSelf()) {
  11280. xGame.uiMgr.Show(UIRodMethod);
  11281. }
  11282. }
  11283. clickHelpLineBtn(force = false) {
  11284. if (!this.isTurnSelf())
  11285. return;
  11286. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11287. if (success) {
  11288. xGame.common.longHelpLine = true;
  11289. xGame.common.d2World.getHelpLine();
  11290. Moyu.sendDataEvent("guideNum");
  11291. }
  11292. else {
  11293. }
  11294. });
  11295. }
  11296. renderSelfDisplayBalls(index, target) {
  11297. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11298. target.myImg.url = xGame.common.getGameIconUrl(str);
  11299. }
  11300. renderAIDisplayBalls(index, target) {
  11301. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11302. target.myImg.url = xGame.common.getGameIconUrl(str);
  11303. ;
  11304. }
  11305. updateMode() {
  11306. if (xGame.common.gameMode == GameMode.classic) {
  11307. this.ui.topNode.scoreNode.visible = false;
  11308. }
  11309. else if (xGame.common.gameMode == GameMode.bigMove) {
  11310. this.ui.topNode.scoreNode.visible = true;
  11311. }
  11312. }
  11313. show() {
  11314. super.show();
  11315. console.log("zh:uigame show AADD");
  11316. this.ui.alpha = 0;
  11317. this.updateSelf();
  11318. xGame.common.gameMgr.gamePause = false;
  11319. xGame.common.gameUI.ui.blackAni.visible = false;
  11320. xGame.common.gameUI.ui.whiteAni.visible = false;
  11321. this.ui.powerEft.visible = false;
  11322. this.ui.colorNode.visible = false;
  11323. this.updateHead();
  11324. let curUse = DataMgr.getCurBallRod();
  11325. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  11326. this.getGanZiImg();
  11327. }
  11328. updateSelf() {
  11329. if (xGame.common.gameMode == GameMode.classic) {
  11330. this.ui.c1.selectedIndex = 0;
  11331. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11332. this.ui.topNode.middleNode.visible = true;
  11333. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11334. }
  11335. else if (xGame.common.gameMode == GameMode.bigMove) {
  11336. this.ui.c1.selectedIndex = 0;
  11337. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11338. this.ui.topNode.middleNode.visible = false;
  11339. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11340. let rand = xGame.common.randomNum(1, max);
  11341. let guide = DataMgr.getSkillGuide();
  11342. if (guide == 0)
  11343. rand = 1;
  11344. xGame.common.bigMoveLevelIndex = rand;
  11345. }
  11346. else if (xGame.common.gameMode == GameMode.placeBall) {
  11347. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11348. this.ui.c1.selectedIndex = 1 + data.type;
  11349. this.ui.alpha = 1;
  11350. this.startGame();
  11351. }
  11352. this.updateMode();
  11353. this.initD3world();
  11354. this.initD2world();
  11355. }
  11356. startGame() {
  11357. this.ui.snowNode.visible = Math.random() <= 0.1;
  11358. this.ui.d2Node.visible = false;
  11359. xGame.common.d3World.d3Hand.gameObj.active = false;
  11360. xGame.common.d3World.tableSrc.init();
  11361. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11362. this.cameraViewChange(() => {
  11363. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11364. switch (xGame.common.gameMode) {
  11365. case GameMode.classic:
  11366. xGame.common.d3World.d3Hand.gameObj.active = true;
  11367. this.playPutBallD3Ani();
  11368. break;
  11369. case GameMode.bigMove:
  11370. this.enterGame();
  11371. Laya.timer.once(500, this, () => {
  11372. this.ui.topNode.middleNode.visible = true;
  11373. this.ui.topNode.middleNode.t0.play();
  11374. });
  11375. break;
  11376. case GameMode.placeBall:
  11377. this.enterGame();
  11378. break;
  11379. default:
  11380. break;
  11381. }
  11382. });
  11383. PlatMgr.showBanner(false);
  11384. }
  11385. enterGame() {
  11386. this.ui.d2Node.visible = true;
  11387. xGame.common.d3World.d3Hand.gameObj.active = false;
  11388. xGame.common.showOneCamera("mainCamera");
  11389. Moyu.recordGame(30, true);
  11390. if (!this.isPrePlay) {
  11391. this.isPrePlay = true;
  11392. xGame.common.d3World.prePlayEft();
  11393. }
  11394. xGame.common.gameMgr.gameReady();
  11395. this.openAllEvent();
  11396. this.ui.snowNode.visible = false;
  11397. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11398. this.ui.helpBtn.visible = condition;
  11399. }
  11400. showHelpLineGuide() {
  11401. let longGuide = DataMgr.getGuideHelpLine();
  11402. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11403. this.ui.helpBtn.visible = true;
  11404. this.ui.guideNode.visible = true;
  11405. }
  11406. }
  11407. setTurnAlpha(alpha) {
  11408. this.ui.keduNode.alpha = alpha;
  11409. this.ui.ganNode.alpha = alpha;
  11410. this.ui.rodMethodNode.alpha = alpha;
  11411. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11412. }
  11413. cameraViewChange(callback) {
  11414. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11415. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11416. xGame.common.showOneCamera("visitAngle");
  11417. cameraSrc.localRotationEulerY = 180;
  11418. cameraSrc.localRotationEulerZ = 0;
  11419. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11420. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11421. callback && callback();
  11422. }));
  11423. }));
  11424. }
  11425. playPutBallD3Ani() {
  11426. xGame.common.showOneCamera("mainCamera");
  11427. let handSrc = xGame.common.d3World.d3Hand;
  11428. handSrc.gameObj.active = true;
  11429. handSrc.transform.localPositionZ = 3;
  11430. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11431. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11432. handSrc.gameObj.active = false;
  11433. this.enterGame();
  11434. }), 400);
  11435. }));
  11436. }
  11437. updateHead() {
  11438. let user = Moyu.getUserInfo();
  11439. this.ui.topNode.selfNameTxt.text = user.nickName;
  11440. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11441. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11442. if (DataMgr.getSkillGuide() < 1) {
  11443. this.ui.topNode.aiNameTxt.text = 'billiards';
  11444. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11445. }
  11446. else {
  11447. this.ui.topNode.aiNameTxt.text = aiData.name;
  11448. let randNo = Math.floor(Math.random() * 10) + 1;
  11449. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11450. }
  11451. }
  11452. initD2world() {
  11453. let node = this.ui.d2Root.displayObject;
  11454. let src = node.getComponent(D2World);
  11455. if (!src) {
  11456. xGame.common.d2World = node.addComponent(D2World);
  11457. }
  11458. xGame.common.d2World.initSelf();
  11459. }
  11460. initD3world() {
  11461. if (this.isD3Inited)
  11462. return;
  11463. this.isD3Inited = true;
  11464. let scene3D = xGame.common.d3Scene;
  11465. this.ui.d3Root.displayObject.addChild(scene3D);
  11466. scene3D.active = true;
  11467. xGame.common.d3World.tableSrc.setBorderPos();
  11468. }
  11469. onRootMove(e) {
  11470. let rootBall = xGame.common.d2World.rootBall;
  11471. this.ui.moveNode.x = e.x;
  11472. this.ui.moveNode.y = e.y;
  11473. rootBall.gameObj.x = e.x;
  11474. rootBall.gameObj.y = e.y;
  11475. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11476. }
  11477. aiRootMove(move) {
  11478. if (move)
  11479. this.hideBallUI();
  11480. else {
  11481. this.showBallUI();
  11482. xGame.common.d2World.getHelpLine();
  11483. }
  11484. }
  11485. aiForce(type, force = 0) {
  11486. this.pressTarget = PressType.powerNode;
  11487. if (type == 1)
  11488. this.onEventUp({ force: true });
  11489. else if (type == 2)
  11490. this.onEventMove({ stageY: force, force: true });
  11491. }
  11492. onEventPress(e) {
  11493. if (e.stopPropagation)
  11494. e.stopPropagation();
  11495. if (!this.isTurnSelf())
  11496. return;
  11497. let target = e.target;
  11498. switch (target) {
  11499. case this.ui.myPowerNode.displayObject:
  11500. this.pressTarget = PressType.powerNode;
  11501. this.barInfo.curY = e.stageY;
  11502. this.updateBarInfo();
  11503. break;
  11504. case this.ui.moveNode.displayObject:
  11505. this.pressTarget = PressType.moveNode;
  11506. this.hideBallUI();
  11507. this.eventObj.curX = this.ui.moveNode.x;
  11508. this.eventObj.curY = this.ui.moveNode.y;
  11509. this.ui.moveNode.finger.visible = false;
  11510. this.eventObj.lastX = e.stageX;
  11511. this.eventObj.lastY = e.stageY;
  11512. break;
  11513. case this.ui.rulerClickNode.displayObject:
  11514. this.pressTarget = PressType.rulerNode;
  11515. this.eventObj.lastY = e.stageY;
  11516. break;
  11517. case this.ui.d2Root.displayObject:
  11518. this.pressTarget = PressType.d2Root;
  11519. this.eventObj.lastX = e.stageX;
  11520. this.eventObj.lastY = e.stageY;
  11521. this.eventObj.starX = e.stageX;
  11522. this.eventObj.starY = e.stageY;
  11523. this.eventObj.curX = 0;
  11524. this.eventObj.curY = 0;
  11525. xGame.common.d2World.d2Gan.setGanLastInfo();
  11526. this.rulerOffset = 0;
  11527. break;
  11528. default:
  11529. break;
  11530. }
  11531. }
  11532. onEventMove(e) {
  11533. if (e.stopPropagation)
  11534. e.stopPropagation();
  11535. if (e && e.force) {
  11536. }
  11537. else {
  11538. if (!this.isTurnSelf())
  11539. return;
  11540. }
  11541. switch (this.pressTarget) {
  11542. case PressType.powerNode:
  11543. this.barInfo.curY = e.stageY;
  11544. this.updateBarInfo();
  11545. this.isMoveRod = true;
  11546. break;
  11547. case PressType.moveNode:
  11548. let rootBall = xGame.common.d2World.rootBall;
  11549. let radius = rootBall.gameObj.width / 2;
  11550. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11551. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11552. let border = xGame.common.d2World.borderRect;
  11553. if (curX <= border.x + radius)
  11554. curX = border.x + radius;
  11555. else if (curX >= border.x + border.width - radius)
  11556. curX = border.x + border.width - radius;
  11557. if (curY <= border.y + radius)
  11558. curY = border.y + radius;
  11559. else if (curY >= border.y + border.height - radius)
  11560. curY = border.y + border.height - radius;
  11561. if (xGame.common.gameMgr.isOpenBall) {
  11562. if (curX >= border.x + border.openBallW - radius)
  11563. curX = border.x + border.openBallW - radius;
  11564. }
  11565. this.ui.moveNode.x = curX;
  11566. this.ui.moveNode.y = curY;
  11567. rootBall.gameObj.x = curX;
  11568. rootBall.gameObj.y = curY;
  11569. rootBall.d3BallSrc.setTransPos(curX, curY);
  11570. this.isMoveRod = true;
  11571. break;
  11572. case PressType.rulerNode:
  11573. let yy = e.stageY - this.eventObj.lastY;
  11574. this.eventObj.lastY = e.stageY;
  11575. let ruler1 = this.ui.rulerNode.img1;
  11576. let ruler2 = this.ui.rulerNode.img2;
  11577. ruler1.y += yy;
  11578. ruler2.y += yy;
  11579. this.rulerOffset += yy;
  11580. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11581. this.rulerOffset = 0;
  11582. xGame.soundMgr.playSound("inch", 1, 10);
  11583. }
  11584. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11585. let h = ruler1.height;
  11586. this.checkGuide();
  11587. this.isMoveRod = true;
  11588. if (ruler1.y >= h) {
  11589. ruler1.y = -h;
  11590. ruler2.y = 0;
  11591. return;
  11592. }
  11593. else if (ruler1.y <= -h) {
  11594. ruler1.y = h;
  11595. ruler2.y = 0;
  11596. return;
  11597. }
  11598. if (ruler2.y >= h) {
  11599. ruler2.y = -h;
  11600. ruler1.y = 0;
  11601. return;
  11602. }
  11603. else if (ruler2.y <= -h) {
  11604. ruler2.y = h;
  11605. ruler1.y = 0;
  11606. return;
  11607. }
  11608. break;
  11609. case PressType.d2Root:
  11610. this.eventObj.curX = e.stageX;
  11611. this.eventObj.curY = e.stageY;
  11612. let offset = this.checkRodMoveDir();
  11613. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11614. this.eventObj.lastX = e.stageX;
  11615. this.eventObj.lastY = e.stageY;
  11616. break;
  11617. default:
  11618. break;
  11619. }
  11620. }
  11621. onEventUp(e) {
  11622. if (e.stopPropagation)
  11623. e.stopPropagation();
  11624. if (e && e.force) {
  11625. }
  11626. else {
  11627. if (!this.isTurnSelf())
  11628. return;
  11629. }
  11630. switch (this.pressTarget) {
  11631. case PressType.powerNode:
  11632. this.ui.powerNode.value = 0;
  11633. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11634. this.ui.powerTxt.text = "";
  11635. if (this.powerNum > 0) {
  11636. xGame.eventMgr.event(BALL_SHOOT);
  11637. xGame.common.d2World.shoot(this.powerNum);
  11638. xGame.common.d2World.d2Gan.shoot();
  11639. xGame.common.d2World.d2HelpLine.shoot();
  11640. this.finishGuide();
  11641. this.ui.powerEft.visible = false;
  11642. this.ui.colorNode.visible = false;
  11643. let ganStr = "";
  11644. if (this.powerNum <= 30) {
  11645. ganStr = "gan_30";
  11646. }
  11647. else if (this.powerNum <= 60) {
  11648. ganStr = "gan_50";
  11649. }
  11650. else {
  11651. ganStr = "gan_80";
  11652. }
  11653. xGame.soundMgr.playSound(ganStr);
  11654. }
  11655. break;
  11656. case PressType.moveNode:
  11657. let rootBall = xGame.common.d2World.rootBall;
  11658. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11659. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11660. let isIntersect = this.judgeBallIntersect();
  11661. if (isIntersect) {
  11662. this.ui.moveNode.x = lastX;
  11663. this.ui.moveNode.y = lastY;
  11664. rootBall.gameObj.x = lastX;
  11665. rootBall.gameObj.y = lastY;
  11666. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11667. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11668. }
  11669. else {
  11670. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11671. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11672. }
  11673. this.showBallUI();
  11674. this.ui.moveNode.finger.visible = true;
  11675. xGame.common.d2World.getHelpLine();
  11676. break;
  11677. case PressType.rulerNode:
  11678. break;
  11679. case PressType.d2Root:
  11680. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11681. if (dis <= 25) {
  11682. this.moveToClickDot(e);
  11683. }
  11684. break;
  11685. default:
  11686. break;
  11687. }
  11688. this.pressTarget = -1;
  11689. }
  11690. checkGuide() {
  11691. let guide = DataMgr.getSkillGuide();
  11692. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11693. xGame.common.guideStep++;
  11694. xGame.common.gameUI.ui.guide2.visible = false;
  11695. xGame.common.gameUI.ui.guide3.visible = true;
  11696. }
  11697. }
  11698. finishGuide() {
  11699. let guide = DataMgr.getSkillGuide();
  11700. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11701. xGame.common.guideStep = 10;
  11702. this.closeAllGuide();
  11703. console.log('zh: 新手引导完毕');
  11704. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11705. }
  11706. }
  11707. closeAllGuide() {
  11708. xGame.common.gameUI.ui.guide1.visible = false;
  11709. xGame.common.gameUI.ui.guide2.visible = false;
  11710. xGame.common.gameUI.ui.guide3.visible = false;
  11711. }
  11712. updateBarInfo() {
  11713. let star = this.ui.powerNode.y;
  11714. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11715. if (rate >= 1)
  11716. rate = 1;
  11717. if (rate <= 0)
  11718. rate = 0;
  11719. this.powerNum = Math.ceil(rate * 100);
  11720. this.ui.powerNode.value = this.powerNum;
  11721. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11722. this.ui.colorNode.value = this.powerNum;
  11723. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11724. this.ui.powerEft.visible = this.powerNum != 0;
  11725. this.ui.colorNode.visible = this.powerNum != 0;
  11726. this.ui.powerTxt.text = this.powerNum + "";
  11727. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11728. }
  11729. forceCancel() {
  11730. this.ui.powerNode.value = 0;
  11731. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11732. this.ui.powerTxt.text = "";
  11733. }
  11734. checkRodMoveDir() {
  11735. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11736. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11737. if (tempX >= 0 && tempY <= 0) {
  11738. return this.checkDir();
  11739. }
  11740. else if (tempX < 0 && tempY < 0) {
  11741. return this.checkDir(1, -1);
  11742. }
  11743. else if (tempX < 0 && tempY > 0) {
  11744. return this.checkDir(-1, -1);
  11745. }
  11746. else {
  11747. return this.checkDir(-1, 1);
  11748. }
  11749. }
  11750. checkDir(flagX = 1, flagY = 1) {
  11751. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11752. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11753. if (offsetY == 0) {
  11754. return offsetX * flagX;
  11755. }
  11756. if (offsetX == 0) {
  11757. return offsetY * flagY;
  11758. }
  11759. let angle = offsetY / offsetX;
  11760. if (Math.abs(angle) >= 1) {
  11761. return offsetY * flagY;
  11762. }
  11763. else {
  11764. return offsetX * flagX;
  11765. }
  11766. }
  11767. judgeBallIntersect() {
  11768. let rootBall = xGame.common.d2World.rootBall;
  11769. let ballArr = xGame.common.d2World.ballArr;
  11770. let radius = rootBall.gameObj.width / 2;
  11771. let temp;
  11772. let isIntersect = false;
  11773. for (let index = 0; index < ballArr.length; index++) {
  11774. temp = ballArr[index];
  11775. if (temp.number == rootBall.number)
  11776. continue;
  11777. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11778. if (isIntersect) {
  11779. break;
  11780. }
  11781. }
  11782. return isIntersect;
  11783. }
  11784. hideBallUI() {
  11785. let d2Gan = xGame.common.d2World.d2Gan;
  11786. if (!d2Gan.ui.isDisposed)
  11787. d2Gan.ui.visible = false;
  11788. let d2Help = xGame.common.d2World.d2HelpLine;
  11789. if (!d2Help.ui.isDisposed)
  11790. d2Help.ui.visible = false;
  11791. let rootBall = xGame.common.d2World.rootBall;
  11792. if (!rootBall.destroyed) {
  11793. rootBall.gameObj.active = false;
  11794. }
  11795. }
  11796. showBallUI() {
  11797. let d2Gan = xGame.common.d2World.d2Gan;
  11798. if (!d2Gan.ui.isDisposed)
  11799. d2Gan.ui.visible = true;
  11800. let d2Help = xGame.common.d2World.d2HelpLine;
  11801. if (!d2Help.ui.isDisposed)
  11802. d2Help.ui.visible = true;
  11803. let rootBall = xGame.common.d2World.rootBall;
  11804. if (!rootBall.destroyed) {
  11805. rootBall.gameObj.active = true;
  11806. }
  11807. }
  11808. moveToClickDot(e) {
  11809. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11810. let root = xGame.common.d2World.rootBall.gameObj;
  11811. let xx = e.stageX - xGame.common.sysOffestNum;
  11812. let yy = e.stageY;
  11813. let x = xx - root.x;
  11814. let y = yy - root.y;
  11815. let angle = xGame.common.getfguiRotation(x, y);
  11816. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11817. xGame.common.d2World.getHelpLine();
  11818. }
  11819. this.isMoveRod = false;
  11820. xGame.common.clickedBall = false;
  11821. }
  11822. openAllEvent() {
  11823. this.closeAllEvent();
  11824. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11825. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11826. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11827. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11828. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11829. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11830. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11831. }
  11832. closeAllEvent() {
  11833. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11834. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11835. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11836. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11837. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11838. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11839. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11840. }
  11841. resetGame() {
  11842. this.closeAllEvent();
  11843. this.hideBallUI();
  11844. xGame.common.gameMgr.gamePause = true;
  11845. }
  11846. }
  11847. UIGame.uiName = "UIGame";
  11848. class UIAddProp extends UIBase {
  11849. constructor() {
  11850. super();
  11851. this.curType = "";
  11852. }
  11853. onConstructor() {
  11854. this.ui = ui_UIAddProp.createInstance();
  11855. this.contentPane = this.ui;
  11856. this.isEject = false;
  11857. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11858. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11859. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11860. this.updateUI();
  11861. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11862. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11863. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11864. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11865. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11866. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11867. }
  11868. show(type) {
  11869. super.show();
  11870. this.curType = type == 0 ? "coin" : "diamond";
  11871. this.switchBtn("");
  11872. this.ui.t0.play();
  11873. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11874. PlatMgr.showInsert(true);
  11875. }
  11876. closeSelf() {
  11877. this.hide();
  11878. }
  11879. updateUI() {
  11880. let data = cfgTable.moneyData;
  11881. let temp;
  11882. let obj;
  11883. for (const key in data) {
  11884. temp = data[key];
  11885. obj = this.ui.myNode["node" + key];
  11886. if (parseInt(key) <= 2) {
  11887. obj.diamondTxt.text = "+" + temp.num;
  11888. }
  11889. else {
  11890. obj.coinTxt.text = temp.num;
  11891. obj.diamondTxt.text = temp.get.split('_')[1];
  11892. }
  11893. }
  11894. this.updateDiamondShare();
  11895. }
  11896. updateDiamondShare() {
  11897. let data = DataMgr.getShareDiamondTimes();
  11898. if (data >= xGame.common.maxShareDiamondTimes) {
  11899. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11900. this.ui.myNode.node1.touchable = false;
  11901. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11902. }
  11903. else {
  11904. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11905. this.ui.myNode.node1.touchable = true;
  11906. }
  11907. }
  11908. switchBtn(type) {
  11909. if (type == "")
  11910. type = this.curType;
  11911. else {
  11912. if (this.curType == type) {
  11913. return;
  11914. }
  11915. else {
  11916. this.curType = type;
  11917. }
  11918. }
  11919. if (type == "coin") {
  11920. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11921. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11922. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11923. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11924. this.ui.myNode.c1.selectedIndex = 0;
  11925. }
  11926. else {
  11927. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11928. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11929. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11930. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11931. this.ui.myNode.c1.selectedIndex = 1;
  11932. }
  11933. }
  11934. convertCoin(index) {
  11935. let data = cfgTable.moneyData[index];
  11936. let coinNum = data.num;
  11937. let str = data.get.split('_')[1];
  11938. let needDiamond = parseInt(str);
  11939. if (DataMgr.diamondEnough(needDiamond)) {
  11940. DataMgr.setDiamond(-needDiamond);
  11941. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11942. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11943. }
  11944. else {
  11945. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11946. this.switchBtn("diamond");
  11947. }
  11948. }
  11949. videoGetDiamond() {
  11950. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11951. if (Laya.Browser.onAndroid) {
  11952. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11953. if (!boo) {
  11954. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11955. return;
  11956. }
  11957. }
  11958. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11959. }
  11960. else {
  11961. console.log('zh:AD 失败,直接发放奖励');
  11962. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11963. }
  11964. }
  11965. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11966. let num = cfgTable.moneyData[2].num;
  11967. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11968. this.closeSelf();
  11969. }
  11970. videoGetCoin() {
  11971. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11972. if (Laya.Browser.onAndroid) {
  11973. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11974. if (!boo) {
  11975. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11976. return;
  11977. }
  11978. }
  11979. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11980. }
  11981. else {
  11982. console.log('zh:AD 失败,直接发放奖励');
  11983. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11984. }
  11985. }
  11986. qjff_AD_for_uiAddProp_videoGetCoin() {
  11987. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11988. this.closeSelf();
  11989. }
  11990. shareGetDiamond() {
  11991. let times = DataMgr.getShareDiamondTimes();
  11992. if (times >= xGame.common.maxShareDiamondTimes) {
  11993. console.log('zh: 233333333333 maxShareDiamondTimes');
  11994. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11995. }
  11996. else {
  11997. console.log('zh:33333333333333ad');
  11998. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11999. if (Laya.Browser.onAndroid) {
  12000. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12001. if (!boo) {
  12002. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12003. return;
  12004. }
  12005. }
  12006. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12007. }
  12008. else {
  12009. console.log('zh:AD 失败,直接发放奖励');
  12010. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12011. }
  12012. }
  12013. }
  12014. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12015. let diamond = xGame.common.randomNum(50, 100);
  12016. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12017. DataMgr.setShareDiamondTimes(1);
  12018. this.updateDiamondShare();
  12019. }
  12020. openPutBallView() {
  12021. let end = xGame.uiMgr.getUI(UIGameEnd);
  12022. let skill = xGame.uiMgr.getUI(UISkill);
  12023. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12024. let uigame = xGame.uiMgr.getUI(UIGame);
  12025. if (end && !end.isHide) {
  12026. xGame.uiMgr.Hide(UIGameEnd);
  12027. xGame.uiMgr.Show(UIMain);
  12028. }
  12029. if (skill && !skill.isHide)
  12030. xGame.uiMgr.Hide(UISkill);
  12031. if (uigame && !uigame.isHide)
  12032. xGame.uiMgr.Hide(UIGame);
  12033. if (level && !level.isHide) {
  12034. }
  12035. else {
  12036. xGame.uiMgr.Show(UILevelDisplay);
  12037. }
  12038. this.closeSelf();
  12039. }
  12040. }
  12041. UIAddProp.uiName = "UIAddProp";
  12042. class MoneyNode {
  12043. constructor(ui) {
  12044. this.leftTime = 0;
  12045. this.ui = ui;
  12046. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12047. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12048. this.ui.addPowerBtn.onClick(this, this.addPower);
  12049. this.ui.c1.selectedIndex = 1;
  12050. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12051. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12052. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12053. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12054. this.coinChange();
  12055. this.diamondChange();
  12056. this.powerChange();
  12057. }
  12058. addPower() {
  12059. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12060. xGame.uiMgr.Show(UIPower);
  12061. }
  12062. powerChange() {
  12063. let powerNum = DataMgr.getPower();
  12064. this.ui.powerTxt.text = powerNum + "";
  12065. }
  12066. checkPowerTime() {
  12067. let cur = new Date().getTime();
  12068. let last = DataMgr.getPowerTime();
  12069. if (last == 0) {
  12070. last = cur;
  12071. DataMgr.setPowerTime(cur);
  12072. }
  12073. let power = DataMgr.getPower();
  12074. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12075. Laya.timer.clearAll(this);
  12076. if (power >= xGame.common.natureMaxPower) {
  12077. this.ui.powerTimeTxt.text = "";
  12078. DataMgr.setPowerTime(cur);
  12079. return;
  12080. }
  12081. if (power + offset >= xGame.common.natureMaxPower) {
  12082. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12083. this.ui.powerTimeTxt.text = "";
  12084. DataMgr.setPowerTime(cur);
  12085. }
  12086. else {
  12087. if (offset > 0) {
  12088. DataMgr.setPower(offset);
  12089. DataMgr.setPowerTime(cur);
  12090. }
  12091. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12092. this.leftTime = xGame.common.powerRecoverNum - time;
  12093. if (this.leftTime <= 0)
  12094. this.leftTime = 0;
  12095. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12096. Laya.timer.loop(1000, this, this.updatePowerTime);
  12097. }
  12098. }
  12099. updatePowerTime() {
  12100. this.leftTime -= 1;
  12101. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12102. if (this.leftTime <= 0) {
  12103. this.checkPowerTime();
  12104. }
  12105. }
  12106. coinChange() {
  12107. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12108. }
  12109. diamondChange() {
  12110. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12111. }
  12112. addCoin() {
  12113. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12114. Moyu.sendDataEvent("AddCoinBtn");
  12115. xGame.uiMgr.Show(UIAddProp, 0);
  12116. }
  12117. addDiamond() {
  12118. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12119. Moyu.sendDataEvent("AddDiamondBtn");
  12120. xGame.uiMgr.Show(UIAddProp, 1);
  12121. }
  12122. }
  12123. class UIDraw extends UIBase {
  12124. constructor() {
  12125. super();
  12126. this.curKey = 0;
  12127. }
  12128. onConstructor() {
  12129. this.ui = ui_UIDraw.createInstance();
  12130. this.contentPane = this.ui;
  12131. this.isEject = false;
  12132. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12133. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12134. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12135. this.initDraw();
  12136. this.initUI();
  12137. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12138. }
  12139. show() {
  12140. super.show();
  12141. this.ui.t0.play();
  12142. this.playSecretaryIdle();
  12143. this.updateDraw();
  12144. this.checkFree();
  12145. if (PlatMgr.bannerDelay > 0) {
  12146. this.ui.closeNode.closeBtn.visible = false;
  12147. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12148. this.ui.closeNode.closeBtn.visible = true;
  12149. });
  12150. }
  12151. PlatMgr.showRateBanner();
  12152. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12153. }
  12154. hide() {
  12155. Laya.timer.clearAll(this);
  12156. super.hide();
  12157. }
  12158. checkFree() {
  12159. let isFree = DataMgr.getDailyfreeDrawTimes();
  12160. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12161. }
  12162. initDraw() {
  12163. this.drawObj = [];
  12164. let data = cfgTable.drawData;
  12165. let temp;
  12166. let weight = 0;
  12167. for (const key in data) {
  12168. temp = data[key];
  12169. weight += temp.weight;
  12170. this.drawObj.push(weight);
  12171. }
  12172. this.allWeight = weight;
  12173. }
  12174. initUI() {
  12175. let data = cfgTable.drawData;
  12176. let temp;
  12177. let img;
  12178. let txt;
  12179. for (const key in data) {
  12180. temp = data[key];
  12181. img = this.ui.myNode.rotNode["img" + key];
  12182. txt = this.ui.myNode.rotNode["txt" + key];
  12183. img.url = xGame.common.getGameIconUrl(temp.icon);
  12184. txt.visible = true;
  12185. if (temp.award > 2) {
  12186. img.rotation = 0;
  12187. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12188. }
  12189. else {
  12190. img.rotation = temp.rotation;
  12191. txt.text = temp.num;
  12192. }
  12193. }
  12194. }
  12195. getCurkey() {
  12196. let rand = Math.random() * this.allWeight;
  12197. let temp;
  12198. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12199. temp = this.drawObj[index];
  12200. if (index == 0) {
  12201. if (rand < temp) {
  12202. return index + 1;
  12203. }
  12204. }
  12205. else {
  12206. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12207. return index + 1;
  12208. }
  12209. }
  12210. }
  12211. return 2;
  12212. }
  12213. startDraw() {
  12214. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12215. if (freeTimes > 0) {
  12216. this.beginDraw();
  12217. DataMgr.setDailyfreeDrawTimes(0);
  12218. this.checkFree();
  12219. }
  12220. else {
  12221. if (Laya.Browser.onAndroid) {
  12222. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12223. if (!boo) {
  12224. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12225. return;
  12226. }
  12227. }
  12228. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12229. }
  12230. else {
  12231. console.log('zh:AD 失败,直接发放奖励');
  12232. this.qjff_chouJiang();
  12233. }
  12234. }
  12235. }
  12236. qjff_chouJiang() {
  12237. this.beginDraw();
  12238. }
  12239. beginDraw() {
  12240. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12241. this.ui.drawBtn.touchable = false;
  12242. this.curKey = this.getCurkey();
  12243. console.log("当前key", this.curKey);
  12244. let cell = 60;
  12245. let lap = 3;
  12246. let angle = cell * (this.curKey - 1) + lap * 360;
  12247. let target = this.ui.myNode.rotNode;
  12248. target.rotation = 0;
  12249. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12250. console.log("旋转完成");
  12251. this.ui.drawBtn.touchable = true;
  12252. this.getAward();
  12253. }));
  12254. }
  12255. getAward() {
  12256. let data = cfgTable.drawData[this.curKey];
  12257. let temp = new AwardType();
  12258. temp.type = data.award;
  12259. temp.num = data.num;
  12260. xGame.common.getAward([temp], () => {
  12261. DataMgr.setDrawTimes(1);
  12262. this.updateDraw();
  12263. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12264. });
  12265. }
  12266. updateDraw() {
  12267. let drawTimes = DataMgr.getDrawTimes();
  12268. let awardTimes = DataMgr.getDrawAwardTimes();
  12269. if (Math.floor(drawTimes / 3) > awardTimes) {
  12270. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12271. this.ui.extraNode.boxBtn.touchable = true;
  12272. this.ui.extraNode.tipsTxt.text = "3/3";
  12273. this.ui.extraNode.barNode.width = 265;
  12274. this.getExtraAward();
  12275. }
  12276. else {
  12277. this.ui.extraNode.boxBtn.t0.stop();
  12278. this.ui.extraNode.boxBtn.touchable = false;
  12279. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12280. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12281. }
  12282. let data = cfgTable.drawData[1];
  12283. if (awardTimes == 0) {
  12284. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12285. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12286. this.ui.myNode.rotNode.img1.rotation = 0;
  12287. }
  12288. else {
  12289. let award = data.nextid;
  12290. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12291. this.ui.myNode.rotNode.txt1.text = award[1];
  12292. this.ui.myNode.rotNode.img1.rotation = 0;
  12293. }
  12294. }
  12295. getExtraAward() {
  12296. let drawTimes = DataMgr.getDrawTimes();
  12297. let awardTimes = DataMgr.getDrawAwardTimes();
  12298. let data = cfgTable.drawData[1];
  12299. let award = new AwardType();
  12300. if (awardTimes == 0) {
  12301. award.num = data.num;
  12302. award.type = data.award;
  12303. xGame.common.getAward([award], () => {
  12304. let all = Math.floor(drawTimes / 3);
  12305. DataMgr.setDrawAwardTimes(all);
  12306. this.updateDraw();
  12307. });
  12308. }
  12309. else {
  12310. award.num = parseInt(data.nextid[1]);
  12311. award.type = parseInt(data.nextid[0]);
  12312. xGame.common.getAward([award], () => {
  12313. let all = Math.floor(drawTimes / 3);
  12314. DataMgr.setDrawAwardTimes(all);
  12315. this.updateDraw();
  12316. });
  12317. }
  12318. }
  12319. closeSelf() {
  12320. this.hide();
  12321. }
  12322. playSecretaryIdle() {
  12323. let parent = this.ui.secretary.displayObject;
  12324. parent.destroyChildren();
  12325. let xx = this.ui.secretary.width / 2;
  12326. let yy = this.ui.secretary.height;
  12327. let scale = xGame.common.getSecretaryScale();
  12328. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12329. xGame.common.secretary.play(data, 0, true, parent);
  12330. }
  12331. }
  12332. UIDraw.uiName = "UIDraw";
  12333. class ui_UIFlyEft extends fgui.GComponent {
  12334. static createInstance() {
  12335. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12336. }
  12337. onConstruct() {
  12338. this.n0 = (this.getChild("n0"));
  12339. this.n1 = (this.getChild("n1"));
  12340. this.n2 = (this.getChild("n2"));
  12341. this.n3 = (this.getChild("n3"));
  12342. this.n4 = (this.getChild("n4"));
  12343. this.n5 = (this.getChild("n5"));
  12344. this.n6 = (this.getChild("n6"));
  12345. this.n7 = (this.getChild("n7"));
  12346. this.iconNode = (this.getChild("iconNode"));
  12347. this.txt = (this.getChild("txt"));
  12348. this.txtNode = (this.getChild("txtNode"));
  12349. }
  12350. }
  12351. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12352. class UIFlyEft extends UIBase {
  12353. constructor() {
  12354. super();
  12355. this.max = 8;
  12356. this.delay = 0;
  12357. }
  12358. onConstructor() {
  12359. this.ui = ui_UIFlyEft.createInstance();
  12360. this.contentPane = this.ui;
  12361. this.isEject = false;
  12362. this.isMuti = true;
  12363. this.ui.x += xGame.common.sysOffestNum;
  12364. }
  12365. getArrPos() {
  12366. if (this.iconPos && this.iconPos.length > 0)
  12367. return;
  12368. this.iconPos = [];
  12369. let temp;
  12370. for (let index = 0; index < this.max; index++) {
  12371. temp = this.ui["n" + index];
  12372. this.iconPos.push([temp.x, temp.y]);
  12373. }
  12374. }
  12375. show(stPos, edPos, num, type, callback) {
  12376. super.show();
  12377. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12378. this.getArrPos();
  12379. this.updateUI(type);
  12380. this.updatePos();
  12381. this.runFly(edPos, callback);
  12382. this.runWorlds(stPos, num);
  12383. }
  12384. updateUI(type) {
  12385. let temp;
  12386. let str;
  12387. for (let index = 0; index < this.max; index++) {
  12388. temp = this.ui["n" + index];
  12389. str = this.getIconStr(type);
  12390. temp.url = xGame.common.getGameIconUrl(str);
  12391. }
  12392. }
  12393. getIconStr(type) {
  12394. switch (type) {
  12395. case Prop.diamond:
  12396. return "ty_zs";
  12397. case Prop.coin:
  12398. return "ty_jb";
  12399. default:
  12400. break;
  12401. }
  12402. }
  12403. updatePos() {
  12404. let temp;
  12405. for (let index = 0; index < this.max; index++) {
  12406. temp = this.ui["n" + index];
  12407. temp.x = this.iconPos[index][0];
  12408. temp.y = this.iconPos[index][1];
  12409. }
  12410. }
  12411. runFly(endPos, callback) {
  12412. let all = 0;
  12413. let temp;
  12414. for (let index = 0; index < this.max; index++) {
  12415. temp = this.ui["n" + index];
  12416. temp.visible = true;
  12417. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12418. temp.visible = false;
  12419. all++;
  12420. if (all >= this.max) {
  12421. callback && callback();
  12422. }
  12423. }), 20 * index);
  12424. }
  12425. }
  12426. runWorlds(stPos, num) {
  12427. let str = "+" + num;
  12428. this.ui.txt.text = str;
  12429. let starX = stPos.x;
  12430. let starY = stPos.y + 50;
  12431. this.ui.txt.x = starX;
  12432. this.ui.txt.y = starY;
  12433. this.ui.txt.visible = true;
  12434. this.ui.txt.alpha = 1;
  12435. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12436. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12437. this.ui.txt.visible = false;
  12438. this.hide();
  12439. }));
  12440. }));
  12441. }
  12442. }
  12443. UIFlyEft.uiName = "UIFlyEft";
  12444. class Common {
  12445. constructor() {
  12446. this.convertNum = 0.025;
  12447. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12448. this.scaleV3One = new Laya.Vector3();
  12449. this.scaleV3Two = new Laya.Vector3();
  12450. this.posV4 = new Laya.Vector4();
  12451. this.showDebug = false;
  12452. this.openGuide = true;
  12453. this.rodOffest = new Laya.Vector2(0, 0);
  12454. this.rodAngle = 0;
  12455. this.gameMode = GameMode.classic;
  12456. this.bigMoveLevelIndex = 1;
  12457. this.bigMoveNeedCoin = 1000;
  12458. this.classicNiceNeddCoin = 1000;
  12459. this.passAwardCoin = 2000;
  12460. this.classicRoomType = 1;
  12461. this.maxPower = 20;
  12462. this.natureMaxPower = 5;
  12463. this.videoPower = 2;
  12464. this.powerRecoverNum = 900;
  12465. this.curPlayerSkillType = 0;
  12466. this.isNewDay = false;
  12467. this.clickedBall = false;
  12468. this.placeBallCurLevel = 0;
  12469. this.placeBallStarNum = 0;
  12470. this.longHelpLine = false;
  12471. this.maxShareDiamondTimes = 3;
  12472. this.guideStep = 0;
  12473. this.temSelfLevel = 0;
  12474. this.extraMoveNum = 0;
  12475. this.curRankID = 0;
  12476. this.rankID = {
  12477. normalStar: 12000,
  12478. wxStar: 12001
  12479. };
  12480. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12481. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12482. this.btnClickStr = "buttonclick";
  12483. this.maxSkillLevel = 10;
  12484. this.upSkillLevel = false;
  12485. this.gameStartTime = 0;
  12486. this._sysOffestNum = 0;
  12487. this.angleV2 = new Laya.Vector2();
  12488. this.rootV = new Laya.Vector2(0, 1);
  12489. this.tempDir1 = new Laya.Vector2();
  12490. this.tempDir2 = new Laya.Vector2();
  12491. this.ballSize = 33;
  12492. this.stPos = new Laya.Point();
  12493. this.edPos = new Laya.Point();
  12494. Common._instance = this;
  12495. window["common"] = this;
  12496. }
  12497. static getInstance() {
  12498. if (!this._instance) {
  12499. this._instance = new Common();
  12500. }
  12501. return this._instance;
  12502. }
  12503. get sysOffestNum() {
  12504. if (this._sysOffestNum == 0) {
  12505. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12506. }
  12507. return this._sysOffestNum;
  12508. }
  12509. testShader() {
  12510. let test = new LightShader();
  12511. test.texture = "res/d3Res/ballTexture/ball1.png";
  12512. Laya.stage.addChild(test);
  12513. }
  12514. playScale(node) {
  12515. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12516. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12517. }));
  12518. }));
  12519. }
  12520. setGroup(colli, ...group) {
  12521. let out = 0;
  12522. for (let index = 0; index < group.length; index++) {
  12523. if (index == 0) {
  12524. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12525. }
  12526. else {
  12527. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12528. }
  12529. }
  12530. colli.collisionGroup = out;
  12531. }
  12532. setCanGroupWith(colli, ...group) {
  12533. let out = 0;
  12534. for (let index = 0; index < group.length; index++) {
  12535. if (index == 0) {
  12536. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12537. }
  12538. else {
  12539. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12540. }
  12541. }
  12542. colli.canCollideWith = out;
  12543. }
  12544. loadPrefab(name, callback) {
  12545. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12546. let prefab = new Laya.Prefab();
  12547. prefab.json = obj;
  12548. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12549. callback && callback(img);
  12550. }));
  12551. }
  12552. pos2to3Convert(x, y, d3Pos) {
  12553. x = x + this.sysOffestNum;
  12554. d3Pos.setValue(x, y, 0);
  12555. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12556. if (success) {
  12557. }
  12558. else {
  12559. console.error("转换出错了。。。。。。。。");
  12560. }
  12561. }
  12562. scale2to3Convert(num) {
  12563. this.scaleV3One.setValue(0, 0, 0);
  12564. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12565. this.scaleV3Two.setValue(0, num, 0);
  12566. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12567. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12568. return outNum;
  12569. }
  12570. pos3to2Convert(d3Pos) {
  12571. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12572. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12573. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12574. d3Pos.x -= this.sysOffestNum;
  12575. }
  12576. scale3to2Convert(num) {
  12577. let scale = this.scale2to3Convert(1);
  12578. let d2Out = num / scale;
  12579. return d2Out;
  12580. }
  12581. getCollider(type, restitution = 0.9, density = 10) {
  12582. let colli;
  12583. if (type == "box")
  12584. colli = new Laya.BoxCollider();
  12585. else
  12586. colli = new Laya.CircleCollider();
  12587. colli.friction = 0;
  12588. colli.restitution = restitution;
  12589. colli.density = density;
  12590. return colli;
  12591. }
  12592. getRigbody() {
  12593. let rigy = new Laya.RigidBody();
  12594. rigy.bullet = true;
  12595. rigy.allowRotation = false;
  12596. rigy.allowSleep = false;
  12597. rigy.gravityScale = 0;
  12598. return rigy;
  12599. }
  12600. getfguiRotation(x, y) {
  12601. this.angleV2.setValue(x, y);
  12602. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12603. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12604. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12605. angle = -angle;
  12606. }
  12607. return 180 + angle;
  12608. }
  12609. getAngle(x, y) {
  12610. this.angleV2.setValue(x, y);
  12611. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12612. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12613. return angle;
  12614. }
  12615. randomNum(a, b) {
  12616. return a + Math.floor((b - a + 1) * Math.random());
  12617. }
  12618. getRandArrEle(arr) {
  12619. return arr[Math.floor(arr.length * Math.random())];
  12620. }
  12621. getSign(val) {
  12622. return val >= 0 ? 1 : -1;
  12623. }
  12624. botherArr(arr) {
  12625. let times = arr.length + 2;
  12626. let length = arr.length;
  12627. let a;
  12628. let b;
  12629. let temp;
  12630. for (let index = 0; index < times; index++) {
  12631. a = Math.floor(Math.random() * length);
  12632. b = Math.floor(Math.random() * length);
  12633. temp = arr[a];
  12634. arr[a] = arr[b];
  12635. arr[b] = temp;
  12636. }
  12637. }
  12638. getGameIconUrl(id) {
  12639. return "ui://game/" + id;
  12640. }
  12641. getComponentUrl(id) {
  12642. return "ui://game/" + id;
  12643. }
  12644. getAnimation() {
  12645. }
  12646. judgeSkillType(type = SkillType.highSpace) {
  12647. if (this.gameMode == GameMode.classic)
  12648. return;
  12649. let gameMgr = this.gameMgr;
  12650. if (gameMgr.selfTurn) {
  12651. if (gameMgr.selfCurSkill == type) {
  12652. return true;
  12653. }
  12654. }
  12655. else {
  12656. if (gameMgr.aiCurSkill == type) {
  12657. return true;
  12658. }
  12659. }
  12660. }
  12661. ballColliHole(collider) {
  12662. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12663. xGame.common.gameMgr.isFirstInGame = false;
  12664. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12665. }
  12666. collider.owner.mySrc.checkWrongBall();
  12667. }
  12668. getArrMaxEle(arr) {
  12669. let max = -Infinity;
  12670. for (let index = 0; index < arr.length; index++) {
  12671. max = Math.max(arr[index], max);
  12672. }
  12673. return max;
  12674. }
  12675. getArrMinEle(arr) {
  12676. let min = Infinity;
  12677. for (let index = 0; index < arr.length; index++) {
  12678. min = Math.min(arr[index], min);
  12679. }
  12680. return min;
  12681. }
  12682. playRandomMutiBallBigSkillSound() {
  12683. if (Math.random() <= 0.5)
  12684. return;
  12685. let rand = this.randomNum(1, 6);
  12686. let str = "ganfa0" + rand;
  12687. xGame.soundMgr.playSound(str);
  12688. }
  12689. showOneCamera(type) {
  12690. let object = xGame.common.d3World.cameraObj;
  12691. for (const key in object) {
  12692. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12693. object[key].init();
  12694. object[key].owner.active = key == type;
  12695. }
  12696. }
  12697. }
  12698. checkBallOverBorder(x, y) {
  12699. let radius = 17;
  12700. let condition = this._checkBorder(x + radius, y) ||
  12701. this._checkBorder(x - radius, y) ||
  12702. this._checkBorder(x, y + radius) ||
  12703. this._checkBorder(x, y - radius);
  12704. if (condition) {
  12705. return true;
  12706. }
  12707. }
  12708. _checkBorder(x, y) {
  12709. let borderRect = this.d2World.borderRect;
  12710. let xOffest = 20;
  12711. let yOffest = 20;
  12712. if (y <= borderRect.y - yOffest) {
  12713. return true;
  12714. }
  12715. if (y >= borderRect.y + borderRect.height + yOffest) {
  12716. return true;
  12717. }
  12718. if (x <= borderRect.x - xOffest) {
  12719. return true;
  12720. }
  12721. if (x >= borderRect.x + borderRect.width + xOffest) {
  12722. return true;
  12723. }
  12724. }
  12725. initWeight(cfg) {
  12726. let allCfgData = { data: {}, allWeightNum: 0 };
  12727. let weightCfg = allCfgData.data;
  12728. let weight = 0;
  12729. for (const key in cfg) {
  12730. weightCfg[key] = {};
  12731. weightCfg[key].id = cfg[key].id;
  12732. weightCfg[key].minWeight = weight;
  12733. weight += cfg[key].weight;
  12734. weightCfg[key].maxWeight = weight;
  12735. }
  12736. allCfgData.allWeightNum = weight;
  12737. return allCfgData;
  12738. }
  12739. getRandomWeightData(cfg) {
  12740. let weightCfg = cfg.data;
  12741. let allWeightNum = cfg.allWeightNum;
  12742. let rand = Math.floor(Math.random() * allWeightNum);
  12743. for (const key in weightCfg) {
  12744. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12745. return weightCfg[key];
  12746. }
  12747. }
  12748. return weightCfg[1];
  12749. }
  12750. showGirlTalkPop(wordsIndex, node, msgNode) {
  12751. node.visible = true;
  12752. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12753. node.t0.play(Laya.Handler.create(this, () => {
  12754. node.visible = false;
  12755. }));
  12756. }
  12757. stopGirlPop(node) {
  12758. node.t0.stop();
  12759. node.visible = false;
  12760. }
  12761. createHead(loader, url, size = 107) {
  12762. if (Laya.Browser.name == "Browser") {
  12763. loader.url = url;
  12764. return;
  12765. }
  12766. else {
  12767. console.log('zh:url=', url);
  12768. loader.url = url;
  12769. }
  12770. }
  12771. addTestCoin(num) {
  12772. DataMgr.setCoin(num);
  12773. }
  12774. addTestDiamond(num) {
  12775. DataMgr.setDiamond(num);
  12776. }
  12777. addTestSkill() {
  12778. DataMgr.setBigSkill(0, 99);
  12779. DataMgr.setBigSkill(1, 99);
  12780. DataMgr.setBigSkill(2, 99);
  12781. }
  12782. playClassicEmotion(number, x, y) {
  12783. if (this.gameMode == GameMode.bigMove)
  12784. return;
  12785. let randIndex = this.randomNum(0, 2);
  12786. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12787. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12788. if (this.gameMgr.selfTurn) {
  12789. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12790. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12791. }
  12792. else {
  12793. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12794. }
  12795. else {
  12796. if (number == this.gameMgr.blackNum) {
  12797. if (this.gameMgr.selfBallArr.length == 0) {
  12798. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12799. }
  12800. else {
  12801. }
  12802. }
  12803. else {
  12804. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12805. }
  12806. }
  12807. }
  12808. }
  12809. else {
  12810. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12811. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12812. }
  12813. else {
  12814. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12815. }
  12816. else {
  12817. if (number == this.gameMgr.blackNum) {
  12818. if (this.gameMgr.aiBallArr.length == 0) {
  12819. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12820. }
  12821. else {
  12822. }
  12823. }
  12824. else {
  12825. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12826. }
  12827. }
  12828. }
  12829. }
  12830. }
  12831. playHappySound(number) {
  12832. if (this.gameMode != GameMode.classic)
  12833. return;
  12834. if (number == 8)
  12835. return;
  12836. let play = false;
  12837. if (this.gameMgr.selfTurn) {
  12838. if (this.gameMgr.ensureBallType) {
  12839. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12840. play = true;
  12841. }
  12842. }
  12843. else {
  12844. play = true;
  12845. }
  12846. }
  12847. else {
  12848. if (this.gameMgr.ensureBallType) {
  12849. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12850. play = true;
  12851. }
  12852. }
  12853. else {
  12854. play = true;
  12855. }
  12856. }
  12857. if (play)
  12858. xGame.soundMgr.playSound("applause");
  12859. }
  12860. destroyClassicEmotion() {
  12861. if (this.gameMode == GameMode.bigMove)
  12862. return;
  12863. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12864. parent.destroyChildren();
  12865. }
  12866. playAwardSpine(x, y) {
  12867. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12868. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12869. this.awardSpine.play(data, 0, false, parent);
  12870. }
  12871. destroyAwardSpine() {
  12872. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12873. parent.destroyChildren();
  12874. }
  12875. isBlock(bx, by, hx, hy, except = null) {
  12876. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12877. let balls = xGame.common.d2World.ballArr;
  12878. let outArr = [];
  12879. for (let index = 0; index < balls.length; index++) {
  12880. let obj = balls[index];
  12881. if (obj.number == 0)
  12882. continue;
  12883. if (obj == except)
  12884. continue;
  12885. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12886. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12887. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12888. if (num >= 1)
  12889. num = 1;
  12890. if (num < 0)
  12891. continue;
  12892. let gap = Math.sin(Math.acos(num)) * dis;
  12893. if (gap < this.ballSize) {
  12894. outArr.push({
  12895. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12896. disHon: Math.cos(Math.acos(num)) * dis,
  12897. disVer: Math.sin(Math.acos(num)) * dis,
  12898. src: balls[index],
  12899. dir: this.tempDir1
  12900. });
  12901. }
  12902. }
  12903. if (outArr.length > 0) {
  12904. outArr.sort((a, b) => { return a.dis - b.dis; });
  12905. return outArr[0];
  12906. }
  12907. }
  12908. AngleBetween(vector1, vector2) {
  12909. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12910. return rad * (180 / Math.PI);
  12911. }
  12912. getSecretaryScale() {
  12913. if (this.secretary.spineName == "mishu") {
  12914. return 1.28;
  12915. }
  12916. else {
  12917. return 1.024;
  12918. }
  12919. }
  12920. signAwardContainsRod(arr) {
  12921. let temp;
  12922. for (let index = 0; index < arr.length; index++) {
  12923. temp = arr[index].split('-')[0];
  12924. if (parseInt(temp) > 2) {
  12925. return true;
  12926. }
  12927. }
  12928. }
  12929. judgeSameDay() {
  12930. let lastTime = DataMgr.getSignTime();
  12931. let curTime = new Date().getTime();
  12932. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12933. return true;
  12934. }
  12935. return false;
  12936. }
  12937. getAward(arr, callback) {
  12938. let showTriple = arr[0].type <= 2;
  12939. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12940. let temp;
  12941. for (let index = 0; index < arr.length; index++) {
  12942. temp = arr[index];
  12943. switch (temp.type) {
  12944. case 1:
  12945. this.playObjFlyAnim(temp.num, temp.type);
  12946. break;
  12947. case 2:
  12948. this.playObjFlyAnim(temp.num, temp.type);
  12949. break;
  12950. case 3:
  12951. case 4:
  12952. case 5:
  12953. case 6:
  12954. DataMgr.setBallRod(temp.type - 2, 1);
  12955. DataMgr.setCurBallRod(temp.type - 2);
  12956. break;
  12957. default:
  12958. break;
  12959. }
  12960. }
  12961. callback && callback(watchVideo);
  12962. });
  12963. }
  12964. getMoneyNode() {
  12965. let moneyNode;
  12966. let sign = xGame.uiMgr.getUI(UISign);
  12967. let draw = xGame.uiMgr.getUI(UIDraw);
  12968. let end = xGame.uiMgr.getUI(UIGameEnd);
  12969. let skill = xGame.uiMgr.getUI(UISkill);
  12970. if (sign && !sign.isHide)
  12971. moneyNode = sign.ui.moneyNode;
  12972. if (draw && !draw.isHide)
  12973. moneyNode = draw.ui.moneyNode;
  12974. if (end && !end.isHide)
  12975. moneyNode = end.ui.moneyNode;
  12976. if (skill && !skill.isHide)
  12977. moneyNode = skill.ui.moneyNode;
  12978. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12979. let main = xGame.uiMgr.getUI(UIMain);
  12980. if (condition1 && main && !main.isHide) {
  12981. moneyNode = main.ui.moneyNode;
  12982. }
  12983. return moneyNode;
  12984. }
  12985. playObjFlyAnim(num, type, callback = null) {
  12986. this.stPos.x = Laya.stage.width / 2;
  12987. this.stPos.y = Laya.stage.height / 2;
  12988. let moneyNode = this.getMoneyNode();
  12989. switch (type) {
  12990. case Prop.diamond:
  12991. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12992. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12993. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12994. this.edPos.x /= 2;
  12995. this.edPos.y /= 2;
  12996. break;
  12997. case Prop.coin:
  12998. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12999. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13000. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13001. this.edPos.x /= 2;
  13002. this.edPos.y /= 2;
  13003. break;
  13004. default:
  13005. break;
  13006. }
  13007. xGame.soundMgr.playSound("coinbag");
  13008. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13009. switch (type) {
  13010. case Prop.diamond:
  13011. DataMgr.setDiamond(num);
  13012. break;
  13013. case Prop.coin:
  13014. DataMgr.setCoin(num);
  13015. break;
  13016. default:
  13017. break;
  13018. }
  13019. callback && callback();
  13020. });
  13021. }
  13022. autoPopUIView() {
  13023. let arr = [];
  13024. let sign = this.judgeSameDay() ? false : true;
  13025. if (sign)
  13026. arr.push("sign");
  13027. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13028. if (draw)
  13029. arr.push("draw");
  13030. if (arr.length <= 0)
  13031. return;
  13032. let str = this.getRandArrEle(arr);
  13033. switch (str) {
  13034. case "sign":
  13035. xGame.uiMgr.Show(UISign);
  13036. break;
  13037. case "draw":
  13038. xGame.uiMgr.Show(UIDraw);
  13039. break;
  13040. default:
  13041. break;
  13042. }
  13043. }
  13044. getMSTime(time) {
  13045. let min = Math.floor(time / 60);
  13046. let sec = Math.floor((time - min * 60));
  13047. if (sec < 10)
  13048. sec = "0" + sec;
  13049. if (min < 10)
  13050. min = "0" + min;
  13051. return `${min}:${sec}`;
  13052. }
  13053. testPower() {
  13054. DataMgr.setPower(0, false);
  13055. }
  13056. getAllStarNum() {
  13057. let data = DataMgr.getPlaceBallLevelList();
  13058. let out = 0;
  13059. for (let index = 0; index < data.length; index++) {
  13060. out += data[index].star;
  13061. }
  13062. return out;
  13063. }
  13064. recoverCameraView() {
  13065. Laya.timer.once(900, this, () => {
  13066. xGame.common.showOneCamera("mainCamera");
  13067. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13068. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13069. xGame.common.gameUI.ui.border.alpha = 0;
  13070. if (Laya.physicsTimer.scale < 1) {
  13071. Laya.physicsTimer.scale = 1;
  13072. }
  13073. }
  13074. });
  13075. }
  13076. getClassicLevel() {
  13077. let successTimes = DataMgr.getClassicTimes();
  13078. let needKey = "";
  13079. let lastKey = "";
  13080. let cfg = cfgTable.classictimesData;
  13081. let data;
  13082. for (const key in cfg) {
  13083. data = cfg[key];
  13084. if (successTimes <= data.times) {
  13085. needKey = key;
  13086. }
  13087. lastKey = key;
  13088. }
  13089. if (needKey == "")
  13090. needKey = lastKey;
  13091. return cfg[needKey];
  13092. }
  13093. }
  13094. Common._instance = null;
  13095. class ui_Component92 extends fgui.GComponent {
  13096. static createInstance() {
  13097. return (fgui.UIPackage.createObject("game", "Component92"));
  13098. }
  13099. onConstruct() {
  13100. this.n0 = (this.getChild("n0"));
  13101. }
  13102. }
  13103. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13104. class ui_Component129 extends fgui.GProgressBar {
  13105. static createInstance() {
  13106. return (fgui.UIPackage.createObject("game", "Component129"));
  13107. }
  13108. onConstruct() {
  13109. this.bar_v = (this.getChild("bar_v"));
  13110. this.n84 = (this.getChild("n84"));
  13111. }
  13112. }
  13113. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13114. class ui_Component130 extends fgui.GComponent {
  13115. static createInstance() {
  13116. return (fgui.UIPackage.createObject("game", "Component130"));
  13117. }
  13118. onConstruct() {
  13119. this.ani = (this.getChild("ani"));
  13120. this.t0 = this.getTransition("t0");
  13121. }
  13122. }
  13123. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13124. class ui_powerEft extends fgui.GComponent {
  13125. static createInstance() {
  13126. return (fgui.UIPackage.createObject("game", "powerEft"));
  13127. }
  13128. onConstruct() {
  13129. this.ani = (this.getChild("ani"));
  13130. this.n88 = (this.getChild("n88"));
  13131. this.n89 = (this.getChild("n89"));
  13132. }
  13133. }
  13134. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13135. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13136. static createInstance() {
  13137. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13138. }
  13139. onConstruct() {
  13140. this.c1 = this.getController("c1");
  13141. this.n2 = (this.getChild("n2"));
  13142. this.n22 = (this.getChild("n22"));
  13143. this.n23 = (this.getChild("n23"));
  13144. this.n15 = (this.getChild("n15"));
  13145. this.challenge = (this.getChild("challenge"));
  13146. this.n17 = (this.getChild("n17"));
  13147. this.n3 = (this.getChild("n3"));
  13148. this.starNode = (this.getChild("starNode"));
  13149. this.levelTxt = (this.getChild("levelTxt"));
  13150. this.n14 = (this.getChild("n14"));
  13151. this.n19 = (this.getChild("n19"));
  13152. this.n20 = (this.getChild("n20"));
  13153. this.n21 = (this.getChild("n21"));
  13154. this.special = (this.getChild("special"));
  13155. }
  13156. }
  13157. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13158. class ui_Component79 extends fgui.GComponent {
  13159. static createInstance() {
  13160. return (fgui.UIPackage.createObject("game", "Component79"));
  13161. }
  13162. onConstruct() {
  13163. this.c1 = this.getController("c1");
  13164. this.n7 = (this.getChild("n7"));
  13165. this.n8 = (this.getChild("n8"));
  13166. this.n9 = (this.getChild("n9"));
  13167. this.n10 = (this.getChild("n10"));
  13168. this.n11 = (this.getChild("n11"));
  13169. this.n12 = (this.getChild("n12"));
  13170. }
  13171. }
  13172. ui_Component79.URL = "ui://isxx5ak7avag477";
  13173. class ui_Component80 extends fgui.GComponent {
  13174. static createInstance() {
  13175. return (fgui.UIPackage.createObject("game", "Component80"));
  13176. }
  13177. onConstruct() {
  13178. this.n0 = (this.getChild("n0"));
  13179. this.n1 = (this.getChild("n1"));
  13180. this.myList = (this.getChild("myList"));
  13181. this.t0 = this.getTransition("t0");
  13182. }
  13183. }
  13184. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13185. class ui_SignNormal extends fgui.GComponent {
  13186. static createInstance() {
  13187. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13188. }
  13189. onConstruct() {
  13190. this.c1 = this.getController("c1");
  13191. this.n7 = (this.getChild("n7"));
  13192. this.n15 = (this.getChild("n15"));
  13193. this.titleTxt = (this.getChild("titleTxt"));
  13194. this.n8 = (this.getChild("n8"));
  13195. this.myIcon = (this.getChild("myIcon"));
  13196. this.numTxt = (this.getChild("numTxt"));
  13197. this.n12 = (this.getChild("n12"));
  13198. this.n13 = (this.getChild("n13"));
  13199. this.n17 = (this.getChild("n17"));
  13200. this.n14 = (this.getChild("n14"));
  13201. }
  13202. }
  13203. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13204. class ui_Button_reg extends fgui.GButton {
  13205. static createInstance() {
  13206. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13207. }
  13208. onConstruct() {
  13209. this.button = this.getController("button");
  13210. this.n6 = (this.getChild("n6"));
  13211. this.n4 = (this.getChild("n4"));
  13212. }
  13213. }
  13214. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13215. class ui_screenNode extends fgui.GComponent {
  13216. static createInstance() {
  13217. return (fgui.UIPackage.createObject("game", "screenNode"));
  13218. }
  13219. onConstruct() {
  13220. this.n9 = (this.getChild("n9"));
  13221. this.screenImg = (this.getChild("screenImg"));
  13222. }
  13223. }
  13224. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13225. class ui_GetAwrad_com1 extends fgui.GComponent {
  13226. static createInstance() {
  13227. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13228. }
  13229. onConstruct() {
  13230. this.n38 = (this.getChild("n38"));
  13231. this.n39 = (this.getChild("n39"));
  13232. this.n40 = (this.getChild("n40"));
  13233. this.t0 = this.getTransition("t0");
  13234. this.t1 = this.getTransition("t1");
  13235. }
  13236. }
  13237. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13238. class ui_GetAwrad_com2 extends fgui.GComponent {
  13239. static createInstance() {
  13240. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13241. }
  13242. onConstruct() {
  13243. this.n39 = (this.getChild("n39"));
  13244. this.n40 = (this.getChild("n40"));
  13245. this.t0 = this.getTransition("t0");
  13246. }
  13247. }
  13248. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13249. class ui_Component128 extends fgui.GComponent {
  13250. static createInstance() {
  13251. return (fgui.UIPackage.createObject("game", "Component128"));
  13252. }
  13253. onConstruct() {
  13254. this.n38 = (this.getChild("n38"));
  13255. this.n40 = (this.getChild("n40"));
  13256. }
  13257. }
  13258. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13259. class ui_Component100_1 extends fgui.GComponent {
  13260. static createInstance() {
  13261. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13262. }
  13263. onConstruct() {
  13264. this.myNode = (this.getChild("myNode"));
  13265. this.t0 = this.getTransition("t0");
  13266. }
  13267. }
  13268. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13269. class ui_Component142 extends fgui.GComponent {
  13270. static createInstance() {
  13271. return (fgui.UIPackage.createObject("game", "Component142"));
  13272. }
  13273. onConstruct() {
  13274. this.n41 = (this.getChild("n41"));
  13275. this.n42 = (this.getChild("n42"));
  13276. }
  13277. }
  13278. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13279. class ui_main_guang extends fgui.GComponent {
  13280. static createInstance() {
  13281. return (fgui.UIPackage.createObject("game", "main_guang"));
  13282. }
  13283. onConstruct() {
  13284. this.n1 = (this.getChild("n1"));
  13285. this.n2 = (this.getChild("n2"));
  13286. this.n3 = (this.getChild("n3"));
  13287. this.n4 = (this.getChild("n4"));
  13288. this.n5 = (this.getChild("n5"));
  13289. this.n6 = (this.getChild("n6"));
  13290. this.n8 = (this.getChild("n8"));
  13291. this.t0 = this.getTransition("t0");
  13292. }
  13293. }
  13294. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13295. class ui_try_com1 extends fgui.GComponent {
  13296. static createInstance() {
  13297. return (fgui.UIPackage.createObject("game", "try_com1"));
  13298. }
  13299. onConstruct() {
  13300. this.c1 = this.getController("c1");
  13301. this.n0 = (this.getChild("n0"));
  13302. this.n2 = (this.getChild("n2"));
  13303. this.cancelBtn = (this.getChild("cancelBtn"));
  13304. this.videoBtn = (this.getChild("videoBtn"));
  13305. this.n9 = (this.getChild("n9"));
  13306. this.n24 = (this.getChild("n24"));
  13307. this.titleTxt = (this.getChild("titleTxt"));
  13308. this.n32 = (this.getChild("n32"));
  13309. this.n29 = (this.getChild("n29"));
  13310. this.n36 = (this.getChild("n36"));
  13311. this.txtTime = (this.getChild("txtTime"));
  13312. this.t0 = this.getTransition("t0");
  13313. }
  13314. }
  13315. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13316. class ui_try_com2 extends fgui.GComponent {
  13317. static createInstance() {
  13318. return (fgui.UIPackage.createObject("game", "try_com2"));
  13319. }
  13320. onConstruct() {
  13321. this.skillicon = (this.getChild("skillicon"));
  13322. this.n35 = (this.getChild("n35"));
  13323. this.n31 = (this.getChild("n31"));
  13324. this.n32 = (this.getChild("n32"));
  13325. this.n33 = (this.getChild("n33"));
  13326. this.n34 = (this.getChild("n34"));
  13327. }
  13328. }
  13329. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13330. class ui_try_com3 extends fgui.GComponent {
  13331. static createInstance() {
  13332. return (fgui.UIPackage.createObject("game", "try_com3"));
  13333. }
  13334. onConstruct() {
  13335. this.n33 = (this.getChild("n33"));
  13336. this.n34 = (this.getChild("n34"));
  13337. this.n35 = (this.getChild("n35"));
  13338. this.t0 = this.getTransition("t0");
  13339. }
  13340. }
  13341. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13342. class ui_huihe1 extends fgui.GComponent {
  13343. static createInstance() {
  13344. return (fgui.UIPackage.createObject("game", "huihe1"));
  13345. }
  13346. onConstruct() {
  13347. this.n0 = (this.getChild("n0"));
  13348. this.n1 = (this.getChild("n1"));
  13349. this.t0 = this.getTransition("t0");
  13350. }
  13351. }
  13352. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13353. class ui_huihe2 extends fgui.GComponent {
  13354. static createInstance() {
  13355. return (fgui.UIPackage.createObject("game", "huihe2"));
  13356. }
  13357. onConstruct() {
  13358. this.n0 = (this.getChild("n0"));
  13359. this.n1 = (this.getChild("n1"));
  13360. this.t0 = this.getTransition("t0");
  13361. }
  13362. }
  13363. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13364. class ui_Component143 extends fgui.GComponent {
  13365. static createInstance() {
  13366. return (fgui.UIPackage.createObject("game", "Component143"));
  13367. }
  13368. onConstruct() {
  13369. this.n3 = (this.getChild("n3"));
  13370. this.n4 = (this.getChild("n4"));
  13371. this.n5 = (this.getChild("n5"));
  13372. this.n6 = (this.getChild("n6"));
  13373. this.n7 = (this.getChild("n7"));
  13374. this.n8 = (this.getChild("n8"));
  13375. this.n9 = (this.getChild("n9"));
  13376. this.n10 = (this.getChild("n10"));
  13377. this.t0 = this.getTransition("t0");
  13378. }
  13379. }
  13380. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13381. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13382. static createInstance() {
  13383. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13384. }
  13385. onConstruct() {
  13386. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13387. }
  13388. }
  13389. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13390. class ui_dh_jingbi2 extends fgui.GComponent {
  13391. static createInstance() {
  13392. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13393. }
  13394. onConstruct() {
  13395. this.n0 = (this.getChild("n0"));
  13396. this.n1 = (this.getChild("n1"));
  13397. this.n2 = (this.getChild("n2"));
  13398. this.n3 = (this.getChild("n3"));
  13399. this.n4 = (this.getChild("n4"));
  13400. this.n5 = (this.getChild("n5"));
  13401. this.n6 = (this.getChild("n6"));
  13402. this.n8 = (this.getChild("n8"));
  13403. this.n10 = (this.getChild("n10"));
  13404. this.t0 = this.getTransition("t0");
  13405. }
  13406. }
  13407. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13408. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13409. static createInstance() {
  13410. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13411. }
  13412. onConstruct() {
  13413. this.n1 = (this.getChild("n1"));
  13414. this.n4 = (this.getChild("n4"));
  13415. this.t0 = this.getTransition("t0");
  13416. }
  13417. }
  13418. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13419. class ui_dh_jingbi3 extends fgui.GComponent {
  13420. static createInstance() {
  13421. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13422. }
  13423. onConstruct() {
  13424. this.n0 = (this.getChild("n0"));
  13425. this.n1 = (this.getChild("n1"));
  13426. this.n2 = (this.getChild("n2"));
  13427. this.n3 = (this.getChild("n3"));
  13428. this.n4 = (this.getChild("n4"));
  13429. this.n5 = (this.getChild("n5"));
  13430. this.n6 = (this.getChild("n6"));
  13431. this.n8 = (this.getChild("n8"));
  13432. this.n10 = (this.getChild("n10"));
  13433. this.t0 = this.getTransition("t0");
  13434. }
  13435. }
  13436. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13437. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13438. static createInstance() {
  13439. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13440. }
  13441. onConstruct() {
  13442. this.n3 = (this.getChild("n3"));
  13443. this.n1 = (this.getChild("n1"));
  13444. this.t0 = this.getTransition("t0");
  13445. }
  13446. }
  13447. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13448. class ui_hb_jinbi1 extends fgui.GButton {
  13449. static createInstance() {
  13450. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13451. }
  13452. onConstruct() {
  13453. this.n20 = (this.getChild("n20"));
  13454. this.n25 = (this.getChild("n25"));
  13455. this.coinTxt = (this.getChild("coinTxt"));
  13456. this.n28 = (this.getChild("n28"));
  13457. this.n32 = (this.getChild("n32"));
  13458. this.n38 = (this.getChild("n38"));
  13459. this.n45 = (this.getChild("n45"));
  13460. this.getTips = (this.getChild("getTips"));
  13461. this.n39 = (this.getChild("n39"));
  13462. this.diamondTxt = (this.getChild("diamondTxt"));
  13463. this.n41 = (this.getChild("n41"));
  13464. this.n42 = (this.getChild("n42"));
  13465. this.n46 = (this.getChild("n46"));
  13466. this.n47 = (this.getChild("n47"));
  13467. this.n48 = (this.getChild("n48"));
  13468. this.t0 = this.getTransition("t0");
  13469. }
  13470. }
  13471. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13472. class ui_hb_jinbi2 extends fgui.GButton {
  13473. static createInstance() {
  13474. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13475. }
  13476. onConstruct() {
  13477. this.n20 = (this.getChild("n20"));
  13478. this.n25 = (this.getChild("n25"));
  13479. this.coinTxt = (this.getChild("coinTxt"));
  13480. this.n28 = (this.getChild("n28"));
  13481. this.n32 = (this.getChild("n32"));
  13482. this.n38 = (this.getChild("n38"));
  13483. this.n39 = (this.getChild("n39"));
  13484. this.diamondTxt = (this.getChild("diamondTxt"));
  13485. this.n41 = (this.getChild("n41"));
  13486. this.n42 = (this.getChild("n42"));
  13487. this.n43 = (this.getChild("n43"));
  13488. this.n44 = (this.getChild("n44"));
  13489. this.n45 = (this.getChild("n45"));
  13490. this.t0 = this.getTransition("t0");
  13491. }
  13492. }
  13493. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13494. class ui_hb_jinbi3 extends fgui.GButton {
  13495. static createInstance() {
  13496. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13497. }
  13498. onConstruct() {
  13499. this.n20 = (this.getChild("n20"));
  13500. this.n25 = (this.getChild("n25"));
  13501. this.coinTxt = (this.getChild("coinTxt"));
  13502. this.n28 = (this.getChild("n28"));
  13503. this.n32 = (this.getChild("n32"));
  13504. this.n38 = (this.getChild("n38"));
  13505. this.n39 = (this.getChild("n39"));
  13506. this.diamondTxt = (this.getChild("diamondTxt"));
  13507. this.n41 = (this.getChild("n41"));
  13508. this.n42 = (this.getChild("n42"));
  13509. this.n43 = (this.getChild("n43"));
  13510. this.n44 = (this.getChild("n44"));
  13511. this.n45 = (this.getChild("n45"));
  13512. this.t0 = this.getTransition("t0");
  13513. }
  13514. }
  13515. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13516. class ui_Component104 extends fgui.GComponent {
  13517. static createInstance() {
  13518. return (fgui.UIPackage.createObject("game", "Component104"));
  13519. }
  13520. onConstruct() {
  13521. this.c1 = this.getController("c1");
  13522. this.n12 = (this.getChild("n12"));
  13523. this.coinBtn = (this.getChild("coinBtn"));
  13524. this.diamondBtn = (this.getChild("diamondBtn"));
  13525. this.node3 = (this.getChild("node3"));
  13526. this.node4 = (this.getChild("node4"));
  13527. this.node5 = (this.getChild("node5"));
  13528. this.node1 = (this.getChild("node1"));
  13529. this.node2 = (this.getChild("node2"));
  13530. this.node6 = (this.getChild("node6"));
  13531. this.t0 = this.getTransition("t0");
  13532. }
  13533. }
  13534. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13535. class ui_Component105 extends fgui.GButton {
  13536. static createInstance() {
  13537. return (fgui.UIPackage.createObject("game", "Component105"));
  13538. }
  13539. onConstruct() {
  13540. this.c1 = this.getController("c1");
  13541. this.n49 = (this.getChild("n49"));
  13542. this.n18 = (this.getChild("n18"));
  13543. this.n46 = (this.getChild("n46"));
  13544. this.n48 = (this.getChild("n48"));
  13545. }
  13546. }
  13547. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13548. class ui_Component106 extends fgui.GButton {
  13549. static createInstance() {
  13550. return (fgui.UIPackage.createObject("game", "Component106"));
  13551. }
  13552. onConstruct() {
  13553. this.c1 = this.getController("c1");
  13554. this.n49 = (this.getChild("n49"));
  13555. this.n18 = (this.getChild("n18"));
  13556. this.n46 = (this.getChild("n46"));
  13557. this.n48 = (this.getChild("n48"));
  13558. }
  13559. }
  13560. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13561. class ui_hb_zs1 extends fgui.GButton {
  13562. static createInstance() {
  13563. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13564. }
  13565. onConstruct() {
  13566. this.c1 = this.getController("c1");
  13567. this.n20 = (this.getChild("n20"));
  13568. this.n21 = (this.getChild("n21"));
  13569. this.n26 = (this.getChild("n26"));
  13570. this.n27 = (this.getChild("n27"));
  13571. this.shareTxt = (this.getChild("shareTxt"));
  13572. this.n32 = (this.getChild("n32"));
  13573. this.n38 = (this.getChild("n38"));
  13574. this.n39 = (this.getChild("n39"));
  13575. this.n44 = (this.getChild("n44"));
  13576. this.diamondTxt = (this.getChild("diamondTxt"));
  13577. this.n41 = (this.getChild("n41"));
  13578. this.n45 = (this.getChild("n45"));
  13579. this.n47 = (this.getChild("n47"));
  13580. this.n48 = (this.getChild("n48"));
  13581. this.randTxt = (this.getChild("randTxt"));
  13582. this.n50 = (this.getChild("n50"));
  13583. this.t0 = this.getTransition("t0");
  13584. }
  13585. }
  13586. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13587. class ui_dh_zs1 extends fgui.GComponent {
  13588. static createInstance() {
  13589. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13590. }
  13591. onConstruct() {
  13592. this.n10 = (this.getChild("n10"));
  13593. this.n9 = (this.getChild("n9"));
  13594. this.n1 = (this.getChild("n1"));
  13595. this.n2 = (this.getChild("n2"));
  13596. this.n3 = (this.getChild("n3"));
  13597. this.n4 = (this.getChild("n4"));
  13598. this.n5 = (this.getChild("n5"));
  13599. this.n6 = (this.getChild("n6"));
  13600. this.n8 = (this.getChild("n8"));
  13601. this.n11 = (this.getChild("n11"));
  13602. this.t0 = this.getTransition("t0");
  13603. }
  13604. }
  13605. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13606. class ui_dh_zs1_1 extends fgui.GComponent {
  13607. static createInstance() {
  13608. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13609. }
  13610. onConstruct() {
  13611. this.n3 = (this.getChild("n3"));
  13612. this.n1 = (this.getChild("n1"));
  13613. this.t0 = this.getTransition("t0");
  13614. }
  13615. }
  13616. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13617. class ui_hb_zs2 extends fgui.GButton {
  13618. static createInstance() {
  13619. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13620. }
  13621. onConstruct() {
  13622. this.n20 = (this.getChild("n20"));
  13623. this.n21 = (this.getChild("n21"));
  13624. this.n26 = (this.getChild("n26"));
  13625. this.n27 = (this.getChild("n27"));
  13626. this.n32 = (this.getChild("n32"));
  13627. this.n38 = (this.getChild("n38"));
  13628. this.n39 = (this.getChild("n39"));
  13629. this.n44 = (this.getChild("n44"));
  13630. this.diamondTxt = (this.getChild("diamondTxt"));
  13631. this.n41 = (this.getChild("n41"));
  13632. this.n45 = (this.getChild("n45"));
  13633. this.t0 = this.getTransition("t0");
  13634. }
  13635. }
  13636. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13637. class ui_hb_zs3 extends fgui.GButton {
  13638. static createInstance() {
  13639. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13640. }
  13641. onConstruct() {
  13642. this.n20 = (this.getChild("n20"));
  13643. this.n21 = (this.getChild("n21"));
  13644. this.n26 = (this.getChild("n26"));
  13645. this.n27 = (this.getChild("n27"));
  13646. this.n32 = (this.getChild("n32"));
  13647. this.n38 = (this.getChild("n38"));
  13648. this.n47 = (this.getChild("n47"));
  13649. this.t0 = this.getTransition("t0");
  13650. }
  13651. }
  13652. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13653. class ui_dh_zs2 extends fgui.GComponent {
  13654. static createInstance() {
  13655. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13656. }
  13657. onConstruct() {
  13658. this.n10 = (this.getChild("n10"));
  13659. this.n9 = (this.getChild("n9"));
  13660. this.n1 = (this.getChild("n1"));
  13661. this.n2 = (this.getChild("n2"));
  13662. this.n3 = (this.getChild("n3"));
  13663. this.n4 = (this.getChild("n4"));
  13664. this.n5 = (this.getChild("n5"));
  13665. this.n6 = (this.getChild("n6"));
  13666. this.n8 = (this.getChild("n8"));
  13667. this.n11 = (this.getChild("n11"));
  13668. this.t0 = this.getTransition("t0");
  13669. }
  13670. }
  13671. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13672. class ui_dh_zs2_1 extends fgui.GComponent {
  13673. static createInstance() {
  13674. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13675. }
  13676. onConstruct() {
  13677. this.n3 = (this.getChild("n3"));
  13678. this.n1 = (this.getChild("n1"));
  13679. this.t0 = this.getTransition("t0");
  13680. }
  13681. }
  13682. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13683. class ui_dh_zs3 extends fgui.GComponent {
  13684. static createInstance() {
  13685. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13686. }
  13687. onConstruct() {
  13688. this.n10 = (this.getChild("n10"));
  13689. this.n9 = (this.getChild("n9"));
  13690. this.n1 = (this.getChild("n1"));
  13691. this.n2 = (this.getChild("n2"));
  13692. this.n3 = (this.getChild("n3"));
  13693. this.n4 = (this.getChild("n4"));
  13694. this.n5 = (this.getChild("n5"));
  13695. this.n6 = (this.getChild("n6"));
  13696. this.n8 = (this.getChild("n8"));
  13697. this.n11 = (this.getChild("n11"));
  13698. this.t0 = this.getTransition("t0");
  13699. }
  13700. }
  13701. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13702. class ui_dh_zs3_1 extends fgui.GComponent {
  13703. static createInstance() {
  13704. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13705. }
  13706. onConstruct() {
  13707. this.n3 = (this.getChild("n3"));
  13708. this.n1 = (this.getChild("n1"));
  13709. this.t0 = this.getTransition("t0");
  13710. }
  13711. }
  13712. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13713. class ui_Component107 extends fgui.GComponent {
  13714. static createInstance() {
  13715. return (fgui.UIPackage.createObject("game", "Component107"));
  13716. }
  13717. onConstruct() {
  13718. this.n18 = (this.getChild("n18"));
  13719. this.n19 = (this.getChild("n19"));
  13720. this.n20 = (this.getChild("n20"));
  13721. this.n21 = (this.getChild("n21"));
  13722. this.n22 = (this.getChild("n22"));
  13723. this.levelTxt = (this.getChild("levelTxt"));
  13724. this.t0 = this.getTransition("t0");
  13725. }
  13726. }
  13727. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13728. class ui_box_com1 extends fgui.GComponent {
  13729. static createInstance() {
  13730. return (fgui.UIPackage.createObject("game", "box_com1"));
  13731. }
  13732. onConstruct() {
  13733. this.n14 = (this.getChild("n14"));
  13734. this.n6 = (this.getChild("n6"));
  13735. this.t0 = this.getTransition("t0");
  13736. }
  13737. }
  13738. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13739. class ui_box_com2 extends fgui.GProgressBar {
  13740. static createInstance() {
  13741. return (fgui.UIPackage.createObject("game", "box_com2"));
  13742. }
  13743. onConstruct() {
  13744. this.bg0 = (this.getChild("bg0"));
  13745. this.bg = (this.getChild("bg"));
  13746. this.bar = (this.getChild("bar"));
  13747. this.n7 = (this.getChild("n7"));
  13748. this.n8 = (this.getChild("n8"));
  13749. this.n10 = (this.getChild("n10"));
  13750. this.n11 = (this.getChild("n11"));
  13751. this.n12 = (this.getChild("n12"));
  13752. }
  13753. }
  13754. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13755. class ui_box_com4 extends fgui.GComponent {
  13756. static createInstance() {
  13757. return (fgui.UIPackage.createObject("game", "box_com4"));
  13758. }
  13759. onConstruct() {
  13760. this.n8 = (this.getChild("n8"));
  13761. this.t0 = this.getTransition("t0");
  13762. }
  13763. }
  13764. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13765. class ui_box_com3 extends fgui.GComponent {
  13766. static createInstance() {
  13767. return (fgui.UIPackage.createObject("game", "box_com3"));
  13768. }
  13769. onConstruct() {
  13770. this.n2 = (this.getChild("n2"));
  13771. this.n3 = (this.getChild("n3"));
  13772. this.n4 = (this.getChild("n4"));
  13773. this.n5 = (this.getChild("n5"));
  13774. this.t0 = this.getTransition("t0");
  13775. this.t1 = this.getTransition("t1");
  13776. }
  13777. }
  13778. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13779. class ui_Component97 extends fgui.GComponent {
  13780. static createInstance() {
  13781. return (fgui.UIPackage.createObject("game", "Component97"));
  13782. }
  13783. onConstruct() {
  13784. this.c1 = this.getController("c1");
  13785. this.n46 = (this.getChild("n46"));
  13786. this.diamondNode = (this.getChild("diamondNode"));
  13787. this.coinNode = (this.getChild("coinNode"));
  13788. this.t0 = this.getTransition("t0");
  13789. }
  13790. }
  13791. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13792. class ui_Component98 extends fgui.GButton {
  13793. static createInstance() {
  13794. return (fgui.UIPackage.createObject("game", "Component98"));
  13795. }
  13796. onConstruct() {
  13797. this.n8 = (this.getChild("n8"));
  13798. this.n40 = (this.getChild("n40"));
  13799. }
  13800. }
  13801. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13802. class ui_Component28_11 extends fgui.GButton {
  13803. static createInstance() {
  13804. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13805. }
  13806. onConstruct() {
  13807. this.c1 = this.getController("c1");
  13808. this.n12 = (this.getChild("n12"));
  13809. this.n17 = (this.getChild("n17"));
  13810. this.n13 = (this.getChild("n13"));
  13811. this.diamondTxt = (this.getChild("diamondTxt"));
  13812. this.n15 = (this.getChild("n15"));
  13813. this.n16 = (this.getChild("n16"));
  13814. }
  13815. }
  13816. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13817. class ui_Component58_11 extends fgui.GComponent {
  13818. static createInstance() {
  13819. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13820. }
  13821. onConstruct() {
  13822. this.c1 = this.getController("c1");
  13823. this.n23 = (this.getChild("n23"));
  13824. this.n41 = (this.getChild("n41"));
  13825. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13826. this.n_daoju = (this.getChild("n_daoju"));
  13827. this.myList = (this.getChild("myList"));
  13828. this.djList = (this.getChild("djList"));
  13829. this.t0 = this.getTransition("t0");
  13830. }
  13831. }
  13832. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13833. class ui_Component100 extends fgui.GComponent {
  13834. static createInstance() {
  13835. return (fgui.UIPackage.createObject("game", "Component100"));
  13836. }
  13837. onConstruct() {
  13838. this.c1 = this.getController("c1");
  13839. this.n75 = (this.getChild("n75"));
  13840. this.n76 = (this.getChild("n76"));
  13841. this.n80 = (this.getChild("n80"));
  13842. this.txt = (this.getChild("txt"));
  13843. this.spineRoot = (this.getChild("spineRoot"));
  13844. }
  13845. }
  13846. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13847. class ui_Component101 extends fgui.GComponent {
  13848. static createInstance() {
  13849. return (fgui.UIPackage.createObject("game", "Component101"));
  13850. }
  13851. onConstruct() {
  13852. this.c1 = this.getController("c1");
  13853. this.n36 = (this.getChild("n36"));
  13854. this.n35 = (this.getChild("n35"));
  13855. this.n33 = (this.getChild("n33"));
  13856. this.n34 = (this.getChild("n34"));
  13857. }
  13858. }
  13859. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13860. class ui_Component53 extends fgui.GComponent {
  13861. static createInstance() {
  13862. return (fgui.UIPackage.createObject("game", "Component53"));
  13863. }
  13864. onConstruct() {
  13865. this.n0 = (this.getChild("n0"));
  13866. this.n1 = (this.getChild("n1"));
  13867. this.n2 = (this.getChild("n2"));
  13868. this.n3 = (this.getChild("n3"));
  13869. this.n4 = (this.getChild("n4"));
  13870. this.n5 = (this.getChild("n5"));
  13871. this.n6 = (this.getChild("n6"));
  13872. this.n7 = (this.getChild("n7"));
  13873. this.n8 = (this.getChild("n8"));
  13874. this.n9 = (this.getChild("n9"));
  13875. this.n10 = (this.getChild("n10"));
  13876. this.n11 = (this.getChild("n11"));
  13877. this.n12 = (this.getChild("n12"));
  13878. this.n13 = (this.getChild("n13"));
  13879. this.n14 = (this.getChild("n14"));
  13880. this.n15 = (this.getChild("n15"));
  13881. this.n16 = (this.getChild("n16"));
  13882. this.n19 = (this.getChild("n19"));
  13883. this.n20 = (this.getChild("n20"));
  13884. this.n21 = (this.getChild("n21"));
  13885. this.n22 = (this.getChild("n22"));
  13886. this.n23 = (this.getChild("n23"));
  13887. this.n24 = (this.getChild("n24"));
  13888. this.n25 = (this.getChild("n25"));
  13889. this.n26 = (this.getChild("n26"));
  13890. this.n27 = (this.getChild("n27"));
  13891. this.n28 = (this.getChild("n28"));
  13892. this.n29 = (this.getChild("n29"));
  13893. this.n30 = (this.getChild("n30"));
  13894. this.n31 = (this.getChild("n31"));
  13895. this.n32 = (this.getChild("n32"));
  13896. this.n33 = (this.getChild("n33"));
  13897. this.n34 = (this.getChild("n34"));
  13898. this.n35 = (this.getChild("n35"));
  13899. this.t0 = this.getTransition("t0");
  13900. }
  13901. }
  13902. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13903. class ui_Component58 extends fgui.GComponent {
  13904. static createInstance() {
  13905. return (fgui.UIPackage.createObject("game", "Component58"));
  13906. }
  13907. onConstruct() {
  13908. this.n23 = (this.getChild("n23"));
  13909. this.n41 = (this.getChild("n41"));
  13910. this.n8 = (this.getChild("n8"));
  13911. this.skillList = (this.getChild("skillList"));
  13912. this.t0 = this.getTransition("t0");
  13913. }
  13914. }
  13915. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13916. class ui_Component59 extends fgui.GComponent {
  13917. static createInstance() {
  13918. return (fgui.UIPackage.createObject("game", "Component59"));
  13919. }
  13920. onConstruct() {
  13921. this.n3 = (this.getChild("n3"));
  13922. this.msgTxt = (this.getChild("msgTxt"));
  13923. this.t0 = this.getTransition("t0");
  13924. }
  13925. }
  13926. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13927. class ui_RulerNode extends fgui.GComponent {
  13928. static createInstance() {
  13929. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13930. }
  13931. onConstruct() {
  13932. this.n6 = (this.getChild("n6"));
  13933. this.n4 = (this.getChild("n4"));
  13934. this.img1 = (this.getChild("img1"));
  13935. this.img2 = (this.getChild("img2"));
  13936. }
  13937. }
  13938. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13939. class ui_Component108 extends fgui.GComponent {
  13940. static createInstance() {
  13941. return (fgui.UIPackage.createObject("game", "Component108"));
  13942. }
  13943. onConstruct() {
  13944. this.n19 = (this.getChild("n19"));
  13945. this.t0 = this.getTransition("t0");
  13946. }
  13947. }
  13948. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13949. class ui_Component63 extends fgui.GComponent {
  13950. static createInstance() {
  13951. return (fgui.UIPackage.createObject("game", "Component63"));
  13952. }
  13953. onConstruct() {
  13954. this.n66 = (this.getChild("n66"));
  13955. this.n56 = (this.getChild("n56"));
  13956. this.n63 = (this.getChild("n63"));
  13957. this.n65 = (this.getChild("n65"));
  13958. this.t0 = this.getTransition("t0");
  13959. }
  13960. }
  13961. ui_Component63.URL = "ui://isxx5ak7h657452";
  13962. class ui_topNode extends fgui.GComponent {
  13963. static createInstance() {
  13964. return (fgui.UIPackage.createObject("game", "topNode"));
  13965. }
  13966. onConstruct() {
  13967. this.selfProgress = (this.getChild("selfProgress"));
  13968. this.aiProgress = (this.getChild("aiProgress"));
  13969. this.selfKuang = (this.getChild("selfKuang"));
  13970. this.aiKuang = (this.getChild("aiKuang"));
  13971. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13972. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13973. this.n33 = (this.getChild("n33"));
  13974. this.n34 = (this.getChild("n34"));
  13975. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13976. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13977. this.selfBallList = (this.getChild("selfBallList"));
  13978. this.aiBallList = (this.getChild("aiBallList"));
  13979. this.middleNode = (this.getChild("middleNode"));
  13980. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13981. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13982. this.scoreNode = (this.getChild("scoreNode"));
  13983. this.selfTips = (this.getChild("selfTips"));
  13984. this.aiTips = (this.getChild("aiTips"));
  13985. }
  13986. }
  13987. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13988. class ui_selfProgress extends fgui.GProgressBar {
  13989. static createInstance() {
  13990. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13991. }
  13992. onConstruct() {
  13993. this.n3 = (this.getChild("n3"));
  13994. this.bar = (this.getChild("bar"));
  13995. }
  13996. }
  13997. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13998. class ui_aiProgress extends fgui.GProgressBar {
  13999. static createInstance() {
  14000. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14001. }
  14002. onConstruct() {
  14003. this.n3 = (this.getChild("n3"));
  14004. this.bar = (this.getChild("bar"));
  14005. }
  14006. }
  14007. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14008. class ui_ballDisplay extends fgui.GComponent {
  14009. static createInstance() {
  14010. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14011. }
  14012. onConstruct() {
  14013. this.myImg = (this.getChild("myImg"));
  14014. }
  14015. }
  14016. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14017. class ui_moveNode extends fgui.GComponent {
  14018. static createInstance() {
  14019. return (fgui.UIPackage.createObject("game", "moveNode"));
  14020. }
  14021. onConstruct() {
  14022. this.n8 = (this.getChild("n8"));
  14023. this.finger = (this.getChild("finger"));
  14024. }
  14025. }
  14026. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14027. class ui_cancelBtn extends fgui.GButton {
  14028. static createInstance() {
  14029. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14030. }
  14031. onConstruct() {
  14032. this.c1 = this.getController("c1");
  14033. this.n0 = (this.getChild("n0"));
  14034. this.n1 = (this.getChild("n1"));
  14035. }
  14036. }
  14037. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14038. class ui_shareBtn extends fgui.GButton {
  14039. static createInstance() {
  14040. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14041. }
  14042. onConstruct() {
  14043. this.c1 = this.getController("c1");
  14044. this.n2 = (this.getChild("n2"));
  14045. this.n1 = (this.getChild("n1"));
  14046. this.n3 = (this.getChild("n3"));
  14047. this.n4 = (this.getChild("n4"));
  14048. this.n5 = (this.getChild("n5"));
  14049. this.n6 = (this.getChild("n6"));
  14050. }
  14051. }
  14052. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14053. class ui_share2Btn extends fgui.GButton {
  14054. static createInstance() {
  14055. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14056. }
  14057. onConstruct() {
  14058. this.n3 = (this.getChild("n3"));
  14059. }
  14060. }
  14061. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14062. class ui_rodMethodNode extends fgui.GComponent {
  14063. static createInstance() {
  14064. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14065. }
  14066. onConstruct() {
  14067. this.bg = (this.getChild("bg"));
  14068. this.dot = (this.getChild("dot"));
  14069. }
  14070. }
  14071. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14072. class ui_sureBtn extends fgui.GButton {
  14073. static createInstance() {
  14074. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14075. }
  14076. onConstruct() {
  14077. this.n2 = (this.getChild("n2"));
  14078. this.n1 = (this.getChild("n1"));
  14079. }
  14080. }
  14081. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14082. class ui_Component18 extends fgui.GComponent {
  14083. static createInstance() {
  14084. return (fgui.UIPackage.createObject("game", "Component18"));
  14085. }
  14086. onConstruct() {
  14087. this.c1 = this.getController("c1");
  14088. this.nameTxt = (this.getChild("nameTxt"));
  14089. this.headImg = (this.getChild("headImg"));
  14090. this.n24 = (this.getChild("n24"));
  14091. this.skillImg = (this.getChild("skillImg"));
  14092. this.skillTxt = (this.getChild("skillTxt"));
  14093. }
  14094. }
  14095. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14096. class ui_Component45 extends fgui.GComponent {
  14097. static createInstance() {
  14098. return (fgui.UIPackage.createObject("game", "Component45"));
  14099. }
  14100. onConstruct() {
  14101. this.c1 = this.getController("c1");
  14102. this.n40 = (this.getChild("n40"));
  14103. this.n41 = (this.getChild("n41"));
  14104. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14105. this.n42 = (this.getChild("n42"));
  14106. this.awardTxt = (this.getChild("awardTxt"));
  14107. this.n44 = (this.getChild("n44"));
  14108. this.t0 = this.getTransition("t0");
  14109. }
  14110. }
  14111. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14112. class ui_emotionDisplay extends fgui.GButton {
  14113. static createInstance() {
  14114. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14115. }
  14116. onConstruct() {
  14117. this.myIcon = (this.getChild("myIcon"));
  14118. }
  14119. }
  14120. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14121. class ui_Component49 extends fgui.GButton {
  14122. static createInstance() {
  14123. return (fgui.UIPackage.createObject("game", "Component49"));
  14124. }
  14125. onConstruct() {
  14126. this.n69 = (this.getChild("n69"));
  14127. this.n56 = (this.getChild("n56"));
  14128. }
  14129. }
  14130. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14131. class ui_Component50 extends fgui.GButton {
  14132. static createInstance() {
  14133. return (fgui.UIPackage.createObject("game", "Component50"));
  14134. }
  14135. onConstruct() {
  14136. this.n54 = (this.getChild("n54"));
  14137. this.n65 = (this.getChild("n65"));
  14138. }
  14139. }
  14140. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14141. class ui_Component51 extends fgui.GButton {
  14142. static createInstance() {
  14143. return (fgui.UIPackage.createObject("game", "Component51"));
  14144. }
  14145. onConstruct() {
  14146. this.c1 = this.getController("c1");
  14147. this.n51 = (this.getChild("n51"));
  14148. this.n54 = (this.getChild("n54"));
  14149. }
  14150. }
  14151. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14152. class ui_Button5 extends fgui.GButton {
  14153. static createInstance() {
  14154. return (fgui.UIPackage.createObject("game", "Button5"));
  14155. }
  14156. onConstruct() {
  14157. this.c1 = this.getController("c1");
  14158. this.n0 = (this.getChild("n0"));
  14159. this.n2 = (this.getChild("n2"));
  14160. }
  14161. }
  14162. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14163. class ui_Component124 extends fgui.GComponent {
  14164. static createInstance() {
  14165. return (fgui.UIPackage.createObject("game", "Component124"));
  14166. }
  14167. onConstruct() {
  14168. this.n22 = (this.getChild("n22"));
  14169. this.shareNode = (this.getChild("shareNode"));
  14170. }
  14171. }
  14172. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14173. class ui_Component125 extends fgui.GComponent {
  14174. static createInstance() {
  14175. return (fgui.UIPackage.createObject("game", "Component125"));
  14176. }
  14177. onConstruct() {
  14178. this.n29 = (this.getChild("n29"));
  14179. this.coinTxt = (this.getChild("coinTxt"));
  14180. }
  14181. }
  14182. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14183. class ui_Component52 extends fgui.GButton {
  14184. static createInstance() {
  14185. return (fgui.UIPackage.createObject("game", "Component52"));
  14186. }
  14187. onConstruct() {
  14188. this.n35 = (this.getChild("n35"));
  14189. this.n36 = (this.getChild("n36"));
  14190. }
  14191. }
  14192. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14193. class ui_Component_denglu extends fgui.GComponent {
  14194. static createInstance() {
  14195. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14196. }
  14197. onConstruct() {
  14198. this.c1 = this.getController("c1");
  14199. this.n102 = (this.getChild("n102"));
  14200. this.n103 = (this.getChild("n103"));
  14201. }
  14202. }
  14203. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14204. class ui_Component_fl_1 extends fgui.GComponent {
  14205. static createInstance() {
  14206. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14207. }
  14208. onConstruct() {
  14209. this.n0 = (this.getChild("n0"));
  14210. this.n6 = (this.getChild("n6"));
  14211. this.n7 = (this.getChild("n7"));
  14212. this.n8 = (this.getChild("n8"));
  14213. this.n5 = (this.getChild("n5"));
  14214. this.n9 = (this.getChild("n9"));
  14215. this.n10 = (this.getChild("n10"));
  14216. this.txt_price = (this.getChild("txt_price"));
  14217. this.n_no = (this.getChild("n_no"));
  14218. this.n_buy = (this.getChild("n_buy"));
  14219. }
  14220. }
  14221. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14222. class ui_Component_fl_2 extends fgui.GComponent {
  14223. static createInstance() {
  14224. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14225. }
  14226. onConstruct() {
  14227. this.n0 = (this.getChild("n0"));
  14228. this.txt_price = (this.getChild("txt_price"));
  14229. this.n4 = (this.getChild("n4"));
  14230. this.n6 = (this.getChild("n6"));
  14231. this.n7 = (this.getChild("n7"));
  14232. this.n5 = (this.getChild("n5"));
  14233. this.n8 = (this.getChild("n8"));
  14234. this.n9 = (this.getChild("n9"));
  14235. this.n_no = (this.getChild("n_no"));
  14236. this.n_buy = (this.getChild("n_buy"));
  14237. }
  14238. }
  14239. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14240. class ui_drawBtn extends fgui.GButton {
  14241. static createInstance() {
  14242. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14243. }
  14244. onConstruct() {
  14245. this.c1 = this.getController("c1");
  14246. this.n2 = (this.getChild("n2"));
  14247. this.n1 = (this.getChild("n1"));
  14248. this.n5 = (this.getChild("n5"));
  14249. }
  14250. }
  14251. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14252. class ui_Component43 extends fgui.GButton {
  14253. static createInstance() {
  14254. return (fgui.UIPackage.createObject("game", "Component43"));
  14255. }
  14256. onConstruct() {
  14257. this.n49 = (this.getChild("n49"));
  14258. }
  14259. }
  14260. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14261. class ui_wordsDisplay extends fgui.GComponent {
  14262. static createInstance() {
  14263. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14264. }
  14265. onConstruct() {
  14266. this.txt = (this.getChild("txt"));
  14267. this.n63 = (this.getChild("n63"));
  14268. }
  14269. }
  14270. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14271. class ui_Component_phb extends fgui.GComponent {
  14272. static createInstance() {
  14273. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14274. }
  14275. onConstruct() {
  14276. this.n3 = (this.getChild("n3"));
  14277. this.n4 = (this.getChild("n4"));
  14278. }
  14279. }
  14280. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14281. class ui_Component3 extends fgui.GComponent {
  14282. static createInstance() {
  14283. return (fgui.UIPackage.createObject("game", "Component3"));
  14284. }
  14285. onConstruct() {
  14286. this.n26 = (this.getChild("n26"));
  14287. this.n24 = (this.getChild("n24"));
  14288. this.nameTxt = (this.getChild("nameTxt"));
  14289. this.headRoot = (this.getChild("headRoot"));
  14290. }
  14291. }
  14292. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14293. class ui_Component4 extends fgui.GComponent {
  14294. static createInstance() {
  14295. return (fgui.UIPackage.createObject("game", "Component4"));
  14296. }
  14297. onConstruct() {
  14298. this.headImg = (this.getChild("headImg"));
  14299. }
  14300. }
  14301. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14302. class ui_Component7 extends fgui.GButton {
  14303. static createInstance() {
  14304. return (fgui.UIPackage.createObject("game", "Component7"));
  14305. }
  14306. onConstruct() {
  14307. this.n17 = (this.getChild("n17"));
  14308. }
  14309. }
  14310. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14311. class ui_Component8 extends fgui.GButton {
  14312. static createInstance() {
  14313. return (fgui.UIPackage.createObject("game", "Component8"));
  14314. }
  14315. onConstruct() {
  14316. this.n19 = (this.getChild("n19"));
  14317. }
  14318. }
  14319. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14320. class ui_Component10 extends fgui.GButton {
  14321. static createInstance() {
  14322. return (fgui.UIPackage.createObject("game", "Component10"));
  14323. }
  14324. onConstruct() {
  14325. this.c1 = this.getController("c1");
  14326. this.n40 = (this.getChild("n40"));
  14327. }
  14328. }
  14329. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14330. class ui_Component11 extends fgui.GButton {
  14331. static createInstance() {
  14332. return (fgui.UIPackage.createObject("game", "Component11"));
  14333. }
  14334. onConstruct() {
  14335. this.n34 = (this.getChild("n34"));
  14336. }
  14337. }
  14338. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14339. class ui_Component12 extends fgui.GButton {
  14340. static createInstance() {
  14341. return (fgui.UIPackage.createObject("game", "Component12"));
  14342. }
  14343. onConstruct() {
  14344. this.n35 = (this.getChild("n35"));
  14345. }
  14346. }
  14347. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14348. class ui_Component13 extends fgui.GButton {
  14349. static createInstance() {
  14350. return (fgui.UIPackage.createObject("game", "Component13"));
  14351. }
  14352. onConstruct() {
  14353. this.n27 = (this.getChild("n27"));
  14354. this.n36 = (this.getChild("n36"));
  14355. }
  14356. }
  14357. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14358. class ui_dh_js_tuowei extends fgui.GComponent {
  14359. static createInstance() {
  14360. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14361. }
  14362. onConstruct() {
  14363. this.n19 = (this.getChild("n19"));
  14364. this.n18 = (this.getChild("n18"));
  14365. this.n0 = (this.getChild("n0"));
  14366. this.n3 = (this.getChild("n3"));
  14367. this.n4 = (this.getChild("n4"));
  14368. this.n5 = (this.getChild("n5"));
  14369. this.n6 = (this.getChild("n6"));
  14370. this.n8 = (this.getChild("n8"));
  14371. this.n9 = (this.getChild("n9"));
  14372. this.n10 = (this.getChild("n10"));
  14373. this.n11 = (this.getChild("n11"));
  14374. this.n12 = (this.getChild("n12"));
  14375. this.n13 = (this.getChild("n13"));
  14376. this.n14 = (this.getChild("n14"));
  14377. this.n15 = (this.getChild("n15"));
  14378. this.n20 = (this.getChild("n20"));
  14379. this.t0 = this.getTransition("t0");
  14380. this.t1 = this.getTransition("t1");
  14381. }
  14382. }
  14383. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14384. class ui_dh_js_tw_g extends fgui.GComponent {
  14385. static createInstance() {
  14386. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14387. }
  14388. onConstruct() {
  14389. this.n0 = (this.getChild("n0"));
  14390. this.n1 = (this.getChild("n1"));
  14391. this.t0 = this.getTransition("t0");
  14392. }
  14393. }
  14394. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14395. class ui_dh_js_xingxing extends fgui.GComponent {
  14396. static createInstance() {
  14397. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14398. }
  14399. onConstruct() {
  14400. this.n1 = (this.getChild("n1"));
  14401. this.n2 = (this.getChild("n2"));
  14402. this.n3 = (this.getChild("n3"));
  14403. this.n4 = (this.getChild("n4"));
  14404. this.n0 = (this.getChild("n0"));
  14405. this.t2 = this.getTransition("t2");
  14406. this.t1 = this.getTransition("t1");
  14407. }
  14408. }
  14409. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14410. class ui_dh_zy_jiazai extends fgui.GComponent {
  14411. static createInstance() {
  14412. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14413. }
  14414. onConstruct() {
  14415. this.c1 = this.getController("c1");
  14416. this.n0 = (this.getChild("n0"));
  14417. this.n1 = (this.getChild("n1"));
  14418. this.n2 = (this.getChild("n2"));
  14419. this.n4 = (this.getChild("n4"));
  14420. this.n5 = (this.getChild("n5"));
  14421. this.n6 = (this.getChild("n6"));
  14422. this.n8 = (this.getChild("n8"));
  14423. this.n7 = (this.getChild("n7"));
  14424. this.t0 = this.getTransition("t0");
  14425. }
  14426. }
  14427. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14428. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14429. static createInstance() {
  14430. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14431. }
  14432. onConstruct() {
  14433. this.c1 = this.getController("c1");
  14434. this.n3 = (this.getChild("n3"));
  14435. this.n5 = (this.getChild("n5"));
  14436. this.n4 = (this.getChild("n4"));
  14437. this.n0 = (this.getChild("n0"));
  14438. this.n1 = (this.getChild("n1"));
  14439. this.n2 = (this.getChild("n2"));
  14440. }
  14441. }
  14442. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14443. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14444. static createInstance() {
  14445. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14446. }
  14447. onConstruct() {
  14448. this.n19 = (this.getChild("n19"));
  14449. this.n21 = (this.getChild("n21"));
  14450. this.n0 = (this.getChild("n0"));
  14451. this.n3 = (this.getChild("n3"));
  14452. this.n4 = (this.getChild("n4"));
  14453. this.n5 = (this.getChild("n5"));
  14454. this.n6 = (this.getChild("n6"));
  14455. this.n8 = (this.getChild("n8"));
  14456. this.n9 = (this.getChild("n9"));
  14457. this.n10 = (this.getChild("n10"));
  14458. this.n11 = (this.getChild("n11"));
  14459. this.n12 = (this.getChild("n12"));
  14460. this.n13 = (this.getChild("n13"));
  14461. this.n14 = (this.getChild("n14"));
  14462. this.n15 = (this.getChild("n15"));
  14463. this.n23 = (this.getChild("n23"));
  14464. this.t0 = this.getTransition("t0");
  14465. this.t1 = this.getTransition("t1");
  14466. }
  14467. }
  14468. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14469. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14470. static createInstance() {
  14471. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14472. }
  14473. onConstruct() {
  14474. this.n1 = (this.getChild("n1"));
  14475. this.n2 = (this.getChild("n2"));
  14476. this.t0 = this.getTransition("t0");
  14477. }
  14478. }
  14479. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14480. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14481. static createInstance() {
  14482. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14483. }
  14484. onConstruct() {
  14485. this.n4 = (this.getChild("n4"));
  14486. this.n2 = (this.getChild("n2"));
  14487. this.n3 = (this.getChild("n3"));
  14488. this.idle = this.getTransition("idle");
  14489. this.attack = this.getTransition("attack");
  14490. }
  14491. }
  14492. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14493. class ui_special extends fgui.GComponent {
  14494. static createInstance() {
  14495. return (fgui.UIPackage.createObject("game", "special"));
  14496. }
  14497. onConstruct() {
  14498. this.n18 = (this.getChild("n18"));
  14499. this.n19 = (this.getChild("n19"));
  14500. this.n20 = (this.getChild("n20"));
  14501. this.n21 = (this.getChild("n21"));
  14502. this.n22 = (this.getChild("n22"));
  14503. this.levelTxt = (this.getChild("levelTxt"));
  14504. this.n24 = (this.getChild("n24"));
  14505. this.n25 = (this.getChild("n25"));
  14506. this.t0 = this.getTransition("t0");
  14507. }
  14508. }
  14509. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14510. class ui_Component145 extends fgui.GComponent {
  14511. static createInstance() {
  14512. return (fgui.UIPackage.createObject("game", "Component145"));
  14513. }
  14514. onConstruct() {
  14515. this.guanyuNode = (this.getChild("guanyuNode"));
  14516. }
  14517. }
  14518. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14519. class ui_longBtn extends fgui.GButton {
  14520. static createInstance() {
  14521. return (fgui.UIPackage.createObject("game", "longBtn"));
  14522. }
  14523. onConstruct() {
  14524. this.c1 = this.getController("c1");
  14525. this.n2 = (this.getChild("n2"));
  14526. this.n1 = (this.getChild("n1"));
  14527. this.n4 = (this.getChild("n4"));
  14528. }
  14529. }
  14530. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14531. class ui_Component146 extends fgui.GComponent {
  14532. static createInstance() {
  14533. return (fgui.UIPackage.createObject("game", "Component146"));
  14534. }
  14535. onConstruct() {
  14536. this.n89 = (this.getChild("n89"));
  14537. this.n90 = (this.getChild("n90"));
  14538. this.guideBtn = (this.getChild("guideBtn"));
  14539. }
  14540. }
  14541. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14542. class ui_Component146_11 extends fgui.GComponent {
  14543. static createInstance() {
  14544. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14545. }
  14546. onConstruct() {
  14547. this.n89 = (this.getChild("n89"));
  14548. this.n90 = (this.getChild("n90"));
  14549. this.guideBtn = (this.getChild("guideBtn"));
  14550. }
  14551. }
  14552. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14553. class ui_Component111_1 extends fgui.GComponent {
  14554. static createInstance() {
  14555. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14556. }
  14557. onConstruct() {
  14558. this.n68 = (this.getChild("n68"));
  14559. this.myMask = (this.getChild("myMask"));
  14560. }
  14561. }
  14562. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14563. class ui_Component64_1 extends fgui.GComponent {
  14564. static createInstance() {
  14565. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14566. }
  14567. onConstruct() {
  14568. this.n57 = (this.getChild("n57"));
  14569. this.n54 = (this.getChild("n54"));
  14570. this.n55 = (this.getChild("n55"));
  14571. this.n56 = (this.getChild("n56"));
  14572. this.t1 = this.getTransition("t1");
  14573. }
  14574. }
  14575. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14576. class ui_ModeSelection_com123 extends fgui.GComponent {
  14577. static createInstance() {
  14578. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14579. }
  14580. onConstruct() {
  14581. this.type1 = (this.getChild("type1"));
  14582. this.type2 = (this.getChild("type2"));
  14583. this.type3 = (this.getChild("type3"));
  14584. this.n38 = (this.getChild("n38"));
  14585. this.t0 = this.getTransition("t0");
  14586. }
  14587. }
  14588. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14589. class ui_Component132_2 extends fgui.GComponent {
  14590. static createInstance() {
  14591. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14592. }
  14593. onConstruct() {
  14594. this.n25 = (this.getChild("n25"));
  14595. this.n26 = (this.getChild("n26"));
  14596. this.n27 = (this.getChild("n27"));
  14597. this.t0 = this.getTransition("t0");
  14598. }
  14599. }
  14600. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14601. class ui_UIPower$1 extends fgui.GComponent {
  14602. static createInstance() {
  14603. return (fgui.UIPackage.createObject("game", "UIPower"));
  14604. }
  14605. onConstruct() {
  14606. this.n11 = (this.getChild("n11"));
  14607. this.myNode = (this.getChild("myNode"));
  14608. this.t0 = this.getTransition("t0");
  14609. }
  14610. }
  14611. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14612. class ui_Component133 extends fgui.GComponent {
  14613. static createInstance() {
  14614. return (fgui.UIPackage.createObject("game", "Component133"));
  14615. }
  14616. onConstruct() {
  14617. this.n29 = (this.getChild("n29"));
  14618. this.n30 = (this.getChild("n30"));
  14619. }
  14620. }
  14621. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14622. class ui_Component134 extends fgui.GComponent {
  14623. static createInstance() {
  14624. return (fgui.UIPackage.createObject("game", "Component134"));
  14625. }
  14626. onConstruct() {
  14627. this.n30 = (this.getChild("n30"));
  14628. this.n31 = (this.getChild("n31"));
  14629. this.t0 = this.getTransition("t0");
  14630. }
  14631. }
  14632. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14633. class ui_Component135 extends fgui.GComponent {
  14634. static createInstance() {
  14635. return (fgui.UIPackage.createObject("game", "Component135"));
  14636. }
  14637. onConstruct() {
  14638. this.n30 = (this.getChild("n30"));
  14639. this.t0 = this.getTransition("t0");
  14640. }
  14641. }
  14642. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14643. class ui_Component137 extends fgui.GComponent {
  14644. static createInstance() {
  14645. return (fgui.UIPackage.createObject("game", "Component137"));
  14646. }
  14647. onConstruct() {
  14648. this.n28 = (this.getChild("n28"));
  14649. this.n29 = (this.getChild("n29"));
  14650. this.n30 = (this.getChild("n30"));
  14651. this.n32 = (this.getChild("n32"));
  14652. }
  14653. }
  14654. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14655. class ui_dh_zuanshi extends fgui.GButton {
  14656. static createInstance() {
  14657. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14658. }
  14659. onConstruct() {
  14660. this.n1 = (this.getChild("n1"));
  14661. this.n2 = (this.getChild("n2"));
  14662. this.n0 = (this.getChild("n0"));
  14663. this.n3 = (this.getChild("n3"));
  14664. this.n4 = (this.getChild("n4"));
  14665. }
  14666. }
  14667. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14668. class ui_Component138 extends fgui.GComponent {
  14669. static createInstance() {
  14670. return (fgui.UIPackage.createObject("game", "Component138"));
  14671. }
  14672. onConstruct() {
  14673. this.n1 = (this.getChild("n1"));
  14674. this.n2 = (this.getChild("n2"));
  14675. this.t0 = this.getTransition("t0");
  14676. }
  14677. }
  14678. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14679. class ui_Component139 extends fgui.GComponent {
  14680. static createInstance() {
  14681. return (fgui.UIPackage.createObject("game", "Component139"));
  14682. }
  14683. onConstruct() {
  14684. this.n0 = (this.getChild("n0"));
  14685. this.t0 = this.getTransition("t0");
  14686. }
  14687. }
  14688. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14689. class ui_Component140 extends fgui.GComponent {
  14690. static createInstance() {
  14691. return (fgui.UIPackage.createObject("game", "Component140"));
  14692. }
  14693. onConstruct() {
  14694. this.n2 = (this.getChild("n2"));
  14695. this.n3 = (this.getChild("n3"));
  14696. this.t0 = this.getTransition("t0");
  14697. }
  14698. }
  14699. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14700. class ui_Component141 extends fgui.GComponent {
  14701. static createInstance() {
  14702. return (fgui.UIPackage.createObject("game", "Component141"));
  14703. }
  14704. onConstruct() {
  14705. this.n0 = (this.getChild("n0"));
  14706. this.t0 = this.getTransition("t0");
  14707. }
  14708. }
  14709. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14710. class ui_powerNode extends fgui.GProgressBar {
  14711. static createInstance() {
  14712. return (fgui.UIPackage.createObject("game", "powerNode"));
  14713. }
  14714. onConstruct() {
  14715. this.n2 = (this.getChild("n2"));
  14716. this.bar_v = (this.getChild("bar_v"));
  14717. this.showImg = (this.getChild("showImg"));
  14718. this.n12 = (this.getChild("n12"));
  14719. }
  14720. }
  14721. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14722. class ui_dh_jingbi1 extends fgui.GComponent {
  14723. static createInstance() {
  14724. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14725. }
  14726. onConstruct() {
  14727. this.n0 = (this.getChild("n0"));
  14728. this.n1 = (this.getChild("n1"));
  14729. this.n2 = (this.getChild("n2"));
  14730. this.n3 = (this.getChild("n3"));
  14731. this.n4 = (this.getChild("n4"));
  14732. this.n5 = (this.getChild("n5"));
  14733. this.n6 = (this.getChild("n6"));
  14734. this.n8 = (this.getChild("n8"));
  14735. this.t0 = this.getTransition("t0");
  14736. }
  14737. }
  14738. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14739. class ui_Component94 extends fgui.GButton {
  14740. static createInstance() {
  14741. return (fgui.UIPackage.createObject("game", "Component94"));
  14742. }
  14743. onConstruct() {
  14744. this.n77 = (this.getChild("n77"));
  14745. }
  14746. }
  14747. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14748. class ui_Component95 extends fgui.GButton {
  14749. static createInstance() {
  14750. return (fgui.UIPackage.createObject("game", "Component95"));
  14751. }
  14752. onConstruct() {
  14753. this.n77 = (this.getChild("n77"));
  14754. }
  14755. }
  14756. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14757. class ui_Component126 extends fgui.GComponent {
  14758. static createInstance() {
  14759. return (fgui.UIPackage.createObject("game", "Component126"));
  14760. }
  14761. onConstruct() {
  14762. this.c1 = this.getController("c1");
  14763. this.normalBtn = (this.getChild("normalBtn"));
  14764. this.tripleBtn = (this.getChild("tripleBtn"));
  14765. }
  14766. }
  14767. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14768. class ui_Component60 extends fgui.GComponent {
  14769. static createInstance() {
  14770. return (fgui.UIPackage.createObject("game", "Component60"));
  14771. }
  14772. onConstruct() {
  14773. this.c1 = this.getController("c1");
  14774. this.n48 = (this.getChild("n48"));
  14775. this.womanTxt = (this.getChild("womanTxt"));
  14776. this.t0 = this.getTransition("t0");
  14777. }
  14778. }
  14779. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14780. class ui_Button_h extends fgui.GButton {
  14781. static createInstance() {
  14782. return (fgui.UIPackage.createObject("game", "Button_h"));
  14783. }
  14784. onConstruct() {
  14785. this.button = this.getController("button");
  14786. this.n0 = (this.getChild("n0"));
  14787. this.n1 = (this.getChild("n1"));
  14788. }
  14789. }
  14790. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14791. class ui_Button_lv extends fgui.GButton {
  14792. static createInstance() {
  14793. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14794. }
  14795. onConstruct() {
  14796. this.button = this.getController("button");
  14797. this.n0 = (this.getChild("n0"));
  14798. this.n1 = (this.getChild("n1"));
  14799. }
  14800. }
  14801. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14802. class ui_Component98_3 extends fgui.GButton {
  14803. static createInstance() {
  14804. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14805. }
  14806. onConstruct() {
  14807. this.c1 = this.getController("c1");
  14808. this.n8 = (this.getChild("n8"));
  14809. this.n41 = (this.getChild("n41"));
  14810. this.n40 = (this.getChild("n40"));
  14811. }
  14812. }
  14813. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14814. class ui_ModeSelection_com1 extends fgui.GButton {
  14815. static createInstance() {
  14816. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14817. }
  14818. onConstruct() {
  14819. this.n34 = (this.getChild("n34"));
  14820. this.n36 = (this.getChild("n36"));
  14821. this.n22 = (this.getChild("n22"));
  14822. this.n20 = (this.getChild("n20"));
  14823. this.n23 = (this.getChild("n23"));
  14824. this.n24 = (this.getChild("n24"));
  14825. this.n26 = (this.getChild("n26"));
  14826. this.n33 = (this.getChild("n33"));
  14827. this.coinImg = (this.getChild("coinImg"));
  14828. this.need = (this.getChild("need"));
  14829. this.n35 = (this.getChild("n35"));
  14830. this.n29 = (this.getChild("n29"));
  14831. this.tipsTxt = (this.getChild("tipsTxt"));
  14832. this.n30 = (this.getChild("n30"));
  14833. this.peopleTxt = (this.getChild("peopleTxt"));
  14834. this.t0 = this.getTransition("t0");
  14835. }
  14836. }
  14837. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14838. class ui_ModeSelection_com2 extends fgui.GButton {
  14839. static createInstance() {
  14840. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14841. }
  14842. onConstruct() {
  14843. this.n36 = (this.getChild("n36"));
  14844. this.n34 = (this.getChild("n34"));
  14845. this.n22 = (this.getChild("n22"));
  14846. this.n20 = (this.getChild("n20"));
  14847. this.n23 = (this.getChild("n23"));
  14848. this.n24 = (this.getChild("n24"));
  14849. this.n26 = (this.getChild("n26"));
  14850. this.n33 = (this.getChild("n33"));
  14851. this.coinImg = (this.getChild("coinImg"));
  14852. this.need = (this.getChild("need"));
  14853. this.n35 = (this.getChild("n35"));
  14854. this.n29 = (this.getChild("n29"));
  14855. this.tipsTxt = (this.getChild("tipsTxt"));
  14856. this.n30 = (this.getChild("n30"));
  14857. this.peopleTxt = (this.getChild("peopleTxt"));
  14858. this.t0 = this.getTransition("t0");
  14859. }
  14860. }
  14861. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14862. class ui_ModeSelection_com3 extends fgui.GButton {
  14863. static createInstance() {
  14864. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14865. }
  14866. onConstruct() {
  14867. this.n34 = (this.getChild("n34"));
  14868. this.n36 = (this.getChild("n36"));
  14869. this.n22 = (this.getChild("n22"));
  14870. this.n20 = (this.getChild("n20"));
  14871. this.n23 = (this.getChild("n23"));
  14872. this.n24 = (this.getChild("n24"));
  14873. this.n26 = (this.getChild("n26"));
  14874. this.n33 = (this.getChild("n33"));
  14875. this.coinImg = (this.getChild("coinImg"));
  14876. this.need = (this.getChild("need"));
  14877. this.n35 = (this.getChild("n35"));
  14878. this.n29 = (this.getChild("n29"));
  14879. this.tipsTxt = (this.getChild("tipsTxt"));
  14880. this.n30 = (this.getChild("n30"));
  14881. this.peopleTxt = (this.getChild("peopleTxt"));
  14882. this.t0 = this.getTransition("t0");
  14883. }
  14884. }
  14885. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14886. class ui_Invitation_com1 extends fgui.GComponent {
  14887. static createInstance() {
  14888. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14889. }
  14890. onConstruct() {
  14891. this.n14 = (this.getChild("n14"));
  14892. this.n13 = (this.getChild("n13"));
  14893. this.n3 = (this.getChild("n3"));
  14894. this.n1 = (this.getChild("n1"));
  14895. this.n6 = (this.getChild("n6"));
  14896. this.n7 = (this.getChild("n7"));
  14897. this.enterBtn = (this.getChild("enterBtn"));
  14898. this.n11 = (this.getChild("n11"));
  14899. this.n12 = (this.getChild("n12"));
  14900. this.n15 = (this.getChild("n15"));
  14901. this.t0 = this.getTransition("t0");
  14902. this.t1 = this.getTransition("t1");
  14903. }
  14904. }
  14905. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14906. class ui_Component87_1 extends fgui.GComponent {
  14907. static createInstance() {
  14908. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14909. }
  14910. onConstruct() {
  14911. this.n74 = (this.getChild("n74"));
  14912. this.n73 = (this.getChild("n73"));
  14913. this.ballTxt = (this.getChild("ballTxt"));
  14914. this.n76 = (this.getChild("n76"));
  14915. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14916. this.levelTxt = (this.getChild("levelTxt"));
  14917. this.n87 = (this.getChild("n87"));
  14918. this.n84 = (this.getChild("n84"));
  14919. this.hpTxt = (this.getChild("hpTxt"));
  14920. this.n89 = (this.getChild("n89"));
  14921. this.tipsTxt = (this.getChild("tipsTxt"));
  14922. }
  14923. }
  14924. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14925. class ui_sqg1 extends fgui.GComponent {
  14926. static createInstance() {
  14927. return (fgui.UIPackage.createObject("game", "sqg1"));
  14928. }
  14929. onConstruct() {
  14930. this.n1 = (this.getChild("n1"));
  14931. this.n0 = (this.getChild("n0"));
  14932. }
  14933. }
  14934. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14935. class ui_sqg2 extends fgui.GComponent {
  14936. static createInstance() {
  14937. return (fgui.UIPackage.createObject("game", "sqg2"));
  14938. }
  14939. onConstruct() {
  14940. this.n1 = (this.getChild("n1"));
  14941. this.n0 = (this.getChild("n0"));
  14942. }
  14943. }
  14944. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14945. class ui_sqg3 extends fgui.GComponent {
  14946. static createInstance() {
  14947. return (fgui.UIPackage.createObject("game", "sqg3"));
  14948. }
  14949. onConstruct() {
  14950. this.n1 = (this.getChild("n1"));
  14951. this.n0 = (this.getChild("n0"));
  14952. }
  14953. }
  14954. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14955. class ui_sqg4 extends fgui.GComponent {
  14956. static createInstance() {
  14957. return (fgui.UIPackage.createObject("game", "sqg4"));
  14958. }
  14959. onConstruct() {
  14960. this.n1 = (this.getChild("n1"));
  14961. this.n0 = (this.getChild("n0"));
  14962. }
  14963. }
  14964. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14965. class ui_Component36 extends fgui.GButton {
  14966. static createInstance() {
  14967. return (fgui.UIPackage.createObject("game", "Component36"));
  14968. }
  14969. onConstruct() {
  14970. this.c1 = this.getController("c1");
  14971. this.n53 = (this.getChild("n53"));
  14972. this.n56 = (this.getChild("n56"));
  14973. }
  14974. }
  14975. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14976. class ui_Component37 extends fgui.GButton {
  14977. static createInstance() {
  14978. return (fgui.UIPackage.createObject("game", "Component37"));
  14979. }
  14980. onConstruct() {
  14981. this.c1 = this.getController("c1");
  14982. this.n52 = (this.getChild("n52"));
  14983. this.n54 = (this.getChild("n54"));
  14984. }
  14985. }
  14986. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14987. class ui_UISetting extends fgui.GComponent {
  14988. static createInstance() {
  14989. return (fgui.UIPackage.createObject("game", "UISetting"));
  14990. }
  14991. onConstruct() {
  14992. this.c1 = this.getController("c1");
  14993. this.n4 = (this.getChild("n4"));
  14994. this.soundBtn = (this.getChild("soundBtn"));
  14995. this.shakeBtn = (this.getChild("shakeBtn"));
  14996. this.clickNode = (this.getChild("clickNode"));
  14997. this.xyBtn = (this.getChild("xyBtn"));
  14998. }
  14999. }
  15000. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15001. class ui_Component39 extends fgui.GComponent {
  15002. static createInstance() {
  15003. return (fgui.UIPackage.createObject("game", "Component39"));
  15004. }
  15005. onConstruct() {
  15006. this.n5 = (this.getChild("n5"));
  15007. this.n6 = (this.getChild("n6"));
  15008. this.n7 = (this.getChild("n7"));
  15009. this.t0 = this.getTransition("t0");
  15010. }
  15011. }
  15012. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15013. class ui_Component40 extends fgui.GButton {
  15014. static createInstance() {
  15015. return (fgui.UIPackage.createObject("game", "Component40"));
  15016. }
  15017. onConstruct() {
  15018. this.n46 = (this.getChild("n46"));
  15019. this.n47 = (this.getChild("n47"));
  15020. }
  15021. }
  15022. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15023. class ui_Component41 extends fgui.GComponent {
  15024. static createInstance() {
  15025. return (fgui.UIPackage.createObject("game", "Component41"));
  15026. }
  15027. onConstruct() {
  15028. this.c1 = this.getController("c1");
  15029. this.n0 = (this.getChild("n0"));
  15030. this.titleTxt = (this.getChild("titleTxt"));
  15031. this.n2 = (this.getChild("n2"));
  15032. this.msgTips = (this.getChild("msgTips"));
  15033. this.numTxt = (this.getChild("numTxt"));
  15034. this.n18 = (this.getChild("n18"));
  15035. this.cancelBtn = (this.getChild("cancelBtn"));
  15036. this.videoBtn = (this.getChild("videoBtn"));
  15037. this.n10 = (this.getChild("n10"));
  15038. }
  15039. }
  15040. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15041. class ui_Component42 extends fgui.GComponent {
  15042. static createInstance() {
  15043. return (fgui.UIPackage.createObject("game", "Component42"));
  15044. }
  15045. onConstruct() {
  15046. this.c1 = this.getController("c1");
  15047. this.n1 = (this.getChild("n1"));
  15048. this.n2 = (this.getChild("n2"));
  15049. this.n3 = (this.getChild("n3"));
  15050. this.tipsTxt = (this.getChild("tipsTxt"));
  15051. this.cancelBtn = (this.getChild("cancelBtn"));
  15052. this.sureBtn = (this.getChild("sureBtn"));
  15053. this.n11 = (this.getChild("n11"));
  15054. this.n13 = (this.getChild("n13"));
  15055. this.n14 = (this.getChild("n14"));
  15056. this.womanTxt = (this.getChild("womanTxt"));
  15057. this.t0 = this.getTransition("t0");
  15058. }
  15059. }
  15060. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15061. class ui_dh_js_shengli extends fgui.GComponent {
  15062. static createInstance() {
  15063. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15064. }
  15065. onConstruct() {
  15066. this.n3 = (this.getChild("n3"));
  15067. this.n4 = (this.getChild("n4"));
  15068. this.n1 = (this.getChild("n1"));
  15069. this.n2 = (this.getChild("n2"));
  15070. this.n5 = (this.getChild("n5"));
  15071. this.n6 = (this.getChild("n6"));
  15072. this.n7 = (this.getChild("n7"));
  15073. this.n8 = (this.getChild("n8"));
  15074. this.attack = this.getTransition("attack");
  15075. this.idle = this.getTransition("idle");
  15076. }
  15077. }
  15078. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15079. class ui_dh_js_shengli_g extends fgui.GComponent {
  15080. static createInstance() {
  15081. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15082. }
  15083. onConstruct() {
  15084. this.n3 = (this.getChild("n3"));
  15085. this.n1 = (this.getChild("n1"));
  15086. this.t0 = this.getTransition("t0");
  15087. }
  15088. }
  15089. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15090. class ui_dh_js_shibai extends fgui.GComponent {
  15091. static createInstance() {
  15092. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15093. }
  15094. onConstruct() {
  15095. this.n0 = (this.getChild("n0"));
  15096. this.n1 = (this.getChild("n1"));
  15097. this.n2 = (this.getChild("n2"));
  15098. this.n3 = (this.getChild("n3"));
  15099. this.idle = this.getTransition("idle");
  15100. this.attack = this.getTransition("attack");
  15101. }
  15102. }
  15103. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15104. class ui_dh_zy_ganfa extends fgui.GButton {
  15105. static createInstance() {
  15106. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15107. }
  15108. onConstruct() {
  15109. this.n0 = (this.getChild("n0"));
  15110. }
  15111. }
  15112. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15113. class ui_dh_zy_sc_guang extends fgui.GButton {
  15114. static createInstance() {
  15115. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15116. }
  15117. onConstruct() {
  15118. this.n0 = (this.getChild("n0"));
  15119. this.n2 = (this.getChild("n2"));
  15120. }
  15121. }
  15122. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15123. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15124. static createInstance() {
  15125. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15126. }
  15127. onConstruct() {
  15128. this.n0 = (this.getChild("n0"));
  15129. this.n3 = (this.getChild("n3"));
  15130. }
  15131. }
  15132. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15133. class ui_dh_zy_wanfa extends fgui.GButton {
  15134. static createInstance() {
  15135. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15136. }
  15137. onConstruct() {
  15138. this.n0 = (this.getChild("n0"));
  15139. }
  15140. }
  15141. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15142. class ui_Button_login extends fgui.GButton {
  15143. static createInstance() {
  15144. return (fgui.UIPackage.createObject("game", "Button_login"));
  15145. }
  15146. onConstruct() {
  15147. this.button = this.getController("button");
  15148. this.n5 = (this.getChild("n5"));
  15149. this.n3 = (this.getChild("n3"));
  15150. }
  15151. }
  15152. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15153. class ui_Component53_1 extends fgui.GComponent {
  15154. static createInstance() {
  15155. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15156. }
  15157. onConstruct() {
  15158. this.n0 = (this.getChild("n0"));
  15159. this.n1 = (this.getChild("n1"));
  15160. this.n2 = (this.getChild("n2"));
  15161. this.n3 = (this.getChild("n3"));
  15162. this.n4 = (this.getChild("n4"));
  15163. this.n5 = (this.getChild("n5"));
  15164. this.n6 = (this.getChild("n6"));
  15165. this.n7 = (this.getChild("n7"));
  15166. this.n8 = (this.getChild("n8"));
  15167. this.n9 = (this.getChild("n9"));
  15168. this.n10 = (this.getChild("n10"));
  15169. this.n11 = (this.getChild("n11"));
  15170. this.n12 = (this.getChild("n12"));
  15171. this.n13 = (this.getChild("n13"));
  15172. this.n14 = (this.getChild("n14"));
  15173. this.n15 = (this.getChild("n15"));
  15174. this.n16 = (this.getChild("n16"));
  15175. this.n19 = (this.getChild("n19"));
  15176. this.n20 = (this.getChild("n20"));
  15177. this.n21 = (this.getChild("n21"));
  15178. this.n22 = (this.getChild("n22"));
  15179. this.n23 = (this.getChild("n23"));
  15180. this.n24 = (this.getChild("n24"));
  15181. this.n25 = (this.getChild("n25"));
  15182. this.n26 = (this.getChild("n26"));
  15183. this.n27 = (this.getChild("n27"));
  15184. this.n28 = (this.getChild("n28"));
  15185. this.n29 = (this.getChild("n29"));
  15186. this.n30 = (this.getChild("n30"));
  15187. this.n31 = (this.getChild("n31"));
  15188. this.n32 = (this.getChild("n32"));
  15189. this.n33 = (this.getChild("n33"));
  15190. this.n34 = (this.getChild("n34"));
  15191. this.n35 = (this.getChild("n35"));
  15192. this.t0 = this.getTransition("t0");
  15193. }
  15194. }
  15195. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15196. class ui_Component30 extends fgui.GComponent {
  15197. static createInstance() {
  15198. return (fgui.UIPackage.createObject("game", "Component30"));
  15199. }
  15200. onConstruct() {
  15201. this.c1 = this.getController("c1");
  15202. this.n46 = (this.getChild("n46"));
  15203. this.n47 = (this.getChild("n47"));
  15204. this.numTxt = (this.getChild("numTxt"));
  15205. this.n50 = (this.getChild("n50"));
  15206. this.n53 = (this.getChild("n53"));
  15207. this.n54 = (this.getChild("n54"));
  15208. this.n55 = (this.getChild("n55"));
  15209. this.n56 = (this.getChild("n56"));
  15210. }
  15211. }
  15212. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15213. class ui_Component30_1 extends fgui.GComponent {
  15214. static createInstance() {
  15215. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15216. }
  15217. onConstruct() {
  15218. this.c1 = this.getController("c1");
  15219. this.n46 = (this.getChild("n46"));
  15220. this.n47 = (this.getChild("n47"));
  15221. this.numTxt = (this.getChild("numTxt"));
  15222. this.n50 = (this.getChild("n50"));
  15223. this.n51 = (this.getChild("n51"));
  15224. this.n52 = (this.getChild("n52"));
  15225. this.n53 = (this.getChild("n53"));
  15226. this.n54 = (this.getChild("n54"));
  15227. }
  15228. }
  15229. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15230. class ui_Component31 extends fgui.GComponent {
  15231. static createInstance() {
  15232. return (fgui.UIPackage.createObject("game", "Component31"));
  15233. }
  15234. onConstruct() {
  15235. this.n55 = (this.getChild("n55"));
  15236. this.n54 = (this.getChild("n54"));
  15237. this.conditionTxt = (this.getChild("conditionTxt"));
  15238. this.n57 = (this.getChild("n57"));
  15239. this.t0 = this.getTransition("t0");
  15240. }
  15241. }
  15242. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15243. class ui_Component32 extends fgui.GComponent {
  15244. static createInstance() {
  15245. return (fgui.UIPackage.createObject("game", "Component32"));
  15246. }
  15247. onConstruct() {
  15248. this.n5 = (this.getChild("n5"));
  15249. this.n6 = (this.getChild("n6"));
  15250. this.n7 = (this.getChild("n7"));
  15251. this.t0 = this.getTransition("t0");
  15252. }
  15253. }
  15254. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15255. class ui_AwardItem extends fgui.GComponent {
  15256. static createInstance() {
  15257. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15258. }
  15259. onConstruct() {
  15260. this.n9 = (this.getChild("n9"));
  15261. this.myIcon = (this.getChild("myIcon"));
  15262. this.numTxt = (this.getChild("numTxt"));
  15263. this.nameTxt = (this.getChild("nameTxt"));
  15264. this.n16 = (this.getChild("n16"));
  15265. this.n17 = (this.getChild("n17"));
  15266. }
  15267. }
  15268. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15269. class ui_ranking_com1 extends fgui.GButton {
  15270. static createInstance() {
  15271. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15272. }
  15273. onConstruct() {
  15274. this.c1 = this.getController("c1");
  15275. this.n49 = (this.getChild("n49"));
  15276. this.n18 = (this.getChild("n18"));
  15277. this.n46 = (this.getChild("n46"));
  15278. this.n48 = (this.getChild("n48"));
  15279. this.n50 = (this.getChild("n50"));
  15280. }
  15281. }
  15282. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15283. class ui_ranking_com2 extends fgui.GButton {
  15284. static createInstance() {
  15285. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15286. }
  15287. onConstruct() {
  15288. this.c1 = this.getController("c1");
  15289. this.n49 = (this.getChild("n49"));
  15290. this.n18 = (this.getChild("n18"));
  15291. this.n46 = (this.getChild("n46"));
  15292. this.n48 = (this.getChild("n48"));
  15293. this.n50 = (this.getChild("n50"));
  15294. }
  15295. }
  15296. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15297. class ui_ranking_com3 extends fgui.GComponent {
  15298. static createInstance() {
  15299. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15300. }
  15301. onConstruct() {
  15302. this.n17 = (this.getChild("n17"));
  15303. this.myIcon = (this.getChild("myIcon"));
  15304. }
  15305. }
  15306. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15307. class ui_ranking_com4 extends fgui.GComponent {
  15308. static createInstance() {
  15309. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15310. }
  15311. onConstruct() {
  15312. this.n16 = (this.getChild("n16"));
  15313. this.head = (this.getChild("head"));
  15314. }
  15315. }
  15316. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15317. class ui_ranking_com5 extends fgui.GComponent {
  15318. static createInstance() {
  15319. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15320. }
  15321. onConstruct() {
  15322. this.c1 = this.getController("c1");
  15323. this.c2 = this.getController("c2");
  15324. this.n2 = (this.getChild("n2"));
  15325. this.n3 = (this.getChild("n3"));
  15326. this.levelBtn = (this.getChild("levelBtn"));
  15327. this.starBtn = (this.getChild("starBtn"));
  15328. this.n23 = (this.getChild("n23"));
  15329. this.n24 = (this.getChild("n24"));
  15330. this.n25 = (this.getChild("n25"));
  15331. this.myList = (this.getChild("myList"));
  15332. this.selfNode = (this.getChild("selfNode"));
  15333. this.n9 = (this.getChild("n9"));
  15334. this.n12 = (this.getChild("n12"));
  15335. this.n13 = (this.getChild("n13"));
  15336. this.n14 = (this.getChild("n14"));
  15337. this.n39 = (this.getChild("n39"));
  15338. this.n41 = (this.getChild("n41"));
  15339. this.n42 = (this.getChild("n42"));
  15340. this.n45 = (this.getChild("n45"));
  15341. this.changeBtn = (this.getChild("changeBtn"));
  15342. this.closeBtn = (this.getChild("closeBtn"));
  15343. this.t0 = this.getTransition("t0");
  15344. }
  15345. }
  15346. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15347. class ui_RankItem extends fgui.GComponent {
  15348. static createInstance() {
  15349. return (fgui.UIPackage.createObject("game", "RankItem"));
  15350. }
  15351. onConstruct() {
  15352. this.n10 = (this.getChild("n10"));
  15353. this.n11 = (this.getChild("n11"));
  15354. this.rankTxt = (this.getChild("rankTxt"));
  15355. this.headNode = (this.getChild("headNode"));
  15356. this.nameTxt = (this.getChild("nameTxt"));
  15357. this.n19 = (this.getChild("n19"));
  15358. this.valueTxt = (this.getChild("valueTxt"));
  15359. this.img1 = (this.getChild("img1"));
  15360. this.img2 = (this.getChild("img2"));
  15361. this.img3 = (this.getChild("img3"));
  15362. }
  15363. }
  15364. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15365. class ui_ranking_com9 extends fgui.GComponent {
  15366. static createInstance() {
  15367. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15368. }
  15369. onConstruct() {
  15370. this.c1 = this.getController("c1");
  15371. this.n27 = (this.getChild("n27"));
  15372. this.n28 = (this.getChild("n28"));
  15373. this.headNode = (this.getChild("headNode"));
  15374. this.rankTxt = (this.getChild("rankTxt"));
  15375. this.nameTxt = (this.getChild("nameTxt"));
  15376. this.n34 = (this.getChild("n34"));
  15377. this.valueTxt = (this.getChild("valueTxt"));
  15378. this.n36 = (this.getChild("n36"));
  15379. this.n37 = (this.getChild("n37"));
  15380. this.n38 = (this.getChild("n38"));
  15381. this.n39 = (this.getChild("n39"));
  15382. this.n40 = (this.getChild("n40"));
  15383. }
  15384. }
  15385. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15386. class ui_ranking_com10 extends fgui.GComponent {
  15387. static createInstance() {
  15388. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15389. }
  15390. onConstruct() {
  15391. this.n23 = (this.getChild("n23"));
  15392. this.n24 = (this.getChild("n24"));
  15393. }
  15394. }
  15395. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15396. class ui_ranking_com11 extends fgui.GComponent {
  15397. static createInstance() {
  15398. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15399. }
  15400. onConstruct() {
  15401. this.n24 = (this.getChild("n24"));
  15402. this.n25 = (this.getChild("n25"));
  15403. this.t0 = this.getTransition("t0");
  15404. }
  15405. }
  15406. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15407. class ui_ranking_com13 extends fgui.GButton {
  15408. static createInstance() {
  15409. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15410. }
  15411. onConstruct() {
  15412. this.c1 = this.getController("c1");
  15413. this.n44 = (this.getChild("n44"));
  15414. this.n45 = (this.getChild("n45"));
  15415. this.n46 = (this.getChild("n46"));
  15416. }
  15417. }
  15418. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15419. class ui_Component122 extends fgui.GComponent {
  15420. static createInstance() {
  15421. return (fgui.UIPackage.createObject("game", "Component122"));
  15422. }
  15423. onConstruct() {
  15424. this.gameNode3 = (this.getChild("gameNode3"));
  15425. }
  15426. }
  15427. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15428. class ui_skillItem extends fgui.GComponent {
  15429. static createInstance() {
  15430. return (fgui.UIPackage.createObject("game", "skillItem"));
  15431. }
  15432. onConstruct() {
  15433. this.c1 = this.getController("c1");
  15434. this.n31 = (this.getChild("n31"));
  15435. this.n6 = (this.getChild("n6"));
  15436. this.skillImg = (this.getChild("skillImg"));
  15437. this.nameTxt = (this.getChild("nameTxt"));
  15438. this.levelTxt = (this.getChild("levelTxt"));
  15439. this.n28 = (this.getChild("n28"));
  15440. this.describeTxt = (this.getChild("describeTxt"));
  15441. this.n32 = (this.getChild("n32"));
  15442. this.mutiBtn = (this.getChild("mutiBtn"));
  15443. this.tryNode = (this.getChild("tryNode"));
  15444. this.normalBtn = (this.getChild("normalBtn"));
  15445. this.startBtn = (this.getChild("startBtn"));
  15446. this.n42 = (this.getChild("n42"));
  15447. this.n43 = (this.getChild("n43"));
  15448. this.n44 = (this.getChild("n44"));
  15449. }
  15450. }
  15451. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15452. class ui_Component26 extends fgui.GButton {
  15453. static createInstance() {
  15454. return (fgui.UIPackage.createObject("game", "Component26"));
  15455. }
  15456. onConstruct() {
  15457. this.n11 = (this.getChild("n11"));
  15458. this.n30 = (this.getChild("n30"));
  15459. this.n34 = (this.getChild("n34"));
  15460. }
  15461. }
  15462. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15463. class ui_Component28 extends fgui.GButton {
  15464. static createInstance() {
  15465. return (fgui.UIPackage.createObject("game", "Component28"));
  15466. }
  15467. onConstruct() {
  15468. this.n12 = (this.getChild("n12"));
  15469. this.n31 = (this.getChild("n31"));
  15470. this.curTxt = (this.getChild("curTxt"));
  15471. this.n33 = (this.getChild("n33"));
  15472. }
  15473. }
  15474. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15475. class ui_Component1302 extends fgui.GComponent {
  15476. static createInstance() {
  15477. return (fgui.UIPackage.createObject("game", "Component1302"));
  15478. }
  15479. onConstruct() {
  15480. this.n2 = (this.getChild("n2"));
  15481. this.n3 = (this.getChild("n3"));
  15482. }
  15483. }
  15484. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15485. class ui_Component113 extends fgui.GComponent {
  15486. static createInstance() {
  15487. return (fgui.UIPackage.createObject("game", "Component113"));
  15488. }
  15489. onConstruct() {
  15490. this.n85 = (this.getChild("n85"));
  15491. this.n86 = (this.getChild("n86"));
  15492. this.n77 = (this.getChild("n77"));
  15493. this.n79 = (this.getChild("n79"));
  15494. this.n80 = (this.getChild("n80"));
  15495. this.n81 = (this.getChild("n81"));
  15496. this.n82 = (this.getChild("n82"));
  15497. this.n84 = (this.getChild("n84"));
  15498. this.n87 = (this.getChild("n87"));
  15499. this.t0 = this.getTransition("t0");
  15500. }
  15501. }
  15502. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15503. class ui_Component114 extends fgui.GComponent {
  15504. static createInstance() {
  15505. return (fgui.UIPackage.createObject("game", "Component114"));
  15506. }
  15507. onConstruct() {
  15508. this.n77 = (this.getChild("n77"));
  15509. this.t0 = this.getTransition("t0");
  15510. }
  15511. }
  15512. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15513. class ui_Component115 extends fgui.GComponent {
  15514. static createInstance() {
  15515. return (fgui.UIPackage.createObject("game", "Component115"));
  15516. }
  15517. onConstruct() {
  15518. this.n83 = (this.getChild("n83"));
  15519. this.fingerNode = (this.getChild("fingerNode"));
  15520. this.n84 = (this.getChild("n84"));
  15521. }
  15522. }
  15523. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15524. class ui_Component117 extends fgui.GComponent {
  15525. static createInstance() {
  15526. return (fgui.UIPackage.createObject("game", "Component117"));
  15527. }
  15528. onConstruct() {
  15529. this.n87 = (this.getChild("n87"));
  15530. this.n88 = (this.getChild("n88"));
  15531. this.n84 = (this.getChild("n84"));
  15532. this.n85 = (this.getChild("n85"));
  15533. this.n86 = (this.getChild("n86"));
  15534. this.t0 = this.getTransition("t0");
  15535. }
  15536. }
  15537. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15538. class ui_Component98_1 extends fgui.GButton {
  15539. static createInstance() {
  15540. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15541. }
  15542. onConstruct() {
  15543. this.c1 = this.getController("c1");
  15544. this.n8 = (this.getChild("n8"));
  15545. this.n41 = (this.getChild("n41"));
  15546. this.n40 = (this.getChild("n40"));
  15547. }
  15548. }
  15549. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15550. class ui_Component61 extends fgui.GComponent {
  15551. static createInstance() {
  15552. return (fgui.UIPackage.createObject("game", "Component61"));
  15553. }
  15554. onConstruct() {
  15555. this.n14 = (this.getChild("n14"));
  15556. this.n6 = (this.getChild("n6"));
  15557. this.t0 = this.getTransition("t0");
  15558. }
  15559. }
  15560. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15561. class ui_Component62 extends fgui.GComponent {
  15562. static createInstance() {
  15563. return (fgui.UIPackage.createObject("game", "Component62"));
  15564. }
  15565. onConstruct() {
  15566. this.n66 = (this.getChild("n66"));
  15567. this.n56 = (this.getChild("n56"));
  15568. this.n63 = (this.getChild("n63"));
  15569. this.n65 = (this.getChild("n65"));
  15570. this.t0 = this.getTransition("t0");
  15571. }
  15572. }
  15573. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15574. class ui_d3Root extends fgui.GComponent {
  15575. static createInstance() {
  15576. return (fgui.UIPackage.createObject("game", "d3Root"));
  15577. }
  15578. onConstruct() {
  15579. }
  15580. }
  15581. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15582. class ui_d2Root extends fgui.GComponent {
  15583. static createInstance() {
  15584. return (fgui.UIPackage.createObject("game", "d2Root"));
  15585. }
  15586. onConstruct() {
  15587. }
  15588. }
  15589. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15590. class ui_ballNode extends fgui.GComponent {
  15591. static createInstance() {
  15592. return (fgui.UIPackage.createObject("game", "ballNode"));
  15593. }
  15594. onConstruct() {
  15595. }
  15596. }
  15597. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15598. class ui_border extends fgui.GComponent {
  15599. static createInstance() {
  15600. return (fgui.UIPackage.createObject("game", "border"));
  15601. }
  15602. onConstruct() {
  15603. this.bar1 = (this.getChild("bar1"));
  15604. this.bar2 = (this.getChild("bar2"));
  15605. this.bar3 = (this.getChild("bar3"));
  15606. this.bar4 = (this.getChild("bar4"));
  15607. this.bar5 = (this.getChild("bar5"));
  15608. this.bar6 = (this.getChild("bar6"));
  15609. this.circle1 = (this.getChild("circle1"));
  15610. this.circle2 = (this.getChild("circle2"));
  15611. this.circle3 = (this.getChild("circle3"));
  15612. this.circle4 = (this.getChild("circle4"));
  15613. this.circle5 = (this.getChild("circle5"));
  15614. this.circle6 = (this.getChild("circle6"));
  15615. this.n28 = (this.getChild("n28"));
  15616. }
  15617. }
  15618. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15619. class ui_btn_buy extends fgui.GButton {
  15620. static createInstance() {
  15621. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15622. }
  15623. onConstruct() {
  15624. this.button = this.getController("button");
  15625. this.n0 = (this.getChild("n0"));
  15626. this.n1 = (this.getChild("n1"));
  15627. this.n2 = (this.getChild("n2"));
  15628. }
  15629. }
  15630. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15631. class ui_Component41_2 extends fgui.GComponent {
  15632. static createInstance() {
  15633. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15634. }
  15635. onConstruct() {
  15636. this.c1 = this.getController("c1");
  15637. this.n0 = (this.getChild("n0"));
  15638. this.n2 = (this.getChild("n2"));
  15639. this.n19 = (this.getChild("n19"));
  15640. this.cancelBtn = (this.getChild("cancelBtn"));
  15641. this.videoBtn = (this.getChild("videoBtn"));
  15642. this.n9 = (this.getChild("n9"));
  15643. this.n22 = (this.getChild("n22"));
  15644. this.tipsTxt = (this.getChild("tipsTxt"));
  15645. this.n23 = (this.getChild("n23"));
  15646. this.n24 = (this.getChild("n24"));
  15647. this.n26 = (this.getChild("n26"));
  15648. this.n27 = (this.getChild("n27"));
  15649. this.titleTxt = (this.getChild("titleTxt"));
  15650. }
  15651. }
  15652. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15653. class ui_Component41_1 extends fgui.GComponent {
  15654. static createInstance() {
  15655. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15656. }
  15657. onConstruct() {
  15658. this.c1 = this.getController("c1");
  15659. this.n0 = (this.getChild("n0"));
  15660. this.n2 = (this.getChild("n2"));
  15661. this.cancelBtn = (this.getChild("cancelBtn"));
  15662. this.videoBtn = (this.getChild("videoBtn"));
  15663. this.n27 = (this.getChild("n27"));
  15664. this.n30 = (this.getChild("n30"));
  15665. this.n31 = (this.getChild("n31"));
  15666. this.n32 = (this.getChild("n32"));
  15667. this.n33 = (this.getChild("n33"));
  15668. this.n34 = (this.getChild("n34"));
  15669. this.n35 = (this.getChild("n35"));
  15670. this.n36 = (this.getChild("n36"));
  15671. this.n1 = (this.getChild("n1"));
  15672. this.n37 = (this.getChild("n37"));
  15673. this.t0 = this.getTransition("t0");
  15674. this.t1 = this.getTransition("t1");
  15675. this.t2 = this.getTransition("t2");
  15676. this.t3 = this.getTransition("t3");
  15677. }
  15678. }
  15679. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15680. class ui_againBtn extends fgui.GButton {
  15681. static createInstance() {
  15682. return (fgui.UIPackage.createObject("game", "againBtn"));
  15683. }
  15684. onConstruct() {
  15685. this.n2 = (this.getChild("n2"));
  15686. this.n1 = (this.getChild("n1"));
  15687. this.n5 = (this.getChild("n5"));
  15688. }
  15689. }
  15690. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15691. class ui_Component118 extends fgui.GButton {
  15692. static createInstance() {
  15693. return (fgui.UIPackage.createObject("game", "Component118"));
  15694. }
  15695. onConstruct() {
  15696. this.c1 = this.getController("c1");
  15697. this.n14 = (this.getChild("n14"));
  15698. this.n9 = (this.getChild("n9"));
  15699. this.n10 = (this.getChild("n10"));
  15700. this.diamondTxt = (this.getChild("diamondTxt"));
  15701. this.n13 = (this.getChild("n13"));
  15702. this.n15 = (this.getChild("n15"));
  15703. }
  15704. }
  15705. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15706. class ui_Component119 extends fgui.GComponent {
  15707. static createInstance() {
  15708. return (fgui.UIPackage.createObject("game", "Component119"));
  15709. }
  15710. onConstruct() {
  15711. this.n1 = (this.getChild("n1"));
  15712. this.n2 = (this.getChild("n2"));
  15713. this.n13 = (this.getChild("n13"));
  15714. this.n6 = (this.getChild("n6"));
  15715. this.screenNode = (this.getChild("screenNode"));
  15716. this.n15 = (this.getChild("n15"));
  15717. this.closeBtn = (this.getChild("closeBtn"));
  15718. this.share2Btn = (this.getChild("share2Btn"));
  15719. this.shareBtn = (this.getChild("shareBtn"));
  15720. this.tipsNode = (this.getChild("tipsNode"));
  15721. this.awardNode = (this.getChild("awardNode"));
  15722. }
  15723. }
  15724. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15725. class ui_daoJuDisplay extends fgui.GComponent {
  15726. static createInstance() {
  15727. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15728. }
  15729. onConstruct() {
  15730. this.n6 = (this.getChild("n6"));
  15731. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15732. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15733. this.btn_buy = (this.getChild("btn_buy"));
  15734. this.nameTxt = (this.getChild("nameTxt"));
  15735. this.zsImg = (this.getChild("zsImg"));
  15736. }
  15737. }
  15738. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15739. class ui_Component132_1 extends fgui.GComponent {
  15740. static createInstance() {
  15741. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15742. }
  15743. onConstruct() {
  15744. this.n25 = (this.getChild("n25"));
  15745. this.n26 = (this.getChild("n26"));
  15746. this.n27 = (this.getChild("n27"));
  15747. this.t0 = this.getTransition("t0");
  15748. }
  15749. }
  15750. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15751. class ui_SecretaryDisplay extends fgui.GComponent {
  15752. static createInstance() {
  15753. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15754. }
  15755. onConstruct() {
  15756. this.n2 = (this.getChild("n2"));
  15757. this.levelTxt = (this.getChild("levelTxt"));
  15758. this.n4 = (this.getChild("n4"));
  15759. this.secretary = (this.getChild("secretary"));
  15760. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15761. this.n16 = (this.getChild("n16"));
  15762. this.n37 = (this.getChild("n37"));
  15763. this.n41 = (this.getChild("n41"));
  15764. this.n14 = (this.getChild("n14"));
  15765. this.n17 = (this.getChild("n17"));
  15766. this.heightTxt = (this.getChild("heightTxt"));
  15767. this.n46 = (this.getChild("n46"));
  15768. this.n36 = (this.getChild("n36"));
  15769. this.n38 = (this.getChild("n38"));
  15770. this.foodTxt = (this.getChild("foodTxt"));
  15771. this.n47 = (this.getChild("n47"));
  15772. this.n40 = (this.getChild("n40"));
  15773. this.n42 = (this.getChild("n42"));
  15774. this.historyTxt = (this.getChild("historyTxt"));
  15775. this.n48 = (this.getChild("n48"));
  15776. this.nameImg = (this.getChild("nameImg"));
  15777. this.n12 = (this.getChild("n12"));
  15778. this.n49 = (this.getChild("n49"));
  15779. this.t0 = this.getTransition("t0");
  15780. }
  15781. }
  15782. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15783. class ui_BallRodDisplay extends fgui.GComponent {
  15784. static createInstance() {
  15785. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15786. }
  15787. onConstruct() {
  15788. this.c1 = this.getController("c1");
  15789. this.n31 = (this.getChild("n31"));
  15790. this.n6 = (this.getChild("n6"));
  15791. this.nameTxt = (this.getChild("nameTxt"));
  15792. this.rodImg = (this.getChild("rodImg"));
  15793. this.eftRod = (this.getChild("eftRod"));
  15794. this.levelNode = (this.getChild("levelNode"));
  15795. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15796. }
  15797. }
  15798. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15799. class ui_Component111_11 extends fgui.GComponent {
  15800. static createInstance() {
  15801. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15802. }
  15803. onConstruct() {
  15804. this.n68 = (this.getChild("n68"));
  15805. this.n69 = (this.getChild("n69"));
  15806. }
  15807. }
  15808. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15809. class ui_Component112 extends fgui.GComponent {
  15810. static createInstance() {
  15811. return (fgui.UIPackage.createObject("game", "Component112"));
  15812. }
  15813. onConstruct() {
  15814. this.n68 = (this.getChild("n68"));
  15815. this.n70 = (this.getChild("n70"));
  15816. this.myMask = (this.getChild("myMask"));
  15817. }
  15818. }
  15819. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15820. class ui_Component111 extends fgui.GComponent {
  15821. static createInstance() {
  15822. return (fgui.UIPackage.createObject("game", "Component111"));
  15823. }
  15824. onConstruct() {
  15825. this.n68 = (this.getChild("n68"));
  15826. this.myMask = (this.getChild("myMask"));
  15827. }
  15828. }
  15829. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15830. class ui_Component144 extends fgui.GButton {
  15831. static createInstance() {
  15832. return (fgui.UIPackage.createObject("game", "Component144"));
  15833. }
  15834. onConstruct() {
  15835. this.n8 = (this.getChild("n8"));
  15836. }
  15837. }
  15838. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15839. class ui_Sign_com2 extends fgui.GComponent {
  15840. static createInstance() {
  15841. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15842. }
  15843. onConstruct() {
  15844. this.n0 = (this.getChild("n0"));
  15845. this.n1 = (this.getChild("n1"));
  15846. this.t0 = this.getTransition("t0");
  15847. }
  15848. }
  15849. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15850. class ui_Sign_guang extends fgui.GComponent {
  15851. static createInstance() {
  15852. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15853. }
  15854. onConstruct() {
  15855. this.n1 = (this.getChild("n1"));
  15856. this.n2 = (this.getChild("n2"));
  15857. this.n3 = (this.getChild("n3"));
  15858. this.n4 = (this.getChild("n4"));
  15859. this.n5 = (this.getChild("n5"));
  15860. this.n6 = (this.getChild("n6"));
  15861. this.n8 = (this.getChild("n8"));
  15862. }
  15863. }
  15864. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15865. class ui_SignMax extends fgui.GComponent {
  15866. static createInstance() {
  15867. return (fgui.UIPackage.createObject("game", "SignMax"));
  15868. }
  15869. onConstruct() {
  15870. this.c1 = this.getController("c1");
  15871. this.n7 = (this.getChild("n7"));
  15872. this.n15 = (this.getChild("n15"));
  15873. this.n8 = (this.getChild("n8"));
  15874. this.titleTxt = (this.getChild("titleTxt"));
  15875. this.myIcon1 = (this.getChild("myIcon1"));
  15876. this.numTxt1 = (this.getChild("numTxt1"));
  15877. this.myIcon2 = (this.getChild("myIcon2"));
  15878. this.n20 = (this.getChild("n20"));
  15879. this.n17 = (this.getChild("n17"));
  15880. this.numTxt2 = (this.getChild("numTxt2"));
  15881. this.n12 = (this.getChild("n12"));
  15882. this.n13 = (this.getChild("n13"));
  15883. this.n21 = (this.getChild("n21"));
  15884. this.n14 = (this.getChild("n14"));
  15885. }
  15886. }
  15887. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15888. class ui_Sign_com2_1 extends fgui.GComponent {
  15889. static createInstance() {
  15890. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15891. }
  15892. onConstruct() {
  15893. this.n0 = (this.getChild("n0"));
  15894. this.n1 = (this.getChild("n1"));
  15895. this.t0 = this.getTransition("t0");
  15896. }
  15897. }
  15898. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15899. class ui_Sign_com5 extends fgui.GComponent {
  15900. static createInstance() {
  15901. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15902. }
  15903. onConstruct() {
  15904. this.n3 = (this.getChild("n3"));
  15905. this.n29 = (this.getChild("n29"));
  15906. this.n4 = (this.getChild("n4"));
  15907. this.day1 = (this.getChild("day1"));
  15908. this.day2 = (this.getChild("day2"));
  15909. this.day3 = (this.getChild("day3"));
  15910. this.day4 = (this.getChild("day4"));
  15911. this.day5 = (this.getChild("day5"));
  15912. this.day6 = (this.getChild("day6"));
  15913. this.day7 = (this.getChild("day7"));
  15914. this.t0 = this.getTransition("t0");
  15915. }
  15916. }
  15917. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15918. class ui_Sign_com8 extends fgui.GComponent {
  15919. static createInstance() {
  15920. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15921. }
  15922. onConstruct() {
  15923. this.n48 = (this.getChild("n48"));
  15924. this.womanTxt = (this.getChild("womanTxt"));
  15925. this.t0 = this.getTransition("t0");
  15926. }
  15927. }
  15928. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15929. class ui_Sign_com6 extends fgui.GComponent {
  15930. static createInstance() {
  15931. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15932. }
  15933. onConstruct() {
  15934. this.n2 = (this.getChild("n2"));
  15935. this.n3 = (this.getChild("n3"));
  15936. this.t0 = this.getTransition("t0");
  15937. }
  15938. }
  15939. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15940. class ui_Sign_com7 extends fgui.GComponent {
  15941. static createInstance() {
  15942. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15943. }
  15944. onConstruct() {
  15945. this.n29 = (this.getChild("n29"));
  15946. this.n2 = (this.getChild("n2"));
  15947. }
  15948. }
  15949. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15950. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15951. static createInstance() {
  15952. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15953. }
  15954. onConstruct() {
  15955. this.n5 = (this.getChild("n5"));
  15956. this.n4 = (this.getChild("n4"));
  15957. this.t0 = this.getTransition("t0");
  15958. }
  15959. }
  15960. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15961. class ui_UITurntable_com2 extends fgui.GComponent {
  15962. static createInstance() {
  15963. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15964. }
  15965. onConstruct() {
  15966. this.c1 = this.getController("c1");
  15967. this.n4 = (this.getChild("n4"));
  15968. this.n6 = (this.getChild("n6"));
  15969. this.n10 = (this.getChild("n10"));
  15970. this.n11 = (this.getChild("n11"));
  15971. this.n12 = (this.getChild("n12"));
  15972. this.n13 = (this.getChild("n13"));
  15973. this.n14 = (this.getChild("n14"));
  15974. this.n15 = (this.getChild("n15"));
  15975. this.n16 = (this.getChild("n16"));
  15976. this.n17 = (this.getChild("n17"));
  15977. this.n18 = (this.getChild("n18"));
  15978. this.n19 = (this.getChild("n19"));
  15979. this.n20 = (this.getChild("n20"));
  15980. this.n21 = (this.getChild("n21"));
  15981. this.n22 = (this.getChild("n22"));
  15982. this.n23 = (this.getChild("n23"));
  15983. this.n24 = (this.getChild("n24"));
  15984. this.n25 = (this.getChild("n25"));
  15985. this.n26 = (this.getChild("n26"));
  15986. this.n27 = (this.getChild("n27"));
  15987. this.n28 = (this.getChild("n28"));
  15988. this.n29 = (this.getChild("n29"));
  15989. this.n30 = (this.getChild("n30"));
  15990. this.n31 = (this.getChild("n31"));
  15991. this.n32 = (this.getChild("n32"));
  15992. this.n33 = (this.getChild("n33"));
  15993. }
  15994. }
  15995. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15996. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15997. static createInstance() {
  15998. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15999. }
  16000. onConstruct() {
  16001. this.n5 = (this.getChild("n5"));
  16002. this.n4 = (this.getChild("n4"));
  16003. this.t0 = this.getTransition("t0");
  16004. }
  16005. }
  16006. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16007. class ui_UITurntable_com5 extends fgui.GComponent {
  16008. static createInstance() {
  16009. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16010. }
  16011. onConstruct() {
  16012. this.flashNode = (this.getChild("flashNode"));
  16013. this.rotNode = (this.getChild("rotNode"));
  16014. this.n3 = (this.getChild("n3"));
  16015. this.n21 = (this.getChild("n21"));
  16016. this.t0 = this.getTransition("t0");
  16017. }
  16018. }
  16019. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16020. class ui_UITurntable_com7 extends fgui.GComponent {
  16021. static createInstance() {
  16022. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16023. }
  16024. onConstruct() {
  16025. this.n2 = (this.getChild("n2"));
  16026. this.n35 = (this.getChild("n35"));
  16027. this.img1 = (this.getChild("img1"));
  16028. this.img2 = (this.getChild("img2"));
  16029. this.img3 = (this.getChild("img3"));
  16030. this.img4 = (this.getChild("img4"));
  16031. this.img6 = (this.getChild("img6"));
  16032. this.img5 = (this.getChild("img5"));
  16033. this.txt1 = (this.getChild("txt1"));
  16034. this.txt2 = (this.getChild("txt2"));
  16035. this.txt3 = (this.getChild("txt3"));
  16036. this.txt4 = (this.getChild("txt4"));
  16037. this.txt5 = (this.getChild("txt5"));
  16038. this.txt6 = (this.getChild("txt6"));
  16039. }
  16040. }
  16041. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16042. class ui_UITurntable_com9 extends fgui.GComponent {
  16043. static createInstance() {
  16044. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16045. }
  16046. onConstruct() {
  16047. this.n38 = (this.getChild("n38"));
  16048. this.n39 = (this.getChild("n39"));
  16049. }
  16050. }
  16051. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16052. class ui_UITurntable_com10 extends fgui.GComponent {
  16053. static createInstance() {
  16054. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16055. }
  16056. onConstruct() {
  16057. this.n39 = (this.getChild("n39"));
  16058. this.n40 = (this.getChild("n40"));
  16059. this.t0 = this.getTransition("t0");
  16060. }
  16061. }
  16062. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16063. class ui_UITurntable_com11 extends fgui.GComponent {
  16064. static createInstance() {
  16065. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16066. }
  16067. onConstruct() {
  16068. this.n38 = (this.getChild("n38"));
  16069. this.n39 = (this.getChild("n39"));
  16070. this.n40 = (this.getChild("n40"));
  16071. this.t0 = this.getTransition("t0");
  16072. }
  16073. }
  16074. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16075. class ui_UITurntable_com12 extends fgui.GComponent {
  16076. static createInstance() {
  16077. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16078. }
  16079. onConstruct() {
  16080. this.n43 = (this.getChild("n43"));
  16081. this.barNode = (this.getChild("barNode"));
  16082. this.tipsTxt = (this.getChild("tipsTxt"));
  16083. this.n45 = (this.getChild("n45"));
  16084. this.boxBtn = (this.getChild("boxBtn"));
  16085. }
  16086. }
  16087. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16088. class ui_UITurntable_com1 extends fgui.GButton {
  16089. static createInstance() {
  16090. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16091. }
  16092. onConstruct() {
  16093. this.n41 = (this.getChild("n41"));
  16094. this.n42 = (this.getChild("n42"));
  16095. this.t0 = this.getTransition("t0");
  16096. }
  16097. }
  16098. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16099. class ui_UITurntable_com3 extends fgui.GComponent {
  16100. static createInstance() {
  16101. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16102. }
  16103. onConstruct() {
  16104. this.n48 = (this.getChild("n48"));
  16105. this.womanTxt = (this.getChild("womanTxt"));
  16106. this.t0 = this.getTransition("t0");
  16107. }
  16108. }
  16109. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16110. class ui_cancelBtn2 extends fgui.GButton {
  16111. static createInstance() {
  16112. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16113. }
  16114. onConstruct() {
  16115. this.c1 = this.getController("c1");
  16116. this.n0 = (this.getChild("n0"));
  16117. this.n1 = (this.getChild("n1"));
  16118. this.n2 = (this.getChild("n2"));
  16119. this.n3 = (this.getChild("n3"));
  16120. this.n4 = (this.getChild("n4"));
  16121. this.n5 = (this.getChild("n5"));
  16122. this.n6 = (this.getChild("n6"));
  16123. this.n7 = (this.getChild("n7"));
  16124. this.n8 = (this.getChild("n8"));
  16125. this.powerEft = (this.getChild("powerEft"));
  16126. }
  16127. }
  16128. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16129. class ui_shareBtn2 extends fgui.GButton {
  16130. static createInstance() {
  16131. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16132. }
  16133. onConstruct() {
  16134. this.c1 = this.getController("c1");
  16135. this.n2 = (this.getChild("n2"));
  16136. this.n24 = (this.getChild("n24"));
  16137. this.n1 = (this.getChild("n1"));
  16138. this.n3 = (this.getChild("n3"));
  16139. this.n23 = (this.getChild("n23"));
  16140. this.n4 = (this.getChild("n4"));
  16141. this.n5 = (this.getChild("n5"));
  16142. this.n6 = (this.getChild("n6"));
  16143. this.n20 = (this.getChild("n20"));
  16144. this.n21 = (this.getChild("n21"));
  16145. this.n22 = (this.getChild("n22"));
  16146. this.powerEft = (this.getChild("powerEft"));
  16147. }
  16148. }
  16149. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16150. class ui_UIMoney extends fgui.GComponent {
  16151. static createInstance() {
  16152. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16153. }
  16154. onConstruct() {
  16155. this.c1 = this.getController("c1");
  16156. this.n4 = (this.getChild("n4"));
  16157. this.coinImg = (this.getChild("coinImg"));
  16158. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16159. this.coinTxt = (this.getChild("coinTxt"));
  16160. this.n7 = (this.getChild("n7"));
  16161. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16162. this.diamondTxt = (this.getChild("diamondTxt"));
  16163. this.diamondImg = (this.getChild("diamondImg"));
  16164. this.n12 = (this.getChild("n12"));
  16165. this.powerImg = (this.getChild("powerImg"));
  16166. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16167. this.powerTxt = (this.getChild("powerTxt"));
  16168. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16169. }
  16170. }
  16171. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16172. class ui_backBtn extends fgui.GButton {
  16173. static createInstance() {
  16174. return (fgui.UIPackage.createObject("game", "backBtn"));
  16175. }
  16176. onConstruct() {
  16177. this.n0 = (this.getChild("n0"));
  16178. this.t0 = this.getTransition("t0");
  16179. this.t1 = this.getTransition("t1");
  16180. }
  16181. }
  16182. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16183. class ui_MoneyBtn extends fgui.GButton {
  16184. static createInstance() {
  16185. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16186. }
  16187. onConstruct() {
  16188. this.button = this.getController("button");
  16189. this.n0 = (this.getChild("n0"));
  16190. }
  16191. }
  16192. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16193. class ui_UIMoneyBtn extends fgui.GComponent {
  16194. static createInstance() {
  16195. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16196. }
  16197. onConstruct() {
  16198. this.n1 = (this.getChild("n1"));
  16199. this.closeBtn = (this.getChild("closeBtn"));
  16200. }
  16201. }
  16202. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16203. class ui_Component64 extends fgui.GComponent {
  16204. static createInstance() {
  16205. return (fgui.UIPackage.createObject("game", "Component64"));
  16206. }
  16207. onConstruct() {
  16208. this.n57 = (this.getChild("n57"));
  16209. this.n54 = (this.getChild("n54"));
  16210. this.n55 = (this.getChild("n55"));
  16211. this.n56 = (this.getChild("n56"));
  16212. this.t1 = this.getTransition("t1");
  16213. }
  16214. }
  16215. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16216. class ui_Component41_3 extends fgui.GComponent {
  16217. static createInstance() {
  16218. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16219. }
  16220. onConstruct() {
  16221. this.c1 = this.getController("c1");
  16222. this.n0 = (this.getChild("n0"));
  16223. this.n2 = (this.getChild("n2"));
  16224. this.cancelBtn = (this.getChild("cancelBtn"));
  16225. this.videoBtn = (this.getChild("videoBtn"));
  16226. this.n9 = (this.getChild("n9"));
  16227. this.n24 = (this.getChild("n24"));
  16228. this.n27 = (this.getChild("n27"));
  16229. this.titleTxt = (this.getChild("titleTxt"));
  16230. this.n28 = (this.getChild("n28"));
  16231. this.t0 = this.getTransition("t0");
  16232. }
  16233. }
  16234. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16235. class ui_dh_zs_4 extends fgui.GComponent {
  16236. static createInstance() {
  16237. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16238. }
  16239. onConstruct() {
  16240. this.n1 = (this.getChild("n1"));
  16241. this.n2 = (this.getChild("n2"));
  16242. this.n3 = (this.getChild("n3"));
  16243. this.n4 = (this.getChild("n4"));
  16244. this.n5 = (this.getChild("n5"));
  16245. this.n6 = (this.getChild("n6"));
  16246. this.n8 = (this.getChild("n8"));
  16247. this.t0 = this.getTransition("t0");
  16248. }
  16249. }
  16250. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16251. class ui_Component71_1 extends fgui.GButton {
  16252. static createInstance() {
  16253. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16254. }
  16255. onConstruct() {
  16256. this.n17 = (this.getChild("n17"));
  16257. this.t0 = this.getTransition("t0");
  16258. }
  16259. }
  16260. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16261. class ui_Component83 extends fgui.GComponent {
  16262. static createInstance() {
  16263. return (fgui.UIPackage.createObject("game", "Component83"));
  16264. }
  16265. onConstruct() {
  16266. this.c1 = this.getController("c1");
  16267. this.n17 = (this.getChild("n17"));
  16268. this.n19 = (this.getChild("n19"));
  16269. this.n20 = (this.getChild("n20"));
  16270. }
  16271. }
  16272. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16273. class ui_Component84 extends fgui.GComponent {
  16274. static createInstance() {
  16275. return (fgui.UIPackage.createObject("game", "Component84"));
  16276. }
  16277. onConstruct() {
  16278. this.c1 = this.getController("c1");
  16279. this.n4 = (this.getChild("n4"));
  16280. this.n22 = (this.getChild("n22"));
  16281. this.n23 = (this.getChild("n23"));
  16282. this.numTxt = (this.getChild("numTxt"));
  16283. this.n25 = (this.getChild("n25"));
  16284. this.n26 = (this.getChild("n26"));
  16285. }
  16286. }
  16287. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16288. class ui_Component84_1 extends fgui.GComponent {
  16289. static createInstance() {
  16290. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16291. }
  16292. onConstruct() {
  16293. this.c1 = this.getController("c1");
  16294. this.n4 = (this.getChild("n4"));
  16295. this.n22 = (this.getChild("n22"));
  16296. this.n23 = (this.getChild("n23"));
  16297. this.numTxt = (this.getChild("numTxt"));
  16298. this.n25 = (this.getChild("n25"));
  16299. this.n26 = (this.getChild("n26"));
  16300. }
  16301. }
  16302. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16303. class ui_Component85 extends fgui.GComponent {
  16304. static createInstance() {
  16305. return (fgui.UIPackage.createObject("game", "Component85"));
  16306. }
  16307. onConstruct() {
  16308. this.n1 = (this.getChild("n1"));
  16309. this.n6 = (this.getChild("n6"));
  16310. this.n2 = (this.getChild("n2"));
  16311. this.n3 = (this.getChild("n3"));
  16312. this.levelTxt = (this.getChild("levelTxt"));
  16313. this.n10 = (this.getChild("n10"));
  16314. this.n11 = (this.getChild("n11"));
  16315. this.n12 = (this.getChild("n12"));
  16316. this.n13 = (this.getChild("n13"));
  16317. this.n14 = (this.getChild("n14"));
  16318. this.modeNode = (this.getChild("modeNode"));
  16319. this.n18 = (this.getChild("n18"));
  16320. this.conditionTxt = (this.getChild("conditionTxt"));
  16321. this.diamondNode = (this.getChild("diamondNode"));
  16322. this.coinNode = (this.getChild("coinNode"));
  16323. this.startBtn = (this.getChild("startBtn"));
  16324. this.n28 = (this.getChild("n28"));
  16325. this.displayRoot = (this.getChild("displayRoot"));
  16326. this.t0 = this.getTransition("t0");
  16327. }
  16328. }
  16329. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16330. class ui_Component86 extends fgui.GButton {
  16331. static createInstance() {
  16332. return (fgui.UIPackage.createObject("game", "Component86"));
  16333. }
  16334. onConstruct() {
  16335. this.n15 = (this.getChild("n15"));
  16336. this.t0 = this.getTransition("t0");
  16337. }
  16338. }
  16339. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16340. class ui_Component87 extends fgui.GComponent {
  16341. static createInstance() {
  16342. return (fgui.UIPackage.createObject("game", "Component87"));
  16343. }
  16344. onConstruct() {
  16345. this.n66 = (this.getChild("n66"));
  16346. this.myProgress = (this.getChild("myProgress"));
  16347. this.starAni = (this.getChild("starAni"));
  16348. this.hpTxt = (this.getChild("hpTxt"));
  16349. this.n74 = (this.getChild("n74"));
  16350. this.n73 = (this.getChild("n73"));
  16351. this.ballTxt = (this.getChild("ballTxt"));
  16352. this.n76 = (this.getChild("n76"));
  16353. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16354. this.levelTxt = (this.getChild("levelTxt"));
  16355. this.star1 = (this.getChild("star1"));
  16356. this.star2 = (this.getChild("star2"));
  16357. this.star3 = (this.getChild("star3"));
  16358. }
  16359. }
  16360. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16361. class ui_Component88 extends fgui.GProgressBar {
  16362. static createInstance() {
  16363. return (fgui.UIPackage.createObject("game", "Component88"));
  16364. }
  16365. onConstruct() {
  16366. this.n68 = (this.getChild("n68"));
  16367. this.bar = (this.getChild("bar"));
  16368. }
  16369. }
  16370. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16371. class ui_Component89 extends fgui.GComponent {
  16372. static createInstance() {
  16373. return (fgui.UIPackage.createObject("game", "Component89"));
  16374. }
  16375. onConstruct() {
  16376. this.c1 = this.getController("c1");
  16377. this.n71 = (this.getChild("n71"));
  16378. this.n72 = (this.getChild("n72"));
  16379. }
  16380. }
  16381. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16382. class ui_Component90 extends fgui.GComponent {
  16383. static createInstance() {
  16384. return (fgui.UIPackage.createObject("game", "Component90"));
  16385. }
  16386. onConstruct() {
  16387. this.c1 = this.getController("c1");
  16388. this.n64 = (this.getChild("n64"));
  16389. this.n65 = (this.getChild("n65"));
  16390. this.n66 = (this.getChild("n66"));
  16391. this.t0 = this.getTransition("t0");
  16392. }
  16393. }
  16394. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16395. class ui_Component127 extends fgui.GButton {
  16396. static createInstance() {
  16397. return (fgui.UIPackage.createObject("game", "Component127"));
  16398. }
  16399. onConstruct() {
  16400. this.n5 = (this.getChild("n5"));
  16401. }
  16402. }
  16403. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16404. class gameBinder {
  16405. static bindAll() {
  16406. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16407. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16408. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16409. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16410. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16411. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16412. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16413. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16414. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16415. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16416. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16417. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16418. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16419. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16420. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16421. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16422. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16423. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16424. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16425. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16426. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16427. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16428. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16429. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16430. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16431. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16432. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16433. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16434. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16435. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16436. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16437. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16438. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16439. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16440. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16441. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16442. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16443. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16444. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16445. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16446. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16447. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16448. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16449. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16450. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16451. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16452. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16453. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16454. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16455. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16456. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16457. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16458. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16459. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16460. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16461. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16462. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16463. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16464. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16465. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16466. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16467. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16468. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16469. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16470. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16471. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16472. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16473. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16474. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16475. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16476. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16477. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16478. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16479. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16480. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16481. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16482. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16483. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16484. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16485. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16486. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16487. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16488. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16489. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16490. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16491. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16492. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16493. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16494. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16495. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16496. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16497. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16498. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16499. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16500. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16501. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16502. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16503. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16504. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16505. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16506. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16507. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16508. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16509. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16510. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16511. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16512. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16513. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16514. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16515. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16516. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16517. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16518. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16519. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16520. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16521. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16522. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16523. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16524. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16525. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16526. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16527. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16528. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16529. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16530. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16531. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16532. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16533. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16534. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16535. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16536. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16537. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16538. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16539. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16540. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16541. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16542. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16543. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16544. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16545. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16546. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16547. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16548. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16549. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16550. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16551. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16552. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16553. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16554. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16555. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16556. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16557. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16558. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16559. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16560. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16561. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16562. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16563. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16564. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16565. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16566. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16567. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16568. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16569. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16570. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16571. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16572. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16573. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16574. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16575. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16576. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16577. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16578. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16579. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16580. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16581. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16582. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16583. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16584. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16585. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16586. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16587. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16588. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16589. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16590. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16591. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16592. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16593. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16594. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16595. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16596. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16597. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16598. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16599. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16600. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16601. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16602. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16603. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16604. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16605. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16606. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16607. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16608. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16609. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16610. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16611. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16612. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16613. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16614. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16615. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16616. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16617. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16618. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16619. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16620. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16621. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16622. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16623. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16624. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16625. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16626. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16627. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16628. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16629. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16630. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16631. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16632. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16633. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16634. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16635. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16636. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16637. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16638. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16639. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16640. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16641. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16642. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16643. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16644. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16645. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16646. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16647. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16648. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16649. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16650. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16651. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16652. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16653. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16654. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16655. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16656. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16657. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16658. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16659. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16660. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16661. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16662. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16663. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16664. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16665. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16666. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16667. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16668. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16669. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16670. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16671. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16672. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16673. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16674. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16675. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16676. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16677. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16678. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16679. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16680. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16681. }
  16682. }
  16683. class ui_btn6 extends fgui.GButton {
  16684. static createInstance() {
  16685. return (fgui.UIPackage.createObject("loading", "btn6"));
  16686. }
  16687. onConstruct() {
  16688. this.n6 = (this.getChild("n6"));
  16689. this.n1 = (this.getChild("n1"));
  16690. }
  16691. }
  16692. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16693. class ui_xyItem extends fgui.GComponent {
  16694. static createInstance() {
  16695. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16696. }
  16697. onConstruct() {
  16698. this.xyItem = (this.getChild("xyItem"));
  16699. }
  16700. }
  16701. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16702. class ui_loadinfo extends fgui.GProgressBar {
  16703. static createInstance() {
  16704. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16705. }
  16706. onConstruct() {
  16707. this.bg = (this.getChild("bg"));
  16708. this.bar = (this.getChild("bar"));
  16709. this.title = (this.getChild("title"));
  16710. this.ani = (this.getChild("ani"));
  16711. }
  16712. }
  16713. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16714. class ui_xyNode extends fgui.GComponent {
  16715. static createInstance() {
  16716. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16717. }
  16718. onConstruct() {
  16719. this.n0 = (this.getChild("n0"));
  16720. this.btnYes = (this.getChild("btnYes"));
  16721. this.btnNo = (this.getChild("btnNo"));
  16722. this.btnKnown = (this.getChild("btnKnown"));
  16723. this.btnSure = (this.getChild("btnSure"));
  16724. this.txtWelcom = (this.getChild("txtWelcom"));
  16725. this.txtXy = (this.getChild("txtXy"));
  16726. this.n75 = (this.getChild("n75"));
  16727. this.btnXy1 = (this.getChild("btnXy1"));
  16728. this.btnXy3 = (this.getChild("btnXy3"));
  16729. this.btnXy2 = (this.getChild("btnXy2"));
  16730. this.n74 = (this.getChild("n74"));
  16731. this.xy1 = (this.getChild("xy1"));
  16732. this.txtTitle = (this.getChild("txtTitle"));
  16733. this.btnBack = (this.getChild("btnBack"));
  16734. this.xyList = (this.getChild("xyList"));
  16735. this.xy2 = (this.getChild("xy2"));
  16736. this.xyNode = (this.getChild("xyNode"));
  16737. }
  16738. }
  16739. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16740. class ui_ageNode extends fgui.GComponent {
  16741. static createInstance() {
  16742. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16743. }
  16744. onConstruct() {
  16745. this.n3 = (this.getChild("n3"));
  16746. this.n7 = (this.getChild("n7"));
  16747. this.n4 = (this.getChild("n4"));
  16748. this.btnAge = (this.getChild("btnAge"));
  16749. this.ageNode = (this.getChild("ageNode"));
  16750. }
  16751. }
  16752. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16753. class ui_rnNode extends fgui.GComponent {
  16754. static createInstance() {
  16755. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16756. }
  16757. onConstruct() {
  16758. this.n28 = (this.getChild("n28"));
  16759. this.n30 = (this.getChild("n30"));
  16760. this.n33 = (this.getChild("n33"));
  16761. this.rn1 = (this.getChild("rn1"));
  16762. this.n40 = (this.getChild("n40"));
  16763. this.n41 = (this.getChild("n41"));
  16764. this.rn3 = (this.getChild("rn3"));
  16765. this.n37 = (this.getChild("n37"));
  16766. this.n39 = (this.getChild("n39"));
  16767. this.rn2 = (this.getChild("rn2"));
  16768. this.n47 = (this.getChild("n47"));
  16769. this.n49 = (this.getChild("n49"));
  16770. this.n44 = (this.getChild("n44"));
  16771. this.inputCode = (this.getChild("inputCode"));
  16772. this.inputName = (this.getChild("inputName"));
  16773. this.n48 = (this.getChild("n48"));
  16774. this.n50 = (this.getChild("n50"));
  16775. this.rn4 = (this.getChild("rn4"));
  16776. this.btnCheck = (this.getChild("btnCheck"));
  16777. this.btnExit = (this.getChild("btnExit"));
  16778. this.btnDone = (this.getChild("btnDone"));
  16779. this.rnNode = (this.getChild("rnNode"));
  16780. }
  16781. }
  16782. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16783. class ui_tipNode extends fgui.GComponent {
  16784. static createInstance() {
  16785. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16786. }
  16787. onConstruct() {
  16788. this.bg = (this.getChild("bg"));
  16789. this.n55 = (this.getChild("n55"));
  16790. this.n56 = (this.getChild("n56"));
  16791. this.tipNode = (this.getChild("tipNode"));
  16792. }
  16793. }
  16794. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16795. class ui_fcmNode extends fgui.GComponent {
  16796. static createInstance() {
  16797. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16798. }
  16799. onConstruct() {
  16800. this.n63 = (this.getChild("n63"));
  16801. this.n62 = (this.getChild("n62"));
  16802. this.btnRn = (this.getChild("btnRn"));
  16803. this.n61 = (this.getChild("n61"));
  16804. this.n58 = (this.getChild("n58"));
  16805. this.fcmNode = (this.getChild("fcmNode"));
  16806. }
  16807. }
  16808. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16809. class ui_msgNode extends fgui.GComponent {
  16810. static createInstance() {
  16811. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16812. }
  16813. onConstruct() {
  16814. this.n69 = (this.getChild("n69"));
  16815. this.txtMsg = (this.getChild("txtMsg"));
  16816. this.msgNode = (this.getChild("msgNode"));
  16817. }
  16818. }
  16819. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16820. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16821. static createInstance() {
  16822. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16823. }
  16824. onConstruct() {
  16825. this.n1 = (this.getChild("n1"));
  16826. this.n13 = (this.getChild("n13"));
  16827. this.n14 = (this.getChild("n14"));
  16828. this.n15 = (this.getChild("n15"));
  16829. this.n3 = (this.getChild("n3"));
  16830. this.n4 = (this.getChild("n4"));
  16831. this.n5 = (this.getChild("n5"));
  16832. this.n6 = (this.getChild("n6"));
  16833. this.n7 = (this.getChild("n7"));
  16834. this.n8 = (this.getChild("n8"));
  16835. this.n9 = (this.getChild("n9"));
  16836. this.n10 = (this.getChild("n10"));
  16837. this.n12 = (this.getChild("n12"));
  16838. this.n11 = (this.getChild("n11"));
  16839. this.n16 = (this.getChild("n16"));
  16840. this.n17 = (this.getChild("n17"));
  16841. this.n18 = (this.getChild("n18"));
  16842. this.n20 = (this.getChild("n20"));
  16843. this.n21 = (this.getChild("n21"));
  16844. this.t0 = this.getTransition("t0");
  16845. }
  16846. }
  16847. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16848. class ui_btn5 extends fgui.GButton {
  16849. static createInstance() {
  16850. return (fgui.UIPackage.createObject("loading", "btn5"));
  16851. }
  16852. onConstruct() {
  16853. this.n9 = (this.getChild("n9"));
  16854. this.n1 = (this.getChild("n1"));
  16855. }
  16856. }
  16857. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16858. class ui_UILoading extends fgui.GComponent {
  16859. static createInstance() {
  16860. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16861. }
  16862. onConstruct() {
  16863. this.n12 = (this.getChild("n12"));
  16864. this.loadinfo = (this.getChild("loadinfo"));
  16865. this.n13 = (this.getChild("n13"));
  16866. this.txtLoad = (this.getChild("txtLoad"));
  16867. this.n18 = (this.getChild("n18"));
  16868. }
  16869. }
  16870. ui_UILoading.URL = "ui://37nctnhwphc33";
  16871. class ui_AgeItem extends fgui.GComponent {
  16872. static createInstance() {
  16873. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16874. }
  16875. onConstruct() {
  16876. this.txtAge = (this.getChild("txtAge"));
  16877. }
  16878. }
  16879. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16880. class ui_btn1 extends fgui.GButton {
  16881. static createInstance() {
  16882. return (fgui.UIPackage.createObject("loading", "btn1"));
  16883. }
  16884. onConstruct() {
  16885. this.n6 = (this.getChild("n6"));
  16886. this.n1 = (this.getChild("n1"));
  16887. }
  16888. }
  16889. ui_btn1.URL = "ui://37nctnhwxe622p";
  16890. class ui_btn3 extends fgui.GButton {
  16891. static createInstance() {
  16892. return (fgui.UIPackage.createObject("loading", "btn3"));
  16893. }
  16894. onConstruct() {
  16895. this.n9 = (this.getChild("n9"));
  16896. this.n1 = (this.getChild("n1"));
  16897. }
  16898. }
  16899. ui_btn3.URL = "ui://37nctnhwxe622s";
  16900. class ui_btn2 extends fgui.GButton {
  16901. static createInstance() {
  16902. return (fgui.UIPackage.createObject("loading", "btn2"));
  16903. }
  16904. onConstruct() {
  16905. this.n6 = (this.getChild("n6"));
  16906. this.n1 = (this.getChild("n1"));
  16907. }
  16908. }
  16909. ui_btn2.URL = "ui://37nctnhwxe622t";
  16910. class ui_btnBack extends fgui.GButton {
  16911. static createInstance() {
  16912. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16913. }
  16914. onConstruct() {
  16915. this.n6 = (this.getChild("n6"));
  16916. this.n7 = (this.getChild("n7"));
  16917. }
  16918. }
  16919. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16920. class ui_btnXy1 extends fgui.GButton {
  16921. static createInstance() {
  16922. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16923. }
  16924. onConstruct() {
  16925. this.n1 = (this.getChild("n1"));
  16926. }
  16927. }
  16928. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16929. class ui_btnXy2 extends fgui.GButton {
  16930. static createInstance() {
  16931. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16932. }
  16933. onConstruct() {
  16934. this.n1 = (this.getChild("n1"));
  16935. }
  16936. }
  16937. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16938. class ui_btnXy3 extends fgui.GButton {
  16939. static createInstance() {
  16940. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16941. }
  16942. onConstruct() {
  16943. this.n1 = (this.getChild("n1"));
  16944. }
  16945. }
  16946. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16947. class ui_btn4 extends fgui.GButton {
  16948. static createInstance() {
  16949. return (fgui.UIPackage.createObject("loading", "btn4"));
  16950. }
  16951. onConstruct() {
  16952. this.n9 = (this.getChild("n9"));
  16953. this.n1 = (this.getChild("n1"));
  16954. }
  16955. }
  16956. ui_btn4.URL = "ui://37nctnhwxe622z";
  16957. class loadingBinder {
  16958. static bindAll() {
  16959. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16960. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16961. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16962. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16963. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16964. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16965. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16966. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16967. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16968. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16969. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16970. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16971. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16972. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16973. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16974. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16975. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16976. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16977. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16978. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16979. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16980. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16981. }
  16982. }
  16983. class UIMgr {
  16984. constructor() {
  16985. this._stage = null;
  16986. this._uiList = [];
  16987. this._showList = [];
  16988. this._bindPkgList = [];
  16989. this.uiIndex = 0;
  16990. }
  16991. static get inst() {
  16992. if (UIMgr._inst == null) {
  16993. UIMgr._inst = new UIMgr();
  16994. }
  16995. return UIMgr._inst;
  16996. }
  16997. setStage(s) {
  16998. if (this._stage) {
  16999. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17000. return;
  17001. }
  17002. this._stage = s;
  17003. }
  17004. clearTempData() {
  17005. console.log('zh:clearTempData start');
  17006. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17007. console.log('zh:clearTempData end');
  17008. }
  17009. init() {
  17010. this.setStage(Laya.stage);
  17011. fairygui.UIConfig.defaultFont = "微软雅黑";
  17012. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17013. fairygui.UIConfig.packageFileExtension = "obj";
  17014. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17015. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17016. fairygui.GRoot.inst.width = Laya.stage.width;
  17017. fairygui.GRoot.inst.height = Laya.stage.height;
  17018. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17019. }
  17020. addAllUpdate() {
  17021. this.uiIndex = 0;
  17022. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17023. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17024. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17025. }
  17026. }
  17027. }
  17028. bindFUI(pkgname) {
  17029. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17030. return;
  17031. }
  17032. switch (pkgname) {
  17033. case fguiRes.loading:
  17034. fairygui.UIPackage.addPackage(pkgname);
  17035. loadingBinder.bindAll();
  17036. this._bindPkgList.push(pkgname);
  17037. break;
  17038. case fguiRes.game:
  17039. fairygui.UIPackage.addPackage(pkgname);
  17040. gameBinder.bindAll();
  17041. this._bindPkgList.push(pkgname);
  17042. break;
  17043. default:
  17044. break;
  17045. }
  17046. }
  17047. Show(cls, ...param) {
  17048. let nameStr = cls.uiName;
  17049. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17050. let temp = this._uiList[i];
  17051. let str = temp.className;
  17052. if (str == nameStr) {
  17053. if (temp.isMuti) {
  17054. if (temp.isHide) {
  17055. temp.show(...param);
  17056. this._uiList.splice(i, 1);
  17057. this._uiList.push(temp);
  17058. return temp;
  17059. }
  17060. }
  17061. else {
  17062. temp.show(...param);
  17063. this._uiList.splice(i, 1);
  17064. this._uiList.push(temp);
  17065. return temp;
  17066. }
  17067. }
  17068. }
  17069. let ui = new cls();
  17070. ui.className = nameStr;
  17071. this._showUI(ui, param);
  17072. return ui;
  17073. }
  17074. destroyUI(ui) {
  17075. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17076. let temp = this._uiList[i].className;
  17077. if (temp == ui.className) {
  17078. this._uiList.splice(i, 1);
  17079. break;
  17080. }
  17081. }
  17082. this.checkUIState();
  17083. }
  17084. _showUI(ui, param) {
  17085. this._uiList.push(ui);
  17086. ui.show(...param);
  17087. }
  17088. Hide(uiClass) {
  17089. let ui = this.getUI(uiClass);
  17090. if (ui && !ui.isHide) {
  17091. ui.hide();
  17092. }
  17093. }
  17094. getUI(ui) {
  17095. let nameStr = ui.uiName;
  17096. for (let index = 0; index < this._uiList.length; index++) {
  17097. let temp = this._uiList[index];
  17098. if (temp.className == nameStr) {
  17099. return temp;
  17100. }
  17101. }
  17102. return null;
  17103. }
  17104. isShow(cls) {
  17105. for (var i of this._uiList) {
  17106. if (i instanceof cls) {
  17107. return i.isShowing;
  17108. }
  17109. }
  17110. return false;
  17111. }
  17112. showUINum() {
  17113. let num = 0;
  17114. for (var i of this._uiList) {
  17115. if (i.isShowing) {
  17116. num++;
  17117. }
  17118. }
  17119. return num;
  17120. }
  17121. checkUIState() {
  17122. Laya.timer.clear(this, this._uiCheck);
  17123. Laya.timer.once(400, this, this._uiCheck);
  17124. }
  17125. _uiCheck() {
  17126. let showList = [];
  17127. for (var i of this._uiList) {
  17128. if (!i.isHide) {
  17129. showList.push(i);
  17130. }
  17131. }
  17132. for (let index = 0; index < showList.length; index++) {
  17133. if (index == showList.length - 1) {
  17134. showList[index].checkActive(true);
  17135. }
  17136. else {
  17137. showList[index].checkActive(false);
  17138. }
  17139. }
  17140. }
  17141. showTip(msg, time = 600, size = 30) {
  17142. }
  17143. }
  17144. class UIShowList {
  17145. }
  17146. class SoundMgr {
  17147. constructor() {
  17148. this.soundMax = 4;
  17149. this.isLoad = false;
  17150. this.soundMap = {};
  17151. this.isSound = true;
  17152. this.openShake = true;
  17153. SoundMgr._instance = this;
  17154. }
  17155. static getInstance() {
  17156. if (!this._instance) {
  17157. this._instance = new SoundMgr();
  17158. }
  17159. return this._instance;
  17160. }
  17161. init() {
  17162. console.log('zh:sm init 1');
  17163. Laya.SoundManager.autoReleaseSound = true;
  17164. Laya.SoundManager.autoStopMusic = true;
  17165. Laya.SoundManager.musicVolume = 0.3;
  17166. Laya.SoundManager.soundVolume = 0.5;
  17167. this.musicPlayed = false;
  17168. this.audioUrl = "asset/sound/ogg/";
  17169. console.log('zh:sm init 2');
  17170. console.log('zh:dev type ');
  17171. if (Laya.Browser.onAndroid) {
  17172. console.log('zh:dev type android');
  17173. this.audioUrl = "asset/sound/ogg/";
  17174. this.isLoad = true;
  17175. }
  17176. else {
  17177. console.log('zh:dev type not android');
  17178. this.audioUrl = "asset/sound/mp3/";
  17179. this.isLoad = true;
  17180. }
  17181. }
  17182. onSetting(isS) {
  17183. this.isSound = isS;
  17184. this.mute(!this.isSound);
  17185. }
  17186. clearCount() {
  17187. for (var key in this.soundMap) {
  17188. delete this.soundMap[key];
  17189. }
  17190. }
  17191. playMusic(path, loop = 0) {
  17192. console.log('zh:playMusic 1 PATH=' + path);
  17193. this.musicPath = path;
  17194. if (!this.isLoad) {
  17195. return;
  17196. }
  17197. if (!path || path == "") {
  17198. return;
  17199. }
  17200. if (!this.isSound) {
  17201. return;
  17202. }
  17203. this.musicPlayed = true;
  17204. let url = this.getUrl(path);
  17205. if (!Laya.Browser.onAndroid) {
  17206. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17207. this.play(url, loop);
  17208. }));
  17209. }
  17210. else {
  17211. this.play(url, loop);
  17212. }
  17213. }
  17214. play(url, loop) {
  17215. Laya.SoundManager.playMusic(url, loop);
  17216. }
  17217. getUrl(path) {
  17218. let url = this.audioUrl + path;
  17219. if (Laya.Browser.onAndroid) {
  17220. url += ".ogg";
  17221. }
  17222. else {
  17223. url += ".mp3";
  17224. }
  17225. return url;
  17226. }
  17227. pauseMusic(pause) {
  17228. if (pause) {
  17229. this.mute(true);
  17230. }
  17231. else if (this.isSound)
  17232. this.mute(false);
  17233. }
  17234. stopMusic() {
  17235. Laya.SoundManager.stopMusic();
  17236. if (Moyu.isNeedPlatAudio) {
  17237. Moyu.stopMusic();
  17238. }
  17239. }
  17240. mute(mute) {
  17241. if (Moyu.isNeedPlatAudio) {
  17242. Moyu.pauseMusic(mute);
  17243. }
  17244. else {
  17245. Laya.SoundManager.musicMuted = mute;
  17246. if (!mute && !this.musicPlayed && this.musicPath) {
  17247. this.playMusic(this.musicPath);
  17248. }
  17249. }
  17250. }
  17251. stopSound(path) {
  17252. let url = this.getUrl(path);
  17253. Laya.SoundManager.stopSound(url);
  17254. }
  17255. playSound(path, loop = 1, soundMax = this.soundMax) {
  17256. if (!this.isLoad)
  17257. return;
  17258. if (!this.isSound)
  17259. return;
  17260. if (!path || path == "")
  17261. return;
  17262. let url = this.getUrl(path);
  17263. if (Moyu.isNeedPlatAudio) {
  17264. Moyu.playSound(path, loop == 0);
  17265. }
  17266. else {
  17267. let count = 1;
  17268. if (this.soundMap[path])
  17269. count = this.soundMap[path] + 1;
  17270. if (count > soundMax)
  17271. return;
  17272. this.soundMap[path] = count;
  17273. Laya.SoundManager.playSound(url, loop);
  17274. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17275. }
  17276. }
  17277. removePath(path) {
  17278. if (this.soundMap[path]) {
  17279. let count = this.soundMap[path];
  17280. count--;
  17281. if (count < 1)
  17282. delete this.soundMap[path];
  17283. else
  17284. this.soundMap[path] = count;
  17285. }
  17286. }
  17287. playBtnSound() {
  17288. this.playSound("btn");
  17289. }
  17290. playGetSound() {
  17291. }
  17292. playCloseUISound() {
  17293. }
  17294. }
  17295. SoundMgr._instance = null;
  17296. var Handler$1 = Laya.Handler;
  17297. var EResType;
  17298. (function (EResType) {
  17299. EResType[EResType["none"] = 0] = "none";
  17300. EResType[EResType["nromal"] = 1] = "nromal";
  17301. EResType[EResType["td"] = 2] = "td";
  17302. EResType[EResType["sk"] = 3] = "sk";
  17303. })(EResType || (EResType = {}));
  17304. class CResLoader {
  17305. constructor(doneCall, proCall) {
  17306. this.completrCall = doneCall;
  17307. this.progressCall = proCall;
  17308. this.progressHander = new Handler$1(this, this.onProgress);
  17309. this.tdResMap = {};
  17310. }
  17311. load(resList) {
  17312. this.resCount = 0;
  17313. this.loadCount = 0;
  17314. for (let i = 0; i < resList.length; i++) {
  17315. let path = resList[i];
  17316. if (!path)
  17317. continue;
  17318. this.resCount++;
  17319. let type = this.getResType(path);
  17320. if (type == EResType.nromal)
  17321. this.loadNromal(path);
  17322. else if (type == EResType.td)
  17323. this.loadTd(path);
  17324. }
  17325. }
  17326. getRes(path) {
  17327. let type = this.getResType(path);
  17328. if (type == EResType.nromal)
  17329. return Laya.loader.getRes(path);
  17330. else if (type == EResType.td) {
  17331. let res = this.tdResMap[path];
  17332. if (res)
  17333. return res.clone();
  17334. return null;
  17335. }
  17336. }
  17337. destroy() {
  17338. this.progressHander.clear();
  17339. this.progressHander = null;
  17340. }
  17341. clearRes(path) {
  17342. let type = this.getResType(path);
  17343. if (type == EResType.nromal)
  17344. Laya.loader.clearRes(path);
  17345. else if (type == EResType.td) {
  17346. let obj = this.tdResMap[path];
  17347. if (obj)
  17348. obj.destroy();
  17349. delete this.tdResMap[path];
  17350. }
  17351. }
  17352. getResType(path) {
  17353. let exs = this.getExtension(path);
  17354. if (exs == "sk")
  17355. return EResType.sk;
  17356. if (exs == "ls" || exs == "lh" || exs == "lm")
  17357. return EResType.td;
  17358. else
  17359. return EResType.nromal;
  17360. }
  17361. getExtension(res) {
  17362. var index = res.lastIndexOf(".");
  17363. return res.substr(index + 1);
  17364. }
  17365. loadNromal(path) {
  17366. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17367. if (res) {
  17368. this.onLoad();
  17369. }
  17370. else
  17371. console.log("load res fail:" + path);
  17372. }), this.progressHander);
  17373. }
  17374. loadSk() {
  17375. }
  17376. loadTd(path) {
  17377. if (this.tdResMap[path]) {
  17378. this.onLoad();
  17379. return;
  17380. }
  17381. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17382. if (res) {
  17383. this.tdResMap[path] = res;
  17384. this.onLoad();
  17385. }
  17386. else
  17387. console.log("load res fail:" + path);
  17388. }));
  17389. }
  17390. onLoad() {
  17391. this.loadCount++;
  17392. this.onProgress(1);
  17393. if (this.loadCount >= this.resCount) {
  17394. this.completrCall.run();
  17395. }
  17396. }
  17397. onProgress(pro) {
  17398. let progress = (this.loadCount + pro) / this.resCount;
  17399. this.progressCall.runWith(progress);
  17400. }
  17401. }
  17402. var Handler$2 = Laya.Handler;
  17403. class ResInfo {
  17404. constructor() {
  17405. this.index = 0;
  17406. }
  17407. }
  17408. class ResMgr {
  17409. constructor() {
  17410. this.resList = [];
  17411. this.doneList = [];
  17412. this.resMap = {};
  17413. this.currentLoad = null;
  17414. this.completeHandler = new Handler$2(this, this.onComplete);
  17415. this.progressHandler = new Handler$2(this, this.onProgress);
  17416. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17417. }
  17418. static getInstance() {
  17419. if (ResMgr._instance == null) {
  17420. ResMgr._instance = new ResMgr();
  17421. }
  17422. return ResMgr._instance;
  17423. }
  17424. loadList(list, completeHandler, progressHandler) {
  17425. if (list.length < 1) {
  17426. completeHandler.run();
  17427. return;
  17428. }
  17429. let info = this.getResInfo();
  17430. info.resList = list;
  17431. info.completeHandler = completeHandler;
  17432. info.progressHandler = progressHandler;
  17433. this.resList.push(info);
  17434. this.startLoad();
  17435. }
  17436. loadFguiRes(list, completeHandler, progressHandler) {
  17437. Laya.loader.load(list, completeHandler, progressHandler);
  17438. }
  17439. loadAny(list, completeHandler, progressHandler) {
  17440. Laya.loader.load(list, completeHandler, progressHandler);
  17441. }
  17442. load(path, completeHandler, progressHandler) {
  17443. let count = this.resMap[path];
  17444. if (count && count > 0) {
  17445. if (completeHandler)
  17446. completeHandler.run();
  17447. }
  17448. else
  17449. this.loadList([path], completeHandler, progressHandler);
  17450. }
  17451. getRes(path) {
  17452. let res = this.resMap[path];
  17453. if (!res)
  17454. this.showLog("资源不存在:" + path);
  17455. else
  17456. return this.loader.getRes(path);
  17457. }
  17458. clearList(list, force = false) {
  17459. if (!list || list.length < 1)
  17460. return;
  17461. let cr = () => {
  17462. for (const k in list) {
  17463. let v = list[k];
  17464. if (!v)
  17465. continue;
  17466. if (force) {
  17467. this.loader.clearRes(v);
  17468. delete this.resMap[v];
  17469. }
  17470. else {
  17471. let count = this.resMap[v];
  17472. if (count && count > 1) {
  17473. count--;
  17474. this.resMap[v] = count;
  17475. }
  17476. else {
  17477. this.loader.clearRes(v);
  17478. delete this.resMap[v];
  17479. }
  17480. }
  17481. }
  17482. if (!window.hasOwnProperty("ks"))
  17483. Laya.Resource.destroyUnusedResources();
  17484. };
  17485. Laya.timer.clearAll(this);
  17486. Laya.timer.once(2000, this, cr);
  17487. }
  17488. clear3D() {
  17489. for (const k in this.loader.tdResMap) {
  17490. this.loader.clearRes(k);
  17491. if (this.resMap[k])
  17492. delete this.resMap[k];
  17493. }
  17494. if (!window.hasOwnProperty("ks"))
  17495. Laya.Resource.destroyUnusedResources();
  17496. }
  17497. clear(path, force = false) {
  17498. this.clearList([path], force);
  17499. }
  17500. getResInfo() {
  17501. if (this.doneList.length > 0)
  17502. return this.doneList.pop();
  17503. else
  17504. return new ResInfo();
  17505. }
  17506. startLoad() {
  17507. if (this.currentLoad)
  17508. return;
  17509. this.currentLoad = this.resList.pop();
  17510. if (this.currentLoad) {
  17511. this.loader.load(this.currentLoad.resList);
  17512. }
  17513. }
  17514. onComplete() {
  17515. if (!this.currentLoad)
  17516. return;
  17517. for (const k in this.currentLoad.resList) {
  17518. let v = this.currentLoad.resList[k];
  17519. let count = this.resMap[v];
  17520. if (count)
  17521. count++;
  17522. else
  17523. count = 1;
  17524. this.resMap[v] = count;
  17525. }
  17526. if (this.currentLoad.completeHandler)
  17527. this.currentLoad.completeHandler.run();
  17528. this.doneList.push(this.currentLoad);
  17529. this.currentLoad = null;
  17530. this.startLoad();
  17531. }
  17532. onProgress(pro) {
  17533. if (!this.currentLoad)
  17534. return;
  17535. if (this.currentLoad.progressHandler)
  17536. this.currentLoad.progressHandler.runWith(pro);
  17537. }
  17538. showLog(str, ...args) {
  17539. console.log("[ResLoader] " + str);
  17540. }
  17541. }
  17542. ResMgr._instance = null;
  17543. class EventMgr extends Laya.EventDispatcher {
  17544. }
  17545. let eventMgr = new EventMgr();
  17546. /*! *****************************************************************************
  17547. Copyright (c) Microsoft Corporation. All rights reserved.
  17548. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17549. this file except in compliance with the License. You may obtain a copy of the
  17550. License at http://www.apache.org/licenses/LICENSE-2.0
  17551. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17552. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17553. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17554. MERCHANTABLITY OR NON-INFRINGEMENT.
  17555. See the Apache Version 2.0 License for specific language governing permissions
  17556. and limitations under the License.
  17557. ***************************************************************************** */
  17558. /* global Reflect, Promise */
  17559. var extendStatics = function(d, b) {
  17560. extendStatics = Object.setPrototypeOf ||
  17561. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17562. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17563. return extendStatics(d, b);
  17564. };
  17565. function __extends(d, b) {
  17566. extendStatics(d, b);
  17567. function __() { this.constructor = d; }
  17568. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17569. }
  17570. var __assign = function() {
  17571. __assign = Object.assign || function __assign(t) {
  17572. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17573. s = arguments[i];
  17574. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17575. }
  17576. return t;
  17577. };
  17578. return __assign.apply(this, arguments);
  17579. };
  17580. function __rest(s, e) {
  17581. var t = {};
  17582. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17583. t[p] = s[p];
  17584. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17585. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17586. t[p[i]] = s[p[i]];
  17587. return t;
  17588. }
  17589. function __decorate(decorators, target, key, desc) {
  17590. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17591. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17592. 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;
  17593. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17594. }
  17595. function __param(paramIndex, decorator) {
  17596. return function (target, key) { decorator(target, key, paramIndex); }
  17597. }
  17598. function __metadata(metadataKey, metadataValue) {
  17599. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17600. }
  17601. function __awaiter(thisArg, _arguments, P, generator) {
  17602. return new (P || (P = Promise))(function (resolve, reject) {
  17603. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17604. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17605. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17606. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17607. });
  17608. }
  17609. function __generator(thisArg, body) {
  17610. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17611. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17612. function verb(n) { return function (v) { return step([n, v]); }; }
  17613. function step(op) {
  17614. if (f) throw new TypeError("Generator is already executing.");
  17615. while (_) try {
  17616. 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;
  17617. if (y = 0, t) op = [op[0] & 2, t.value];
  17618. switch (op[0]) {
  17619. case 0: case 1: t = op; break;
  17620. case 4: _.label++; return { value: op[1], done: false };
  17621. case 5: _.label++; y = op[1]; op = [0]; continue;
  17622. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17623. default:
  17624. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17625. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17626. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17627. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17628. if (t[2]) _.ops.pop();
  17629. _.trys.pop(); continue;
  17630. }
  17631. op = body.call(thisArg, _);
  17632. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17633. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17634. }
  17635. }
  17636. function __exportStar(m, exports) {
  17637. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17638. }
  17639. function __values(o) {
  17640. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17641. if (m) return m.call(o);
  17642. return {
  17643. next: function () {
  17644. if (o && i >= o.length) o = void 0;
  17645. return { value: o && o[i++], done: !o };
  17646. }
  17647. };
  17648. }
  17649. function __read(o, n) {
  17650. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17651. if (!m) return o;
  17652. var i = m.call(o), r, ar = [], e;
  17653. try {
  17654. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17655. }
  17656. catch (error) { e = { error: error }; }
  17657. finally {
  17658. try {
  17659. if (r && !r.done && (m = i["return"])) m.call(i);
  17660. }
  17661. finally { if (e) throw e.error; }
  17662. }
  17663. return ar;
  17664. }
  17665. function __spread() {
  17666. for (var ar = [], i = 0; i < arguments.length; i++)
  17667. ar = ar.concat(__read(arguments[i]));
  17668. return ar;
  17669. }
  17670. function __await(v) {
  17671. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17672. }
  17673. function __asyncGenerator(thisArg, _arguments, generator) {
  17674. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17675. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17676. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17677. 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); }); }; }
  17678. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17679. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17680. function fulfill(value) { resume("next", value); }
  17681. function reject(value) { resume("throw", value); }
  17682. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17683. }
  17684. function __asyncDelegator(o) {
  17685. var i, p;
  17686. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17687. 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; }
  17688. }
  17689. function __asyncValues(o) {
  17690. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17691. var m = o[Symbol.asyncIterator], i;
  17692. 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);
  17693. 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); }); }; }
  17694. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17695. }
  17696. function __makeTemplateObject(cooked, raw) {
  17697. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17698. return cooked;
  17699. };
  17700. function __importStar(mod) {
  17701. if (mod && mod.__esModule) return mod;
  17702. var result = {};
  17703. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17704. result.default = mod;
  17705. return result;
  17706. }
  17707. function __importDefault(mod) {
  17708. return (mod && mod.__esModule) ? mod : { default: mod };
  17709. }
  17710. class CustomAlert {
  17711. static show(title, content, buttons) {
  17712. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17713. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17714. return;
  17715. }
  17716. const bg = new Laya.Box();
  17717. bg.alpha = 0;
  17718. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17719. Laya.stage.addChild(bg);
  17720. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17721. const panel = new Laya.Box();
  17722. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17723. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17724. bg.addChild(panel);
  17725. const titleText = new Laya.Text();
  17726. titleText.text = title;
  17727. titleText.fontSize = 32;
  17728. titleText.color = "#333333";
  17729. titleText.bold = true;
  17730. titleText.pos(20, 20);
  17731. titleText.width = 360;
  17732. titleText.align = "center";
  17733. panel.addChild(titleText);
  17734. const contentText = new Laya.Text();
  17735. contentText.text = content;
  17736. contentText.fontSize = 21;
  17737. contentText.color = "#555555";
  17738. contentText.pos(20, 70);
  17739. contentText.width = 360;
  17740. contentText.wordWrap = true;
  17741. contentText.align = "center";
  17742. panel.addChild(contentText);
  17743. const buttonContainer = new Laya.Box();
  17744. buttonContainer.pos(20, 160);
  17745. panel.addChild(buttonContainer);
  17746. const btnWidth = 120;
  17747. const spacing = 30;
  17748. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17749. buttons.forEach((btn, index) => {
  17750. const button = new Laya.Button();
  17751. button.label = btn.label;
  17752. button.size(btnWidth, 40);
  17753. button.labelSize = 22;
  17754. button.pos(index * (btnWidth + spacing), 0);
  17755. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17756. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17757. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17758. button.alpha = 0.9;
  17759. });
  17760. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17761. button.alpha = 1;
  17762. });
  17763. button.on(Laya.Event.CLICK, this, () => {
  17764. btn.handler();
  17765. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17766. bg.removeSelf();
  17767. }));
  17768. });
  17769. buttonContainer.addChild(button);
  17770. });
  17771. buttonContainer.x = (panel.width - totalWidth) / 2;
  17772. }
  17773. }
  17774. class ConfigMgr {
  17775. constructor() {
  17776. this.httpReqCount = 4;
  17777. this.httpReqOkCount = 0;
  17778. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17779. try {
  17780. this.httpReqOkCount = 0;
  17781. let reqData = xGame.httpMgr.getReqData();
  17782. console.log('zh:第1个请求getClassicCfg');
  17783. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17784. this.classicCfg = classicCfg;
  17785. this.httpReqOkCount++;
  17786. console.log('zh:第2个请求getLevelCfg');
  17787. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17788. this.levelCfg = levelCfg;
  17789. this.httpReqOkCount++;
  17790. console.log('zh:第3个请求 getPlaceBallCfg');
  17791. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17792. this.placeBallCfg = placeBallCfg;
  17793. this.httpReqOkCount++;
  17794. console.log('zh:第4个请求 npc');
  17795. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17796. this.npcJson = npc.Data;
  17797. this.httpReqOkCount++;
  17798. console.log('zh:所有配置加载完成');
  17799. }
  17800. catch (error) {
  17801. console.error('❌请求失败:', error);
  17802. Laya.timer.once(5000, this, () => {
  17803. let retryCount = 0;
  17804. const maxRetries = 3;
  17805. const tryFetchConfig = () => {
  17806. try {
  17807. xGame.cfgMgr.getConfigFromServer();
  17808. }
  17809. catch (error) {
  17810. if (retryCount < maxRetries) {
  17811. retryCount++;
  17812. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17813. Laya.timer.once(5000, this, tryFetchConfig);
  17814. }
  17815. else {
  17816. console.error("❌ 达到最大重试次数,配置获取失败");
  17817. }
  17818. }
  17819. };
  17820. tryFetchConfig();
  17821. });
  17822. }
  17823. finally {
  17824. if (this.httpReqCount > this.httpReqOkCount) {
  17825. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17826. {
  17827. label: "Okay", handler: () => {
  17828. console.log("zh:好的知道了");
  17829. JSBridgeUtils.instance.exitAndCloseGame();
  17830. }
  17831. }
  17832. ]);
  17833. }
  17834. }
  17835. });
  17836. this.sendPostAsync = (action, reqData) => {
  17837. return new Promise((resolve, reject) => {
  17838. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17839. try {
  17840. let code = res.code;
  17841. if (code == 200) {
  17842. const parsedData = JSON.parse(res.msg);
  17843. resolve(parsedData);
  17844. }
  17845. else {
  17846. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17847. reject(new Error(`Request failed with code: ${code}`));
  17848. }
  17849. }
  17850. catch (error) {
  17851. console.error(`ERROR=${error}`);
  17852. alert("Please check your network connection.");
  17853. reject(error);
  17854. }
  17855. finally {
  17856. console.log(`zh:${action}的请求处理完毕`);
  17857. }
  17858. });
  17859. });
  17860. };
  17861. }
  17862. static getInstance() {
  17863. if (!this._instance) {
  17864. this._instance = new ConfigMgr();
  17865. }
  17866. return this._instance;
  17867. }
  17868. init() {
  17869. this.getConfigFromServer();
  17870. }
  17871. test() {
  17872. let reqData = xGame.httpMgr.getReqData();
  17873. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17874. console.log('zh:1s');
  17875. try {
  17876. let code = res.code;
  17877. let data = res.data;
  17878. if (code == 200) {
  17879. const parsedData = JSON.parse(data);
  17880. this.classicCfg = parsedData;
  17881. }
  17882. else {
  17883. console.log('zh:res = ' + JSON.stringify(res));
  17884. }
  17885. }
  17886. catch (error) {
  17887. console.log('error=' + error);
  17888. alert("Please check your network connection.");
  17889. }
  17890. finally {
  17891. console.log('zh:1');
  17892. }
  17893. });
  17894. }
  17895. getUserInfoByIndex(index) {
  17896. return this.npcJson[index];
  17897. }
  17898. getRandomUserInfo() {
  17899. let index = xGame.tools.random(0, this.npcJson.length);
  17900. let rs = this.npcJson[index];
  17901. return rs;
  17902. }
  17903. getMaxBigMoveLength() {
  17904. return Object.keys(this.levelCfg).length;
  17905. }
  17906. getBigMoveLevelByIndex(index) {
  17907. let cfg = this.levelCfg;
  17908. cfg = cfg[index];
  17909. return cfg;
  17910. }
  17911. getRandomClassicLevel() {
  17912. let cfg = this.classicCfg;
  17913. let num = Object.keys(cfg).length;
  17914. let rand = xGame.common.randomNum(1, num);
  17915. return cfg[rand];
  17916. }
  17917. getPlaceBallByLevel(level) {
  17918. return this.placeBallCfg[level];
  17919. }
  17920. getMaxPlaceBall() {
  17921. return Object.keys(this.placeBallCfg).length;
  17922. }
  17923. }
  17924. class PoolD3Mgr {
  17925. constructor() {
  17926. this.pool = {};
  17927. }
  17928. static get ins() {
  17929. return this._ins || (this._ins = new PoolD3Mgr);
  17930. }
  17931. createList(key, prefab, parent) {
  17932. if (!this.pool[key]) {
  17933. this.pool[key] = {};
  17934. this.pool[key].prefab = prefab;
  17935. this.pool[key].list = [];
  17936. this.pool[key].parent = parent;
  17937. }
  17938. }
  17939. getItem(key) {
  17940. if (!this.pool[key]) {
  17941. return;
  17942. }
  17943. let temp;
  17944. if (this.pool[key].list.length > 0) {
  17945. temp = this.pool[key].list.pop();
  17946. }
  17947. else {
  17948. temp = this.pool[key].prefab.clone();
  17949. if (this.pool[key].parent) {
  17950. this.pool[key].parent.addChild(temp);
  17951. }
  17952. }
  17953. temp.active = true;
  17954. return temp;
  17955. }
  17956. putItem(key, obj) {
  17957. if (!this.pool[key]) {
  17958. return;
  17959. }
  17960. obj.active = false;
  17961. this.pool[key].list.push(obj);
  17962. }
  17963. }
  17964. let context$1 = context;
  17965. let uiMgr = UIMgr.inst;
  17966. let soundMgr = SoundMgr.getInstance();
  17967. let resMgr = ResMgr.getInstance();
  17968. let httpMgr = HttpMgr.getInstance();
  17969. let common = Common.getInstance();
  17970. let cfgMgr = ConfigMgr.getInstance();
  17971. let poolD3Mgr = PoolD3Mgr.ins;
  17972. let d3TexUrl = "res/d3Res/";
  17973. let d3ModeUrl = "res/unityRes/";
  17974. function setStageSize(view) {
  17975. if (view.width) {
  17976. view.width = Laya.stage.width;
  17977. view.height = Laya.stage.height;
  17978. }
  17979. }
  17980. function filledBg(view) {
  17981. let wh = Laya.stage.height / Laya.stage.width;
  17982. if (wh > 16 / 9) {
  17983. view.height = Laya.stage.height;
  17984. view.width = Laya.stage.height / 1334 * 750;
  17985. }
  17986. else {
  17987. view.width = Laya.stage.width;
  17988. view.height = Laya.stage.width / 750 * 1334;
  17989. }
  17990. }
  17991. function setNotch(view) {
  17992. if (view.height) {
  17993. view.y += context$1.notchHeight;
  17994. }
  17995. }
  17996. function showTip(str) {
  17997. uiMgr.Show(UIMsg, str);
  17998. }
  17999. function log(...args) {
  18000. console.log(args);
  18001. }
  18002. let xGame = {
  18003. context: context$1,
  18004. eventMgr,
  18005. resMgr,
  18006. uiMgr,
  18007. soundMgr,
  18008. define,
  18009. tools,
  18010. httpMgr,
  18011. d3TexUrl,
  18012. d3ModeUrl,
  18013. common,
  18014. cfgMgr,
  18015. poolD3Mgr,
  18016. setStageSize,
  18017. filledBg,
  18018. setNotch,
  18019. showTip,
  18020. log,
  18021. };
  18022. window["xGame"] = xGame;
  18023. let dataName = 'tBall_';
  18024. class UserData {
  18025. constructor() {
  18026. this.userId = "";
  18027. this.isAgree = false;
  18028. this.coinNum = 0;
  18029. this.gemNum = 0;
  18030. this.sound = true;
  18031. this.vibration = true;
  18032. this.currentDate = 0;
  18033. this.createTime = 0;
  18034. this.awardTime = 0;
  18035. this.roleId = 1;
  18036. this.roleList = [];
  18037. this.roleAds = [];
  18038. this.dressId = 101;
  18039. this.itemId = 201;
  18040. this.bigSkills = [1, 1, 1, 1, 1];
  18041. this.coin = 4000;
  18042. this.diamond = 0;
  18043. this.skillSuccessTimes = 0;
  18044. this.skillGuide = 0;
  18045. this.skillAccTimes = 0;
  18046. this.placeBallData = [];
  18047. this.shareDiamondTimes = 0;
  18048. this.dailyVideoShareTimes = 0;
  18049. this.secretary = [1, 0];
  18050. this.curSecretary = 0;
  18051. this.ballRod = [1, 0, 0, 0, 0, 1];
  18052. this.curBallRod = 5;
  18053. this.signData = 0;
  18054. this.signTime = 0;
  18055. this.drawTimes = 0;
  18056. this.drawAwardTimes = 0;
  18057. this.dailyfreeDrawTimes = 1;
  18058. this.power = 5;
  18059. this.powerTime = 0;
  18060. this.challengeTimes = 0;
  18061. this.extraSign = 0;
  18062. this.classicTimes = 0;
  18063. this.guideHelpLine = 0;
  18064. this.newUser = true;
  18065. this.rootBallFoul = 0;
  18066. this.timeoutFoul = 0;
  18067. this.roleList = [1];
  18068. }
  18069. saveData() {
  18070. let data = {};
  18071. for (let k in this) {
  18072. data[k.toString()] = this[k];
  18073. }
  18074. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18075. }
  18076. getData() {
  18077. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18078. if (ld) {
  18079. let localData = JSON.parse(ld);
  18080. if (localData) {
  18081. for (let k in this) {
  18082. let key = k.toString();
  18083. let data = localData[key];
  18084. if (data != undefined) {
  18085. this[k] = data;
  18086. }
  18087. }
  18088. }
  18089. }
  18090. }
  18091. }
  18092. class ItemData {
  18093. constructor() {
  18094. this.itemList = {};
  18095. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18096. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18097. }
  18098. saveData() {
  18099. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18100. }
  18101. getData() {
  18102. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18103. if (ld) {
  18104. let localData = JSON.parse(ld);
  18105. if (localData) {
  18106. this.itemList = localData;
  18107. }
  18108. }
  18109. }
  18110. }
  18111. class GameData {
  18112. constructor() {
  18113. this.curLevel = 0;
  18114. this.gameType = 1;
  18115. this.signIdx = 0;
  18116. this.signMax = 0;
  18117. this.rotaryTime = 0;
  18118. this.rotaryCount = 0;
  18119. this.rotaryList = [];
  18120. this.diyCount = 3;
  18121. this.awardIdx = 0;
  18122. this.shareNum = 2;
  18123. this.rankWeek = 0;
  18124. this.rankScore = 0;
  18125. this.gameCount = 0;
  18126. this.trySkill = -1;
  18127. this.tryTime = 0;
  18128. }
  18129. saveData() {
  18130. let data = {};
  18131. for (let k in this) {
  18132. data[k.toString()] = this[k];
  18133. }
  18134. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18135. }
  18136. getData() {
  18137. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18138. if (ld) {
  18139. let localData = JSON.parse(ld);
  18140. if (localData) {
  18141. for (let k in this) {
  18142. let key = k.toString();
  18143. let data = localData[key];
  18144. if (data != undefined) {
  18145. this[k] = data;
  18146. }
  18147. }
  18148. }
  18149. }
  18150. }
  18151. }
  18152. class Diy2025GameData {
  18153. constructor() {
  18154. this.challengeMode_overLev = 0;
  18155. this.xszyForClassic = false;
  18156. this.xszyForChallenge = false;
  18157. }
  18158. saveData() {
  18159. let data = {};
  18160. for (let k in this) {
  18161. data[k.toString()] = this[k];
  18162. }
  18163. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18164. }
  18165. getData() {
  18166. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18167. if (ld) {
  18168. let localData = JSON.parse(ld);
  18169. if (localData) {
  18170. for (let k in this) {
  18171. let key = k.toString();
  18172. let data = localData[key];
  18173. if (data != undefined) {
  18174. this[k] = data;
  18175. }
  18176. }
  18177. }
  18178. }
  18179. }
  18180. }
  18181. class DataMgr {
  18182. static Init() {
  18183. this.userData = new UserData();
  18184. this.gameData = new GameData();
  18185. this.itemData = new ItemData();
  18186. this.diyGameData = new Diy2025GameData();
  18187. this.userData.getData();
  18188. this.gameData.getData();
  18189. this.itemData.getData();
  18190. this.diyGameData.getData();
  18191. this.roleId = this.userData.roleId;
  18192. this.resetUse();
  18193. }
  18194. static isNewDay() {
  18195. Moyu.isNewDay(this, (isnew) => {
  18196. xGame.common.isNewDay = isnew;
  18197. if (!isnew)
  18198. return;
  18199. DataMgr.setShareDiamondTimes(0, false);
  18200. DataMgr.setDailyVideoShareTimes(0, false);
  18201. DataMgr.setDailyfreeDrawTimes(1);
  18202. DataMgr.setExtraSign(0);
  18203. });
  18204. }
  18205. static deletData() {
  18206. Laya.LocalStorage.clear();
  18207. }
  18208. static upRankData() {
  18209. let num = xGame.common.getAllStarNum();
  18210. if (num > 0)
  18211. Moyu.upRankData(xGame.common.curRankID, num);
  18212. }
  18213. static addItem(id, count = 1) {
  18214. let v = this.itemData.itemList[id];
  18215. if (!v)
  18216. v = { id: id, count: count, adnum: 0, active: true };
  18217. else {
  18218. if (v.active) {
  18219. v.count += count;
  18220. }
  18221. else {
  18222. v.count = count;
  18223. v.active = true;
  18224. }
  18225. }
  18226. this.itemData.itemList[id] = v;
  18227. xGame.soundMgr.playGetSound();
  18228. this.saveItemData();
  18229. }
  18230. static hasItem(id) {
  18231. let v = this.itemData.itemList[id];
  18232. if (v && v.active)
  18233. return true;
  18234. return false;
  18235. }
  18236. static getItem(id) {
  18237. let v = this.itemData.itemList[id];
  18238. return v;
  18239. }
  18240. static getItemCount(id) {
  18241. let v = this.itemData.itemList[id];
  18242. if (v && v.active)
  18243. return v.count;
  18244. return 0;
  18245. }
  18246. static getItemAd(id) {
  18247. let v = this.itemData.itemList[id];
  18248. if (v) {
  18249. return v.adnum;
  18250. }
  18251. return 0;
  18252. }
  18253. static onItemAd(id, num = 1) {
  18254. let v = this.itemData.itemList[id];
  18255. if (!v)
  18256. v = { id: id, count: 1, adnum: num, active: false };
  18257. else
  18258. v.adnum += num;
  18259. this.itemData.itemList[id] = v;
  18260. this.saveItemData();
  18261. }
  18262. static costItem(id, count) {
  18263. let v = this.itemData.itemList[id];
  18264. if (v && v.active) {
  18265. if (v.count < count)
  18266. return false;
  18267. else {
  18268. v.count -= count;
  18269. this.itemData.itemList[id] = v;
  18270. return true;
  18271. }
  18272. }
  18273. return false;
  18274. }
  18275. static resetUse() {
  18276. this.dressId = this.userData.dressId;
  18277. this.itemId = this.userData.itemId;
  18278. }
  18279. static passLevel() {
  18280. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18281. this.gameData.curLevel++;
  18282. this.curLevel = this.gameData.curLevel;
  18283. this.saveGameData();
  18284. }
  18285. static useRole(id) {
  18286. this.roleId = id;
  18287. if (this.hasRole(id)) {
  18288. this.userData.roleId = id;
  18289. this.saveUserData();
  18290. }
  18291. }
  18292. static addRole(id) {
  18293. if (this.hasRole(id))
  18294. return;
  18295. this.userData.roleList.push(id);
  18296. this.saveUserData();
  18297. }
  18298. static hasRole(id) {
  18299. return this.userData.roleList.indexOf(id) >= 0;
  18300. }
  18301. static gemEnough(num) {
  18302. return this.userData.gemNum >= num;
  18303. }
  18304. static roleHasAd(id) {
  18305. let count = this.userData.roleAds[id];
  18306. if (count != undefined && count >= 0)
  18307. return true;
  18308. else
  18309. return false;
  18310. }
  18311. static saveUserData(time = 500, event, arg) {
  18312. if (this.userSaving)
  18313. return;
  18314. this.userSaving = true;
  18315. Laya.timer.once(time, this, () => {
  18316. this.userSaving = false;
  18317. this.userData.saveData();
  18318. if (event)
  18319. xGame.eventMgr.event(event, arg);
  18320. });
  18321. }
  18322. static updateUserNickName(loginUserName) {
  18323. let kyeStr = 'moyudata_180';
  18324. console.log('zh:################### kyeStr=' + kyeStr);
  18325. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18326. if (moyudata) {
  18327. const obj = JSON.parse(moyudata);
  18328. obj.nickName = loginUserName;
  18329. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18330. console.log('zh:################### updateUserNickName');
  18331. }
  18332. }
  18333. static saveGameData() {
  18334. if (this.gameSaving)
  18335. return;
  18336. this.gameSaving = true;
  18337. Laya.timer.once(1000, this, () => {
  18338. this.gameSaving = false;
  18339. this.gameData.saveData();
  18340. });
  18341. }
  18342. static saveItemData() {
  18343. let fun = () => {
  18344. this.itemData.saveData();
  18345. };
  18346. Laya.timer.clear(this, fun);
  18347. Laya.timer.once(500, this, fun);
  18348. }
  18349. static saveData() {
  18350. this.saveUserData();
  18351. this.saveGameData();
  18352. }
  18353. static getBigSkillList() {
  18354. return this.userData.bigSkills;
  18355. }
  18356. static getBigSkillByIndex(index) {
  18357. return this.userData.bigSkills[index];
  18358. }
  18359. static setBigSkill(index, val, addUp = true) {
  18360. if (addUp) {
  18361. this.userData.bigSkills[index] += val;
  18362. }
  18363. else {
  18364. this.userData.bigSkills[index] = val;
  18365. }
  18366. this.saveUserData();
  18367. }
  18368. static coinEnough(need) {
  18369. if (typeof need != "number") {
  18370. console.error("金币格式错误");
  18371. return;
  18372. }
  18373. return this.userData.coin >= need;
  18374. }
  18375. static setCoin(val) {
  18376. if (typeof val != "number") {
  18377. return;
  18378. }
  18379. this.userData.coin += val;
  18380. this.saveUserData();
  18381. xGame.eventMgr.event(COIN_CHANGE);
  18382. this.updateUserInfo2Server("jb");
  18383. }
  18384. static setCoin2(val) {
  18385. if (typeof val != "number") {
  18386. return;
  18387. }
  18388. this.userData.coin = val;
  18389. this.saveUserData();
  18390. xGame.eventMgr.event(COIN_CHANGE);
  18391. }
  18392. static setCoinFormServer(val) {
  18393. if (typeof val != "number") {
  18394. return;
  18395. }
  18396. this.userData.coin = val;
  18397. this.saveUserData();
  18398. console.log('zh:通知更新金币变化' + val);
  18399. xGame.eventMgr.event(COIN_CHANGE);
  18400. }
  18401. static getCoin() {
  18402. return this.userData.coin;
  18403. }
  18404. static diamondEnough(need) {
  18405. if (typeof need != "number") {
  18406. console.error("金币格式错误");
  18407. return;
  18408. }
  18409. return this.userData.diamond >= need;
  18410. }
  18411. static setDiamond(val) {
  18412. if (typeof val != "number") {
  18413. return;
  18414. }
  18415. this.userData.diamond += val;
  18416. this.saveUserData();
  18417. xGame.eventMgr.event(DIAMOND_CHANGE);
  18418. this.updateUserInfo2Server("zs");
  18419. }
  18420. static setDiamond2(val) {
  18421. if (typeof val != "number") {
  18422. return;
  18423. }
  18424. this.userData.diamond = val;
  18425. this.saveUserData();
  18426. xGame.eventMgr.event(DIAMOND_CHANGE);
  18427. }
  18428. static setDiamondFormServer(val) {
  18429. if (typeof val != "number") {
  18430. return;
  18431. }
  18432. this.userData.diamond = val;
  18433. this.saveUserData();
  18434. console.log('zh:通知更新钻石变化' + val);
  18435. xGame.eventMgr.event(DIAMOND_CHANGE);
  18436. }
  18437. static getDiamond() {
  18438. return this.userData.diamond;
  18439. }
  18440. static getSkillSuccessTimes() {
  18441. return this.userData.skillSuccessTimes;
  18442. }
  18443. static setSkillSuccessTimes(val, addUp = true) {
  18444. if (addUp)
  18445. this.userData.skillSuccessTimes += val;
  18446. else
  18447. this.userData.skillSuccessTimes = val;
  18448. this.saveUserData();
  18449. }
  18450. static getSkillAccTimes() {
  18451. return this.userData.skillAccTimes;
  18452. }
  18453. static setSkillAccTimes(val) {
  18454. this.userData.skillAccTimes += val;
  18455. this.saveUserData();
  18456. }
  18457. static getSkillGuide() {
  18458. if (!xGame.common.openGuide) {
  18459. return 1;
  18460. }
  18461. return this.userData.skillGuide;
  18462. }
  18463. static setSkillGuide(val) {
  18464. this.userData.skillGuide = val;
  18465. this.saveUserData();
  18466. }
  18467. static getPlaceBallLevelList() {
  18468. return this.userData.placeBallData;
  18469. }
  18470. static setPlaceBallLevelList(objStr) {
  18471. if (objStr) {
  18472. let obj = JSON.parse(objStr);
  18473. this.userData.placeBallData = obj;
  18474. let cd = obj.length;
  18475. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18476. xGame.common.placeBallCurLevel = cd;
  18477. DataMgr.setChallengeMode_overLev(cd);
  18478. this.saveUserData();
  18479. }
  18480. else {
  18481. this.userData.placeBallData = [];
  18482. this.saveUserData();
  18483. }
  18484. }
  18485. static getPlaceBallLevel(level) {
  18486. let arr = this.userData.placeBallData;
  18487. let index = level - 1;
  18488. let out;
  18489. if (arr[index]) {
  18490. out = arr[index];
  18491. }
  18492. else {
  18493. let max = arr.length;
  18494. if (max == index) {
  18495. out = {
  18496. star: 0,
  18497. play: true,
  18498. isCur: true,
  18499. getAward: false
  18500. };
  18501. }
  18502. else {
  18503. out = {
  18504. star: 0,
  18505. play: false,
  18506. getAward: false
  18507. };
  18508. }
  18509. }
  18510. return out;
  18511. }
  18512. static setPlaceBallLevel(level, star) {
  18513. let arr = this.userData.placeBallData;
  18514. let index = level - 1;
  18515. if (arr[index]) {
  18516. arr[index].star = Math.max(arr[index].star, star);
  18517. }
  18518. else {
  18519. let max = arr.length;
  18520. if (max == index) {
  18521. arr.push({
  18522. star: star,
  18523. play: true,
  18524. getAward: false
  18525. });
  18526. }
  18527. else {
  18528. console.error("关卡存储出错");
  18529. }
  18530. }
  18531. this.saveUserData();
  18532. }
  18533. static setPlaceBallAward(level) {
  18534. let arr = this.userData.placeBallData;
  18535. let index = level - 1;
  18536. if (arr[index]) {
  18537. arr[index].getAward = true;
  18538. }
  18539. this.saveUserData();
  18540. }
  18541. static getShareDiamondTimes() {
  18542. return this.userData.shareDiamondTimes;
  18543. }
  18544. static setShareDiamondTimes(val, addUp = true) {
  18545. if (addUp) {
  18546. this.userData.shareDiamondTimes += val;
  18547. }
  18548. else {
  18549. this.userData.shareDiamondTimes = val;
  18550. }
  18551. this.saveUserData();
  18552. }
  18553. static getDailyVideoShareTimes() {
  18554. return this.userData.dailyVideoShareTimes;
  18555. }
  18556. static setDailyVideoShareTimes(val, addUp = true) {
  18557. if (addUp) {
  18558. this.userData.dailyVideoShareTimes += val;
  18559. }
  18560. else {
  18561. this.userData.dailyVideoShareTimes = val;
  18562. }
  18563. this.saveUserData();
  18564. }
  18565. static getSecretary(index) {
  18566. return this.userData.secretary[index];
  18567. }
  18568. static setSecretary(index, val) {
  18569. this.userData.secretary[index] = val;
  18570. this.saveUserData();
  18571. }
  18572. static getCurSecretary() {
  18573. return this.userData.curSecretary;
  18574. }
  18575. static setCurSecretary(index) {
  18576. this.userData.curSecretary = index;
  18577. this.saveUserData();
  18578. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18579. }
  18580. static getBallRod(index) {
  18581. return this.userData.ballRod[index];
  18582. }
  18583. static setBallRod(index, val) {
  18584. this.userData.ballRod[index] = val;
  18585. this.saveUserData();
  18586. }
  18587. static setBallRodFormServer(haveQiuGanJsonStr) {
  18588. if (!haveQiuGanJsonStr) {
  18589. console.log("setBallRodFormServer数据为空或未定义");
  18590. return;
  18591. }
  18592. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18593. const keys = Object.keys(haveQiuGanJsonObj);
  18594. keys.forEach(key => {
  18595. let v = haveQiuGanJsonObj[key];
  18596. let k = parseInt(key);
  18597. let idx = k - 1;
  18598. this.userData.ballRod[idx] = v;
  18599. });
  18600. }
  18601. static getCurBallRod() {
  18602. return this.userData.curBallRod;
  18603. }
  18604. static setCurBallRod(index) {
  18605. this.userData.curBallRod = index;
  18606. this.saveUserData();
  18607. }
  18608. static setSignData(val) {
  18609. this.userData.signData = val;
  18610. this.saveUserData();
  18611. }
  18612. static getSignData() {
  18613. return this.userData.signData;
  18614. }
  18615. static setSignTime(val) {
  18616. this.userData.signTime = val;
  18617. this.saveUserData();
  18618. }
  18619. static getSignTime() {
  18620. return this.userData.signTime;
  18621. }
  18622. static getDrawTimes() {
  18623. return this.userData.drawTimes;
  18624. }
  18625. static setDrawTimes(val, addUp = true) {
  18626. if (addUp) {
  18627. this.userData.drawTimes += val;
  18628. }
  18629. else {
  18630. this.userData.drawTimes = val;
  18631. }
  18632. this.saveUserData();
  18633. }
  18634. static getDrawAwardTimes() {
  18635. return this.userData.drawAwardTimes;
  18636. }
  18637. static setDrawAwardTimes(val) {
  18638. this.userData.drawAwardTimes = val;
  18639. this.saveUserData();
  18640. }
  18641. static getDailyfreeDrawTimes() {
  18642. return this.userData.dailyfreeDrawTimes;
  18643. }
  18644. static setDailyfreeDrawTimes(val) {
  18645. this.userData.dailyfreeDrawTimes = val;
  18646. this.saveUserData();
  18647. }
  18648. static setPower(val, addUp = true) {
  18649. if (addUp)
  18650. this.userData.power += val;
  18651. else
  18652. this.userData.power = val;
  18653. if (this.userData.power >= xGame.common.maxPower) {
  18654. this.userData.power = xGame.common.maxPower;
  18655. }
  18656. xGame.eventMgr.event(POWER_CHANGE, val);
  18657. this.saveUserData();
  18658. }
  18659. static getPower() {
  18660. return this.userData.power;
  18661. }
  18662. static setPowerTime(val) {
  18663. this.userData.powerTime = val;
  18664. this.saveUserData();
  18665. }
  18666. static getPowerTime() {
  18667. return this.userData.powerTime;
  18668. }
  18669. static powerEnough() {
  18670. return this.getPower() > 0;
  18671. }
  18672. static getChallengeTimes() {
  18673. return this.userData.challengeTimes;
  18674. }
  18675. static setChallengeTimes(val) {
  18676. this.userData.challengeTimes += val;
  18677. this.saveUserData();
  18678. }
  18679. static getExtraSign() {
  18680. return this.userData.extraSign;
  18681. }
  18682. static setExtraSign(val) {
  18683. this.userData.extraSign = val;
  18684. this.saveUserData();
  18685. }
  18686. static getClassicTimes() {
  18687. return this.userData.classicTimes;
  18688. }
  18689. static setClassicTimes() {
  18690. this.userData.classicTimes += 1;
  18691. this.saveUserData();
  18692. }
  18693. static getGuideHelpLine() {
  18694. return this.userData.guideHelpLine;
  18695. }
  18696. static setGuideHelpLine() {
  18697. this.userData.guideHelpLine = 1;
  18698. this.saveUserData();
  18699. }
  18700. static getNewUser() {
  18701. return this.userData.newUser;
  18702. }
  18703. static setNewUser() {
  18704. this.userData.newUser = false;
  18705. this.saveUserData();
  18706. }
  18707. static getRootBallFoul() {
  18708. return this.userData.rootBallFoul;
  18709. }
  18710. static setRootBallFoul() {
  18711. this.userData.rootBallFoul = 1;
  18712. this.saveUserData();
  18713. }
  18714. static getTimeoutFoul() {
  18715. return this.userData.timeoutFoul;
  18716. }
  18717. static setTimeoutFoul() {
  18718. this.userData.timeoutFoul = 1;
  18719. this.saveUserData();
  18720. }
  18721. static saveDiyGameData() {
  18722. if (this.diyGameSaving)
  18723. return;
  18724. this.diyGameSaving = true;
  18725. Laya.timer.once(500, this, () => {
  18726. this.diyGameSaving = false;
  18727. this.diyGameData.saveData();
  18728. });
  18729. }
  18730. static getChallengeMode_overLev() {
  18731. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18732. return this.challengeMode_overLev;
  18733. }
  18734. static setChallengeMode_overLev(levNum) {
  18735. this.diyGameData.challengeMode_overLev = levNum;
  18736. this.saveDiyGameData();
  18737. }
  18738. static updateUserInfo2Server(type, count = 0) {
  18739. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18740. if (userInfoData == null) {
  18741. return;
  18742. }
  18743. let reqData = xGame.httpMgr.getReqData();
  18744. let rd = JSON.parse(reqData);
  18745. rd.dataType = type;
  18746. let dataValue = 0;
  18747. if (type == "zs") {
  18748. dataValue = this.getDiamond();
  18749. }
  18750. if (type == "jb") {
  18751. dataValue = this.getCoin();
  18752. }
  18753. rd.dataValue = dataValue;
  18754. reqData = JSON.stringify(rd);
  18755. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18756. try {
  18757. let code = res.code;
  18758. let data = res.data;
  18759. if (code == 401) {
  18760. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18761. console.log('zh:保存资产信息失败,请重新登录 ');
  18762. return;
  18763. }
  18764. if (code == 200) {
  18765. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18766. }
  18767. else {
  18768. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18769. }
  18770. }
  18771. catch (error) {
  18772. console.log('error=' + error);
  18773. alert("Please check your network connection.");
  18774. }
  18775. finally {
  18776. }
  18777. });
  18778. }
  18779. static getUserZiChanInfo() {
  18780. console.log('zh:开始获取用户资产信息');
  18781. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18782. if (userInfoData == null) {
  18783. return;
  18784. }
  18785. let reqData = xGame.httpMgr.getReqData();
  18786. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18787. try {
  18788. let code = res.code;
  18789. let msg = res.msg;
  18790. if (code == 401) {
  18791. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18792. alert(TIP_MSG_key.pleaseLoginIn);
  18793. return;
  18794. }
  18795. if (code == 200) {
  18796. let d = res.data;
  18797. let zuanShi = d.zuanShi;
  18798. let jinBi = d.jinBi;
  18799. let haveQiuGanJson = d.haveQiuGanJson;
  18800. let signData = d.signData;
  18801. let placeBallData = d.placeBallData;
  18802. DataMgr.setDiamondFormServer(zuanShi);
  18803. DataMgr.setCoinFormServer(jinBi);
  18804. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18805. DataMgr.setPlaceBallLevelList(placeBallData);
  18806. if (signData && signData > 0) {
  18807. DataMgr.setSignData(signData);
  18808. }
  18809. }
  18810. else {
  18811. console.log("zh:更新用户资产信息error" + msg);
  18812. alert(msg);
  18813. }
  18814. }
  18815. catch (error) {
  18816. console.log('error=' + error);
  18817. alert(error);
  18818. }
  18819. finally {
  18820. console.log("zh:更新用户资产信息结束");
  18821. }
  18822. });
  18823. }
  18824. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18825. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18826. console.log('zh:updateLocalUserData=' + userInfo);
  18827. if (userInfo != null) {
  18828. if (!userInfo.buySpids) {
  18829. userInfo.buySpids = { 1: false, 7: false };
  18830. }
  18831. else {
  18832. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18833. }
  18834. userInfo.buySpids[spid] = isBuyOk;
  18835. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18836. }
  18837. else {
  18838. }
  18839. }
  18840. static loadUserSpOrderForAd() {
  18841. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18842. if (userInfo == null) {
  18843. return;
  18844. }
  18845. console.log('zh:重新加载更新广告权利');
  18846. let reqData = xGame.httpMgr.getReqData();
  18847. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  18848. try {
  18849. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  18850. let code = res.code;
  18851. let msg = res.msg;
  18852. if (code == 401) {
  18853. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18854. return;
  18855. }
  18856. if (code == 200) {
  18857. let data = res.data;
  18858. let buy_spid1 = false;
  18859. let buy_spid7 = false;
  18860. for (let index = 0; index < data.length; index++) {
  18861. let element = data[index];
  18862. console.log('zh:list element.spid = ' + element.spid);
  18863. if (element.spid == 1) {
  18864. buy_spid1 = true;
  18865. }
  18866. if (element.spid == 7) {
  18867. buy_spid7 = true;
  18868. }
  18869. }
  18870. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  18871. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  18872. }
  18873. else {
  18874. }
  18875. }
  18876. catch (error) {
  18877. console.log('error=' + error);
  18878. alert(error);
  18879. }
  18880. finally {
  18881. }
  18882. });
  18883. }
  18884. }
  18885. DataMgr.isNewUser = false;
  18886. DataMgr.fristEnter = true;
  18887. DataMgr.levelType = 0;
  18888. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18889. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18890. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18891. DataMgr.challengeMode_overLev = 0;
  18892. DataMgr.xszyForClassic = false;
  18893. DataMgr.xszyForChallenge = false;
  18894. DataMgr.awardId = 0;
  18895. DataMgr.awardCoin = 0;
  18896. DataMgr.sceneId = -1;
  18897. DataMgr.tryId = 0;
  18898. DataMgr.curLevel = 1;
  18899. DataMgr.vipLevel = 0;
  18900. DataMgr.maxLevel = 0;
  18901. DataMgr.awardRatio = 1;
  18902. DataMgr.gameList = [];
  18903. DataMgr.rankList = [];
  18904. DataMgr.recoverTime = 480000;
  18905. DataMgr.minScore = 0;
  18906. DataMgr.rankDis = 0;
  18907. DataMgr.userSaving = false;
  18908. DataMgr.gameSaving = false;
  18909. DataMgr.diyGameSaving = false;
  18910. class D3Tween extends Laya.Script3D {
  18911. constructor() {
  18912. super();
  18913. this.isInited = false;
  18914. }
  18915. ;
  18916. init() {
  18917. if (this.isInited)
  18918. return;
  18919. this.isInited = true;
  18920. this.gameObj = this.owner;
  18921. this.transform = this.gameObj.transform;
  18922. }
  18923. get rotX() {
  18924. return this.transform.localRotationEulerX;
  18925. }
  18926. set rotX(v) {
  18927. this.transform.localRotationEulerX = v;
  18928. }
  18929. get rotY() {
  18930. return this.transform.localRotationEulerY;
  18931. }
  18932. set rotY(v) {
  18933. this.transform.localRotationEulerY = v;
  18934. }
  18935. get rotZ() {
  18936. return this.transform.localRotationEulerZ;
  18937. }
  18938. set rotZ(v) {
  18939. this.transform.localRotationEulerZ = v;
  18940. }
  18941. get posX() {
  18942. return this.transform.localPositionX;
  18943. }
  18944. set posX(v) {
  18945. this.transform.localPositionX = v;
  18946. }
  18947. get posY() {
  18948. return this.transform.localPositionY;
  18949. }
  18950. set posY(v) {
  18951. this.transform.localPositionY = v;
  18952. }
  18953. get posZ() {
  18954. return this.transform.localPositionZ;
  18955. }
  18956. set posZ(v) {
  18957. this.transform.localPositionZ = v;
  18958. }
  18959. get rotation() {
  18960. return this.transform.localRotation;
  18961. }
  18962. set rotation(v) {
  18963. this.transform.localRotation = v;
  18964. }
  18965. }
  18966. class D2Hole extends Laya.Script {
  18967. constructor() { super(); }
  18968. onTriggerEnter(collider) {
  18969. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18970. return;
  18971. }
  18972. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18973. if (collider.owner["mySrc"].isRunSkillAni) {
  18974. return;
  18975. }
  18976. if (collider.owner["mySrc"].number != 0) {
  18977. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18978. }
  18979. xGame.common.ballColliHole(collider);
  18980. xGame.common.recoverCameraView();
  18981. }
  18982. }
  18983. }
  18984. class Table extends Laya.Script3D {
  18985. constructor() {
  18986. super();
  18987. this.isSetBorder = false;
  18988. this.inited = false;
  18989. }
  18990. ;
  18991. onAwake() {
  18992. this.init();
  18993. }
  18994. init() {
  18995. if (this.inited)
  18996. return;
  18997. this.inited = true;
  18998. this.gameObj = this.owner;
  18999. this.border = this.gameObj.getChildByName("border");
  19000. }
  19001. setBorderPos() {
  19002. if (this.isSetBorder)
  19003. return;
  19004. this.isSetBorder = true;
  19005. let ui = xGame.common.gameUI.ui;
  19006. let bar1 = this.border.getChildByName("bar1");
  19007. let bar2 = this.border.getChildByName("bar2");
  19008. let bar3 = this.border.getChildByName("bar3");
  19009. let bar4 = this.border.getChildByName("bar4");
  19010. let bar5 = this.border.getChildByName("bar5");
  19011. let bar6 = this.border.getChildByName("bar6");
  19012. this.setInfo(bar1, ui.border.bar1, "box");
  19013. this.setInfo(bar2, ui.border.bar2, "box");
  19014. this.setInfo(bar3, ui.border.bar3, "box");
  19015. this.setInfo(bar4, ui.border.bar4, "box");
  19016. this.setInfo(bar5, ui.border.bar5, "box");
  19017. this.setInfo(bar6, ui.border.bar6, "box");
  19018. let circle1 = this.border.getChildByName("circle1");
  19019. let circle2 = this.border.getChildByName("circle2");
  19020. let circle3 = this.border.getChildByName("circle3");
  19021. let circle4 = this.border.getChildByName("circle4");
  19022. let circle5 = this.border.getChildByName("circle5");
  19023. let circle6 = this.border.getChildByName("circle6");
  19024. this.setInfo(circle1, ui.border.circle1, "circle");
  19025. this.setInfo(circle2, ui.border.circle2, "circle");
  19026. this.setInfo(circle3, ui.border.circle3, "circle");
  19027. this.setInfo(circle4, ui.border.circle4, "circle");
  19028. this.setInfo(circle5, ui.border.circle5, "circle");
  19029. this.setInfo(circle6, ui.border.circle6, "circle");
  19030. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19031. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19032. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19033. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19034. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19035. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19036. let arr = xGame.common.gameMgr.holePosList;
  19037. xGame.common.gameMgr.posObj = {
  19038. "1": arr[0],
  19039. "3": arr[2],
  19040. "4": arr[3],
  19041. "6": arr[5]
  19042. };
  19043. }
  19044. initHolePos(x, y) {
  19045. if (x < 300)
  19046. x += 25;
  19047. else if (x > 1000)
  19048. x -= 25;
  19049. else if (y > 200)
  19050. y -= 10;
  19051. else
  19052. y += 10;
  19053. if (y < 200)
  19054. y += 30;
  19055. else if (y > 500)
  19056. y -= 30;
  19057. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19058. }
  19059. setInfo(d3Obj, d2Obj, type) {
  19060. let ui = xGame.common.gameUI.ui;
  19061. let sprite = new Laya.Sprite();
  19062. ui.border.displayObject.addChild(sprite);
  19063. let colli = xGame.common.getCollider(type);
  19064. sprite.addComponentIntance(colli);
  19065. let rigy = xGame.common.getRigbody();
  19066. rigy.type = "static";
  19067. sprite.addComponentIntance(rigy);
  19068. let d3Pos = d3Obj.transform.position;
  19069. xGame.common.pos3to2Convert(d3Pos);
  19070. let scaleX = d3Obj.transform.localScaleX;
  19071. let scaleZ = d3Obj.transform.localScaleZ;
  19072. let width = xGame.common.scale3to2Convert(scaleZ);
  19073. let height = xGame.common.scale3to2Convert(scaleX);
  19074. sprite.pivotX = width / 2;
  19075. sprite.pivotY = height / 2;
  19076. sprite.x = d3Pos.x;
  19077. sprite.y = d3Pos.y;
  19078. sprite.width = width;
  19079. sprite.height = height;
  19080. d2Obj.x = d3Pos.x;
  19081. d2Obj.y = d3Pos.y;
  19082. d2Obj.width = width;
  19083. d2Obj.height = height;
  19084. if (type == "box") {
  19085. colli.width = width;
  19086. colli.height = height;
  19087. colli.isSensor = false;
  19088. colli.label = "border";
  19089. }
  19090. else {
  19091. colli.radius = width / 2;
  19092. colli.isSensor = true;
  19093. colli.label = "hole";
  19094. sprite.addComponent(D2Hole);
  19095. }
  19096. }
  19097. }
  19098. class D3World extends Laya.Script3D {
  19099. constructor() {
  19100. super();
  19101. this.loadNum = 0;
  19102. this.setLoadNum = 7;
  19103. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19104. }
  19105. onAwake() {
  19106. }
  19107. loadScene() {
  19108. this.scene = this.owner;
  19109. let url = `res/unityRes/root.lh`;
  19110. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19111. this.scene.addChild(prefab);
  19112. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19113. this.putCameraInfo();
  19114. this.camera.enableHDR = false;
  19115. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19116. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19117. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19118. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19119. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19120. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19121. this.knife.active = false;
  19122. this.loadD3Obj();
  19123. }));
  19124. }
  19125. putCameraInfo() {
  19126. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19127. this.cameraObj = new cameraType();
  19128. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19129. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19130. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19131. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19132. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19133. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19134. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19135. this.visitAngleChild.init();
  19136. this.visitRootObj.posX = this.visitAngleChild.posX;
  19137. this.visitRootObj.posY = this.visitAngleChild.posY;
  19138. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19139. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19140. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19141. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19142. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19143. xGame.common.showOneCamera("mainCamera");
  19144. }
  19145. loadD3Obj() {
  19146. this.loadTable();
  19147. this.loadRoom();
  19148. this.loadInHoleParticial();
  19149. this.loadIceParticial();
  19150. this.loadHitParticial();
  19151. this.loadFireworksParticial();
  19152. this.loadBall();
  19153. }
  19154. loadInHoleParticial() {
  19155. this.loadD3Res("inHoleEft", "", (prefab) => {
  19156. prefab.addComponent(Partical);
  19157. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19158. });
  19159. }
  19160. loadIceParticial() {
  19161. this.loadD3Res("iceEft", "", (prefab) => {
  19162. prefab.addComponent(Partical);
  19163. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19164. });
  19165. }
  19166. loadHitParticial() {
  19167. this.loadD3Res("hitEft", "", (prefab) => {
  19168. prefab.addComponent(Partical);
  19169. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19170. });
  19171. }
  19172. loadFireworksParticial() {
  19173. this.loadD3Res("fireworksEft", "", (prefab) => {
  19174. prefab.addComponent(Partical);
  19175. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19176. });
  19177. }
  19178. loadBall(index = 1) {
  19179. this.loadD3Res("ball", index, (prefab) => {
  19180. this.ballPrefab = prefab;
  19181. this.ballPrefab.addComponent(Ball);
  19182. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19183. });
  19184. }
  19185. loadTable(index = 1) {
  19186. this.loadD3Res("table", index, (prefab) => {
  19187. this.tableSrc = prefab.addComponent(Table);
  19188. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19189. this.d3Hand.init();
  19190. this.tableRoot.addChild(prefab);
  19191. });
  19192. }
  19193. loadRoom(index = 1) {
  19194. this.loadD3Res("room", index, (prefab) => {
  19195. this.roomRoot.addChild(prefab);
  19196. });
  19197. }
  19198. loadD3Res(type, index, callback) {
  19199. let url = `res/unityRes/${type}${index}.lh`;
  19200. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19201. callback && callback(prefab);
  19202. this.checkResLoad();
  19203. }));
  19204. }
  19205. checkResLoad() {
  19206. this.loadNum++;
  19207. if (this.loadNum >= this.setLoadNum) {
  19208. xGame.eventMgr.event(D3RES_LOADED);
  19209. }
  19210. }
  19211. prePlayEft() {
  19212. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19213. eft.transform.localPositionX = 0;
  19214. eft.transform.localPositionY = -5;
  19215. eft.transform.localPositionZ = 0;
  19216. eft.active = true;
  19217. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19218. ice.transform.localPositionX = 0;
  19219. ice.transform.localPositionY = -5;
  19220. ice.transform.localPositionZ = 0;
  19221. ice.active = true;
  19222. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19223. hit.transform.localPositionX = 0;
  19224. hit.transform.localPositionY = -5;
  19225. hit.transform.localPositionZ = 0;
  19226. hit.active = true;
  19227. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19228. fireworks.transform.localPositionX = 0;
  19229. fireworks.transform.localPositionY = -5;
  19230. fireworks.transform.localPositionZ = 0;
  19231. fireworks.active = true;
  19232. }
  19233. }
  19234. class cameraType {
  19235. }
  19236. class MoyuMgr$1 {
  19237. static initMoyu() {
  19238. this.moyuView = new MoyuView$1();
  19239. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19240. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19241. this.moyuView.ui.displayObject.zOrder = 1000;
  19242. this.moyuView.init();
  19243. this.moyuView.showTip(true);
  19244. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19245. window['XApk'] = this;
  19246. }
  19247. static showAge(show) {
  19248. if (this.moyuView)
  19249. this.moyuView.showAge(show);
  19250. }
  19251. static onPlatMsg(idx) {
  19252. if (!MoyuMgr$1.moyuView)
  19253. return;
  19254. if (idx == '0') {
  19255. MoyuMgr$1.moyuView.showTip(false);
  19256. }
  19257. }
  19258. static showAgree(call) {
  19259. if (this.moyuView)
  19260. this.moyuView.showAgree(call);
  19261. else
  19262. call && call();
  19263. }
  19264. static showXy(type = 1) {
  19265. if (this.moyuView)
  19266. this.moyuView.showXy(type);
  19267. }
  19268. }
  19269. MoyuMgr$1.isAdvise = false;
  19270. class MoyuView$1 {
  19271. constructor() {
  19272. this.ysxyNum = 1;
  19273. this.ysJson = null;
  19274. this.ui = ui_UIMoyu.createInstance();
  19275. }
  19276. init() {
  19277. this.ui.mainBg.visible = false;
  19278. this.ui.xyNode.visible = false;
  19279. this.ui.ageNode.visible = false;
  19280. this.ui.tipNode.visible = false;
  19281. this.ui.rnNode.visible = false;
  19282. this.ui.fcmNode.visible = false;
  19283. this.ui.ageTip.visible = false;
  19284. this.ui.msgNode.visible = false;
  19285. this.ui.visible = false;
  19286. this.ui.xyNode.xyList.setVirtual();
  19287. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19288. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19289. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19290. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19291. this.ui.xyNode.btnKnown.visible = false;
  19292. this.ui.xyNode.xy1.visible = false;
  19293. this.ui.xyNode.xy2.visible = false;
  19294. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19295. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19296. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19297. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19298. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19299. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19300. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19301. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19302. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19303. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19304. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19305. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19306. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19307. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19308. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19309. this.ysxyNum = 2;
  19310. }
  19311. }
  19312. onClick(obj) {
  19313. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19314. switch (obj) {
  19315. case this.ui.ageTip:
  19316. if (Moyu.isTTApk) {
  19317. this.ui.ageNode.visible = true;
  19318. this.ui.mainBg.visible = true;
  19319. }
  19320. break;
  19321. case this.ui.tipNode:
  19322. this.showTip(false);
  19323. break;
  19324. case this.ui.ageNode.btnAge:
  19325. this.ui.ageNode.visible = false;
  19326. this.ui.mainBg.visible = false;
  19327. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19328. this.ui.visible = false;
  19329. break;
  19330. case this.ui.xyNode.btnXy3:
  19331. case this.ui.xyNode.btnXy1:
  19332. this.loadXy(1);
  19333. break;
  19334. case this.ui.xyNode.btnXy2:
  19335. this.loadXy(2);
  19336. break;
  19337. case this.ui.xyNode.btnBack:
  19338. this.ui.xyNode.xy1.visible = true;
  19339. this.ui.xyNode.xy2.visible = false;
  19340. break;
  19341. case this.ui.xyNode.btnKnown:
  19342. this.ui.xyNode.visible = false;
  19343. this.ui.mainBg.visible = false;
  19344. this.ui.visible = false;
  19345. break;
  19346. case this.ui.rnNode.btnCheck:
  19347. this.check();
  19348. break;
  19349. case this.ui.rnNode.btnExit:
  19350. case this.ui.xyNode.btnNo:
  19351. this.ysxyNum--;
  19352. if (this.ysxyNum > 0)
  19353. this.showMsg("Refuse to quit the game once again");
  19354. else {
  19355. Moyu.userAgree(false);
  19356. Moyu.exit();
  19357. }
  19358. break;
  19359. case this.ui.xyNode.btnSure:
  19360. case this.ui.xyNode.btnYes:
  19361. DataMgr.userData.isAgree = true;
  19362. DataMgr.saveUserData();
  19363. this.onAgree();
  19364. break;
  19365. case this.ui.rnNode.btnDone:
  19366. this.ui.rnNode.visible = false;
  19367. this.ui.visible = false;
  19368. break;
  19369. case this.ui.fcmNode.btnRn:
  19370. this.showRn();
  19371. break;
  19372. }
  19373. }
  19374. showTip(show) {
  19375. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19376. return;
  19377. if (show) {
  19378. MoyuMgr$1.isAdvise = true;
  19379. this.ui.visible = true;
  19380. this.ui.tipNode.visible = true;
  19381. this.ui.tipNode.alpha = 1;
  19382. Laya.timer.once(1000, this, this.showTip, [false]);
  19383. }
  19384. else {
  19385. this.ui.tipNode.alpha = 1;
  19386. this.ui.tipNode.visible = true;
  19387. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19388. this.ui.tipNode.visible = false;
  19389. MoyuMgr$1.isAdvise = false;
  19390. }), 1000);
  19391. }
  19392. }
  19393. showAge(show, px = 0, py = 0) {
  19394. if (Moyu.platType > 10 && !Moyu.isIos) {
  19395. this.ui.ageTip.x = px;
  19396. this.ui.ageTip.y = py;
  19397. this.ui.ageTip.visible = show;
  19398. if (show)
  19399. this.ui.visible = true;
  19400. }
  19401. }
  19402. showAgree(call) {
  19403. this.agreeCall = call;
  19404. this.onAgree();
  19405. return;
  19406. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19407. this.showXy(0);
  19408. }
  19409. else
  19410. this.onAgree();
  19411. }
  19412. onAgree() {
  19413. if (!this.ui.ageNode.visible)
  19414. this.ui.visible = false;
  19415. this.ui.xyNode.visible = false;
  19416. Moyu.userAgree(true);
  19417. this.showAge(false);
  19418. this.agreeCall && this.agreeCall();
  19419. this.showRn();
  19420. }
  19421. showMsg(txt) {
  19422. this.ui.msgNode.txtMsg.text = txt;
  19423. this.ui.msgNode.visible = true;
  19424. this.ui.msgNode.alpha = 1;
  19425. this.ui.visible = true;
  19426. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19427. this.ui.msgNode.visible = false;
  19428. }), 2500, true);
  19429. }
  19430. showRn() {
  19431. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19432. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19433. this.ui.rnNode.rn1.visible = true;
  19434. this.ui.rnNode.rn2.visible = false;
  19435. this.ui.rnNode.rn3.visible = false;
  19436. this.ui.rnNode.rn4.visible = false;
  19437. this.ui.rnNode.visible = true;
  19438. this.ui.mainBg.visible = true;
  19439. this.ui.rnNode.btnDone.visible = false;
  19440. this.ui.rnNode.btnExit.visible = true;
  19441. this.ui.rnNode.btnCheck.visible = true;
  19442. this.ui.fcmNode.visible = false;
  19443. this.ui.visible = true;
  19444. return;
  19445. }
  19446. }
  19447. this.showFcm();
  19448. }
  19449. showFcm() {
  19450. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19451. Moyu.initFCM(true);
  19452. if (Moyu.gameTime < 1)
  19453. this.fcmLoop();
  19454. else if (Moyu.gameTime < 999)
  19455. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19456. }
  19457. }
  19458. fcmLoop() {
  19459. if (Moyu.gameTime < 1) {
  19460. this.ui.rnNode.visible = false;
  19461. this.ui.fcmNode.visible = true;
  19462. this.ui.mainBg.visible = true;
  19463. this.ui.visible = true;
  19464. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19465. Laya.timer.clear(this.ui, this.fcmLoop);
  19466. }
  19467. }
  19468. check() {
  19469. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19470. this.ui.rnNode.rn1.visible = false;
  19471. this.ui.rnNode.rn2.visible = false;
  19472. this.ui.rnNode.rn4.visible = true;
  19473. }
  19474. else if (this.ui.rnNode.rn4.visible) {
  19475. let name = this.ui.rnNode.inputName.text;
  19476. let code = this.ui.rnNode.inputCode.text;
  19477. if (code && code.length == 18) {
  19478. this.ui.rnNode.rn1.visible = false;
  19479. this.ui.rnNode.rn4.visible = false;
  19480. Moyu.authenticate(name, code, (res) => {
  19481. this.ui.rnNode.rn2.visible = !res;
  19482. this.ui.rnNode.rn3.visible = res;
  19483. this.ui.rnNode.btnDone.visible = res;
  19484. this.ui.rnNode.btnExit.visible = !res;
  19485. this.ui.rnNode.btnCheck.visible = !res;
  19486. if (res)
  19487. this.showFcm();
  19488. });
  19489. }
  19490. else
  19491. this.showMsg("信息填写不完整");
  19492. }
  19493. }
  19494. loadXy(type = 0) {
  19495. this.ui.xyNode.xy1.visible = false;
  19496. this.ui.xyNode.xy2.visible = true;
  19497. this.ui.xyNode.xyList.scrollToView(0);
  19498. if (type == 1) {
  19499. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19500. }
  19501. else if (type == 2) {
  19502. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19503. }
  19504. }
  19505. showXy(type = 0) {
  19506. this.xyBtn();
  19507. if (type == 0) {
  19508. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19509. this.ui.xyNode.btnSure.visible = true;
  19510. }
  19511. else {
  19512. this.ui.xyNode.btnYes.visible = true;
  19513. this.ui.xyNode.btnNo.visible = true;
  19514. }
  19515. }
  19516. else {
  19517. this.ui.xyNode.btnKnown.visible = true;
  19518. this.ui.mainBg.visible = true;
  19519. }
  19520. this.ui.xyNode.xy1.visible = true;
  19521. this.ui.xyNode.xy2.visible = false;
  19522. this.ui.xyNode.visible = true;
  19523. this.ui.visible = true;
  19524. }
  19525. xyBtn() {
  19526. this.ui.xyNode.btnSure.visible = false;
  19527. this.ui.xyNode.btnYes.visible = false;
  19528. this.ui.xyNode.btnNo.visible = false;
  19529. this.ui.xyNode.btnKnown.visible = false;
  19530. {
  19531. this.ui.xyNode.btnXy3.visible = false;
  19532. this.ui.xyNode.btnXy2.visible = true;
  19533. this.ui.xyNode.btnXy1.visible = true;
  19534. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19535. }
  19536. }
  19537. createXY(json) {
  19538. this.ysJson = json.content;
  19539. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19540. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19541. this.ui.xyNode.xy2.visible = true;
  19542. }
  19543. renderListItem(idx, cell) {
  19544. let xy = this.ysJson[idx];
  19545. cell.height = xy.line * 30;
  19546. cell.xyItem.text = xy.text;
  19547. }
  19548. onDestroy() {
  19549. this.agreeCall = null;
  19550. }
  19551. }
  19552. class UILoading extends UIBase {
  19553. constructor() {
  19554. super();
  19555. this.accTime = 0;
  19556. this.curNum = 0;
  19557. this.rate = 1;
  19558. this.loadSubOk = false;
  19559. this.loadResOK = false;
  19560. this.openLoading = true;
  19561. this.beginLoadRes = false;
  19562. this.finishD2 = false;
  19563. this.finishD3 = false;
  19564. }
  19565. onConstructor() {
  19566. this.ui = ui_UILoading.createInstance();
  19567. this.contentPane = this.ui;
  19568. this.isEject = false;
  19569. this._initUI();
  19570. this._addEvent();
  19571. }
  19572. _initUI() {
  19573. MoyuMgr$1.initMoyu();
  19574. }
  19575. _addEvent() {
  19576. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19577. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19578. }
  19579. show() {
  19580. super.show();
  19581. console.log('zh:加载分包资源');
  19582. loadSubRes(this.subResProgress.bind(this));
  19583. this.ui.txtLoad.text = "Loading...";
  19584. }
  19585. subResProgress(pro, finish) {
  19586. this.curNum = pro;
  19587. if (finish) {
  19588. this.curNum = 1;
  19589. this.loadSubOk = true;
  19590. }
  19591. }
  19592. laodD3Res() {
  19593. let scene3D = new Laya.Scene3D();
  19594. xGame.common.d3Scene = scene3D;
  19595. xGame.common.d3World = scene3D.addComponent(D3World);
  19596. xGame.common.d3World.loadScene();
  19597. }
  19598. loadD2Res() {
  19599. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19600. this.finishD2 = true;
  19601. this.checkLoadAll();
  19602. this.curNum = 1;
  19603. }), Laya.Handler.create(this, (pro) => {
  19604. this.curNum = pro;
  19605. }, null, false));
  19606. }
  19607. d3ResFinish() {
  19608. this.finishD3 = true;
  19609. this.checkLoadAll();
  19610. }
  19611. checkLoadAll() {
  19612. if (this.finishD2 && this.finishD3) {
  19613. this.loadResOK = true;
  19614. }
  19615. }
  19616. loadRes() {
  19617. this.laodD3Res();
  19618. this.loadD2Res();
  19619. }
  19620. myUpdate(dt) {
  19621. if (!this.openLoading)
  19622. return;
  19623. this.accTime += dt * this.rate;
  19624. if (this.accTime >= this.curNum)
  19625. this.accTime = this.curNum;
  19626. this.ui.loadinfo.value = this.accTime * 100;
  19627. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19628. if (!this.beginLoadRes) {
  19629. this.beginLoadRes = true;
  19630. this.ui.txtLoad.text = "Loading...";
  19631. this.curNum = 0;
  19632. this.accTime = 0;
  19633. this.loadRes();
  19634. }
  19635. if (this.loadResOK) {
  19636. this.openLoading = false;
  19637. Laya.timer.once(300, this, () => {
  19638. xGame.common.d3Scene.active = false;
  19639. MoyuMgr$1.showAgree(enterGame);
  19640. });
  19641. }
  19642. }
  19643. }
  19644. release() {
  19645. }
  19646. hide() {
  19647. super.hide();
  19648. this.release();
  19649. }
  19650. onClose() {
  19651. this.hide();
  19652. }
  19653. }
  19654. UILoading.uiName = "UILoading";
  19655. class UIRepentProp$1 extends UIBase {
  19656. constructor() {
  19657. super();
  19658. this.viewType = 0;
  19659. this.regretType = 0;
  19660. }
  19661. onConstructor() {
  19662. this.ui = ui_UIRepentProp.createInstance();
  19663. this.contentPane = this.ui;
  19664. this.isEject = false;
  19665. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19666. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19667. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19668. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19669. }
  19670. show(viewType, regretType, callback) {
  19671. PlatMgr.showInsert(true);
  19672. this.viewType = viewType;
  19673. this.regretType = regretType;
  19674. this.callback = callback;
  19675. super.show();
  19676. this.ui.t0.play();
  19677. this.ui.c1.selectedIndex = this.viewType;
  19678. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19679. if (this.viewType == 0) {
  19680. let guide = DataMgr.getGuideHelpLine();
  19681. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19682. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19683. }
  19684. xGame.common.gameMgr.gamePause = true;
  19685. }
  19686. hideSelf() {
  19687. xGame.common.gameMgr.gamePause = false;
  19688. this.callback && this.callback(false);
  19689. this.hide();
  19690. }
  19691. videoRegret() {
  19692. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19693. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19694. }
  19695. else {
  19696. console.log('zh:AD 失败,直接发放奖励');
  19697. this.qjff_AD_for_UIrepentProp_videoRegret();
  19698. }
  19699. }
  19700. qjff_AD_for_UIrepentProp_videoRegret() {
  19701. this.callback && this.callback(true);
  19702. this.hideSelf();
  19703. }
  19704. videoAddHelpLine() {
  19705. let guide = DataMgr.getGuideHelpLine();
  19706. if (guide == 0) {
  19707. this.callback && this.callback(true);
  19708. this.hideSelf();
  19709. DataMgr.setGuideHelpLine();
  19710. xGame.common.gameUI.ui.guideNode.visible = false;
  19711. }
  19712. else {
  19713. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19714. if (Laya.Browser.onAndroid) {
  19715. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19716. if (!boo) {
  19717. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19718. return;
  19719. }
  19720. }
  19721. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19722. }
  19723. else {
  19724. console.log('zh:AD 失败,直接发放奖励');
  19725. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19726. }
  19727. }
  19728. }
  19729. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19730. this.callback && this.callback(true);
  19731. this.hideSelf();
  19732. }
  19733. }
  19734. UIRepentProp$1.uiName = "UIRepentProp";
  19735. class UIRodMethod$1 extends UIBase {
  19736. constructor() {
  19737. super();
  19738. this.isPressd = false;
  19739. }
  19740. onConstructor() {
  19741. this.ui = ui_UIRodMethod.createInstance();
  19742. this.contentPane = this.ui;
  19743. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19744. this.moveDir = new Laya.Vector2();
  19745. this.moveDest = new Laya.Vector2();
  19746. this.centerPos = new Laya.Vector2();
  19747. xGame.common.uiRodMethod = this;
  19748. }
  19749. show() {
  19750. super.show();
  19751. xGame.common.gameMgr.gamePause = true;
  19752. this.openPressDotEvent();
  19753. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19754. this.centerPos.x = this.ui.white.x;
  19755. this.centerPos.y = this.ui.white.y;
  19756. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19757. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19758. this.setDot();
  19759. }
  19760. setDot() {
  19761. this.ui.dot.x = this.moveDest.x;
  19762. this.ui.dot.y = this.moveDest.y;
  19763. }
  19764. closeSelf() {
  19765. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19766. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19767. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19768. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19769. xGame.common.gameMgr.gamePause = false;
  19770. this.hide();
  19771. }
  19772. openPressDotEvent() {
  19773. this.closePressDotEvent();
  19774. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19775. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19776. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19777. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19778. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19779. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19780. }
  19781. closePressDotEvent() {
  19782. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19783. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19784. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19785. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19786. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19787. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19788. }
  19789. onDown(e) {
  19790. if (e.type == Laya.Event.MOUSE_DOWN)
  19791. this.isPressd = true;
  19792. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19793. this.isPressd = false;
  19794. if (!this.isPressd)
  19795. return;
  19796. this.moveDest.x = e.stageX;
  19797. this.moveDest.y = e.stageY;
  19798. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19799. if (dis > 6724) {
  19800. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19801. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19802. }
  19803. this.setDot();
  19804. }
  19805. resetRod() {
  19806. this.ui.dot.x = this.ui.white.x;
  19807. this.ui.dot.y = this.ui.white.y;
  19808. this.gameRod.dot.x = this.gameRod.bg.x;
  19809. this.gameRod.dot.y = this.gameRod.bg.y;
  19810. xGame.common.rodOffest.x = 0;
  19811. xGame.common.rodOffest.y = 0;
  19812. }
  19813. }
  19814. UIRodMethod$1.uiName = "UIRodMethod";
  19815. class UIMsg$1 extends UIBase {
  19816. constructor() {
  19817. super();
  19818. }
  19819. onConstructor() {
  19820. this.ui = ui_UIMsg.createInstance();
  19821. this.contentPane = this.ui;
  19822. this.isEject = false;
  19823. this.isMuti = true;
  19824. }
  19825. show(msg, callback) {
  19826. super.show();
  19827. this.ui.tipsNode.msgTxt.text = msg;
  19828. this.ui.alpha = 1;
  19829. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19830. this.hide();
  19831. callback && callback();
  19832. }), 1000);
  19833. }
  19834. }
  19835. UIMsg$1.uiName = "UIMsg";
  19836. class UITips$1 extends UIBase {
  19837. constructor() {
  19838. super();
  19839. this.type = 0;
  19840. }
  19841. onConstructor() {
  19842. this.ui = ui_UITips.createInstance();
  19843. this.contentPane = this.ui;
  19844. this.isEject = false;
  19845. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19846. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19847. }
  19848. show(tipsTxt, womanTxt, type) {
  19849. super.show();
  19850. this.ui.t0.play();
  19851. this.ui.myNode.tipsTxt.text = tipsTxt;
  19852. this.ui.myNode.womanTxt.text = womanTxt;
  19853. PlatMgr.showInsert(true);
  19854. this.ui.myNode.c1.selectedIndex = type;
  19855. this.type = type;
  19856. switch (this.type) {
  19857. case TipsType.exitGame:
  19858. xGame.common.gameMgr.gamePause = true;
  19859. break;
  19860. case TipsType.foul:
  19861. Laya.timer.once(200, this, () => {
  19862. xGame.common.gameMgr.gamePause = true;
  19863. });
  19864. break;
  19865. default:
  19866. break;
  19867. }
  19868. }
  19869. clickLeftBtn() {
  19870. this.hide();
  19871. xGame.common.gameMgr.gamePause = false;
  19872. switch (this.type) {
  19873. case TipsType.exitGame:
  19874. break;
  19875. case TipsType.foul:
  19876. break;
  19877. default:
  19878. break;
  19879. }
  19880. }
  19881. clickRightBtn() {
  19882. this.hide();
  19883. switch (this.type) {
  19884. case TipsType.exitGame:
  19885. xGame.eventMgr.event(RESET_GAME);
  19886. xGame.uiMgr.Show(UIMain$1);
  19887. Moyu.recordEnd(this, null);
  19888. xGame.common.longHelpLine = false;
  19889. break;
  19890. case TipsType.foul:
  19891. xGame.common.gameMgr.gamePause = false;
  19892. Laya.timer.clearAll(this);
  19893. break;
  19894. default:
  19895. break;
  19896. }
  19897. }
  19898. }
  19899. UITips$1.uiName = "UITips";
  19900. class UIGame$1 extends UIBase {
  19901. constructor() {
  19902. super();
  19903. this.powerNum = 0;
  19904. this.isD3Inited = false;
  19905. this.isPrePlay = false;
  19906. this.isMoveRod = false;
  19907. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19908. this.rulerDis = 20;
  19909. this.rulerOffset = 0;
  19910. }
  19911. onConstructor() {
  19912. this.ui = ui_UIGame.createInstance();
  19913. this.contentPane = this.ui;
  19914. this.ui.x += xGame.common.sysOffestNum;
  19915. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19916. this.isEject = false;
  19917. xGame.common.gameUI = this;
  19918. this.initSelf();
  19919. }
  19920. isTurnSelf() {
  19921. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19922. return true;
  19923. }
  19924. }
  19925. initSelf() {
  19926. let topUI = this.ui.topNode;
  19927. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19928. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19929. this.barInfo = {};
  19930. this.barInfo.curY = 0;
  19931. this.barInfo.height = this.ui.powerNode.height;
  19932. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19933. this.barInfo.powerStartY = this.ui.powerNode.y;
  19934. xGame.common.aiPlayer = new AIPlayer();
  19935. xGame.common.gameMgr = new GameMgr();
  19936. xGame.common.skillMgr = new SkillMgr();
  19937. xGame.common.wordsMgr = new WordsMgr();
  19938. xGame.common.talkMgr = new TalkMgr();
  19939. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19940. console.log("加载经典模式表情文件chenggon !");
  19941. });
  19942. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19943. console.log("挑战模式奖励模式spine加载成功!");
  19944. });
  19945. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19946. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19947. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19948. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19949. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19950. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19951. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19952. }
  19953. getGanZiImg() {
  19954. let index = DataMgr.getCurBallRod();
  19955. let data = cfgTable.ballrodData[index + 1];
  19956. let gan_url = xGame.common.getGameIconUrl(data.img);
  19957. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19958. this.ui.powerNode.showImg.url = gan_url;
  19959. console.log('zh:修改杆子图标O K');
  19960. }
  19961. returnHome() {
  19962. let tips = "Are you sure to exit the game?";
  19963. let woman = "Boss, why don't you play for a while longer?";
  19964. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19965. }
  19966. addRodMethodClick() {
  19967. if (this.isTurnSelf()) {
  19968. xGame.uiMgr.Show(UIRodMethod$1);
  19969. }
  19970. }
  19971. clickHelpLineBtn(force = false) {
  19972. if (!this.isTurnSelf())
  19973. return;
  19974. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19975. if (success) {
  19976. xGame.common.longHelpLine = true;
  19977. xGame.common.d2World.getHelpLine();
  19978. Moyu.sendDataEvent("guideNum");
  19979. }
  19980. else {
  19981. }
  19982. });
  19983. }
  19984. renderSelfDisplayBalls(index, target) {
  19985. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19986. target.myImg.url = xGame.common.getGameIconUrl(str);
  19987. }
  19988. renderAIDisplayBalls(index, target) {
  19989. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19990. target.myImg.url = xGame.common.getGameIconUrl(str);
  19991. ;
  19992. }
  19993. updateMode() {
  19994. if (xGame.common.gameMode == GameMode.classic) {
  19995. this.ui.topNode.scoreNode.visible = false;
  19996. }
  19997. else if (xGame.common.gameMode == GameMode.bigMove) {
  19998. this.ui.topNode.scoreNode.visible = true;
  19999. }
  20000. }
  20001. show() {
  20002. super.show();
  20003. console.log("zh:uigame show AADD");
  20004. this.ui.alpha = 0;
  20005. this.updateSelf();
  20006. xGame.common.gameMgr.gamePause = false;
  20007. xGame.common.gameUI.ui.blackAni.visible = false;
  20008. xGame.common.gameUI.ui.whiteAni.visible = false;
  20009. this.ui.powerEft.visible = false;
  20010. this.ui.colorNode.visible = false;
  20011. this.updateHead();
  20012. let curUse = DataMgr.getCurBallRod();
  20013. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  20014. this.getGanZiImg();
  20015. }
  20016. updateSelf() {
  20017. if (xGame.common.gameMode == GameMode.classic) {
  20018. this.ui.c1.selectedIndex = 0;
  20019. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20020. this.ui.topNode.middleNode.visible = true;
  20021. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20022. }
  20023. else if (xGame.common.gameMode == GameMode.bigMove) {
  20024. this.ui.c1.selectedIndex = 0;
  20025. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20026. this.ui.topNode.middleNode.visible = false;
  20027. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20028. let rand = xGame.common.randomNum(1, max);
  20029. let guide = DataMgr.getSkillGuide();
  20030. if (guide == 0)
  20031. rand = 1;
  20032. xGame.common.bigMoveLevelIndex = rand;
  20033. }
  20034. else if (xGame.common.gameMode == GameMode.placeBall) {
  20035. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20036. this.ui.c1.selectedIndex = 1 + data.type;
  20037. this.ui.alpha = 1;
  20038. this.startGame();
  20039. }
  20040. this.updateMode();
  20041. this.initD3world();
  20042. this.initD2world();
  20043. }
  20044. startGame() {
  20045. this.ui.snowNode.visible = Math.random() <= 0.1;
  20046. this.ui.d2Node.visible = false;
  20047. xGame.common.d3World.d3Hand.gameObj.active = false;
  20048. xGame.common.d3World.tableSrc.init();
  20049. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20050. this.cameraViewChange(() => {
  20051. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20052. switch (xGame.common.gameMode) {
  20053. case GameMode.classic:
  20054. xGame.common.d3World.d3Hand.gameObj.active = true;
  20055. this.playPutBallD3Ani();
  20056. break;
  20057. case GameMode.bigMove:
  20058. this.enterGame();
  20059. Laya.timer.once(500, this, () => {
  20060. this.ui.topNode.middleNode.visible = true;
  20061. this.ui.topNode.middleNode.t0.play();
  20062. });
  20063. break;
  20064. case GameMode.placeBall:
  20065. this.enterGame();
  20066. break;
  20067. default:
  20068. break;
  20069. }
  20070. });
  20071. PlatMgr.showBanner(false);
  20072. }
  20073. enterGame() {
  20074. this.ui.d2Node.visible = true;
  20075. xGame.common.d3World.d3Hand.gameObj.active = false;
  20076. xGame.common.showOneCamera("mainCamera");
  20077. Moyu.recordGame(30, true);
  20078. if (!this.isPrePlay) {
  20079. this.isPrePlay = true;
  20080. xGame.common.d3World.prePlayEft();
  20081. }
  20082. xGame.common.gameMgr.gameReady();
  20083. this.openAllEvent();
  20084. this.ui.snowNode.visible = false;
  20085. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20086. this.ui.helpBtn.visible = condition;
  20087. }
  20088. showHelpLineGuide() {
  20089. let longGuide = DataMgr.getGuideHelpLine();
  20090. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20091. this.ui.helpBtn.visible = true;
  20092. this.ui.guideNode.visible = true;
  20093. }
  20094. }
  20095. setTurnAlpha(alpha) {
  20096. this.ui.keduNode.alpha = alpha;
  20097. this.ui.ganNode.alpha = alpha;
  20098. this.ui.rodMethodNode.alpha = alpha;
  20099. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20100. }
  20101. cameraViewChange(callback) {
  20102. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20103. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20104. xGame.common.showOneCamera("visitAngle");
  20105. cameraSrc.localRotationEulerY = 180;
  20106. cameraSrc.localRotationEulerZ = 0;
  20107. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20108. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20109. callback && callback();
  20110. }));
  20111. }));
  20112. }
  20113. playPutBallD3Ani() {
  20114. xGame.common.showOneCamera("mainCamera");
  20115. let handSrc = xGame.common.d3World.d3Hand;
  20116. handSrc.gameObj.active = true;
  20117. handSrc.transform.localPositionZ = 3;
  20118. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20119. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20120. handSrc.gameObj.active = false;
  20121. this.enterGame();
  20122. }), 400);
  20123. }));
  20124. }
  20125. updateHead() {
  20126. let user = Moyu.getUserInfo();
  20127. this.ui.topNode.selfNameTxt.text = user.nickName;
  20128. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20129. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20130. if (DataMgr.getSkillGuide() < 1) {
  20131. this.ui.topNode.aiNameTxt.text = 'billiards';
  20132. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20133. }
  20134. else {
  20135. this.ui.topNode.aiNameTxt.text = aiData.name;
  20136. let randNo = Math.floor(Math.random() * 10) + 1;
  20137. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20138. }
  20139. }
  20140. initD2world() {
  20141. let node = this.ui.d2Root.displayObject;
  20142. let src = node.getComponent(D2World);
  20143. if (!src) {
  20144. xGame.common.d2World = node.addComponent(D2World);
  20145. }
  20146. xGame.common.d2World.initSelf();
  20147. }
  20148. initD3world() {
  20149. if (this.isD3Inited)
  20150. return;
  20151. this.isD3Inited = true;
  20152. let scene3D = xGame.common.d3Scene;
  20153. this.ui.d3Root.displayObject.addChild(scene3D);
  20154. scene3D.active = true;
  20155. xGame.common.d3World.tableSrc.setBorderPos();
  20156. }
  20157. onRootMove(e) {
  20158. let rootBall = xGame.common.d2World.rootBall;
  20159. this.ui.moveNode.x = e.x;
  20160. this.ui.moveNode.y = e.y;
  20161. rootBall.gameObj.x = e.x;
  20162. rootBall.gameObj.y = e.y;
  20163. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20164. }
  20165. aiRootMove(move) {
  20166. if (move)
  20167. this.hideBallUI();
  20168. else {
  20169. this.showBallUI();
  20170. xGame.common.d2World.getHelpLine();
  20171. }
  20172. }
  20173. aiForce(type, force = 0) {
  20174. this.pressTarget = PressType.powerNode;
  20175. if (type == 1)
  20176. this.onEventUp({ force: true });
  20177. else if (type == 2)
  20178. this.onEventMove({ stageY: force, force: true });
  20179. }
  20180. onEventPress(e) {
  20181. if (e.stopPropagation)
  20182. e.stopPropagation();
  20183. if (!this.isTurnSelf())
  20184. return;
  20185. let target = e.target;
  20186. switch (target) {
  20187. case this.ui.myPowerNode.displayObject:
  20188. this.pressTarget = PressType.powerNode;
  20189. this.barInfo.curY = e.stageY;
  20190. this.updateBarInfo();
  20191. break;
  20192. case this.ui.moveNode.displayObject:
  20193. this.pressTarget = PressType.moveNode;
  20194. this.hideBallUI();
  20195. this.eventObj.curX = this.ui.moveNode.x;
  20196. this.eventObj.curY = this.ui.moveNode.y;
  20197. this.ui.moveNode.finger.visible = false;
  20198. this.eventObj.lastX = e.stageX;
  20199. this.eventObj.lastY = e.stageY;
  20200. break;
  20201. case this.ui.rulerClickNode.displayObject:
  20202. this.pressTarget = PressType.rulerNode;
  20203. this.eventObj.lastY = e.stageY;
  20204. break;
  20205. case this.ui.d2Root.displayObject:
  20206. this.pressTarget = PressType.d2Root;
  20207. this.eventObj.lastX = e.stageX;
  20208. this.eventObj.lastY = e.stageY;
  20209. this.eventObj.starX = e.stageX;
  20210. this.eventObj.starY = e.stageY;
  20211. this.eventObj.curX = 0;
  20212. this.eventObj.curY = 0;
  20213. xGame.common.d2World.d2Gan.setGanLastInfo();
  20214. this.rulerOffset = 0;
  20215. break;
  20216. default:
  20217. break;
  20218. }
  20219. }
  20220. onEventMove(e) {
  20221. if (e.stopPropagation)
  20222. e.stopPropagation();
  20223. if (e && e.force) {
  20224. }
  20225. else {
  20226. if (!this.isTurnSelf())
  20227. return;
  20228. }
  20229. switch (this.pressTarget) {
  20230. case PressType.powerNode:
  20231. this.barInfo.curY = e.stageY;
  20232. this.updateBarInfo();
  20233. this.isMoveRod = true;
  20234. break;
  20235. case PressType.moveNode:
  20236. let rootBall = xGame.common.d2World.rootBall;
  20237. let radius = rootBall.gameObj.width / 2;
  20238. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20239. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20240. let border = xGame.common.d2World.borderRect;
  20241. if (curX <= border.x + radius)
  20242. curX = border.x + radius;
  20243. else if (curX >= border.x + border.width - radius)
  20244. curX = border.x + border.width - radius;
  20245. if (curY <= border.y + radius)
  20246. curY = border.y + radius;
  20247. else if (curY >= border.y + border.height - radius)
  20248. curY = border.y + border.height - radius;
  20249. if (xGame.common.gameMgr.isOpenBall) {
  20250. if (curX >= border.x + border.openBallW - radius)
  20251. curX = border.x + border.openBallW - radius;
  20252. }
  20253. this.ui.moveNode.x = curX;
  20254. this.ui.moveNode.y = curY;
  20255. rootBall.gameObj.x = curX;
  20256. rootBall.gameObj.y = curY;
  20257. rootBall.d3BallSrc.setTransPos(curX, curY);
  20258. this.isMoveRod = true;
  20259. break;
  20260. case PressType.rulerNode:
  20261. let yy = e.stageY - this.eventObj.lastY;
  20262. this.eventObj.lastY = e.stageY;
  20263. let ruler1 = this.ui.rulerNode.img1;
  20264. let ruler2 = this.ui.rulerNode.img2;
  20265. ruler1.y += yy;
  20266. ruler2.y += yy;
  20267. this.rulerOffset += yy;
  20268. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20269. this.rulerOffset = 0;
  20270. xGame.soundMgr.playSound("inch", 1, 10);
  20271. }
  20272. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20273. let h = ruler1.height;
  20274. this.checkGuide();
  20275. this.isMoveRod = true;
  20276. if (ruler1.y >= h) {
  20277. ruler1.y = -h;
  20278. ruler2.y = 0;
  20279. return;
  20280. }
  20281. else if (ruler1.y <= -h) {
  20282. ruler1.y = h;
  20283. ruler2.y = 0;
  20284. return;
  20285. }
  20286. if (ruler2.y >= h) {
  20287. ruler2.y = -h;
  20288. ruler1.y = 0;
  20289. return;
  20290. }
  20291. else if (ruler2.y <= -h) {
  20292. ruler2.y = h;
  20293. ruler1.y = 0;
  20294. return;
  20295. }
  20296. break;
  20297. case PressType.d2Root:
  20298. this.eventObj.curX = e.stageX;
  20299. this.eventObj.curY = e.stageY;
  20300. let offset = this.checkRodMoveDir();
  20301. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20302. this.eventObj.lastX = e.stageX;
  20303. this.eventObj.lastY = e.stageY;
  20304. break;
  20305. default:
  20306. break;
  20307. }
  20308. }
  20309. onEventUp(e) {
  20310. if (e.stopPropagation)
  20311. e.stopPropagation();
  20312. if (e && e.force) {
  20313. }
  20314. else {
  20315. if (!this.isTurnSelf())
  20316. return;
  20317. }
  20318. switch (this.pressTarget) {
  20319. case PressType.powerNode:
  20320. this.ui.powerNode.value = 0;
  20321. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20322. this.ui.powerTxt.text = "";
  20323. if (this.powerNum > 0) {
  20324. xGame.eventMgr.event(BALL_SHOOT);
  20325. xGame.common.d2World.shoot(this.powerNum);
  20326. xGame.common.d2World.d2Gan.shoot();
  20327. xGame.common.d2World.d2HelpLine.shoot();
  20328. this.finishGuide();
  20329. this.ui.powerEft.visible = false;
  20330. this.ui.colorNode.visible = false;
  20331. let ganStr = "";
  20332. if (this.powerNum <= 30) {
  20333. ganStr = "gan_30";
  20334. }
  20335. else if (this.powerNum <= 60) {
  20336. ganStr = "gan_50";
  20337. }
  20338. else {
  20339. ganStr = "gan_80";
  20340. }
  20341. xGame.soundMgr.playSound(ganStr);
  20342. }
  20343. break;
  20344. case PressType.moveNode:
  20345. let rootBall = xGame.common.d2World.rootBall;
  20346. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20347. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20348. let isIntersect = this.judgeBallIntersect();
  20349. if (isIntersect) {
  20350. this.ui.moveNode.x = lastX;
  20351. this.ui.moveNode.y = lastY;
  20352. rootBall.gameObj.x = lastX;
  20353. rootBall.gameObj.y = lastY;
  20354. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20355. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20356. }
  20357. else {
  20358. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20359. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20360. }
  20361. this.showBallUI();
  20362. this.ui.moveNode.finger.visible = true;
  20363. xGame.common.d2World.getHelpLine();
  20364. break;
  20365. case PressType.rulerNode:
  20366. break;
  20367. case PressType.d2Root:
  20368. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20369. if (dis <= 25) {
  20370. this.moveToClickDot(e);
  20371. }
  20372. break;
  20373. default:
  20374. break;
  20375. }
  20376. this.pressTarget = -1;
  20377. }
  20378. checkGuide() {
  20379. let guide = DataMgr.getSkillGuide();
  20380. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20381. xGame.common.guideStep++;
  20382. xGame.common.gameUI.ui.guide2.visible = false;
  20383. xGame.common.gameUI.ui.guide3.visible = true;
  20384. }
  20385. }
  20386. finishGuide() {
  20387. let guide = DataMgr.getSkillGuide();
  20388. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20389. xGame.common.guideStep = 10;
  20390. this.closeAllGuide();
  20391. console.log('zh: 新手引导完毕');
  20392. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20393. }
  20394. }
  20395. closeAllGuide() {
  20396. xGame.common.gameUI.ui.guide1.visible = false;
  20397. xGame.common.gameUI.ui.guide2.visible = false;
  20398. xGame.common.gameUI.ui.guide3.visible = false;
  20399. }
  20400. updateBarInfo() {
  20401. let star = this.ui.powerNode.y;
  20402. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20403. if (rate >= 1)
  20404. rate = 1;
  20405. if (rate <= 0)
  20406. rate = 0;
  20407. this.powerNum = Math.ceil(rate * 100);
  20408. this.ui.powerNode.value = this.powerNum;
  20409. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20410. this.ui.colorNode.value = this.powerNum;
  20411. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20412. this.ui.powerEft.visible = this.powerNum != 0;
  20413. this.ui.colorNode.visible = this.powerNum != 0;
  20414. this.ui.powerTxt.text = this.powerNum + "";
  20415. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20416. }
  20417. forceCancel() {
  20418. this.ui.powerNode.value = 0;
  20419. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20420. this.ui.powerTxt.text = "";
  20421. }
  20422. checkRodMoveDir() {
  20423. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20424. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20425. if (tempX >= 0 && tempY <= 0) {
  20426. return this.checkDir();
  20427. }
  20428. else if (tempX < 0 && tempY < 0) {
  20429. return this.checkDir(1, -1);
  20430. }
  20431. else if (tempX < 0 && tempY > 0) {
  20432. return this.checkDir(-1, -1);
  20433. }
  20434. else {
  20435. return this.checkDir(-1, 1);
  20436. }
  20437. }
  20438. checkDir(flagX = 1, flagY = 1) {
  20439. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20440. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20441. if (offsetY == 0) {
  20442. return offsetX * flagX;
  20443. }
  20444. if (offsetX == 0) {
  20445. return offsetY * flagY;
  20446. }
  20447. let angle = offsetY / offsetX;
  20448. if (Math.abs(angle) >= 1) {
  20449. return offsetY * flagY;
  20450. }
  20451. else {
  20452. return offsetX * flagX;
  20453. }
  20454. }
  20455. judgeBallIntersect() {
  20456. let rootBall = xGame.common.d2World.rootBall;
  20457. let ballArr = xGame.common.d2World.ballArr;
  20458. let radius = rootBall.gameObj.width / 2;
  20459. let temp;
  20460. let isIntersect = false;
  20461. for (let index = 0; index < ballArr.length; index++) {
  20462. temp = ballArr[index];
  20463. if (temp.number == rootBall.number)
  20464. continue;
  20465. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20466. if (isIntersect) {
  20467. break;
  20468. }
  20469. }
  20470. return isIntersect;
  20471. }
  20472. hideBallUI() {
  20473. let d2Gan = xGame.common.d2World.d2Gan;
  20474. if (!d2Gan.ui.isDisposed)
  20475. d2Gan.ui.visible = false;
  20476. let d2Help = xGame.common.d2World.d2HelpLine;
  20477. if (!d2Help.ui.isDisposed)
  20478. d2Help.ui.visible = false;
  20479. let rootBall = xGame.common.d2World.rootBall;
  20480. if (!rootBall.destroyed) {
  20481. rootBall.gameObj.active = false;
  20482. }
  20483. }
  20484. showBallUI() {
  20485. let d2Gan = xGame.common.d2World.d2Gan;
  20486. if (!d2Gan.ui.isDisposed)
  20487. d2Gan.ui.visible = true;
  20488. let d2Help = xGame.common.d2World.d2HelpLine;
  20489. if (!d2Help.ui.isDisposed)
  20490. d2Help.ui.visible = true;
  20491. let rootBall = xGame.common.d2World.rootBall;
  20492. if (!rootBall.destroyed) {
  20493. rootBall.gameObj.active = true;
  20494. }
  20495. }
  20496. moveToClickDot(e) {
  20497. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20498. let root = xGame.common.d2World.rootBall.gameObj;
  20499. let xx = e.stageX - xGame.common.sysOffestNum;
  20500. let yy = e.stageY;
  20501. let x = xx - root.x;
  20502. let y = yy - root.y;
  20503. let angle = xGame.common.getfguiRotation(x, y);
  20504. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20505. xGame.common.d2World.getHelpLine();
  20506. }
  20507. this.isMoveRod = false;
  20508. xGame.common.clickedBall = false;
  20509. }
  20510. openAllEvent() {
  20511. this.closeAllEvent();
  20512. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20513. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20514. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20515. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20516. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20517. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20518. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20519. }
  20520. closeAllEvent() {
  20521. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20522. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20523. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20524. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20525. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20526. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20527. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20528. }
  20529. resetGame() {
  20530. this.closeAllEvent();
  20531. this.hideBallUI();
  20532. xGame.common.gameMgr.gamePause = true;
  20533. }
  20534. }
  20535. UIGame$1.uiName = "UIGame";
  20536. class UIAddCoin$1 extends UIBase {
  20537. constructor() {
  20538. super();
  20539. this.coinNum = 2000;
  20540. }
  20541. onConstructor() {
  20542. this.ui = ui_UIAddCoin.createInstance();
  20543. this.contentPane = this.ui;
  20544. this.isEject = false;
  20545. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20546. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20547. }
  20548. show() {
  20549. super.show();
  20550. this.ui.t0.play();
  20551. }
  20552. videoAddCoin() {
  20553. console.log('zh:qjff_AD_for_UIAddCoin');
  20554. if (Laya.Browser.onAndroid) {
  20555. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20556. if (!boo) {
  20557. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20558. return;
  20559. }
  20560. }
  20561. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20562. }
  20563. else {
  20564. console.log('zh:AD 失败,直接发放奖励');
  20565. this.qjff_AD_for_UIAddCoin();
  20566. }
  20567. }
  20568. qjff_AD_for_UIAddCoin() {
  20569. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20570. this.hide();
  20571. }
  20572. }
  20573. UIAddCoin$1.uiName = "UIAddCoin";
  20574. class UIInvitation$1 extends UIBase {
  20575. constructor() {
  20576. super();
  20577. }
  20578. onConstructor() {
  20579. this.ui = ui_UIInvitation.createInstance();
  20580. this.contentPane = this.ui;
  20581. this.isEject = false;
  20582. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20583. }
  20584. show() {
  20585. super.show();
  20586. }
  20587. enterGame() {
  20588. xGame.common.gameMode = GameMode.classic;
  20589. DataMgr.setChallengeTimes(1);
  20590. xGame.common.passAwardCoin = 2000;
  20591. let need = xGame.common.classicNiceNeddCoin;
  20592. if (DataMgr.coinEnough(need)) {
  20593. DataMgr.setCoin(-need);
  20594. xGame.eventMgr.event(RESTART_GAME, true);
  20595. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20596. }
  20597. else {
  20598. xGame.eventMgr.event(RESTART_GAME, true);
  20599. }
  20600. this.hide();
  20601. }
  20602. hide() {
  20603. super.hide();
  20604. }
  20605. }
  20606. UIInvitation$1.uiName = "UIInvitation";
  20607. class UIPower$1 extends UIBase {
  20608. constructor() {
  20609. super();
  20610. }
  20611. onConstructor() {
  20612. this.ui = ui_UIPower.createInstance();
  20613. this.contentPane = this.ui;
  20614. this.isEject = false;
  20615. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20616. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20617. }
  20618. show() {
  20619. super.show();
  20620. this.ui.t0.play();
  20621. }
  20622. videoGetPower() {
  20623. console.log('zh:qjff_AD_for_uipower');
  20624. if (Laya.Browser.onAndroid) {
  20625. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20626. if (!boo) {
  20627. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20628. return;
  20629. }
  20630. }
  20631. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20632. }
  20633. else {
  20634. console.log('zh:AD 失败,直接发放奖励');
  20635. this.qjff_AD_for_uipower();
  20636. }
  20637. }
  20638. qjff_AD_for_uipower() {
  20639. DataMgr.setPower(xGame.common.videoPower, true);
  20640. xGame.eventMgr.event(POWER_TIME);
  20641. this.hide();
  20642. }
  20643. }
  20644. UIPower$1.uiName = "UIPower";
  20645. class UIGameEnd$1 extends UIBase {
  20646. constructor() {
  20647. super();
  20648. this.success = false;
  20649. this.awardCoinNum = 1000;
  20650. this.awardDiamondNum = 10;
  20651. }
  20652. onConstructor() {
  20653. this.ui = ui_UIGameEnd.createInstance();
  20654. this.contentPane = this.ui;
  20655. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20656. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20657. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20658. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20659. this.ui.talkNode.visible = false;
  20660. if (Moyu.isKs)
  20661. this.ui.closeNode.closeBtn.x += 100;
  20662. }
  20663. updateType() {
  20664. switch (xGame.common.gameMode) {
  20665. case GameMode.classic:
  20666. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20667. this.ui.coinNode.visible = this.success;
  20668. if (!this.success) {
  20669. Laya.timer.once(500, this, () => {
  20670. xGame.uiMgr.Show(UIAddCoin$1);
  20671. });
  20672. }
  20673. else {
  20674. this.logEventForClassic_win();
  20675. }
  20676. this.logEventForClassic_complete();
  20677. this.ui.isGetAward.visible = false;
  20678. this.ui.leftBtn.c1.selectedIndex = 3;
  20679. this.ui.rightBtn.c1.selectedIndex = 0;
  20680. this.moneyNode.ui.c1.selectedIndex = 1;
  20681. break;
  20682. case GameMode.bigMove:
  20683. console.log('zh:招法模式 aaaaaa bigMove');
  20684. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20685. this.ui.coinNode.visible = this.success;
  20686. if (xGame.common.gameMode == GameMode.bigMove) {
  20687. if (this.success) {
  20688. DataMgr.setSkillSuccessTimes(1, true);
  20689. DataMgr.setSkillAccTimes(1);
  20690. }
  20691. else {
  20692. DataMgr.setSkillSuccessTimes(0, false);
  20693. }
  20694. }
  20695. this.logEventForRod_complete_N();
  20696. if (!this.success) {
  20697. Laya.timer.once(500, this, () => {
  20698. xGame.uiMgr.Show(UIAddCoin$1);
  20699. });
  20700. }
  20701. else {
  20702. this.logEventForRod_win();
  20703. }
  20704. this.ui.isGetAward.visible = false;
  20705. this.ui.leftBtn.c1.selectedIndex = 3;
  20706. this.ui.rightBtn.c1.selectedIndex = 0;
  20707. this.moneyNode.ui.c1.selectedIndex = 1;
  20708. break;
  20709. case GameMode.placeBall:
  20710. this.ui.coinNode.visible = false;
  20711. if (this.success) {
  20712. if (xGame.common.placeBallStarNum == 3) {
  20713. this.ui.c1.selectedIndex = 2;
  20714. }
  20715. else {
  20716. this.ui.c1.selectedIndex = 3;
  20717. }
  20718. let level = xGame.common.placeBallCurLevel;
  20719. if (level > 59) {
  20720. this.logEventForChallenge_level_complete(level);
  20721. }
  20722. else {
  20723. this.logEventForChallenge_level_N(level);
  20724. }
  20725. }
  20726. else {
  20727. this.ui.c1.selectedIndex = 4;
  20728. }
  20729. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20730. if (cfg.type == PlaceBallType.challenge) {
  20731. this.ui.c1.selectedIndex = 2;
  20732. }
  20733. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20734. this.updatePlaceBallBtn();
  20735. this.updatePlaceBallStarNum();
  20736. this.updatePlaceBallAwardState();
  20737. this.moneyNode.ui.c1.selectedIndex = 2;
  20738. this.moneyNode.checkPowerTime();
  20739. this.moneyNode.powerChange();
  20740. DataMgr.upRankData();
  20741. break;
  20742. default:
  20743. break;
  20744. }
  20745. }
  20746. logEventForRod_complete_N() {
  20747. let gfmsIdx = xGame.common.curPlayerSkillType;
  20748. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20749. let gfmc = 'Skyfall Shot';
  20750. if (gfmsIdx == 0) {
  20751. gfmc = 'Skyfall Shot';
  20752. }
  20753. if (gfmsIdx == 1) {
  20754. gfmc = 'Surging break';
  20755. }
  20756. if (gfmsIdx == 2) {
  20757. gfmc = 'Frost Lock';
  20758. }
  20759. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20760. console.log('zh:logEventForRod_complete_N level = ' + level);
  20761. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20762. let jsonStr = {
  20763. "count": 0,
  20764. "name": gfmc
  20765. };
  20766. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20767. const d = LocalStorageManager.getItem(keyStr);
  20768. jsonStr.count = d.count + 1;
  20769. LocalStorageManager.setItem(keyStr, jsonStr);
  20770. }
  20771. else {
  20772. LocalStorageManager.setItem(keyStr, jsonStr);
  20773. }
  20774. const d2 = LocalStorageManager.getItem(keyStr);
  20775. let count = d2.count;
  20776. console.log('zh:logEventForRod_complete_N count = ' + count);
  20777. if (count % 5 == 0) {
  20778. const reqStr = JSON.stringify(jsonStr);
  20779. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20780. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20781. }
  20782. }
  20783. logEventForRod_win() {
  20784. console.log('zh:logEventForRod_win,胜利');
  20785. let gfmsIdx = xGame.common.curPlayerSkillType;
  20786. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20787. let gfmc = 'Skyfall Shot';
  20788. if (gfmsIdx == 0) {
  20789. gfmc = 'Skyfall Shot';
  20790. }
  20791. if (gfmsIdx == 1) {
  20792. gfmc = 'Surging break';
  20793. }
  20794. if (gfmsIdx == 2) {
  20795. gfmc = 'Frost Lock';
  20796. }
  20797. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20798. console.log('zh:logEventForRod_win level = ' + level);
  20799. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20800. let jsonStr = {
  20801. "count": 1,
  20802. "name": gfmc + ' Lev' + level
  20803. };
  20804. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20805. const d = LocalStorageManager.getItem(keyStr);
  20806. jsonStr.count = d.count + 1;
  20807. LocalStorageManager.setItem(keyStr, jsonStr);
  20808. }
  20809. else {
  20810. LocalStorageManager.setItem(keyStr, jsonStr);
  20811. }
  20812. const reqStr = JSON.stringify(jsonStr);
  20813. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20814. }
  20815. logEventForClassic_win() {
  20816. console.log('zh:logEventForClassic_win,胜利');
  20817. let rtype = xGame.common.classicRoomType;
  20818. let msmc = '';
  20819. if (rtype == 1) {
  20820. msmc = 'beginner';
  20821. }
  20822. if (rtype == 2) {
  20823. msmc = 'expert';
  20824. }
  20825. if (rtype == 3) {
  20826. msmc = 'master';
  20827. }
  20828. let keyStr = 'sjmd_classic_win_' + rtype;
  20829. let jsonStr = {
  20830. "difficulty": msmc,
  20831. "classic_count": 1,
  20832. "difficulty_count": 1
  20833. };
  20834. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20835. const d = LocalStorageManager.getItem(keyStr);
  20836. jsonStr.classic_count = d.classic_count + 1;
  20837. jsonStr.difficulty_count = d.difficulty_count + 1;
  20838. LocalStorageManager.setItem(keyStr, jsonStr);
  20839. }
  20840. else {
  20841. LocalStorageManager.setItem(keyStr, jsonStr);
  20842. }
  20843. const reqStr = JSON.stringify(jsonStr);
  20844. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20845. }
  20846. logEventForClassic_complete() {
  20847. console.log('zh:logEventForClassic_complete,胜利');
  20848. let rtype = xGame.common.classicRoomType;
  20849. let msmc = '';
  20850. if (rtype == 1) {
  20851. msmc = 'beginner';
  20852. }
  20853. if (rtype == 2) {
  20854. msmc = 'expert';
  20855. }
  20856. if (rtype == 3) {
  20857. msmc = 'master';
  20858. }
  20859. let keyStr = 'sjmd_classic_complete_' + rtype;
  20860. let jsonStr = {
  20861. "msmc": msmc,
  20862. "count": 0
  20863. };
  20864. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20865. const d = LocalStorageManager.getItem(keyStr);
  20866. jsonStr.count = d.count + 1;
  20867. LocalStorageManager.setItem(keyStr, jsonStr);
  20868. }
  20869. else {
  20870. LocalStorageManager.setItem(keyStr, jsonStr);
  20871. }
  20872. if (jsonStr.count % 5 == 0) {
  20873. const reqStr = JSON.stringify(jsonStr);
  20874. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20875. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20876. }
  20877. }
  20878. updatePlaceBallBtn() {
  20879. this.ui.leftBtn.c1.selectedIndex = 5;
  20880. if (this.success) {
  20881. this.ui.rightBtn.c1.selectedIndex = 14;
  20882. }
  20883. else {
  20884. if (xGame.common.placeBallStarNum == 3) {
  20885. this.ui.rightBtn.c1.selectedIndex = 14;
  20886. }
  20887. else {
  20888. this.ui.rightBtn.c1.selectedIndex = 1;
  20889. }
  20890. }
  20891. }
  20892. updatePlaceBallStarNum() {
  20893. let starNum = xGame.common.placeBallStarNum;
  20894. if (starNum == 0)
  20895. this.ui.starNumNode.c1.selectedIndex = 3;
  20896. else {
  20897. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20898. }
  20899. }
  20900. updatePlaceBallAwardState() {
  20901. let level = xGame.common.placeBallCurLevel;
  20902. let starNum = xGame.common.placeBallStarNum;
  20903. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20904. let data = cfgTable.placeballData[level].award;
  20905. let cfg = cfgTable.placeballData[level];
  20906. this.awardDiamondNum = data[1];
  20907. this.awardCoinNum = data[0];
  20908. if (cfg.type == PlaceBallType.challenge) {
  20909. this.awardDiamondNum = 0;
  20910. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20911. }
  20912. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20913. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20914. if (cfg.type == PlaceBallType.challenge) {
  20915. this.ui.awardNode.coinNode.visible = true;
  20916. }
  20917. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20918. this.ui.awardNode.diamondNode.x = 265;
  20919. this.ui.awardNode.coinNode.x = 354;
  20920. }
  20921. else {
  20922. this.ui.awardNode.diamondNode.x = 291;
  20923. this.ui.awardNode.coinNode.x = 291;
  20924. }
  20925. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20926. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20927. if (this.awardCoinNum == 0) {
  20928. this.ui.awardNode.coinNode.numTxt.text = "";
  20929. }
  20930. if (getAward) {
  20931. this.ui.isGetAward.visible = true;
  20932. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20933. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20934. }
  20935. else {
  20936. this.ui.isGetAward.visible = false;
  20937. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20938. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20939. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20940. }
  20941. else {
  20942. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20943. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20944. }
  20945. }
  20946. }
  20947. show(success) {
  20948. super.show();
  20949. xGame.eventMgr.event(RESET_GAME);
  20950. this.success = success;
  20951. Laya.timer.clearAll(this);
  20952. this.playSecretaryAni();
  20953. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20954. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20955. offsetTime = Math.floor(offsetTime / 1000);
  20956. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20957. this.updateType();
  20958. Laya.timer.once(200, this, () => {
  20959. this.addAward(() => {
  20960. this.updateType();
  20961. Laya.timer.once(500, this, () => {
  20962. this.showChallengeLevel();
  20963. });
  20964. });
  20965. });
  20966. if (this.success) {
  20967. JSBridgeUtils.instance.showInternAd('gameend_success');
  20968. console.log('zh:game end 成功');
  20969. xGame.soundMgr.playSound('slots_roll01');
  20970. xGame.soundMgr.playSound("s_win");
  20971. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20972. this.diyGameDataUtilForGameWin();
  20973. this.updateGamePlaceBallData2Server();
  20974. }
  20975. else {
  20976. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20977. console.log('zh:game end失败');
  20978. xGame.soundMgr.playSound('matchwin01');
  20979. xGame.soundMgr.playSound("s_lose");
  20980. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20981. }
  20982. let challengeNum = DataMgr.getChallengeTimes();
  20983. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20984. DataMgr.setChallengeTimes(1);
  20985. }
  20986. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20987. DataMgr.setClassicTimes();
  20988. }
  20989. }
  20990. diyGameDataUtilForGameWin() {
  20991. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20992. switch (xGame.common.gameMode) {
  20993. case GameMode.classic:
  20994. console.log('zh:DiyGameDataUtilForGameWin 111');
  20995. case GameMode.bigMove:
  20996. console.log('zh:DiyGameDataUtilForGameWin 222');
  20997. this.restartGame();
  20998. break;
  20999. case GameMode.placeBall:
  21000. console.log('zh:DiyGameDataUtilForGameWin 333');
  21001. var level = xGame.common.placeBallCurLevel;
  21002. console.log('zh:练习模式 联系了多少LEV=' + level);
  21003. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21004. if (level > db_over_lev) {
  21005. DataMgr.setChallengeMode_overLev(level);
  21006. }
  21007. break;
  21008. default:
  21009. console.log('zh:DiyGameDataUtilForGameWin 444');
  21010. break;
  21011. }
  21012. }
  21013. updateGamePlaceBallData2Server() {
  21014. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21015. if (userInfo == null) {
  21016. return;
  21017. }
  21018. let pbdObj = DataMgr.getPlaceBallLevelList();
  21019. let reqData = xGame.httpMgr.getReqData();
  21020. let pd = JSON.parse(reqData);
  21021. pd.placeBallData = JSON.stringify(pbdObj);
  21022. reqData = JSON.stringify(pd);
  21023. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21024. try {
  21025. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21026. let code = res.code;
  21027. let msg = res.msg;
  21028. if (code == 401) {
  21029. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  21030. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21031. return;
  21032. }
  21033. if (code == 200) {
  21034. let data = res.data;
  21035. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21036. }
  21037. else {
  21038. xGame.uiMgr.Show(UIMsg$1, msg);
  21039. }
  21040. }
  21041. catch (error) {
  21042. console.log('error=' + error);
  21043. alert(error);
  21044. }
  21045. finally {
  21046. }
  21047. });
  21048. }
  21049. showChallengeLevel() {
  21050. if (DataMgr.getChallengeTimes() != 0)
  21051. return;
  21052. let skill = DataMgr.getSkillAccTimes();
  21053. let put = DataMgr.getPlaceBallLevelList().length;
  21054. if (skill >= 3 || put >= 5) {
  21055. xGame.uiMgr.Show(UIInvitation$1);
  21056. this.hide();
  21057. }
  21058. }
  21059. addAward(callback) {
  21060. if (!this.success) {
  21061. callback && callback();
  21062. return;
  21063. }
  21064. switch (xGame.common.gameMode) {
  21065. case GameMode.classic:
  21066. this.awardCoinNum = xGame.common.passAwardCoin;
  21067. this.awardDiamondNum = 0;
  21068. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21069. break;
  21070. case GameMode.bigMove:
  21071. this.awardCoinNum = xGame.common.passAwardCoin;
  21072. this.awardDiamondNum = 0;
  21073. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21074. callback && callback();
  21075. break;
  21076. case GameMode.placeBall:
  21077. let level = xGame.common.placeBallCurLevel;
  21078. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21079. if (xGame.common.placeBallStarNum != 3) {
  21080. callback && callback();
  21081. return;
  21082. }
  21083. else {
  21084. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21085. if (getAward) {
  21086. callback && callback();
  21087. return;
  21088. }
  21089. }
  21090. let cfg = cfgTable.placeballData[level];
  21091. let data = cfgTable.placeballData[level].award;
  21092. this.awardCoinNum = data[0];
  21093. this.awardDiamondNum = data[1];
  21094. if (cfg.type == PlaceBallType.challenge) {
  21095. this.awardDiamondNum = 0;
  21096. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21097. }
  21098. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21099. let diamondAward;
  21100. if (this.awardDiamondNum > 0) {
  21101. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21102. xGame.common.getAward([diamondAward, coinAward], callback);
  21103. }
  21104. else {
  21105. xGame.common.getAward([coinAward], callback);
  21106. }
  21107. if (cfg.type == PlaceBallType.normal) {
  21108. DataMgr.setPlaceBallAward(level);
  21109. }
  21110. break;
  21111. default:
  21112. break;
  21113. }
  21114. }
  21115. playSecretaryAni_old() {
  21116. let parent = this.ui.secretary.displayObject;
  21117. parent.destroyChildren();
  21118. let xx = this.ui.secretary.width / 2;
  21119. let yy = this.ui.secretary.height;
  21120. let scale = xGame.common.getSecretaryScale();
  21121. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21122. if (this.success) {
  21123. let rand = Math.random() <= 0.5 ? 2 : 3;
  21124. xGame.common.secretary.play(data, rand, false, parent, () => {
  21125. xGame.common.secretary.play(data, 1, true, parent);
  21126. });
  21127. }
  21128. else {
  21129. xGame.common.secretary.play(data, 0, true, parent);
  21130. }
  21131. }
  21132. playSecretaryAni() {
  21133. let parent = this.ui.secretary.displayObject;
  21134. parent.destroyChildren();
  21135. let xx = this.ui.secretary.width / 2;
  21136. let yy = this.ui.secretary.height;
  21137. let scale = xGame.common.getSecretaryScale();
  21138. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21139. if (this.success) {
  21140. let rand = 0;
  21141. xGame.common.secretary.play(data, 0, true, parent);
  21142. }
  21143. else {
  21144. xGame.common.secretary.play(data, 0, true, parent);
  21145. }
  21146. }
  21147. restartGame() {
  21148. switch (xGame.common.gameMode) {
  21149. case GameMode.classic:
  21150. xGame.eventMgr.event(RESTART_GAME);
  21151. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21152. break;
  21153. case GameMode.bigMove:
  21154. this.hide();
  21155. xGame.eventMgr.event(RESTART_GAME);
  21156. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21157. break;
  21158. default:
  21159. break;
  21160. }
  21161. }
  21162. hide() {
  21163. super.hide();
  21164. xGame.common.stopGirlPop(this.ui.talkNode);
  21165. PlatMgr.showBanner(false);
  21166. }
  21167. returnHome() {
  21168. this.hide();
  21169. let showFailWords = !this.success;
  21170. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21171. }
  21172. clickLeftBtn() {
  21173. switch (xGame.common.gameMode) {
  21174. case GameMode.classic:
  21175. case GameMode.bigMove:
  21176. this.returnHome();
  21177. break;
  21178. case GameMode.placeBall:
  21179. let level = xGame.common.placeBallCurLevel;
  21180. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21181. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21182. break;
  21183. default:
  21184. break;
  21185. }
  21186. }
  21187. powerStartPlaceBallLevel(level, btn) {
  21188. if (DataMgr.powerEnough()) {
  21189. btn.touchable = false;
  21190. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21191. btn.touchable = true;
  21192. DataMgr.setPower(-1);
  21193. xGame.eventMgr.event(POWER_TIME);
  21194. this.startPlaceBallLevel(level);
  21195. this.logEventForChallenge_level_start(level);
  21196. }));
  21197. }
  21198. else {
  21199. xGame.uiMgr.Show(UIPower$1, 0);
  21200. }
  21201. }
  21202. clickRightBtn() {
  21203. switch (xGame.common.gameMode) {
  21204. case GameMode.classic:
  21205. console.log('zh:clickRightBtn 111');
  21206. case GameMode.bigMove:
  21207. console.log('zh:clickRightBtn 222');
  21208. this.restartGame();
  21209. break;
  21210. case GameMode.placeBall:
  21211. console.log('zh:clickRightBtn 333');
  21212. let level = xGame.common.placeBallCurLevel;
  21213. let data = DataMgr.getPlaceBallLevel(level);
  21214. let curPss = data.play && !data.isCur;
  21215. if (curPss) {
  21216. console.log('zh:clickRightBtn 333-111');
  21217. console.log('zh:当前LV=' + level);
  21218. if (level == 60) {
  21219. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21220. Laya.timer.once(3000, this, () => {
  21221. this.returnHome();
  21222. });
  21223. }
  21224. else {
  21225. let lev = level + 1;
  21226. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21227. }
  21228. }
  21229. else {
  21230. console.log('zh:clickRightBtn 333-000');
  21231. Moyu.sendDataEvent("placeBallNextLevel");
  21232. console.log('zh:qjff_AD_for_uiGameEnd');
  21233. if (Laya.Browser.onAndroid) {
  21234. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21235. if (!boo) {
  21236. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21237. return;
  21238. }
  21239. }
  21240. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21241. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21242. }
  21243. else {
  21244. console.log('zh:AD 失败,直接发放奖励');
  21245. this.qjff_AD_for_uiGameEnd(level);
  21246. }
  21247. }
  21248. break;
  21249. default:
  21250. console.log('zh:clickRightBtn 444');
  21251. break;
  21252. }
  21253. }
  21254. logEventForChallenge_level_start(level) {
  21255. let keyStr = 'sjmd_challenge_level_start';
  21256. let jsonStr = {
  21257. "count": 0,
  21258. "gold_balance ": DataMgr.getCoin(),
  21259. "level": level,
  21260. "diamond_balance ": DataMgr.getDiamond()
  21261. };
  21262. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21263. const d = LocalStorageManager.getItem(keyStr);
  21264. if (level > d.level) {
  21265. jsonStr.count = d.count + 1;
  21266. LocalStorageManager.setItem(keyStr, jsonStr);
  21267. }
  21268. else {
  21269. }
  21270. }
  21271. else {
  21272. LocalStorageManager.setItem(keyStr, jsonStr);
  21273. }
  21274. const reqStr = JSON.stringify(jsonStr);
  21275. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21276. }
  21277. qjff_AD_for_uiGameEnd(level) {
  21278. DataMgr.setPlaceBallLevel(level, 1);
  21279. this.startPlaceBallLevel(level + 1);
  21280. }
  21281. startPlaceBallLevel(level) {
  21282. xGame.common.gameMode = GameMode.placeBall;
  21283. xGame.common.placeBallCurLevel = level;
  21284. xGame.uiMgr.Show(UIGame$1);
  21285. this.hide();
  21286. }
  21287. logEventForChallenge_level_complete(level) {
  21288. let keyStr = 'sjmd_challenge_level_complete';
  21289. let jsonStr = {
  21290. "count": 1,
  21291. "gold_balance ": DataMgr.getCoin(),
  21292. "level": level,
  21293. "diamond_balance ": DataMgr.getDiamond()
  21294. };
  21295. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21296. const d = LocalStorageManager.getItem(keyStr);
  21297. jsonStr.count = d.count + 1;
  21298. LocalStorageManager.setItem(keyStr, jsonStr);
  21299. }
  21300. else {
  21301. LocalStorageManager.setItem(keyStr, jsonStr);
  21302. }
  21303. const reqStr = JSON.stringify(jsonStr);
  21304. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21305. }
  21306. logEventForChallenge_level_N(level) {
  21307. console.log('zh:logEventForChallenge_level_N ' + level);
  21308. let keyStr = 'sjmd_challenge_level_N';
  21309. if (LocalStorageManager.hasKey(keyStr)) {
  21310. let lev = LocalStorageManager.getItem(keyStr);
  21311. if (level > lev) {
  21312. LocalStorageManager.setItem(keyStr, level);
  21313. }
  21314. if ((level) % 5 == 0) {
  21315. console.log('zh:每5关上报1次');
  21316. let sjmc = 'challenge_level_' + level;
  21317. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21318. let sjmcForFirebase = 'challenge_level_' + level;
  21319. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21320. }
  21321. else {
  21322. console.log('zh:5 no 上报');
  21323. }
  21324. }
  21325. else {
  21326. LocalStorageManager.setItem(keyStr, level);
  21327. }
  21328. }
  21329. }
  21330. UIGameEnd$1.uiName = "UIGameEnd";
  21331. class ShowItem$1 {
  21332. constructor() {
  21333. this.ui = ui_ShowItem.createInstance();
  21334. }
  21335. destroySelf() {
  21336. if (!this.ui.isDisposed) {
  21337. this.ui.removeFromParent();
  21338. this.ui.dispose();
  21339. }
  21340. }
  21341. setParent(parent) {
  21342. parent.addChild(this.ui);
  21343. }
  21344. setPos(x, y) {
  21345. this.ui.x = x;
  21346. this.ui.y = y;
  21347. }
  21348. setUrl(index) {
  21349. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21350. }
  21351. }
  21352. class UILevelProp$1 extends UIBase {
  21353. constructor() {
  21354. super();
  21355. this.firstPos = 385;
  21356. this.secondPos = 467;
  21357. this.showItemArr = [];
  21358. try {
  21359. Laya.loader.load("res/font/arial.fnt", Laya.Handler.create(this, this.onFontLoaded));
  21360. console.log("zh: constructor加载arial字体成功");
  21361. }
  21362. catch (error) {
  21363. console.log("zh: constructor加载arial字体失败");
  21364. }
  21365. }
  21366. onFontLoaded() {
  21367. try {
  21368. Laya.Text.defaultFont = "arial";
  21369. this.ui.myNode.conditionTxt.font = "arial";
  21370. console.log("zh: onFontLoaded 设置arial字体成功");
  21371. }
  21372. catch (error) {
  21373. console.log("zh: constructor onFontLoaded加载arial字体失败");
  21374. }
  21375. }
  21376. onConstructor() {
  21377. this.ui = ui_UILevelProp.createInstance();
  21378. this.contentPane = this.ui;
  21379. this.isEject = false;
  21380. this.addUIClick(this.ui.closeBtn, this.hide);
  21381. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21382. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21383. }
  21384. show(level) {
  21385. super.show();
  21386. this.ui.t1.play();
  21387. this.level = level;
  21388. this.data = cfgTable.placeballData[this.level];
  21389. this.updateSelf();
  21390. this.showPreView();
  21391. this.moneyNode.ui.c1.selectedIndex = 2;
  21392. this.moneyNode.checkPowerTime();
  21393. this.moneyNode.powerChange();
  21394. }
  21395. showPreView() {
  21396. let item;
  21397. let data;
  21398. for (let index = 0; index < this.showItemArr.length; index++) {
  21399. item = this.showItemArr[index];
  21400. item.destroySelf();
  21401. }
  21402. this.showItemArr = [];
  21403. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21404. for (const key in cfgData) {
  21405. data = cfgData[key];
  21406. item = new ShowItem$1();
  21407. item.setParent(this.ui.myNode.displayRoot);
  21408. item.setPos(data.x, data.y);
  21409. item.setUrl(data.value);
  21410. this.showItemArr.push(item);
  21411. }
  21412. }
  21413. updateSelf() {
  21414. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21415. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21416. if (this.data.ball == -1) {
  21417. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21418. }
  21419. else {
  21420. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21421. }
  21422. let localData = DataMgr.getPlaceBallLevel(this.level);
  21423. let getAward = localData.getAward;
  21424. let cfg = cfgTable.placeballData[this.level];
  21425. let coin = this.data.award[0];
  21426. let diamond = this.data.award[1];
  21427. if (cfg.type == PlaceBallType.challenge) {
  21428. diamond = 0;
  21429. coin = 100;
  21430. }
  21431. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21432. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21433. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21434. if (cfg.type == PlaceBallType.challenge) {
  21435. this.ui.myNode.coinNode.numTxt.text = "";
  21436. }
  21437. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21438. if (coin > 0 && diamond > 0) {
  21439. this.ui.myNode.diamondNode.x = 385;
  21440. this.ui.myNode.coinNode.x = 467;
  21441. }
  21442. else {
  21443. this.ui.myNode.diamondNode.x = 385;
  21444. this.ui.myNode.coinNode.x = 385;
  21445. }
  21446. if (!getAward) {
  21447. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21448. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21449. }
  21450. else {
  21451. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21452. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21453. }
  21454. }
  21455. startGame() {
  21456. if (DataMgr.powerEnough()) {
  21457. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21458. this.ui.myNode.startBtn.touchable = false;
  21459. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21460. console.log('zh:startGame ');
  21461. this.ui.myNode.startBtn.touchable = true;
  21462. DataMgr.setPower(-1);
  21463. xGame.eventMgr.event(POWER_TIME);
  21464. xGame.common.gameMode = GameMode.placeBall;
  21465. xGame.common.placeBallCurLevel = this.level;
  21466. xGame.uiMgr.Show(UIGame$1);
  21467. this.logEventForChallenge_level_start(this.level);
  21468. xGame.uiMgr.Hide(UILevelDisplay$1);
  21469. xGame.uiMgr.Hide(UIMain$1);
  21470. this.hide();
  21471. }));
  21472. }
  21473. else {
  21474. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21475. xGame.uiMgr.Show(UIPower$1);
  21476. }
  21477. }
  21478. logEventForChallenge_level_start(level) {
  21479. let keyStr = 'sjmd_challenge_level_start';
  21480. let jsonStr = {
  21481. "count": 1,
  21482. "gold_balance ": DataMgr.getCoin(),
  21483. "level": level,
  21484. "diamond_balance ": DataMgr.getDiamond()
  21485. };
  21486. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21487. const d = LocalStorageManager.getItem(keyStr);
  21488. if (level > d.level) {
  21489. jsonStr.count = d.count + 1;
  21490. LocalStorageManager.setItem(keyStr, jsonStr);
  21491. }
  21492. else {
  21493. }
  21494. }
  21495. else {
  21496. LocalStorageManager.setItem(keyStr, jsonStr);
  21497. }
  21498. const reqStr = JSON.stringify(jsonStr);
  21499. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21500. }
  21501. hide() {
  21502. super.hide();
  21503. }
  21504. }
  21505. UILevelProp$1.uiName = "UILevelProp";
  21506. class PutBallLevelDisplay$1 {
  21507. constructor(ui, index) {
  21508. this.index = 0;
  21509. this.ui = ui;
  21510. this.index = index;
  21511. this.ui.onClick(this, this.clickSelf);
  21512. this.updateSelf();
  21513. this.ui.levelTxt.text = (this.index + 1) + "";
  21514. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21515. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21516. }
  21517. updateSelf() {
  21518. let level = this.index + 1;
  21519. this.data = DataMgr.getPlaceBallLevel(level);
  21520. this.ui.starNode.c1.selectedIndex = this.data.star;
  21521. let isChallenge = cfgTable.placeballData[level].type;
  21522. if (this.data.isCur) {
  21523. if (isChallenge) {
  21524. this.ui.c1.selectedIndex = 5;
  21525. }
  21526. else {
  21527. this.ui.c1.selectedIndex = 2;
  21528. }
  21529. }
  21530. else {
  21531. if (this.data.play) {
  21532. if (this.data.star == 3) {
  21533. this.ui.c1.selectedIndex = 0;
  21534. }
  21535. else {
  21536. this.ui.c1.selectedIndex = 1;
  21537. }
  21538. }
  21539. else {
  21540. if (isChallenge) {
  21541. this.ui.c1.selectedIndex = 4;
  21542. }
  21543. else {
  21544. this.ui.c1.selectedIndex = 3;
  21545. }
  21546. }
  21547. }
  21548. }
  21549. clickSelf() {
  21550. if (!this.data.play)
  21551. return;
  21552. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21553. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21554. }
  21555. }
  21556. class UILevelDisplay$1 extends UIBase {
  21557. constructor() {
  21558. super();
  21559. }
  21560. onConstructor() {
  21561. this.ui = ui_UILevelDisplay.createInstance();
  21562. this.contentPane = this.ui;
  21563. this.isEject = false;
  21564. this.myList = this.ui.myNode.myList;
  21565. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21566. this.levelItemArr = [];
  21567. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21568. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21569. this.myList.numItems = levelNum;
  21570. }
  21571. levelItemRender(index, target) {
  21572. let item = new PutBallLevelDisplay$1(target, index);
  21573. this.levelItemArr.push(item);
  21574. }
  21575. show() {
  21576. super.show();
  21577. this.updateLevel();
  21578. this.scrollToPlace();
  21579. }
  21580. updateLevel() {
  21581. let temp;
  21582. for (let index = 0; index < this.levelItemArr.length; index++) {
  21583. temp = this.levelItemArr[index];
  21584. temp.updateSelf();
  21585. }
  21586. }
  21587. scrollToPlace() {
  21588. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21589. let passArr = DataMgr.getPlaceBallLevelList();
  21590. let offest = passArr.length;
  21591. if (offest >= maxNum - 1)
  21592. offest = maxNum - 1;
  21593. this.myList.scrollToView(offest, true, true);
  21594. }
  21595. hide() {
  21596. super.hide();
  21597. }
  21598. }
  21599. UILevelDisplay$1.uiName = "UILevelDisplay";
  21600. class UIMatching$1 extends UIBase {
  21601. constructor() {
  21602. super();
  21603. }
  21604. onConstructor() {
  21605. this.ui = ui_UIMatching.createInstance();
  21606. this.contentPane = this.ui;
  21607. this.isEject = false;
  21608. }
  21609. show(callback) {
  21610. super.show();
  21611. PlatMgr.showBanner(true);
  21612. this.callback = callback;
  21613. let user = Moyu.getUserInfo();
  21614. if (!this.selfPot) {
  21615. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21616. }
  21617. if (!this.aiPot) {
  21618. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21619. }
  21620. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21621. this.ui.selfHead.nameTxt.text = user.nickName;
  21622. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21623. this.ui.aiHead.nameTxt.text = "???";
  21624. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21625. this.ui.selfHead.c1.selectedIndex = 0;
  21626. this.ui.aiHead.c1.selectedIndex = 0;
  21627. this.ui.selfHead.x = this.selfPot.x;
  21628. this.ui.selfHead.y = this.selfPot.y;
  21629. this.ui.aiHead.x = this.aiPot.x;
  21630. this.ui.aiHead.y = this.aiPot.y;
  21631. switch (xGame.common.gameMode) {
  21632. case GameMode.classic:
  21633. break;
  21634. case GameMode.bigMove:
  21635. this.initSkillData();
  21636. break;
  21637. default:
  21638. break;
  21639. }
  21640. this.ui.t1.play(Laya.Handler.create(this, () => {
  21641. this.ui.t2.play(Laya.Handler.create(this, () => {
  21642. switch (xGame.common.gameMode) {
  21643. case GameMode.classic:
  21644. this.waitingPeople();
  21645. break;
  21646. case GameMode.bigMove:
  21647. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21648. break;
  21649. default:
  21650. break;
  21651. }
  21652. }));
  21653. }));
  21654. }
  21655. initSkillData() {
  21656. this.skillSelectData = [];
  21657. let skillUrl = xGame.common.skillIconList;
  21658. let skillName = xGame.common.skillNameList;
  21659. let skillLevel = DataMgr.getBigSkillList();
  21660. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21661. for (let index = 0; index < 5; index++) {
  21662. let obj = {};
  21663. obj.skillImg = skillUrl[index];
  21664. obj.skillName = skillName[index];
  21665. obj.skillType = skillType[index];
  21666. obj.skillLevel = skillLevel[index];
  21667. this.skillSelectData.push(obj);
  21668. }
  21669. }
  21670. getAISkillLevel(myLevel) {
  21671. let video = xGame.common.upSkillLevel;
  21672. let aiLevel;
  21673. let temp;
  21674. if (video) {
  21675. temp = xGame.common.randomNum(-2, -1);
  21676. }
  21677. else {
  21678. if (myLevel <= 5) {
  21679. temp = xGame.common.randomNum(1, 3);
  21680. }
  21681. else if (myLevel <= 9) {
  21682. temp = xGame.common.randomNum(-2, 1);
  21683. }
  21684. else {
  21685. temp = xGame.common.randomNum(-4, 0);
  21686. }
  21687. }
  21688. aiLevel = temp + myLevel;
  21689. if (aiLevel <= 1)
  21690. aiLevel = 1;
  21691. if (aiLevel >= 10)
  21692. aiLevel = 10;
  21693. return aiLevel;
  21694. }
  21695. getAISkillType() {
  21696. return xGame.common.randomNum(1, 4);
  21697. let successTimes = DataMgr.getSkillSuccessTimes();
  21698. let info = cfgTable.aiskillData[successTimes];
  21699. if (!info) {
  21700. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21701. info = cfgTable.aiskillData[max];
  21702. }
  21703. let dataArr = info.skillselect;
  21704. let myCfg = {};
  21705. for (let index = 0; index < dataArr.length; index++) {
  21706. let temp = dataArr[index].split('-');
  21707. myCfg[temp[0]] = {};
  21708. myCfg[temp[0]].id = parseInt(temp[0]);
  21709. myCfg[temp[0]].weight = parseInt(temp[1]);
  21710. }
  21711. let aiCfg = xGame.common.initWeight(myCfg);
  21712. let curData = xGame.common.getRandomWeightData(aiCfg);
  21713. return parseInt(curData.id);
  21714. }
  21715. getAISkillData(index) {
  21716. let myLevel = this.skillSelectData[index].skillLevel;
  21717. let aiLevel = this.getAISkillLevel(myLevel);
  21718. let aiType = this.getAISkillType() - 1;
  21719. return { aiLevel, aiType } = { aiLevel, aiType };
  21720. }
  21721. skillSelectFinish(index) {
  21722. let aiInfo = this.getAISkillData(index);
  21723. xGame.common.gameMgr.selfCurSkill = index;
  21724. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21725. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21726. this.ui.selfHead.c1.selectedIndex = 1;
  21727. this.ui.aiHead.c1.selectedIndex = 1;
  21728. let myData = this.skillSelectData[index];
  21729. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21730. let guide = DataMgr.getSkillGuide();
  21731. if (guide == 0) {
  21732. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21733. }
  21734. else {
  21735. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21736. }
  21737. let aiData = this.skillSelectData[aiInfo.aiType];
  21738. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21739. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21740. this.waitingPeople();
  21741. }
  21742. waitingPeople() {
  21743. let time = xGame.common.randomNum(1000, 3000);
  21744. time += 1000;
  21745. Laya.timer.once(time, this, () => {
  21746. this.matchingSuccess();
  21747. });
  21748. }
  21749. matchingSuccess() {
  21750. let gameUI = xGame.common.gameUI;
  21751. let name = gameUI.ui.topNode.aiNameTxt.text;
  21752. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21753. this.ui.aiHead.nameTxt.text = name;
  21754. this.ui.aiHead.headImg.url = url;
  21755. name = gameUI.ui.topNode.selfNameTxt.text;
  21756. url = gameUI.ui.topNode.selfHeadLoader.url;
  21757. this.ui.selfHead.nameTxt.text = name;
  21758. this.ui.selfHead.headImg.url = url;
  21759. this.ui.t3.play(Laya.Handler.create(this, () => {
  21760. this.callback && this.callback();
  21761. this.ui.t4.play(Laya.Handler.create(this, () => {
  21762. this.destroySelf();
  21763. }));
  21764. }));
  21765. }
  21766. destroySelf() {
  21767. this.callback = null;
  21768. this.skillSelectData = null;
  21769. this.selfPot = null;
  21770. this.aiPot = null;
  21771. if (!this.ui.isDisposed) {
  21772. this.ui.removeFromParent();
  21773. this.ui.dispose();
  21774. }
  21775. xGame.uiMgr.destroyUI(this);
  21776. }
  21777. }
  21778. UIMatching$1.uiName = "UIMatching";
  21779. class SkillDisplay$1 {
  21780. constructor(ui, data, uiIndex) {
  21781. this.starX = 0;
  21782. this.starY = 0;
  21783. this.index = 0;
  21784. this.ui = ui;
  21785. this.data = data;
  21786. this.index = uiIndex;
  21787. this.initSelf();
  21788. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21789. }
  21790. initSelf() {
  21791. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21792. this.ui.nameTxt.text = this.data.name;
  21793. this.ui.describeTxt.text = this.data.describe;
  21794. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21795. this.ui.startBtn.onClick(this, this.startGame);
  21796. this.updateSelf();
  21797. }
  21798. updateSelf() {
  21799. this.checkTry();
  21800. let level = DataMgr.getBigSkillByIndex(this.index);
  21801. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21802. }
  21803. checkTry() {
  21804. let index = this.index;
  21805. let level = DataMgr.getBigSkillByIndex(index);
  21806. if (level == null) {
  21807. DataMgr.setBigSkill(index, 1, false);
  21808. level = 1;
  21809. }
  21810. this.ui.levelTxt.text = "LV." + level;
  21811. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21812. this.ui.tryNode.visible = true;
  21813. else
  21814. this.ui.tryNode.visible = false;
  21815. }
  21816. clickAddLevel() {
  21817. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21818. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21819. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21820. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21821. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21822. }
  21823. else {
  21824. console.log('zh:AD 失败,直接发放奖励');
  21825. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21826. }
  21827. }
  21828. qjff_AD_for_skilldisplay_clickAddLevel() {
  21829. DataMgr.setBigSkill(this.data.index, 1);
  21830. this.updateSelf();
  21831. xGame.common.upSkillLevel = true;
  21832. }
  21833. startGame() {
  21834. console.log('zh:rod skill startgame');
  21835. if (this.data.index == 3) {
  21836. alert('Coming soon!');
  21837. return;
  21838. }
  21839. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21840. let needCoin = xGame.common.bigMoveNeedCoin;
  21841. xGame.common.passAwardCoin = 2000;
  21842. let guide = DataMgr.getSkillGuide();
  21843. console.log('zh:startGame guide=' + guide);
  21844. xGame.common.temSelfLevel = 0;
  21845. if (guide == 0) {
  21846. needCoin = 0;
  21847. xGame.common.temSelfLevel = 100;
  21848. }
  21849. if (DataMgr.coinEnough(needCoin)) {
  21850. DataMgr.setCoin(-needCoin);
  21851. xGame.common.curPlayerSkillType = this.index;
  21852. if (guide == 0)
  21853. xGame.common.curPlayerSkillType = 0;
  21854. console.log('zh: skilldisplay 1');
  21855. xGame.uiMgr.Show(UIGame$1);
  21856. xGame.uiMgr.Hide(UIMain$1);
  21857. xGame.uiMgr.Show(UIMatching$1, () => {
  21858. xGame.common.gameUI.ui.alpha = 1;
  21859. xGame.common.gameUI.startGame();
  21860. xGame.uiMgr.Hide(UISkill$1);
  21861. });
  21862. this.logEventForRod_start();
  21863. }
  21864. else {
  21865. console.log('zh: skilldisplay 2');
  21866. xGame.uiMgr.Show(UIAddProp$1, 0);
  21867. Moyu.sendDataEvent("AddCoinVideo");
  21868. }
  21869. }
  21870. logEventForRod_start() {
  21871. let gfmsIdx = xGame.common.curPlayerSkillType;
  21872. console.log('zh:选择的技能=' + gfmsIdx);
  21873. let gfmc = 'Skyfall Shot';
  21874. if (gfmsIdx == 0) {
  21875. gfmc = 'Skyfall Shot';
  21876. }
  21877. if (gfmsIdx == 1) {
  21878. gfmc = 'Surging break';
  21879. }
  21880. if (gfmsIdx == 2) {
  21881. gfmc = 'Frost Lock';
  21882. }
  21883. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21884. let jsonStr = {
  21885. "count": 0,
  21886. "name": gfmc
  21887. };
  21888. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21889. const d = LocalStorageManager.getItem(keyStr);
  21890. jsonStr.count = d.count + 1;
  21891. LocalStorageManager.setItem(keyStr, jsonStr);
  21892. }
  21893. else {
  21894. LocalStorageManager.setItem(keyStr, jsonStr);
  21895. }
  21896. const reqStr = JSON.stringify(jsonStr);
  21897. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21898. }
  21899. }
  21900. class UISkill$1 extends UIBase {
  21901. constructor() {
  21902. super();
  21903. this.skillData = [];
  21904. }
  21905. onConstructor() {
  21906. this.ui = ui_UISkill.createInstance();
  21907. this.contentPane = this.ui;
  21908. this.isEject = false;
  21909. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21910. this.initSkillData();
  21911. console.log('zh:aaaaaa1111111111');
  21912. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21913. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21914. console.log('zh:aaaaaa22222222');
  21915. this.displayList = [];
  21916. this.ui.skillNode.skillList.numItems = 3;
  21917. this.addUIClick(this.ui, this.interuptSecretary);
  21918. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21919. this.ui.talkNode.visible = false;
  21920. if (Moyu.isKs)
  21921. this.ui.closeNode.closeBtn.x += 100;
  21922. }
  21923. show() {
  21924. super.show();
  21925. this.playSecretaryIdle();
  21926. this.moneyNode.ui.c1.selectedIndex = 1;
  21927. Laya.timer.clearAll(this);
  21928. xGame.soundMgr.playSound("s_start");
  21929. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21930. let guide = DataMgr.getSkillGuide();
  21931. this.ui.guideNode.visible = guide == 0;
  21932. let item = this.getSkillItemByUIIndex(0);
  21933. if (guide == 0) {
  21934. item.ui.c1.selectedIndex = 1;
  21935. }
  21936. else {
  21937. item.ui.c1.selectedIndex = 0;
  21938. }
  21939. this.ui.guideNode.guideBtn.visible = guide == 0;
  21940. for (let index = 0; index < this.displayList.length; index++) {
  21941. this.displayList[index].checkTry();
  21942. }
  21943. }
  21944. getSkillItemByUIIndex(cur) {
  21945. for (let index = 0; index < this.displayList.length; index++) {
  21946. if (this.displayList[index].index == cur) {
  21947. return this.displayList[index];
  21948. }
  21949. }
  21950. }
  21951. enterGuideLevel() {
  21952. let item = this.getSkillItemByUIIndex(0);
  21953. item.startGame();
  21954. if (DataMgr.getNewUser())
  21955. Moyu.sendDataEvent("gameStart1");
  21956. }
  21957. initSkillData() {
  21958. this.skillData = [];
  21959. let nameList = xGame.common.skillNameList;
  21960. let iconList = xGame.common.skillIconList;
  21961. let describeList = [
  21962. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21963. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21964. "The power of frost descends—freezing the flow and taking full control of the game!"
  21965. ];
  21966. console.log('zh:initSkillData 111111111');
  21967. let data;
  21968. for (let index = 0; index < nameList.length; index++) {
  21969. data = {};
  21970. data.name = nameList[index];
  21971. data.icon = iconList[index];
  21972. data.describe = describeList[index];
  21973. data.index = index;
  21974. this.skillData.push(data);
  21975. }
  21976. }
  21977. updateSkillItem(index, target) {
  21978. if (this.displayList[index] == null) {
  21979. let uiIndex;
  21980. switch (index) {
  21981. case 0:
  21982. uiIndex = 1;
  21983. break;
  21984. case 1:
  21985. uiIndex = 0;
  21986. break;
  21987. case 2:
  21988. uiIndex = 2;
  21989. break;
  21990. case 3:
  21991. uiIndex = 3;
  21992. break;
  21993. default:
  21994. break;
  21995. }
  21996. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21997. this.displayList.push(temp);
  21998. }
  21999. }
  22000. playSecretaryIdle() {
  22001. let parent = this.ui.secretary.displayObject;
  22002. parent.destroyChildren();
  22003. let xx = this.ui.secretary.width / 2;
  22004. let yy = this.ui.secretary.height;
  22005. let scale = xGame.common.getSecretaryScale();
  22006. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22007. xGame.common.secretary.play(data, 0, true, parent);
  22008. }
  22009. returnUIMain() {
  22010. this.hide();
  22011. xGame.common.stopGirlPop(this.ui.talkNode);
  22012. xGame.uiMgr.Show(UIMain$1);
  22013. }
  22014. interuptSecretary() {
  22015. Laya.timer.clearAll(this);
  22016. this.playSecretaryRandomSound();
  22017. }
  22018. playSecretaryRandomSound() {
  22019. if (this.isHide)
  22020. return;
  22021. let time = xGame.common.randomNum(45000, 60000);
  22022. Laya.timer.once(time, this, () => {
  22023. if (this.isHide)
  22024. return;
  22025. let index = xGame.common.randomNum(4, 7);
  22026. xGame.soundMgr.playSound("s_main0" + index);
  22027. let words = 1;
  22028. switch (index) {
  22029. case 4:
  22030. words = 5;
  22031. break;
  22032. case 5:
  22033. words = 3;
  22034. break;
  22035. case 6:
  22036. words = 6;
  22037. break;
  22038. case 7:
  22039. words = 7;
  22040. break;
  22041. default:
  22042. break;
  22043. }
  22044. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22045. this.playSecretaryRandomSound();
  22046. });
  22047. }
  22048. }
  22049. UISkill$1.uiName = "UISkill";
  22050. class UIAddProp$1 extends UIBase {
  22051. constructor() {
  22052. super();
  22053. this.curType = "";
  22054. }
  22055. onConstructor() {
  22056. this.ui = ui_UIAddProp.createInstance();
  22057. this.contentPane = this.ui;
  22058. this.isEject = false;
  22059. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22060. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22061. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22062. this.updateUI();
  22063. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22064. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22065. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22066. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22067. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22068. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22069. }
  22070. show(type) {
  22071. super.show();
  22072. this.curType = type == 0 ? "coin" : "diamond";
  22073. this.switchBtn("");
  22074. this.ui.t0.play();
  22075. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22076. PlatMgr.showInsert(true);
  22077. }
  22078. closeSelf() {
  22079. this.hide();
  22080. }
  22081. updateUI() {
  22082. let data = cfgTable.moneyData;
  22083. let temp;
  22084. let obj;
  22085. for (const key in data) {
  22086. temp = data[key];
  22087. obj = this.ui.myNode["node" + key];
  22088. if (parseInt(key) <= 2) {
  22089. obj.diamondTxt.text = "+" + temp.num;
  22090. }
  22091. else {
  22092. obj.coinTxt.text = temp.num;
  22093. obj.diamondTxt.text = temp.get.split('_')[1];
  22094. }
  22095. }
  22096. this.updateDiamondShare();
  22097. }
  22098. updateDiamondShare() {
  22099. let data = DataMgr.getShareDiamondTimes();
  22100. if (data >= xGame.common.maxShareDiamondTimes) {
  22101. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22102. this.ui.myNode.node1.touchable = false;
  22103. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22104. }
  22105. else {
  22106. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22107. this.ui.myNode.node1.touchable = true;
  22108. }
  22109. }
  22110. switchBtn(type) {
  22111. if (type == "")
  22112. type = this.curType;
  22113. else {
  22114. if (this.curType == type) {
  22115. return;
  22116. }
  22117. else {
  22118. this.curType = type;
  22119. }
  22120. }
  22121. if (type == "coin") {
  22122. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22123. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22124. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22125. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22126. this.ui.myNode.c1.selectedIndex = 0;
  22127. }
  22128. else {
  22129. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22130. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22131. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22132. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22133. this.ui.myNode.c1.selectedIndex = 1;
  22134. }
  22135. }
  22136. convertCoin(index) {
  22137. let data = cfgTable.moneyData[index];
  22138. let coinNum = data.num;
  22139. let str = data.get.split('_')[1];
  22140. let needDiamond = parseInt(str);
  22141. if (DataMgr.diamondEnough(needDiamond)) {
  22142. DataMgr.setDiamond(-needDiamond);
  22143. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22144. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22145. }
  22146. else {
  22147. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22148. this.switchBtn("diamond");
  22149. }
  22150. }
  22151. videoGetDiamond() {
  22152. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22153. if (Laya.Browser.onAndroid) {
  22154. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22155. if (!boo) {
  22156. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22157. return;
  22158. }
  22159. }
  22160. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22161. }
  22162. else {
  22163. console.log('zh:AD 失败,直接发放奖励');
  22164. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22165. }
  22166. }
  22167. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22168. let num = cfgTable.moneyData[2].num;
  22169. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22170. this.closeSelf();
  22171. }
  22172. videoGetCoin() {
  22173. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22174. if (Laya.Browser.onAndroid) {
  22175. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22176. if (!boo) {
  22177. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22178. return;
  22179. }
  22180. }
  22181. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22182. }
  22183. else {
  22184. console.log('zh:AD 失败,直接发放奖励');
  22185. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22186. }
  22187. }
  22188. qjff_AD_for_uiAddProp_videoGetCoin() {
  22189. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22190. this.closeSelf();
  22191. }
  22192. shareGetDiamond() {
  22193. let times = DataMgr.getShareDiamondTimes();
  22194. if (times >= xGame.common.maxShareDiamondTimes) {
  22195. console.log('zh: 233333333333 maxShareDiamondTimes');
  22196. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22197. }
  22198. else {
  22199. console.log('zh:33333333333333ad');
  22200. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22201. if (Laya.Browser.onAndroid) {
  22202. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22203. if (!boo) {
  22204. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22205. return;
  22206. }
  22207. }
  22208. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22209. }
  22210. else {
  22211. console.log('zh:AD 失败,直接发放奖励');
  22212. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22213. }
  22214. }
  22215. }
  22216. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22217. let diamond = xGame.common.randomNum(50, 100);
  22218. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22219. DataMgr.setShareDiamondTimes(1);
  22220. this.updateDiamondShare();
  22221. }
  22222. openPutBallView() {
  22223. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22224. let skill = xGame.uiMgr.getUI(UISkill$1);
  22225. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22226. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22227. if (end && !end.isHide) {
  22228. xGame.uiMgr.Hide(UIGameEnd$1);
  22229. xGame.uiMgr.Show(UIMain$1);
  22230. }
  22231. if (skill && !skill.isHide)
  22232. xGame.uiMgr.Hide(UISkill$1);
  22233. if (uigame && !uigame.isHide)
  22234. xGame.uiMgr.Hide(UIGame$1);
  22235. if (level && !level.isHide) {
  22236. }
  22237. else {
  22238. xGame.uiMgr.Show(UILevelDisplay$1);
  22239. }
  22240. this.closeSelf();
  22241. }
  22242. }
  22243. UIAddProp$1.uiName = "UIAddProp";
  22244. class MoneyNode$1 {
  22245. constructor(ui) {
  22246. this.leftTime = 0;
  22247. this.ui = ui;
  22248. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22249. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22250. this.ui.addPowerBtn.onClick(this, this.addPower);
  22251. this.ui.c1.selectedIndex = 1;
  22252. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22253. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22254. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22255. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22256. this.coinChange();
  22257. this.diamondChange();
  22258. this.powerChange();
  22259. }
  22260. addPower() {
  22261. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22262. xGame.uiMgr.Show(UIPower$1);
  22263. }
  22264. powerChange() {
  22265. let powerNum = DataMgr.getPower();
  22266. this.ui.powerTxt.text = powerNum + "";
  22267. }
  22268. checkPowerTime() {
  22269. let cur = new Date().getTime();
  22270. let last = DataMgr.getPowerTime();
  22271. if (last == 0) {
  22272. last = cur;
  22273. DataMgr.setPowerTime(cur);
  22274. }
  22275. let power = DataMgr.getPower();
  22276. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22277. Laya.timer.clearAll(this);
  22278. if (power >= xGame.common.natureMaxPower) {
  22279. this.ui.powerTimeTxt.text = "";
  22280. DataMgr.setPowerTime(cur);
  22281. return;
  22282. }
  22283. if (power + offset >= xGame.common.natureMaxPower) {
  22284. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22285. this.ui.powerTimeTxt.text = "";
  22286. DataMgr.setPowerTime(cur);
  22287. }
  22288. else {
  22289. if (offset > 0) {
  22290. DataMgr.setPower(offset);
  22291. DataMgr.setPowerTime(cur);
  22292. }
  22293. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22294. this.leftTime = xGame.common.powerRecoverNum - time;
  22295. if (this.leftTime <= 0)
  22296. this.leftTime = 0;
  22297. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22298. Laya.timer.loop(1000, this, this.updatePowerTime);
  22299. }
  22300. }
  22301. updatePowerTime() {
  22302. this.leftTime -= 1;
  22303. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22304. if (this.leftTime <= 0) {
  22305. this.checkPowerTime();
  22306. }
  22307. }
  22308. coinChange() {
  22309. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22310. }
  22311. diamondChange() {
  22312. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22313. }
  22314. addCoin() {
  22315. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22316. Moyu.sendDataEvent("AddCoinBtn");
  22317. xGame.uiMgr.Show(UIAddProp$1, 0);
  22318. }
  22319. addDiamond() {
  22320. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22321. Moyu.sendDataEvent("AddDiamondBtn");
  22322. xGame.uiMgr.Show(UIAddProp$1, 1);
  22323. }
  22324. }
  22325. class SettingNode$1 {
  22326. constructor(ui) {
  22327. this.showSetting = false;
  22328. this.openSound = true;
  22329. this.openShake = true;
  22330. this.ui = ui;
  22331. this.ui.soundBtn.onClick(this, this.switchSound);
  22332. this.ui.shakeBtn.onClick(this, this.switchShake);
  22333. this.ui.xyBtn.onClick(this, this.onXy);
  22334. this.ui.clickNode.onClick(this, this.changeSetting);
  22335. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22336. this.ui.xyBtn.visible = false;
  22337. this.ui.shakeBtn.visible = false;
  22338. }
  22339. changeSetting() {
  22340. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22341. this.showSetting = !this.showSetting;
  22342. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22343. }
  22344. switchSound() {
  22345. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22346. this.openSound = !this.openSound;
  22347. Moyu.onSetting(this.openSound, this.openShake);
  22348. xGame.soundMgr.onSetting(this.openSound);
  22349. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22350. }
  22351. switchShake() {
  22352. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22353. this.openShake = !this.openShake;
  22354. Moyu.onSetting(this.openSound, this.openShake);
  22355. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22356. }
  22357. onXy() {
  22358. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22359. MoyuMgr$1.showXy(1);
  22360. }
  22361. }
  22362. class UIDraw$1 extends UIBase {
  22363. constructor() {
  22364. super();
  22365. this.curKey = 0;
  22366. }
  22367. onConstructor() {
  22368. this.ui = ui_UIDraw.createInstance();
  22369. this.contentPane = this.ui;
  22370. this.isEject = false;
  22371. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22372. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22373. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22374. this.initDraw();
  22375. this.initUI();
  22376. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22377. }
  22378. show() {
  22379. super.show();
  22380. this.ui.t0.play();
  22381. this.playSecretaryIdle();
  22382. this.updateDraw();
  22383. this.checkFree();
  22384. if (PlatMgr.bannerDelay > 0) {
  22385. this.ui.closeNode.closeBtn.visible = false;
  22386. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22387. this.ui.closeNode.closeBtn.visible = true;
  22388. });
  22389. }
  22390. PlatMgr.showRateBanner();
  22391. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22392. }
  22393. hide() {
  22394. Laya.timer.clearAll(this);
  22395. super.hide();
  22396. }
  22397. checkFree() {
  22398. let isFree = DataMgr.getDailyfreeDrawTimes();
  22399. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22400. }
  22401. initDraw() {
  22402. this.drawObj = [];
  22403. let data = cfgTable.drawData;
  22404. let temp;
  22405. let weight = 0;
  22406. for (const key in data) {
  22407. temp = data[key];
  22408. weight += temp.weight;
  22409. this.drawObj.push(weight);
  22410. }
  22411. this.allWeight = weight;
  22412. }
  22413. initUI() {
  22414. let data = cfgTable.drawData;
  22415. let temp;
  22416. let img;
  22417. let txt;
  22418. for (const key in data) {
  22419. temp = data[key];
  22420. img = this.ui.myNode.rotNode["img" + key];
  22421. txt = this.ui.myNode.rotNode["txt" + key];
  22422. img.url = xGame.common.getGameIconUrl(temp.icon);
  22423. txt.visible = true;
  22424. if (temp.award > 2) {
  22425. img.rotation = 0;
  22426. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22427. }
  22428. else {
  22429. img.rotation = temp.rotation;
  22430. txt.text = temp.num;
  22431. }
  22432. }
  22433. }
  22434. getCurkey() {
  22435. let rand = Math.random() * this.allWeight;
  22436. let temp;
  22437. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22438. temp = this.drawObj[index];
  22439. if (index == 0) {
  22440. if (rand < temp) {
  22441. return index + 1;
  22442. }
  22443. }
  22444. else {
  22445. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22446. return index + 1;
  22447. }
  22448. }
  22449. }
  22450. return 2;
  22451. }
  22452. startDraw() {
  22453. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22454. if (freeTimes > 0) {
  22455. this.beginDraw();
  22456. DataMgr.setDailyfreeDrawTimes(0);
  22457. this.checkFree();
  22458. }
  22459. else {
  22460. if (Laya.Browser.onAndroid) {
  22461. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22462. if (!boo) {
  22463. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22464. return;
  22465. }
  22466. }
  22467. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22468. }
  22469. else {
  22470. console.log('zh:AD 失败,直接发放奖励');
  22471. this.qjff_chouJiang();
  22472. }
  22473. }
  22474. }
  22475. qjff_chouJiang() {
  22476. this.beginDraw();
  22477. }
  22478. beginDraw() {
  22479. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22480. this.ui.drawBtn.touchable = false;
  22481. this.curKey = this.getCurkey();
  22482. console.log("当前key", this.curKey);
  22483. let cell = 60;
  22484. let lap = 3;
  22485. let angle = cell * (this.curKey - 1) + lap * 360;
  22486. let target = this.ui.myNode.rotNode;
  22487. target.rotation = 0;
  22488. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22489. console.log("旋转完成");
  22490. this.ui.drawBtn.touchable = true;
  22491. this.getAward();
  22492. }));
  22493. }
  22494. getAward() {
  22495. let data = cfgTable.drawData[this.curKey];
  22496. let temp = new AwardType();
  22497. temp.type = data.award;
  22498. temp.num = data.num;
  22499. xGame.common.getAward([temp], () => {
  22500. DataMgr.setDrawTimes(1);
  22501. this.updateDraw();
  22502. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22503. });
  22504. }
  22505. updateDraw() {
  22506. let drawTimes = DataMgr.getDrawTimes();
  22507. let awardTimes = DataMgr.getDrawAwardTimes();
  22508. if (Math.floor(drawTimes / 3) > awardTimes) {
  22509. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22510. this.ui.extraNode.boxBtn.touchable = true;
  22511. this.ui.extraNode.tipsTxt.text = "3/3";
  22512. this.ui.extraNode.barNode.width = 265;
  22513. this.getExtraAward();
  22514. }
  22515. else {
  22516. this.ui.extraNode.boxBtn.t0.stop();
  22517. this.ui.extraNode.boxBtn.touchable = false;
  22518. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22519. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22520. }
  22521. let data = cfgTable.drawData[1];
  22522. if (awardTimes == 0) {
  22523. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22524. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22525. this.ui.myNode.rotNode.img1.rotation = 0;
  22526. }
  22527. else {
  22528. let award = data.nextid;
  22529. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22530. this.ui.myNode.rotNode.txt1.text = award[1];
  22531. this.ui.myNode.rotNode.img1.rotation = 0;
  22532. }
  22533. }
  22534. getExtraAward() {
  22535. let drawTimes = DataMgr.getDrawTimes();
  22536. let awardTimes = DataMgr.getDrawAwardTimes();
  22537. let data = cfgTable.drawData[1];
  22538. let award = new AwardType();
  22539. if (awardTimes == 0) {
  22540. award.num = data.num;
  22541. award.type = data.award;
  22542. xGame.common.getAward([award], () => {
  22543. let all = Math.floor(drawTimes / 3);
  22544. DataMgr.setDrawAwardTimes(all);
  22545. this.updateDraw();
  22546. });
  22547. }
  22548. else {
  22549. award.num = parseInt(data.nextid[1]);
  22550. award.type = parseInt(data.nextid[0]);
  22551. xGame.common.getAward([award], () => {
  22552. let all = Math.floor(drawTimes / 3);
  22553. DataMgr.setDrawAwardTimes(all);
  22554. this.updateDraw();
  22555. });
  22556. }
  22557. }
  22558. closeSelf() {
  22559. this.hide();
  22560. }
  22561. playSecretaryIdle() {
  22562. let parent = this.ui.secretary.displayObject;
  22563. parent.destroyChildren();
  22564. let xx = this.ui.secretary.width / 2;
  22565. let yy = this.ui.secretary.height;
  22566. let scale = xGame.common.getSecretaryScale();
  22567. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22568. xGame.common.secretary.play(data, 0, true, parent);
  22569. }
  22570. }
  22571. UIDraw$1.uiName = "UIDraw";
  22572. class UIRanking$1 extends UIBase {
  22573. constructor() {
  22574. super();
  22575. this.showSelf = true;
  22576. this.rankType = 1;
  22577. this.rankList = [];
  22578. this.topX = 10;
  22579. this.myIndex = this.topX + 1;
  22580. this.myStar = 0;
  22581. }
  22582. onConstructor() {
  22583. this.ui = ui_UIRanking.createInstance();
  22584. this.contentPane = this.ui;
  22585. this.isEject = false;
  22586. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22587. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22588. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22589. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22590. this.ui.myNode.myList.setVirtual();
  22591. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22592. }
  22593. show() {
  22594. super.show();
  22595. this.getPaiHangBangDataFormJosnFile();
  22596. this.updateSelf();
  22597. let self = Moyu.getUserInfo();
  22598. if (!self.isAuth) {
  22599. Moyu.initUser(this, () => {
  22600. DataMgr.upRankData();
  22601. });
  22602. }
  22603. }
  22604. getPaiHangBangDataFormJosnFile() {
  22605. const rankingList = cfgTable.paiHangBangData.list;
  22606. this.updateItemData(rankingList);
  22607. }
  22608. updateSelfItem() {
  22609. console.log('zh:Moyu.platType =' + Moyu.platType);
  22610. let self = Moyu.getUserInfo();
  22611. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22612. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22613. if (this.myIndex > this.topX) {
  22614. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22615. }
  22616. else {
  22617. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22618. }
  22619. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22620. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22621. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22622. }
  22623. updateItemData(data) {
  22624. this.myStar = xGame.common.getAllStarNum();
  22625. if (this.rankList.length < 2) {
  22626. this.rankList = data;
  22627. let self = Moyu.getUserInfo();
  22628. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22629. self.headIcon = self.headIcon;
  22630. for (let i = 0; i < data.length; i++) {
  22631. let data = this.rankList[i];
  22632. if (data.userId == self.userId) {
  22633. this.rankList.splice(i, 1);
  22634. break;
  22635. }
  22636. }
  22637. for (let i = 0; i < data.length; i++) {
  22638. let data = this.rankList[i];
  22639. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22640. this.myIndex = i + 1;
  22641. let user = { headIcon: self.headIcon, nickName: "myself" };
  22642. let ud = { user: user, data: {} };
  22643. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22644. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22645. if (Moyu.platType < 11) {
  22646. user.headIcon = self.headIcon;
  22647. user.nickName = self.nickName;
  22648. }
  22649. this.rankList.splice(i, 0, md);
  22650. break;
  22651. }
  22652. }
  22653. }
  22654. this.updateSelfItem();
  22655. this.ui.myNode.myList.numItems = this.rankList.length;
  22656. }
  22657. updateItemUI(index, obj) {
  22658. let data = this.rankList[index];
  22659. let userData = JSON.parse(data.userData).user;
  22660. obj.nameTxt.text = userData.nickName.toString();
  22661. obj.valueTxt.text = data.rankScore;
  22662. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22663. obj.rankTxt.text = index + 1;
  22664. switch (index) {
  22665. case 0:
  22666. this.setImg(obj, 1, 0, 0);
  22667. obj.rankTxt.color = "#FFC047";
  22668. break;
  22669. case 1:
  22670. this.setImg(obj, 0, 1, 0);
  22671. obj.rankTxt.color = "#ACACAC";
  22672. break;
  22673. case 2:
  22674. this.setImg(obj, 0, 0, 1);
  22675. obj.rankTxt.color = "#D09672";
  22676. break;
  22677. default:
  22678. this.setImg(obj, 0, 0, 0);
  22679. obj.rankTxt.color = "#496FAB";
  22680. break;
  22681. }
  22682. }
  22683. setImg(obj, a, b, c) {
  22684. obj.img1.visible = a ? true : false;
  22685. obj.img2.visible = b ? true : false;
  22686. obj.img3.visible = c ? true : false;
  22687. }
  22688. changeList(type) {
  22689. this.rankType = type;
  22690. this.updateSelf();
  22691. }
  22692. changeSelfNode() {
  22693. this.showSelf = !this.showSelf;
  22694. this.updateSelf();
  22695. }
  22696. updateSelf() {
  22697. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22698. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22699. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22700. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22701. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22702. }
  22703. }
  22704. UIRanking$1.uiName = "UIRanking";
  22705. class UISecretary$1 extends UIBase {
  22706. constructor() {
  22707. super();
  22708. this.curIndex = 1;
  22709. }
  22710. onConstructor() {
  22711. this.ui = ui_UISecretary.createInstance();
  22712. this.contentPane = this.ui;
  22713. this.isEject = false;
  22714. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22715. this.nodeObj = { left: null, right: null, cur: null };
  22716. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22717. }
  22718. show() {
  22719. super.show();
  22720. this.ui.t0.play();
  22721. this.updateData();
  22722. }
  22723. addSecretarySpine(node, spineName) {
  22724. if (spineName == "mishu") {
  22725. if (this.secretarySpine1) {
  22726. node.displayObject.destroyChildren();
  22727. this.playWoman(this.secretarySpine1, node.displayObject);
  22728. }
  22729. else {
  22730. let spine1 = new SpineMgr("mishu", () => {
  22731. this.secretarySpine1 = spine1;
  22732. this.playWoman(this.secretarySpine1, node.displayObject);
  22733. });
  22734. }
  22735. }
  22736. else {
  22737. if (this.secretarySpine2) {
  22738. node.displayObject.destroyChildren();
  22739. this.playWoman(this.secretarySpine2, node.displayObject);
  22740. }
  22741. else {
  22742. let spine2 = new SpineMgr("xiaomishu2", () => {
  22743. this.secretarySpine2 = spine2;
  22744. this.playWoman(this.secretarySpine2, node.displayObject);
  22745. });
  22746. }
  22747. }
  22748. }
  22749. playWoman(node, parent) {
  22750. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22751. let yy = this.ui.myNode.gameNode3.secretary.height;
  22752. let scale = 1.5;
  22753. if (node == this.secretarySpine2) {
  22754. scale = 1.2;
  22755. }
  22756. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22757. node.play(data, 0, true, parent);
  22758. }
  22759. turnLeft() {
  22760. this.curIndex--;
  22761. if (this.curIndex < 1) {
  22762. this.curIndex = 2;
  22763. }
  22764. let left = this.nodeObj.left;
  22765. let right = this.nodeObj.right;
  22766. let cur = this.nodeObj.cur;
  22767. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22768. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22769. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22770. this.updateData();
  22771. }));
  22772. this.ui.myNode.setChildIndex(right, 2);
  22773. this.nodeObj.left = cur;
  22774. this.nodeObj.right = left;
  22775. this.nodeObj.cur = right;
  22776. }
  22777. turnRight() {
  22778. this.curIndex++;
  22779. if (this.curIndex > 2) {
  22780. this.curIndex = 1;
  22781. }
  22782. let left = this.nodeObj.left;
  22783. let right = this.nodeObj.right;
  22784. let cur = this.nodeObj.cur;
  22785. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22786. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22787. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22788. this.updateData();
  22789. }));
  22790. this.ui.myNode.setChildIndex(left, 2);
  22791. this.nodeObj.left = right;
  22792. this.nodeObj.right = cur;
  22793. this.nodeObj.cur = left;
  22794. }
  22795. updateData() {
  22796. console.log('zh: updateData FFFFFFFFFF');
  22797. let data = cfgTable.secretaryshopData;
  22798. let children = this.ui.myNode._children;
  22799. let temp;
  22800. let curData;
  22801. for (let index = 0; index < children.length; index++) {
  22802. temp = children[index];
  22803. curData = data[1];
  22804. temp.heightTxt.text = curData.height;
  22805. temp.foodTxt.text = curData.food;
  22806. temp.historyTxt.text = curData.history;
  22807. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22808. this.addSecretarySpine(temp.secretary, curData.spine);
  22809. let womanIndex = curData.id - 1;
  22810. let getWoman = DataMgr.getSecretary(womanIndex);
  22811. let curUse = DataMgr.getCurSecretary();
  22812. if (getWoman) {
  22813. if (curUse == womanIndex) {
  22814. temp.purchaseBtn.c1.selectedIndex = 1;
  22815. }
  22816. else {
  22817. temp.purchaseBtn.c1.selectedIndex = 2;
  22818. }
  22819. }
  22820. else {
  22821. temp.purchaseBtn.c1.selectedIndex = 0;
  22822. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22823. }
  22824. temp.purchaseBtn.visible = false;
  22825. }
  22826. }
  22827. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22828. console.log('zh: 点击了clickSecretary ');
  22829. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22830. if (getWoman) {
  22831. if (curUse != womanIndex) {
  22832. console.log();
  22833. DataMgr.setCurSecretary(womanIndex);
  22834. this.updateData();
  22835. }
  22836. }
  22837. else {
  22838. console.log('zh:点击购买了');
  22839. let need = needDiamond;
  22840. if (DataMgr.diamondEnough(need)) {
  22841. DataMgr.setDiamond(-need);
  22842. DataMgr.setSecretary(womanIndex, 1);
  22843. DataMgr.setCurSecretary(womanIndex);
  22844. this.updateData();
  22845. }
  22846. else {
  22847. xGame.uiMgr.Show(UIAddProp$1, 1);
  22848. }
  22849. }
  22850. }
  22851. closeSelf() {
  22852. this.hide();
  22853. }
  22854. }
  22855. UISecretary$1.uiName = "UISecretary";
  22856. class BallRodDisplay$1 {
  22857. constructor(ui, index) {
  22858. this.index = 0;
  22859. this.uiIndex = 0;
  22860. this.ui = ui;
  22861. this.index = index;
  22862. this.initData();
  22863. }
  22864. initData() {
  22865. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22866. let data = cfgTable.ballrodData[this.index + 1];
  22867. this.ui.nameTxt.text = data.name;
  22868. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22869. this.ui.levelNode.c1.selectedIndex = data.quality;
  22870. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22871. if (data.spine) {
  22872. this.mySpine = new SpineMgr(data.spine, () => {
  22873. let xx = 150;
  22874. let yy = 70;
  22875. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22876. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22877. });
  22878. }
  22879. }
  22880. updateSelf() {
  22881. console.log('zh:updateSelf -------------- ');
  22882. let get = DataMgr.getBallRod(this.index);
  22883. if (get == null)
  22884. get = 1;
  22885. let curUse = DataMgr.getCurBallRod();
  22886. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22887. if (get) {
  22888. if (curUse == this.index) {
  22889. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22890. }
  22891. else {
  22892. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22893. }
  22894. }
  22895. else {
  22896. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22897. }
  22898. }
  22899. buyBallRod() {
  22900. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22901. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22902. switch (selectedIndex) {
  22903. case 0:
  22904. break;
  22905. case 1:
  22906. console.log('zh:点击了 USE THIS');
  22907. DataMgr.setCurBallRod(this.index);
  22908. let curUse = DataMgr.getCurBallRod();
  22909. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22910. let ui = xGame.uiMgr.getUI(UIShop$1);
  22911. ui.updateBallRod();
  22912. break;
  22913. case 2:
  22914. let data = cfgTable.ballrodData[this.index + 1];
  22915. let need = data.price;
  22916. if (DataMgr.diamondEnough(need)) {
  22917. this.buyQiuGan(data);
  22918. DataMgr.setDiamond(-need);
  22919. DataMgr.setBallRod(this.index, 1);
  22920. DataMgr.setCurBallRod(this.index);
  22921. let ui = xGame.uiMgr.getUI(UIShop$1);
  22922. ui.updateBallRod();
  22923. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22924. }
  22925. else {
  22926. xGame.uiMgr.Show(UIAddProp$1, 1);
  22927. }
  22928. break;
  22929. default:
  22930. break;
  22931. }
  22932. }
  22933. buyQiuGan(qgItem) {
  22934. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22935. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22936. if (userInfo == null) {
  22937. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22938. return;
  22939. }
  22940. let reqData = xGame.httpMgr.getReqData();
  22941. let pd = JSON.parse(reqData);
  22942. pd.qiuGanData = qgItem;
  22943. reqData = JSON.stringify(pd);
  22944. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22945. try {
  22946. console.log('zh:buySp res = ' + JSON.stringify(res));
  22947. let code = res.code;
  22948. let msg = res.msg;
  22949. if (code == 401) {
  22950. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22951. alert(TIP_MSG_key.loginTimeOut);
  22952. xGame.uiMgr.Show(UIMsg$1, msg);
  22953. return;
  22954. }
  22955. if (code == 200) {
  22956. xGame.uiMgr.Show(UIMsg$1, msg);
  22957. DataMgr.getUserZiChanInfo();
  22958. }
  22959. else {
  22960. xGame.uiMgr.Show(UIMsg$1, msg);
  22961. }
  22962. }
  22963. catch (error) {
  22964. console.log('error=' + error);
  22965. alert(error);
  22966. }
  22967. finally {
  22968. }
  22969. });
  22970. }
  22971. logEventForGouMaiGan(qiuGanName) {
  22972. const ev = {
  22973. value: qiuGanName
  22974. };
  22975. const jsonStr = JSON.stringify(ev);
  22976. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22977. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22978. }
  22979. }
  22980. class DaoJuDisplay$1 {
  22981. constructor(ui, index) {
  22982. this.index = 0;
  22983. this.uiIndex = 0;
  22984. this.ggSpid = "";
  22985. this.spid = 0;
  22986. this.ui = ui;
  22987. this.index = index;
  22988. this.initData();
  22989. }
  22990. initData() {
  22991. this.ui.btn_buy.onClick(this, this.gotoBuy);
  22992. let data = cfgTable.daoJuData[this.index + 1];
  22993. console.log('zh:' + JSON.stringify(data));
  22994. this.ui.nameTxt.text = data.spbt;
  22995. this.ui.n_jiaGe.text = data.spjg + "";
  22996. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22997. this.ggSpid = data.ggSpid;
  22998. this.spid = data.spid;
  22999. let baseUrl = "asset/sound/ogg/";
  23000. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23001. }
  23002. gotoBuy() {
  23003. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23004. if (userInfo != null) {
  23005. let token = userInfo.token;
  23006. let ggSpid = this.ggSpid;
  23007. let spid = this.spid;
  23008. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23009. console.log('zh:gotoBuy1 spid =' + spid);
  23010. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23011. return;
  23012. }
  23013. else {
  23014. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23015. }
  23016. }
  23017. gotoBuy1() {
  23018. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23019. let djItem = cfgTable.daoJuData[this.index + 1];
  23020. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23021. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23022. if (userInfo == null) {
  23023. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23024. return;
  23025. }
  23026. let reqData = xGame.httpMgr.getReqData();
  23027. let pd = JSON.parse(reqData);
  23028. pd.spItem = djItem;
  23029. reqData = JSON.stringify(pd);
  23030. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23031. try {
  23032. console.log('zh:buySp res = ' + JSON.stringify(res));
  23033. let code = res.code;
  23034. let msg = res.msg;
  23035. if (code == 401) {
  23036. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23037. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23038. return;
  23039. }
  23040. if (code == 200) {
  23041. xGame.uiMgr.Show(UIMsg$1, msg);
  23042. DataMgr.getUserZiChanInfo();
  23043. }
  23044. else {
  23045. xGame.uiMgr.Show(UIMsg$1, msg);
  23046. }
  23047. }
  23048. catch (error) {
  23049. console.log('error=' + error);
  23050. alert(error);
  23051. }
  23052. finally {
  23053. }
  23054. });
  23055. }
  23056. }
  23057. class UIShop$1 extends UIBase {
  23058. constructor() {
  23059. super();
  23060. this.itemNums = 0;
  23061. this.itemNumsForDj = 0;
  23062. this.curType = "";
  23063. }
  23064. onConstructor() {
  23065. this.ui = ui_UIShop.createInstance();
  23066. this.contentPane = this.ui;
  23067. this.isEject = false;
  23068. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23069. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23070. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23071. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23072. this.addUIClick(this.ui, this.interuptSecretary);
  23073. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23074. this.ballRodArr = [];
  23075. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23076. this.ui.myNode.myList.numItems = this.itemNums;
  23077. this.loadDjdata_old();
  23078. }
  23079. loadDjdata_old() {
  23080. let fff = cfgTable.daoJuData;
  23081. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23082. this.daoJuArr = [];
  23083. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23084. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23085. }
  23086. getProductList() {
  23087. let reqData = xGame.httpMgr.getReqData();
  23088. let pd = JSON.parse(reqData);
  23089. pd.splx = "Consumable";
  23090. reqData = JSON.stringify(pd);
  23091. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23092. try {
  23093. let code = res.code;
  23094. let msg = res.msg;
  23095. if (code == 401) {
  23096. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23097. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23098. return;
  23099. }
  23100. if (code == 200) {
  23101. let data = res.data;
  23102. for (let index = 0; index < data.length; index++) {
  23103. let element = data[index];
  23104. cfgTable.daoJuData[element.spid] = element;
  23105. }
  23106. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23107. }
  23108. else {
  23109. xGame.uiMgr.Show(UIMsg, msg);
  23110. }
  23111. }
  23112. catch (error) {
  23113. console.log('error=' + error);
  23114. alert(error);
  23115. }
  23116. finally {
  23117. }
  23118. });
  23119. }
  23120. show(type) {
  23121. super.show();
  23122. this.curType = type == 0 ? "qiugan" : "daoju";
  23123. this.switchBtn("");
  23124. this.playSecretaryIdle();
  23125. this.updateBallRod();
  23126. }
  23127. test123() {
  23128. console.log('zh:test123 ');
  23129. }
  23130. switchBtn(type) {
  23131. console.log('zh:1111切換 sel type=' + type);
  23132. if (type == "") {
  23133. type = this.curType;
  23134. }
  23135. else {
  23136. if (this.curType == type) {
  23137. return;
  23138. }
  23139. else {
  23140. this.curType = type;
  23141. }
  23142. }
  23143. if (type == "qiugan") {
  23144. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23145. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23146. this.ui.myNode.c1.selectedIndex = 0;
  23147. this.ui.myNode.myList.visible = true;
  23148. this.ui.myNode.djList.visible = false;
  23149. }
  23150. else {
  23151. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23152. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23153. this.ui.myNode.c1.selectedIndex = 1;
  23154. this.ui.myNode.myList.visible = false;
  23155. this.ui.myNode.djList.visible = true;
  23156. }
  23157. }
  23158. updateBallRod() {
  23159. for (let index = 0; index < this.ballRodArr.length; index++) {
  23160. this.ballRodArr[index].updateSelf();
  23161. }
  23162. }
  23163. renderBallRod(sort, obj) {
  23164. let index = this.getIndexBySort(sort + 1) - 1;
  23165. let ballRod = new BallRodDisplay$1(obj, index);
  23166. this.ballRodArr.push(ballRod);
  23167. }
  23168. renderDaoJu(idx, obj) {
  23169. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23170. let b = new DaoJuDisplay$1(obj, index);
  23171. this.daoJuArr.push(b);
  23172. }
  23173. getIndexBySort(sort) {
  23174. let object = cfgTable.ballrodData;
  23175. for (const key in object) {
  23176. if (object[key].sort == sort) {
  23177. return parseInt(key);
  23178. }
  23179. }
  23180. }
  23181. getIndexBySortForDj(idx) {
  23182. let object = cfgTable.daoJuData;
  23183. for (const key in object) {
  23184. if (object[key].idx == idx) {
  23185. return parseInt(key);
  23186. }
  23187. }
  23188. }
  23189. playSecretaryIdle() {
  23190. let parent = this.ui.secretary.displayObject;
  23191. parent.destroyChildren();
  23192. let xx = this.ui.secretary.width / 2;
  23193. let yy = this.ui.secretary.height;
  23194. let scale = xGame.common.getSecretaryScale();
  23195. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23196. xGame.common.secretary.play(data, 0, true, parent);
  23197. }
  23198. interuptSecretary() {
  23199. Laya.timer.clearAll(this);
  23200. this.playSecretaryRandomSound();
  23201. }
  23202. playSecretaryRandomSound() {
  23203. if (this.isHide)
  23204. return;
  23205. let time = xGame.common.randomNum(45000, 60000);
  23206. Laya.timer.once(time, this, () => {
  23207. if (this.isHide)
  23208. return;
  23209. let index = xGame.common.randomNum(4, 7);
  23210. xGame.soundMgr.playSound("s_main0" + index);
  23211. let words = 1;
  23212. switch (index) {
  23213. case 4:
  23214. words = 5;
  23215. break;
  23216. case 5:
  23217. words = 3;
  23218. break;
  23219. case 6:
  23220. words = 6;
  23221. break;
  23222. case 7:
  23223. words = 7;
  23224. break;
  23225. default:
  23226. break;
  23227. }
  23228. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23229. this.playSecretaryRandomSound();
  23230. });
  23231. }
  23232. closeSelf() {
  23233. this.hide();
  23234. }
  23235. }
  23236. UIShop$1.uiName = "UIShop";
  23237. class SignMax$1 {
  23238. constructor(ui) {
  23239. this.ui = ui;
  23240. }
  23241. updateSelf(index, sameDay, curDayIndex) {
  23242. let data = cfgTable.signData[index + 1];
  23243. this.ui.titleTxt.text = data.title;
  23244. let arr1 = data.award[0].split('-');
  23245. let arr2 = data.award[1].split('-');
  23246. let num1 = parseInt(arr1[1]);
  23247. let num2 = parseInt(arr2[1]);
  23248. this.ui.numTxt1.text = num1 + "";
  23249. this.ui.numTxt2.text = num2 + "";
  23250. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23251. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23252. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23253. this.ui.numTxt1.visible = false;
  23254. }
  23255. else {
  23256. this.ui.numTxt1.visible = true;
  23257. }
  23258. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23259. this.ui.numTxt2.visible = false;
  23260. }
  23261. else {
  23262. this.ui.numTxt2.visible = true;
  23263. }
  23264. if (index < curDayIndex) {
  23265. this.ui.c1.selectedIndex = 1;
  23266. }
  23267. else if (index == curDayIndex) {
  23268. if (sameDay) {
  23269. this.ui.c1.selectedIndex = 2;
  23270. }
  23271. else {
  23272. this.ui.c1.selectedIndex = 2;
  23273. }
  23274. }
  23275. else {
  23276. this.ui.c1.selectedIndex = 0;
  23277. }
  23278. }
  23279. }
  23280. class SignNormal$1 {
  23281. constructor(ui) {
  23282. this.ui = ui;
  23283. }
  23284. updateSelf(index, sameDay, curDayIndex) {
  23285. let data = cfgTable.signData[index + 1];
  23286. this.ui.titleTxt.text = data.title;
  23287. let arr = data.award[0].split('-');
  23288. let type = parseInt(arr[0]);
  23289. let num = parseInt(arr[1]);
  23290. this.ui.numTxt.text = num + "";
  23291. if (type > 2) {
  23292. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23293. this.ui.myIcon.rotation = 0;
  23294. }
  23295. else {
  23296. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23297. this.ui.myIcon.rotation = 0;
  23298. }
  23299. if (xGame.common.signAwardContainsRod(data.award)) {
  23300. this.ui.numTxt.visible = false;
  23301. }
  23302. else {
  23303. this.ui.numTxt.visible = true;
  23304. }
  23305. if (index < curDayIndex) {
  23306. this.ui.c1.selectedIndex = 1;
  23307. }
  23308. else if (index == curDayIndex) {
  23309. if (sameDay) {
  23310. this.ui.c1.selectedIndex = 2;
  23311. }
  23312. else {
  23313. this.ui.c1.selectedIndex = 2;
  23314. }
  23315. }
  23316. else {
  23317. this.ui.c1.selectedIndex = 0;
  23318. }
  23319. }
  23320. }
  23321. class UISign$1 extends UIBase {
  23322. constructor() {
  23323. super();
  23324. this.curDayIndex = 0;
  23325. this.starX = 0;
  23326. }
  23327. onConstructor() {
  23328. this.ui = ui_UISign.createInstance();
  23329. this.contentPane = this.ui;
  23330. this.isEject = false;
  23331. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23332. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23333. this.initSignItem();
  23334. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23335. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23336. }
  23337. show() {
  23338. super.show();
  23339. this.ui.t0.play();
  23340. this.playSecretaryIdle();
  23341. this.updateSign();
  23342. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23343. }
  23344. initSignItem() {
  23345. this.signArr = [];
  23346. for (let index = 0; index < 6; index++) {
  23347. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23348. this.signArr.push(temp);
  23349. }
  23350. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23351. if (Moyu.isKs)
  23352. this.ui.closeNode.closeBtn.x += 100;
  23353. }
  23354. updateSign() {
  23355. let sameDay = xGame.common.judgeSameDay();
  23356. let max = 7;
  23357. this.curDayIndex = DataMgr.getSignData();
  23358. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23359. this.curDayIndex = 0;
  23360. if (!sameDay) {
  23361. this.ui.normalBtn.visible = true;
  23362. this.ui.tipsNode.visible = false;
  23363. this.ui.againBtn.visible = false;
  23364. }
  23365. else {
  23366. this.ui.normalBtn.visible = false;
  23367. let again = DataMgr.getExtraSign();
  23368. let isCurrency = false;
  23369. let index = this.curDayIndex;
  23370. if (index == 0)
  23371. index = 7;
  23372. let award = cfgTable.signData[index].award;
  23373. let num = award[0].split("-")[0];
  23374. if (num == "1" || num == "2")
  23375. isCurrency = true;
  23376. let showAgain = again == 0 && isCurrency;
  23377. this.ui.againBtn.visible = showAgain;
  23378. this.ui.tipsNode.visible = !showAgain;
  23379. }
  23380. for (let index = 0; index < this.signArr.length; index++) {
  23381. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23382. }
  23383. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23384. }
  23385. playSecretaryIdle() {
  23386. let parent = this.ui.secretary.displayObject;
  23387. parent.destroyChildren();
  23388. let xx = this.ui.secretary.width / 2;
  23389. let yy = this.ui.secretary.height;
  23390. let scale = xGame.common.getSecretaryScale();
  23391. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23392. xGame.common.secretary.play(data, 0, true, parent);
  23393. }
  23394. closeSelf() {
  23395. this.hide();
  23396. }
  23397. normalGetAward() {
  23398. let sameDay = xGame.common.judgeSameDay();
  23399. if (!sameDay) {
  23400. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23401. let temp;
  23402. let type;
  23403. let num;
  23404. let arr = [];
  23405. for (let index = 0; index < award.length; index++) {
  23406. temp = award[index].split("-");
  23407. type = parseInt(temp[0]);
  23408. num = parseInt(temp[1]);
  23409. let awardType = new AwardType();
  23410. awardType.num = num;
  23411. awardType.type = type;
  23412. arr.push(awardType);
  23413. }
  23414. xGame.common.getAward(arr, (watchVideo) => {
  23415. this.curDayIndex++;
  23416. if (this.curDayIndex > 7)
  23417. this.curDayIndex = 0;
  23418. DataMgr.setSignData(this.curDayIndex);
  23419. this.updateSignData2Server(this.curDayIndex);
  23420. DataMgr.setSignTime(new Date().getTime());
  23421. if (watchVideo) {
  23422. DataMgr.setExtraSign(1);
  23423. Moyu.sendDataEvent("signIn1");
  23424. }
  23425. this.updateSign();
  23426. });
  23427. }
  23428. }
  23429. againGetAward() {
  23430. Moyu.sendDataEvent("signIn2");
  23431. console.log('zh:qjff_AD_for_uisign');
  23432. if (Laya.Browser.onAndroid) {
  23433. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23434. if (!boo) {
  23435. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23436. return;
  23437. }
  23438. }
  23439. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23440. }
  23441. else {
  23442. console.log('zh:AD 失败,直接发放奖励');
  23443. this.qjff_AD_for_uisign();
  23444. }
  23445. }
  23446. qjff_AD_for_uisign() {
  23447. let index = this.curDayIndex;
  23448. if (index == 0)
  23449. index = 7;
  23450. let award = cfgTable.signData[index].award;
  23451. let temp;
  23452. let type;
  23453. let num;
  23454. for (let index = 0; index < award.length; index++) {
  23455. temp = award[index].split("-");
  23456. type = parseInt(temp[0]);
  23457. num = parseInt(temp[1]) * 3;
  23458. xGame.common.playObjFlyAnim(num, type);
  23459. }
  23460. DataMgr.setExtraSign(1);
  23461. this.updateSign();
  23462. }
  23463. updateSignData2Server(day) {
  23464. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23465. if (userInfo == null) {
  23466. return;
  23467. }
  23468. let reqData = xGame.httpMgr.getReqData();
  23469. let pd = JSON.parse(reqData);
  23470. pd.signData = day;
  23471. reqData = JSON.stringify(pd);
  23472. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  23473. try {
  23474. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  23475. let code = res.code;
  23476. let msg = res.msg;
  23477. if (code == 401) {
  23478. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23479. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23480. return;
  23481. }
  23482. if (code == 200) {
  23483. let data = res.data;
  23484. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  23485. }
  23486. else {
  23487. xGame.uiMgr.Show(UIMsg$1, msg);
  23488. }
  23489. }
  23490. catch (error) {
  23491. console.log('error=' + error);
  23492. alert(error);
  23493. }
  23494. finally {
  23495. }
  23496. });
  23497. }
  23498. }
  23499. UISign$1.uiName = "UISign";
  23500. class UIModeSelection$1 extends UIBase {
  23501. constructor() {
  23502. super();
  23503. }
  23504. onConstructor() {
  23505. this.ui = ui_UIModeSelection.createInstance();
  23506. this.contentPane = this.ui;
  23507. this.isEject = false;
  23508. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23509. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23510. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23511. this.addUIClick(this.ui.closeBtn, this.hide);
  23512. this.peopleArr = [65, 990, 580];
  23513. this.peopleOffest = [5, 10, 10];
  23514. }
  23515. show(callback) {
  23516. this.updateSelf();
  23517. super.show();
  23518. this.ui.t0.play();
  23519. this.callback = callback;
  23520. }
  23521. updateSelf() {
  23522. let cfg = cfgTable.modeselectData;
  23523. for (let index = 1; index <= 3; index++) {
  23524. let node = this.ui.myNode["type" + index];
  23525. node.need.text = cfg[index].need;
  23526. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23527. node.peopleTxt.text = this.getRandPeople(index - 1);
  23528. }
  23529. }
  23530. enterGame(type) {
  23531. console.log('zh: 进入经典模式 type: ' + type);
  23532. xGame.common.classicRoomType = type;
  23533. let cfg = cfgTable.modeselectData[type];
  23534. let need = cfg.need;
  23535. xGame.common.passAwardCoin = cfg.award;
  23536. if (DataMgr.coinEnough(need)) {
  23537. DataMgr.setCoin(-need);
  23538. this.ui.myNode["type" + type].t0.play();
  23539. Laya.timer.once(200, this, () => {
  23540. this.callback && this.callback();
  23541. });
  23542. this.logEventForClassic_start();
  23543. }
  23544. else {
  23545. Moyu.sendDataEvent("AddCoinVideo");
  23546. xGame.uiMgr.Show(UIAddProp$1, 0);
  23547. }
  23548. }
  23549. getRandPeople(index) {
  23550. let rand = this.peopleOffest[index];
  23551. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23552. }
  23553. logEventForClassic_start() {
  23554. let rtype = xGame.common.classicRoomType;
  23555. let msmc = '';
  23556. if (rtype == 1) {
  23557. msmc = 'beginner';
  23558. }
  23559. if (rtype == 2) {
  23560. msmc = 'expert';
  23561. }
  23562. if (rtype == 3) {
  23563. msmc = 'master';
  23564. }
  23565. let keyStr = 'sjmd_classic_start_' + rtype;
  23566. let jsonStr = {
  23567. "difficulty": msmc,
  23568. "classic_count": 1,
  23569. "difficulty_count": 1
  23570. };
  23571. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23572. const d = LocalStorageManager.getItem(keyStr);
  23573. jsonStr.classic_count = d.classic_count + 1;
  23574. jsonStr.difficulty_count = d.difficulty_count + 1;
  23575. LocalStorageManager.setItem(keyStr, jsonStr);
  23576. }
  23577. else {
  23578. LocalStorageManager.setItem(keyStr, jsonStr);
  23579. }
  23580. const reqStr = JSON.stringify(jsonStr);
  23581. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23582. }
  23583. }
  23584. UIModeSelection$1.uiName = "UIModeSelection";
  23585. class UILogin$1 extends UIBase {
  23586. constructor() {
  23587. super();
  23588. }
  23589. onConstructor() {
  23590. this.ui = ui_UILogin.createInstance();
  23591. this.contentPane = this.ui;
  23592. this.isEject = false;
  23593. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23594. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23595. this.addUIClick(this.ui.btn_login, this.userLogin);
  23596. }
  23597. show() {
  23598. super.show();
  23599. this.x = (Laya.stage.width - this.width) / 2;
  23600. this.y = (Laya.stage.height - this.height) / 2;
  23601. }
  23602. closeSelf() {
  23603. this.hide();
  23604. }
  23605. userLogin() {
  23606. let ua = this.ui.txt_ua.text;
  23607. let up = this.ui.txt_up.text;
  23608. if (ua && up) {
  23609. let reqData = JSON.stringify({
  23610. username: ua.trim(),
  23611. password: up.trim(),
  23612. fromMark: 'app_game'
  23613. });
  23614. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23615. try {
  23616. console.log('zh:res = ' + JSON.stringify(res));
  23617. let code = res.code;
  23618. let msg = res.msg;
  23619. if (code == 200) {
  23620. let keyStr = keyForLoginInfo;
  23621. let jsonStr = {
  23622. "username": res.username,
  23623. "token": res.token,
  23624. "buySpids": { 1: false, 7: false }
  23625. };
  23626. LocalStorageManager.setItem(keyStr, jsonStr);
  23627. let myu = Moyu.getUserInfo();
  23628. console.log('zh:myu = ' + JSON.stringify(myu));
  23629. DataMgr.updateUserNickName(res.username);
  23630. Moyu.updateUserInfo(res.username);
  23631. xGame.uiMgr.Show(UIMsg$1, msg);
  23632. DataMgr.loadUserSpOrderForAd();
  23633. DataMgr.getUserZiChanInfo();
  23634. xGame.eventMgr.event(LOGIN_IN);
  23635. this.closeSelf();
  23636. }
  23637. else {
  23638. xGame.uiMgr.Show(UIMsg$1, msg);
  23639. }
  23640. }
  23641. catch (error) {
  23642. console.log('error=' + error);
  23643. alert(error);
  23644. }
  23645. finally {
  23646. }
  23647. });
  23648. }
  23649. else {
  23650. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23651. }
  23652. }
  23653. gotoRegPage() {
  23654. this.closeSelf();
  23655. xGame.uiMgr.Show(UIReg$1);
  23656. }
  23657. }
  23658. UILogin$1.uiName = "UILogin";
  23659. class UIReg$1 extends UIBase {
  23660. constructor() {
  23661. super();
  23662. }
  23663. onConstructor() {
  23664. this.ui = ui_UIReg.createInstance();
  23665. this.contentPane = this.ui;
  23666. this.isEject = false;
  23667. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23668. this.addUIClick(this.ui.btn_reg, this.regUser);
  23669. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23670. }
  23671. show() {
  23672. super.show();
  23673. this.x = (Laya.stage.width - this.width) / 2;
  23674. this.y = (Laya.stage.height - this.height) / 2;
  23675. }
  23676. closeSelf() {
  23677. this.hide();
  23678. }
  23679. regUser() {
  23680. this.ui.lab_tip.visible = false;
  23681. let ua = this.ui.txt_ua.text;
  23682. let up1 = this.ui.txt_up1.text;
  23683. let up2 = this.ui.txt_up2.text;
  23684. if (ua && up1 && up2 && up1 == up2) {
  23685. let reqData = JSON.stringify({
  23686. username: ua.trim(),
  23687. password: up1.trim(),
  23688. fromMark: 'app_game'
  23689. });
  23690. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23691. try {
  23692. console.log('zh:res = ' + JSON.stringify(res));
  23693. let code = res.code;
  23694. let msg = res.msg;
  23695. xGame.uiMgr.Show(UIMsg$1, msg);
  23696. if (code == 200) {
  23697. this.ui.lab_tip.color = "#FFFFFF";
  23698. xGame.uiMgr.Show(UIMsg$1, msg);
  23699. this.closeSelf();
  23700. }
  23701. else {
  23702. this.ui.lab_tip.color = "#FF0000";
  23703. xGame.uiMgr.Show(UIMsg$1, msg);
  23704. }
  23705. }
  23706. catch (error) {
  23707. console.log('error=' + error);
  23708. alert(error);
  23709. }
  23710. finally {
  23711. }
  23712. });
  23713. }
  23714. else {
  23715. if (up1 != up2) {
  23716. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23717. }
  23718. else {
  23719. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23720. }
  23721. }
  23722. }
  23723. gotoLogin() {
  23724. this.closeSelf();
  23725. xGame.uiMgr.Show(UILogin$1);
  23726. }
  23727. }
  23728. UIReg$1.uiName = "UIReg";
  23729. class UIFuli1$1 extends UIBase {
  23730. constructor() {
  23731. super();
  23732. this.jiage = 4.99;
  23733. }
  23734. onConstructor() {
  23735. this.ui = ui_UIFuli1.createInstance();
  23736. this.contentPane = this.ui;
  23737. this.isEject = false;
  23738. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23739. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23740. }
  23741. show() {
  23742. super.show();
  23743. this.x = (Laya.stage.width - this.width) / 2;
  23744. this.y = (Laya.stage.height - this.height) / 2;
  23745. this.ui.n2.txt_price.text = "$" + this.jiage;
  23746. }
  23747. closeSelf() {
  23748. DataMgr.loadUserSpOrderForAd();
  23749. this.hide();
  23750. }
  23751. gotoBuy() {
  23752. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23753. if (userInfo != null) {
  23754. let token = userInfo.token;
  23755. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23756. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  23757. DataMgr.loadUserSpOrderForAd();
  23758. return;
  23759. }
  23760. else {
  23761. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23762. }
  23763. }
  23764. gotoBuy2() {
  23765. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23766. if (userInfo == null) {
  23767. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23768. return;
  23769. }
  23770. let reqData = xGame.httpMgr.getReqData();
  23771. let pd = JSON.parse(reqData);
  23772. pd.productId = 1;
  23773. reqData = JSON.stringify(pd);
  23774. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23775. try {
  23776. console.log('zh:buySp res = ' + JSON.stringify(res));
  23777. let code = res.code;
  23778. let msg = res.msg;
  23779. if (code == 401) {
  23780. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23781. alert(TIP_MSG_key.loginTimeOut);
  23782. xGame.uiMgr.Show(UIMsg$1, msg);
  23783. return;
  23784. }
  23785. if (code == 200) {
  23786. xGame.uiMgr.Show(UIMsg$1, msg);
  23787. DataMgr.loadUserSpOrderForAd();
  23788. DataMgr.getUserZiChanInfo();
  23789. this.closeSelf();
  23790. }
  23791. else {
  23792. xGame.uiMgr.Show(UIMsg$1, msg);
  23793. }
  23794. }
  23795. catch (error) {
  23796. console.log('error=' + error);
  23797. alert(error);
  23798. }
  23799. finally {
  23800. }
  23801. });
  23802. }
  23803. }
  23804. UIFuli1$1.uiName = "UIFuli1";
  23805. class UIFuli2$1 extends UIBase {
  23806. constructor() {
  23807. super();
  23808. this.jiage = 14.99;
  23809. }
  23810. onConstructor() {
  23811. this.ui = ui_UIFuli2.createInstance();
  23812. this.contentPane = this.ui;
  23813. this.isEject = false;
  23814. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23815. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23816. }
  23817. show() {
  23818. super.show();
  23819. this.x = (Laya.stage.width - this.width) / 2;
  23820. this.y = (Laya.stage.height - this.height) / 2;
  23821. this.ui.n2.txt_price.text = "$" + this.jiage;
  23822. }
  23823. closeSelf() {
  23824. DataMgr.loadUserSpOrderForAd();
  23825. this.hide();
  23826. }
  23827. gotoBuy() {
  23828. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23829. if (userInfo != null) {
  23830. let token = userInfo.token;
  23831. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23832. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  23833. DataMgr.loadUserSpOrderForAd();
  23834. return;
  23835. }
  23836. else {
  23837. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23838. }
  23839. }
  23840. gotoBuy1() {
  23841. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23842. if (userInfo == null) {
  23843. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23844. return;
  23845. }
  23846. let reqData = xGame.httpMgr.getReqData();
  23847. let pd = JSON.parse(reqData);
  23848. pd.productId = 2;
  23849. reqData = JSON.stringify(pd);
  23850. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23851. try {
  23852. console.log('zh:buySp res = ' + JSON.stringify(res));
  23853. let code = res.code;
  23854. let msg = res.msg;
  23855. if (code == 401) {
  23856. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23857. alert(TIP_MSG_key.loginTimeOut);
  23858. xGame.uiMgr.Show(UIMsg$1, msg);
  23859. return;
  23860. }
  23861. if (code == 200) {
  23862. xGame.uiMgr.Show(UIMsg$1, msg);
  23863. DataMgr.loadUserSpOrderForAd();
  23864. DataMgr.getUserZiChanInfo();
  23865. this.closeSelf();
  23866. }
  23867. else {
  23868. xGame.uiMgr.Show(UIMsg$1, msg);
  23869. }
  23870. }
  23871. catch (error) {
  23872. console.log('error=' + error);
  23873. alert(error);
  23874. }
  23875. finally {
  23876. }
  23877. });
  23878. }
  23879. }
  23880. UIFuli2$1.uiName = "UIFuli2";
  23881. class UITry$1 extends UIBase {
  23882. constructor() {
  23883. super();
  23884. this.closeTime = 0;
  23885. this.closeNum = 0;
  23886. this.skillUrl = xGame.common.skillIconList;
  23887. }
  23888. onConstructor() {
  23889. this.ui = ui_UITry.createInstance();
  23890. this.contentPane = this.ui;
  23891. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23892. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23893. }
  23894. show() {
  23895. super.show();
  23896. this.closeNum = 0;
  23897. this.closeTime = 15;
  23898. this.ui.t0.play();
  23899. PlatMgr.showRateBanner();
  23900. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23901. Laya.timer.loop(1000, this, this.updateTime);
  23902. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23903. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23904. xGame.common.gameMgr.gamePause = true;
  23905. }
  23906. updateTime() {
  23907. if (this.closeTime > 1) {
  23908. this.closeTime--;
  23909. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23910. }
  23911. else
  23912. this.hide();
  23913. }
  23914. hide() {
  23915. Laya.timer.clearAll(this);
  23916. Moyu.showBannerAd(false);
  23917. super.hide();
  23918. xGame.common.gameMgr.gamePause = false;
  23919. }
  23920. onTry() {
  23921. console.log('zh:qjff_AD_for_uitry');
  23922. if (Laya.Browser.onAndroid) {
  23923. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23924. if (!boo) {
  23925. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23926. return;
  23927. }
  23928. }
  23929. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23930. }
  23931. else {
  23932. console.log('zh:AD 失败,直接发放奖励');
  23933. this.qjff_AD_for_uitry();
  23934. }
  23935. }
  23936. qjff_AD_for_uitry() {
  23937. let select = xGame.common.curPlayerSkillType;
  23938. DataMgr.gameData.trySkill = select;
  23939. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23940. DataMgr.saveGameData();
  23941. DataMgr.setBigSkill(select, 1);
  23942. xGame.showTip("Trial Successful");
  23943. this.hide();
  23944. }
  23945. onCancel() {
  23946. if (this.closeNum > 0) {
  23947. this.closeNum--;
  23948. if (this.closeNum < 2)
  23949. this.hide();
  23950. return;
  23951. }
  23952. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23953. this.onTry();
  23954. }
  23955. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23956. this.closeNum = 3;
  23957. }
  23958. else
  23959. this.hide();
  23960. }
  23961. }
  23962. UITry$1.uiName = "UITry";
  23963. class UIGetAward$1 extends UIBase {
  23964. constructor() {
  23965. super();
  23966. this.showTriple = true;
  23967. }
  23968. onConstructor() {
  23969. this.ui = ui_UIGetAward.createInstance();
  23970. this.contentPane = this.ui;
  23971. this.isEject = false;
  23972. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23973. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23974. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23975. }
  23976. show(arr, showTriple, callback) {
  23977. super.show();
  23978. this.ui.t0.play();
  23979. this.ui.eftNode.visible = true;
  23980. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23981. this.ui.eftNode.visible = false;
  23982. }), 1, 0, 0, 0.9);
  23983. this.awardArr = arr;
  23984. this.showTriple = showTriple;
  23985. this.callback = callback;
  23986. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23987. this.ui.myList.numItems = arr.length;
  23988. xGame.soundMgr.playSound("getaward");
  23989. }
  23990. updateSelf(index, obj) {
  23991. let temp = this.awardArr[index];
  23992. let icon = this.getIcon(temp.type);
  23993. let str = icon;
  23994. if (temp.type > 2) {
  23995. str = "s" + icon;
  23996. }
  23997. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23998. obj.myIcon.rotation = 0;
  23999. obj.numTxt.text = temp.num + "";
  24000. obj.numTxt.visible = temp.type > 2 ? false : true;
  24001. obj.nameTxt.text = this.getNameStr(temp.type);
  24002. }
  24003. renderItem(index, obj) {
  24004. this.updateSelf(index, obj);
  24005. }
  24006. tripleGetAward() {
  24007. console.log('zh:qjff_AD_for_uigetAward');
  24008. if (Laya.Browser.onAndroid) {
  24009. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24010. if (!boo) {
  24011. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24012. return;
  24013. }
  24014. }
  24015. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24016. }
  24017. else {
  24018. console.log('zh:AD 失败,直接发放奖励');
  24019. this.qjff_AD_for_uigetAward();
  24020. }
  24021. }
  24022. qjff_AD_for_uigetAward() {
  24023. this.getAward(3);
  24024. }
  24025. normalGetAward() {
  24026. if (PlatMgr.isMisVideo())
  24027. this.tripleGetAward();
  24028. else
  24029. this.getAward();
  24030. }
  24031. getAward(times = 1) {
  24032. this.hide();
  24033. for (let index = 0; index < this.awardArr.length; index++) {
  24034. this.awardArr[index].num *= times;
  24035. }
  24036. this.callback && this.callback(times != 1);
  24037. }
  24038. getIcon(type) {
  24039. switch (type) {
  24040. case Prop.diamond:
  24041. return "ty_zs";
  24042. case Prop.coin:
  24043. return "ty_jb";
  24044. case Prop.gan1:
  24045. return "qg1";
  24046. case Prop.gan2:
  24047. return "qg2";
  24048. case Prop.gan3:
  24049. return "qg3";
  24050. case Prop.gan4:
  24051. return "qg4";
  24052. default:
  24053. break;
  24054. }
  24055. }
  24056. getNameStr(type) {
  24057. switch (type) {
  24058. case Prop.diamond:
  24059. return "Diamond";
  24060. case Prop.coin:
  24061. return "Coins";
  24062. case Prop.gan1:
  24063. case Prop.gan2:
  24064. case Prop.gan3:
  24065. case Prop.gan4:
  24066. return cfgTable.ballrodData[type - 1].name;
  24067. default:
  24068. break;
  24069. }
  24070. }
  24071. }
  24072. UIGetAward$1.uiName = "UIGetAward";
  24073. class UIBox$1 extends UIBase {
  24074. constructor() {
  24075. super();
  24076. this.boxNum = 0;
  24077. this.boxMax = 10;
  24078. this.inAd = false;
  24079. this.isClose = false;
  24080. }
  24081. onConstructor() {
  24082. this.ui = ui_UIBox.createInstance();
  24083. this.contentPane = this.ui;
  24084. this.isEject = false;
  24085. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24086. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24087. Laya.timer.loop(1000, this, this.update);
  24088. }
  24089. update() {
  24090. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24091. this.boxNum -= 1;
  24092. this.upBar();
  24093. }
  24094. }
  24095. upBar() {
  24096. if (this.boxNum > this.boxMax)
  24097. this.boxNum = this.boxMax;
  24098. this.ui.bar.value = this.boxNum * 10;
  24099. }
  24100. show() {
  24101. super.show();
  24102. this.isClose = false;
  24103. this.boxNum = 0;
  24104. this.inAd = false;
  24105. this.upBar();
  24106. this.ui.t0.play();
  24107. this.ui.closeBtn.visible = false;
  24108. Laya.timer.once(3000, this, () => {
  24109. this.ui.closeBtn.visible = true;
  24110. this.ui.bar.alpha = 1;
  24111. });
  24112. Laya.timer.once(500, this, () => {
  24113. this.ui.t1.play();
  24114. });
  24115. }
  24116. hide() {
  24117. Laya.timer.clearAll(this);
  24118. Moyu.showBannerAd(false);
  24119. super.hide();
  24120. }
  24121. onOpenBox() {
  24122. this.boxNum++;
  24123. if (this.boxNum < this.boxMax) {
  24124. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24125. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24126. }
  24127. }
  24128. else if (this.boxNum == this.boxMax) {
  24129. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24130. this.ui.openBtn.c1.selectedIndex = 13;
  24131. this.inAd = true;
  24132. }
  24133. else
  24134. this.getAward();
  24135. }
  24136. else if (this.inAd) {
  24137. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24138. if (Laya.Browser.onAndroid) {
  24139. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24140. if (!boo) {
  24141. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24142. return;
  24143. }
  24144. }
  24145. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24146. }
  24147. else {
  24148. console.log('zh:AD 失败,直接发放奖励');
  24149. this.qjff_AD_for_UIBOX_onOpenBox();
  24150. }
  24151. }
  24152. this.upBar();
  24153. }
  24154. qjff_AD_for_UIBOX_onOpenBox() {
  24155. this.getAward();
  24156. }
  24157. onCloseBox() {
  24158. if (this.isClose)
  24159. this.hide();
  24160. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24161. this.isClose = true;
  24162. PlatMgr.showBanner(true, 0, 3000);
  24163. }
  24164. else
  24165. this.hide();
  24166. }
  24167. getAward() {
  24168. let str = "";
  24169. if (Math.random() < 0.5) {
  24170. let max = Moyu.isLegal ? 500 : 2500;
  24171. let num = xGame.tools.random(max, 500 + max);
  24172. DataMgr.setCoin(num);
  24173. str = "金币x" + num;
  24174. }
  24175. else {
  24176. let max = Moyu.isLegal ? 10 : 30;
  24177. let num = xGame.tools.random(max, 30 + max);
  24178. DataMgr.setDiamond(num);
  24179. str = "钻石x" + num;
  24180. }
  24181. xGame.showTip("恭喜获得-" + str);
  24182. this.hide();
  24183. }
  24184. }
  24185. UIBox$1.uiName = "UIBox";
  24186. class UIMain$1 extends UIBase {
  24187. constructor() {
  24188. super();
  24189. this.firstEnter = true;
  24190. }
  24191. nativeCallJs(msg) {
  24192. let t = msg;
  24193. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24194. switch (t) {
  24195. case 'qjff_chouJiang':
  24196. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24197. dui.qjff_chouJiang();
  24198. break;
  24199. case 'qjff_AD_for_uisign':
  24200. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24201. dui2.qjff_AD_for_uisign();
  24202. break;
  24203. case 'qjff_AD_for_uitry':
  24204. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24205. dui3.qjff_AD_for_uitry();
  24206. break;
  24207. case 'qjff_AD_for_uipower':
  24208. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24209. dui4.qjff_AD_for_uipower();
  24210. break;
  24211. case 'qjff_AD_for_uigetAward':
  24212. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24213. dui5.qjff_AD_for_uigetAward();
  24214. break;
  24215. case 'qjff_AD_for_uiGameEnd':
  24216. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24217. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24218. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24219. break;
  24220. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24221. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24222. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24223. break;
  24224. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24225. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24226. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24227. break;
  24228. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24229. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24230. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24231. break;
  24232. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24233. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24234. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24235. break;
  24236. case 'qjff_AD_for_UIBOX_onOpenBox':
  24237. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24238. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24239. break;
  24240. case 'qjff_AD_for_UIAddCoin':
  24241. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24242. dui12.qjff_AD_for_UIAddCoin();
  24243. break;
  24244. case 'app_sign_for_buyProduct_onSuccess':
  24245. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24246. DataMgr.getUserZiChanInfo();
  24247. break;
  24248. case '222axxxxxx':
  24249. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24250. dui15.qjff_AD_for_uisign();
  24251. break;
  24252. case '333axsxxxxxx':
  24253. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24254. dui16.qjff_AD_for_uisign();
  24255. break;
  24256. default:
  24257. console.log('zh:未知的方法名字' + t);
  24258. break;
  24259. }
  24260. }
  24261. onConstructor() {
  24262. console.log('zh: UIMain onConstructor');
  24263. this.ui = ui_UIMain.createInstance();
  24264. this.contentPane = this.ui;
  24265. this.isEject = false;
  24266. this.addEvent();
  24267. this.addClickSpine();
  24268. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24269. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24270. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24271. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24272. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24273. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24274. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24275. let curUse = DataMgr.getCurSecretary();
  24276. this.changeSecretary(curUse);
  24277. this.ui.talkNode.visible = false;
  24278. let guide = DataMgr.getSkillGuide();
  24279. if (xGame.common.isNewDay && guide == 1) {
  24280. xGame.common.isNewDay = false;
  24281. xGame.soundMgr.playSound("s_main01");
  24282. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24283. console.log("zh:播放小秘书每天语音");
  24284. }
  24285. this.onGetUserInfo();
  24286. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24287. DataMgr.getUserZiChanInfo();
  24288. }
  24289. this.ui.n83.visible = false;
  24290. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24291. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24292. let ua = d.username;
  24293. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24294. }
  24295. this.c_btn_for_user();
  24296. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24297. }
  24298. Logout() {
  24299. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24300. LocalStorageManager.removeItem(keyForLoginInfo);
  24301. this.freshUser();
  24302. }
  24303. JSBridgeUtils.instance.loginOutForApp();
  24304. this.setUserDefaultNickname();
  24305. DataMgr.setCoin2(4000);
  24306. DataMgr.setDiamond2(0);
  24307. this.setDefaultQiuGanInfo();
  24308. DataMgr.setPlaceBallLevelList("");
  24309. DataMgr.setChallengeMode_overLev(1);
  24310. this.setDefaultSignData();
  24311. }
  24312. setDefaultSignData() {
  24313. DataMgr.setSignData(1);
  24314. DataMgr.setSignTime(new Date().getTime());
  24315. }
  24316. setDefaultQiuGanInfo() {
  24317. DataMgr.setBallRod(0, 1);
  24318. DataMgr.setBallRod(1, 0);
  24319. DataMgr.setBallRod(2, 0);
  24320. DataMgr.setBallRod(3, 0);
  24321. DataMgr.setBallRod(4, 0);
  24322. DataMgr.setBallRod(5, 1);
  24323. }
  24324. setUserDefaultNickname() {
  24325. let defUsername = "player";
  24326. this.ui.headNode.nameTxt.text = defUsername;
  24327. DataMgr.updateUserNickName(defUsername);
  24328. Moyu.updateUserInfo(defUsername);
  24329. }
  24330. gotoLogin() {
  24331. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24332. xGame.uiMgr.Show(UILogin$1);
  24333. }
  24334. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24335. this.Logout();
  24336. }
  24337. }
  24338. gotoRegUser() {
  24339. xGame.uiMgr.Show(UIReg$1);
  24340. }
  24341. showFuLiSp1() {
  24342. console.log('zh:福利1');
  24343. this.checkForShowFuLi17(1);
  24344. }
  24345. showFuLiSp7() {
  24346. console.log('zh:福利7');
  24347. this.checkForShowFuLi17(7);
  24348. }
  24349. checkForShowFuLi17(spid) {
  24350. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24351. if (userInfo == null) {
  24352. if (spid === 1) {
  24353. xGame.uiMgr.Show(UIFuli1$1);
  24354. }
  24355. if (spid === 7) {
  24356. xGame.uiMgr.Show(UIFuli2$1);
  24357. }
  24358. return;
  24359. }
  24360. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  24361. let reqData = xGame.httpMgr.getReqData();
  24362. let pd = JSON.parse(reqData);
  24363. pd.productId = spid;
  24364. reqData = JSON.stringify(pd);
  24365. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  24366. try {
  24367. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  24368. let code = res.code;
  24369. let msg = res.msg;
  24370. if (code == 401) {
  24371. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  24372. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24373. return;
  24374. }
  24375. if (code == 200) {
  24376. let isBuyOk = res.data;
  24377. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  24378. if (isBuyOk === false) {
  24379. if (spid === 1) {
  24380. xGame.uiMgr.Show(UIFuli1$1);
  24381. }
  24382. if (spid === 7) {
  24383. xGame.uiMgr.Show(UIFuli2$1);
  24384. }
  24385. }
  24386. else {
  24387. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  24388. }
  24389. }
  24390. else {
  24391. xGame.uiMgr.Show(UIMsg$1, msg);
  24392. }
  24393. }
  24394. catch (error) {
  24395. console.log('error=' + error);
  24396. alert(error);
  24397. }
  24398. finally {
  24399. }
  24400. });
  24401. }
  24402. c_btn_for_user() {
  24403. this.ui.n_dengLu.c1.selectedIndex = 0;
  24404. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24405. this.ui.n_dengLu.c1.selectedIndex = 1;
  24406. }
  24407. else {
  24408. this.ui.n_dengLu.c1.selectedIndex = 0;
  24409. }
  24410. }
  24411. changeSecretary(curUse) {
  24412. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24413. xGame.common.secretary && xGame.common.secretary.dispose();
  24414. this.addSecretarySpine(name);
  24415. }
  24416. addSecretarySpine(name) {
  24417. let spine = new SpineMgr(name, () => {
  24418. this.playSecretaryIdle();
  24419. });
  24420. xGame.common.secretary = spine;
  24421. }
  24422. addClickSpine() {
  24423. let clickSpine = new SpineMgr("dianji", () => {
  24424. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24425. let parent = Laya.stage;
  24426. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24427. clickSpine.play(data, 0, false, parent, (spine) => {
  24428. spine.destroy(true);
  24429. });
  24430. });
  24431. });
  24432. }
  24433. addEvent() {
  24434. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24435. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24436. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24437. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24438. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24439. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24440. this.addUIClick(this.ui, this.interuptSecretary);
  24441. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24442. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24443. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24444. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24445. this.addUIClick(this.ui.signBtn, this.openSignView);
  24446. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24447. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24448. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24449. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24450. }
  24451. show(showFailWords) {
  24452. super.show();
  24453. DataMgr.loadUserSpOrderForAd();
  24454. this.moneyNode.ui.c1.selectedIndex = 1;
  24455. this.playSecretaryIdle();
  24456. xGame.soundMgr.playMusic("caromhall01", 0);
  24457. Laya.timer.clearAll(this);
  24458. this.playSecretaryRandomSound();
  24459. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24460. if (showFailWords) {
  24461. console.log('zh:uimain.ts ');
  24462. setTimeout(() => {
  24463. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24464. let words = -1;
  24465. if (str == "s_main02") {
  24466. words = 2;
  24467. }
  24468. else {
  24469. words = 3;
  24470. }
  24471. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24472. xGame.soundMgr.playSound(str);
  24473. }, 300);
  24474. }
  24475. this.showGuide();
  24476. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24477. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24478. let guide = DataMgr.getSkillGuide();
  24479. if (guide == 1) {
  24480. let randTime = xGame.common.randomNum(300, 800);
  24481. if (this.firstEnter) {
  24482. console.log("zh: firstEnter");
  24483. this.firstEnter = false;
  24484. randTime += 900;
  24485. }
  24486. else {
  24487. console.log("zh: no firstEnter");
  24488. }
  24489. Laya.timer.once(randTime, this, () => {
  24490. });
  24491. Laya.timer.once(1000, this, () => {
  24492. console.log('zh: 1秒后 showFuLiSp1');
  24493. this.showFuLiSp1();
  24494. });
  24495. Laya.timer.once(10000, this, () => {
  24496. console.log('zh: 10秒后 showFuLiSp1');
  24497. this.showFuLiSp7();
  24498. });
  24499. }
  24500. }
  24501. checkActive(show) {
  24502. }
  24503. showGuide() {
  24504. let guide = DataMgr.getSkillGuide();
  24505. this.ui.guideBtn.visible = guide == 0;
  24506. this.ui.enterGuide.visible = false;
  24507. this.ui.secretaryGuide.visible = guide == 0;
  24508. if (guide == 0) {
  24509. console.log("zh:显示引导");
  24510. xGame.soundMgr.playSound("s_guide");
  24511. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24512. }
  24513. else {
  24514. console.log("zh:不需要显示引导");
  24515. }
  24516. }
  24517. ensureSecretary() {
  24518. console.log('zh: ensureSecretary ');
  24519. this.ui.secretaryGuide.visible = false;
  24520. this.ui.enterGuide.visible = true;
  24521. this.ui.wordsNode.t0.play();
  24522. if (DataMgr.getNewUser())
  24523. Moyu.sendDataEvent("gameReady");
  24524. }
  24525. playSecretaryIdle() {
  24526. let parent = this.ui.secretary.displayObject;
  24527. parent.destroyChildren();
  24528. let xx = this.ui.secretary.width / 2;
  24529. let yy = this.ui.secretary.height;
  24530. let scale = xGame.common.getSecretaryScale();
  24531. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24532. xGame.common.secretary.play(data, 0, true, parent);
  24533. }
  24534. startGame(type) {
  24535. if (!this.isReadyForLoadNetSource()) {
  24536. return;
  24537. }
  24538. xGame.common.gameMode = type;
  24539. Moyu.sendDataEvent("PlayGame", { type: type });
  24540. let gm = xGame.common.gameMode;
  24541. console.log('zh:进入游戏gameMode =' + gm);
  24542. switch (gm) {
  24543. case GameMode.classic:
  24544. console.log('zh:进入经典模式111111111');
  24545. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24546. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24547. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  24548. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24549. console.log('zh:判断是否可以玩该模式classic =NO');
  24550. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24551. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24552. return;
  24553. }
  24554. else {
  24555. console.log('zh:可以玩该模式classic');
  24556. this.beginGame();
  24557. }
  24558. }
  24559. else {
  24560. console.log('zh:不需要判断是否可以玩该classic');
  24561. let challengeTimes = DataMgr.getChallengeTimes();
  24562. if (challengeTimes == 0) {
  24563. xGame.uiMgr.Show(UIInvitation$1);
  24564. }
  24565. else {
  24566. this.beginGame();
  24567. }
  24568. }
  24569. break;
  24570. case GameMode.bigMove:
  24571. console.info('zh:bigMove check 大招');
  24572. let guide = DataMgr.getSkillGuide();
  24573. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24574. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24575. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24576. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24577. console.log('zh:提示不可以玩');
  24578. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24579. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24580. return;
  24581. }
  24582. else {
  24583. console.log('zh:可以玩该模式 bigMove');
  24584. this.beginGame();
  24585. if (DataMgr.getNewUser())
  24586. Moyu.sendDataEvent("gameStart0");
  24587. }
  24588. }
  24589. else {
  24590. this.beginGame();
  24591. if (DataMgr.getNewUser())
  24592. Moyu.sendDataEvent("gameStart0");
  24593. }
  24594. break;
  24595. default:
  24596. console.error('zh:未知错误!!!!');
  24597. break;
  24598. }
  24599. }
  24600. beginGame(isNice = false) {
  24601. console.log('zh:beginGame ');
  24602. let guide = DataMgr.getSkillGuide();
  24603. if (guide == 1) {
  24604. console.log('zh:非新手引导,showInternAd ');
  24605. JSBridgeUtils.instance.showInternAd('beginGame');
  24606. }
  24607. else {
  24608. console.log('zh:新手引导,不显示AD ');
  24609. }
  24610. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  24611. console.log('zh:beginGame 1');
  24612. if (xGame.common.gameMode == GameMode.classic) {
  24613. console.log('zh:beginGame 2');
  24614. if (isNice) {
  24615. console.log('zh:进入巅峰赛');
  24616. this.enterClassic();
  24617. }
  24618. else {
  24619. console.log('zh:beginGame 3-1');
  24620. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24621. console.log('zh:beginGame 3-2');
  24622. this.enterClassic();
  24623. });
  24624. }
  24625. }
  24626. else if (xGame.common.gameMode == GameMode.bigMove) {
  24627. console.log('zh:beginGame 5');
  24628. this.ui.enterGuide.visible = false;
  24629. xGame.uiMgr.Show(UISkill$1);
  24630. }
  24631. }
  24632. enterClassic() {
  24633. console.log('zh:beginGame 7');
  24634. xGame.uiMgr.Show(UIGame$1);
  24635. xGame.uiMgr.Show(UIMatching$1, () => {
  24636. if (!this.isHide)
  24637. this.hide();
  24638. xGame.common.gameUI.ui.alpha = 1;
  24639. console.log('zh:beginGame 8');
  24640. xGame.common.gameUI.startGame();
  24641. xGame.uiMgr.Hide(UIGameEnd$1);
  24642. });
  24643. }
  24644. start_debug_for_moni_payOk() {
  24645. console.log('zh:start_debug_for_moni_payOk');
  24646. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24647. if (userInfo != null) {
  24648. let token = userInfo.token;
  24649. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24650. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24651. alert('模拟支付OK');
  24652. return;
  24653. }
  24654. else {
  24655. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24656. }
  24657. }
  24658. startGlobal() {
  24659. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24660. }
  24661. startWeekly() {
  24662. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24663. }
  24664. zhouSaiMonth() {
  24665. console.log('zh: zhouSaiMonth 被调用');
  24666. }
  24667. isReadyForLoadNetSource() {
  24668. let reqCount = xGame.cfgMgr.httpReqCount;
  24669. let ok = xGame.cfgMgr.httpReqOkCount;
  24670. if (reqCount > ok) {
  24671. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24672. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24673. Laya.timer.once(5000, this, () => {
  24674. let retryCount = 0;
  24675. const maxRetries = 3;
  24676. const tryFetchConfig = () => {
  24677. try {
  24678. xGame.cfgMgr.getConfigFromServer();
  24679. }
  24680. catch (error) {
  24681. if (retryCount < maxRetries) {
  24682. retryCount++;
  24683. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24684. Laya.timer.once(5000, this, tryFetchConfig);
  24685. }
  24686. else {
  24687. console.error("❌ 达到最大重试次数,配置获取失败");
  24688. }
  24689. }
  24690. };
  24691. tryFetchConfig();
  24692. });
  24693. return false;
  24694. }
  24695. return true;
  24696. }
  24697. startPlaceBall() {
  24698. if (!this.isReadyForLoadNetSource()) {
  24699. return;
  24700. }
  24701. xGame.uiMgr.Show(UILevelDisplay$1);
  24702. }
  24703. hide() {
  24704. console.log('zh:uimain hide ...');
  24705. super.hide();
  24706. xGame.common.stopGirlPop(this.ui.talkNode);
  24707. }
  24708. onGetUserInfo(force = false) {
  24709. if (Moyu.isWx) {
  24710. let info = Moyu.getSystemInfo();
  24711. if (info)
  24712. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24713. }
  24714. else {
  24715. Moyu.initUser(this, this.freshUser, force);
  24716. }
  24717. this.freshUser();
  24718. console.log('zh:5秒后更新用户信息');
  24719. setTimeout(() => {
  24720. DataMgr.getUserZiChanInfo();
  24721. }, 5000);
  24722. }
  24723. event_login_in() {
  24724. console.log("zh:event_login_in被触发");
  24725. this.freshUser();
  24726. }
  24727. freshUser() {
  24728. let user = Moyu.getUserInfo();
  24729. if (!user.isAuth) {
  24730. user.headIcon = 'res/ty_touxiang.png';
  24731. }
  24732. else {
  24733. DataMgr.upRankData();
  24734. }
  24735. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24736. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24737. let keyStr = keyForLoginInfo;
  24738. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24739. const d = LocalStorageManager.getItem(keyStr);
  24740. let ua = d.username;
  24741. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24742. }
  24743. else {
  24744. }
  24745. this.c_btn_for_user();
  24746. }
  24747. interuptSecretary() {
  24748. Laya.timer.clearAll(this);
  24749. this.playSecretaryRandomSound();
  24750. }
  24751. playSecretaryRandomSound() {
  24752. if (this.isHide)
  24753. return;
  24754. let time = xGame.common.randomNum(45000, 60000);
  24755. Laya.timer.once(time, this, () => {
  24756. if (this.isHide)
  24757. return;
  24758. let index = xGame.common.randomNum(4, 7);
  24759. xGame.soundMgr.playSound("s_main0" + index);
  24760. let words = 1;
  24761. switch (index) {
  24762. case 4:
  24763. words = 5;
  24764. break;
  24765. case 5:
  24766. words = 3;
  24767. break;
  24768. case 6:
  24769. words = 6;
  24770. break;
  24771. case 7:
  24772. words = 7;
  24773. break;
  24774. default:
  24775. break;
  24776. }
  24777. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24778. this.playSecretaryRandomSound();
  24779. });
  24780. }
  24781. openSecretaryView() {
  24782. xGame.uiMgr.Show(UISecretary$1);
  24783. Moyu.sendDataEvent("secretary");
  24784. }
  24785. openShopView() {
  24786. xGame.uiMgr.Show(UIShop$1, 1);
  24787. }
  24788. openShopView0() {
  24789. xGame.uiMgr.Show(UIShop$1, 0);
  24790. }
  24791. openSignView() {
  24792. xGame.uiMgr.Show(UISign$1);
  24793. }
  24794. openDrawView() {
  24795. xGame.uiMgr.Show(UIDraw$1);
  24796. }
  24797. openRanking() {
  24798. console.log('zh:phb openRanking');
  24799. xGame.uiMgr.Show(UIRanking$1);
  24800. Moyu.sendDataEvent("rankingList");
  24801. }
  24802. }
  24803. UIMain$1.uiName = "UIMain";
  24804. function InitShader() {
  24805. }
  24806. function appInit() {
  24807. xGame.context.init(getLoadingResList(), initCallback);
  24808. }
  24809. function getLoadingResList() {
  24810. return [
  24811. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24812. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24813. ];
  24814. }
  24815. function getGameResList() {
  24816. return [
  24817. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24818. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24819. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24820. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24821. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24822. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24823. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24824. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24825. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24826. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24827. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24828. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24829. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24830. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24831. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24832. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24833. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24834. ];
  24835. }
  24836. function initCallback() {
  24837. window["DataMgr"] = DataMgr;
  24838. DataMgr.Init();
  24839. Moyu.init(getPlat(), this, () => {
  24840. DataMgr.isNewDay();
  24841. PlatMgr.initConfig();
  24842. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24843. }, true);
  24844. console.log('zh:开始sm init1 start');
  24845. xGame.soundMgr.init();
  24846. console.log('zh:开始sm init1 end');
  24847. xGame.uiMgr.init();
  24848. xGame.uiMgr.clearTempData();
  24849. xGame.uiMgr.bindFUI(fguiRes.loading);
  24850. xGame.uiMgr.Show(UILoading);
  24851. }
  24852. function loadSubRes(callback) {
  24853. var tab = ["asset", "res", "spine"];
  24854. let subDone = 0;
  24855. for (var i = 0; i < tab.length; i++) {
  24856. let sub = tab[i];
  24857. Moyu.loadSubRes(sub, (pro) => {
  24858. callback && callback(pro, false);
  24859. }).then(() => {
  24860. subDone++;
  24861. if (subDone >= tab.length)
  24862. callback && callback(1, true);
  24863. });
  24864. }
  24865. }
  24866. function enterGame() {
  24867. xGame.cfgMgr.init();
  24868. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24869. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24870. xGame.uiMgr.Hide(UILoading);
  24871. fgui.UIPackage.removePackage(fguiRes.loading);
  24872. xGame.uiMgr.bindFUI(fguiRes.game);
  24873. xGame.uiMgr.Show(UIMain$1);
  24874. if (DataMgr.getNewUser())
  24875. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24876. }
  24877. function getPlat() {
  24878. let cfg = new MoyuCfg();
  24879. cfg.plat = MoyuPlat.web;
  24880. cfg.myId = 180;
  24881. cfg.myKey = '8848a885774230a4';
  24882. cfg.version = 0;
  24883. if (window.hasOwnProperty("gamebox")) {
  24884. cfg.plat = MoyuPlat.f399;
  24885. cfg.version = 0;
  24886. }
  24887. else if (window.hasOwnProperty("ks")) {
  24888. cfg.plat = MoyuPlat.ks;
  24889. cfg.version = 0;
  24890. cfg.ads.ksVideoId = '2300002254_01';
  24891. cfg.ads.ksInsertId = '2300002254_02';
  24892. }
  24893. else if (Laya.Browser.onTTMiniGame) {
  24894. cfg.plat = MoyuPlat.tt;
  24895. cfg.version = 0;
  24896. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24897. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24898. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24899. }
  24900. else if (Laya.Browser.onMiniGame) {
  24901. cfg.plat = MoyuPlat.wx;
  24902. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24903. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24904. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24905. }
  24906. else if (Laya.Browser.onQQMiniGame) {
  24907. cfg.plat = MoyuPlat.qq;
  24908. }
  24909. else if (Laya.Browser.onQGMiniGame) {
  24910. cfg.plat = MoyuPlat.op;
  24911. cfg.ads.opVideoId = '455502';
  24912. cfg.ads.opBannerId = '455507';
  24913. }
  24914. else if (Laya.Browser.onVVMiniGame) {
  24915. cfg.plat = MoyuPlat.vv;
  24916. cfg.version = 0;
  24917. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24918. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24919. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24920. }
  24921. else if (Laya.Browser.onHWMiniGame) {
  24922. cfg.plat = MoyuPlat.hw;
  24923. }
  24924. else if (window["mz"]) {
  24925. cfg.plat = MoyuPlat.mz;
  24926. }
  24927. else {
  24928. let cfg = window['conchConfig'];
  24929. if (cfg) {
  24930. var os = cfg.getOS();
  24931. if (os == "Conch-ios") {
  24932. cfg.plat = MoyuPlat.ios;
  24933. }
  24934. else if (os == "Conch-android") {
  24935. }
  24936. }
  24937. }
  24938. return cfg;
  24939. }
  24940. class Main {
  24941. constructor() {
  24942. if (window["Laya3D"])
  24943. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24944. else {
  24945. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  24946. this.initMain();
  24947. }
  24948. }
  24949. initMain() {
  24950. Laya["Physics"] && Laya["Physics"].enable();
  24951. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  24952. Laya.stage.scaleMode = GameConfig.scaleMode;
  24953. Laya.stage.screenMode = GameConfig.screenMode;
  24954. Laya.stage.alignV = GameConfig.alignV;
  24955. Laya.stage.alignH = GameConfig.alignH;
  24956. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  24957. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  24958. Laya.enableDebugPanel();
  24959. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  24960. Laya["PhysicsDebugDraw"].enable();
  24961. if (GameConfig.stat)
  24962. Laya.Stat.show();
  24963. Laya.alertGlobalError(true);
  24964. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  24965. }
  24966. onVersionLoaded() {
  24967. appInit();
  24968. }
  24969. }
  24970. new Main();
  24971. }());
  24972. //# sourceMappingURL=bundle.js.map