bundle.js 975 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405
  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 = true;
  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. console.log('zh:showInternAd start');
  1267. if (!Laya.Browser.onAndroid) {
  1268. console.log('zh:showInternAd 非android dev');
  1269. return false;
  1270. }
  1271. if (!this.initBridge()) {
  1272. return false;
  1273. }
  1274. let rs = this.bridge.call("showInternAd", mark);
  1275. try {
  1276. const result = JSON.parse(rs);
  1277. if (result.code === 200) {
  1278. console.log("zh:showInternAd OK");
  1279. return true;
  1280. }
  1281. else {
  1282. console.warn("zh:showInternAd FAILL:", result.msg);
  1283. return false;
  1284. }
  1285. }
  1286. catch (e) {
  1287. console.error("zh:解析桥接返回值失败:", e);
  1288. return false;
  1289. }
  1290. }
  1291. exitAndCloseGame() {
  1292. if (!Laya.Browser.onAndroid) {
  1293. return;
  1294. }
  1295. if (!this.initBridge()) {
  1296. return;
  1297. }
  1298. console.log('zh:开始关闭游戏-');
  1299. this.bridge.call("exitAndCloseGame");
  1300. }
  1301. checkAdForUserOrderForSpid17(spid) {
  1302. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1303. if (userInfo != null) {
  1304. if (!userInfo.buySpids) {
  1305. userInfo.buySpids = { 1: false, 7: false };
  1306. }
  1307. else {
  1308. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1309. }
  1310. let boo = userInfo.buySpids[spid];
  1311. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1312. return boo;
  1313. }
  1314. return false;
  1315. }
  1316. showRewardAd(mark) {
  1317. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1318. if (boo7) {
  1319. console.log('zh: VIP SPID = 7,无任何AD');
  1320. return false;
  1321. }
  1322. if (!Laya.Browser.onAndroid) {
  1323. return false;
  1324. }
  1325. if (!this.initBridge()) {
  1326. return false;
  1327. }
  1328. let rs = this.bridge.call("showRewardAd", mark);
  1329. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1330. try {
  1331. const result = JSON.parse(rs);
  1332. if (result.code === 200) {
  1333. console.log("zh:广告显示成功");
  1334. return true;
  1335. }
  1336. else {
  1337. console.warn("zh:广告显示失败:", result.msg);
  1338. return false;
  1339. }
  1340. }
  1341. catch (e) {
  1342. console.error("zh:解析桥接返回值失败:", e);
  1343. return false;
  1344. }
  1345. }
  1346. logEventForAdNoParams(eventName) {
  1347. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1348. if (!Laya.Browser.onAndroid) {
  1349. return;
  1350. }
  1351. if (!this.initBridge()) {
  1352. return;
  1353. }
  1354. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1355. this.bridge.call("logEventForAdNoParams", eventName);
  1356. }
  1357. logEventForAdHaveParams(eventName, jsonStr) {
  1358. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1359. if (!Laya.Browser.onAndroid) {
  1360. return;
  1361. }
  1362. if (!this.initBridge()) {
  1363. return;
  1364. }
  1365. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1366. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1367. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1368. }
  1369. logEventForFirebase(eventName, jsonStr) {
  1370. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1371. if (!Laya.Browser.onAndroid) {
  1372. return;
  1373. }
  1374. if (!this.initBridge()) {
  1375. return;
  1376. }
  1377. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1378. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1379. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1380. }
  1381. testNetTip() {
  1382. if (Laya.Browser.onAndroid) {
  1383. let boo = this.getNetworkAvailable();
  1384. this.showToast2("Network error, reward unavailable");
  1385. return;
  1386. }
  1387. }
  1388. getNetworkAvailable() {
  1389. if (!Laya.Browser.onAndroid) {
  1390. return;
  1391. }
  1392. if (!this.initBridge()) {
  1393. return;
  1394. }
  1395. let boo = this.bridge.call("getNetworkAvailable");
  1396. console.log("zh:getNetworkAvailable boo=" + boo);
  1397. return boo;
  1398. }
  1399. showToast2(msg) {
  1400. if (!Laya.Browser.onAndroid) {
  1401. return;
  1402. }
  1403. if (!this.initBridge()) {
  1404. return;
  1405. }
  1406. this.bridge.call("showToast2", msg);
  1407. }
  1408. loginOutForApp() {
  1409. if (!Laya.Browser.onAndroid) {
  1410. return;
  1411. }
  1412. if (!this.initBridge()) {
  1413. return;
  1414. }
  1415. this.bridge.call("loginOutForApp");
  1416. }
  1417. startGgPay(token, ggSpid, spid) {
  1418. if (!Laya.Browser.onAndroid) {
  1419. return;
  1420. }
  1421. if (!this.initBridge()) {
  1422. return;
  1423. }
  1424. let jsonObj = {
  1425. token: token,
  1426. ggSpid: ggSpid,
  1427. spid: spid,
  1428. spsl: 1
  1429. };
  1430. let reqData = JSON.stringify(jsonObj);
  1431. console.log("zh:startGgPay ts reqData=" + reqData);
  1432. this.bridge.call("startGgPay", reqData);
  1433. }
  1434. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1435. if (!Laya.Browser.onAndroid) {
  1436. return;
  1437. }
  1438. if (!this.initBridge()) {
  1439. return;
  1440. }
  1441. let jsonObj = {
  1442. token: token,
  1443. ggSpid: ggSpid,
  1444. spid: spid,
  1445. spsl: 1
  1446. };
  1447. let reqData = JSON.stringify(jsonObj);
  1448. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1449. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1450. }
  1451. nativeCallJs(msg) {
  1452. console.log("zh:nativeCallJs received data: 1111", msg);
  1453. if (msg === 'Ad1') {
  1454. GlobalManager.instance.callMethod('Ad1');
  1455. console.log("zh: Ad1 奖励发送成功");
  1456. }
  1457. else if (msg === 'Ad2') {
  1458. GlobalManager.instance.callMethod('Ad2');
  1459. console.log("zh: Ad2 奖励发送成功");
  1460. }
  1461. else if (msg === 'Ad3') {
  1462. GlobalManager.instance.callMethod('Ad3');
  1463. console.log("zh: Ad3 奖励发送成功");
  1464. }
  1465. else if (msg === 'Ad4') {
  1466. GlobalManager.instance.callMethod('Ad4');
  1467. console.log("zh: Ad4 奖励发送成功");
  1468. }
  1469. else if (msg === 'Ad5') {
  1470. console.log("zh: Ad5 奖励发送成功");
  1471. GlobalManager.instance.callMethod('Ad5');
  1472. }
  1473. }
  1474. }
  1475. class UIBox extends UIBase {
  1476. constructor() {
  1477. super();
  1478. this.boxNum = 0;
  1479. this.boxMax = 10;
  1480. this.inAd = false;
  1481. this.isClose = false;
  1482. }
  1483. onConstructor() {
  1484. this.ui = ui_UIBox.createInstance();
  1485. this.contentPane = this.ui;
  1486. this.isEject = false;
  1487. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1488. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1489. Laya.timer.loop(1000, this, this.update);
  1490. }
  1491. update() {
  1492. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1493. this.boxNum -= 1;
  1494. this.upBar();
  1495. }
  1496. }
  1497. upBar() {
  1498. if (this.boxNum > this.boxMax)
  1499. this.boxNum = this.boxMax;
  1500. this.ui.bar.value = this.boxNum * 10;
  1501. }
  1502. show() {
  1503. super.show();
  1504. this.isClose = false;
  1505. this.boxNum = 0;
  1506. this.inAd = false;
  1507. this.upBar();
  1508. this.ui.t0.play();
  1509. this.ui.closeBtn.visible = false;
  1510. Laya.timer.once(3000, this, () => {
  1511. this.ui.closeBtn.visible = true;
  1512. this.ui.bar.alpha = 1;
  1513. });
  1514. Laya.timer.once(500, this, () => {
  1515. this.ui.t1.play();
  1516. });
  1517. }
  1518. hide() {
  1519. Laya.timer.clearAll(this);
  1520. Moyu.showBannerAd(false);
  1521. super.hide();
  1522. }
  1523. onOpenBox() {
  1524. this.boxNum++;
  1525. if (this.boxNum < this.boxMax) {
  1526. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1527. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1528. }
  1529. }
  1530. else if (this.boxNum == this.boxMax) {
  1531. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1532. this.ui.openBtn.c1.selectedIndex = 13;
  1533. this.inAd = true;
  1534. }
  1535. else
  1536. this.getAward();
  1537. }
  1538. else if (this.inAd) {
  1539. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1540. if (Laya.Browser.onAndroid) {
  1541. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1542. if (!boo) {
  1543. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1544. return;
  1545. }
  1546. }
  1547. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1548. }
  1549. else {
  1550. console.log('zh:AD 失败,直接发放奖励');
  1551. this.qjff_AD_for_UIBOX_onOpenBox();
  1552. }
  1553. }
  1554. this.upBar();
  1555. }
  1556. qjff_AD_for_UIBOX_onOpenBox() {
  1557. this.getAward();
  1558. }
  1559. onCloseBox() {
  1560. if (this.isClose)
  1561. this.hide();
  1562. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1563. this.isClose = true;
  1564. PlatMgr.showBanner(true, 0, 3000);
  1565. }
  1566. else
  1567. this.hide();
  1568. }
  1569. getAward() {
  1570. let str = "";
  1571. if (Math.random() < 0.5) {
  1572. let max = Moyu.isLegal ? 500 : 2500;
  1573. let num = xGame.tools.random(max, 500 + max);
  1574. DataMgr.setCoin(num);
  1575. str = "金币x" + num;
  1576. }
  1577. else {
  1578. let max = Moyu.isLegal ? 10 : 30;
  1579. let num = xGame.tools.random(max, 30 + max);
  1580. DataMgr.setDiamond(num);
  1581. str = "钻石x" + num;
  1582. }
  1583. xGame.showTip("恭喜获得-" + str);
  1584. this.hide();
  1585. }
  1586. }
  1587. UIBox.uiName = "UIBox";
  1588. class ui_UITry extends fgui.GComponent {
  1589. static createInstance() {
  1590. return (fgui.UIPackage.createObject("game", "UITry"));
  1591. }
  1592. onConstruct() {
  1593. this.n11 = (this.getChild("n11"));
  1594. this.myNode = (this.getChild("myNode"));
  1595. this.t0 = this.getTransition("t0");
  1596. }
  1597. }
  1598. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1599. class UITry extends UIBase {
  1600. constructor() {
  1601. super();
  1602. this.closeTime = 0;
  1603. this.closeNum = 0;
  1604. this.skillUrl = xGame.common.skillIconList;
  1605. }
  1606. onConstructor() {
  1607. this.ui = ui_UITry.createInstance();
  1608. this.contentPane = this.ui;
  1609. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1610. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1611. }
  1612. show() {
  1613. super.show();
  1614. this.closeNum = 0;
  1615. this.closeTime = 15;
  1616. this.ui.t0.play();
  1617. PlatMgr.showRateBanner();
  1618. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1619. Laya.timer.loop(1000, this, this.updateTime);
  1620. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1621. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1622. xGame.common.gameMgr.gamePause = true;
  1623. }
  1624. updateTime() {
  1625. if (this.closeTime > 1) {
  1626. this.closeTime--;
  1627. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1628. }
  1629. else
  1630. this.hide();
  1631. }
  1632. hide() {
  1633. Laya.timer.clearAll(this);
  1634. Moyu.showBannerAd(false);
  1635. super.hide();
  1636. xGame.common.gameMgr.gamePause = false;
  1637. }
  1638. onTry() {
  1639. console.log('zh:qjff_AD_for_uitry');
  1640. if (Laya.Browser.onAndroid) {
  1641. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1642. if (!boo) {
  1643. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1644. return;
  1645. }
  1646. }
  1647. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1648. }
  1649. else {
  1650. console.log('zh:AD 失败,直接发放奖励');
  1651. this.qjff_AD_for_uitry();
  1652. }
  1653. }
  1654. qjff_AD_for_uitry() {
  1655. let select = xGame.common.curPlayerSkillType;
  1656. DataMgr.gameData.trySkill = select;
  1657. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1658. DataMgr.saveGameData();
  1659. DataMgr.setBigSkill(select, 1);
  1660. xGame.showTip("Trial Successful");
  1661. this.hide();
  1662. }
  1663. onCancel() {
  1664. if (this.closeNum > 0) {
  1665. this.closeNum--;
  1666. if (this.closeNum < 2)
  1667. this.hide();
  1668. return;
  1669. }
  1670. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1671. this.onTry();
  1672. }
  1673. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1674. this.closeNum = 3;
  1675. }
  1676. else
  1677. this.hide();
  1678. }
  1679. }
  1680. UITry.uiName = "UITry";
  1681. class PlatMgr {
  1682. static initConfig() {
  1683. this.lastVt = 0;
  1684. if (!Moyu.platConfig)
  1685. return;
  1686. for (let k in Moyu.platConfig) {
  1687. let pd = this[k];
  1688. let pc = Moyu.platConfig[k];
  1689. if (pd != undefined && pc != undefined)
  1690. this[k] = pc;
  1691. }
  1692. Moyu.setBannerPos(0.5, 1);
  1693. }
  1694. static rand100(num) {
  1695. return xGame.tools.random(0, 100) < num;
  1696. }
  1697. static isMisVideo() {
  1698. let dt = Laya.timer.currTimer - this.lastVt;
  1699. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1700. this.lastVt = Laya.timer.currTimer;
  1701. return true;
  1702. }
  1703. else {
  1704. if (this.rand100(this.fullVideoRate)) {
  1705. console.log('zh:插屏 ad start');
  1706. JSBridgeUtils.instance.showInternAd('platMgr');
  1707. }
  1708. return false;
  1709. }
  1710. }
  1711. static showVideo(call, type) {
  1712. Moyu.showVideoAd(() => {
  1713. this.lastVt = Laya.timer.currTimer;
  1714. call && call();
  1715. }, type);
  1716. }
  1717. static showInsert(delay = false) {
  1718. if (this.getRand() < this.insertRate) {
  1719. let dt = delay ? this.insertDelay : 0;
  1720. console.log('zh:插屏 ad start');
  1721. JSBridgeUtils.instance.showInternAd('gameInsert');
  1722. }
  1723. }
  1724. static gameInsert() {
  1725. let t = this.getRand();
  1726. let r = this.gameInsertRate;
  1727. if (t < r) {
  1728. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1729. }
  1730. }
  1731. static showRateBanner() {
  1732. if (this.getRand() < this.bannerRate)
  1733. this.showBanner(true, this.bannerDelay, 3000);
  1734. }
  1735. static showBanner(show, delay = 0, hide = 0) {
  1736. if (2 > 1) {
  1737. console.log('zh:显示showBanner广告 直接返回');
  1738. return;
  1739. }
  1740. if (!show)
  1741. Moyu.showBannerAd(false);
  1742. else {
  1743. Laya.timer.clear(this, this.bannerShow);
  1744. if (delay > 0)
  1745. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1746. else
  1747. this.bannerShow(true);
  1748. if (hide > 0)
  1749. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1750. }
  1751. }
  1752. static bannerShow(show) {
  1753. if (2 > 1) {
  1754. console.log('zh:显示showBanner广告 直接返回');
  1755. return;
  1756. }
  1757. Moyu.showBannerAd(show);
  1758. console.log("showBanner" + show);
  1759. }
  1760. static getRand() {
  1761. return xGame.tools.random(0, 100);
  1762. }
  1763. static openBox() {
  1764. if (this.getRand() < this.boxRate)
  1765. xGame.uiMgr.Show(UIBox);
  1766. }
  1767. static openTry() {
  1768. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1769. return;
  1770. if (this.getRand() < this.tryRate)
  1771. xGame.uiMgr.Show(UITry);
  1772. else if (DataMgr.gameData.gameCount == 1)
  1773. xGame.uiMgr.Show(UITry);
  1774. }
  1775. }
  1776. PlatMgr.forceShare = 0;
  1777. PlatMgr.signAdRate = 0;
  1778. PlatMgr.forceVideoRate = 0;
  1779. PlatMgr.forceVideoGap = 0;
  1780. PlatMgr.fullVideoRate = 0;
  1781. PlatMgr.gameInsertRate = 0;
  1782. PlatMgr.insertGap = 0;
  1783. PlatMgr.insertDelay = 0;
  1784. PlatMgr.insertRate = 0;
  1785. PlatMgr.boxRate = 0;
  1786. PlatMgr.boxVideoRate = 0;
  1787. PlatMgr.boxInsertRate = 0;
  1788. PlatMgr.boxBannerRate = 0;
  1789. PlatMgr.tryRate = 0;
  1790. PlatMgr.tryClose3Rate = 0;
  1791. PlatMgr.tryVideoRate = 0;
  1792. PlatMgr.bannerRate = 0;
  1793. PlatMgr.lastVt = 0;
  1794. class ui_UIAddProp extends fgui.GComponent {
  1795. static createInstance() {
  1796. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1797. }
  1798. onConstruct() {
  1799. this.n11 = (this.getChild("n11"));
  1800. this.myNode = (this.getChild("myNode"));
  1801. this.closeBtn = (this.getChild("closeBtn"));
  1802. this.t0 = this.getTransition("t0");
  1803. }
  1804. }
  1805. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1806. class SpineMgr {
  1807. constructor(name, loadCb = null) {
  1808. this.loaded = false;
  1809. this.spineName = '';
  1810. this.loadedCallback = loadCb;
  1811. this.templet = new Laya.Templet();
  1812. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1813. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1814. if (name === 'mishu') {
  1815. this.templet.loadAni('spine/nvmishu.sk');
  1816. }
  1817. else {
  1818. this.templet.loadAni(`spine/${name}.sk`);
  1819. }
  1820. this.templet.lock = true;
  1821. this.spineName = name;
  1822. }
  1823. onError() {
  1824. console.log("zh:spine加载出错");
  1825. }
  1826. parseComplete() {
  1827. this.loaded = true;
  1828. this.loadedCallback && this.loadedCallback();
  1829. }
  1830. dispose() {
  1831. if (this.templet && !this.templet.destroyed) {
  1832. this.templet.destroy();
  1833. }
  1834. this.templet = null;
  1835. }
  1836. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1837. if (!this.loaded) {
  1838. return;
  1839. }
  1840. let spine;
  1841. if (mySpine) {
  1842. spine = mySpine;
  1843. }
  1844. else {
  1845. spine = this.createSpine(data, parent);
  1846. }
  1847. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1848. if (!isLoop) {
  1849. spine.on(Laya.Event.STOPPED, this, () => {
  1850. spine.offAll(Laya.Event.STOPPED);
  1851. callback && callback(spine);
  1852. });
  1853. }
  1854. return spine;
  1855. }
  1856. createSpine(data, parent, type = 1) {
  1857. let spine;
  1858. spine = this.templet.buildArmature(type);
  1859. spine.showSkinByIndex(0);
  1860. parent.addChild(spine);
  1861. spine.pos(data.x, data.y);
  1862. spine.scale(data.scaleX, data.scaleY, true);
  1863. return spine;
  1864. }
  1865. }
  1866. var AIState;
  1867. (function (AIState) {
  1868. AIState[AIState["none"] = 0] = "none";
  1869. AIState[AIState["idle"] = 1] = "idle";
  1870. AIState[AIState["reset"] = 2] = "reset";
  1871. AIState[AIState["move"] = 3] = "move";
  1872. AIState[AIState["wait"] = 4] = "wait";
  1873. AIState[AIState["select"] = 5] = "select";
  1874. AIState[AIState["turn"] = 6] = "turn";
  1875. AIState[AIState["shoot"] = 7] = "shoot";
  1876. AIState[AIState["leave"] = 8] = "leave";
  1877. })(AIState || (AIState = {}));
  1878. class AIPlayer {
  1879. constructor() {
  1880. this.dtime = 30;
  1881. this.awayTime = 0;
  1882. this.awayNum = 0;
  1883. this.hideTime = 0;
  1884. this.rootMoveTime = 0;
  1885. this.isGuide = false;
  1886. this.state = AIState.none;
  1887. this.waitTime = 0;
  1888. this.forceNum = 0;
  1889. this.forceMax = 0;
  1890. this.ballSize = 33;
  1891. this.selectNum = 0;
  1892. this.destRot = 0;
  1893. this.aiLv = 10;
  1894. this.kickBall = [];
  1895. this.lineBall = [];
  1896. this.scoreBall = [];
  1897. this.holeBall = [];
  1898. this.turnNum = 0;
  1899. this.setNum = 0;
  1900. this.setMax = 0;
  1901. this.setRate = 0;
  1902. this.rectL = 0;
  1903. this.rectR = 0;
  1904. this.rectT = 0;
  1905. this.rectB = 0;
  1906. this.rootPos = { x: 0, y: 0 };
  1907. this.bestForce = 0;
  1908. this.bestAngle = 180;
  1909. this.bestPos = { x: 0, y: 0 };
  1910. this.bestKick = { x: 0, y: 0 };
  1911. this.posList = [];
  1912. this.posIdx = 0;
  1913. this.chatTime = 3000;
  1914. this.tempDir1 = new Laya.Vector2();
  1915. this.tempDir2 = new Laya.Vector2();
  1916. this.tempDir3 = new Laya.Vector2();
  1917. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1918. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1919. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1920. this.gameSrc = xGame.common.gameUI;
  1921. this.hideTime = Laya.timer.currTimer;
  1922. Moyu.setOnTipCall((id) => {
  1923. if (id == 20012)
  1924. this.hideTime = Laya.timer.currTimer;
  1925. else
  1926. (id == 20011);
  1927. {
  1928. let dt = Laya.timer.currTimer - this.hideTime;
  1929. console.log("onshow" + dt);
  1930. if (dt > 30000 && this.state > AIState.none)
  1931. xGame.common.gameMgr.aiGameEnd(false);
  1932. }
  1933. }, this);
  1934. }
  1935. init() {
  1936. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  1937. this.awayTime = xGame.tools.random(5000, 10000);
  1938. this.awayNum = 0;
  1939. this.hideTime = Laya.timer.currTimer;
  1940. let rect = xGame.common.d2World.borderRect;
  1941. this.rectL = Math.ceil(rect.x) + 17;
  1942. this.rectT = Math.ceil(rect.y) + 17;
  1943. this.rectR = Math.floor(rect.x + rect.width) - 17;
  1944. this.rectB = Math.floor(rect.y + rect.height) - 17;
  1945. this.wBall = xGame.common.d2World.rootBall;
  1946. this.ballSize = this.wBall.gameObj.width - 1;
  1947. if (this.posList.length < 1) {
  1948. let dp = 40;
  1949. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  1950. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  1951. let dx = i < this.rectR ? i : this.rectR;
  1952. let dy = j < this.rectB ? j : this.rectB;
  1953. let order = xGame.tools.random(0, 1000);
  1954. this.posList.push({ x: dx, y: dy, order: order });
  1955. }
  1956. }
  1957. this.posList.sort(function (a, b) {
  1958. return a.order - b.order;
  1959. });
  1960. this.setMax = this.posList.length;
  1961. }
  1962. this.state = AIState.idle;
  1963. }
  1964. setAiLevel(num) {
  1965. this.aiLv = num;
  1966. }
  1967. initBall() {
  1968. this.rootPos.x = this.wBall.gameObj.x;
  1969. this.rootPos.y = this.wBall.gameObj.y;
  1970. this.initHoleBall();
  1971. }
  1972. initHoleBall() {
  1973. this.kickBall = [];
  1974. this.lineBall = [];
  1975. this.scoreBall = [];
  1976. this.holeBall = [];
  1977. this.selectNum = 0;
  1978. this.forceNum = 0;
  1979. this.forceMax = 0;
  1980. this.turnNum = 0;
  1981. let list = xGame.common.d2World.ballArr;
  1982. if (list.length < 20 && !this.isGuide) {
  1983. let holes = xGame.common.gameMgr.holePosList;
  1984. for (let i = 0; i < list.length; i++) {
  1985. let obj = list[i];
  1986. if (!obj)
  1987. continue;
  1988. obj.kickPos.x = 0;
  1989. obj.kickPos.y = 0;
  1990. obj.poleAngle = 0;
  1991. obj.hard = 0;
  1992. obj.borderDis = 0;
  1993. obj.kickAngle = 180;
  1994. if (obj.number == 0)
  1995. continue;
  1996. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  1997. continue;
  1998. if (obj.number == 8 && xGame.common.gameMode == 0) {
  1999. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2000. continue;
  2001. }
  2002. let b = obj.gameObj;
  2003. let wbp = this.rootPos;
  2004. let bx = wbp.x - b.x;
  2005. let by = wbp.y - b.y;
  2006. obj.borderDis = xGame.tools.random(0, 100);
  2007. this.kickBall.push(obj);
  2008. if (!this.isLine(wbp, obj))
  2009. continue;
  2010. obj.kickAngle = xGame.tools.random(90, 180);
  2011. obj.kickPos.x = b.x;
  2012. obj.kickPos.y = b.y;
  2013. this.lineBall.push(obj);
  2014. let minDis = 999999;
  2015. let hole = false;
  2016. for (let j = 0; j < holes.length; j++) {
  2017. let hp = holes[j];
  2018. if (bx >= 0 && hp.x > b.x + 100)
  2019. continue;
  2020. if (bx <= 0 && hp.x < b.x - 100)
  2021. continue;
  2022. if (by < -10 && hp.y < wbp.y)
  2023. continue;
  2024. if (by > 10 && hp.y > wbp.y)
  2025. continue;
  2026. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2027. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2028. if (dis < minDis) {
  2029. let dx = b.x - this.tempDir1.x * this.ballSize;
  2030. let dy = b.y - this.tempDir1.y * this.ballSize;
  2031. this.tempDir3.x = this.tempDir1.x;
  2032. this.tempDir3.y = this.tempDir1.y;
  2033. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2034. obj.kickPos.x = dx;
  2035. obj.kickPos.y = dy;
  2036. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2037. if (num > 1)
  2038. num = 1;
  2039. obj.kickAngle = Math.acos(num) * 57.3;
  2040. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2041. dis = dis * 2;
  2042. if (Math.abs(hp.x - 600) < 100)
  2043. dis += 50;
  2044. obj.hard = dis + obj.kickAngle * 3;
  2045. hole = true;
  2046. }
  2047. }
  2048. }
  2049. }
  2050. if (hole) {
  2051. this.scoreBall.push(obj);
  2052. this.holeBall.push(obj);
  2053. }
  2054. }
  2055. this.scoreBall.sort(function (a, b) {
  2056. return a.hard - b.hard;
  2057. });
  2058. this.holeBall.sort(function (a, b) {
  2059. return a.kickAngle - b.kickAngle;
  2060. });
  2061. this.kickBall.sort(function (a, b) {
  2062. return a.borderDis - b.borderDis;
  2063. });
  2064. }
  2065. else {
  2066. let max = list.length - 1;
  2067. let i = xGame.tools.random(0, max);
  2068. for (i; i <= max; i++) {
  2069. let idx = i >= max ? i -= max : i;
  2070. let obj = list[idx];
  2071. if (obj && obj.number != 0) {
  2072. obj.kickAngle = xGame.tools.random(90, 180);
  2073. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2074. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2075. this.lineBall.push(obj);
  2076. break;
  2077. }
  2078. }
  2079. }
  2080. }
  2081. selectBall() {
  2082. let ball = null;
  2083. this.destRot = 0;
  2084. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2085. let ai = 110 - this.aiLv * 10;
  2086. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2087. let score = false;
  2088. if (this.scoreBall.length < 1) {
  2089. if (this.lineBall.length < 1) {
  2090. for (let i = 0; i < this.kickBall.length; i++) {
  2091. let list = [];
  2092. let bo = this.kickBall[i];
  2093. let bobj = bo.gameObj;
  2094. let rect = xGame.common.d2World.borderRect;
  2095. let mobj = this.wBall.gameObj;
  2096. let minb = bobj.y - rect.y - 20;
  2097. let minw = mobj.y - rect.y - 50;
  2098. if (minb > 0 && minw > 0) {
  2099. let dlenx = 0;
  2100. let dleny = mobj.y - rect.y;
  2101. let spx = mobj.x;
  2102. let spy = rect.y - dleny;
  2103. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2104. }
  2105. minb = rect.y + rect.height - bobj.y - 20;
  2106. minw = rect.y + rect.height - mobj.y - 50;
  2107. if (minb > 0 && minw > 0) {
  2108. let dlenx = 0;
  2109. let dleny = rect.y + rect.height - mobj.y;
  2110. let spx = mobj.x;
  2111. let spy = rect.y + rect.height + dleny;
  2112. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2113. }
  2114. minb = bobj.x - rect.x - 20;
  2115. minw = mobj.x - rect.x - 50;
  2116. if (minb > 0 && minw > 0) {
  2117. let dlenx = mobj.x - rect.x;
  2118. let dleny = 0;
  2119. let spx = rect.x - dlenx;
  2120. let spy = mobj.y;
  2121. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2122. }
  2123. minb = rect.x + rect.width - bobj.x - 20;
  2124. minw = rect.x + rect.width - mobj.x - 50;
  2125. if (minb > 0 && minw > 0) {
  2126. let dlenx = rect.x + rect.width - mobj.x;
  2127. let dleny = 0;
  2128. let spx = rect.x + rect.width + dlenx;
  2129. let spy = mobj.y;
  2130. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2131. }
  2132. list.sort(function (a, b) {
  2133. return a.order - b.order;
  2134. });
  2135. for (let i = 0; i < list.length; i++) {
  2136. let data = list[i];
  2137. let mx = mobj.x - bobj.x;
  2138. let my = mobj.y - bobj.y;
  2139. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2140. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2141. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2142. if (num > 1)
  2143. num = 1;
  2144. let cos = Math.acos(num);
  2145. if (cos > 1.57)
  2146. cos = 1.57;
  2147. else if (cos < 0.01)
  2148. cos = 0.01;
  2149. let tan = Math.tan(cos);
  2150. let dx = tan * data.dleny;
  2151. let dy = tan * data.dlenx;
  2152. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2153. if (Math.abs(bx - 667) < 40)
  2154. continue;
  2155. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2156. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2157. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2158. this.forceMax = dis * 0.08;
  2159. this.destRot += mis * 0.1;
  2160. this.setKick(bx, by);
  2161. return true;
  2162. }
  2163. }
  2164. }
  2165. }
  2166. else {
  2167. ball = xGame.common.getRandArrEle(this.lineBall);
  2168. }
  2169. }
  2170. else {
  2171. for (let i = 0; i < this.scoreBall.length; i++) {
  2172. if (i < this.scoreBall.length - 1) {
  2173. let rand = 70 + this.aiLv * 10 + i * 10;
  2174. if (xGame.tools.random(0, 100) < rand) {
  2175. ball = this.scoreBall[i];
  2176. break;
  2177. }
  2178. }
  2179. else {
  2180. ball = this.scoreBall[i];
  2181. break;
  2182. }
  2183. }
  2184. score = true;
  2185. this.selectNum++;
  2186. }
  2187. if (!ball)
  2188. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2189. if (this.selectNum >= max) {
  2190. let dx = ball.gameObj.x;
  2191. let dy = ball.gameObj.y;
  2192. let kickAngle = 0;
  2193. if (score) {
  2194. dx = ball.kickPos.x;
  2195. dy = ball.kickPos.y;
  2196. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2197. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2198. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2199. if (adot > 1)
  2200. adot = 1;
  2201. kickAngle = Math.acos(adot) * 57.3;
  2202. if (kickAngle > 45) {
  2203. let kdx = ball.kickPos.x - ball.gameObj.x;
  2204. let kdy = ball.kickPos.y - ball.gameObj.y;
  2205. dx = ball.kickPos.x - kdx * mis * 0.3;
  2206. dy = ball.kickPos.y - kdy * mis * 0.3;
  2207. }
  2208. else
  2209. this.destRot += mis;
  2210. }
  2211. else if (ball.poleAngle != 0) {
  2212. this.destRot += ball.poleAngle;
  2213. }
  2214. if (xGame.common.gameMode == 0) {
  2215. let af = kickAngle * 0.08;
  2216. this.forceMax = ball.hard * 0.1 + af * af;
  2217. }
  2218. this.setKick(dx, dy);
  2219. }
  2220. else {
  2221. let rand = this.aiLv * 5 + 40;
  2222. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2223. ball = xGame.common.getRandArrEle(this.scoreBall);
  2224. else
  2225. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2226. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2227. if (xGame.tools.random(0, 100) > rand) {
  2228. this.selectNum = max;
  2229. }
  2230. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2231. this.selectNum++;
  2232. }
  2233. ball.onClick(0, true);
  2234. }
  2235. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2236. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2237. let balls = xGame.common.d2World.ballArr;
  2238. let max = xGame.tools.getDis(hx, hy, bx, by);
  2239. for (let index = 0; index < balls.length; index++) {
  2240. let obj = balls[index];
  2241. if (obj.number == 0)
  2242. continue;
  2243. if (obj.number == bn || obj.number == dn)
  2244. continue;
  2245. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2246. if (dis * dis > max)
  2247. continue;
  2248. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2249. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2250. if (num > 1)
  2251. num = 1;
  2252. if (num < 0)
  2253. continue;
  2254. let gap = Math.sin(Math.acos(num)) * dis;
  2255. if (gap < this.ballSize)
  2256. return true;
  2257. }
  2258. return false;
  2259. }
  2260. isLine(xy, ball) {
  2261. let bx = xy.x;
  2262. let by = xy.y;
  2263. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2264. let dis = ball.getDestDis(xy);
  2265. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2266. let sin = Math.sin(angle);
  2267. let cos = Math.cos(angle);
  2268. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2269. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2270. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2271. let dx = bx + this.tempDir2.x * dis;
  2272. let dy = by + this.tempDir2.y * dis;
  2273. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2274. sin = Math.sin(-angle);
  2275. cos = Math.cos(-angle);
  2276. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2277. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2278. dx = bx + this.tempDir2.x * dis;
  2279. dy = by + this.tempDir2.y * dis;
  2280. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2281. if (isr && isl)
  2282. return false;
  2283. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2284. }
  2285. return true;
  2286. }
  2287. turnPole() {
  2288. this.turnNum++;
  2289. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2290. let dr = rot - this.destRot;
  2291. let abs = Math.abs(dr) % 360;
  2292. if (abs > 180) {
  2293. if (rot > 180)
  2294. rot -= 360;
  2295. if (this.destRot > 180)
  2296. this.destRot -= 360;
  2297. }
  2298. let max = this.turnNum * 5 + this.aiLv * 5;
  2299. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2300. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2301. let at = xGame.tools.random(1000, 2000);
  2302. if (!this.onAway(3))
  2303. at += xGame.tools.random(10000, 15000);
  2304. this.setState(AIState.shoot, at);
  2305. }
  2306. else {
  2307. let mr = 0;
  2308. if (abs > 3)
  2309. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2310. else if (Math.random() > 0.6)
  2311. mr = xGame.tools.random(1, 10) * 0.1;
  2312. mr = dr > 0 ? -mr : mr;
  2313. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2314. }
  2315. }
  2316. setKick(dx, dy) {
  2317. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2318. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2319. this.tempDir1.x = 0;
  2320. this.tempDir1.y = 1;
  2321. this.tempDir2.y = -this.tempDir2.y;
  2322. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2323. if (num > 1)
  2324. num = 1;
  2325. let rot = Math.acos(num) * 57.3;
  2326. if (this.tempDir2.x < 0)
  2327. rot = 360 - rot;
  2328. this.destRot += rot;
  2329. if (!xGame.common.gameMgr.finishOneShoot) {
  2330. this.forceMax += xGame.tools.random(10, 50);
  2331. this.forceMax -= this.aiLv * 2;
  2332. if (this.forceMax < 20)
  2333. this.forceMax = 20;
  2334. }
  2335. if (this.forceMax > 100)
  2336. this.forceMax = 101;
  2337. else if (this.forceMax < 10)
  2338. this.forceMax += xGame.tools.random(0, 10);
  2339. if (xGame.common.gameMode == 1)
  2340. this.forceMax = xGame.tools.random(80, 100);
  2341. else
  2342. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2343. let max = 2000 - this.aiLv * 100;
  2344. if (Math.random() > 0.8)
  2345. max += xGame.tools.random(100, 2000);
  2346. this.setState(AIState.turn, xGame.tools.random(500, max));
  2347. }
  2348. shoot() {
  2349. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2350. if (Math.random() > 0.8) {
  2351. this.gameSrc.aiForce(1);
  2352. this.setState(AIState.wait);
  2353. }
  2354. }
  2355. else {
  2356. let df = xGame.tools.random(3, 8);
  2357. if (this.forceNum < this.forceMax)
  2358. this.forceNum += df;
  2359. else
  2360. this.forceNum -= df;
  2361. let startY = this.gameSrc.ui.powerNode.y;
  2362. let height = this.gameSrc.ui.powerNode.height;
  2363. let force = startY + height * this.forceNum * 0.01;
  2364. this.gameSrc.aiForce(2, force);
  2365. }
  2366. }
  2367. reset() {
  2368. for (let i = 0; i < 4; i++) {
  2369. this.setRate--;
  2370. this.setNum++;
  2371. let pos = this.posList[this.posIdx];
  2372. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2373. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2374. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2375. this.rootPos.x = 387;
  2376. if (this.rootPos.x < this.rectL)
  2377. this.rootPos.x = this.rectL;
  2378. else if (this.rootPos.x > this.rectR)
  2379. this.rootPos.x = this.rectR;
  2380. if (this.rootPos.y < this.rectT)
  2381. this.rootPos.y = this.rectT;
  2382. else if (this.rootPos.y > this.rectB)
  2383. this.rootPos.y = this.rectB;
  2384. this.posIdx++;
  2385. let max = this.posList.length;
  2386. if (this.posIdx >= max)
  2387. this.posIdx -= max;
  2388. this.initHoleBall();
  2389. let ball = null;
  2390. if (this.scoreBall.length > 0)
  2391. ball = this.scoreBall[0];
  2392. else if (this.lineBall.length > 0)
  2393. ball = xGame.common.getRandArrEle(this.lineBall);
  2394. if (ball && ball.kickAngle < this.bestAngle) {
  2395. this.bestAngle = ball.kickAngle;
  2396. this.bestKick.x = ball.kickPos.x;
  2397. this.bestKick.y = ball.kickPos.y;
  2398. this.bestPos.x = this.rootPos.x;
  2399. this.bestPos.y = this.rootPos.y;
  2400. this.bestForce = ball.hard * 0.08;
  2401. }
  2402. }
  2403. if (this.setNum >= this.setMax)
  2404. this.setMax = 0;
  2405. if (this.setRate < 1) {
  2406. this.setState(AIState.move, 0);
  2407. this.rootMoveTime = Laya.timer.currTimer;
  2408. this.gameSrc.aiRootMove(true);
  2409. }
  2410. }
  2411. delayLine() {
  2412. this.gameSrc.aiRootMove(false);
  2413. }
  2414. move() {
  2415. if (this.bestPos.x < 1)
  2416. this.bestPos = this.rootPos;
  2417. let wObj = this.wBall.gameObj;
  2418. let destx = wObj.x;
  2419. let desty = wObj.y;
  2420. let dx = Math.abs(destx - this.bestPos.x);
  2421. let dy = Math.abs(desty - this.bestPos.y);
  2422. let mx = 3 + dx * 0.03;
  2423. let my = 3 + dy * 0.03;
  2424. if (dx < 4 && dy < 4) {
  2425. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2426. dt = dt < 1000 ? 1000 - dt : 0;
  2427. if (this.setMax > 0) {
  2428. let min = this.setMax * 0.3 + this.aiLv * 5;
  2429. this.setRate = xGame.tools.random(min, this.setMax);
  2430. this.setState(AIState.reset, 0);
  2431. }
  2432. else {
  2433. this.destRot = 0;
  2434. this.forceMax = this.bestForce;
  2435. this.setKick(this.bestKick.x, this.bestKick.y);
  2436. }
  2437. if (dt > 100) {
  2438. Laya.timer.clear(this, this.delayLine);
  2439. Laya.timer.once(dt, this, this.delayLine);
  2440. }
  2441. else
  2442. this.gameSrc.aiRootMove(false);
  2443. }
  2444. else {
  2445. if (dx > 4)
  2446. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2447. if (dy > 4)
  2448. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2449. this.gameSrc.onRootMove({ x: destx, y: desty });
  2450. }
  2451. }
  2452. resetRoot() {
  2453. this.bestAngle = 180;
  2454. this.bestForce = 0;
  2455. this.setMax = this.posList.length;
  2456. this.posIdx = xGame.tools.random(0, this.setMax);
  2457. let min = this.setMax * 0.3 + this.aiLv * 5;
  2458. this.setRate = xGame.tools.random(min, this.setMax);
  2459. let max = 2000 - this.aiLv * 100;
  2460. if (Math.random() > 0.8)
  2461. max += xGame.tools.random(100, 1000);
  2462. if (this.isGuide)
  2463. this.setState(AIState.select, 500);
  2464. else if (this.onAway(2))
  2465. this.setState(AIState.reset, xGame.tools.random(400, max));
  2466. else
  2467. this.setState(AIState.none);
  2468. if (xGame.common.gameMgr.finishOneShoot)
  2469. this.chat();
  2470. }
  2471. runAI() {
  2472. if (this.state > AIState.idle)
  2473. return;
  2474. this.initBall();
  2475. this.onGame(2500);
  2476. if (Math.random() > 0.6)
  2477. this.chat();
  2478. }
  2479. stopRun() {
  2480. this.setState(AIState.idle);
  2481. }
  2482. onGame(base) {
  2483. let max = base - this.aiLv * 100;
  2484. if (Math.random() > 0.8)
  2485. max += xGame.tools.random(100, 1000);
  2486. if (this.onAway(2))
  2487. this.setState(AIState.select, xGame.tools.random(500, max));
  2488. else
  2489. this.setState(AIState.none);
  2490. }
  2491. setState(sta, wt = 0) {
  2492. if (this.state == AIState.none)
  2493. return;
  2494. this.state = sta;
  2495. this.waitTime = wt;
  2496. }
  2497. onUpdate() {
  2498. if (this.state == AIState.none)
  2499. return;
  2500. this.awayTime -= this.dtime;
  2501. if (this.awayTime < 1) {
  2502. this.awayTime = xGame.tools.random(6000, 10000);
  2503. this.awayNum += (11 - this.aiLv);
  2504. this.onAway(1);
  2505. }
  2506. if (this.waitTime >= 0) {
  2507. this.waitTime -= this.dtime;
  2508. return;
  2509. }
  2510. switch (this.state) {
  2511. case AIState.idle:
  2512. this.chat();
  2513. break;
  2514. case AIState.reset:
  2515. this.reset();
  2516. break;
  2517. case AIState.move:
  2518. this.move();
  2519. break;
  2520. case AIState.leave:
  2521. this.state = AIState.none;
  2522. xGame.common.gameMgr.aiGameEnd(true);
  2523. break;
  2524. case AIState.select:
  2525. this.selectBall();
  2526. break;
  2527. case AIState.turn:
  2528. this.turnPole();
  2529. break;
  2530. case AIState.shoot:
  2531. this.shoot();
  2532. break;
  2533. }
  2534. }
  2535. onAway(type) {
  2536. if (type == 1) {
  2537. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2538. let num = this.awayNum + db * 20;
  2539. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2540. xGame.common.gameMgr.aiLeave();
  2541. this.setState(AIState.leave, 6666);
  2542. }
  2543. }
  2544. else if (type == 2) {
  2545. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2546. let num = this.awayNum + db * 30;
  2547. if (xGame.tools.random(0, 10000) < num)
  2548. return false;
  2549. }
  2550. else if (type == 3) {
  2551. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2552. let num = this.awayNum + db * 10;
  2553. if (xGame.tools.random(0, 4000) < num)
  2554. return false;
  2555. }
  2556. return true;
  2557. }
  2558. chat() {
  2559. if (this.chatTime > 0) {
  2560. this.chatTime -= this.dtime;
  2561. return;
  2562. }
  2563. this.chatTime = xGame.tools.random(2000, 10000);
  2564. let rand = xGame.tools.random(0, 100);
  2565. if (rand < 15)
  2566. this.talk();
  2567. else if (rand < 35)
  2568. this.emotion();
  2569. }
  2570. talk() {
  2571. xGame.common.talkMgr.showAITalk(0);
  2572. }
  2573. emotion() {
  2574. xGame.common.talkMgr.showAIEmotion(0);
  2575. }
  2576. resetAI() {
  2577. this.stopRun();
  2578. this.state = AIState.none;
  2579. }
  2580. }
  2581. class Partical extends Laya.Script3D {
  2582. constructor() {
  2583. super();
  2584. this.duration = 2000;
  2585. }
  2586. ;
  2587. onAwake() {
  2588. this.gameObj = this.owner;
  2589. }
  2590. onEnable() {
  2591. this.openTimer();
  2592. }
  2593. openTimer() {
  2594. Laya.timer.once(this.duration, this, this.disappear);
  2595. }
  2596. setCallback(obj, callback) {
  2597. this.obj = obj;
  2598. this.callback = callback;
  2599. Laya.timer.clearAll(this);
  2600. Laya.timer.once(this.duration, this, this.disappear);
  2601. }
  2602. disappear() {
  2603. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2604. this.callback && this.callback(this.obj);
  2605. }
  2606. }
  2607. class Ball extends Laya.Script3D {
  2608. constructor() {
  2609. super();
  2610. this.posV3 = new Laya.Vector3();
  2611. this.rotRate = 2.1;
  2612. this.rotSpeed = new Laya.Vector3();
  2613. this.myIndex = 0;
  2614. }
  2615. onAwake() {
  2616. this.gameObj = this.owner;
  2617. this.transform = this.gameObj.transform;
  2618. this.ballNode = this.gameObj.getChildByName("Ball");
  2619. this.shadowNode = this.gameObj.getChildByName("shadow");
  2620. }
  2621. initSelf(index, x, y, owner) {
  2622. this.d2BallSrc = owner;
  2623. this.myIndex = index;
  2624. this.setAlbedoTexture();
  2625. this.setTransPos(x, y);
  2626. this.setScale();
  2627. this.ballNode.transform.localRotationEulerX = 90;
  2628. if (index == 0) {
  2629. }
  2630. }
  2631. setAlbedoTexture(isIce = false) {
  2632. let url;
  2633. if (isIce) {
  2634. url = `res/d3Res/ballTexture/ice.jpg`;
  2635. }
  2636. else {
  2637. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2638. }
  2639. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2640. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2641. }));
  2642. }
  2643. runFireworks(obj, delay, callback) {
  2644. Laya.timer.clearAll(this);
  2645. Laya.timer.once(delay + 1, this, () => {
  2646. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2647. fire.transform.localPositionX = this.transform.localPositionX;
  2648. fire.transform.localPositionY = this.transform.localPositionY;
  2649. fire.transform.localPositionZ = this.transform.localPositionZ;
  2650. let src = fire.getComponent(Partical);
  2651. src.duration = 1000;
  2652. src.setCallback(obj, callback);
  2653. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2654. eft.transform.localPositionX = this.transform.localPositionX;
  2655. eft.transform.localPositionY = this.transform.localPositionY;
  2656. eft.transform.localPositionZ = this.transform.localPositionZ;
  2657. });
  2658. }
  2659. setTransPos(x, y) {
  2660. this.setRotation();
  2661. xGame.common.pos2to3Convert(x, y, this.posV3);
  2662. this.transform.localPositionX = this.posV3.x;
  2663. this.transform.localPositionY = 0;
  2664. this.transform.localPositionZ = this.posV3.z;
  2665. this.transform.localRotationEulerX = 0;
  2666. this.transform.localRotationEulerY = 0;
  2667. this.transform.localRotationEulerZ = 0;
  2668. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2669. this.shadowNode.transform.localPositionY = 0.1;
  2670. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2671. }
  2672. setRotation() {
  2673. if (this.d2BallSrc.canRot) {
  2674. let speed = this.d2BallSrc.rigy.linearVelocity;
  2675. this.rotSpeed.x = speed.x * this.rotRate;
  2676. this.rotSpeed.z = speed.y * this.rotRate;
  2677. this.rotSpeed.y = this.d2BallSrc.rotY;
  2678. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2679. }
  2680. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2681. this.rotSpeed.x = this.rotSpeed.y = 0;
  2682. this.rotSpeed.y = this.d2BallSrc.rotY;
  2683. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2684. }
  2685. }
  2686. setScale() {
  2687. let radius = xGame.common.d2World.rootBall.ui.width;
  2688. let scale = xGame.common.scale2to3Convert(radius);
  2689. this.transform.localScaleX = scale;
  2690. this.transform.localScaleY = scale;
  2691. this.transform.localScaleZ = scale;
  2692. }
  2693. playInHoleEft() {
  2694. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2695. eft.transform.position = this.transform.position;
  2696. }
  2697. playIceEft() {
  2698. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2699. eft.transform.position = this.transform.position;
  2700. }
  2701. get scaleXYZ() {
  2702. return this.transform.localScaleX;
  2703. }
  2704. set scaleXYZ(val) {
  2705. this.transform.localScaleX = val;
  2706. this.transform.localScaleY = val;
  2707. this.transform.localScaleZ = val;
  2708. }
  2709. get posX() {
  2710. return this.transform.localPositionX;
  2711. }
  2712. set posX(val) {
  2713. this.transform.localPositionX = val;
  2714. }
  2715. get posY() {
  2716. return this.transform.localPositionY;
  2717. }
  2718. set posY(val) {
  2719. this.transform.localPositionY = val;
  2720. }
  2721. get posZ() {
  2722. return this.transform.localPositionZ;
  2723. }
  2724. set posZ(val) {
  2725. this.transform.localPositionZ = val;
  2726. }
  2727. destroySelf() {
  2728. this.posV3 = null;
  2729. this.rotSpeed = null;
  2730. this.d2BallSrc = null;
  2731. this.ballNode = null;
  2732. this.gameObj.destroy(true);
  2733. this.transform = null;
  2734. this.destroy();
  2735. }
  2736. }
  2737. class ui_D2Ball extends fgui.GComponent {
  2738. static createInstance() {
  2739. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2740. }
  2741. onConstruct() {
  2742. this.myIcon = (this.getChild("myIcon"));
  2743. this.inner = (this.getChild("inner"));
  2744. this.n8 = (this.getChild("n8"));
  2745. this.n4 = (this.getChild("n4"));
  2746. this.wrongTips = (this.getChild("wrongTips"));
  2747. this.rightTips = (this.getChild("rightTips"));
  2748. this.breathAni = this.getTransition("breathAni");
  2749. }
  2750. }
  2751. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2752. class D2BallSrc extends Laya.Script {
  2753. constructor() {
  2754. super();
  2755. this.number = 0;
  2756. this.startX = 0;
  2757. this.startY = 0;
  2758. this.angleV2 = new Laya.Vector2();
  2759. this.isRootBall = false;
  2760. this.isBlackBall = false;
  2761. this.ballType = "";
  2762. this.canRot = true;
  2763. this.rotY = 0;
  2764. this.poleAngle = 0;
  2765. this.kickPos = { x: 0, y: 0 };
  2766. this.hard = 0;
  2767. this.kickAngle = 0;
  2768. this.borderDis = 0;
  2769. this.speedP10 = 5.6;
  2770. this.lastSpeed = { x: 0, y: 0 };
  2771. this.stillSpeed = 0.12;
  2772. this.ballFunc = "normal";
  2773. this.isRunSkillAni = false;
  2774. this.isInHole = false;
  2775. this.iceOwner = "";
  2776. this.forceRun = false;
  2777. this.myUNID = "";
  2778. this.rectL = 0;
  2779. this.rectR = 0;
  2780. this.rectT = 0;
  2781. this.rectB = 0;
  2782. this.forceVec = new Laya.Vector2();
  2783. this.lastDis = 0;
  2784. this.helpOut = { type: "", x: 0, y: 0 };
  2785. }
  2786. initSelf(number, x, y, d3Ball) {
  2787. if (!this.gameObj)
  2788. this.gameObj = this.owner;
  2789. this.number = number;
  2790. this.startX = x;
  2791. this.startY = y;
  2792. this.d3Ball = d3Ball;
  2793. this.isRootBall = false;
  2794. this.isBlackBall = false;
  2795. this.ballType = "";
  2796. if (number == 0) {
  2797. this.isRootBall = true;
  2798. }
  2799. else if (number == 8) {
  2800. this.isBlackBall = true;
  2801. }
  2802. else {
  2803. if (number <= 7) {
  2804. this.ballType = ballCamp.full;
  2805. }
  2806. else {
  2807. this.ballType = ballCamp.flower;
  2808. }
  2809. }
  2810. this.setInfo();
  2811. this.setD3Ball();
  2812. this.owner["mySrc"] = this;
  2813. this.rigy.linearDamping = 1;
  2814. D2BallSrc._unid++;
  2815. this.myUNID = "d2ball" + D2BallSrc._unid;
  2816. let rect = xGame.common.d2World.borderRect;
  2817. this.rectL = Math.ceil(rect.x) + 20;
  2818. this.rectT = Math.ceil(rect.y) + 20;
  2819. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2820. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2821. }
  2822. setInfo() {
  2823. this.gameObj.x = this.startX;
  2824. this.gameObj.y = this.startY;
  2825. let radius = this.ui.width / 2;
  2826. this.gameObj.width = radius * 2;
  2827. this.gameObj.height = radius * 2;
  2828. if (xGame.common.showDebug) {
  2829. this.ui.myIcon.alpha = 1;
  2830. this.ui.inner.alpha = 1;
  2831. }
  2832. else {
  2833. this.ui.myIcon.alpha = 0;
  2834. this.ui.inner.alpha = 0;
  2835. }
  2836. }
  2837. setD3Ball() {
  2838. this.d3Ball = this.d3Ball;
  2839. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2840. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2841. }
  2842. onUpdate() {
  2843. if (xGame.common.gameMgr.gamePause)
  2844. return;
  2845. if (this.isInHole)
  2846. return;
  2847. if (!xGame.common.d2World.openCheckStill)
  2848. return;
  2849. this.runBall();
  2850. }
  2851. runBall() {
  2852. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2853. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2854. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2855. this.judgeBorder();
  2856. }
  2857. getDestDis(dest) {
  2858. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2859. }
  2860. setmyXY(x, y) {
  2861. this.d3BallSrc.setTransPos(x, y);
  2862. }
  2863. getSpeed() {
  2864. let speed = this.rigy.linearVelocity;
  2865. return speed.x * speed.x + speed.y * speed.y;
  2866. }
  2867. onTriggerEnter(collider) {
  2868. if (!collider || !collider.owner)
  2869. return;
  2870. let coll = "collide";
  2871. let speed = this.getSpeed();
  2872. let sv2 = this.speedP10 * this.speedP10;
  2873. if (collider.label == "ball") {
  2874. if (speed < 9 && this.number != 0)
  2875. coll = "";
  2876. else if (speed < sv2)
  2877. coll = "collide_4";
  2878. else if (speed < sv2 * 6.2)
  2879. coll = "collide_3";
  2880. else if (speed < sv2 * 25)
  2881. coll = "collide_2";
  2882. else if (speed < sv2 * 56)
  2883. coll = "collide_1";
  2884. xGame.soundMgr.playSound(coll);
  2885. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2886. if (collider.owner) {
  2887. let rig = collider.owner.getComponent(D2BallSrc);
  2888. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2889. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2890. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2891. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2892. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2893. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2894. let rx = 0;
  2895. let ry = 0;
  2896. if (this.gameObj.x < this.rectL)
  2897. rx = vx;
  2898. else if (this.gameObj.x > this.rectR)
  2899. rx = -vx;
  2900. else if (this.gameObj.y < this.rectT)
  2901. ry = vy;
  2902. else if (this.gameObj.y > this.rectB)
  2903. ry = -vy;
  2904. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2905. }
  2906. }
  2907. if (this.number != 0) {
  2908. return;
  2909. }
  2910. else {
  2911. if (this.forceRun) {
  2912. console.log("randon force");
  2913. this.applyForce(collider);
  2914. }
  2915. }
  2916. if (xGame.common.d2World.isOnSameLine) {
  2917. xGame.common.d2World.isOnSameLine = false;
  2918. this.rigy.linearVelocity = { x: 0, y: 0 };
  2919. }
  2920. if (xGame.common.gameMgr.firstColliObj == null) {
  2921. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2922. xGame.common.gameMgr.isTouchedBall = true;
  2923. }
  2924. }
  2925. else {
  2926. xGame.common.recoverCameraView();
  2927. let wallStr = "";
  2928. if (speed < 9) { }
  2929. else if (speed < sv2) { }
  2930. else if (speed < sv2 * 6.2)
  2931. wallStr = "wall_30";
  2932. else if (speed < sv2 * 25)
  2933. wallStr = "wall_50";
  2934. else if (speed < sv2 * 56)
  2935. wallStr = "wall_80";
  2936. xGame.soundMgr.playSound(wallStr);
  2937. }
  2938. }
  2939. applyForce(collider) {
  2940. let src = collider.owner.mySrc;
  2941. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  2942. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  2943. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  2944. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  2945. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  2946. }
  2947. checkWrongBall(playEft = true) {
  2948. if (this.isInHole)
  2949. return;
  2950. xGame.common.gameMgr.inHoleBalls.push(this.number);
  2951. if (this.number != 0 && playEft)
  2952. this.d3BallSrc.playInHoleEft();
  2953. let coll = "inpocket_1";
  2954. let speed = this.getSpeed();
  2955. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  2956. if (speed < 9 && this.number != 0)
  2957. coll = "";
  2958. else if (speed < sv2 * 6.2)
  2959. coll = "inpocket_4";
  2960. else if (speed < sv2 * 25)
  2961. coll = "collide_3";
  2962. else if (speed < sv2 * 56)
  2963. coll = "collide_2";
  2964. xGame.soundMgr.playSound(coll);
  2965. this.isInHole = true;
  2966. if (this.number == 0) {
  2967. console.log("白球进了。。");
  2968. this.reset();
  2969. this.rigy.linearVelocity = { x: 0, y: 0 };
  2970. this.hideSelf();
  2971. xGame.common.gameUI.ui.whiteAni.visible = true;
  2972. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  2973. xGame.common.gameUI.ui.whiteAni.visible = false;
  2974. }));
  2975. }
  2976. else {
  2977. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  2978. xGame.common.d2World.removeOneBall(this);
  2979. this.destroySelf();
  2980. xGame.common.playHappySound(this.number);
  2981. this.runFlyEft();
  2982. }
  2983. }
  2984. runFlyEft() {
  2985. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  2986. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  2987. }
  2988. }
  2989. hideSelf() {
  2990. if (this.d3Ball)
  2991. this.d3Ball.active = false;
  2992. }
  2993. showSelf() {
  2994. this.isInHole = false;
  2995. if (this.d3Ball && !this.d3Ball.active)
  2996. this.d3Ball.active = true;
  2997. }
  2998. isStill() {
  2999. let speed = this.rigy.linearVelocity;
  3000. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3001. this.rigy.linearVelocity = { x: 0, y: 0 };
  3002. return true;
  3003. }
  3004. return false;
  3005. }
  3006. reset() {
  3007. }
  3008. destroySelf() {
  3009. this.d3BallSrc.destroySelf();
  3010. if (!this.ui.isDisposed) {
  3011. this.ui.removeFromParent();
  3012. this.ui.dispose();
  3013. this.ui = null;
  3014. }
  3015. this.outColli = null;
  3016. this.innerColli = null;
  3017. this.rigy = null;
  3018. this.d3Ball = null;
  3019. this.d3BallSrc = null;
  3020. this.angleV2 = null;
  3021. this.gameObj.destroy(true);
  3022. this.destroy();
  3023. }
  3024. judgeBorder() {
  3025. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3026. return;
  3027. }
  3028. if (this.destroyed)
  3029. return;
  3030. if (xGame.common.gameMode == GameMode.classic)
  3031. return;
  3032. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3033. if (isOver) {
  3034. this.checkWrongBall();
  3035. }
  3036. }
  3037. onClick(e, force = false) {
  3038. if (this.number == 0)
  3039. return;
  3040. if (force) {
  3041. }
  3042. else {
  3043. if (xGame.common.d2World.openCheckStill)
  3044. return;
  3045. if (!xGame.common.gameMgr.selfTurn) {
  3046. return;
  3047. }
  3048. }
  3049. if (!xGame.common.gameMgr.finishOneShoot)
  3050. return;
  3051. let root = xGame.common.d2World.rootBall.gameObj;
  3052. let x = this.gameObj.x - root.x;
  3053. let y = this.gameObj.y - root.y;
  3054. let angle = xGame.common.getfguiRotation(x, y);
  3055. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3056. xGame.common.d2World.getHelpLine();
  3057. xGame.common.clickedBall = true;
  3058. this.checkGuide();
  3059. }
  3060. checkGuide() {
  3061. let guide = DataMgr.getSkillGuide();
  3062. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3063. xGame.common.guideStep++;
  3064. xGame.common.gameUI.ui.guide1.visible = false;
  3065. xGame.common.gameUI.ui.guide2.visible = true;
  3066. }
  3067. }
  3068. checkDistance(disX, disY, angle) {
  3069. let diameter = this.gameObj.width - 1;
  3070. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3071. if (!this.lastDis)
  3072. this.lastDis = dis;
  3073. else {
  3074. if (dis > this.lastDis) {
  3075. this.helpOut.type = "remove";
  3076. return this.helpOut;
  3077. }
  3078. }
  3079. if (dis <= Math.pow(diameter, 2)) {
  3080. let del = 0.01;
  3081. let offest = 0;
  3082. let realX = disX - this.gameObj.x;
  3083. let realY = disY - this.gameObj.y;
  3084. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3085. offest += del;
  3086. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3087. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3088. }
  3089. this.helpOut.type = "ok";
  3090. this.helpOut.x = realX + this.gameObj.x;
  3091. this.helpOut.y = realY + this.gameObj.y;
  3092. return this.helpOut;
  3093. }
  3094. else {
  3095. this.helpOut.type = "no";
  3096. return this.helpOut;
  3097. }
  3098. }
  3099. clearBallEft() {
  3100. this.clearBallRightEft();
  3101. this.clearBallWrongEft();
  3102. }
  3103. clearBallRightEft() {
  3104. this.ui.breathAni.stop();
  3105. this.ui.rightTips.visible = false;
  3106. }
  3107. clearBallWrongEft() {
  3108. this.ui.wrongTips.visible = false;
  3109. }
  3110. showWrongEft() {
  3111. if (!xGame.common.gameMgr.selfTurn)
  3112. return;
  3113. this.ui.wrongTips.visible = true;
  3114. }
  3115. showRightEft() {
  3116. if (!xGame.common.gameMgr.selfTurn)
  3117. return;
  3118. this.ui.rightTips.visible = true;
  3119. this.ui.rightTips.scaleX = 1;
  3120. this.ui.rightTips.scaleY = 1;
  3121. this.ui.breathAni.play();
  3122. }
  3123. setBallFunc(type, owner) {
  3124. if (type == "ice") {
  3125. this.ballFunc = type;
  3126. this.d3BallSrc.setAlbedoTexture(true);
  3127. this.rigy.type = "static";
  3128. this.iceOwner = owner;
  3129. }
  3130. else {
  3131. if (owner == this.iceOwner) {
  3132. this.ballFunc = type;
  3133. this.d3BallSrc.setAlbedoTexture(false);
  3134. this.rigy.type = "dynamic";
  3135. }
  3136. }
  3137. }
  3138. }
  3139. D2BallSrc._unid = 0;
  3140. class D2RootBallSrc extends D2BallSrc {
  3141. constructor() {
  3142. super();
  3143. this.maxSpeed = 0;
  3144. this.classicMaxSpeed = 2.2;
  3145. this.bigSkillMaxSpeed = 4;
  3146. this.angle = 0;
  3147. this.allPercent = 0;
  3148. this.linearPercent = 0;
  3149. this.anglePercent = 0;
  3150. this.maxAngleRate = 0.6;
  3151. this.baseRot = 7;
  3152. this.angleMax = 0;
  3153. this.speed = new Laya.Vector2();
  3154. this.rotSpeed = new Laya.Vector2();
  3155. }
  3156. isStill() {
  3157. let speed = this.rigy.linearVelocity;
  3158. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3159. if (this.anglePercent <= 0.1) {
  3160. this.rigy.linearVelocity = { x: 0, y: 0 };
  3161. return true;
  3162. }
  3163. }
  3164. return false;
  3165. }
  3166. reset() {
  3167. this.linearPercent = 0;
  3168. this.anglePercent = 0;
  3169. }
  3170. setSpeed(percent, angle) {
  3171. this.allPercent = percent;
  3172. this.angle = angle;
  3173. this.setAngleSpeed();
  3174. this.setLinearSpeed();
  3175. let hit = "hit";
  3176. if (percent < 25)
  3177. hit = "hit03";
  3178. else if (percent < 50)
  3179. hit = "hit02";
  3180. else if (percent < 75)
  3181. hit = "hit01";
  3182. xGame.soundMgr.playSound(hit);
  3183. }
  3184. setAngleSpeed() {
  3185. let offest = xGame.common.rodOffest;
  3186. let radius = 82;
  3187. let rate = Math.abs(offest.y / radius) * 0.5;
  3188. if (offest.y > 0)
  3189. this.angleMax = -this.baseRot * 2;
  3190. else
  3191. this.angleMax = this.baseRot;
  3192. this.rotY = -offest.x / radius * 100;
  3193. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3194. this.linearPercent = this.allPercent - this.anglePercent;
  3195. }
  3196. setLinearSpeed() {
  3197. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3198. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3199. if (!xGame.common.longHelpLine) {
  3200. let offset = -150 + xGame.common.randomNum(0, 300);
  3201. offset /= 100;
  3202. this.angle += offset;
  3203. }
  3204. }
  3205. }
  3206. let sin = Math.sin(this.angle * Math.PI / 180);
  3207. let cos = Math.cos(this.angle * Math.PI / 180);
  3208. switch (xGame.common.gameMode) {
  3209. case GameMode.classic:
  3210. this.maxSpeed = this.classicMaxSpeed;
  3211. break;
  3212. case GameMode.bigMove:
  3213. this.maxSpeed = this.bigSkillMaxSpeed;
  3214. break;
  3215. case GameMode.placeBall:
  3216. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3217. if (data.type == 1) {
  3218. this.maxSpeed = this.bigSkillMaxSpeed;
  3219. }
  3220. else {
  3221. this.maxSpeed = this.classicMaxSpeed;
  3222. }
  3223. break;
  3224. default:
  3225. break;
  3226. }
  3227. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3228. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3229. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3230. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3231. this.rigy.applyLinearImpulseToCenter(this.speed);
  3232. }
  3233. onUpdate() {
  3234. if (this.anglePercent > 0.1) {
  3235. this.anglePercent *= 0.97;
  3236. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3237. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3238. this.rigy.applyForceToCenter(this.rotSpeed);
  3239. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3240. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3241. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3242. if (num > 0.9)
  3243. this.canRot = true;
  3244. }
  3245. else
  3246. this.canRot = true;
  3247. if (Math.abs(this.rotY) > 0.1)
  3248. this.rotY *= 0.98;
  3249. super.onUpdate();
  3250. }
  3251. destroySelf() {
  3252. super.destroySelf();
  3253. this.speed = null;
  3254. }
  3255. }
  3256. class D2Ball extends Laya.Sprite {
  3257. constructor(isRootBall = false) {
  3258. super();
  3259. this.ui = ui_D2Ball.createInstance();
  3260. this.pivotX = this.ui.width / 2;
  3261. this.pivotY = this.ui.width / 2;
  3262. this.x = 0;
  3263. this.y = 0;
  3264. this.addChild(this.ui.displayObject);
  3265. this.ui.displayObject.x += this.ui.width / 2;
  3266. this.ui.displayObject.y += this.ui.width / 2;
  3267. if (isRootBall) {
  3268. this.d2Src = this.addComponent(D2RootBallSrc);
  3269. }
  3270. else {
  3271. this.d2Src = this.addComponent(D2BallSrc);
  3272. }
  3273. this.d2Src.ui = this.ui;
  3274. this.addCircleCollider();
  3275. this.addInnerCircleCollider();
  3276. this.addRigyBody();
  3277. }
  3278. addCircleCollider() {
  3279. let colli = xGame.common.getCollider("circle");
  3280. colli.radius = this.ui.width / 2;
  3281. this.addComponentIntance(colli);
  3282. this.d2Src.outColli = colli;
  3283. colli.label = "ball";
  3284. }
  3285. addInnerCircleCollider() {
  3286. let colli = xGame.common.getCollider("circle");
  3287. colli.radius = this.ui.inner.width / 2;
  3288. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3289. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3290. this.addComponentIntance(colli);
  3291. this.d2Src.innerColli = colli;
  3292. colli.label = "inner";
  3293. }
  3294. addRigyBody() {
  3295. let rigy = xGame.common.getRigbody();
  3296. rigy.type = "dynamic";
  3297. this.addComponentIntance(rigy);
  3298. this.d2Src.rigy = rigy;
  3299. }
  3300. disposeSelf() {
  3301. if (!this.ui.isDisposed) {
  3302. this.ui.dispose();
  3303. this.ui.removeFromParent();
  3304. this.ui = null;
  3305. }
  3306. }
  3307. }
  3308. class ui_D2Gan extends fgui.GComponent {
  3309. static createInstance() {
  3310. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3311. }
  3312. onConstruct() {
  3313. this.myIcon = (this.getChild("myIcon"));
  3314. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3315. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3316. this.self = (this.getChild("self"));
  3317. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3318. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3319. this.ai = (this.getChild("ai"));
  3320. }
  3321. }
  3322. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3323. class D2Gan {
  3324. constructor() {
  3325. this.offset = 0.15;
  3326. this.cell = 1.5;
  3327. this.onBallCell = 0.4;
  3328. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3329. this.moveNum = 70;
  3330. this.rulerRate = 0.1;
  3331. this.ui = ui_D2Gan.createInstance();
  3332. this.changeSelfRod();
  3333. this.changeAIRod();
  3334. }
  3335. changeSelfRod() {
  3336. let index = DataMgr.getCurBallRod();
  3337. let data = cfgTable.ballrodData[index + 1];
  3338. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3339. this.selfMySpine && this.selfMySpine.dispose();
  3340. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3341. if (data.spine) {
  3342. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3343. this.selfMySpine = new SpineMgr(data.spine, () => {
  3344. let xx = this.ui.selfEftRoot.width / 2;
  3345. let yy = this.ui.selfEftRoot.height / 2;
  3346. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3347. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3348. outSpine.rotation = -90;
  3349. });
  3350. }
  3351. }
  3352. changeAIRod() {
  3353. let length = Object.keys(cfgTable.ballrodData).length;
  3354. let rand = Math.floor(length * Math.random()) + 1;
  3355. let data = cfgTable.ballrodData[rand];
  3356. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3357. this.aiMySpine && this.aiMySpine.dispose();
  3358. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3359. if (data.spine) {
  3360. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3361. this.aiMySpine = new SpineMgr(data.spine, () => {
  3362. let xx = this.ui.aiEftRoot.width / 2;
  3363. let yy = this.ui.aiEftRoot.height / 2;
  3364. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3365. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3366. outSpine.rotation = -90;
  3367. });
  3368. }
  3369. }
  3370. setGanLastInfo() {
  3371. this.lastInfo.rotation = this.ui.rotation;
  3372. this.lastInfo.x = this.ui.x;
  3373. this.lastInfo.y = this.ui.y;
  3374. }
  3375. rotateSelf(flag, isRuler = false) {
  3376. let angle;
  3377. flag = flag * this.offset;
  3378. if (xGame.common.d2World.isHelpLineOnBall) {
  3379. angle = flag * this.onBallCell;
  3380. }
  3381. else {
  3382. angle = flag * this.cell;
  3383. }
  3384. if (isRuler) {
  3385. angle *= this.rulerRate;
  3386. }
  3387. this.ui.rotation += angle;
  3388. xGame.common.d2World.getHelpLine();
  3389. }
  3390. checkDistance() {
  3391. let target = xGame.common.d2World.targetBall;
  3392. let root = xGame.common.d2World.rootBall;
  3393. if (target == null) {
  3394. return 1;
  3395. }
  3396. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3397. if (dis <= 2500) {
  3398. return 5;
  3399. }
  3400. return 1;
  3401. }
  3402. rotDest(rot) {
  3403. this.ui.rotation = rot;
  3404. xGame.common.d2World.getHelpLine();
  3405. }
  3406. storagePower(powerNum) {
  3407. let pos = (powerNum / 100) * this.moveNum;
  3408. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3409. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3410. this.ui.x = this.lastInfo.x + xx;
  3411. this.ui.y = this.lastInfo.y + yy;
  3412. }
  3413. shoot() {
  3414. this.storagePower(0);
  3415. this.ui.visible = false;
  3416. }
  3417. destroySelf() {
  3418. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3419. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3420. this.selfMySpine && this.selfMySpine.dispose();
  3421. this.aiMySpine && this.aiMySpine.dispose();
  3422. this.lastInfo = null;
  3423. if (!this.ui.isDisposed) {
  3424. this.ui.removeFromParent();
  3425. this.ui.dispose();
  3426. }
  3427. }
  3428. }
  3429. class ui_HelpLine extends fgui.GComponent {
  3430. static createInstance() {
  3431. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3432. }
  3433. onConstruct() {
  3434. this.n10 = (this.getChild("n10"));
  3435. this.rect = (this.getChild("rect"));
  3436. this.dir11 = (this.getChild("dir11"));
  3437. this.dir = (this.getChild("dir"));
  3438. this.rootDir = (this.getChild("rootDir"));
  3439. this.dirDot = (this.getChild("dirDot"));
  3440. }
  3441. }
  3442. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3443. class D2HelpLine {
  3444. constructor() {
  3445. this.starX = 0;
  3446. this.starY = 0;
  3447. this.ui = ui_HelpLine.createInstance();
  3448. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3449. this.starX = this.ui.rect.x;
  3450. this.starY = this.ui.rect.y;
  3451. }
  3452. shoot() {
  3453. this.ui.visible = false;
  3454. }
  3455. destroySelf() {
  3456. if (this.ui.isDisposed) {
  3457. this.ui.removeFromParent();
  3458. this.ui.dispose();
  3459. }
  3460. }
  3461. }
  3462. class D2World extends Laya.Script {
  3463. constructor() {
  3464. super();
  3465. this.ballArr = [];
  3466. this.openCheckStill = false;
  3467. this.checkArr = [];
  3468. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3469. this.isHelpLineOnBall = false;
  3470. this.isOnSameLine = false;
  3471. this.reflectAngle = 0;
  3472. this.powerPercent = 0;
  3473. this.inHolesSpeed = [];
  3474. this.outDir = new Laya.Vector2();
  3475. this.rootDir = new Laya.Vector2();
  3476. this.aiLv = 0;
  3477. this.rootPos = new Laya.Vector2();
  3478. this.tempDir1 = new Laya.Vector2();
  3479. this.tempDir2 = new Laya.Vector2();
  3480. this.tempDir3 = new Laya.Vector2();
  3481. this.ballSize = 33;
  3482. this.destRot = 0;
  3483. }
  3484. initSelf() {
  3485. this.createBalls();
  3486. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3487. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3488. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3489. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3490. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3491. }
  3492. setBorderRect() {
  3493. let ui = xGame.common.gameUI.ui;
  3494. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3495. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3496. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3497. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3498. this.borderRect.x = starX;
  3499. this.borderRect.y = starY;
  3500. this.borderRect.width = width;
  3501. this.borderRect.height = height;
  3502. }
  3503. resetGame() {
  3504. this.openCheckStill = false;
  3505. let temp;
  3506. for (let index = 0; index < this.ballArr.length; index++) {
  3507. temp = this.ballArr[index];
  3508. temp.destroySelf();
  3509. }
  3510. xGame.common.d3World.ballRoot.destroyChildren();
  3511. xGame.common.gameUI.ui.ballNode.removeChildren();
  3512. console.log("进入摧毁逻辑");
  3513. this.d2Gan.destroySelf();
  3514. this.d2HelpLine.destroySelf();
  3515. this.ballArr = [];
  3516. }
  3517. setD2Gan() {
  3518. let ballNode = this.rootBall.ui;
  3519. let d2Gan = new D2Gan();
  3520. this.d2Gan = d2Gan;
  3521. let ganNode = d2Gan.ui;
  3522. ballNode.addChild(ganNode);
  3523. ganNode.pivotX = ganNode.pivotX;
  3524. ganNode.pivotY = ganNode.pivotY;
  3525. ganNode.x = ganNode.myIcon.width / 2;
  3526. ganNode.y = this.rootBall.gameObj.width;
  3527. d2Gan.setGanLastInfo();
  3528. }
  3529. setHelpLine() {
  3530. let d2Help = new D2HelpLine();
  3531. this.d2HelpLine = d2Help;
  3532. }
  3533. createBalls() {
  3534. let cfg;
  3535. switch (xGame.common.gameMode) {
  3536. case GameMode.classic:
  3537. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3538. break;
  3539. case GameMode.bigMove:
  3540. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3541. break;
  3542. case GameMode.placeBall:
  3543. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3544. break;
  3545. default:
  3546. break;
  3547. }
  3548. cfg = JSON.parse(JSON.stringify(cfg));
  3549. for (const key in cfg) {
  3550. if (cfg[key].value == 0) {
  3551. this.createRootBall(cfg[key]);
  3552. delete cfg[key];
  3553. break;
  3554. }
  3555. }
  3556. this.createOtherBalls(cfg);
  3557. }
  3558. createRootBall(data) {
  3559. let root = new D2Ball(true);
  3560. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3561. this.rootBall = root.d2Src;
  3562. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3563. let d3BallSrc = d3Ball.getComponent(Ball);
  3564. xGame.common.d3World.rootBall = d3Ball;
  3565. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3566. let xx = data.x;
  3567. let yy = data.y;
  3568. let numer = data.value;
  3569. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3570. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3571. this.ballArr.push(this.rootBall);
  3572. this.setD2Gan();
  3573. this.setHelpLine();
  3574. }
  3575. createOtherBalls(cfg) {
  3576. let temp;
  3577. let src;
  3578. let data;
  3579. for (const key in cfg) {
  3580. data = cfg[key];
  3581. temp = new D2Ball();
  3582. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3583. src = temp.d2Src;
  3584. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3585. src.initSelf(data.value, data.x, data.y, d3Ball);
  3586. this.ballArr.push(src);
  3587. }
  3588. }
  3589. shoot(percent) {
  3590. this.powerPercent = percent;
  3591. this.openCheckStill = true;
  3592. let d2Angle = this.d2Gan.ui.rotation;
  3593. this.rootBall.setSpeed(percent, d2Angle);
  3594. this.clearBallAllEft();
  3595. this.changePlayerView();
  3596. }
  3597. onUpdate() {
  3598. if (!this.openCheckStill)
  3599. return;
  3600. this.checkStill();
  3601. }
  3602. checkStill() {
  3603. for (let index = 0; index < this.ballArr.length; index++) {
  3604. if (!this.ballArr[index].isStill()) {
  3605. return;
  3606. }
  3607. }
  3608. xGame.eventMgr.event(ALL_BALL_STOP);
  3609. }
  3610. allBallStop() {
  3611. this.openCheckStill = false;
  3612. xGame.common.recoverCameraView();
  3613. }
  3614. waitShoot() {
  3615. if (!this.d2Gan.ui.isDisposed) {
  3616. this.d2Gan.ui.visible = true;
  3617. }
  3618. if (!this.d2HelpLine.ui.isDisposed) {
  3619. this.d2HelpLine.ui.visible = true;
  3620. }
  3621. this.clearBallAllEft();
  3622. this.showBallRightEft();
  3623. this.getHelpLine();
  3624. this.inHolesSpeed = [];
  3625. this.selectOneBall();
  3626. }
  3627. _getAllBallArr() {
  3628. let arr = this.ballArr;
  3629. let outArr = [];
  3630. for (let index = 0; index < arr.length; index++) {
  3631. if (arr[index] instanceof D2RootBallSrc)
  3632. continue;
  3633. if (arr[index].ballFunc == "ice")
  3634. continue;
  3635. if (arr[index].destroyed)
  3636. continue;
  3637. outArr.push(arr[index]);
  3638. }
  3639. return outArr;
  3640. }
  3641. _getBlackObj() {
  3642. let arr = this.ballArr;
  3643. for (let index = 0; index < arr.length; index++) {
  3644. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3645. return arr[index];
  3646. }
  3647. }
  3648. }
  3649. selectOneBall() {
  3650. let all = this._getAllBallArr();
  3651. let target;
  3652. switch (xGame.common.gameMode) {
  3653. case GameMode.classic:
  3654. if (xGame.common.gameMgr.selfTurn) {
  3655. let self = xGame.common.gameMgr.selfBallArr;
  3656. let black = this._getBlackObj();
  3657. if (xGame.common.gameMgr.ensureBallType) {
  3658. if (self.length > 0) {
  3659. let out = [];
  3660. for (let j = 0; j < all.length; j++) {
  3661. if (self.indexOf(all[j].number) > -1) {
  3662. out.push(all[j]);
  3663. }
  3664. }
  3665. target = this.selectBestEnterOne(out);
  3666. }
  3667. else {
  3668. target = this.selectBestEnterOne([black]);
  3669. }
  3670. }
  3671. else {
  3672. target = this.selectBestEnterOne(all);
  3673. }
  3674. }
  3675. else {
  3676. target = this.selectBestEnterOne(all);
  3677. }
  3678. break;
  3679. case GameMode.bigMove:
  3680. target = this.selectBestEnterOne(all);
  3681. break;
  3682. case GameMode.placeBall:
  3683. if (all.length > 0) {
  3684. target = this.selectBestEnterOne(all);
  3685. }
  3686. break;
  3687. default:
  3688. break;
  3689. }
  3690. if (target && !target.destroyed && target.onClick) {
  3691. target.onClick(0, true);
  3692. let num = -200 + xGame.common.randomNum(0, 400);
  3693. num /= 150;
  3694. if (xGame.common.longHelpLine) {
  3695. num = 0;
  3696. }
  3697. this.destRot += num;
  3698. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3699. }
  3700. }
  3701. removeOneBall(ball) {
  3702. for (let index = 0; index < this.ballArr.length; index++) {
  3703. if (this.ballArr[index].id == ball.id) {
  3704. this.ballArr.splice(index, 1);
  3705. break;
  3706. }
  3707. }
  3708. }
  3709. getHelpLine() {
  3710. this.d2HelpLine.ui.dirDot.visible = false;
  3711. this.isOnSameLine = false;
  3712. let startX = this.rootBall.gameObj.x;
  3713. let startY = this.rootBall.gameObj.y;
  3714. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3715. if (dis == null) {
  3716. this.d2HelpLine.ui.visible = false;
  3717. console.error("辅助线异常");
  3718. return;
  3719. }
  3720. this.d2HelpLine.ui.visible = true;
  3721. let angle = this.d2Gan.ui.rotation;
  3722. let radius = 16.5;
  3723. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3724. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3725. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3726. if (colliObj == null) {
  3727. this.getColliPos(disX, disY, radius, angle);
  3728. xGame.common.d2World.isHelpLineOnBall = false;
  3729. this.targetBall = null;
  3730. this.reflectAngle = 0;
  3731. this.showBallWrongEft();
  3732. }
  3733. else {
  3734. let target = colliObj.src;
  3735. let radius = 16.5;
  3736. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3737. dis1 = Math.sqrt(dis1);
  3738. let realDis = colliObj.disHon - dis1;
  3739. let dir = colliObj.dir;
  3740. let xx = startX + dir.x * realDis;
  3741. let yy = startY + dir.y * realDis;
  3742. this.getColliPos(xx, yy, radius, angle);
  3743. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3744. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3745. let offset = xGame.common.rodOffest;
  3746. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3747. this.isOnSameLine = true;
  3748. }
  3749. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3750. xGame.common.d2World.isHelpLineOnBall = true;
  3751. this.targetBall = target;
  3752. this.reflectAngle = reflectAngle;
  3753. this.showBallWrongEft();
  3754. if (xGame.common.longHelpLine) {
  3755. this.delayReflectLine(target, reflectAngle);
  3756. }
  3757. }
  3758. }
  3759. getBorderDot(startX, startY, angle) {
  3760. let radius = 17;
  3761. let distance;
  3762. let isDone;
  3763. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3764. isDone = this.judgeUpDown(distance, angle, startX);
  3765. if (isDone != null) {
  3766. return isDone;
  3767. }
  3768. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3769. isDone = this.judgeUpDown(distance, angle, startX);
  3770. if (isDone != null) {
  3771. return isDone;
  3772. }
  3773. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3774. isDone = this.judgeLeftRight(distance, angle, startY);
  3775. if (isDone != null) {
  3776. return isDone;
  3777. }
  3778. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3779. isDone = this.judgeLeftRight(distance, angle, startY);
  3780. if (isDone != null) {
  3781. return isDone;
  3782. }
  3783. }
  3784. judgeUpDown(distance, angle, startX) {
  3785. let flag = Math.sin(angle * Math.PI / 180);
  3786. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3787. if (distance >= 0) {
  3788. if (flag > 0) {
  3789. if (temp < this.borderRect.x + this.borderRect.width) {
  3790. return distance;
  3791. }
  3792. }
  3793. else {
  3794. if (temp > this.borderRect.x) {
  3795. return distance;
  3796. }
  3797. }
  3798. }
  3799. }
  3800. judgeLeftRight(distance, angle, starY) {
  3801. let flag = -Math.cos(angle * Math.PI / 180);
  3802. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3803. if (distance >= 0) {
  3804. if (flag > 0) {
  3805. if (temp < this.borderRect.y + this.borderRect.height) {
  3806. return distance;
  3807. }
  3808. }
  3809. else {
  3810. if (temp > this.borderRect.y) {
  3811. return distance;
  3812. }
  3813. }
  3814. }
  3815. }
  3816. clearBallAllEft() {
  3817. let temp;
  3818. for (let index = 0; index < this.ballArr.length; index++) {
  3819. temp = this.ballArr[index];
  3820. temp.clearBallEft();
  3821. }
  3822. }
  3823. showBallRightEft() {
  3824. let gameMgr = xGame.common.gameMgr;
  3825. let temp;
  3826. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3827. if (targetArr.length <= 0)
  3828. return;
  3829. for (let index = 0; index < this.ballArr.length; index++) {
  3830. temp = this.ballArr[index];
  3831. if (targetArr.indexOf(temp.number) > -1) {
  3832. temp.showRightEft();
  3833. }
  3834. }
  3835. }
  3836. showBallWrongEft() {
  3837. let gameMgr = xGame.common.gameMgr;
  3838. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3839. if (targetArr.length <= 0)
  3840. return;
  3841. let temp;
  3842. for (let index = 0; index < this.ballArr.length; index++) {
  3843. temp = this.ballArr[index];
  3844. if (this.targetBall && this.targetBall.number == temp.number) {
  3845. if (targetArr.indexOf(temp.number) <= -1) {
  3846. temp.showWrongEft();
  3847. }
  3848. else {
  3849. temp.clearBallWrongEft();
  3850. }
  3851. }
  3852. else {
  3853. temp.clearBallWrongEft();
  3854. }
  3855. }
  3856. }
  3857. getColliPos(x, y, radius, angle) {
  3858. this.d2HelpLine.ui.x = x;
  3859. this.d2HelpLine.ui.y = y;
  3860. let dirX = x - this.rootBall.gameObj.x;
  3861. let dirY = y - this.rootBall.gameObj.y;
  3862. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3863. if (rectH <= 0)
  3864. rectH = 0;
  3865. this.d2HelpLine.ui.rect.height = 0;
  3866. this.d2HelpLine.ui.rect.height = rectH;
  3867. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3868. if (rectH < this.rootBall.gameObj.width) {
  3869. this.d2HelpLine.ui.rect.visible = false;
  3870. }
  3871. else {
  3872. this.d2HelpLine.ui.rect.visible = true;
  3873. }
  3874. this.d2HelpLine.ui.dir.visible = false;
  3875. this.d2HelpLine.ui.rootDir.visible = false;
  3876. }
  3877. getReflectLine(x, y, radius, target) {
  3878. this.d2HelpLine.ui.dir.visible = true;
  3879. let dirX = target.x - x;
  3880. let dirY = target.y - y;
  3881. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3882. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3883. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3884. this.d2HelpLine.ui.dir.height = 48;
  3885. this.d2HelpLine.ui.dir.rotation = angle;
  3886. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3887. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3888. return angle;
  3889. }
  3890. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3891. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3892. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3893. let targetX = target.gameObj.x;
  3894. let targetY = target.gameObj.y;
  3895. this.outDir.setValue(targetX - xx, targetY - yy);
  3896. this.rootDir.setValue(rtX - xx, rtY - yy);
  3897. let ver = Math.PI / 2;
  3898. let sin = Math.sin(ver);
  3899. let cos = Math.cos(ver);
  3900. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3901. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3902. this.outDir.setValue(outX, outY);
  3903. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3904. Laya.Vector2.normalize(this.outDir, this.outDir);
  3905. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3906. if (Math.abs(result) <= 0.08) {
  3907. this.d2HelpLine.ui.rootDir.visible = false;
  3908. return;
  3909. }
  3910. if (result > 0) {
  3911. angle += 90;
  3912. }
  3913. else if (result < 0) {
  3914. angle -= 90;
  3915. }
  3916. this.d2HelpLine.ui.rootDir.visible = true;
  3917. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3918. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3919. this.d2HelpLine.ui.rootDir.rotation = angle;
  3920. }
  3921. delayReflectLine(obj, angle) {
  3922. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3923. return;
  3924. }
  3925. this.isOnSameLine = false;
  3926. let startX = obj.gameObj.x;
  3927. let startY = obj.gameObj.y;
  3928. let dis = this.getBorderDot(startX, startY, angle);
  3929. if (dis == null) {
  3930. this.d2HelpLine.ui.dirDot.visible = false;
  3931. return;
  3932. }
  3933. this.d2HelpLine.ui.visible = true;
  3934. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3935. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3936. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  3937. if (colliObj == null) {
  3938. this.setDelayLine(disX, disY, obj, angle);
  3939. }
  3940. else {
  3941. let radius = 16;
  3942. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3943. dis1 = Math.sqrt(dis1);
  3944. let realDis = colliObj.disHon - dis1;
  3945. let dir = colliObj.dir;
  3946. let xx = startX + dir.x * realDis;
  3947. let yy = startY + dir.y * realDis;
  3948. this.setDelayLine(xx, yy, obj, angle);
  3949. }
  3950. }
  3951. setDelayLine(x, y, obj, angle) {
  3952. let dirX = x - obj.gameObj.x;
  3953. let dirY = y - obj.gameObj.y;
  3954. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3955. if (rectH <= 0)
  3956. rectH = 0;
  3957. this.d2HelpLine.ui.dir.height = rectH;
  3958. this.d2HelpLine.ui.dirDot.visible = true;
  3959. this.d2HelpLine.ui.dirDot.x = 17;
  3960. this.d2HelpLine.ui.dirDot.y = 17;
  3961. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  3962. ;
  3963. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  3964. }
  3965. changePlayerView() {
  3966. if (Math.random() >= 0.7)
  3967. return;
  3968. if (!this.targetBall) {
  3969. return;
  3970. }
  3971. if (!xGame.common.gameMgr.selfTurn)
  3972. return;
  3973. switch (xGame.common.gameMode) {
  3974. case GameMode.classic:
  3975. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  3976. if (this.targetBall.number != 8) {
  3977. return;
  3978. }
  3979. }
  3980. break;
  3981. case GameMode.bigMove:
  3982. return;
  3983. case GameMode.placeBall:
  3984. break;
  3985. default:
  3986. break;
  3987. }
  3988. let startX = this.targetBall.gameObj.x;
  3989. let startY = this.targetBall.gameObj.y;
  3990. let angle = this.reflectAngle;
  3991. let dis = this.getBorderDot(startX, startY, angle);
  3992. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3993. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3994. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  3995. if (colliObj) {
  3996. return;
  3997. }
  3998. let offset = 40;
  3999. let posObj = xGame.common.gameMgr.posObj;
  4000. let temp;
  4001. let radius;
  4002. let tarX, tarY;
  4003. for (const key in posObj) {
  4004. temp = posObj[key];
  4005. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4006. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4007. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4008. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4009. xGame.common.showOneCamera("angle" + key);
  4010. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4011. Laya.physicsTimer.scale = 0.7;
  4012. break;
  4013. }
  4014. }
  4015. }
  4016. selectBestEnterOne(arr) {
  4017. this.aiLv = xGame.tools.random(1, 11);
  4018. this.aiLv = 10;
  4019. this.wBall = xGame.common.d2World.rootBall;
  4020. this.rootPos.x = this.wBall.gameObj.x;
  4021. this.rootPos.y = this.wBall.gameObj.y;
  4022. this.initHoleBall(arr);
  4023. return this.selectBall();
  4024. }
  4025. selectBall() {
  4026. let ball = null;
  4027. this.destRot = 0;
  4028. let ai = 110 - this.aiLv * 10;
  4029. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4030. let score = false;
  4031. if (this.scoreBall.length < 1) {
  4032. if (this.lineBall.length < 1) {
  4033. for (let i = 0; i < this.kickBall.length; i++) {
  4034. let list = [];
  4035. let bo = this.kickBall[i];
  4036. let bobj = bo.gameObj;
  4037. let rect = xGame.common.d2World.borderRect;
  4038. let mobj = this.wBall.gameObj;
  4039. let minb = bobj.y - rect.y - 20;
  4040. let minw = mobj.y - rect.y - 50;
  4041. if (minb > 0 && minw > 0) {
  4042. let dlenx = 0;
  4043. let dleny = mobj.y - rect.y;
  4044. let spx = mobj.x;
  4045. let spy = rect.y - dleny;
  4046. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4047. }
  4048. minb = rect.y + rect.height - bobj.y - 20;
  4049. minw = rect.y + rect.height - mobj.y - 50;
  4050. if (minb > 0 && minw > 0) {
  4051. let dlenx = 0;
  4052. let dleny = rect.y + rect.height - mobj.y;
  4053. let spx = mobj.x;
  4054. let spy = rect.y + rect.height + dleny;
  4055. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4056. }
  4057. minb = bobj.x - rect.x - 20;
  4058. minw = mobj.x - rect.x - 50;
  4059. if (minb > 0 && minw > 0) {
  4060. let dlenx = mobj.x - rect.x;
  4061. let dleny = 0;
  4062. let spx = rect.x - dlenx;
  4063. let spy = mobj.y;
  4064. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4065. }
  4066. minb = rect.x + rect.width - bobj.x - 20;
  4067. minw = rect.x + rect.width - mobj.x - 50;
  4068. if (minb > 0 && minw > 0) {
  4069. let dlenx = rect.x + rect.width - mobj.x;
  4070. let dleny = 0;
  4071. let spx = rect.x + rect.width + dlenx;
  4072. let spy = mobj.y;
  4073. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4074. }
  4075. list.sort(function (a, b) {
  4076. return a.order - b.order;
  4077. });
  4078. for (let i = 0; i < list.length; i++) {
  4079. let data = list[i];
  4080. let mx = mobj.x - bobj.x;
  4081. let my = mobj.y - bobj.y;
  4082. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4083. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4084. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4085. if (num > 1)
  4086. num = 1;
  4087. let cos = Math.acos(num);
  4088. if (cos > 1.57)
  4089. cos = 1.57;
  4090. else if (cos < 0.01)
  4091. cos = 0.01;
  4092. let tan = Math.tan(cos);
  4093. let dx = tan * data.dleny;
  4094. let dy = tan * data.dlenx;
  4095. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4096. if (Math.abs(bx - 667) < 40)
  4097. continue;
  4098. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4099. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4100. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4101. this.forceMax = dis * 0.08;
  4102. this.destRot += mis * 0.1;
  4103. this.setKick(bx, by);
  4104. return true;
  4105. }
  4106. }
  4107. }
  4108. }
  4109. else {
  4110. ball = xGame.common.getRandArrEle(this.lineBall);
  4111. }
  4112. }
  4113. else {
  4114. for (let i = 0; i < this.scoreBall.length; i++) {
  4115. if (i < this.scoreBall.length - 1) {
  4116. let rand = 70 + this.aiLv * 10 + i * 10;
  4117. if (xGame.tools.random(0, 100) < rand) {
  4118. ball = this.scoreBall[i];
  4119. break;
  4120. }
  4121. }
  4122. else {
  4123. ball = this.scoreBall[i];
  4124. break;
  4125. }
  4126. }
  4127. score = true;
  4128. this.selectNum++;
  4129. }
  4130. if (!ball)
  4131. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4132. let dx = ball.gameObj.x;
  4133. let dy = ball.gameObj.y;
  4134. let kickAngle = 0;
  4135. if (score) {
  4136. dx = ball.kickPos.x;
  4137. dy = ball.kickPos.y;
  4138. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4139. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4140. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4141. if (adot > 1)
  4142. adot = 1;
  4143. kickAngle = Math.acos(adot) * 57.3;
  4144. if (kickAngle > 45) {
  4145. let kdx = ball.kickPos.x - ball.gameObj.x;
  4146. let kdy = ball.kickPos.y - ball.gameObj.y;
  4147. dx = ball.kickPos.x - kdx * mis * 0.3;
  4148. dy = ball.kickPos.y - kdy * mis * 0.3;
  4149. }
  4150. else
  4151. this.destRot += mis;
  4152. }
  4153. else if (ball.poleAngle != 0) {
  4154. this.destRot += ball.poleAngle;
  4155. }
  4156. if (xGame.common.gameMode == 0) {
  4157. let af = kickAngle * 0.08;
  4158. this.forceMax = ball.hard * 0.1 + af * af;
  4159. }
  4160. this.setKick(dx, dy);
  4161. return ball;
  4162. }
  4163. initHoleBall(arr) {
  4164. this.kickBall = [];
  4165. this.lineBall = [];
  4166. this.scoreBall = [];
  4167. this.holeBall = [];
  4168. this.selectNum = 0;
  4169. this.forceNum = 0;
  4170. this.forceMax = 0;
  4171. this.turnNum = 0;
  4172. let list = arr;
  4173. let holes = xGame.common.gameMgr.holePosList;
  4174. let self = xGame.common.aiPlayer;
  4175. for (let i = 0; i < list.length; i++) {
  4176. let obj = list[i];
  4177. if (!obj)
  4178. continue;
  4179. obj.kickPos.x = 0;
  4180. obj.kickPos.y = 0;
  4181. obj.poleAngle = 0;
  4182. obj.hard = 0;
  4183. obj.borderDis = 0;
  4184. obj.kickAngle = 180;
  4185. let b = obj.gameObj;
  4186. let wbp = this.rootPos;
  4187. let bx = wbp.x - b.x;
  4188. let by = wbp.y - b.y;
  4189. obj.borderDis = xGame.tools.random(0, 100);
  4190. this.kickBall.push(obj);
  4191. if (!this.isLine(wbp, obj))
  4192. continue;
  4193. obj.kickAngle = xGame.tools.random(90, 180);
  4194. obj.kickPos.x = b.x;
  4195. obj.kickPos.y = b.y;
  4196. this.lineBall.push(obj);
  4197. let minDis = 999999;
  4198. let hole = false;
  4199. for (let j = 0; j < holes.length; j++) {
  4200. let hp = holes[j];
  4201. if (bx >= 0 && hp.x > b.x + 100)
  4202. continue;
  4203. if (bx <= 0 && hp.x < b.x - 100)
  4204. continue;
  4205. if (by < -10 && hp.y < wbp.y)
  4206. continue;
  4207. if (by > 10 && hp.y > wbp.y)
  4208. continue;
  4209. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4210. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4211. if (dis < minDis) {
  4212. let dx = b.x - this.tempDir1.x * this.ballSize;
  4213. let dy = b.y - this.tempDir1.y * this.ballSize;
  4214. this.tempDir3.x = this.tempDir1.x;
  4215. this.tempDir3.y = this.tempDir1.y;
  4216. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4217. obj.kickPos.x = dx;
  4218. obj.kickPos.y = dy;
  4219. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4220. if (num > 1)
  4221. num = 1;
  4222. obj.kickAngle = Math.acos(num) * 57.3;
  4223. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4224. dis = dis * 2;
  4225. if (Math.abs(hp.x - 600) < 100)
  4226. dis += 50;
  4227. obj.hard = dis + obj.kickAngle * 3;
  4228. hole = true;
  4229. }
  4230. }
  4231. }
  4232. }
  4233. if (hole) {
  4234. this.scoreBall.push(obj);
  4235. this.holeBall.push(obj);
  4236. }
  4237. }
  4238. this.scoreBall.sort(function (a, b) {
  4239. return a.hard - b.hard;
  4240. });
  4241. this.holeBall.sort(function (a, b) {
  4242. return a.kickAngle - b.kickAngle;
  4243. });
  4244. this.kickBall.sort(function (a, b) {
  4245. return a.borderDis - b.borderDis;
  4246. });
  4247. }
  4248. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4249. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4250. let balls = xGame.common.d2World.ballArr;
  4251. let max = xGame.tools.getDis(hx, hy, bx, by);
  4252. for (let index = 0; index < balls.length; index++) {
  4253. let obj = balls[index];
  4254. if (obj.number == 0)
  4255. continue;
  4256. if (obj.number == bn || obj.number == dn)
  4257. continue;
  4258. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4259. if (dis * dis > max)
  4260. continue;
  4261. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4262. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4263. if (num > 1)
  4264. num = 1;
  4265. if (num < 0)
  4266. continue;
  4267. let gap = Math.sin(Math.acos(num)) * dis;
  4268. if (gap < this.ballSize)
  4269. return true;
  4270. }
  4271. return false;
  4272. }
  4273. isLine(xy, ball) {
  4274. let bx = xy.x;
  4275. let by = xy.y;
  4276. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4277. let dis = ball.getDestDis(xy);
  4278. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4279. let sin = Math.sin(angle);
  4280. let cos = Math.cos(angle);
  4281. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4282. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4283. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4284. let dx = bx + this.tempDir2.x * dis;
  4285. let dy = by + this.tempDir2.y * dis;
  4286. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4287. sin = Math.sin(-angle);
  4288. cos = Math.cos(-angle);
  4289. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4290. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4291. dx = bx + this.tempDir2.x * dis;
  4292. dy = by + this.tempDir2.y * dis;
  4293. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4294. if (isr && isl)
  4295. return false;
  4296. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4297. }
  4298. return true;
  4299. }
  4300. setKick(dx, dy) {
  4301. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4302. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4303. this.tempDir1.x = 0;
  4304. this.tempDir1.y = 1;
  4305. this.tempDir2.y = -this.tempDir2.y;
  4306. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4307. if (num > 1)
  4308. num = 1;
  4309. let rot = Math.acos(num) * 57.3;
  4310. if (this.tempDir2.x < 0)
  4311. rot = 360 - rot;
  4312. this.destRot += rot;
  4313. }
  4314. }
  4315. class ui_UIGame extends fgui.GComponent {
  4316. static createInstance() {
  4317. return (fgui.UIPackage.createObject("game", "UIGame"));
  4318. }
  4319. onConstruct() {
  4320. this.c1 = this.getController("c1");
  4321. this.d3Root = (this.getChild("d3Root"));
  4322. this.clickNode = (this.getChild("clickNode"));
  4323. this.d2Root = (this.getChild("d2Root"));
  4324. this.topNode = (this.getChild("topNode"));
  4325. this.n72 = (this.getChild("n72"));
  4326. this.n40 = (this.getChild("n40"));
  4327. this.rulerNode = (this.getChild("rulerNode"));
  4328. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4329. this.n50 = (this.getChild("n50"));
  4330. this.keduNode = (this.getChild("keduNode"));
  4331. this.powerTxt = (this.getChild("powerTxt"));
  4332. this.powerNode = (this.getChild("powerNode"));
  4333. this.colorNode = (this.getChild("colorNode"));
  4334. this.powerEft = (this.getChild("powerEft"));
  4335. this.myPowerNode = (this.getChild("myPowerNode"));
  4336. this.ganNode = (this.getChild("ganNode"));
  4337. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4338. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4339. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4340. this.skillRod = (this.getChild("skillRod"));
  4341. this.border = (this.getChild("border"));
  4342. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4343. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4344. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4345. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4346. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4347. this.guanyuNode = (this.getChild("guanyuNode"));
  4348. this.helpBtn = (this.getChild("helpBtn"));
  4349. this.wordsBtn = (this.getChild("wordsBtn"));
  4350. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4351. this.returnBtn = (this.getChild("returnBtn"));
  4352. this.ballNode = (this.getChild("ballNode"));
  4353. this.whiteAni = (this.getChild("whiteAni"));
  4354. this.blackAni = (this.getChild("blackAni"));
  4355. this.selfTurn = (this.getChild("selfTurn"));
  4356. this.aiTurn = (this.getChild("aiTurn"));
  4357. this.deskNode = (this.getChild("deskNode"));
  4358. this.moveNode = (this.getChild("moveNode"));
  4359. this.selfTalk = (this.getChild("selfTalk"));
  4360. this.aiTalk = (this.getChild("aiTalk"));
  4361. this.d2Node = (this.getChild("d2Node"));
  4362. this.snowNode = (this.getChild("snowNode"));
  4363. this.guide2 = (this.getChild("guide2"));
  4364. this.guide1 = (this.getChild("guide1"));
  4365. this.guide3 = (this.getChild("guide3"));
  4366. this.guideNode = (this.getChild("guideNode"));
  4367. }
  4368. }
  4369. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4370. class ui_UIGameEnd extends fgui.GComponent {
  4371. static createInstance() {
  4372. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4373. }
  4374. onConstruct() {
  4375. this.c1 = this.getController("c1");
  4376. this.n22 = (this.getChild("n22"));
  4377. this.n2 = (this.getChild("n2"));
  4378. this.n52 = (this.getChild("n52"));
  4379. this.n53 = (this.getChild("n53"));
  4380. this.coinNode = (this.getChild("coinNode"));
  4381. this.closeNode = (this.getChild("closeNode"));
  4382. this.moneyNode = (this.getChild("moneyNode"));
  4383. this.secretary = (this.getChild("secretary"));
  4384. this.n27 = (this.getChild("n27"));
  4385. this.n29 = (this.getChild("n29"));
  4386. this.talkNode = (this.getChild("talkNode"));
  4387. this.n38 = (this.getChild("n38"));
  4388. this.n39 = (this.getChild("n39"));
  4389. this.n40 = (this.getChild("n40"));
  4390. this.awardNode = (this.getChild("awardNode"));
  4391. this.starNumNode = (this.getChild("starNumNode"));
  4392. this.n47 = (this.getChild("n47"));
  4393. this.conditionNode = (this.getChild("conditionNode"));
  4394. this.isGetAward = (this.getChild("isGetAward"));
  4395. this.leftBtn = (this.getChild("leftBtn"));
  4396. this.rightBtn = (this.getChild("rightBtn"));
  4397. this.btnNode = (this.getChild("btnNode"));
  4398. }
  4399. }
  4400. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4401. class ui_UIAddCoin extends fgui.GComponent {
  4402. static createInstance() {
  4403. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4404. }
  4405. onConstruct() {
  4406. this.n11 = (this.getChild("n11"));
  4407. this.myNode = (this.getChild("myNode"));
  4408. this.t0 = this.getTransition("t0");
  4409. }
  4410. }
  4411. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4412. class UIAddCoin extends UIBase {
  4413. constructor() {
  4414. super();
  4415. this.coinNum = 2000;
  4416. }
  4417. onConstructor() {
  4418. this.ui = ui_UIAddCoin.createInstance();
  4419. this.contentPane = this.ui;
  4420. this.isEject = false;
  4421. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4422. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4423. }
  4424. show() {
  4425. super.show();
  4426. this.ui.t0.play();
  4427. }
  4428. videoAddCoin() {
  4429. console.log('zh:qjff_AD_for_UIAddCoin');
  4430. if (Laya.Browser.onAndroid) {
  4431. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4432. if (!boo) {
  4433. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4434. return;
  4435. }
  4436. }
  4437. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4438. }
  4439. else {
  4440. console.log('zh:AD 失败,直接发放奖励');
  4441. this.qjff_AD_for_UIAddCoin();
  4442. }
  4443. }
  4444. qjff_AD_for_UIAddCoin() {
  4445. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4446. this.hide();
  4447. }
  4448. }
  4449. UIAddCoin.uiName = "UIAddCoin";
  4450. class ui_UIInvitation extends fgui.GComponent {
  4451. static createInstance() {
  4452. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4453. }
  4454. onConstruct() {
  4455. this.n14 = (this.getChild("n14"));
  4456. this.myNode = (this.getChild("myNode"));
  4457. this.t0 = this.getTransition("t0");
  4458. }
  4459. }
  4460. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4461. class UIInvitation extends UIBase {
  4462. constructor() {
  4463. super();
  4464. }
  4465. onConstructor() {
  4466. this.ui = ui_UIInvitation.createInstance();
  4467. this.contentPane = this.ui;
  4468. this.isEject = false;
  4469. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4470. }
  4471. show() {
  4472. super.show();
  4473. }
  4474. enterGame() {
  4475. xGame.common.gameMode = GameMode.classic;
  4476. DataMgr.setChallengeTimes(1);
  4477. xGame.common.passAwardCoin = 2000;
  4478. let need = xGame.common.classicNiceNeddCoin;
  4479. if (DataMgr.coinEnough(need)) {
  4480. DataMgr.setCoin(-need);
  4481. xGame.eventMgr.event(RESTART_GAME, true);
  4482. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4483. }
  4484. else {
  4485. xGame.eventMgr.event(RESTART_GAME, true);
  4486. }
  4487. this.hide();
  4488. }
  4489. hide() {
  4490. super.hide();
  4491. }
  4492. }
  4493. UIInvitation.uiName = "UIInvitation";
  4494. class ui_UIMain extends fgui.GComponent {
  4495. static createInstance() {
  4496. return (fgui.UIPackage.createObject("game", "UIMain"));
  4497. }
  4498. onConstruct() {
  4499. this.n47 = (this.getChild("n47"));
  4500. this.n10 = (this.getChild("n10"));
  4501. this.secretary = (this.getChild("secretary"));
  4502. this.shopBtn = (this.getChild("shopBtn"));
  4503. this.moneyNode = (this.getChild("moneyNode"));
  4504. this.headNode = (this.getChild("headNode"));
  4505. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4506. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4507. this.classicBtn = (this.getChild("classicBtn"));
  4508. this.globalBtn = (this.getChild("globalBtn"));
  4509. this.n44 = (this.getChild("n44"));
  4510. this.signBtn = (this.getChild("signBtn"));
  4511. this.drawBtn = (this.getChild("drawBtn"));
  4512. this.settingNode = (this.getChild("settingNode"));
  4513. this.n45 = (this.getChild("n45"));
  4514. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4515. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4516. this.rankBtn = (this.getChild("rankBtn"));
  4517. this.n46 = (this.getChild("n46"));
  4518. this.liucheng1 = (this.getChild("liucheng1"));
  4519. this.rightBtn = (this.getChild("rightBtn"));
  4520. this.n75 = (this.getChild("n75"));
  4521. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4522. this.liucheng2 = (this.getChild("liucheng2"));
  4523. this.guideBtn = (this.getChild("guideBtn"));
  4524. this.n73 = (this.getChild("n73"));
  4525. this.wordsNode = (this.getChild("wordsNode"));
  4526. this.enterGuide = (this.getChild("enterGuide"));
  4527. this.talkNode = (this.getChild("talkNode"));
  4528. this.n83 = (this.getChild("n83"));
  4529. this.n84 = (this.getChild("n84"));
  4530. this.n_Logout = (this.getChild("n_Logout"));
  4531. this.n_zhuCe = (this.getChild("n_zhuCe"));
  4532. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4533. this.n_dengLu = (this.getChild("n_dengLu"));
  4534. }
  4535. }
  4536. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4537. class ui_UIMoyu extends fgui.GComponent {
  4538. static createInstance() {
  4539. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4540. }
  4541. onConstruct() {
  4542. this.ageTip = (this.getChild("ageTip"));
  4543. this.mainBg = (this.getChild("mainBg"));
  4544. this.xyNode = (this.getChild("xyNode"));
  4545. this.rnNode = (this.getChild("rnNode"));
  4546. this.fcmNode = (this.getChild("fcmNode"));
  4547. this.ageNode = (this.getChild("ageNode"));
  4548. this.tipNode = (this.getChild("tipNode"));
  4549. this.msgNode = (this.getChild("msgNode"));
  4550. }
  4551. }
  4552. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4553. class MoyuMgr {
  4554. static initMoyu() {
  4555. this.moyuView = new MoyuView();
  4556. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4557. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4558. this.moyuView.ui.displayObject.zOrder = 1000;
  4559. this.moyuView.init();
  4560. this.moyuView.showTip(true);
  4561. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4562. window['XApk'] = this;
  4563. }
  4564. static showAge(show) {
  4565. if (this.moyuView)
  4566. this.moyuView.showAge(show);
  4567. }
  4568. static onPlatMsg(idx) {
  4569. if (!MoyuMgr.moyuView)
  4570. return;
  4571. if (idx == '0') {
  4572. MoyuMgr.moyuView.showTip(false);
  4573. }
  4574. }
  4575. static showAgree(call) {
  4576. if (this.moyuView)
  4577. this.moyuView.showAgree(call);
  4578. else
  4579. call && call();
  4580. }
  4581. static showXy(type = 1) {
  4582. if (this.moyuView)
  4583. this.moyuView.showXy(type);
  4584. }
  4585. }
  4586. MoyuMgr.isAdvise = false;
  4587. class MoyuView {
  4588. constructor() {
  4589. this.ysxyNum = 1;
  4590. this.ysJson = null;
  4591. this.ui = ui_UIMoyu.createInstance();
  4592. }
  4593. init() {
  4594. this.ui.mainBg.visible = false;
  4595. this.ui.xyNode.visible = false;
  4596. this.ui.ageNode.visible = false;
  4597. this.ui.tipNode.visible = false;
  4598. this.ui.rnNode.visible = false;
  4599. this.ui.fcmNode.visible = false;
  4600. this.ui.ageTip.visible = false;
  4601. this.ui.msgNode.visible = false;
  4602. this.ui.visible = false;
  4603. this.ui.xyNode.xyList.setVirtual();
  4604. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4605. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4606. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4607. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4608. this.ui.xyNode.btnKnown.visible = false;
  4609. this.ui.xyNode.xy1.visible = false;
  4610. this.ui.xyNode.xy2.visible = false;
  4611. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4612. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4613. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4614. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4615. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4616. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4617. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4618. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4619. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4620. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4621. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4622. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4623. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4624. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4625. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4626. this.ysxyNum = 2;
  4627. }
  4628. }
  4629. onClick(obj) {
  4630. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4631. switch (obj) {
  4632. case this.ui.ageTip:
  4633. if (Moyu.isTTApk) {
  4634. this.ui.ageNode.visible = true;
  4635. this.ui.mainBg.visible = true;
  4636. }
  4637. break;
  4638. case this.ui.tipNode:
  4639. this.showTip(false);
  4640. break;
  4641. case this.ui.ageNode.btnAge:
  4642. this.ui.ageNode.visible = false;
  4643. this.ui.mainBg.visible = false;
  4644. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4645. this.ui.visible = false;
  4646. break;
  4647. case this.ui.xyNode.btnXy3:
  4648. case this.ui.xyNode.btnXy1:
  4649. this.loadXy(1);
  4650. break;
  4651. case this.ui.xyNode.btnXy2:
  4652. this.loadXy(2);
  4653. break;
  4654. case this.ui.xyNode.btnBack:
  4655. this.ui.xyNode.xy1.visible = true;
  4656. this.ui.xyNode.xy2.visible = false;
  4657. break;
  4658. case this.ui.xyNode.btnKnown:
  4659. this.ui.xyNode.visible = false;
  4660. this.ui.mainBg.visible = false;
  4661. this.ui.visible = false;
  4662. break;
  4663. case this.ui.rnNode.btnCheck:
  4664. this.check();
  4665. break;
  4666. case this.ui.rnNode.btnExit:
  4667. case this.ui.xyNode.btnNo:
  4668. this.ysxyNum--;
  4669. if (this.ysxyNum > 0)
  4670. this.showMsg("Refuse to quit the game once again");
  4671. else {
  4672. Moyu.userAgree(false);
  4673. Moyu.exit();
  4674. }
  4675. break;
  4676. case this.ui.xyNode.btnSure:
  4677. case this.ui.xyNode.btnYes:
  4678. DataMgr.userData.isAgree = true;
  4679. DataMgr.saveUserData();
  4680. this.onAgree();
  4681. break;
  4682. case this.ui.rnNode.btnDone:
  4683. this.ui.rnNode.visible = false;
  4684. this.ui.visible = false;
  4685. break;
  4686. case this.ui.fcmNode.btnRn:
  4687. this.showRn();
  4688. break;
  4689. }
  4690. }
  4691. showTip(show) {
  4692. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4693. return;
  4694. if (show) {
  4695. MoyuMgr.isAdvise = true;
  4696. this.ui.visible = true;
  4697. this.ui.tipNode.visible = true;
  4698. this.ui.tipNode.alpha = 1;
  4699. Laya.timer.once(1000, this, this.showTip, [false]);
  4700. }
  4701. else {
  4702. this.ui.tipNode.alpha = 1;
  4703. this.ui.tipNode.visible = true;
  4704. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4705. this.ui.tipNode.visible = false;
  4706. MoyuMgr.isAdvise = false;
  4707. }), 1000);
  4708. }
  4709. }
  4710. showAge(show, px = 0, py = 0) {
  4711. if (Moyu.platType > 10 && !Moyu.isIos) {
  4712. this.ui.ageTip.x = px;
  4713. this.ui.ageTip.y = py;
  4714. this.ui.ageTip.visible = show;
  4715. if (show)
  4716. this.ui.visible = true;
  4717. }
  4718. }
  4719. showAgree(call) {
  4720. this.agreeCall = call;
  4721. this.onAgree();
  4722. return;
  4723. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4724. this.showXy(0);
  4725. }
  4726. else
  4727. this.onAgree();
  4728. }
  4729. onAgree() {
  4730. if (!this.ui.ageNode.visible)
  4731. this.ui.visible = false;
  4732. this.ui.xyNode.visible = false;
  4733. Moyu.userAgree(true);
  4734. this.showAge(false);
  4735. this.agreeCall && this.agreeCall();
  4736. this.showRn();
  4737. }
  4738. showMsg(txt) {
  4739. this.ui.msgNode.txtMsg.text = txt;
  4740. this.ui.msgNode.visible = true;
  4741. this.ui.msgNode.alpha = 1;
  4742. this.ui.visible = true;
  4743. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4744. this.ui.msgNode.visible = false;
  4745. }), 2500, true);
  4746. }
  4747. showRn() {
  4748. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4749. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4750. this.ui.rnNode.rn1.visible = true;
  4751. this.ui.rnNode.rn2.visible = false;
  4752. this.ui.rnNode.rn3.visible = false;
  4753. this.ui.rnNode.rn4.visible = false;
  4754. this.ui.rnNode.visible = true;
  4755. this.ui.mainBg.visible = true;
  4756. this.ui.rnNode.btnDone.visible = false;
  4757. this.ui.rnNode.btnExit.visible = true;
  4758. this.ui.rnNode.btnCheck.visible = true;
  4759. this.ui.fcmNode.visible = false;
  4760. this.ui.visible = true;
  4761. return;
  4762. }
  4763. }
  4764. this.showFcm();
  4765. }
  4766. showFcm() {
  4767. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4768. Moyu.initFCM(true);
  4769. if (Moyu.gameTime < 1)
  4770. this.fcmLoop();
  4771. else if (Moyu.gameTime < 999)
  4772. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4773. }
  4774. }
  4775. fcmLoop() {
  4776. if (Moyu.gameTime < 1) {
  4777. this.ui.rnNode.visible = false;
  4778. this.ui.fcmNode.visible = true;
  4779. this.ui.mainBg.visible = true;
  4780. this.ui.visible = true;
  4781. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4782. Laya.timer.clear(this.ui, this.fcmLoop);
  4783. }
  4784. }
  4785. check() {
  4786. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4787. this.ui.rnNode.rn1.visible = false;
  4788. this.ui.rnNode.rn2.visible = false;
  4789. this.ui.rnNode.rn4.visible = true;
  4790. }
  4791. else if (this.ui.rnNode.rn4.visible) {
  4792. let name = this.ui.rnNode.inputName.text;
  4793. let code = this.ui.rnNode.inputCode.text;
  4794. if (code && code.length == 18) {
  4795. this.ui.rnNode.rn1.visible = false;
  4796. this.ui.rnNode.rn4.visible = false;
  4797. Moyu.authenticate(name, code, (res) => {
  4798. this.ui.rnNode.rn2.visible = !res;
  4799. this.ui.rnNode.rn3.visible = res;
  4800. this.ui.rnNode.btnDone.visible = res;
  4801. this.ui.rnNode.btnExit.visible = !res;
  4802. this.ui.rnNode.btnCheck.visible = !res;
  4803. if (res)
  4804. this.showFcm();
  4805. });
  4806. }
  4807. else
  4808. this.showMsg("信息填写不完整");
  4809. }
  4810. }
  4811. loadXy(type = 0) {
  4812. this.ui.xyNode.xy1.visible = false;
  4813. this.ui.xyNode.xy2.visible = true;
  4814. this.ui.xyNode.xyList.scrollToView(0);
  4815. if (type == 1) {
  4816. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4817. }
  4818. else if (type == 2) {
  4819. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4820. }
  4821. }
  4822. showXy(type = 0) {
  4823. this.xyBtn();
  4824. if (type == 0) {
  4825. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4826. this.ui.xyNode.btnSure.visible = true;
  4827. }
  4828. else {
  4829. this.ui.xyNode.btnYes.visible = true;
  4830. this.ui.xyNode.btnNo.visible = true;
  4831. }
  4832. }
  4833. else {
  4834. this.ui.xyNode.btnKnown.visible = true;
  4835. this.ui.mainBg.visible = true;
  4836. }
  4837. this.ui.xyNode.xy1.visible = true;
  4838. this.ui.xyNode.xy2.visible = false;
  4839. this.ui.xyNode.visible = true;
  4840. this.ui.visible = true;
  4841. }
  4842. xyBtn() {
  4843. this.ui.xyNode.btnSure.visible = false;
  4844. this.ui.xyNode.btnYes.visible = false;
  4845. this.ui.xyNode.btnNo.visible = false;
  4846. this.ui.xyNode.btnKnown.visible = false;
  4847. {
  4848. this.ui.xyNode.btnXy3.visible = false;
  4849. this.ui.xyNode.btnXy2.visible = true;
  4850. this.ui.xyNode.btnXy1.visible = true;
  4851. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4852. }
  4853. }
  4854. createXY(json) {
  4855. this.ysJson = json.content;
  4856. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4857. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4858. this.ui.xyNode.xy2.visible = true;
  4859. }
  4860. renderListItem(idx, cell) {
  4861. let xy = this.ysJson[idx];
  4862. cell.height = xy.line * 30;
  4863. cell.xyItem.text = xy.text;
  4864. }
  4865. onDestroy() {
  4866. this.agreeCall = null;
  4867. }
  4868. }
  4869. class SettingNode {
  4870. constructor(ui) {
  4871. this.showSetting = false;
  4872. this.openSound = true;
  4873. this.openShake = true;
  4874. this.ui = ui;
  4875. this.ui.soundBtn.onClick(this, this.switchSound);
  4876. this.ui.shakeBtn.onClick(this, this.switchShake);
  4877. this.ui.xyBtn.onClick(this, this.onXy);
  4878. this.ui.clickNode.onClick(this, this.changeSetting);
  4879. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4880. this.ui.xyBtn.visible = false;
  4881. this.ui.shakeBtn.visible = false;
  4882. }
  4883. changeSetting() {
  4884. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4885. this.showSetting = !this.showSetting;
  4886. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4887. }
  4888. switchSound() {
  4889. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4890. this.openSound = !this.openSound;
  4891. Moyu.onSetting(this.openSound, this.openShake);
  4892. xGame.soundMgr.onSetting(this.openSound);
  4893. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4894. }
  4895. switchShake() {
  4896. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4897. this.openShake = !this.openShake;
  4898. Moyu.onSetting(this.openSound, this.openShake);
  4899. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4900. }
  4901. onXy() {
  4902. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4903. MoyuMgr.showXy(1);
  4904. }
  4905. }
  4906. class ui_UILevelDisplay extends fgui.GComponent {
  4907. static createInstance() {
  4908. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4909. }
  4910. onConstruct() {
  4911. this.n9 = (this.getChild("n9"));
  4912. this.myNode = (this.getChild("myNode"));
  4913. this.closeNode = (this.getChild("closeNode"));
  4914. }
  4915. }
  4916. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4917. class ui_UILevelProp extends fgui.GComponent {
  4918. static createInstance() {
  4919. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4920. }
  4921. onConstruct() {
  4922. this.n16 = (this.getChild("n16"));
  4923. this.myNode = (this.getChild("myNode"));
  4924. this.closeBtn = (this.getChild("closeBtn"));
  4925. this.moneyNode = (this.getChild("moneyNode"));
  4926. this.t1 = this.getTransition("t1");
  4927. }
  4928. }
  4929. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4930. class ui_ShowItem extends fgui.GComponent {
  4931. static createInstance() {
  4932. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4933. }
  4934. onConstruct() {
  4935. this.myImg = (this.getChild("myImg"));
  4936. }
  4937. }
  4938. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  4939. class ShowItem {
  4940. constructor() {
  4941. this.ui = ui_ShowItem.createInstance();
  4942. }
  4943. destroySelf() {
  4944. if (!this.ui.isDisposed) {
  4945. this.ui.removeFromParent();
  4946. this.ui.dispose();
  4947. }
  4948. }
  4949. setParent(parent) {
  4950. parent.addChild(this.ui);
  4951. }
  4952. setPos(x, y) {
  4953. this.ui.x = x;
  4954. this.ui.y = y;
  4955. }
  4956. setUrl(index) {
  4957. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  4958. }
  4959. }
  4960. class ui_UIPower extends fgui.GComponent {
  4961. static createInstance() {
  4962. return (fgui.UIPackage.createObject("game", "UIPower"));
  4963. }
  4964. onConstruct() {
  4965. this.n11 = (this.getChild("n11"));
  4966. this.myNode = (this.getChild("myNode"));
  4967. this.t0 = this.getTransition("t0");
  4968. }
  4969. }
  4970. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  4971. class UIPower extends UIBase {
  4972. constructor() {
  4973. super();
  4974. }
  4975. onConstructor() {
  4976. this.ui = ui_UIPower.createInstance();
  4977. this.contentPane = this.ui;
  4978. this.isEject = false;
  4979. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4980. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  4981. }
  4982. show() {
  4983. super.show();
  4984. this.ui.t0.play();
  4985. }
  4986. videoGetPower() {
  4987. console.log('zh:qjff_AD_for_uipower');
  4988. if (Laya.Browser.onAndroid) {
  4989. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4990. if (!boo) {
  4991. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4992. return;
  4993. }
  4994. }
  4995. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  4996. }
  4997. else {
  4998. console.log('zh:AD 失败,直接发放奖励');
  4999. this.qjff_AD_for_uipower();
  5000. }
  5001. }
  5002. qjff_AD_for_uipower() {
  5003. DataMgr.setPower(xGame.common.videoPower, true);
  5004. xGame.eventMgr.event(POWER_TIME);
  5005. this.hide();
  5006. }
  5007. }
  5008. UIPower.uiName = "UIPower";
  5009. class UILevelProp extends UIBase {
  5010. constructor() {
  5011. super();
  5012. this.firstPos = 385;
  5013. this.secondPos = 467;
  5014. this.showItemArr = [];
  5015. }
  5016. onFontLoaded() {
  5017. try {
  5018. this.ui.myNode.conditionTxt.font = "arial";
  5019. console.log("zh: onFontLoaded 设置arial字体成功");
  5020. }
  5021. catch (error) {
  5022. console.log("zh: constructor onFontLoaded加载arial字体失败");
  5023. }
  5024. }
  5025. onConstructor() {
  5026. this.ui = ui_UILevelProp.createInstance();
  5027. this.contentPane = this.ui;
  5028. this.isEject = false;
  5029. this.addUIClick(this.ui.closeBtn, this.hide);
  5030. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5031. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5032. }
  5033. show(level) {
  5034. super.show();
  5035. this.ui.t1.play();
  5036. this.level = level;
  5037. this.data = cfgTable.placeballData[this.level];
  5038. this.updateSelf();
  5039. this.showPreView();
  5040. this.moneyNode.ui.c1.selectedIndex = 2;
  5041. this.moneyNode.checkPowerTime();
  5042. this.moneyNode.powerChange();
  5043. }
  5044. showPreView() {
  5045. let item;
  5046. let data;
  5047. for (let index = 0; index < this.showItemArr.length; index++) {
  5048. item = this.showItemArr[index];
  5049. item.destroySelf();
  5050. }
  5051. this.showItemArr = [];
  5052. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5053. for (const key in cfgData) {
  5054. data = cfgData[key];
  5055. item = new ShowItem();
  5056. item.setParent(this.ui.myNode.displayRoot);
  5057. item.setPos(data.x, data.y);
  5058. item.setUrl(data.value);
  5059. this.showItemArr.push(item);
  5060. }
  5061. }
  5062. updateSelf() {
  5063. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5064. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5065. if (this.data.ball == -1) {
  5066. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5067. }
  5068. else {
  5069. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5070. }
  5071. let localData = DataMgr.getPlaceBallLevel(this.level);
  5072. let getAward = localData.getAward;
  5073. let cfg = cfgTable.placeballData[this.level];
  5074. let coin = this.data.award[0];
  5075. let diamond = this.data.award[1];
  5076. if (cfg.type == PlaceBallType.challenge) {
  5077. diamond = 0;
  5078. coin = 100;
  5079. }
  5080. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5081. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5082. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5083. if (cfg.type == PlaceBallType.challenge) {
  5084. this.ui.myNode.coinNode.numTxt.text = "";
  5085. }
  5086. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5087. if (coin > 0 && diamond > 0) {
  5088. this.ui.myNode.diamondNode.x = 385;
  5089. this.ui.myNode.coinNode.x = 467;
  5090. }
  5091. else {
  5092. this.ui.myNode.diamondNode.x = 385;
  5093. this.ui.myNode.coinNode.x = 385;
  5094. }
  5095. if (!getAward) {
  5096. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5097. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5098. }
  5099. else {
  5100. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5101. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5102. }
  5103. }
  5104. startGame() {
  5105. if (DataMgr.powerEnough()) {
  5106. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5107. this.ui.myNode.startBtn.touchable = false;
  5108. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5109. console.log('zh:startGame ');
  5110. this.ui.myNode.startBtn.touchable = true;
  5111. DataMgr.setPower(-1);
  5112. xGame.eventMgr.event(POWER_TIME);
  5113. xGame.common.gameMode = GameMode.placeBall;
  5114. xGame.common.placeBallCurLevel = this.level;
  5115. xGame.uiMgr.Show(UIGame);
  5116. this.logEventForChallenge_level_start(this.level);
  5117. xGame.uiMgr.Hide(UILevelDisplay);
  5118. xGame.uiMgr.Hide(UIMain);
  5119. this.hide();
  5120. }));
  5121. }
  5122. else {
  5123. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5124. xGame.uiMgr.Show(UIPower);
  5125. }
  5126. }
  5127. logEventForChallenge_level_start(level) {
  5128. let keyStr = 'sjmd_challenge_level_start';
  5129. let jsonStr = {
  5130. "count": 1,
  5131. "gold_balance ": DataMgr.getCoin(),
  5132. "level": level,
  5133. "diamond_balance ": DataMgr.getDiamond()
  5134. };
  5135. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5136. const d = LocalStorageManager.getItem(keyStr);
  5137. if (level > d.level) {
  5138. jsonStr.count = d.count + 1;
  5139. LocalStorageManager.setItem(keyStr, jsonStr);
  5140. }
  5141. else {
  5142. }
  5143. }
  5144. else {
  5145. LocalStorageManager.setItem(keyStr, jsonStr);
  5146. }
  5147. const reqStr = JSON.stringify(jsonStr);
  5148. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5149. }
  5150. hide() {
  5151. super.hide();
  5152. }
  5153. }
  5154. UILevelProp.uiName = "UILevelProp";
  5155. class PutBallLevelDisplay {
  5156. constructor(ui, index) {
  5157. this.index = 0;
  5158. this.ui = ui;
  5159. this.index = index;
  5160. this.ui.onClick(this, this.clickSelf);
  5161. this.updateSelf();
  5162. this.ui.levelTxt.text = (this.index + 1) + "";
  5163. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5164. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5165. }
  5166. updateSelf() {
  5167. let level = this.index + 1;
  5168. this.data = DataMgr.getPlaceBallLevel(level);
  5169. this.ui.starNode.c1.selectedIndex = this.data.star;
  5170. let isChallenge = cfgTable.placeballData[level].type;
  5171. if (this.data.isCur) {
  5172. if (isChallenge) {
  5173. this.ui.c1.selectedIndex = 5;
  5174. }
  5175. else {
  5176. this.ui.c1.selectedIndex = 2;
  5177. }
  5178. }
  5179. else {
  5180. if (this.data.play) {
  5181. if (this.data.star == 3) {
  5182. this.ui.c1.selectedIndex = 0;
  5183. }
  5184. else {
  5185. this.ui.c1.selectedIndex = 1;
  5186. }
  5187. }
  5188. else {
  5189. if (isChallenge) {
  5190. this.ui.c1.selectedIndex = 4;
  5191. }
  5192. else {
  5193. this.ui.c1.selectedIndex = 3;
  5194. }
  5195. }
  5196. }
  5197. }
  5198. clickSelf() {
  5199. if (!this.data.play)
  5200. return;
  5201. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5202. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5203. }
  5204. }
  5205. class UILevelDisplay extends UIBase {
  5206. constructor() {
  5207. super();
  5208. }
  5209. onConstructor() {
  5210. this.ui = ui_UILevelDisplay.createInstance();
  5211. this.contentPane = this.ui;
  5212. this.isEject = false;
  5213. this.myList = this.ui.myNode.myList;
  5214. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5215. this.levelItemArr = [];
  5216. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5217. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5218. this.myList.numItems = levelNum;
  5219. }
  5220. levelItemRender(index, target) {
  5221. let item = new PutBallLevelDisplay(target, index);
  5222. this.levelItemArr.push(item);
  5223. }
  5224. show() {
  5225. super.show();
  5226. this.updateLevel();
  5227. this.scrollToPlace();
  5228. }
  5229. updateLevel() {
  5230. let temp;
  5231. for (let index = 0; index < this.levelItemArr.length; index++) {
  5232. temp = this.levelItemArr[index];
  5233. temp.updateSelf();
  5234. }
  5235. }
  5236. scrollToPlace() {
  5237. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5238. let passArr = DataMgr.getPlaceBallLevelList();
  5239. let offest = passArr.length;
  5240. if (offest >= maxNum - 1)
  5241. offest = maxNum - 1;
  5242. this.myList.scrollToView(offest, true, true);
  5243. }
  5244. hide() {
  5245. super.hide();
  5246. }
  5247. }
  5248. UILevelDisplay.uiName = "UILevelDisplay";
  5249. class ui_UIMatching extends fgui.GComponent {
  5250. static createInstance() {
  5251. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5252. }
  5253. onConstruct() {
  5254. this.n5 = (this.getChild("n5"));
  5255. this.n49 = (this.getChild("n49"));
  5256. this.n51 = (this.getChild("n51"));
  5257. this.n64 = (this.getChild("n64"));
  5258. this.n2 = (this.getChild("n2"));
  5259. this.n53 = (this.getChild("n53"));
  5260. this.n54 = (this.getChild("n54"));
  5261. this.n56 = (this.getChild("n56"));
  5262. this.n58 = (this.getChild("n58"));
  5263. this.n59 = (this.getChild("n59"));
  5264. this.n57 = (this.getChild("n57"));
  5265. this.n60 = (this.getChild("n60"));
  5266. this.n62 = (this.getChild("n62"));
  5267. this.awardTxt = (this.getChild("awardTxt"));
  5268. this.n61 = (this.getChild("n61"));
  5269. this.selfHead = (this.getChild("selfHead"));
  5270. this.aiHead = (this.getChild("aiHead"));
  5271. this.n82 = (this.getChild("n82"));
  5272. this.n84 = (this.getChild("n84"));
  5273. this.n83 = (this.getChild("n83"));
  5274. this.t1 = this.getTransition("t1");
  5275. this.t2 = this.getTransition("t2");
  5276. this.t3 = this.getTransition("t3");
  5277. this.t4 = this.getTransition("t4");
  5278. }
  5279. }
  5280. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5281. class UIMatching extends UIBase {
  5282. constructor() {
  5283. super();
  5284. }
  5285. onConstructor() {
  5286. this.ui = ui_UIMatching.createInstance();
  5287. this.contentPane = this.ui;
  5288. this.isEject = false;
  5289. }
  5290. show(callback) {
  5291. super.show();
  5292. PlatMgr.showBanner(true);
  5293. this.callback = callback;
  5294. let user = Moyu.getUserInfo();
  5295. if (!this.selfPot) {
  5296. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5297. }
  5298. if (!this.aiPot) {
  5299. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5300. }
  5301. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5302. this.ui.selfHead.nameTxt.text = user.nickName;
  5303. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5304. this.ui.aiHead.nameTxt.text = "???";
  5305. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5306. this.ui.selfHead.c1.selectedIndex = 0;
  5307. this.ui.aiHead.c1.selectedIndex = 0;
  5308. this.ui.selfHead.x = this.selfPot.x;
  5309. this.ui.selfHead.y = this.selfPot.y;
  5310. this.ui.aiHead.x = this.aiPot.x;
  5311. this.ui.aiHead.y = this.aiPot.y;
  5312. switch (xGame.common.gameMode) {
  5313. case GameMode.classic:
  5314. break;
  5315. case GameMode.bigMove:
  5316. this.initSkillData();
  5317. break;
  5318. default:
  5319. break;
  5320. }
  5321. this.ui.t1.play(Laya.Handler.create(this, () => {
  5322. this.ui.t2.play(Laya.Handler.create(this, () => {
  5323. switch (xGame.common.gameMode) {
  5324. case GameMode.classic:
  5325. this.waitingPeople();
  5326. break;
  5327. case GameMode.bigMove:
  5328. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5329. break;
  5330. default:
  5331. break;
  5332. }
  5333. }));
  5334. }));
  5335. }
  5336. initSkillData() {
  5337. this.skillSelectData = [];
  5338. let skillUrl = xGame.common.skillIconList;
  5339. let skillName = xGame.common.skillNameList;
  5340. let skillLevel = DataMgr.getBigSkillList();
  5341. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5342. for (let index = 0; index < 5; index++) {
  5343. let obj = {};
  5344. obj.skillImg = skillUrl[index];
  5345. obj.skillName = skillName[index];
  5346. obj.skillType = skillType[index];
  5347. obj.skillLevel = skillLevel[index];
  5348. this.skillSelectData.push(obj);
  5349. }
  5350. }
  5351. getAISkillLevel(myLevel) {
  5352. let video = xGame.common.upSkillLevel;
  5353. let aiLevel;
  5354. let temp;
  5355. if (video) {
  5356. temp = xGame.common.randomNum(-2, -1);
  5357. }
  5358. else {
  5359. if (myLevel <= 5) {
  5360. temp = xGame.common.randomNum(1, 3);
  5361. }
  5362. else if (myLevel <= 9) {
  5363. temp = xGame.common.randomNum(-2, 1);
  5364. }
  5365. else {
  5366. temp = xGame.common.randomNum(-4, 0);
  5367. }
  5368. }
  5369. aiLevel = temp + myLevel;
  5370. if (aiLevel <= 1)
  5371. aiLevel = 1;
  5372. if (aiLevel >= 10)
  5373. aiLevel = 10;
  5374. return aiLevel;
  5375. }
  5376. getAISkillType() {
  5377. return xGame.common.randomNum(1, 4);
  5378. let successTimes = DataMgr.getSkillSuccessTimes();
  5379. let info = cfgTable.aiskillData[successTimes];
  5380. if (!info) {
  5381. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5382. info = cfgTable.aiskillData[max];
  5383. }
  5384. let dataArr = info.skillselect;
  5385. let myCfg = {};
  5386. for (let index = 0; index < dataArr.length; index++) {
  5387. let temp = dataArr[index].split('-');
  5388. myCfg[temp[0]] = {};
  5389. myCfg[temp[0]].id = parseInt(temp[0]);
  5390. myCfg[temp[0]].weight = parseInt(temp[1]);
  5391. }
  5392. let aiCfg = xGame.common.initWeight(myCfg);
  5393. let curData = xGame.common.getRandomWeightData(aiCfg);
  5394. return parseInt(curData.id);
  5395. }
  5396. getAISkillData(index) {
  5397. let myLevel = this.skillSelectData[index].skillLevel;
  5398. let aiLevel = this.getAISkillLevel(myLevel);
  5399. let aiType = this.getAISkillType() - 1;
  5400. return { aiLevel, aiType } = { aiLevel, aiType };
  5401. }
  5402. skillSelectFinish(index) {
  5403. let aiInfo = this.getAISkillData(index);
  5404. xGame.common.gameMgr.selfCurSkill = index;
  5405. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5406. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5407. this.ui.selfHead.c1.selectedIndex = 1;
  5408. this.ui.aiHead.c1.selectedIndex = 1;
  5409. let myData = this.skillSelectData[index];
  5410. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5411. let guide = DataMgr.getSkillGuide();
  5412. if (guide == 0) {
  5413. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5414. }
  5415. else {
  5416. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5417. }
  5418. let aiData = this.skillSelectData[aiInfo.aiType];
  5419. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5420. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5421. this.waitingPeople();
  5422. }
  5423. waitingPeople() {
  5424. let time = xGame.common.randomNum(1000, 3000);
  5425. time += 1000;
  5426. Laya.timer.once(time, this, () => {
  5427. this.matchingSuccess();
  5428. });
  5429. }
  5430. matchingSuccess() {
  5431. let gameUI = xGame.common.gameUI;
  5432. let name = gameUI.ui.topNode.aiNameTxt.text;
  5433. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5434. this.ui.aiHead.nameTxt.text = name;
  5435. this.ui.aiHead.headImg.url = url;
  5436. name = gameUI.ui.topNode.selfNameTxt.text;
  5437. url = gameUI.ui.topNode.selfHeadLoader.url;
  5438. this.ui.selfHead.nameTxt.text = name;
  5439. this.ui.selfHead.headImg.url = url;
  5440. this.ui.t3.play(Laya.Handler.create(this, () => {
  5441. this.callback && this.callback();
  5442. this.ui.t4.play(Laya.Handler.create(this, () => {
  5443. this.destroySelf();
  5444. }));
  5445. }));
  5446. }
  5447. destroySelf() {
  5448. this.callback = null;
  5449. this.skillSelectData = null;
  5450. this.selfPot = null;
  5451. this.aiPot = null;
  5452. if (!this.ui.isDisposed) {
  5453. this.ui.removeFromParent();
  5454. this.ui.dispose();
  5455. }
  5456. xGame.uiMgr.destroyUI(this);
  5457. }
  5458. }
  5459. UIMatching.uiName = "UIMatching";
  5460. class ui_UIRanking extends fgui.GComponent {
  5461. static createInstance() {
  5462. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5463. }
  5464. onConstruct() {
  5465. this.n26 = (this.getChild("n26"));
  5466. this.myNode = (this.getChild("myNode"));
  5467. }
  5468. }
  5469. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5470. class UIRanking extends UIBase {
  5471. constructor() {
  5472. super();
  5473. this.showSelf = true;
  5474. this.rankType = 1;
  5475. this.rankList = [];
  5476. this.topX = 10;
  5477. this.myIndex = this.topX + 1;
  5478. this.myStar = 0;
  5479. }
  5480. onConstructor() {
  5481. this.ui = ui_UIRanking.createInstance();
  5482. this.contentPane = this.ui;
  5483. this.isEject = false;
  5484. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5485. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5486. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5487. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5488. this.ui.myNode.myList.setVirtual();
  5489. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5490. }
  5491. show() {
  5492. super.show();
  5493. this.getPaiHangBangDataFormJosnFile();
  5494. this.updateSelf();
  5495. let self = Moyu.getUserInfo();
  5496. if (!self.isAuth) {
  5497. Moyu.initUser(this, () => {
  5498. DataMgr.upRankData();
  5499. });
  5500. }
  5501. }
  5502. getPaiHangBangDataFormJosnFile() {
  5503. const rankingList = cfgTable.paiHangBangData.list;
  5504. this.updateItemData(rankingList);
  5505. }
  5506. updateSelfItem() {
  5507. console.log('zh:Moyu.platType =' + Moyu.platType);
  5508. let self = Moyu.getUserInfo();
  5509. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5510. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5511. if (this.myIndex > this.topX) {
  5512. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5513. }
  5514. else {
  5515. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5516. }
  5517. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5518. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5519. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5520. }
  5521. updateItemData(data) {
  5522. this.myStar = xGame.common.getAllStarNum();
  5523. if (this.rankList.length < 2) {
  5524. this.rankList = data;
  5525. let self = Moyu.getUserInfo();
  5526. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5527. self.headIcon = self.headIcon;
  5528. for (let i = 0; i < data.length; i++) {
  5529. let data = this.rankList[i];
  5530. if (data.userId == self.userId) {
  5531. this.rankList.splice(i, 1);
  5532. break;
  5533. }
  5534. }
  5535. for (let i = 0; i < data.length; i++) {
  5536. let data = this.rankList[i];
  5537. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5538. this.myIndex = i + 1;
  5539. let user = { headIcon: self.headIcon, nickName: "myself" };
  5540. let ud = { user: user, data: {} };
  5541. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5542. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5543. if (Moyu.platType < 11) {
  5544. user.headIcon = self.headIcon;
  5545. user.nickName = self.nickName;
  5546. }
  5547. this.rankList.splice(i, 0, md);
  5548. break;
  5549. }
  5550. }
  5551. }
  5552. this.updateSelfItem();
  5553. this.ui.myNode.myList.numItems = this.rankList.length;
  5554. }
  5555. updateItemUI(index, obj) {
  5556. let data = this.rankList[index];
  5557. let userData = JSON.parse(data.userData).user;
  5558. obj.nameTxt.text = userData.nickName.toString();
  5559. obj.valueTxt.text = data.rankScore;
  5560. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5561. obj.rankTxt.text = index + 1;
  5562. switch (index) {
  5563. case 0:
  5564. this.setImg(obj, 1, 0, 0);
  5565. obj.rankTxt.color = "#FFC047";
  5566. break;
  5567. case 1:
  5568. this.setImg(obj, 0, 1, 0);
  5569. obj.rankTxt.color = "#ACACAC";
  5570. break;
  5571. case 2:
  5572. this.setImg(obj, 0, 0, 1);
  5573. obj.rankTxt.color = "#D09672";
  5574. break;
  5575. default:
  5576. this.setImg(obj, 0, 0, 0);
  5577. obj.rankTxt.color = "#496FAB";
  5578. break;
  5579. }
  5580. }
  5581. setImg(obj, a, b, c) {
  5582. obj.img1.visible = a ? true : false;
  5583. obj.img2.visible = b ? true : false;
  5584. obj.img3.visible = c ? true : false;
  5585. }
  5586. changeList(type) {
  5587. this.rankType = type;
  5588. this.updateSelf();
  5589. }
  5590. changeSelfNode() {
  5591. this.showSelf = !this.showSelf;
  5592. this.updateSelf();
  5593. }
  5594. updateSelf() {
  5595. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5596. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5597. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5598. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5599. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5600. }
  5601. }
  5602. UIRanking.uiName = "UIRanking";
  5603. class ui_UISecretary extends fgui.GComponent {
  5604. static createInstance() {
  5605. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5606. }
  5607. onConstruct() {
  5608. this.n0 = (this.getChild("n0"));
  5609. this.myNode = (this.getChild("myNode"));
  5610. this.closeBtn = (this.getChild("closeBtn"));
  5611. this.t0 = this.getTransition("t0");
  5612. }
  5613. }
  5614. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5615. class UISecretary extends UIBase {
  5616. constructor() {
  5617. super();
  5618. this.curIndex = 1;
  5619. }
  5620. onConstructor() {
  5621. this.ui = ui_UISecretary.createInstance();
  5622. this.contentPane = this.ui;
  5623. this.isEject = false;
  5624. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5625. this.nodeObj = { left: null, right: null, cur: null };
  5626. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5627. }
  5628. show() {
  5629. super.show();
  5630. this.ui.t0.play();
  5631. this.updateData();
  5632. }
  5633. addSecretarySpine(node, spineName) {
  5634. if (spineName == "mishu") {
  5635. if (this.secretarySpine1) {
  5636. node.displayObject.destroyChildren();
  5637. this.playWoman(this.secretarySpine1, node.displayObject);
  5638. }
  5639. else {
  5640. let spine1 = new SpineMgr("mishu", () => {
  5641. this.secretarySpine1 = spine1;
  5642. this.playWoman(this.secretarySpine1, node.displayObject);
  5643. });
  5644. }
  5645. }
  5646. else {
  5647. if (this.secretarySpine2) {
  5648. node.displayObject.destroyChildren();
  5649. this.playWoman(this.secretarySpine2, node.displayObject);
  5650. }
  5651. else {
  5652. let spine2 = new SpineMgr("xiaomishu2", () => {
  5653. this.secretarySpine2 = spine2;
  5654. this.playWoman(this.secretarySpine2, node.displayObject);
  5655. });
  5656. }
  5657. }
  5658. }
  5659. playWoman(node, parent) {
  5660. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5661. let yy = this.ui.myNode.gameNode3.secretary.height;
  5662. let scale = 1.5;
  5663. if (node == this.secretarySpine2) {
  5664. scale = 1.2;
  5665. }
  5666. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5667. node.play(data, 0, true, parent);
  5668. }
  5669. turnLeft() {
  5670. this.curIndex--;
  5671. if (this.curIndex < 1) {
  5672. this.curIndex = 2;
  5673. }
  5674. let left = this.nodeObj.left;
  5675. let right = this.nodeObj.right;
  5676. let cur = this.nodeObj.cur;
  5677. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5678. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5679. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5680. this.updateData();
  5681. }));
  5682. this.ui.myNode.setChildIndex(right, 2);
  5683. this.nodeObj.left = cur;
  5684. this.nodeObj.right = left;
  5685. this.nodeObj.cur = right;
  5686. }
  5687. turnRight() {
  5688. this.curIndex++;
  5689. if (this.curIndex > 2) {
  5690. this.curIndex = 1;
  5691. }
  5692. let left = this.nodeObj.left;
  5693. let right = this.nodeObj.right;
  5694. let cur = this.nodeObj.cur;
  5695. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5696. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5697. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5698. this.updateData();
  5699. }));
  5700. this.ui.myNode.setChildIndex(left, 2);
  5701. this.nodeObj.left = right;
  5702. this.nodeObj.right = cur;
  5703. this.nodeObj.cur = left;
  5704. }
  5705. updateData() {
  5706. console.log('zh: updateData FFFFFFFFFF');
  5707. let data = cfgTable.secretaryshopData;
  5708. let children = this.ui.myNode._children;
  5709. let temp;
  5710. let curData;
  5711. for (let index = 0; index < children.length; index++) {
  5712. temp = children[index];
  5713. curData = data[1];
  5714. temp.heightTxt.text = curData.height;
  5715. temp.foodTxt.text = curData.food;
  5716. temp.historyTxt.text = curData.history;
  5717. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5718. this.addSecretarySpine(temp.secretary, curData.spine);
  5719. let womanIndex = curData.id - 1;
  5720. let getWoman = DataMgr.getSecretary(womanIndex);
  5721. let curUse = DataMgr.getCurSecretary();
  5722. if (getWoman) {
  5723. if (curUse == womanIndex) {
  5724. temp.purchaseBtn.c1.selectedIndex = 1;
  5725. }
  5726. else {
  5727. temp.purchaseBtn.c1.selectedIndex = 2;
  5728. }
  5729. }
  5730. else {
  5731. temp.purchaseBtn.c1.selectedIndex = 0;
  5732. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5733. }
  5734. temp.purchaseBtn.visible = false;
  5735. }
  5736. }
  5737. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5738. console.log('zh: 点击了clickSecretary ');
  5739. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5740. if (getWoman) {
  5741. if (curUse != womanIndex) {
  5742. console.log();
  5743. DataMgr.setCurSecretary(womanIndex);
  5744. this.updateData();
  5745. }
  5746. }
  5747. else {
  5748. console.log('zh:点击购买了');
  5749. let need = needDiamond;
  5750. if (DataMgr.diamondEnough(need)) {
  5751. DataMgr.setDiamond(-need);
  5752. DataMgr.setSecretary(womanIndex, 1);
  5753. DataMgr.setCurSecretary(womanIndex);
  5754. this.updateData();
  5755. }
  5756. else {
  5757. xGame.uiMgr.Show(UIAddProp, 1);
  5758. }
  5759. }
  5760. }
  5761. closeSelf() {
  5762. this.hide();
  5763. }
  5764. }
  5765. UISecretary.uiName = "UISecretary";
  5766. class ui_UIShop extends fgui.GComponent {
  5767. static createInstance() {
  5768. return (fgui.UIPackage.createObject("game", "UIShop"));
  5769. }
  5770. onConstruct() {
  5771. this.n48 = (this.getChild("n48"));
  5772. this.n0 = (this.getChild("n0"));
  5773. this.secretary = (this.getChild("secretary"));
  5774. this.talkNode = (this.getChild("talkNode"));
  5775. this.closeNode = (this.getChild("closeNode"));
  5776. this.moneyNode = (this.getChild("moneyNode"));
  5777. this.myNode = (this.getChild("myNode"));
  5778. }
  5779. }
  5780. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5781. class ui_UIMsg extends fgui.GComponent {
  5782. static createInstance() {
  5783. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5784. }
  5785. onConstruct() {
  5786. this.tipsNode = (this.getChild("tipsNode"));
  5787. }
  5788. }
  5789. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5790. class UIMsg extends UIBase {
  5791. constructor() {
  5792. super();
  5793. }
  5794. onConstructor() {
  5795. this.ui = ui_UIMsg.createInstance();
  5796. this.contentPane = this.ui;
  5797. this.isEject = false;
  5798. this.isMuti = true;
  5799. }
  5800. show(msg, callback) {
  5801. super.show();
  5802. this.ui.tipsNode.msgTxt.text = msg;
  5803. this.ui.alpha = 1;
  5804. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5805. this.hide();
  5806. callback && callback();
  5807. }), 1000);
  5808. }
  5809. }
  5810. UIMsg.uiName = "UIMsg";
  5811. class BallRodDisplay {
  5812. constructor(ui, index) {
  5813. this.index = 0;
  5814. this.uiIndex = 0;
  5815. this.ui = ui;
  5816. this.index = index;
  5817. this.initData();
  5818. }
  5819. initData() {
  5820. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5821. let data = cfgTable.ballrodData[this.index + 1];
  5822. this.ui.nameTxt.text = data.name;
  5823. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5824. this.ui.levelNode.c1.selectedIndex = data.quality;
  5825. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5826. if (data.spine) {
  5827. this.mySpine = new SpineMgr(data.spine, () => {
  5828. let xx = 150;
  5829. let yy = 70;
  5830. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5831. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5832. });
  5833. }
  5834. }
  5835. updateSelf() {
  5836. console.log('zh:updateSelf -------------- ');
  5837. let get = DataMgr.getBallRod(this.index);
  5838. if (get == null)
  5839. get = 1;
  5840. let curUse = DataMgr.getCurBallRod();
  5841. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5842. if (get) {
  5843. if (curUse == this.index) {
  5844. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5845. }
  5846. else {
  5847. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5848. }
  5849. }
  5850. else {
  5851. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5852. }
  5853. }
  5854. buyBallRod() {
  5855. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5856. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5857. switch (selectedIndex) {
  5858. case 0:
  5859. break;
  5860. case 1:
  5861. console.log('zh:点击了 USE THIS');
  5862. DataMgr.setCurBallRod(this.index);
  5863. let curUse = DataMgr.getCurBallRod();
  5864. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5865. let ui = xGame.uiMgr.getUI(UIShop);
  5866. ui.updateBallRod();
  5867. break;
  5868. case 2:
  5869. let data = cfgTable.ballrodData[this.index + 1];
  5870. let need = data.price;
  5871. if (DataMgr.diamondEnough(need)) {
  5872. this.buyQiuGan(data);
  5873. DataMgr.setDiamond(-need);
  5874. DataMgr.setBallRod(this.index, 1);
  5875. DataMgr.setCurBallRod(this.index);
  5876. let ui = xGame.uiMgr.getUI(UIShop);
  5877. ui.updateBallRod();
  5878. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5879. }
  5880. else {
  5881. xGame.uiMgr.Show(UIAddProp, 1);
  5882. }
  5883. break;
  5884. default:
  5885. break;
  5886. }
  5887. }
  5888. buyQiuGan(qgItem) {
  5889. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5890. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5891. if (userInfo == null) {
  5892. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5893. return;
  5894. }
  5895. let reqData = xGame.httpMgr.getReqData();
  5896. let pd = JSON.parse(reqData);
  5897. pd.qiuGanData = qgItem;
  5898. reqData = JSON.stringify(pd);
  5899. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5900. try {
  5901. console.log('zh:buySp res = ' + JSON.stringify(res));
  5902. let code = res.code;
  5903. let msg = res.msg;
  5904. if (code == 401) {
  5905. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5906. alert(TIP_MSG_key.loginTimeOut);
  5907. xGame.uiMgr.Show(UIMsg, msg);
  5908. return;
  5909. }
  5910. if (code == 200) {
  5911. xGame.uiMgr.Show(UIMsg, msg);
  5912. DataMgr.getUserZiChanInfo();
  5913. }
  5914. else {
  5915. xGame.uiMgr.Show(UIMsg, msg);
  5916. }
  5917. }
  5918. catch (error) {
  5919. console.log('error=' + error);
  5920. alert(error);
  5921. }
  5922. finally {
  5923. }
  5924. });
  5925. }
  5926. logEventForGouMaiGan(qiuGanName) {
  5927. const ev = {
  5928. value: qiuGanName
  5929. };
  5930. const jsonStr = JSON.stringify(ev);
  5931. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5932. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5933. }
  5934. }
  5935. class DaoJuDisplay {
  5936. constructor(ui, index) {
  5937. this.index = 0;
  5938. this.uiIndex = 0;
  5939. this.ggSpid = "";
  5940. this.spid = 0;
  5941. this.ui = ui;
  5942. this.index = index;
  5943. this.initData();
  5944. }
  5945. initData() {
  5946. this.ui.btn_buy.onClick(this, this.gotoBuy);
  5947. let data = cfgTable.daoJuData[this.index + 1];
  5948. console.log('zh:' + JSON.stringify(data));
  5949. this.ui.nameTxt.text = data.spbt;
  5950. this.ui.n_jiaGe.text = data.spjg + "";
  5951. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  5952. this.ggSpid = data.ggSpid;
  5953. this.spid = data.spid;
  5954. let baseUrl = "asset/sound/ogg/";
  5955. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  5956. }
  5957. gotoBuy() {
  5958. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5959. if (userInfo != null) {
  5960. let token = userInfo.token;
  5961. let ggSpid = this.ggSpid;
  5962. let spid = this.spid;
  5963. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  5964. console.log('zh:gotoBuy1 spid =' + spid);
  5965. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  5966. return;
  5967. }
  5968. else {
  5969. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5970. }
  5971. }
  5972. gotoBuy1() {
  5973. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5974. let djItem = cfgTable.daoJuData[this.index + 1];
  5975. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  5976. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5977. if (userInfo == null) {
  5978. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5979. return;
  5980. }
  5981. let reqData = xGame.httpMgr.getReqData();
  5982. let pd = JSON.parse(reqData);
  5983. pd.spItem = djItem;
  5984. reqData = JSON.stringify(pd);
  5985. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  5986. try {
  5987. console.log('zh:buySp res = ' + JSON.stringify(res));
  5988. let code = res.code;
  5989. let msg = res.msg;
  5990. if (code == 401) {
  5991. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  5992. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5993. return;
  5994. }
  5995. if (code == 200) {
  5996. xGame.uiMgr.Show(UIMsg, msg);
  5997. DataMgr.getUserZiChanInfo();
  5998. }
  5999. else {
  6000. xGame.uiMgr.Show(UIMsg, msg);
  6001. }
  6002. }
  6003. catch (error) {
  6004. console.log('error=' + error);
  6005. alert(error);
  6006. }
  6007. finally {
  6008. }
  6009. });
  6010. }
  6011. }
  6012. class UIShop extends UIBase {
  6013. constructor() {
  6014. super();
  6015. this.itemNums = 0;
  6016. this.itemNumsForDj = 0;
  6017. this.curType = "";
  6018. }
  6019. onConstructor() {
  6020. this.ui = ui_UIShop.createInstance();
  6021. this.contentPane = this.ui;
  6022. this.isEject = false;
  6023. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6024. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6025. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6026. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6027. this.addUIClick(this.ui, this.interuptSecretary);
  6028. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6029. this.ballRodArr = [];
  6030. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6031. this.ui.myNode.myList.numItems = this.itemNums;
  6032. this.loadDjdata_old();
  6033. }
  6034. loadDjdata_old() {
  6035. let fff = cfgTable.daoJuData;
  6036. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6037. this.daoJuArr = [];
  6038. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6039. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6040. }
  6041. getProductList() {
  6042. let reqData = xGame.httpMgr.getReqData();
  6043. let pd = JSON.parse(reqData);
  6044. pd.splx = "Consumable";
  6045. reqData = JSON.stringify(pd);
  6046. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6047. try {
  6048. let code = res.code;
  6049. let msg = res.msg;
  6050. if (code == 401) {
  6051. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6052. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6053. return;
  6054. }
  6055. if (code == 200) {
  6056. let data = res.data;
  6057. for (let index = 0; index < data.length; index++) {
  6058. let element = data[index];
  6059. cfgTable.daoJuData[element.spid] = element;
  6060. }
  6061. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6062. }
  6063. else {
  6064. xGame.uiMgr.Show(UIMsg, msg);
  6065. }
  6066. }
  6067. catch (error) {
  6068. console.log('error=' + error);
  6069. alert(error);
  6070. }
  6071. finally {
  6072. }
  6073. });
  6074. }
  6075. show(type) {
  6076. super.show();
  6077. this.curType = type == 0 ? "qiugan" : "daoju";
  6078. this.switchBtn("");
  6079. this.playSecretaryIdle();
  6080. this.updateBallRod();
  6081. }
  6082. test123() {
  6083. console.log('zh:test123 ');
  6084. }
  6085. switchBtn(type) {
  6086. console.log('zh:1111切換 sel type=' + type);
  6087. if (type == "") {
  6088. type = this.curType;
  6089. }
  6090. else {
  6091. if (this.curType == type) {
  6092. return;
  6093. }
  6094. else {
  6095. this.curType = type;
  6096. }
  6097. }
  6098. if (type == "qiugan") {
  6099. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6100. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6101. this.ui.myNode.c1.selectedIndex = 0;
  6102. this.ui.myNode.myList.visible = true;
  6103. this.ui.myNode.djList.visible = false;
  6104. }
  6105. else {
  6106. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6107. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6108. this.ui.myNode.c1.selectedIndex = 1;
  6109. this.ui.myNode.myList.visible = false;
  6110. this.ui.myNode.djList.visible = true;
  6111. }
  6112. }
  6113. updateBallRod() {
  6114. for (let index = 0; index < this.ballRodArr.length; index++) {
  6115. this.ballRodArr[index].updateSelf();
  6116. }
  6117. }
  6118. renderBallRod(sort, obj) {
  6119. let index = this.getIndexBySort(sort + 1) - 1;
  6120. let ballRod = new BallRodDisplay(obj, index);
  6121. this.ballRodArr.push(ballRod);
  6122. }
  6123. renderDaoJu(idx, obj) {
  6124. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6125. let b = new DaoJuDisplay(obj, index);
  6126. this.daoJuArr.push(b);
  6127. }
  6128. getIndexBySort(sort) {
  6129. let object = cfgTable.ballrodData;
  6130. for (const key in object) {
  6131. if (object[key].sort == sort) {
  6132. return parseInt(key);
  6133. }
  6134. }
  6135. }
  6136. getIndexBySortForDj(idx) {
  6137. let object = cfgTable.daoJuData;
  6138. for (const key in object) {
  6139. if (object[key].idx == idx) {
  6140. return parseInt(key);
  6141. }
  6142. }
  6143. }
  6144. playSecretaryIdle() {
  6145. let parent = this.ui.secretary.displayObject;
  6146. parent.destroyChildren();
  6147. let xx = this.ui.secretary.width / 2;
  6148. let yy = this.ui.secretary.height;
  6149. let scale = xGame.common.getSecretaryScale();
  6150. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6151. xGame.common.secretary.play(data, 0, true, parent);
  6152. }
  6153. interuptSecretary() {
  6154. Laya.timer.clearAll(this);
  6155. this.playSecretaryRandomSound();
  6156. }
  6157. playSecretaryRandomSound() {
  6158. if (this.isHide)
  6159. return;
  6160. let time = xGame.common.randomNum(45000, 60000);
  6161. Laya.timer.once(time, this, () => {
  6162. if (this.isHide)
  6163. return;
  6164. let index = xGame.common.randomNum(4, 7);
  6165. xGame.soundMgr.playSound("s_main0" + index);
  6166. let words = 1;
  6167. switch (index) {
  6168. case 4:
  6169. words = 5;
  6170. break;
  6171. case 5:
  6172. words = 3;
  6173. break;
  6174. case 6:
  6175. words = 6;
  6176. break;
  6177. case 7:
  6178. words = 7;
  6179. break;
  6180. default:
  6181. break;
  6182. }
  6183. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6184. this.playSecretaryRandomSound();
  6185. });
  6186. }
  6187. closeSelf() {
  6188. this.hide();
  6189. }
  6190. }
  6191. UIShop.uiName = "UIShop";
  6192. class ui_UISign extends fgui.GComponent {
  6193. static createInstance() {
  6194. return (fgui.UIPackage.createObject("game", "UISign"));
  6195. }
  6196. onConstruct() {
  6197. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6198. this.n6 = (this.getChild("n6"));
  6199. this.closeNode = (this.getChild("closeNode"));
  6200. this.myNode = (this.getChild("myNode"));
  6201. this.moneyNode = (this.getChild("moneyNode"));
  6202. this.secretary = (this.getChild("secretary"));
  6203. this.talkNode = (this.getChild("talkNode"));
  6204. this.tripleBtn = (this.getChild("tripleBtn"));
  6205. this.normalBtn = (this.getChild("normalBtn"));
  6206. this.tipsNode = (this.getChild("tipsNode"));
  6207. this.againBtn = (this.getChild("againBtn"));
  6208. this.t0 = this.getTransition("t0");
  6209. }
  6210. }
  6211. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6212. class SignMax {
  6213. constructor(ui) {
  6214. this.ui = ui;
  6215. }
  6216. updateSelf(index, sameDay, curDayIndex) {
  6217. let data = cfgTable.signData[index + 1];
  6218. this.ui.titleTxt.text = data.title;
  6219. let arr1 = data.award[0].split('-');
  6220. let arr2 = data.award[1].split('-');
  6221. let num1 = parseInt(arr1[1]);
  6222. let num2 = parseInt(arr2[1]);
  6223. this.ui.numTxt1.text = num1 + "";
  6224. this.ui.numTxt2.text = num2 + "";
  6225. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6226. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6227. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6228. this.ui.numTxt1.visible = false;
  6229. }
  6230. else {
  6231. this.ui.numTxt1.visible = true;
  6232. }
  6233. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6234. this.ui.numTxt2.visible = false;
  6235. }
  6236. else {
  6237. this.ui.numTxt2.visible = true;
  6238. }
  6239. if (index < curDayIndex) {
  6240. this.ui.c1.selectedIndex = 1;
  6241. }
  6242. else if (index == curDayIndex) {
  6243. if (sameDay) {
  6244. this.ui.c1.selectedIndex = 2;
  6245. }
  6246. else {
  6247. this.ui.c1.selectedIndex = 2;
  6248. }
  6249. }
  6250. else {
  6251. this.ui.c1.selectedIndex = 0;
  6252. }
  6253. }
  6254. }
  6255. class SignNormal {
  6256. constructor(ui) {
  6257. this.ui = ui;
  6258. }
  6259. updateSelf(index, sameDay, curDayIndex) {
  6260. let data = cfgTable.signData[index + 1];
  6261. this.ui.titleTxt.text = data.title;
  6262. let arr = data.award[0].split('-');
  6263. let type = parseInt(arr[0]);
  6264. let num = parseInt(arr[1]);
  6265. this.ui.numTxt.text = num + "";
  6266. if (type > 2) {
  6267. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6268. this.ui.myIcon.rotation = 0;
  6269. }
  6270. else {
  6271. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6272. this.ui.myIcon.rotation = 0;
  6273. }
  6274. if (xGame.common.signAwardContainsRod(data.award)) {
  6275. this.ui.numTxt.visible = false;
  6276. }
  6277. else {
  6278. this.ui.numTxt.visible = true;
  6279. }
  6280. if (index < curDayIndex) {
  6281. this.ui.c1.selectedIndex = 1;
  6282. }
  6283. else if (index == curDayIndex) {
  6284. if (sameDay) {
  6285. this.ui.c1.selectedIndex = 2;
  6286. }
  6287. else {
  6288. this.ui.c1.selectedIndex = 2;
  6289. }
  6290. }
  6291. else {
  6292. this.ui.c1.selectedIndex = 0;
  6293. }
  6294. }
  6295. }
  6296. class UISign extends UIBase {
  6297. constructor() {
  6298. super();
  6299. this.curDayIndex = 0;
  6300. this.starX = 0;
  6301. }
  6302. onConstructor() {
  6303. this.ui = ui_UISign.createInstance();
  6304. this.contentPane = this.ui;
  6305. this.isEject = false;
  6306. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6307. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6308. this.initSignItem();
  6309. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6310. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6311. }
  6312. show() {
  6313. super.show();
  6314. this.ui.t0.play();
  6315. this.playSecretaryIdle();
  6316. this.updateSign();
  6317. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6318. }
  6319. initSignItem() {
  6320. this.signArr = [];
  6321. for (let index = 0; index < 6; index++) {
  6322. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6323. this.signArr.push(temp);
  6324. }
  6325. this.signMax = new SignMax(this.ui.myNode.day7);
  6326. if (Moyu.isKs)
  6327. this.ui.closeNode.closeBtn.x += 100;
  6328. }
  6329. updateSign() {
  6330. let sameDay = xGame.common.judgeSameDay();
  6331. let max = 7;
  6332. this.curDayIndex = DataMgr.getSignData();
  6333. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6334. this.curDayIndex = 0;
  6335. if (!sameDay) {
  6336. this.ui.normalBtn.visible = true;
  6337. this.ui.tipsNode.visible = false;
  6338. this.ui.againBtn.visible = false;
  6339. }
  6340. else {
  6341. this.ui.normalBtn.visible = false;
  6342. let again = DataMgr.getExtraSign();
  6343. let isCurrency = false;
  6344. let index = this.curDayIndex;
  6345. if (index == 0)
  6346. index = 7;
  6347. let award = cfgTable.signData[index].award;
  6348. let num = award[0].split("-")[0];
  6349. if (num == "1" || num == "2")
  6350. isCurrency = true;
  6351. let showAgain = again == 0 && isCurrency;
  6352. this.ui.againBtn.visible = showAgain;
  6353. this.ui.tipsNode.visible = !showAgain;
  6354. }
  6355. for (let index = 0; index < this.signArr.length; index++) {
  6356. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6357. }
  6358. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6359. }
  6360. playSecretaryIdle() {
  6361. let parent = this.ui.secretary.displayObject;
  6362. parent.destroyChildren();
  6363. let xx = this.ui.secretary.width / 2;
  6364. let yy = this.ui.secretary.height;
  6365. let scale = xGame.common.getSecretaryScale();
  6366. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6367. xGame.common.secretary.play(data, 0, true, parent);
  6368. }
  6369. closeSelf() {
  6370. this.hide();
  6371. }
  6372. normalGetAward() {
  6373. let sameDay = xGame.common.judgeSameDay();
  6374. if (!sameDay) {
  6375. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6376. let temp;
  6377. let type;
  6378. let num;
  6379. let arr = [];
  6380. for (let index = 0; index < award.length; index++) {
  6381. temp = award[index].split("-");
  6382. type = parseInt(temp[0]);
  6383. num = parseInt(temp[1]);
  6384. let awardType = new AwardType();
  6385. awardType.num = num;
  6386. awardType.type = type;
  6387. arr.push(awardType);
  6388. }
  6389. xGame.common.getAward(arr, (watchVideo) => {
  6390. this.curDayIndex++;
  6391. if (this.curDayIndex > 7)
  6392. this.curDayIndex = 0;
  6393. DataMgr.setSignData(this.curDayIndex);
  6394. this.updateSignData2Server(this.curDayIndex);
  6395. DataMgr.setSignTime(new Date().getTime());
  6396. if (watchVideo) {
  6397. DataMgr.setExtraSign(1);
  6398. Moyu.sendDataEvent("signIn1");
  6399. }
  6400. this.updateSign();
  6401. });
  6402. }
  6403. }
  6404. againGetAward() {
  6405. Moyu.sendDataEvent("signIn2");
  6406. console.log('zh:qjff_AD_for_uisign');
  6407. if (Laya.Browser.onAndroid) {
  6408. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6409. if (!boo) {
  6410. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6411. return;
  6412. }
  6413. }
  6414. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6415. }
  6416. else {
  6417. console.log('zh:AD 失败,直接发放奖励');
  6418. this.qjff_AD_for_uisign();
  6419. }
  6420. }
  6421. qjff_AD_for_uisign() {
  6422. let index = this.curDayIndex;
  6423. if (index == 0)
  6424. index = 7;
  6425. let award = cfgTable.signData[index].award;
  6426. let temp;
  6427. let type;
  6428. let num;
  6429. for (let index = 0; index < award.length; index++) {
  6430. temp = award[index].split("-");
  6431. type = parseInt(temp[0]);
  6432. num = parseInt(temp[1]) * 3;
  6433. xGame.common.playObjFlyAnim(num, type);
  6434. }
  6435. DataMgr.setExtraSign(1);
  6436. this.updateSign();
  6437. }
  6438. updateSignData2Server(day) {
  6439. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6440. if (userInfo == null) {
  6441. return;
  6442. }
  6443. let reqData = xGame.httpMgr.getReqData();
  6444. let pd = JSON.parse(reqData);
  6445. pd.signData = day;
  6446. reqData = JSON.stringify(pd);
  6447. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6448. try {
  6449. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6450. let code = res.code;
  6451. let msg = res.msg;
  6452. if (code == 401) {
  6453. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  6454. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6455. return;
  6456. }
  6457. if (code == 200) {
  6458. let data = res.data;
  6459. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6460. }
  6461. else {
  6462. xGame.uiMgr.Show(UIMsg, msg);
  6463. }
  6464. }
  6465. catch (error) {
  6466. console.log('error=' + error);
  6467. alert(error);
  6468. }
  6469. finally {
  6470. }
  6471. });
  6472. }
  6473. }
  6474. UISign.uiName = "UISign";
  6475. class ui_UISkill extends fgui.GComponent {
  6476. static createInstance() {
  6477. return (fgui.UIPackage.createObject("game", "UISkill"));
  6478. }
  6479. onConstruct() {
  6480. this.n48 = (this.getChild("n48"));
  6481. this.n0 = (this.getChild("n0"));
  6482. this.secretary = (this.getChild("secretary"));
  6483. this.talkNode = (this.getChild("talkNode"));
  6484. this.closeNode = (this.getChild("closeNode"));
  6485. this.moneyNode = (this.getChild("moneyNode"));
  6486. this.skillNode = (this.getChild("skillNode"));
  6487. this.guideNode = (this.getChild("guideNode"));
  6488. }
  6489. }
  6490. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6491. class SkillDisplay {
  6492. constructor(ui, data, uiIndex) {
  6493. this.starX = 0;
  6494. this.starY = 0;
  6495. this.index = 0;
  6496. this.ui = ui;
  6497. this.data = data;
  6498. this.index = uiIndex;
  6499. this.initSelf();
  6500. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6501. }
  6502. initSelf() {
  6503. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6504. this.ui.nameTxt.text = this.data.name;
  6505. this.ui.describeTxt.text = this.data.describe;
  6506. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6507. this.ui.startBtn.onClick(this, this.startGame);
  6508. this.updateSelf();
  6509. }
  6510. updateSelf() {
  6511. this.checkTry();
  6512. let level = DataMgr.getBigSkillByIndex(this.index);
  6513. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6514. }
  6515. checkTry() {
  6516. let index = this.index;
  6517. let level = DataMgr.getBigSkillByIndex(index);
  6518. if (level == null) {
  6519. DataMgr.setBigSkill(index, 1, false);
  6520. level = 1;
  6521. }
  6522. this.ui.levelTxt.text = "LV." + level;
  6523. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6524. this.ui.tryNode.visible = true;
  6525. else
  6526. this.ui.tryNode.visible = false;
  6527. }
  6528. clickAddLevel() {
  6529. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6530. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6531. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6532. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6533. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6534. }
  6535. else {
  6536. console.log('zh:AD 失败,直接发放奖励');
  6537. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6538. }
  6539. }
  6540. qjff_AD_for_skilldisplay_clickAddLevel() {
  6541. DataMgr.setBigSkill(this.data.index, 1);
  6542. this.updateSelf();
  6543. xGame.common.upSkillLevel = true;
  6544. }
  6545. startGame() {
  6546. console.log('zh:rod skill startgame');
  6547. if (this.data.index == 3) {
  6548. alert('Coming soon!');
  6549. return;
  6550. }
  6551. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6552. let needCoin = xGame.common.bigMoveNeedCoin;
  6553. xGame.common.passAwardCoin = 2000;
  6554. let guide = DataMgr.getSkillGuide();
  6555. console.log('zh:startGame guide=' + guide);
  6556. xGame.common.temSelfLevel = 0;
  6557. if (guide == 0) {
  6558. needCoin = 0;
  6559. xGame.common.temSelfLevel = 100;
  6560. }
  6561. if (DataMgr.coinEnough(needCoin)) {
  6562. DataMgr.setCoin(-needCoin);
  6563. xGame.common.curPlayerSkillType = this.index;
  6564. if (guide == 0)
  6565. xGame.common.curPlayerSkillType = 0;
  6566. console.log('zh: skilldisplay 1');
  6567. xGame.uiMgr.Show(UIGame);
  6568. xGame.uiMgr.Hide(UIMain);
  6569. xGame.uiMgr.Show(UIMatching, () => {
  6570. xGame.common.gameUI.ui.alpha = 1;
  6571. xGame.common.gameUI.startGame();
  6572. xGame.uiMgr.Hide(UISkill);
  6573. });
  6574. this.logEventForRod_start();
  6575. }
  6576. else {
  6577. console.log('zh: skilldisplay 2');
  6578. xGame.uiMgr.Show(UIAddProp, 0);
  6579. Moyu.sendDataEvent("AddCoinVideo");
  6580. }
  6581. }
  6582. logEventForRod_start() {
  6583. let gfmsIdx = xGame.common.curPlayerSkillType;
  6584. console.log('zh:选择的技能=' + gfmsIdx);
  6585. let gfmc = 'Skyfall Shot';
  6586. if (gfmsIdx == 0) {
  6587. gfmc = 'Skyfall Shot';
  6588. }
  6589. if (gfmsIdx == 1) {
  6590. gfmc = 'Surging break';
  6591. }
  6592. if (gfmsIdx == 2) {
  6593. gfmc = 'Frost Lock';
  6594. }
  6595. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6596. let jsonStr = {
  6597. "count": 0,
  6598. "name": gfmc
  6599. };
  6600. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6601. const d = LocalStorageManager.getItem(keyStr);
  6602. jsonStr.count = d.count + 1;
  6603. LocalStorageManager.setItem(keyStr, jsonStr);
  6604. }
  6605. else {
  6606. LocalStorageManager.setItem(keyStr, jsonStr);
  6607. }
  6608. const reqStr = JSON.stringify(jsonStr);
  6609. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6610. }
  6611. }
  6612. class UISkill extends UIBase {
  6613. constructor() {
  6614. super();
  6615. this.skillData = [];
  6616. }
  6617. onConstructor() {
  6618. this.ui = ui_UISkill.createInstance();
  6619. this.contentPane = this.ui;
  6620. this.isEject = false;
  6621. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6622. this.initSkillData();
  6623. console.log('zh:aaaaaa1111111111');
  6624. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6625. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6626. console.log('zh:aaaaaa22222222');
  6627. this.displayList = [];
  6628. this.ui.skillNode.skillList.numItems = 3;
  6629. this.addUIClick(this.ui, this.interuptSecretary);
  6630. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6631. this.ui.talkNode.visible = false;
  6632. if (Moyu.isKs)
  6633. this.ui.closeNode.closeBtn.x += 100;
  6634. }
  6635. show() {
  6636. super.show();
  6637. this.playSecretaryIdle();
  6638. this.moneyNode.ui.c1.selectedIndex = 1;
  6639. Laya.timer.clearAll(this);
  6640. xGame.soundMgr.playSound("s_start");
  6641. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6642. let guide = DataMgr.getSkillGuide();
  6643. this.ui.guideNode.visible = guide == 0;
  6644. let item = this.getSkillItemByUIIndex(0);
  6645. if (guide == 0) {
  6646. item.ui.c1.selectedIndex = 1;
  6647. }
  6648. else {
  6649. item.ui.c1.selectedIndex = 0;
  6650. }
  6651. this.ui.guideNode.guideBtn.visible = guide == 0;
  6652. for (let index = 0; index < this.displayList.length; index++) {
  6653. this.displayList[index].checkTry();
  6654. }
  6655. }
  6656. getSkillItemByUIIndex(cur) {
  6657. for (let index = 0; index < this.displayList.length; index++) {
  6658. if (this.displayList[index].index == cur) {
  6659. return this.displayList[index];
  6660. }
  6661. }
  6662. }
  6663. enterGuideLevel() {
  6664. let item = this.getSkillItemByUIIndex(0);
  6665. item.startGame();
  6666. if (DataMgr.getNewUser())
  6667. Moyu.sendDataEvent("gameStart1");
  6668. }
  6669. initSkillData() {
  6670. this.skillData = [];
  6671. let nameList = xGame.common.skillNameList;
  6672. let iconList = xGame.common.skillIconList;
  6673. let describeList = [
  6674. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6675. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6676. "The power of frost descends—freezing the flow and taking full control of the game!"
  6677. ];
  6678. console.log('zh:initSkillData 111111111');
  6679. let data;
  6680. for (let index = 0; index < nameList.length; index++) {
  6681. data = {};
  6682. data.name = nameList[index];
  6683. data.icon = iconList[index];
  6684. data.describe = describeList[index];
  6685. data.index = index;
  6686. this.skillData.push(data);
  6687. }
  6688. }
  6689. updateSkillItem(index, target) {
  6690. if (this.displayList[index] == null) {
  6691. let uiIndex;
  6692. switch (index) {
  6693. case 0:
  6694. uiIndex = 1;
  6695. break;
  6696. case 1:
  6697. uiIndex = 0;
  6698. break;
  6699. case 2:
  6700. uiIndex = 2;
  6701. break;
  6702. case 3:
  6703. uiIndex = 3;
  6704. break;
  6705. default:
  6706. break;
  6707. }
  6708. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6709. this.displayList.push(temp);
  6710. }
  6711. }
  6712. playSecretaryIdle() {
  6713. let parent = this.ui.secretary.displayObject;
  6714. parent.destroyChildren();
  6715. let xx = this.ui.secretary.width / 2;
  6716. let yy = this.ui.secretary.height;
  6717. let scale = xGame.common.getSecretaryScale();
  6718. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6719. xGame.common.secretary.play(data, 0, true, parent);
  6720. }
  6721. returnUIMain() {
  6722. this.hide();
  6723. xGame.common.stopGirlPop(this.ui.talkNode);
  6724. xGame.uiMgr.Show(UIMain);
  6725. }
  6726. interuptSecretary() {
  6727. Laya.timer.clearAll(this);
  6728. this.playSecretaryRandomSound();
  6729. }
  6730. playSecretaryRandomSound() {
  6731. if (this.isHide)
  6732. return;
  6733. let time = xGame.common.randomNum(45000, 60000);
  6734. Laya.timer.once(time, this, () => {
  6735. if (this.isHide)
  6736. return;
  6737. let index = xGame.common.randomNum(4, 7);
  6738. xGame.soundMgr.playSound("s_main0" + index);
  6739. let words = 1;
  6740. switch (index) {
  6741. case 4:
  6742. words = 5;
  6743. break;
  6744. case 5:
  6745. words = 3;
  6746. break;
  6747. case 6:
  6748. words = 6;
  6749. break;
  6750. case 7:
  6751. words = 7;
  6752. break;
  6753. default:
  6754. break;
  6755. }
  6756. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6757. this.playSecretaryRandomSound();
  6758. });
  6759. }
  6760. }
  6761. UISkill.uiName = "UISkill";
  6762. class ui_UIModeSelection extends fgui.GComponent {
  6763. static createInstance() {
  6764. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6765. }
  6766. onConstruct() {
  6767. this.n19 = (this.getChild("n19"));
  6768. this.closeBtn = (this.getChild("closeBtn"));
  6769. this.myNode = (this.getChild("myNode"));
  6770. this.t0 = this.getTransition("t0");
  6771. }
  6772. }
  6773. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6774. class UIModeSelection extends UIBase {
  6775. constructor() {
  6776. super();
  6777. }
  6778. onConstructor() {
  6779. this.ui = ui_UIModeSelection.createInstance();
  6780. this.contentPane = this.ui;
  6781. this.isEject = false;
  6782. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6783. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6784. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6785. this.addUIClick(this.ui.closeBtn, this.hide);
  6786. this.peopleArr = [65, 990, 580];
  6787. this.peopleOffest = [5, 10, 10];
  6788. }
  6789. show(callback) {
  6790. this.updateSelf();
  6791. super.show();
  6792. this.ui.t0.play();
  6793. this.callback = callback;
  6794. }
  6795. updateSelf() {
  6796. let cfg = cfgTable.modeselectData;
  6797. for (let index = 1; index <= 3; index++) {
  6798. let node = this.ui.myNode["type" + index];
  6799. node.need.text = cfg[index].need;
  6800. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6801. node.peopleTxt.text = this.getRandPeople(index - 1);
  6802. }
  6803. }
  6804. enterGame(type) {
  6805. console.log('zh: 进入经典模式 type: ' + type);
  6806. xGame.common.classicRoomType = type;
  6807. let cfg = cfgTable.modeselectData[type];
  6808. let need = cfg.need;
  6809. xGame.common.passAwardCoin = cfg.award;
  6810. if (DataMgr.coinEnough(need)) {
  6811. DataMgr.setCoin(-need);
  6812. this.ui.myNode["type" + type].t0.play();
  6813. Laya.timer.once(200, this, () => {
  6814. this.callback && this.callback();
  6815. });
  6816. this.logEventForClassic_start();
  6817. }
  6818. else {
  6819. Moyu.sendDataEvent("AddCoinVideo");
  6820. xGame.uiMgr.Show(UIAddProp, 0);
  6821. }
  6822. }
  6823. getRandPeople(index) {
  6824. let rand = this.peopleOffest[index];
  6825. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6826. }
  6827. logEventForClassic_start() {
  6828. let rtype = xGame.common.classicRoomType;
  6829. let msmc = '';
  6830. if (rtype == 1) {
  6831. msmc = 'beginner';
  6832. }
  6833. if (rtype == 2) {
  6834. msmc = 'expert';
  6835. }
  6836. if (rtype == 3) {
  6837. msmc = 'master';
  6838. }
  6839. let keyStr = 'sjmd_classic_start_' + rtype;
  6840. let jsonStr = {
  6841. "difficulty": msmc,
  6842. "classic_count": 1,
  6843. "difficulty_count": 1
  6844. };
  6845. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6846. const d = LocalStorageManager.getItem(keyStr);
  6847. jsonStr.classic_count = d.classic_count + 1;
  6848. jsonStr.difficulty_count = d.difficulty_count + 1;
  6849. LocalStorageManager.setItem(keyStr, jsonStr);
  6850. }
  6851. else {
  6852. LocalStorageManager.setItem(keyStr, jsonStr);
  6853. }
  6854. const reqStr = JSON.stringify(jsonStr);
  6855. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6856. }
  6857. }
  6858. UIModeSelection.uiName = "UIModeSelection";
  6859. class ui_UIReg extends fgui.GComponent {
  6860. static createInstance() {
  6861. return (fgui.UIPackage.createObject("game", "UIReg"));
  6862. }
  6863. onConstruct() {
  6864. this.n38 = (this.getChild("n38"));
  6865. this.n9 = (this.getChild("n9"));
  6866. this.n14 = (this.getChild("n14"));
  6867. this.n15 = (this.getChild("n15"));
  6868. this.n34 = (this.getChild("n34"));
  6869. this.closeBtn = (this.getChild("closeBtn"));
  6870. this.lab_tip = (this.getChild("lab_tip"));
  6871. this.n43 = (this.getChild("n43"));
  6872. this.txt_ua = (this.getChild("txt_ua"));
  6873. this.n44 = (this.getChild("n44"));
  6874. this.txt_up1 = (this.getChild("txt_up1"));
  6875. this.n45 = (this.getChild("n45"));
  6876. this.txt_up2 = (this.getChild("txt_up2"));
  6877. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6878. this.btn_reg = (this.getChild("btn_reg"));
  6879. this.n50 = (this.getChild("n50"));
  6880. }
  6881. }
  6882. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6883. class ui_UILogin extends fgui.GComponent {
  6884. static createInstance() {
  6885. return (fgui.UIPackage.createObject("game", "UILogin"));
  6886. }
  6887. onConstruct() {
  6888. this.c1 = this.getController("c1");
  6889. this.n18 = (this.getChild("n18"));
  6890. this.n7 = (this.getChild("n7"));
  6891. this.n5 = (this.getChild("n5"));
  6892. this.n6 = (this.getChild("n6"));
  6893. this.closeBtn = (this.getChild("closeBtn"));
  6894. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6895. this.btn_login = (this.getChild("btn_login"));
  6896. this.n30 = (this.getChild("n30"));
  6897. this.n31 = (this.getChild("n31"));
  6898. this.txt_up = (this.getChild("txt_up"));
  6899. this.n32 = (this.getChild("n32"));
  6900. this.txt_ua = (this.getChild("txt_ua"));
  6901. }
  6902. }
  6903. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6904. class UILogin extends UIBase {
  6905. constructor() {
  6906. super();
  6907. }
  6908. onConstructor() {
  6909. this.ui = ui_UILogin.createInstance();
  6910. this.contentPane = this.ui;
  6911. this.isEject = false;
  6912. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6913. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6914. this.addUIClick(this.ui.btn_login, this.userLogin);
  6915. }
  6916. show() {
  6917. super.show();
  6918. this.x = (Laya.stage.width - this.width) / 2;
  6919. this.y = (Laya.stage.height - this.height) / 2;
  6920. }
  6921. closeSelf() {
  6922. this.hide();
  6923. }
  6924. userLogin() {
  6925. let ua = this.ui.txt_ua.text;
  6926. let up = this.ui.txt_up.text;
  6927. if (ua && up) {
  6928. let reqData = JSON.stringify({
  6929. username: ua.trim(),
  6930. password: up.trim(),
  6931. fromMark: 'app_game'
  6932. });
  6933. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6934. try {
  6935. console.log('zh:res = ' + JSON.stringify(res));
  6936. let code = res.code;
  6937. let msg = res.msg;
  6938. if (code == 200) {
  6939. let keyStr = keyForLoginInfo;
  6940. let jsonStr = {
  6941. "username": res.username,
  6942. "token": res.token,
  6943. "buySpids": { 1: false, 7: false }
  6944. };
  6945. LocalStorageManager.setItem(keyStr, jsonStr);
  6946. let myu = Moyu.getUserInfo();
  6947. console.log('zh:myu = ' + JSON.stringify(myu));
  6948. DataMgr.updateUserNickName(res.username);
  6949. Moyu.updateUserInfo(res.username);
  6950. xGame.uiMgr.Show(UIMsg, msg);
  6951. DataMgr.getUserZiChanInfo();
  6952. xGame.eventMgr.event(LOGIN_IN);
  6953. this.closeSelf();
  6954. }
  6955. else {
  6956. xGame.uiMgr.Show(UIMsg, msg);
  6957. }
  6958. }
  6959. catch (error) {
  6960. console.log('error=' + error);
  6961. alert(error);
  6962. }
  6963. finally {
  6964. }
  6965. });
  6966. }
  6967. else {
  6968. xGame.uiMgr.Show(UIMsg, "Missing information!");
  6969. }
  6970. }
  6971. gotoRegPage() {
  6972. this.closeSelf();
  6973. xGame.uiMgr.Show(UIReg);
  6974. }
  6975. }
  6976. UILogin.uiName = "UILogin";
  6977. class UIReg extends UIBase {
  6978. constructor() {
  6979. super();
  6980. }
  6981. onConstructor() {
  6982. this.ui = ui_UIReg.createInstance();
  6983. this.contentPane = this.ui;
  6984. this.isEject = false;
  6985. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6986. this.addUIClick(this.ui.btn_reg, this.regUser);
  6987. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  6988. }
  6989. show() {
  6990. super.show();
  6991. this.x = (Laya.stage.width - this.width) / 2;
  6992. this.y = (Laya.stage.height - this.height) / 2;
  6993. }
  6994. closeSelf() {
  6995. this.hide();
  6996. }
  6997. regUser() {
  6998. this.ui.lab_tip.visible = false;
  6999. let ua = this.ui.txt_ua.text;
  7000. let up1 = this.ui.txt_up1.text;
  7001. let up2 = this.ui.txt_up2.text;
  7002. if (ua && up1 && up2 && up1 == up2) {
  7003. let reqData = JSON.stringify({
  7004. username: ua.trim(),
  7005. password: up1.trim(),
  7006. fromMark: 'app_game'
  7007. });
  7008. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7009. try {
  7010. console.log('zh:res = ' + JSON.stringify(res));
  7011. let code = res.code;
  7012. let msg = res.msg;
  7013. xGame.uiMgr.Show(UIMsg, msg);
  7014. if (code == 200) {
  7015. this.ui.lab_tip.color = "#FFFFFF";
  7016. xGame.uiMgr.Show(UIMsg, msg);
  7017. this.closeSelf();
  7018. }
  7019. else {
  7020. this.ui.lab_tip.color = "#FF0000";
  7021. xGame.uiMgr.Show(UIMsg, msg);
  7022. }
  7023. }
  7024. catch (error) {
  7025. console.log('error=' + error);
  7026. alert(error);
  7027. }
  7028. finally {
  7029. }
  7030. });
  7031. }
  7032. else {
  7033. if (up1 != up2) {
  7034. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7035. }
  7036. else {
  7037. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7038. }
  7039. }
  7040. }
  7041. gotoLogin() {
  7042. this.closeSelf();
  7043. xGame.uiMgr.Show(UILogin);
  7044. }
  7045. }
  7046. UIReg.uiName = "UIReg";
  7047. class ui_UIFuli1 extends fgui.GComponent {
  7048. static createInstance() {
  7049. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  7050. }
  7051. onConstruct() {
  7052. this.n1 = (this.getChild("n1"));
  7053. this.n2 = (this.getChild("n2"));
  7054. }
  7055. }
  7056. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  7057. class UIFuli1 extends UIBase {
  7058. constructor() {
  7059. super();
  7060. }
  7061. onConstructor() {
  7062. this.ui = ui_UIFuli1.createInstance();
  7063. this.contentPane = this.ui;
  7064. this.isEject = false;
  7065. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7066. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7067. }
  7068. show() {
  7069. super.show();
  7070. this.x = (Laya.stage.width - this.width) / 2;
  7071. this.y = (Laya.stage.height - this.height) / 2;
  7072. }
  7073. closeSelf() {
  7074. this.hide();
  7075. }
  7076. gotoBuy() {
  7077. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7078. if (userInfo != null) {
  7079. let token = userInfo.token;
  7080. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7081. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  7082. return;
  7083. }
  7084. else {
  7085. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7086. }
  7087. }
  7088. gotoBuy2() {
  7089. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7090. if (userInfo == null) {
  7091. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7092. return;
  7093. }
  7094. let reqData = xGame.httpMgr.getReqData();
  7095. let pd = JSON.parse(reqData);
  7096. pd.productId = 1;
  7097. reqData = JSON.stringify(pd);
  7098. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7099. try {
  7100. console.log('zh:buySp res = ' + JSON.stringify(res));
  7101. let code = res.code;
  7102. let msg = res.msg;
  7103. if (code == 401) {
  7104. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7105. alert(TIP_MSG_key.loginTimeOut);
  7106. xGame.uiMgr.Show(UIMsg, msg);
  7107. return;
  7108. }
  7109. if (code == 200) {
  7110. xGame.uiMgr.Show(UIMsg, msg);
  7111. DataMgr.getUserZiChanInfo();
  7112. this.closeSelf();
  7113. }
  7114. else {
  7115. xGame.uiMgr.Show(UIMsg, msg);
  7116. }
  7117. }
  7118. catch (error) {
  7119. console.log('error=' + error);
  7120. alert(error);
  7121. }
  7122. finally {
  7123. }
  7124. });
  7125. }
  7126. }
  7127. UIFuli1.uiName = "UIFuli1";
  7128. class ui_UIFuli2 extends fgui.GComponent {
  7129. static createInstance() {
  7130. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7131. }
  7132. onConstruct() {
  7133. this.n1 = (this.getChild("n1"));
  7134. this.n0 = (this.getChild("n0"));
  7135. }
  7136. }
  7137. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7138. class UIFuli2 extends UIBase {
  7139. constructor() {
  7140. super();
  7141. }
  7142. onConstructor() {
  7143. this.ui = ui_UIFuli2.createInstance();
  7144. this.contentPane = this.ui;
  7145. this.isEject = false;
  7146. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  7147. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  7148. }
  7149. show() {
  7150. super.show();
  7151. this.x = (Laya.stage.width - this.width) / 2;
  7152. this.y = (Laya.stage.height - this.height) / 2;
  7153. }
  7154. closeSelf() {
  7155. this.hide();
  7156. }
  7157. gotoBuy() {
  7158. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7159. if (userInfo != null) {
  7160. let token = userInfo.token;
  7161. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7162. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  7163. return;
  7164. }
  7165. else {
  7166. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7167. }
  7168. }
  7169. gotoBuy1() {
  7170. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7171. if (userInfo == null) {
  7172. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7173. return;
  7174. }
  7175. let reqData = xGame.httpMgr.getReqData();
  7176. let pd = JSON.parse(reqData);
  7177. pd.productId = 2;
  7178. reqData = JSON.stringify(pd);
  7179. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7180. try {
  7181. console.log('zh:buySp res = ' + JSON.stringify(res));
  7182. let code = res.code;
  7183. let msg = res.msg;
  7184. if (code == 401) {
  7185. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7186. alert(TIP_MSG_key.loginTimeOut);
  7187. xGame.uiMgr.Show(UIMsg, msg);
  7188. return;
  7189. }
  7190. if (code == 200) {
  7191. xGame.uiMgr.Show(UIMsg, msg);
  7192. DataMgr.getUserZiChanInfo();
  7193. this.closeSelf();
  7194. }
  7195. else {
  7196. xGame.uiMgr.Show(UIMsg, msg);
  7197. }
  7198. }
  7199. catch (error) {
  7200. console.log('error=' + error);
  7201. alert(error);
  7202. }
  7203. finally {
  7204. }
  7205. });
  7206. }
  7207. }
  7208. UIFuli2.uiName = "UIFuli2";
  7209. class ui_UIGetAward extends fgui.GComponent {
  7210. static createInstance() {
  7211. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7212. }
  7213. onConstruct() {
  7214. this.n4 = (this.getChild("n4"));
  7215. this.n0 = (this.getChild("n0"));
  7216. this.myList = (this.getChild("myList"));
  7217. this.n1 = (this.getChild("n1"));
  7218. this.eftNode = (this.getChild("eftNode"));
  7219. this.btnNode = (this.getChild("btnNode"));
  7220. this.t0 = this.getTransition("t0");
  7221. }
  7222. }
  7223. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7224. class UIGetAward extends UIBase {
  7225. constructor() {
  7226. super();
  7227. this.showTriple = true;
  7228. }
  7229. onConstructor() {
  7230. this.ui = ui_UIGetAward.createInstance();
  7231. this.contentPane = this.ui;
  7232. this.isEject = false;
  7233. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7234. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7235. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7236. }
  7237. show(arr, showTriple, callback) {
  7238. super.show();
  7239. this.ui.t0.play();
  7240. this.ui.eftNode.visible = true;
  7241. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7242. this.ui.eftNode.visible = false;
  7243. }), 1, 0, 0, 0.9);
  7244. this.awardArr = arr;
  7245. this.showTriple = showTriple;
  7246. this.callback = callback;
  7247. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7248. this.ui.myList.numItems = arr.length;
  7249. xGame.soundMgr.playSound("getaward");
  7250. }
  7251. updateSelf(index, obj) {
  7252. let temp = this.awardArr[index];
  7253. let icon = this.getIcon(temp.type);
  7254. let str = icon;
  7255. if (temp.type > 2) {
  7256. str = "s" + icon;
  7257. }
  7258. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7259. obj.myIcon.rotation = 0;
  7260. obj.numTxt.text = temp.num + "";
  7261. obj.numTxt.visible = temp.type > 2 ? false : true;
  7262. obj.nameTxt.text = this.getNameStr(temp.type);
  7263. }
  7264. renderItem(index, obj) {
  7265. this.updateSelf(index, obj);
  7266. }
  7267. tripleGetAward() {
  7268. console.log('zh:qjff_AD_for_uigetAward');
  7269. if (Laya.Browser.onAndroid) {
  7270. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7271. if (!boo) {
  7272. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7273. return;
  7274. }
  7275. }
  7276. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7277. }
  7278. else {
  7279. console.log('zh:AD 失败,直接发放奖励');
  7280. this.qjff_AD_for_uigetAward();
  7281. }
  7282. }
  7283. qjff_AD_for_uigetAward() {
  7284. this.getAward(3);
  7285. }
  7286. normalGetAward() {
  7287. if (PlatMgr.isMisVideo())
  7288. this.tripleGetAward();
  7289. else
  7290. this.getAward();
  7291. }
  7292. getAward(times = 1) {
  7293. this.hide();
  7294. for (let index = 0; index < this.awardArr.length; index++) {
  7295. this.awardArr[index].num *= times;
  7296. }
  7297. this.callback && this.callback(times != 1);
  7298. }
  7299. getIcon(type) {
  7300. switch (type) {
  7301. case Prop.diamond:
  7302. return "ty_zs";
  7303. case Prop.coin:
  7304. return "ty_jb";
  7305. case Prop.gan1:
  7306. return "qg1";
  7307. case Prop.gan2:
  7308. return "qg2";
  7309. case Prop.gan3:
  7310. return "qg3";
  7311. case Prop.gan4:
  7312. return "qg4";
  7313. default:
  7314. break;
  7315. }
  7316. }
  7317. getNameStr(type) {
  7318. switch (type) {
  7319. case Prop.diamond:
  7320. return "Diamond";
  7321. case Prop.coin:
  7322. return "Coins";
  7323. case Prop.gan1:
  7324. case Prop.gan2:
  7325. case Prop.gan3:
  7326. case Prop.gan4:
  7327. return cfgTable.ballrodData[type - 1].name;
  7328. default:
  7329. break;
  7330. }
  7331. }
  7332. }
  7333. UIGetAward.uiName = "UIGetAward";
  7334. class ui_UIRepentProp extends fgui.GComponent {
  7335. static createInstance() {
  7336. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7337. }
  7338. onConstruct() {
  7339. this.c1 = this.getController("c1");
  7340. this.n11 = (this.getChild("n11"));
  7341. this.regretNode = (this.getChild("regretNode"));
  7342. this.helpLineNode = (this.getChild("helpLineNode"));
  7343. this.t0 = this.getTransition("t0");
  7344. }
  7345. }
  7346. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7347. class UIRepentProp extends UIBase {
  7348. constructor() {
  7349. super();
  7350. this.viewType = 0;
  7351. this.regretType = 0;
  7352. }
  7353. onConstructor() {
  7354. this.ui = ui_UIRepentProp.createInstance();
  7355. this.contentPane = this.ui;
  7356. this.isEject = false;
  7357. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7358. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7359. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7360. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7361. }
  7362. show(viewType, regretType, callback) {
  7363. PlatMgr.showInsert(true);
  7364. this.viewType = viewType;
  7365. this.regretType = regretType;
  7366. this.callback = callback;
  7367. super.show();
  7368. this.ui.t0.play();
  7369. this.ui.c1.selectedIndex = this.viewType;
  7370. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7371. if (this.viewType == 0) {
  7372. let guide = DataMgr.getGuideHelpLine();
  7373. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7374. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7375. }
  7376. xGame.common.gameMgr.gamePause = true;
  7377. }
  7378. hideSelf() {
  7379. xGame.common.gameMgr.gamePause = false;
  7380. this.callback && this.callback(false);
  7381. this.hide();
  7382. }
  7383. videoRegret() {
  7384. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7385. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7386. }
  7387. else {
  7388. console.log('zh:AD 失败,直接发放奖励');
  7389. this.qjff_AD_for_UIrepentProp_videoRegret();
  7390. }
  7391. }
  7392. qjff_AD_for_UIrepentProp_videoRegret() {
  7393. this.callback && this.callback(true);
  7394. this.hideSelf();
  7395. }
  7396. videoAddHelpLine() {
  7397. let guide = DataMgr.getGuideHelpLine();
  7398. if (guide == 0) {
  7399. this.callback && this.callback(true);
  7400. this.hideSelf();
  7401. DataMgr.setGuideHelpLine();
  7402. xGame.common.gameUI.ui.guideNode.visible = false;
  7403. }
  7404. else {
  7405. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7406. if (Laya.Browser.onAndroid) {
  7407. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7408. if (!boo) {
  7409. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7410. return;
  7411. }
  7412. }
  7413. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7414. }
  7415. else {
  7416. console.log('zh:AD 失败,直接发放奖励');
  7417. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7418. }
  7419. }
  7420. }
  7421. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7422. this.callback && this.callback(true);
  7423. this.hideSelf();
  7424. }
  7425. }
  7426. UIRepentProp.uiName = "UIRepentProp";
  7427. class UIMain extends UIBase {
  7428. constructor() {
  7429. super();
  7430. this.firstEnter = true;
  7431. }
  7432. nativeCallJs(msg) {
  7433. let t = msg;
  7434. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7435. switch (t) {
  7436. case 'qjff_chouJiang':
  7437. let dui = xGame.uiMgr.getUI(UIDraw);
  7438. dui.qjff_chouJiang();
  7439. break;
  7440. case 'qjff_AD_for_uisign':
  7441. let dui2 = xGame.uiMgr.getUI(UISign);
  7442. dui2.qjff_AD_for_uisign();
  7443. break;
  7444. case 'qjff_AD_for_uitry':
  7445. let dui3 = xGame.uiMgr.getUI(UITry);
  7446. dui3.qjff_AD_for_uitry();
  7447. break;
  7448. case 'qjff_AD_for_uipower':
  7449. let dui4 = xGame.uiMgr.getUI(UIPower);
  7450. dui4.qjff_AD_for_uipower();
  7451. break;
  7452. case 'qjff_AD_for_uigetAward':
  7453. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7454. dui5.qjff_AD_for_uigetAward();
  7455. break;
  7456. case 'qjff_AD_for_uiGameEnd':
  7457. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7458. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7459. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7460. break;
  7461. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7462. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7463. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7464. break;
  7465. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7466. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7467. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7468. break;
  7469. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7470. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7471. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7472. break;
  7473. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7474. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7475. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7476. break;
  7477. case 'qjff_AD_for_UIBOX_onOpenBox':
  7478. let dui11 = xGame.uiMgr.getUI(UIBox);
  7479. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7480. break;
  7481. case 'qjff_AD_for_UIAddCoin':
  7482. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7483. dui12.qjff_AD_for_UIAddCoin();
  7484. break;
  7485. case '111a':
  7486. let dui14 = xGame.uiMgr.getUI(UISign);
  7487. dui14.qjff_AD_for_uisign();
  7488. break;
  7489. case '222a':
  7490. let dui15 = xGame.uiMgr.getUI(UISign);
  7491. dui15.qjff_AD_for_uisign();
  7492. break;
  7493. case '333a':
  7494. let dui16 = xGame.uiMgr.getUI(UISign);
  7495. dui16.qjff_AD_for_uisign();
  7496. break;
  7497. default:
  7498. console.log('zh:未知的方法名字' + t);
  7499. break;
  7500. }
  7501. }
  7502. onConstructor() {
  7503. console.log('zh: UIMain onConstructor');
  7504. this.ui = ui_UIMain.createInstance();
  7505. this.contentPane = this.ui;
  7506. this.isEject = false;
  7507. this.addEvent();
  7508. this.addClickSpine();
  7509. this.settingNode = new SettingNode(this.ui.settingNode);
  7510. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7511. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7512. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7513. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7514. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7515. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7516. let curUse = DataMgr.getCurSecretary();
  7517. this.changeSecretary(curUse);
  7518. this.ui.talkNode.visible = false;
  7519. let guide = DataMgr.getSkillGuide();
  7520. if (xGame.common.isNewDay && guide == 1) {
  7521. xGame.common.isNewDay = false;
  7522. xGame.soundMgr.playSound("s_main01");
  7523. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7524. console.log("zh:播放小秘书每天语音");
  7525. }
  7526. this.onGetUserInfo();
  7527. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7528. DataMgr.getUserZiChanInfo();
  7529. }
  7530. this.ui.n83.visible = false;
  7531. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7532. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7533. let ua = d.username;
  7534. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7535. }
  7536. this.c_btn_for_user();
  7537. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7538. this.loadUserSpOrderForAd();
  7539. }
  7540. Logout() {
  7541. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7542. LocalStorageManager.removeItem(keyForLoginInfo);
  7543. this.freshUser();
  7544. }
  7545. JSBridgeUtils.instance.loginOutForApp();
  7546. this.setUserDefaultNickname();
  7547. DataMgr.setCoin2(4000);
  7548. DataMgr.setDiamond2(0);
  7549. this.setDefaultQiuGanInfo();
  7550. DataMgr.setPlaceBallLevelList("");
  7551. }
  7552. setDefaultQiuGanInfo() {
  7553. DataMgr.setBallRod(0, 1);
  7554. DataMgr.setBallRod(1, 0);
  7555. DataMgr.setBallRod(2, 0);
  7556. DataMgr.setBallRod(3, 0);
  7557. DataMgr.setBallRod(4, 0);
  7558. DataMgr.setBallRod(5, 1);
  7559. }
  7560. setUserDefaultNickname() {
  7561. let defUsername = "player";
  7562. this.ui.headNode.nameTxt.text = defUsername;
  7563. DataMgr.updateUserNickName(defUsername);
  7564. Moyu.updateUserInfo(defUsername);
  7565. }
  7566. gotoLogin() {
  7567. xGame.uiMgr.Show(UILogin);
  7568. }
  7569. gotoRegUser() {
  7570. xGame.uiMgr.Show(UIReg);
  7571. }
  7572. showFuLiSp1() {
  7573. console.log('zh:福利1');
  7574. this.checkForShowFuLi17(1);
  7575. }
  7576. showFuLiSp7() {
  7577. console.log('zh:福利7');
  7578. this.checkForShowFuLi17(7);
  7579. }
  7580. loadUserSpOrderForAd() {
  7581. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7582. if (userInfo == null) {
  7583. return;
  7584. }
  7585. let reqData = xGame.httpMgr.getReqData();
  7586. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  7587. try {
  7588. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  7589. let code = res.code;
  7590. let msg = res.msg;
  7591. if (code == 401) {
  7592. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7593. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7594. return;
  7595. }
  7596. if (code == 200) {
  7597. let data = res.data;
  7598. let buy_spid1 = false;
  7599. let buy_spid7 = false;
  7600. for (let index = 0; index < data.length; index++) {
  7601. let element = data[index];
  7602. console.log('zh:list element.spid = ' + element.spid);
  7603. if (element.spid == 1) {
  7604. buy_spid1 = true;
  7605. }
  7606. if (element.spid == 7) {
  7607. buy_spid7 = true;
  7608. }
  7609. }
  7610. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  7611. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  7612. }
  7613. else {
  7614. xGame.uiMgr.Show(UIMsg, msg);
  7615. }
  7616. }
  7617. catch (error) {
  7618. console.log('error=' + error);
  7619. alert(error);
  7620. }
  7621. finally {
  7622. }
  7623. });
  7624. }
  7625. checkForShowFuLi17(spid) {
  7626. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7627. if (userInfo == null) {
  7628. if (spid === 1) {
  7629. xGame.uiMgr.Show(UIFuli1);
  7630. }
  7631. if (spid === 7) {
  7632. xGame.uiMgr.Show(UIFuli2);
  7633. }
  7634. return;
  7635. }
  7636. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  7637. let reqData = xGame.httpMgr.getReqData();
  7638. let pd = JSON.parse(reqData);
  7639. pd.productId = spid;
  7640. reqData = JSON.stringify(pd);
  7641. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  7642. try {
  7643. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  7644. let code = res.code;
  7645. let msg = res.msg;
  7646. if (code == 401) {
  7647. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  7648. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7649. return;
  7650. }
  7651. if (code == 200) {
  7652. let isBuyOk = res.data;
  7653. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  7654. if (isBuyOk === false) {
  7655. if (spid === 1) {
  7656. xGame.uiMgr.Show(UIFuli1);
  7657. }
  7658. if (spid === 7) {
  7659. xGame.uiMgr.Show(UIFuli2);
  7660. }
  7661. }
  7662. else {
  7663. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  7664. }
  7665. }
  7666. else {
  7667. xGame.uiMgr.Show(UIMsg, msg);
  7668. }
  7669. }
  7670. catch (error) {
  7671. console.log('error=' + error);
  7672. alert(error);
  7673. }
  7674. finally {
  7675. }
  7676. });
  7677. }
  7678. c_btn_for_user() {
  7679. this.ui.n_Logout.visible = false;
  7680. this.ui.n_dengLu.visible = false;
  7681. this.ui.n_zhuCe.visible = false;
  7682. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7683. this.ui.n_Logout.visible = true;
  7684. }
  7685. else {
  7686. this.ui.n_dengLu.visible = true;
  7687. }
  7688. }
  7689. changeSecretary(curUse) {
  7690. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7691. xGame.common.secretary && xGame.common.secretary.dispose();
  7692. this.addSecretarySpine(name);
  7693. }
  7694. addSecretarySpine(name) {
  7695. let spine = new SpineMgr(name, () => {
  7696. this.playSecretaryIdle();
  7697. });
  7698. xGame.common.secretary = spine;
  7699. }
  7700. addClickSpine() {
  7701. let clickSpine = new SpineMgr("dianji", () => {
  7702. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7703. let parent = Laya.stage;
  7704. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7705. clickSpine.play(data, 0, false, parent, (spine) => {
  7706. spine.destroy(true);
  7707. });
  7708. });
  7709. });
  7710. }
  7711. addEvent() {
  7712. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7713. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7714. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  7715. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7716. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7717. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7718. this.addUIClick(this.ui, this.interuptSecretary);
  7719. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7720. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7721. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7722. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7723. this.addUIClick(this.ui.signBtn, this.openSignView);
  7724. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7725. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7726. this.addUIClick(this.ui.n_Logout, this.Logout);
  7727. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7728. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  7729. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7730. }
  7731. show(showFailWords) {
  7732. super.show();
  7733. this.loadUserSpOrderForAd();
  7734. this.moneyNode.ui.c1.selectedIndex = 1;
  7735. this.playSecretaryIdle();
  7736. xGame.soundMgr.playMusic("caromhall01", 0);
  7737. Laya.timer.clearAll(this);
  7738. this.playSecretaryRandomSound();
  7739. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7740. if (showFailWords) {
  7741. console.log('zh:uimain.ts ');
  7742. setTimeout(() => {
  7743. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7744. let words = -1;
  7745. if (str == "s_main02") {
  7746. words = 2;
  7747. }
  7748. else {
  7749. words = 3;
  7750. }
  7751. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7752. xGame.soundMgr.playSound(str);
  7753. }, 300);
  7754. }
  7755. this.showGuide();
  7756. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7757. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7758. let guide = DataMgr.getSkillGuide();
  7759. if (guide == 1) {
  7760. let randTime = xGame.common.randomNum(300, 800);
  7761. if (this.firstEnter) {
  7762. console.log("zh: firstEnter");
  7763. this.firstEnter = false;
  7764. randTime += 900;
  7765. }
  7766. else {
  7767. console.log("zh: no firstEnter");
  7768. }
  7769. Laya.timer.once(randTime, this, () => {
  7770. });
  7771. Laya.timer.once(1000, this, () => {
  7772. console.log('zh: 1秒后 showFuLiSp1');
  7773. this.showFuLiSp1();
  7774. });
  7775. Laya.timer.once(10000, this, () => {
  7776. console.log('zh: 10秒后 showFuLiSp1');
  7777. this.showFuLiSp7();
  7778. });
  7779. }
  7780. }
  7781. checkActive(show) {
  7782. }
  7783. showGuide() {
  7784. let guide = DataMgr.getSkillGuide();
  7785. this.ui.guideBtn.visible = guide == 0;
  7786. this.ui.enterGuide.visible = false;
  7787. this.ui.secretaryGuide.visible = guide == 0;
  7788. if (guide == 0) {
  7789. console.log("zh:显示引导");
  7790. xGame.soundMgr.playSound("s_guide");
  7791. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7792. }
  7793. else {
  7794. console.log("zh:不需要显示引导");
  7795. }
  7796. }
  7797. ensureSecretary() {
  7798. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  7799. this.ui.secretaryGuide.visible = false;
  7800. this.ui.enterGuide.visible = true;
  7801. this.ui.wordsNode.t0.play();
  7802. if (DataMgr.getNewUser())
  7803. Moyu.sendDataEvent("gameReady");
  7804. }
  7805. playSecretaryIdle() {
  7806. let parent = this.ui.secretary.displayObject;
  7807. parent.destroyChildren();
  7808. let xx = this.ui.secretary.width / 2;
  7809. let yy = this.ui.secretary.height;
  7810. let scale = xGame.common.getSecretaryScale();
  7811. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7812. xGame.common.secretary.play(data, 0, true, parent);
  7813. }
  7814. startGame(type) {
  7815. if (!this.isReadyForLoadNetSource()) {
  7816. return;
  7817. }
  7818. xGame.common.gameMode = type;
  7819. Moyu.sendDataEvent("PlayGame", { type: type });
  7820. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  7821. switch (xGame.common.gameMode) {
  7822. case GameMode.classic:
  7823. console.log('zh:进入经典模式111111111');
  7824. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7825. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7826. console.log('zh:classic db_over_lev=', db_over_lev);
  7827. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7828. console.log('zh:判断是否可以玩该模式classic =NO');
  7829. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7830. xGame.uiMgr.Show(UIMsg, tipStr);
  7831. return;
  7832. }
  7833. else {
  7834. console.log('zh:可以玩该模式classic 66666666666666');
  7835. this.beginGame();
  7836. }
  7837. }
  7838. else {
  7839. console.log('zh:不需要判断是否可以玩该classic');
  7840. let challengeTimes = DataMgr.getChallengeTimes();
  7841. if (challengeTimes == 0) {
  7842. xGame.uiMgr.Show(UIInvitation);
  7843. }
  7844. else {
  7845. this.beginGame();
  7846. }
  7847. break;
  7848. }
  7849. case GameMode.bigMove:
  7850. console.error('zh:bigMove check');
  7851. let guide = DataMgr.getSkillGuide();
  7852. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7853. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7854. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7855. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7856. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7857. xGame.uiMgr.Show(UIMsg, tipStr);
  7858. return;
  7859. }
  7860. else {
  7861. console.log('zh:可以玩该模式 bigMove');
  7862. this.beginGame();
  7863. if (DataMgr.getNewUser())
  7864. Moyu.sendDataEvent("gameStart0");
  7865. }
  7866. }
  7867. else {
  7868. this.beginGame();
  7869. if (DataMgr.getNewUser())
  7870. Moyu.sendDataEvent("gameStart0");
  7871. }
  7872. break;
  7873. default:
  7874. console.error('zh:未知错误!!!!');
  7875. break;
  7876. }
  7877. }
  7878. beginGame(isNice = false) {
  7879. console.log('zh:beginGame ');
  7880. let guide = DataMgr.getSkillGuide();
  7881. if (guide == 1) {
  7882. console.log('zh:非新手引导,showInternAd ');
  7883. JSBridgeUtils.instance.showInternAd('beginGame');
  7884. }
  7885. else {
  7886. console.log('zh:新手引导,不显示AD ');
  7887. }
  7888. console.log('zh:beginGame 2 go');
  7889. if (xGame.common.gameMode == GameMode.classic) {
  7890. if (isNice) {
  7891. this.enterClassic();
  7892. }
  7893. else {
  7894. xGame.uiMgr.Show(UIModeSelection, () => {
  7895. console.log('zh:BBBBBBBBBBBBBBB');
  7896. this.enterClassic();
  7897. });
  7898. }
  7899. }
  7900. else if (xGame.common.gameMode == GameMode.bigMove) {
  7901. this.ui.enterGuide.visible = false;
  7902. xGame.uiMgr.Show(UISkill);
  7903. }
  7904. }
  7905. enterClassic() {
  7906. xGame.uiMgr.Show(UIGame);
  7907. xGame.uiMgr.Show(UIMatching, () => {
  7908. if (!this.isHide)
  7909. this.hide();
  7910. xGame.common.gameUI.ui.alpha = 1;
  7911. xGame.common.gameUI.startGame();
  7912. xGame.uiMgr.Hide(UIGameEnd);
  7913. });
  7914. }
  7915. start_debug_for_moni_payOk() {
  7916. console.log('zh:start_debug_for_moni_payOk');
  7917. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7918. if (userInfo != null) {
  7919. let token = userInfo.token;
  7920. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7921. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7922. alert('模拟支付OK');
  7923. return;
  7924. }
  7925. else {
  7926. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7927. }
  7928. }
  7929. startGlobal() {
  7930. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7931. }
  7932. startWeekly() {
  7933. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7934. }
  7935. zhouSaiMonth() {
  7936. console.log('zh: zhouSaiMonth 被调用');
  7937. }
  7938. isReadyForLoadNetSource() {
  7939. let reqCount = xGame.cfgMgr.httpReqCount;
  7940. let ok = xGame.cfgMgr.httpReqOkCount;
  7941. if (reqCount > ok) {
  7942. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7943. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7944. Laya.timer.once(5000, this, () => {
  7945. let retryCount = 0;
  7946. const maxRetries = 3;
  7947. const tryFetchConfig = () => {
  7948. try {
  7949. xGame.cfgMgr.getConfigFromServer();
  7950. }
  7951. catch (error) {
  7952. if (retryCount < maxRetries) {
  7953. retryCount++;
  7954. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7955. Laya.timer.once(5000, this, tryFetchConfig);
  7956. }
  7957. else {
  7958. console.error("❌ 达到最大重试次数,配置获取失败");
  7959. }
  7960. }
  7961. };
  7962. tryFetchConfig();
  7963. });
  7964. return false;
  7965. }
  7966. return true;
  7967. }
  7968. startPlaceBall() {
  7969. if (!this.isReadyForLoadNetSource()) {
  7970. return;
  7971. }
  7972. xGame.uiMgr.Show(UILevelDisplay);
  7973. }
  7974. hide() {
  7975. console.log('zh:uimain hide ...');
  7976. super.hide();
  7977. xGame.common.stopGirlPop(this.ui.talkNode);
  7978. }
  7979. onGetUserInfo(force = false) {
  7980. if (Moyu.isWx) {
  7981. let info = Moyu.getSystemInfo();
  7982. if (info)
  7983. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7984. }
  7985. else {
  7986. Moyu.initUser(this, this.freshUser, force);
  7987. }
  7988. this.freshUser();
  7989. console.log('zh:5秒后更新用戶資產信息');
  7990. setTimeout(() => {
  7991. console.log('setTimeout 5秒over 執行');
  7992. DataMgr.getUserZiChanInfo();
  7993. }, 5000);
  7994. }
  7995. event_login_in() {
  7996. console.log("zh:event_login_in被触发");
  7997. this.freshUser();
  7998. }
  7999. freshUser() {
  8000. let user = Moyu.getUserInfo();
  8001. if (!user.isAuth) {
  8002. user.headIcon = 'res/ty_touxiang.png';
  8003. }
  8004. else {
  8005. DataMgr.upRankData();
  8006. }
  8007. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8008. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8009. let keyStr = keyForLoginInfo;
  8010. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8011. const d = LocalStorageManager.getItem(keyStr);
  8012. let ua = d.username;
  8013. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8014. }
  8015. else {
  8016. }
  8017. this.c_btn_for_user();
  8018. }
  8019. interuptSecretary() {
  8020. Laya.timer.clearAll(this);
  8021. this.playSecretaryRandomSound();
  8022. }
  8023. playSecretaryRandomSound() {
  8024. if (this.isHide)
  8025. return;
  8026. let time = xGame.common.randomNum(45000, 60000);
  8027. Laya.timer.once(time, this, () => {
  8028. if (this.isHide)
  8029. return;
  8030. let index = xGame.common.randomNum(4, 7);
  8031. xGame.soundMgr.playSound("s_main0" + index);
  8032. let words = 1;
  8033. switch (index) {
  8034. case 4:
  8035. words = 5;
  8036. break;
  8037. case 5:
  8038. words = 3;
  8039. break;
  8040. case 6:
  8041. words = 6;
  8042. break;
  8043. case 7:
  8044. words = 7;
  8045. break;
  8046. default:
  8047. break;
  8048. }
  8049. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8050. this.playSecretaryRandomSound();
  8051. });
  8052. }
  8053. openSecretaryView() {
  8054. xGame.uiMgr.Show(UISecretary);
  8055. Moyu.sendDataEvent("secretary");
  8056. }
  8057. openShopView() {
  8058. xGame.uiMgr.Show(UIShop, 0);
  8059. }
  8060. openSignView() {
  8061. xGame.uiMgr.Show(UISign);
  8062. }
  8063. openDrawView() {
  8064. xGame.uiMgr.Show(UIDraw);
  8065. }
  8066. openRanking() {
  8067. console.log('zh:phb openRanking');
  8068. xGame.uiMgr.Show(UIRanking);
  8069. Moyu.sendDataEvent("rankingList");
  8070. }
  8071. }
  8072. UIMain.uiName = "UIMain";
  8073. class UIGameEnd extends UIBase {
  8074. constructor() {
  8075. super();
  8076. this.success = false;
  8077. this.awardCoinNum = 1000;
  8078. this.awardDiamondNum = 10;
  8079. }
  8080. onConstructor() {
  8081. this.ui = ui_UIGameEnd.createInstance();
  8082. this.contentPane = this.ui;
  8083. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8084. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8085. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8086. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8087. this.ui.talkNode.visible = false;
  8088. if (Moyu.isKs)
  8089. this.ui.closeNode.closeBtn.x += 100;
  8090. }
  8091. updateType() {
  8092. switch (xGame.common.gameMode) {
  8093. case GameMode.classic:
  8094. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8095. this.ui.coinNode.visible = this.success;
  8096. if (!this.success) {
  8097. Laya.timer.once(500, this, () => {
  8098. xGame.uiMgr.Show(UIAddCoin);
  8099. });
  8100. }
  8101. else {
  8102. this.logEventForClassic_win();
  8103. }
  8104. this.logEventForClassic_complete();
  8105. this.ui.isGetAward.visible = false;
  8106. this.ui.leftBtn.c1.selectedIndex = 3;
  8107. this.ui.rightBtn.c1.selectedIndex = 0;
  8108. this.moneyNode.ui.c1.selectedIndex = 1;
  8109. break;
  8110. case GameMode.bigMove:
  8111. console.log('zh:招法模式 aaaaaa bigMove');
  8112. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8113. this.ui.coinNode.visible = this.success;
  8114. if (xGame.common.gameMode == GameMode.bigMove) {
  8115. if (this.success) {
  8116. DataMgr.setSkillSuccessTimes(1, true);
  8117. DataMgr.setSkillAccTimes(1);
  8118. }
  8119. else {
  8120. DataMgr.setSkillSuccessTimes(0, false);
  8121. }
  8122. }
  8123. this.logEventForRod_complete_N();
  8124. if (!this.success) {
  8125. Laya.timer.once(500, this, () => {
  8126. xGame.uiMgr.Show(UIAddCoin);
  8127. });
  8128. }
  8129. else {
  8130. this.logEventForRod_win();
  8131. }
  8132. this.ui.isGetAward.visible = false;
  8133. this.ui.leftBtn.c1.selectedIndex = 3;
  8134. this.ui.rightBtn.c1.selectedIndex = 0;
  8135. this.moneyNode.ui.c1.selectedIndex = 1;
  8136. break;
  8137. case GameMode.placeBall:
  8138. this.ui.coinNode.visible = false;
  8139. if (this.success) {
  8140. if (xGame.common.placeBallStarNum == 3) {
  8141. this.ui.c1.selectedIndex = 2;
  8142. }
  8143. else {
  8144. this.ui.c1.selectedIndex = 3;
  8145. }
  8146. let level = xGame.common.placeBallCurLevel;
  8147. if (level > 59) {
  8148. this.logEventForChallenge_level_complete(level);
  8149. }
  8150. else {
  8151. this.logEventForChallenge_level_N(level);
  8152. }
  8153. }
  8154. else {
  8155. this.ui.c1.selectedIndex = 4;
  8156. }
  8157. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8158. if (cfg.type == PlaceBallType.challenge) {
  8159. this.ui.c1.selectedIndex = 2;
  8160. }
  8161. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8162. this.updatePlaceBallBtn();
  8163. this.updatePlaceBallStarNum();
  8164. this.updatePlaceBallAwardState();
  8165. this.moneyNode.ui.c1.selectedIndex = 2;
  8166. this.moneyNode.checkPowerTime();
  8167. this.moneyNode.powerChange();
  8168. DataMgr.upRankData();
  8169. break;
  8170. default:
  8171. break;
  8172. }
  8173. }
  8174. logEventForRod_complete_N() {
  8175. let gfmsIdx = xGame.common.curPlayerSkillType;
  8176. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8177. let gfmc = 'Skyfall Shot';
  8178. if (gfmsIdx == 0) {
  8179. gfmc = 'Skyfall Shot';
  8180. }
  8181. if (gfmsIdx == 1) {
  8182. gfmc = 'Surging break';
  8183. }
  8184. if (gfmsIdx == 2) {
  8185. gfmc = 'Frost Lock';
  8186. }
  8187. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8188. console.log('zh:logEventForRod_complete_N level = ' + level);
  8189. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8190. let jsonStr = {
  8191. "count": 0,
  8192. "name": gfmc
  8193. };
  8194. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8195. const d = LocalStorageManager.getItem(keyStr);
  8196. jsonStr.count = d.count + 1;
  8197. LocalStorageManager.setItem(keyStr, jsonStr);
  8198. }
  8199. else {
  8200. LocalStorageManager.setItem(keyStr, jsonStr);
  8201. }
  8202. const d2 = LocalStorageManager.getItem(keyStr);
  8203. let count = d2.count;
  8204. console.log('zh:logEventForRod_complete_N count = ' + count);
  8205. if (count % 5 == 0) {
  8206. const reqStr = JSON.stringify(jsonStr);
  8207. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8208. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8209. }
  8210. }
  8211. logEventForRod_win() {
  8212. console.log('zh:logEventForRod_win,胜利');
  8213. let gfmsIdx = xGame.common.curPlayerSkillType;
  8214. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8215. let gfmc = 'Skyfall Shot';
  8216. if (gfmsIdx == 0) {
  8217. gfmc = 'Skyfall Shot';
  8218. }
  8219. if (gfmsIdx == 1) {
  8220. gfmc = 'Surging break';
  8221. }
  8222. if (gfmsIdx == 2) {
  8223. gfmc = 'Frost Lock';
  8224. }
  8225. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8226. console.log('zh:logEventForRod_win level = ' + level);
  8227. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8228. let jsonStr = {
  8229. "count": 1,
  8230. "name": gfmc + ' Lev' + level
  8231. };
  8232. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8233. const d = LocalStorageManager.getItem(keyStr);
  8234. jsonStr.count = d.count + 1;
  8235. LocalStorageManager.setItem(keyStr, jsonStr);
  8236. }
  8237. else {
  8238. LocalStorageManager.setItem(keyStr, jsonStr);
  8239. }
  8240. const reqStr = JSON.stringify(jsonStr);
  8241. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8242. }
  8243. logEventForClassic_win() {
  8244. console.log('zh:logEventForClassic_win,胜利');
  8245. let rtype = xGame.common.classicRoomType;
  8246. let msmc = '';
  8247. if (rtype == 1) {
  8248. msmc = 'beginner';
  8249. }
  8250. if (rtype == 2) {
  8251. msmc = 'expert';
  8252. }
  8253. if (rtype == 3) {
  8254. msmc = 'master';
  8255. }
  8256. let keyStr = 'sjmd_classic_win_' + rtype;
  8257. let jsonStr = {
  8258. "difficulty": msmc,
  8259. "classic_count": 1,
  8260. "difficulty_count": 1
  8261. };
  8262. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8263. const d = LocalStorageManager.getItem(keyStr);
  8264. jsonStr.classic_count = d.classic_count + 1;
  8265. jsonStr.difficulty_count = d.difficulty_count + 1;
  8266. LocalStorageManager.setItem(keyStr, jsonStr);
  8267. }
  8268. else {
  8269. LocalStorageManager.setItem(keyStr, jsonStr);
  8270. }
  8271. const reqStr = JSON.stringify(jsonStr);
  8272. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8273. }
  8274. logEventForClassic_complete() {
  8275. console.log('zh:logEventForClassic_complete,胜利');
  8276. let rtype = xGame.common.classicRoomType;
  8277. let msmc = '';
  8278. if (rtype == 1) {
  8279. msmc = 'beginner';
  8280. }
  8281. if (rtype == 2) {
  8282. msmc = 'expert';
  8283. }
  8284. if (rtype == 3) {
  8285. msmc = 'master';
  8286. }
  8287. let keyStr = 'sjmd_classic_complete_' + rtype;
  8288. let jsonStr = {
  8289. "msmc": msmc,
  8290. "count": 0
  8291. };
  8292. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8293. const d = LocalStorageManager.getItem(keyStr);
  8294. jsonStr.count = d.count + 1;
  8295. LocalStorageManager.setItem(keyStr, jsonStr);
  8296. }
  8297. else {
  8298. LocalStorageManager.setItem(keyStr, jsonStr);
  8299. }
  8300. if (jsonStr.count % 5 == 0) {
  8301. const reqStr = JSON.stringify(jsonStr);
  8302. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8303. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8304. }
  8305. }
  8306. updatePlaceBallBtn() {
  8307. this.ui.leftBtn.c1.selectedIndex = 5;
  8308. if (this.success) {
  8309. this.ui.rightBtn.c1.selectedIndex = 14;
  8310. }
  8311. else {
  8312. if (xGame.common.placeBallStarNum == 3) {
  8313. this.ui.rightBtn.c1.selectedIndex = 14;
  8314. }
  8315. else {
  8316. this.ui.rightBtn.c1.selectedIndex = 1;
  8317. }
  8318. }
  8319. }
  8320. updatePlaceBallStarNum() {
  8321. let starNum = xGame.common.placeBallStarNum;
  8322. if (starNum == 0)
  8323. this.ui.starNumNode.c1.selectedIndex = 3;
  8324. else {
  8325. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8326. }
  8327. }
  8328. updatePlaceBallAwardState() {
  8329. let level = xGame.common.placeBallCurLevel;
  8330. let starNum = xGame.common.placeBallStarNum;
  8331. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8332. let data = cfgTable.placeballData[level].award;
  8333. let cfg = cfgTable.placeballData[level];
  8334. this.awardDiamondNum = data[1];
  8335. this.awardCoinNum = data[0];
  8336. if (cfg.type == PlaceBallType.challenge) {
  8337. this.awardDiamondNum = 0;
  8338. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8339. }
  8340. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8341. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8342. if (cfg.type == PlaceBallType.challenge) {
  8343. this.ui.awardNode.coinNode.visible = true;
  8344. }
  8345. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8346. this.ui.awardNode.diamondNode.x = 265;
  8347. this.ui.awardNode.coinNode.x = 354;
  8348. }
  8349. else {
  8350. this.ui.awardNode.diamondNode.x = 291;
  8351. this.ui.awardNode.coinNode.x = 291;
  8352. }
  8353. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8354. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8355. if (this.awardCoinNum == 0) {
  8356. this.ui.awardNode.coinNode.numTxt.text = "";
  8357. }
  8358. if (getAward) {
  8359. this.ui.isGetAward.visible = true;
  8360. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8361. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8362. }
  8363. else {
  8364. this.ui.isGetAward.visible = false;
  8365. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8366. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8367. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8368. }
  8369. else {
  8370. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8371. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8372. }
  8373. }
  8374. }
  8375. show(success) {
  8376. super.show();
  8377. xGame.eventMgr.event(RESET_GAME);
  8378. this.success = success;
  8379. Laya.timer.clearAll(this);
  8380. this.playSecretaryAni();
  8381. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8382. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8383. offsetTime = Math.floor(offsetTime / 1000);
  8384. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8385. this.updateType();
  8386. Laya.timer.once(200, this, () => {
  8387. this.addAward(() => {
  8388. this.updateType();
  8389. Laya.timer.once(500, this, () => {
  8390. this.showChallengeLevel();
  8391. });
  8392. });
  8393. });
  8394. if (this.success) {
  8395. JSBridgeUtils.instance.showInternAd('gameend_success');
  8396. console.log('zh:game end 成功');
  8397. xGame.soundMgr.playSound('slots_roll01');
  8398. xGame.soundMgr.playSound("s_win");
  8399. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8400. this.diyGameDataUtilForGameWin();
  8401. this.updateGamePlaceBallData2Server();
  8402. }
  8403. else {
  8404. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8405. console.log('zh:game end失败');
  8406. xGame.soundMgr.playSound('matchwin01');
  8407. xGame.soundMgr.playSound("s_lose");
  8408. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8409. }
  8410. let challengeNum = DataMgr.getChallengeTimes();
  8411. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8412. DataMgr.setChallengeTimes(1);
  8413. }
  8414. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8415. DataMgr.setClassicTimes();
  8416. }
  8417. }
  8418. diyGameDataUtilForGameWin() {
  8419. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8420. switch (xGame.common.gameMode) {
  8421. case GameMode.classic:
  8422. console.log('zh:DiyGameDataUtilForGameWin 111');
  8423. case GameMode.bigMove:
  8424. console.log('zh:DiyGameDataUtilForGameWin 222');
  8425. this.restartGame();
  8426. break;
  8427. case GameMode.placeBall:
  8428. console.log('zh:DiyGameDataUtilForGameWin 333');
  8429. var level = xGame.common.placeBallCurLevel;
  8430. console.log('zh:练习模式 联系了多少LEV=' + level);
  8431. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8432. if (level > db_over_lev) {
  8433. DataMgr.setChallengeMode_overLev(level);
  8434. }
  8435. break;
  8436. default:
  8437. console.log('zh:DiyGameDataUtilForGameWin 444');
  8438. break;
  8439. }
  8440. }
  8441. updateGamePlaceBallData2Server() {
  8442. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8443. if (userInfo == null) {
  8444. return;
  8445. }
  8446. let pbdObj = DataMgr.getPlaceBallLevelList();
  8447. let reqData = xGame.httpMgr.getReqData();
  8448. let pd = JSON.parse(reqData);
  8449. pd.placeBallData = JSON.stringify(pbdObj);
  8450. reqData = JSON.stringify(pd);
  8451. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8452. try {
  8453. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8454. let code = res.code;
  8455. let msg = res.msg;
  8456. if (code == 401) {
  8457. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  8458. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8459. return;
  8460. }
  8461. if (code == 200) {
  8462. let data = res.data;
  8463. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8464. }
  8465. else {
  8466. xGame.uiMgr.Show(UIMsg, msg);
  8467. }
  8468. }
  8469. catch (error) {
  8470. console.log('error=' + error);
  8471. alert(error);
  8472. }
  8473. finally {
  8474. }
  8475. });
  8476. }
  8477. showChallengeLevel() {
  8478. if (DataMgr.getChallengeTimes() != 0)
  8479. return;
  8480. let skill = DataMgr.getSkillAccTimes();
  8481. let put = DataMgr.getPlaceBallLevelList().length;
  8482. if (skill >= 3 || put >= 5) {
  8483. xGame.uiMgr.Show(UIInvitation);
  8484. this.hide();
  8485. }
  8486. }
  8487. addAward(callback) {
  8488. if (!this.success) {
  8489. callback && callback();
  8490. return;
  8491. }
  8492. switch (xGame.common.gameMode) {
  8493. case GameMode.classic:
  8494. this.awardCoinNum = xGame.common.passAwardCoin;
  8495. this.awardDiamondNum = 0;
  8496. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8497. break;
  8498. case GameMode.bigMove:
  8499. this.awardCoinNum = xGame.common.passAwardCoin;
  8500. this.awardDiamondNum = 0;
  8501. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8502. callback && callback();
  8503. break;
  8504. case GameMode.placeBall:
  8505. let level = xGame.common.placeBallCurLevel;
  8506. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8507. if (xGame.common.placeBallStarNum != 3) {
  8508. callback && callback();
  8509. return;
  8510. }
  8511. else {
  8512. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8513. if (getAward) {
  8514. callback && callback();
  8515. return;
  8516. }
  8517. }
  8518. let cfg = cfgTable.placeballData[level];
  8519. let data = cfgTable.placeballData[level].award;
  8520. this.awardCoinNum = data[0];
  8521. this.awardDiamondNum = data[1];
  8522. if (cfg.type == PlaceBallType.challenge) {
  8523. this.awardDiamondNum = 0;
  8524. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8525. }
  8526. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8527. let diamondAward;
  8528. if (this.awardDiamondNum > 0) {
  8529. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8530. xGame.common.getAward([diamondAward, coinAward], callback);
  8531. }
  8532. else {
  8533. xGame.common.getAward([coinAward], callback);
  8534. }
  8535. if (cfg.type == PlaceBallType.normal) {
  8536. DataMgr.setPlaceBallAward(level);
  8537. }
  8538. break;
  8539. default:
  8540. break;
  8541. }
  8542. }
  8543. playSecretaryAni_old() {
  8544. let parent = this.ui.secretary.displayObject;
  8545. parent.destroyChildren();
  8546. let xx = this.ui.secretary.width / 2;
  8547. let yy = this.ui.secretary.height;
  8548. let scale = xGame.common.getSecretaryScale();
  8549. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8550. if (this.success) {
  8551. let rand = Math.random() <= 0.5 ? 2 : 3;
  8552. xGame.common.secretary.play(data, rand, false, parent, () => {
  8553. xGame.common.secretary.play(data, 1, true, parent);
  8554. });
  8555. }
  8556. else {
  8557. xGame.common.secretary.play(data, 0, true, parent);
  8558. }
  8559. }
  8560. playSecretaryAni() {
  8561. let parent = this.ui.secretary.displayObject;
  8562. parent.destroyChildren();
  8563. let xx = this.ui.secretary.width / 2;
  8564. let yy = this.ui.secretary.height;
  8565. let scale = xGame.common.getSecretaryScale();
  8566. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8567. if (this.success) {
  8568. let rand = 0;
  8569. xGame.common.secretary.play(data, 0, true, parent);
  8570. }
  8571. else {
  8572. xGame.common.secretary.play(data, 0, true, parent);
  8573. }
  8574. }
  8575. restartGame() {
  8576. switch (xGame.common.gameMode) {
  8577. case GameMode.classic:
  8578. xGame.eventMgr.event(RESTART_GAME);
  8579. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8580. break;
  8581. case GameMode.bigMove:
  8582. this.hide();
  8583. xGame.eventMgr.event(RESTART_GAME);
  8584. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8585. break;
  8586. default:
  8587. break;
  8588. }
  8589. }
  8590. hide() {
  8591. super.hide();
  8592. xGame.common.stopGirlPop(this.ui.talkNode);
  8593. PlatMgr.showBanner(false);
  8594. }
  8595. returnHome() {
  8596. this.hide();
  8597. let showFailWords = !this.success;
  8598. xGame.uiMgr.Show(UIMain, showFailWords);
  8599. }
  8600. clickLeftBtn() {
  8601. switch (xGame.common.gameMode) {
  8602. case GameMode.classic:
  8603. case GameMode.bigMove:
  8604. this.returnHome();
  8605. break;
  8606. case GameMode.placeBall:
  8607. let level = xGame.common.placeBallCurLevel;
  8608. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8609. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8610. break;
  8611. default:
  8612. break;
  8613. }
  8614. }
  8615. powerStartPlaceBallLevel(level, btn) {
  8616. if (DataMgr.powerEnough()) {
  8617. btn.touchable = false;
  8618. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8619. btn.touchable = true;
  8620. DataMgr.setPower(-1);
  8621. xGame.eventMgr.event(POWER_TIME);
  8622. this.startPlaceBallLevel(level);
  8623. this.logEventForChallenge_level_start(level);
  8624. }));
  8625. }
  8626. else {
  8627. xGame.uiMgr.Show(UIPower, 0);
  8628. }
  8629. }
  8630. clickRightBtn() {
  8631. switch (xGame.common.gameMode) {
  8632. case GameMode.classic:
  8633. console.log('zh:clickRightBtn 111');
  8634. case GameMode.bigMove:
  8635. console.log('zh:clickRightBtn 222');
  8636. this.restartGame();
  8637. break;
  8638. case GameMode.placeBall:
  8639. console.log('zh:clickRightBtn 333');
  8640. let level = xGame.common.placeBallCurLevel;
  8641. let data = DataMgr.getPlaceBallLevel(level);
  8642. let curPss = data.play && !data.isCur;
  8643. if (curPss) {
  8644. console.log('zh:clickRightBtn 333-111');
  8645. console.log('zh:当前LV=' + level);
  8646. if (level == 60) {
  8647. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8648. Laya.timer.once(3000, this, () => {
  8649. this.returnHome();
  8650. });
  8651. }
  8652. else {
  8653. let lev = level + 1;
  8654. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8655. }
  8656. }
  8657. else {
  8658. console.log('zh:clickRightBtn 333-000');
  8659. Moyu.sendDataEvent("placeBallNextLevel");
  8660. console.log('zh:qjff_AD_for_uiGameEnd');
  8661. if (Laya.Browser.onAndroid) {
  8662. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8663. if (!boo) {
  8664. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8665. return;
  8666. }
  8667. }
  8668. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8669. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8670. }
  8671. else {
  8672. console.log('zh:AD 失败,直接发放奖励');
  8673. this.qjff_AD_for_uiGameEnd(level);
  8674. }
  8675. }
  8676. break;
  8677. default:
  8678. console.log('zh:clickRightBtn 444');
  8679. break;
  8680. }
  8681. }
  8682. logEventForChallenge_level_start(level) {
  8683. let keyStr = 'sjmd_challenge_level_start';
  8684. let jsonStr = {
  8685. "count": 0,
  8686. "gold_balance ": DataMgr.getCoin(),
  8687. "level": level,
  8688. "diamond_balance ": DataMgr.getDiamond()
  8689. };
  8690. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8691. const d = LocalStorageManager.getItem(keyStr);
  8692. if (level > d.level) {
  8693. jsonStr.count = d.count + 1;
  8694. LocalStorageManager.setItem(keyStr, jsonStr);
  8695. }
  8696. else {
  8697. }
  8698. }
  8699. else {
  8700. LocalStorageManager.setItem(keyStr, jsonStr);
  8701. }
  8702. const reqStr = JSON.stringify(jsonStr);
  8703. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8704. }
  8705. qjff_AD_for_uiGameEnd(level) {
  8706. DataMgr.setPlaceBallLevel(level, 1);
  8707. this.startPlaceBallLevel(level + 1);
  8708. }
  8709. startPlaceBallLevel(level) {
  8710. xGame.common.gameMode = GameMode.placeBall;
  8711. xGame.common.placeBallCurLevel = level;
  8712. xGame.uiMgr.Show(UIGame);
  8713. this.hide();
  8714. }
  8715. logEventForChallenge_level_complete(level) {
  8716. let keyStr = 'sjmd_challenge_level_complete';
  8717. let jsonStr = {
  8718. "count": 1,
  8719. "gold_balance ": DataMgr.getCoin(),
  8720. "level": level,
  8721. "diamond_balance ": DataMgr.getDiamond()
  8722. };
  8723. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8724. const d = LocalStorageManager.getItem(keyStr);
  8725. jsonStr.count = d.count + 1;
  8726. LocalStorageManager.setItem(keyStr, jsonStr);
  8727. }
  8728. else {
  8729. LocalStorageManager.setItem(keyStr, jsonStr);
  8730. }
  8731. const reqStr = JSON.stringify(jsonStr);
  8732. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8733. }
  8734. logEventForChallenge_level_N(level) {
  8735. console.log('zh:logEventForChallenge_level_N ' + level);
  8736. let keyStr = 'sjmd_challenge_level_N';
  8737. if (LocalStorageManager.hasKey(keyStr)) {
  8738. let lev = LocalStorageManager.getItem(keyStr);
  8739. if (level > lev) {
  8740. LocalStorageManager.setItem(keyStr, level);
  8741. }
  8742. if ((level) % 5 == 0) {
  8743. console.log('zh:每5关上报1次');
  8744. let sjmc = 'challenge_level_' + level;
  8745. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8746. let sjmcForFirebase = 'challenge_level_' + level;
  8747. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8748. }
  8749. else {
  8750. console.log('zh:5 no 上报');
  8751. }
  8752. }
  8753. else {
  8754. LocalStorageManager.setItem(keyStr, level);
  8755. }
  8756. }
  8757. }
  8758. UIGameEnd.uiName = "UIGameEnd";
  8759. class ui_UIVideoShare extends fgui.GComponent {
  8760. static createInstance() {
  8761. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8762. }
  8763. onConstruct() {
  8764. this.n10 = (this.getChild("n10"));
  8765. this.myNode = (this.getChild("myNode"));
  8766. this.t0 = this.getTransition("t0");
  8767. }
  8768. }
  8769. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8770. class UIVideoShare extends UIBase {
  8771. constructor() {
  8772. super();
  8773. this.success = false;
  8774. this.awardNum = 0;
  8775. this.isShared = true;
  8776. }
  8777. onConstructor() {
  8778. this.ui = ui_UIVideoShare.createInstance();
  8779. this.contentPane = this.ui;
  8780. this.isEject = false;
  8781. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8782. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8783. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8784. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8785. }
  8786. show(success) {
  8787. super.show();
  8788. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8789. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8790. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8791. this.success = success;
  8792. let time = xGame.common.randomNum(600, 1500);
  8793. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8794. if (success)
  8795. xGame.soundMgr.playSound("applause");
  8796. this.ui.t0.play();
  8797. this.checkShareState();
  8798. let times = DataMgr.getDailyVideoShareTimes();
  8799. this.awardNum = times == 0 ? 2000 : 200;
  8800. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8801. }
  8802. checkShareState() {
  8803. if (PlatMgr.forceShare == 0) {
  8804. this.ui.myNode.closeBtn.visible = true;
  8805. this.ui.myNode.tipsNode.visible = false;
  8806. this.ui.myNode.closeBtn.x = 90;
  8807. this.ui.myNode.shareBtn.x = 342;
  8808. }
  8809. else if (PlatMgr.forceShare == 1) {
  8810. this.ui.myNode.closeBtn.visible = false;
  8811. this.ui.myNode.tipsNode.visible = true;
  8812. this.ui.myNode.shareBtn.x = 218;
  8813. this.isShared = true;
  8814. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8815. }
  8816. }
  8817. checkForceShare() {
  8818. this.isShared = !this.isShared;
  8819. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8820. }
  8821. videoShare() {
  8822. if (PlatMgr.forceShare == 1) {
  8823. if (this.isShared) {
  8824. this.shareGame();
  8825. }
  8826. else {
  8827. this.hideSelf();
  8828. }
  8829. }
  8830. else {
  8831. this.shareGame();
  8832. }
  8833. }
  8834. shareGame() {
  8835. Moyu.sendDataEvent("VideoShare");
  8836. if (Moyu.canShare() > 100) {
  8837. Moyu.shareGame((success) => {
  8838. if (success) {
  8839. DataMgr.setDailyVideoShareTimes(1);
  8840. DataMgr.setCoin(this.awardNum);
  8841. }
  8842. this.hideSelf();
  8843. }, this);
  8844. }
  8845. else {
  8846. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8847. this.hideSelf();
  8848. }
  8849. }
  8850. hideSelf() {
  8851. this.hide();
  8852. xGame.uiMgr.Show(UIGameEnd, this.success);
  8853. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8854. xGame.common.screenImg.destroy();
  8855. xGame.common.screenImg = null;
  8856. }
  8857. }
  8858. }
  8859. UIVideoShare.uiName = "UIVideoShare";
  8860. class ui_UITips extends fgui.GComponent {
  8861. static createInstance() {
  8862. return (fgui.UIPackage.createObject("game", "UITips"));
  8863. }
  8864. onConstruct() {
  8865. this.n0 = (this.getChild("n0"));
  8866. this.myNode = (this.getChild("myNode"));
  8867. this.t0 = this.getTransition("t0");
  8868. }
  8869. }
  8870. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8871. class UITips extends UIBase {
  8872. constructor() {
  8873. super();
  8874. this.type = 0;
  8875. }
  8876. onConstructor() {
  8877. this.ui = ui_UITips.createInstance();
  8878. this.contentPane = this.ui;
  8879. this.isEject = false;
  8880. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8881. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8882. }
  8883. show(tipsTxt, womanTxt, type) {
  8884. super.show();
  8885. this.ui.t0.play();
  8886. this.ui.myNode.tipsTxt.text = tipsTxt;
  8887. this.ui.myNode.womanTxt.text = womanTxt;
  8888. PlatMgr.showInsert(true);
  8889. this.ui.myNode.c1.selectedIndex = type;
  8890. this.type = type;
  8891. switch (this.type) {
  8892. case TipsType.exitGame:
  8893. xGame.common.gameMgr.gamePause = true;
  8894. break;
  8895. case TipsType.foul:
  8896. Laya.timer.once(200, this, () => {
  8897. xGame.common.gameMgr.gamePause = true;
  8898. });
  8899. break;
  8900. default:
  8901. break;
  8902. }
  8903. }
  8904. clickLeftBtn() {
  8905. this.hide();
  8906. xGame.common.gameMgr.gamePause = false;
  8907. switch (this.type) {
  8908. case TipsType.exitGame:
  8909. break;
  8910. case TipsType.foul:
  8911. break;
  8912. default:
  8913. break;
  8914. }
  8915. }
  8916. clickRightBtn() {
  8917. this.hide();
  8918. switch (this.type) {
  8919. case TipsType.exitGame:
  8920. xGame.eventMgr.event(RESET_GAME);
  8921. xGame.uiMgr.Show(UIMain);
  8922. Moyu.recordEnd(this, null);
  8923. xGame.common.longHelpLine = false;
  8924. break;
  8925. case TipsType.foul:
  8926. xGame.common.gameMgr.gamePause = false;
  8927. Laya.timer.clearAll(this);
  8928. break;
  8929. default:
  8930. break;
  8931. }
  8932. }
  8933. }
  8934. UITips.uiName = "UITips";
  8935. class GameMgr {
  8936. constructor() {
  8937. this.selfCamp = "";
  8938. this.selfFoulNum = 0;
  8939. this.selfBallArr = [];
  8940. this.selfTimer = 0;
  8941. this.selfScore = 0;
  8942. this.aiCamp = "";
  8943. this.aiFoulNum = 0;
  8944. this.aiBallArr = [];
  8945. this.aiTimer = 0;
  8946. this.aiScore = 0;
  8947. this.aiSkillLevelNum = 1;
  8948. this.targertScore = 0;
  8949. this.setTime = 30;
  8950. this.selfTurnRate = 0.5;
  8951. this.accTime = 0;
  8952. this.curFoul = "";
  8953. this.maxFoulTimes = 3;
  8954. this.isFirstInGame = true;
  8955. this.firstColliObj = null;
  8956. this.inHoleBalls = [];
  8957. this.blackNum = 8;
  8958. this.success = false;
  8959. this.holePosList = [];
  8960. this.posObj = {};
  8961. this._selfTurn = false;
  8962. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8963. this.ensureBallType = false;
  8964. this.isOpenBall = true;
  8965. this.finishOneShoot = true;
  8966. this.isEnd = false;
  8967. this.isChangeTurn = false;
  8968. this.isInterrupt = false;
  8969. this.aiPlayedBreakArmy = false;
  8970. this.isTouchedBall = false;
  8971. this.finishBalls = 0;
  8972. this.needBalls = 0;
  8973. this.allBallNum = 0;
  8974. this.placeBallPosData = {};
  8975. this.curHP = 0;
  8976. this.showLongView = false;
  8977. this.firstShoot = true;
  8978. this._gamePause = false;
  8979. this.trunCount = 0;
  8980. this.isBlackInHole = false;
  8981. this.isEnter = true;
  8982. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8983. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8984. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8985. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8986. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8987. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8988. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8989. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8990. }
  8991. get gamePause() {
  8992. return this._gamePause;
  8993. }
  8994. set gamePause(v) {
  8995. if (v) {
  8996. Laya.physicsTimer.pause();
  8997. }
  8998. else {
  8999. Laya.physicsTimer.resume();
  9000. }
  9001. this._gamePause = v;
  9002. }
  9003. get selfTurn() {
  9004. return this._selfTurn;
  9005. }
  9006. set selfTurn(val) {
  9007. this.trunCount++;
  9008. this._selfTurn = val;
  9009. if (val) {
  9010. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9011. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9012. }
  9013. else {
  9014. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9015. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9016. if (this.trunCount > 1)
  9017. PlatMgr.openBox();
  9018. }
  9019. }
  9020. resetGame() {
  9021. this.inHoleBalls = [];
  9022. this.isFirstInGame = true;
  9023. this.firstColliObj = null;
  9024. this.aiCamp = "";
  9025. this.selfCamp = "";
  9026. this.aiFoulNum = 0;
  9027. this.selfFoulNum = 0;
  9028. this.selfBallArr = [];
  9029. this.aiBallArr = [];
  9030. this.gamePause = false;
  9031. this.ensureBallType = false;
  9032. this.isInterrupt = false;
  9033. this.updateLeftBall();
  9034. this.clearTime();
  9035. this.aiPlayedBreakArmy = false;
  9036. this.isBlackInHole = false;
  9037. this.placeBallPosData = {};
  9038. if (xGame.common.d3World.knifeRoot) {
  9039. xGame.common.d3World.knifeRoot.destroyChildren();
  9040. }
  9041. }
  9042. gameReady() {
  9043. this.trunCount = 0;
  9044. this.firstColliObj = null;
  9045. this.isFirstInGame = true;
  9046. this.selfTurn = Math.random() <= this.selfTurnRate;
  9047. let challengeNum = DataMgr.getChallengeTimes();
  9048. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9049. this.selfTurn = true;
  9050. }
  9051. if (xGame.common.gameMode == GameMode.placeBall)
  9052. this.selfTurn = true;
  9053. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9054. this.selfTurn = true;
  9055. }
  9056. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9057. this.checkGuide();
  9058. if (xGame.common.uiRodMethod)
  9059. xGame.common.uiRodMethod.resetRod();
  9060. xGame.common.d2World.getHelpLine();
  9061. this.isOpenBall = true;
  9062. this.isTouchedBall = false;
  9063. xGame.common.aiPlayer.stopRun();
  9064. this.setTime = 30;
  9065. let ui = xGame.common.gameUI.ui;
  9066. switch (xGame.common.gameMode) {
  9067. case GameMode.classic:
  9068. xGame.common.aiPlayer.init();
  9069. this.blackNum = 8;
  9070. this.placeRootBall();
  9071. this.peoplePlay(9, 10);
  9072. ui.wordsBtn.visible = true;
  9073. ui.aiWordsBtn.visible = true;
  9074. xGame.common.talkMgr.changeAIState(true);
  9075. DataMgr.gameData.gameCount++;
  9076. DataMgr.saveGameData();
  9077. break;
  9078. case GameMode.bigMove:
  9079. this.blackNum = -1;
  9080. this.selfScore = 0;
  9081. this.aiScore = 0;
  9082. xGame.common.aiPlayer.init();
  9083. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9084. this.updateSelfScore();
  9085. this.updateAIScore();
  9086. this.updateTargetSroce();
  9087. this.placeRootBall();
  9088. this.peoplePlay(9, 10);
  9089. ui.wordsBtn.visible = true;
  9090. ui.aiWordsBtn.visible = true;
  9091. xGame.common.talkMgr.changeAIState(true);
  9092. if (DataMgr.getSkillGuide() < 1)
  9093. DataMgr.gameData.gameCount = 0;
  9094. else {
  9095. DataMgr.gameData.gameCount++;
  9096. DataMgr.saveGameData();
  9097. PlatMgr.openTry();
  9098. }
  9099. if (xGame.common.d3World.knifeRoot) {
  9100. xGame.common.d3World.knifeRoot.destroyChildren();
  9101. }
  9102. break;
  9103. case GameMode.placeBall:
  9104. this.blackNum = -1;
  9105. this.selfTurn = true;
  9106. this.setTime = 10000;
  9107. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9108. this.curHP = this.placeBallData.hp;
  9109. if (this.placeBallData.ball == -1)
  9110. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9111. else
  9112. this.needBalls = this.placeBallData.ball;
  9113. console.log("需要的进球数目", this.needBalls);
  9114. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9115. this.finishBalls = 0;
  9116. this.placeBallPosData = {};
  9117. this.updatePlaceBallPos();
  9118. this.updatePlaceBallState();
  9119. this.finishOneShoot = true;
  9120. xGame.common.gameUI.ui.moveNode.visible = false;
  9121. this.isOpenBall = false;
  9122. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9123. ui.wordsBtn.visible = false;
  9124. ui.aiWordsBtn.visible = false;
  9125. xGame.common.talkMgr.changeAIState(false);
  9126. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9127. PlatMgr.openBox();
  9128. });
  9129. break;
  9130. default:
  9131. break;
  9132. }
  9133. this.showLongView = false;
  9134. xGame.common.wordsMgr.comboTimes = 1;
  9135. let guide = DataMgr.getSkillGuide();
  9136. if (guide)
  9137. xGame.eventMgr.event(WAIT_SHOOT);
  9138. xGame.common.upSkillLevel = false;
  9139. xGame.common.gameStartTime = new Date().getTime();
  9140. this.firstShoot = true;
  9141. }
  9142. checkGuide() {
  9143. let guide = DataMgr.getSkillGuide();
  9144. let gameUI = xGame.common.gameUI.ui;
  9145. gameUI.guide1.visible = false;
  9146. gameUI.guide2.visible = false;
  9147. gameUI.guide3.visible = false;
  9148. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9149. this.selfTurn = true;
  9150. }
  9151. else {
  9152. return;
  9153. }
  9154. let oneBall = this.getOneBall();
  9155. gameUI.guide1.visible = true;
  9156. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9157. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9158. }
  9159. getOneBall() {
  9160. let arr = xGame.common.d2World.ballArr;
  9161. for (let index = 0; index < arr.length; index++) {
  9162. if (arr[index].number == 0)
  9163. continue;
  9164. return arr[index];
  9165. }
  9166. }
  9167. updateSelfScore() {
  9168. let ui = xGame.common.gameUI.ui.topNode;
  9169. ui.selfScoreTxt.text = this.selfScore + "";
  9170. }
  9171. updateAIScore() {
  9172. let ui = xGame.common.gameUI.ui.topNode;
  9173. ui.aiScoreTxt.text = this.aiScore + "";
  9174. }
  9175. updateTargetSroce() {
  9176. let ui = xGame.common.gameUI.ui.topNode;
  9177. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9178. }
  9179. updateLeftBall() {
  9180. let topUI = xGame.common.gameUI.ui.topNode;
  9181. topUI.selfBallList.numItems = this.selfBallArr.length;
  9182. topUI.aiBallList.numItems = this.aiBallArr.length;
  9183. }
  9184. ballShoot() {
  9185. this.clearTime();
  9186. this.finishOneShoot = false;
  9187. xGame.common.gameUI.ui.moveNode.visible = false;
  9188. if (xGame.common.gameUI.ui.guideNode.visible) {
  9189. xGame.common.gameUI.ui.guideNode.visible = false;
  9190. }
  9191. if (this.firstShoot) {
  9192. this.firstShoot = false;
  9193. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9194. }
  9195. }
  9196. ensureCamp(number) {
  9197. this.ensureBallType = true;
  9198. this.isOpenBall = false;
  9199. if (xGame.common.gameMode != GameMode.classic)
  9200. return;
  9201. let full = [1, 2, 3, 4, 5, 6, 7];
  9202. let flower = [9, 10, 11, 12, 13, 14, 15];
  9203. let sayWords = "";
  9204. if (this.selfTurn) {
  9205. if (number <= 7) {
  9206. this.selfCamp = ballCamp.full;
  9207. this.selfBallArr = full;
  9208. this.aiCamp = ballCamp.flower;
  9209. this.aiBallArr = flower;
  9210. sayWords = cfgTable.wordsData[3].msg;
  9211. }
  9212. else {
  9213. this.selfCamp = ballCamp.flower;
  9214. this.selfBallArr = flower;
  9215. this.aiCamp = ballCamp.full;
  9216. this.aiBallArr = full;
  9217. sayWords = cfgTable.wordsData[4].msg;
  9218. }
  9219. }
  9220. else {
  9221. if (number <= 7) {
  9222. this.selfCamp = ballCamp.flower;
  9223. this.selfBallArr = flower;
  9224. this.aiCamp = ballCamp.full;
  9225. this.aiBallArr = full;
  9226. sayWords = cfgTable.wordsData[2].msg;
  9227. }
  9228. else {
  9229. this.selfCamp = ballCamp.full;
  9230. this.selfBallArr = full;
  9231. this.aiCamp = ballCamp.flower;
  9232. this.aiBallArr = flower;
  9233. sayWords = cfgTable.wordsData[1].msg;
  9234. }
  9235. }
  9236. this.updateLeftBall();
  9237. xGame.uiMgr.Show(UIMsg, sayWords);
  9238. }
  9239. updatePlaceBallState() {
  9240. let ui = xGame.common.gameUI.ui;
  9241. switch (this.placeBallData.type) {
  9242. case PlaceBallType.normal:
  9243. let normal = ui.placeNormalNode;
  9244. normal.hpTxt.text = this.curHP + "";
  9245. this.updatePlaceBallStar(normal);
  9246. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9247. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9248. break;
  9249. case PlaceBallType.challenge:
  9250. let challenge = ui.placeChallengeNode;
  9251. challenge.hpTxt.text = "Shots:" + this.curHP;
  9252. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9253. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9254. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9255. break;
  9256. default:
  9257. break;
  9258. }
  9259. }
  9260. playSubHpAni() {
  9261. let ui = xGame.common.gameUI.ui;
  9262. switch (this.placeBallData.type) {
  9263. case PlaceBallType.normal:
  9264. let normal = ui.placeNormalNode;
  9265. normal.hpTxt.visible = false;
  9266. normal.starAni.c1.selectedIndex = 1;
  9267. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9268. normal.hpTxt.visible = true;
  9269. normal.starAni.c1.selectedIndex = 0;
  9270. }));
  9271. break;
  9272. default:
  9273. break;
  9274. }
  9275. }
  9276. getEndStarNum() {
  9277. let num;
  9278. let level = xGame.common.placeBallCurLevel;
  9279. if (this.curHP == this.placeBallData.hp) {
  9280. num = 3;
  9281. }
  9282. else if (this.curHP <= 1) {
  9283. num = 1;
  9284. }
  9285. else {
  9286. num = 2;
  9287. }
  9288. if (!this.success) {
  9289. num = 0;
  9290. }
  9291. else {
  9292. DataMgr.setPlaceBallLevel(level, num);
  9293. }
  9294. let myType = cfgTable.placeballData[level].type;
  9295. if (this.success && myType == 1) {
  9296. num = 3;
  9297. }
  9298. xGame.common.placeBallStarNum = num;
  9299. }
  9300. updatePlaceBallStar(node) {
  9301. let star = 0;
  9302. if (this.curHP == this.placeBallData.hp) {
  9303. star = 3;
  9304. }
  9305. else if (this.curHP >= 2) {
  9306. star = 2;
  9307. }
  9308. else if (this.curHP == 1) {
  9309. star = 1;
  9310. }
  9311. else {
  9312. star = 0;
  9313. }
  9314. let temp;
  9315. for (let index = 1; index <= 3; index++) {
  9316. temp = node["star" + index];
  9317. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9318. }
  9319. node.myProgress.value = (star / 3) * 100;
  9320. }
  9321. openRegretView(isFoul, GoalNum, challenge = false) {
  9322. let regretType = -1;
  9323. if (isFoul) {
  9324. regretType = 1;
  9325. }
  9326. else {
  9327. if (GoalNum <= 0) {
  9328. regretType = 0;
  9329. }
  9330. }
  9331. if (challenge) {
  9332. regretType = 1;
  9333. }
  9334. if (regretType != -1) {
  9335. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9336. if (success) {
  9337. this.curHP++;
  9338. this.updatePlaceBallState();
  9339. this.setPlaceBallAllPos();
  9340. xGame.common.gameUI.ui.moveNode.visible = false;
  9341. }
  9342. else {
  9343. if (this.curHP <= 0) {
  9344. this.success = false;
  9345. this.gameEnd();
  9346. }
  9347. this.playSubHpAni();
  9348. }
  9349. this.updatePlaceBallState();
  9350. this.updatePlaceBallPos();
  9351. });
  9352. }
  9353. }
  9354. setPlaceBallAllPos() {
  9355. let allBall = xGame.common.d2World.ballArr;
  9356. let cfgArr = this.placeBallPosData;
  9357. let temp;
  9358. let obj;
  9359. for (let index = 0; index < allBall.length; index++) {
  9360. temp = allBall[index];
  9361. if (temp.destroyed)
  9362. continue;
  9363. obj = cfgArr[temp.myUNID];
  9364. if (obj && obj.src && !obj.src.destroyed) {
  9365. temp.gameObj.x = obj.posX;
  9366. temp.gameObj.y = obj.posY;
  9367. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9368. }
  9369. }
  9370. xGame.common.d2World.getHelpLine();
  9371. }
  9372. updatePlaceBallPos() {
  9373. let arr = xGame.common.d2World.ballArr;
  9374. let temp;
  9375. for (let index = 0; index < arr.length; index++) {
  9376. temp = arr[index];
  9377. if (!this.placeBallPosData[temp.myUNID]) {
  9378. this.placeBallPosData[temp.myUNID] = {
  9379. src: temp,
  9380. posX: temp.gameObj.x,
  9381. posY: temp.gameObj.y
  9382. };
  9383. }
  9384. else {
  9385. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9386. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9387. }
  9388. }
  9389. let check;
  9390. for (const key in this.placeBallPosData) {
  9391. check = this.placeBallPosData[key];
  9392. if (check.src.destroyed) {
  9393. delete this.placeBallPosData[key];
  9394. }
  9395. }
  9396. }
  9397. gameRun(type) {
  9398. if (this.gamePause)
  9399. return;
  9400. this.curFoul = this.getFoulType();
  9401. if (type) {
  9402. xGame.common.d2World.d2Gan.shoot();
  9403. xGame.common.gameUI.forceCancel();
  9404. this.curFoul = type;
  9405. }
  9406. this.isEnd = false;
  9407. this.isChangeTurn = true;
  9408. if (xGame.common.gameMode == GameMode.classic) {
  9409. this.judgeClassic(this.curFoul);
  9410. this.checkClassicWords(() => {
  9411. xGame.common.destroyClassicEmotion();
  9412. if (this.isEnd) {
  9413. if (this.isBlackInHole) {
  9414. xGame.common.gameUI.ui.blackAni.visible = true;
  9415. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9416. xGame.common.gameUI.ui.blackAni.visible = false;
  9417. this.gameEnd();
  9418. }));
  9419. }
  9420. else {
  9421. this.gameEnd();
  9422. }
  9423. }
  9424. else {
  9425. this.waitShoot();
  9426. xGame.eventMgr.event(WAIT_SHOOT);
  9427. }
  9428. });
  9429. }
  9430. else if (xGame.common.gameMode == GameMode.bigMove) {
  9431. xGame.common.aiPlayer.stopRun();
  9432. let scoreArr = this.getScore(this.curFoul);
  9433. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9434. this.isEnd = true;
  9435. }
  9436. this.checkBigSkillWords(() => {
  9437. if (this.isEnd) {
  9438. this.gameEnd();
  9439. }
  9440. else {
  9441. this.waitShoot();
  9442. xGame.eventMgr.event(WAIT_SHOOT);
  9443. }
  9444. });
  9445. }
  9446. else if (xGame.common.gameMode == GameMode.placeBall) {
  9447. xGame.common.destroyAwardSpine();
  9448. let isFoul = this.curFoul == FoulType.rootHole;
  9449. let GoalNum = this.inHoleBalls.length;
  9450. if (this.inHoleBalls.indexOf(0) > -1)
  9451. GoalNum -= 1;
  9452. if (isFoul) {
  9453. this.placeRootBall();
  9454. }
  9455. console.log("neeballs", this.needBalls);
  9456. console.log("当前完成的goalNum", GoalNum);
  9457. this.finishBalls += GoalNum;
  9458. console.log("当前完成的finishballs", this.finishBalls);
  9459. let need = this.needBalls;
  9460. if (this.placeBallData.type == PlaceBallType.challenge) {
  9461. need += 100;
  9462. }
  9463. if (this.finishBalls >= need) {
  9464. this.success = true;
  9465. this.gameEnd();
  9466. }
  9467. else {
  9468. switch (this.placeBallData.type) {
  9469. case PlaceBallType.normal:
  9470. if (!isFoul && GoalNum > 0) {
  9471. this.updatePlaceBallPos();
  9472. this.updatePlaceBallState();
  9473. }
  9474. else {
  9475. this.curHP--;
  9476. this.openRegretView(isFoul, GoalNum);
  9477. }
  9478. this.waitShoot();
  9479. xGame.eventMgr.event(WAIT_SHOOT);
  9480. break;
  9481. case PlaceBallType.challenge:
  9482. this.curHP--;
  9483. this.updatePlaceBallState();
  9484. if (isFoul) {
  9485. this.openRegretView(isFoul, GoalNum, true);
  9486. }
  9487. else {
  9488. this.updatePlaceBallPos();
  9489. if (this.curHP <= 0) {
  9490. this.success = true;
  9491. this.gameEnd();
  9492. }
  9493. }
  9494. this.waitShoot();
  9495. xGame.eventMgr.event(WAIT_SHOOT);
  9496. break;
  9497. default:
  9498. break;
  9499. }
  9500. }
  9501. }
  9502. }
  9503. checkClassicWords(callback) {
  9504. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9505. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9506. let type = this.getClassicWordsType();
  9507. if (condition && type != -1) {
  9508. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9509. xGame.soundMgr.playSound(str);
  9510. xGame.common.wordsMgr.playClassicWords(type, callback);
  9511. }
  9512. else {
  9513. Laya.timer.once(300, this, () => {
  9514. callback && callback();
  9515. });
  9516. }
  9517. }
  9518. getClassicWordsType() {
  9519. let d2world = xGame.common.d2World;
  9520. let type = -1;
  9521. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9522. type = ClassicWordsType.perfectShow;
  9523. return type;
  9524. }
  9525. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9526. type = ClassicWordsType.directShoot;
  9527. return type;
  9528. }
  9529. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9530. type = ClassicWordsType.anotherShoot;
  9531. return type;
  9532. }
  9533. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9534. type = ClassicWordsType.bigPower;
  9535. return type;
  9536. }
  9537. let minSpeed = 1;
  9538. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9539. type = ClassicWordsType.hardShoot;
  9540. return type;
  9541. }
  9542. if (this.inHoleBalls.length > 0) {
  9543. type = ClassicWordsType.directShoot;
  9544. return type;
  9545. }
  9546. return type;
  9547. }
  9548. checkBigSkillWords(callback) {
  9549. if (this.curFoul == FoulType.timeOut) {
  9550. callback && callback();
  9551. }
  9552. else {
  9553. let playSkill = false;
  9554. if (this.selfTurn) {
  9555. playSkill = true;
  9556. }
  9557. else {
  9558. if (!this.aiPlayedBreakArmy) {
  9559. this.aiPlayedBreakArmy = true;
  9560. playSkill = true;
  9561. }
  9562. if (this.aiCurSkill != SkillType.breakArmy) {
  9563. playSkill = true;
  9564. }
  9565. }
  9566. if (xGame.common.skillMgr.playedLastSkill) {
  9567. xGame.common.skillMgr.playedLastSkill = false;
  9568. playSkill = false;
  9569. }
  9570. if (playSkill) {
  9571. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9572. let selfExtra = 0;
  9573. let aiExtra = 0;
  9574. if (this.selfTurn)
  9575. selfExtra += extraScore;
  9576. else
  9577. aiExtra += extraScore;
  9578. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9579. this.isEnd = true;
  9580. }
  9581. this.playBigSkillTimes(callback);
  9582. });
  9583. }
  9584. else {
  9585. this.playBigSkillTimes(callback);
  9586. }
  9587. }
  9588. }
  9589. playBigSkillTimes(callback) {
  9590. let length = this.inHoleBalls.length;
  9591. if (this.inHoleBalls.indexOf(0) > -1) {
  9592. length = this.inHoleBalls.length - 1;
  9593. }
  9594. if (length <= 0) {
  9595. callback && callback();
  9596. return;
  9597. }
  9598. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9599. callback && callback();
  9600. });
  9601. }
  9602. playSkillTips() {
  9603. let levelNum = 0;
  9604. let curType;
  9605. if (this.selfTurn) {
  9606. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9607. curType = this.selfCurSkill;
  9608. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9609. levelNum += 5;
  9610. }
  9611. }
  9612. else {
  9613. levelNum = this.aiSkillLevelNum;
  9614. curType = this.aiCurSkill;
  9615. }
  9616. let str = ``;
  9617. switch (curType) {
  9618. case SkillType.highSpace:
  9619. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9620. break;
  9621. case SkillType.breakArmy:
  9622. str = `You pocketed ${levelNum} extra balls`;
  9623. break;
  9624. case SkillType.ice:
  9625. str = `${levelNum * 2} extra balls were frozen`;
  9626. break;
  9627. case SkillType.fireworks:
  9628. str = `${levelNum} extra balls exploded `;
  9629. break;
  9630. case SkillType.GuanYu:
  9631. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9632. break;
  9633. default:
  9634. break;
  9635. }
  9636. xGame.uiMgr.Show(UIMsg, str);
  9637. }
  9638. getFoulType() {
  9639. let foulType = "";
  9640. if (this.firstColliObj == null) {
  9641. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9642. return FoulType.rootHole;
  9643. }
  9644. return FoulType.notTouch;
  9645. }
  9646. else {
  9647. if (this.selfTurn) {
  9648. if (this.selfBallArr.length > 0) {
  9649. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9650. foulType = FoulType.wrongTouch;
  9651. }
  9652. }
  9653. else {
  9654. if (this.ensureBallType) {
  9655. }
  9656. else {
  9657. if (this.firstColliObj == this.blackNum) {
  9658. foulType = FoulType.wrongTouch;
  9659. }
  9660. }
  9661. }
  9662. }
  9663. else {
  9664. if (this.aiBallArr.length > 0) {
  9665. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9666. foulType = FoulType.wrongTouch;
  9667. }
  9668. }
  9669. else {
  9670. if (this.ensureBallType) {
  9671. }
  9672. else {
  9673. if (this.firstColliObj == this.blackNum) {
  9674. foulType = FoulType.wrongTouch;
  9675. }
  9676. }
  9677. }
  9678. }
  9679. if (this.inHoleBalls.length <= 0) {
  9680. return foulType;
  9681. }
  9682. let temp;
  9683. if (this.inHoleBalls.indexOf(0) > -1) {
  9684. foulType = FoulType.rootHole;
  9685. }
  9686. else {
  9687. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9688. temp = this.inHoleBalls[index];
  9689. if (this.selfTurn) {
  9690. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9691. foulType = FoulType.wrongHole;
  9692. break;
  9693. }
  9694. }
  9695. else {
  9696. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9697. foulType = FoulType.wrongHole;
  9698. break;
  9699. }
  9700. }
  9701. }
  9702. }
  9703. let foo;
  9704. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9705. temp = this.inHoleBalls[index];
  9706. foo = this.selfBallArr.indexOf(temp);
  9707. if (foo > -1) {
  9708. this.selfBallArr.splice(foo, 1);
  9709. }
  9710. foo = this.aiBallArr.indexOf(temp);
  9711. if (foo > -1) {
  9712. this.aiBallArr.splice(foo, 1);
  9713. }
  9714. }
  9715. this.updateLeftBall();
  9716. }
  9717. return foulType;
  9718. }
  9719. judgeGameEndByBlack(arr) {
  9720. if (this.selfTurn) {
  9721. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9722. this.selfFoulNum = this.maxFoulTimes;
  9723. return true;
  9724. }
  9725. }
  9726. else {
  9727. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9728. this.aiFoulNum = this.maxFoulTimes;
  9729. return true;
  9730. }
  9731. }
  9732. }
  9733. judgeClassic(type) {
  9734. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9735. xGame.common.aiPlayer.stopRun();
  9736. if (this.judgeNormalSuccess()) {
  9737. this.isEnd = true;
  9738. return;
  9739. }
  9740. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9741. if (this.selfTurn) {
  9742. if (isFoul) {
  9743. this.selfFoulNum++;
  9744. }
  9745. if (this.selfFoulNum >= this.maxFoulTimes) {
  9746. this.success = false;
  9747. this.isEnd = true;
  9748. return;
  9749. }
  9750. }
  9751. else {
  9752. if (isFoul)
  9753. this.aiFoulNum++;
  9754. if (this.aiFoulNum >= this.maxFoulTimes) {
  9755. this.success = true;
  9756. this.isEnd = true;
  9757. return;
  9758. }
  9759. }
  9760. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9761. this.isChangeTurn = false;
  9762. }
  9763. else {
  9764. this.isInterrupt = true;
  9765. }
  9766. }
  9767. waitShoot() {
  9768. if (xGame.common.gameMode == GameMode.classic) {
  9769. switch (this.curFoul) {
  9770. case FoulType.timeOut:
  9771. case FoulType.rootHole:
  9772. this.selfTurn = !this.selfTurn;
  9773. this.peoplePlay(5, 6, true);
  9774. break;
  9775. case FoulType.notTouch:
  9776. this.selfTurn = !this.selfTurn;
  9777. this.peoplePlay(7, 7);
  9778. break;
  9779. case FoulType.wrongHole:
  9780. this.selfTurn = !this.selfTurn;
  9781. this.peoplePlay(11, 11);
  9782. break;
  9783. default:
  9784. if (this.inHoleBalls.length > 0) {
  9785. this.peoplePlay(0, 0, false, false);
  9786. }
  9787. else {
  9788. this.selfTurn = !this.selfTurn;
  9789. this.peoplePlay(7, 7);
  9790. }
  9791. break;
  9792. }
  9793. }
  9794. else if (xGame.common.gameMode == GameMode.bigMove) {
  9795. if (this.curFoul == FoulType.timeOut) {
  9796. this.selfTurn = !this.selfTurn;
  9797. this.peoplePlay(14, 15);
  9798. this.placeRootBall();
  9799. }
  9800. else {
  9801. this.selfTurn = !this.selfTurn;
  9802. if (this.curFoul == FoulType.rootHole) {
  9803. this.peoplePlay(12, 13);
  9804. this.placeRootBall();
  9805. }
  9806. else {
  9807. this.peoplePlay(0, 0, false, false);
  9808. }
  9809. }
  9810. }
  9811. else if (xGame.common.gameMode == GameMode.placeBall) {
  9812. this.finishOneShoot = true;
  9813. }
  9814. this.gameResult();
  9815. }
  9816. gameResult() {
  9817. this.firstColliObj = null;
  9818. this.inHoleBalls = [];
  9819. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9820. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9821. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9822. if (xGame.common.uiRodMethod)
  9823. xGame.common.uiRodMethod.resetRod();
  9824. xGame.common.d2World.rootBall.showSelf();
  9825. this.clearIceSkill();
  9826. if (this.selfTurn) {
  9827. PlatMgr.gameInsert();
  9828. }
  9829. xGame.common.d3World.knifeRoot.destroyChildren();
  9830. if (this.selfTurn) {
  9831. xGame.common.gameUI.showHelpLineGuide();
  9832. xGame.common.gameUI.setTurnAlpha(true);
  9833. }
  9834. else {
  9835. xGame.common.gameUI.setTurnAlpha(false);
  9836. }
  9837. }
  9838. getScore(type) {
  9839. let selfAdd = 0;
  9840. let aiAdd = 0;
  9841. if (type == FoulType.timeOut) {
  9842. if (this.selfTurn)
  9843. aiAdd += 3;
  9844. else
  9845. selfAdd += 3;
  9846. }
  9847. else {
  9848. if (this.inHoleBalls.length > 0) {
  9849. if (this.selfTurn) {
  9850. if (type == FoulType.rootHole) {
  9851. aiAdd += 3;
  9852. if (this.inHoleBalls.length - 1 > 0) {
  9853. selfAdd += this.inHoleBalls.length - 1;
  9854. }
  9855. }
  9856. else {
  9857. selfAdd += this.inHoleBalls.length;
  9858. }
  9859. }
  9860. else {
  9861. if (type == FoulType.rootHole) {
  9862. selfAdd += 3;
  9863. if (this.inHoleBalls.length - 1 > 0) {
  9864. aiAdd += this.inHoleBalls.length - 1;
  9865. }
  9866. }
  9867. else {
  9868. aiAdd += this.inHoleBalls.length;
  9869. }
  9870. }
  9871. }
  9872. }
  9873. return [selfAdd, aiAdd];
  9874. }
  9875. judgeScoreEnd(selfAdd, aiAdd) {
  9876. this.selfScore += selfAdd;
  9877. this.aiScore += aiAdd;
  9878. this.updateAIScore();
  9879. this.updateSelfScore();
  9880. if (this.selfScore >= this.targertScore) {
  9881. this.success = true;
  9882. return true;
  9883. }
  9884. if (this.aiScore >= this.targertScore) {
  9885. this.success = false;
  9886. return true;
  9887. }
  9888. let ballArr = xGame.common.d2World.ballArr;
  9889. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9890. if (this.selfScore > this.aiScore) {
  9891. this.success = true;
  9892. return true;
  9893. }
  9894. else if (this.selfScore < this.aiScore) {
  9895. this.success = false;
  9896. return true;
  9897. }
  9898. else {
  9899. if (this.selfTurn) {
  9900. this.success = false;
  9901. }
  9902. else {
  9903. this.success = true;
  9904. }
  9905. return true;
  9906. }
  9907. }
  9908. }
  9909. clearIceSkill() {
  9910. let arr = xGame.common.d2World.ballArr;
  9911. let temp;
  9912. if (this.selfTurn) {
  9913. if (this.selfCurSkill == SkillType.ice) {
  9914. for (let index = 0; index < arr.length; index++) {
  9915. temp = arr[index];
  9916. if (temp.ballFunc == "ice") {
  9917. temp.setBallFunc("normal", "self");
  9918. }
  9919. }
  9920. }
  9921. }
  9922. else {
  9923. if (this.aiCurSkill == SkillType.ice) {
  9924. for (let index = 0; index < arr.length; index++) {
  9925. temp = arr[index];
  9926. if (temp.ballFunc == "ice") {
  9927. temp.setBallFunc("normal", "ai");
  9928. }
  9929. }
  9930. }
  9931. }
  9932. }
  9933. judgeNormalSuccess() {
  9934. if (this.selfTurn) {
  9935. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9936. this.success = true;
  9937. return true;
  9938. }
  9939. }
  9940. else {
  9941. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9942. this.success = false;
  9943. return true;
  9944. }
  9945. }
  9946. }
  9947. gameEnd() {
  9948. if (Moyu.isTT) {
  9949. xGame.common.screenImg = getScreenImg();
  9950. }
  9951. console.log("游戏结束", this.success);
  9952. xGame.common.aiPlayer.stopRun();
  9953. if (xGame.common.gameMode == GameMode.placeBall) {
  9954. this.getEndStarNum();
  9955. this.updatePlaceBallState();
  9956. }
  9957. this.isEnter = false;
  9958. Moyu.recordEnd(this, () => {
  9959. if (this.isEnter)
  9960. return;
  9961. this.isEnter = true;
  9962. console.log("进入录结束回调");
  9963. this.enterNext();
  9964. });
  9965. Laya.timer.once(1000, this, () => {
  9966. if (this.isEnter)
  9967. return;
  9968. this.isEnter = true;
  9969. this.enterNext();
  9970. });
  9971. xGame.common.longHelpLine = false;
  9972. }
  9973. enterNext() {
  9974. Laya.timer.clearAll(this);
  9975. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9976. xGame.uiMgr.Show(UIVideoShare, this.success);
  9977. }
  9978. else {
  9979. xGame.uiMgr.Show(UIGameEnd, this.success);
  9980. }
  9981. }
  9982. aiLeave() {
  9983. let ui = xGame.common.gameUI.ui;
  9984. ui.topNode.aiNameTxt.text = "offline";
  9985. }
  9986. aiGameEnd(suc) {
  9987. this.success = suc;
  9988. xGame.common.aiPlayer.stopRun();
  9989. if (this.success) {
  9990. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9991. Laya.timer.once(1000, this, () => {
  9992. this.clearTime();
  9993. this.gameEnd();
  9994. });
  9995. }
  9996. }
  9997. openTimer() {
  9998. let src = xGame.common.gameUI;
  9999. if (this.selfTurn) {
  10000. src.ui.topNode.selfProgress.visible = true;
  10001. src.ui.topNode.aiProgress.visible = false;
  10002. this.curTimer = src.ui.topNode.selfProgress;
  10003. }
  10004. else {
  10005. src.ui.topNode.selfProgress.visible = false;
  10006. src.ui.topNode.aiProgress.visible = true;
  10007. this.curTimer = src.ui.topNode.aiProgress;
  10008. }
  10009. this.accTime = 0;
  10010. Laya.timer.clearAll(this);
  10011. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10012. this.curTimer.value = 100;
  10013. }
  10014. updateTime(dt) {
  10015. if (this.gamePause)
  10016. return;
  10017. this.accTime += dt;
  10018. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10019. if (this.accTime >= this.setTime) {
  10020. this.clearTime();
  10021. console.log("时钟进入了gameRun");
  10022. this.gameRun(FoulType.timeOut);
  10023. }
  10024. }
  10025. clearTime() {
  10026. let src = xGame.common.gameUI;
  10027. src.ui.topNode.selfProgress.visible = false;
  10028. src.ui.topNode.aiProgress.visible = false;
  10029. Laya.timer.clearAll(this);
  10030. }
  10031. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10032. let ui = xGame.common.gameUI.ui;
  10033. let selfMsg, aiMsg;
  10034. if (sayWords) {
  10035. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10036. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10037. if (Foul) {
  10038. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10039. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10040. this.placeRootBall();
  10041. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10042. if (this.curFoul == FoulType.rootHole) {
  10043. if (!DataMgr.getRootBallFoul()) {
  10044. DataMgr.setRootBallFoul();
  10045. aiMsg = "";
  10046. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10047. let woman = "Boss, pay attention next time~";
  10048. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10049. }
  10050. }
  10051. else if (this.curFoul == FoulType.timeOut) {
  10052. if (!DataMgr.getTimeoutFoul()) {
  10053. DataMgr.setTimeoutFoul();
  10054. aiMsg = "";
  10055. let tips = "Game timeout, 3 fouls, this game failed.";
  10056. let woman = "Boss, pay attention to the timeline~";
  10057. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10058. }
  10059. }
  10060. }
  10061. }
  10062. }
  10063. if (this.selfTurn) {
  10064. if (sayWords) {
  10065. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10066. ui.selfTurn.visible = true;
  10067. ui.aiTurn.visible = false;
  10068. ui.selfTurn.t0.play();
  10069. Moyu.vibration();
  10070. });
  10071. }
  10072. }
  10073. else {
  10074. let aiNum = xGame.tools.random(1, 11);
  10075. let challengeNum = DataMgr.getChallengeTimes();
  10076. let delay = false;
  10077. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10078. aiNum = 9;
  10079. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10080. aiNum = 3;
  10081. if (challengeNum == 3) {
  10082. if (!this.showLongView) {
  10083. this.showLongView = true;
  10084. delay = true;
  10085. }
  10086. }
  10087. }
  10088. }
  10089. if (delay) {
  10090. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10091. if (success) {
  10092. xGame.common.longHelpLine = true;
  10093. xGame.common.d2World.getHelpLine();
  10094. }
  10095. else {
  10096. aiNum = 10;
  10097. }
  10098. xGame.common.aiPlayer.setAiLevel(aiNum);
  10099. if (sayWords) {
  10100. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10101. xGame.common.aiPlayer.runAI();
  10102. ui.selfTurn.visible = false;
  10103. ui.aiTurn.visible = true;
  10104. ui.aiTurn.t0.play();
  10105. });
  10106. }
  10107. else {
  10108. xGame.common.aiPlayer.runAI();
  10109. }
  10110. this.openTimer();
  10111. this.finishOneShoot = true;
  10112. if (this.selfTurn) {
  10113. ui.topNode.selfKuang.visible = true;
  10114. ui.topNode.aiKuang.visible = false;
  10115. ui.topNode.selfTips.visible = true;
  10116. ui.topNode.aiTips.visible = false;
  10117. }
  10118. else {
  10119. ui.topNode.selfKuang.visible = false;
  10120. ui.topNode.aiKuang.visible = true;
  10121. ui.topNode.selfTips.visible = false;
  10122. ui.topNode.aiTips.visible = true;
  10123. }
  10124. });
  10125. return;
  10126. }
  10127. if (xGame.common.gameMode == GameMode.classic) {
  10128. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10129. if (cfg) {
  10130. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10131. aiNum = aiLevel;
  10132. }
  10133. }
  10134. xGame.common.aiPlayer.setAiLevel(aiNum);
  10135. if (sayWords) {
  10136. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10137. xGame.common.aiPlayer.runAI();
  10138. ui.selfTurn.visible = false;
  10139. ui.aiTurn.visible = true;
  10140. ui.aiTurn.t0.play();
  10141. });
  10142. }
  10143. else {
  10144. xGame.common.aiPlayer.runAI();
  10145. }
  10146. }
  10147. this.openTimer();
  10148. this.finishOneShoot = true;
  10149. if (this.selfTurn) {
  10150. ui.topNode.selfKuang.visible = true;
  10151. ui.topNode.aiKuang.visible = false;
  10152. ui.topNode.selfTips.visible = true;
  10153. ui.topNode.aiTips.visible = false;
  10154. }
  10155. else {
  10156. ui.topNode.selfKuang.visible = false;
  10157. ui.topNode.aiKuang.visible = true;
  10158. ui.topNode.selfTips.visible = false;
  10159. ui.topNode.aiTips.visible = true;
  10160. }
  10161. }
  10162. placeRootBall() {
  10163. let rootBall = xGame.common.d2World.rootBall;
  10164. if (!rootBall)
  10165. return;
  10166. rootBall.gameObj.x = this.lastRootBallPos.x;
  10167. rootBall.gameObj.y = this.lastRootBallPos.y;
  10168. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10169. let moveNode = xGame.common.gameUI.ui.moveNode;
  10170. moveNode.visible = true;
  10171. moveNode.x = this.lastRootBallPos.x;
  10172. moveNode.y = this.lastRootBallPos.y;
  10173. if (!this.selfTurn) {
  10174. xGame.common.aiPlayer.resetRoot();
  10175. }
  10176. }
  10177. }
  10178. class ui_guanyuAni extends fgui.GComponent {
  10179. static createInstance() {
  10180. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10181. }
  10182. onConstruct() {
  10183. this.n0 = (this.getChild("n0"));
  10184. }
  10185. }
  10186. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10187. class UIFireworks extends UIBase {
  10188. constructor() {
  10189. super();
  10190. }
  10191. onConstructor() {
  10192. this.isEject = false;
  10193. }
  10194. show(callback) {
  10195. super.show();
  10196. }
  10197. }
  10198. UIFireworks.uiName = "UIFireworks";
  10199. class ui_UIGuanYu extends fgui.GComponent {
  10200. static createInstance() {
  10201. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10202. }
  10203. onConstruct() {
  10204. this.n2 = (this.getChild("n2"));
  10205. this.n1 = (this.getChild("n1"));
  10206. this.n3 = (this.getChild("n3"));
  10207. this.n4 = (this.getChild("n4"));
  10208. this.n5 = (this.getChild("n5"));
  10209. this.n6 = (this.getChild("n6"));
  10210. this.n8 = (this.getChild("n8"));
  10211. this.n7 = (this.getChild("n7"));
  10212. this.t0 = this.getTransition("t0");
  10213. }
  10214. }
  10215. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10216. class UIGuanYu extends UIBase {
  10217. constructor() {
  10218. super();
  10219. }
  10220. onConstructor() {
  10221. this.ui = ui_UIGuanYu.createInstance();
  10222. this.contentPane = this.ui;
  10223. this.isEject = false;
  10224. }
  10225. show(callback) {
  10226. super.show();
  10227. this.ui.t0.play(Laya.Handler.create(this, () => {
  10228. callback && callback();
  10229. this.hide();
  10230. }));
  10231. }
  10232. }
  10233. UIGuanYu.uiName = "UIGuanYu";
  10234. class SkillMgr {
  10235. constructor() {
  10236. this.leveNum = 0;
  10237. this.extraScore = 0;
  10238. this.selfTurn = false;
  10239. this.playedLastSkill = false;
  10240. this.tweenArr = [];
  10241. this._finishNum = 0;
  10242. this._curFinish = 0;
  10243. this._rootX = 0;
  10244. this._rootY = 0;
  10245. this.knifeTimes = 0;
  10246. this.knifeV2 = new Laya.Vector2();
  10247. this.knifeV3 = new Laya.Vector3();
  10248. this.rtStarX = 0;
  10249. this.rtStarY = 0;
  10250. this.addBigSkillSpine();
  10251. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10252. }
  10253. addBigSkillSpine() {
  10254. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10255. console.log("extra2 success");
  10256. });
  10257. }
  10258. runBigSkill(callback) {
  10259. this.tweenArr = [];
  10260. this.callback = callback;
  10261. this.judgeSkill();
  10262. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10263. let guide = DataMgr.getSkillGuide();
  10264. if (!xGame.common.gameMgr.selfTurn) {
  10265. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10266. }
  10267. else {
  10268. if (xGame.common.temSelfLevel != 0) {
  10269. this.leveNum = xGame.common.temSelfLevel;
  10270. }
  10271. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10272. this.leveNum += 5;
  10273. }
  10274. }
  10275. if (guide == 0) {
  10276. DataMgr.setSkillGuide(1);
  10277. if (DataMgr.getNewUser()) {
  10278. Moyu.sendDataEvent("gameFirstPlay");
  10279. DataMgr.setNewUser();
  10280. }
  10281. }
  10282. this.playSpineAni(() => {
  10283. switch (this.curSkill) {
  10284. case SkillType.highSpace:
  10285. this.runHighSpace();
  10286. break;
  10287. case SkillType.breakArmy:
  10288. this.runBreakArmy();
  10289. break;
  10290. case SkillType.ice:
  10291. this.runIce();
  10292. break;
  10293. case SkillType.fireworks:
  10294. this.runFireworks();
  10295. break;
  10296. case SkillType.GuanYu:
  10297. this.runGuanYu();
  10298. break;
  10299. default:
  10300. break;
  10301. }
  10302. });
  10303. }
  10304. judgeSkill() {
  10305. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10306. let gameMgr = xGame.common.gameMgr;
  10307. let type;
  10308. for (let index = 0; index < typeArr.length; index++) {
  10309. type = typeArr[index];
  10310. if (gameMgr.selfTurn) {
  10311. if (gameMgr.selfCurSkill == type) {
  10312. this.selfTurn = true;
  10313. this.curSkill = type;
  10314. return;
  10315. }
  10316. }
  10317. else {
  10318. if (gameMgr.aiCurSkill == type) {
  10319. this.selfTurn = false;
  10320. this.curSkill = type;
  10321. return;
  10322. }
  10323. }
  10324. }
  10325. }
  10326. playSpineAni(callback) {
  10327. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10328. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10329. parent.destroyChildren();
  10330. let aniIndex = 0;
  10331. let skillSpine;
  10332. switch (this.curSkill) {
  10333. case SkillType.highSpace:
  10334. aniIndex = 1;
  10335. xGame.soundMgr.playSound("skill01");
  10336. skillSpine = this.skillSpine2;
  10337. data.scaleX = 0.5;
  10338. data.scaleY = 0.5;
  10339. skillSpine.play(data, 1, false, parent, () => {
  10340. callback && callback();
  10341. });
  10342. break;
  10343. case SkillType.breakArmy:
  10344. aniIndex = 2;
  10345. xGame.soundMgr.playSound("skill02");
  10346. skillSpine = this.skillSpine2;
  10347. data.scaleX = 0.5;
  10348. data.scaleY = 0.5;
  10349. skillSpine.play(data, 2, false, parent, () => {
  10350. callback && callback();
  10351. });
  10352. break;
  10353. case SkillType.ice:
  10354. aniIndex = 0;
  10355. xGame.soundMgr.playSound("skill03");
  10356. skillSpine = this.skillSpine2;
  10357. data.scaleX = 0.5;
  10358. data.scaleY = 0.5;
  10359. skillSpine.play(data, 0, false, parent, () => {
  10360. callback && callback();
  10361. });
  10362. break;
  10363. case SkillType.fireworks:
  10364. xGame.soundMgr.playSound("skill_04_01");
  10365. xGame.soundMgr.playSound("skill04");
  10366. xGame.uiMgr.Show(UIFireworks, callback);
  10367. break;
  10368. case SkillType.GuanYu:
  10369. xGame.soundMgr.playSound("skill05_1");
  10370. xGame.soundMgr.playSound("skill05");
  10371. xGame.uiMgr.Show(UIGuanYu, callback);
  10372. break;
  10373. default:
  10374. break;
  10375. }
  10376. }
  10377. getAllBallArr() {
  10378. let arr = xGame.common.d2World.ballArr;
  10379. let outArr = [];
  10380. for (let index = 0; index < arr.length; index++) {
  10381. if (arr[index] instanceof D2RootBallSrc)
  10382. continue;
  10383. if (arr[index].ballFunc == "ice")
  10384. continue;
  10385. if (arr[index].destroyed)
  10386. continue;
  10387. outArr.push(arr[index]);
  10388. }
  10389. return outArr;
  10390. }
  10391. getOneArr(deletObj) {
  10392. let allArr = this.getAllBallArr();
  10393. let temp;
  10394. for (let index = 0; index < allArr.length; index++) {
  10395. temp = allArr[index];
  10396. if (temp.id == deletObj.id) {
  10397. allArr.splice(index, 1);
  10398. break;
  10399. }
  10400. }
  10401. return allArr;
  10402. }
  10403. getNearBallBag(ball) {
  10404. let ui = xGame.common.gameUI.ui;
  10405. let circleArr = [];
  10406. for (let index = 1; index <= 6; index++) {
  10407. circleArr.push(ui.border["circle" + index]);
  10408. }
  10409. let outIndex = 0;
  10410. let temp;
  10411. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10412. ;
  10413. let dis = 0;
  10414. for (let index = 1; index < circleArr.length; index++) {
  10415. temp = circleArr[index];
  10416. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10417. if (dis < min) {
  10418. min = dis;
  10419. outIndex = index;
  10420. }
  10421. }
  10422. return [circleArr[outIndex], outIndex];
  10423. }
  10424. ballFlyToBag(ballArr, time = 300) {
  10425. let temp;
  10426. let hole;
  10427. this._finishNum = ballArr.length;
  10428. this._curFinish = 0;
  10429. let holeObj = {};
  10430. let holeCfg = {
  10431. "1": 0,
  10432. "2": 0,
  10433. "3": 0,
  10434. "4": 0,
  10435. "5": 0,
  10436. "6": 0
  10437. };
  10438. for (let index = 0; index < ballArr.length; index++) {
  10439. temp = ballArr[index];
  10440. temp.outColli.isSensor = true;
  10441. temp.innerColli.isSensor = true;
  10442. temp.isRunSkillAni = true;
  10443. let holeArr = this.getNearBallBag(temp);
  10444. hole = holeArr[0];
  10445. holeObj[index] = holeArr[1];
  10446. temp.d3BallSrc.scaleXYZ = 0.5;
  10447. this.tweenArr.push(temp.d3BallSrc, temp);
  10448. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10449. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10450. }));
  10451. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10452. let mIndex = holeObj[this._curFinish];
  10453. let isDone = holeCfg[mIndex];
  10454. if (isDone) {
  10455. ballArr[this._curFinish].checkWrongBall(false);
  10456. }
  10457. else {
  10458. holeCfg[mIndex] = 1;
  10459. ballArr[this._curFinish].checkWrongBall();
  10460. }
  10461. this._curFinish++;
  10462. if (this._curFinish >= this._finishNum) {
  10463. if (this.curSkill == SkillType.highSpace) {
  10464. }
  10465. else if (this.curSkill == SkillType.breakArmy) {
  10466. let rootBall = xGame.common.d2World.rootBall;
  10467. rootBall.gameObj.x = this._rootX;
  10468. rootBall.gameObj.y = this._rootY;
  10469. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10470. xGame.common.d2World.d2Gan.ui.visible = true;
  10471. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10472. xGame.common.d2World.getHelpLine();
  10473. this.callback && this.callback(this.extraScore);
  10474. }
  10475. }
  10476. }));
  10477. }
  10478. }
  10479. runHighSpace() {
  10480. let rootBall = xGame.common.d2World.rootBall;
  10481. rootBall.showSelf();
  10482. let d3Src = rootBall.d3BallSrc;
  10483. let allArr = this.getAllBallArr();
  10484. if (allArr.length <= 0) {
  10485. this.callback && this.callback(0);
  10486. return;
  10487. }
  10488. let selectBall = xGame.common.d2World.targetBall;
  10489. let wrong = selectBall && selectBall.destroyed;
  10490. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10491. selectBall = xGame.common.getRandArrEle(allArr);
  10492. }
  10493. let targetD3Src = selectBall.d3BallSrc;
  10494. xGame.common.d2World.d2Gan.ui.visible = false;
  10495. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10496. d3Src.scaleXYZ = 0.5;
  10497. this.tweenArr.push(d3Src);
  10498. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10499. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10500. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10501. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10502. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10503. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10504. let outArr = [selectBall];
  10505. let other = this.leveNum - 1;
  10506. if (other > 0) {
  10507. let nearArr = this.getOneArr(selectBall);
  10508. if (nearArr.length > 0) {
  10509. xGame.common.botherArr(nearArr);
  10510. if (other >= nearArr.length)
  10511. other = nearArr.length;
  10512. for (let index = 0; index < other; index++) {
  10513. outArr.push(nearArr[index]);
  10514. }
  10515. }
  10516. }
  10517. xGame.common.extraMoveNum = other + 1;
  10518. this.extraScore = other + 1;
  10519. this._rootX = selectBall.gameObj.x;
  10520. this._rootY = selectBall.gameObj.y;
  10521. rootBall.gameObj.x = this._rootX;
  10522. rootBall.gameObj.y = this._rootY;
  10523. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10524. Laya.Tween.clearAll(d3Src);
  10525. this.addRandomForce(outArr);
  10526. }));
  10527. }));
  10528. }
  10529. addRandomForce(outArr) {
  10530. if (outArr.length > 0) {
  10531. xGame.common.d2World.openCheckStill = true;
  10532. this.playedLastSkill = true;
  10533. }
  10534. let temp;
  10535. for (let index = 0; index < outArr.length; index++) {
  10536. let angle = xGame.common.randomNum(0, 360);
  10537. let linearPercent = xGame.common.randomNum(65, 100);
  10538. temp = outArr[index];
  10539. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10540. }
  10541. }
  10542. setLinearSpeed(angle, rigy, linearPercent) {
  10543. let sin = Math.sin(angle * Math.PI / 180);
  10544. let cos = Math.cos(angle * Math.PI / 180);
  10545. let maxSpeed = 4;
  10546. let speed = new Laya.Vector2();
  10547. speed.x = maxSpeed * linearPercent * sin;
  10548. speed.y = -maxSpeed * linearPercent * cos;
  10549. rigy.applyLinearImpulseToCenter(speed);
  10550. }
  10551. runBreakArmy() {
  10552. xGame.common.d2World.d2Gan.ui.visible = false;
  10553. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10554. let gameUI = xGame.common.gameUI.ui;
  10555. gameUI.skillRod.visible = true;
  10556. gameUI.skillRod.rotation = 110;
  10557. let outArr = this.getAllBallArr();
  10558. if (outArr.length <= 0) {
  10559. gameUI.skillRod.visible = false;
  10560. this.callback && this.callback(0);
  10561. return;
  10562. }
  10563. xGame.common.botherArr(outArr);
  10564. if (this.leveNum >= outArr.length)
  10565. this.leveNum = outArr.length;
  10566. let deleteNum = outArr.length - this.leveNum;
  10567. outArr.splice(0, deleteNum);
  10568. this.extraScore = this.leveNum;
  10569. let potX = gameUI.skillRod.x;
  10570. let potY = gameUI.skillRod.y;
  10571. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10572. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10573. let disArr = [];
  10574. for (let index = 0; index < outArr.length; index++) {
  10575. let obj = outArr[index];
  10576. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10577. dis = Math.pow(dis, 0.5);
  10578. disArr.push(dis);
  10579. }
  10580. this.tweenArr.push(gameUI.skillRod);
  10581. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10582. })).update = Laya.Handler.create(this, (e, t, c) => {
  10583. let angle = gameUI.skillRod.rotation;
  10584. let xx;
  10585. let yy;
  10586. let temp;
  10587. for (let index = 0; index < outArr.length; index++) {
  10588. temp = outArr[index];
  10589. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10590. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10591. yy -= 20;
  10592. temp.gameObj.x = xx;
  10593. temp.gameObj.y = yy;
  10594. temp.d3BallSrc.setTransPos(xx, yy);
  10595. }
  10596. if (angle <= 60) {
  10597. Laya.Tween.clearAll(gameUI.skillRod);
  10598. this.ballFlyToBag(outArr, 150);
  10599. gameUI.skillRod.visible = false;
  10600. }
  10601. }, null, false);
  10602. }
  10603. runIce() {
  10604. let ballArr = xGame.common.d2World.ballArr;
  10605. this.leveNum *= 2;
  10606. if (this.leveNum >= ballArr.length - 1)
  10607. this.leveNum = ballArr.length - 1;
  10608. let tempArr = [];
  10609. let outArr = [];
  10610. for (let index = 0; index < ballArr.length; index++) {
  10611. if (ballArr[index] instanceof D2RootBallSrc)
  10612. continue;
  10613. tempArr.push(ballArr[index]);
  10614. }
  10615. if (tempArr.length <= 0) {
  10616. this.callback && this.callback(0);
  10617. return;
  10618. }
  10619. xGame.common.botherArr(tempArr);
  10620. for (let index = 0; index < this.leveNum; index++) {
  10621. outArr.push(tempArr[index]);
  10622. }
  10623. this.extraScore = this.leveNum;
  10624. let temp;
  10625. for (let index = 0; index < outArr.length; index++) {
  10626. temp = outArr[index];
  10627. temp.d3BallSrc.playIceEft();
  10628. }
  10629. Laya.timer.once(2000, this, () => {
  10630. for (let index = 0; index < outArr.length; index++) {
  10631. temp = outArr[index];
  10632. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10633. temp.setBallFunc("ice", str);
  10634. }
  10635. this.callback && this.callback(0);
  10636. });
  10637. }
  10638. runFireworks() {
  10639. let allArr = this.getAllBallArr();
  10640. if (allArr.length <= 0) {
  10641. this.callback && this.callback(0);
  10642. return;
  10643. }
  10644. xGame.common.d2World.d2Gan.ui.visible = false;
  10645. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10646. let outArr = [];
  10647. let other = this.leveNum;
  10648. if (other > 0) {
  10649. if (allArr.length > 0) {
  10650. xGame.common.botherArr(allArr);
  10651. if (other >= allArr.length)
  10652. other = allArr.length;
  10653. for (let index = 0; index < other; index++) {
  10654. outArr.push(allArr[index]);
  10655. }
  10656. }
  10657. }
  10658. xGame.common.extraMoveNum = other;
  10659. this.extraScore = other;
  10660. this.addRandmomFireworks(outArr);
  10661. }
  10662. addRandmomFireworks(outArr) {
  10663. Laya.timer.once(1100, this, () => {
  10664. if (outArr.length > 0) {
  10665. xGame.common.d2World.openCheckStill = true;
  10666. this.playedLastSkill = true;
  10667. }
  10668. });
  10669. xGame.soundMgr.playSound("skill_04_02");
  10670. let temp;
  10671. let delay = -200;
  10672. for (let index = 0; index < outArr.length; index++) {
  10673. temp = outArr[index];
  10674. delay += 200;
  10675. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10676. let angle = xGame.common.randomNum(0, 360);
  10677. angle = this.getFireworksAngle(obj);
  10678. let linearPercent = xGame.common.randomNum(45, 80);
  10679. if (!obj.destroyed)
  10680. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10681. });
  10682. }
  10683. }
  10684. getFireworksAngle(obj) {
  10685. let rootBall = xGame.common.d2World.rootBall;
  10686. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10687. }
  10688. resetGame() {
  10689. Laya.timer.clearAll(this);
  10690. if (this.tweenArr) {
  10691. for (let index = 0; index < this.tweenArr.length; index++) {
  10692. Laya.Tween.clearAll(this.tweenArr[index]);
  10693. }
  10694. }
  10695. this.tweenArr = null;
  10696. }
  10697. runGuanYu() {
  10698. xGame.common.d2World.d2Gan.ui.visible = false;
  10699. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10700. let rootBall = xGame.common.d2World.rootBall;
  10701. if (rootBall.isInHole) {
  10702. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10703. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10704. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10705. rootBall.showSelf();
  10706. }
  10707. this.rtStarX = rootBall.gameObj.x;
  10708. this.rtStarY = rootBall.gameObj.y;
  10709. this.knifeTimes = 0;
  10710. this.playedLastSkill = true;
  10711. rootBall.forceRun = true;
  10712. rootBall.rigy.type = "static";
  10713. xGame.common.d2World.openCheckStill = true;
  10714. this.guanyuRandomKnife();
  10715. }
  10716. guanyuRandomKnife() {
  10717. let rootBall = xGame.common.d2World.rootBall;
  10718. let dir = this.getRandDir();
  10719. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10720. console.log("当前angle", angle);
  10721. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10722. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10723. let dis = 324;
  10724. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10725. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10726. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10727. this.rtStarX = rootBall.gameObj.x;
  10728. this.rtStarY = rootBall.gameObj.y;
  10729. this.knifeTimes++;
  10730. let skillLevel;
  10731. if (xGame.common.gameMgr.selfTurn) {
  10732. skillLevel = DataMgr.getBigSkillByIndex(4);
  10733. }
  10734. else {
  10735. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10736. }
  10737. if (!skillLevel)
  10738. skillLevel = 1;
  10739. skillLevel += 2;
  10740. if (this.knifeTimes < skillLevel) {
  10741. Laya.timer.once(400, this, () => {
  10742. this.guanyuRandomKnife();
  10743. });
  10744. }
  10745. else {
  10746. rootBall.forceRun = false;
  10747. rootBall.rigy.type = "dynamic";
  10748. xGame.common.extraMoveNum = skillLevel;
  10749. }
  10750. }));
  10751. }
  10752. getRandDir() {
  10753. let rootBall = xGame.common.d2World.rootBall;
  10754. let allBall = this.getAllBallArr();
  10755. let target = xGame.common.getRandArrEle(allBall);
  10756. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10757. return this.knifeV2;
  10758. }
  10759. cloneKnife(x, y, rotation) {
  10760. let parent = xGame.common.d3World.knifeRoot;
  10761. let prefab = xGame.common.d3World.knife;
  10762. let clone = prefab.clone();
  10763. parent.addChild(clone);
  10764. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10765. clone.transform.localPositionX = this.knifeV3.x;
  10766. clone.transform.localPositionY = 0;
  10767. clone.transform.localPositionZ = this.knifeV3.z;
  10768. clone.transform.localRotationEulerX = 0;
  10769. clone.transform.localRotationEulerY = rotation;
  10770. clone.transform.localRotationEulerZ = 0;
  10771. clone.active = true;
  10772. return clone;
  10773. }
  10774. cloneGuanYuEft(x, y, angle) {
  10775. return;
  10776. let parent = xGame.common.gameUI.ui.guanyuNode;
  10777. let eft = new ui_guanyuAni();
  10778. eft.parent = parent;
  10779. eft.x = x;
  10780. eft.y = y;
  10781. eft.rotation = angle;
  10782. }
  10783. }
  10784. class ui_UIWordsList extends fgui.GComponent {
  10785. static createInstance() {
  10786. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10787. }
  10788. onConstruct() {
  10789. this.c1 = this.getController("c1");
  10790. this.n74 = (this.getChild("n74"));
  10791. this.clickNode = (this.getChild("clickNode"));
  10792. this.myNode = (this.getChild("myNode"));
  10793. this.n68 = (this.getChild("n68"));
  10794. this.n66 = (this.getChild("n66"));
  10795. this.n55 = (this.getChild("n55"));
  10796. this.wordsBtn = (this.getChild("wordsBtn"));
  10797. this.emotionBtn = (this.getChild("emotionBtn"));
  10798. this.mybggg = (this.getChild("mybggg"));
  10799. this.wordsList = (this.getChild("wordsList"));
  10800. this.emotionList = (this.getChild("emotionList"));
  10801. this.myRoot = (this.getChild("myRoot"));
  10802. }
  10803. }
  10804. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10805. class EmotionDisplay {
  10806. constructor(index, ui) {
  10807. this.ui = ui;
  10808. this.index = index;
  10809. this.ui.onClick(this, this.clickSelf);
  10810. this.updateSelf();
  10811. }
  10812. updateSelf() {
  10813. let data = cfgTable.emotionData[this.index + 1];
  10814. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10815. }
  10816. clickSelf() {
  10817. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10818. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10819. xGame.common.talkMgr.closeTalkView();
  10820. }
  10821. }
  10822. class WordsDisplay {
  10823. constructor(index, ui) {
  10824. this.ui = ui;
  10825. this.index = index;
  10826. this.ui.onClick(this, this.clickSelf);
  10827. this.updateSelf();
  10828. }
  10829. updateSelf() {
  10830. let data = cfgTable.talkwordsData[this.index + 1];
  10831. this.ui.txt.text = data.msg;
  10832. }
  10833. clickSelf() {
  10834. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10835. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10836. xGame.common.talkMgr.closeTalkView();
  10837. }
  10838. }
  10839. class UIWordsList extends UIBase {
  10840. constructor() {
  10841. super();
  10842. }
  10843. onConstructor() {
  10844. this.ui = ui_UIWordsList.createInstance();
  10845. this.contentPane = this.ui;
  10846. this.isEject = false;
  10847. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10848. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10849. this.addUIClick(this.ui.clickNode, this.hide);
  10850. this.initTalkList();
  10851. this.initEmotionList();
  10852. }
  10853. show() {
  10854. super.show();
  10855. }
  10856. initTalkList() {
  10857. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10858. let data = cfgTable.talkwordsData;
  10859. let length = Object.keys(data).length;
  10860. this.ui.wordsList.numItems = length;
  10861. }
  10862. initEmotionList() {
  10863. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10864. let data = cfgTable.emotionData;
  10865. let length = Object.keys(data).length;
  10866. this.ui.emotionList.numItems = length;
  10867. }
  10868. renderTalkItem(index, obj) {
  10869. let temp = new WordsDisplay(index, obj);
  10870. }
  10871. renderEmotionItem(index, obj) {
  10872. let temp = new EmotionDisplay(index, obj);
  10873. }
  10874. openTalkList() {
  10875. this.ui.c1.selectedIndex = 0;
  10876. }
  10877. openEmotionList() {
  10878. this.ui.c1.selectedIndex = 1;
  10879. }
  10880. }
  10881. UIWordsList.uiName = "UIWordsList";
  10882. class TalkMgr {
  10883. constructor() {
  10884. this.aiSpeak = true;
  10885. this.emotionList = [];
  10886. this.talkList = [];
  10887. this.addEvent();
  10888. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10889. this.emotionList = [];
  10890. this.talkList = [];
  10891. for (let k in cfgTable.emotionData) {
  10892. this.emotionList.push(cfgTable.emotionData[k].id);
  10893. }
  10894. for (let k in cfgTable.talkwordsData) {
  10895. this.talkList.push(cfgTable.talkwordsData[k].id);
  10896. }
  10897. }
  10898. addEvent() {
  10899. let ui = xGame.common.gameUI.ui;
  10900. ui.wordsBtn.visible = true;
  10901. ui.wordsBtn.onClick(this, this.openTalkView);
  10902. ui.aiWordsBtn.visible = true;
  10903. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10904. }
  10905. openTalkView() {
  10906. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10907. xGame.uiMgr.Show(UIWordsList);
  10908. }
  10909. closeTalkView() {
  10910. xGame.uiMgr.Hide(UIWordsList);
  10911. }
  10912. clickAIState() {
  10913. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10914. this.aiSpeak = !this.aiSpeak;
  10915. this.changeAIState(this.aiSpeak);
  10916. }
  10917. changeAIState(speak) {
  10918. this.aiSpeak = speak;
  10919. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10920. if (speak) {
  10921. btn.c1.selectedIndex = 0;
  10922. }
  10923. else {
  10924. btn.c1.selectedIndex = 1;
  10925. }
  10926. }
  10927. showSelfTalk(wordsId) {
  10928. let ui = xGame.common.gameUI.ui;
  10929. ui.selfTalk.visible = true;
  10930. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10931. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10932. ui.selfTalk.t0.play();
  10933. }
  10934. showSelfEmotion(emotionId) {
  10935. let ui = xGame.common.gameUI.ui;
  10936. ui.selfTalk.visible = true;
  10937. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10938. this.selfSpine && this.selfSpine.dispose();
  10939. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10940. let spineData = cfgTable.emotionData[emotionId].spine;
  10941. this.selfSpine = new SpineMgr(spineData, () => {
  10942. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10943. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10944. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10945. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10946. });
  10947. ui.selfTalk.t0.play();
  10948. }
  10949. showAITalk(wordsId) {
  10950. if (!this.aiSpeak)
  10951. return;
  10952. if (DataMgr.gameData.gameCount < 2)
  10953. return;
  10954. if (wordsId < 1)
  10955. wordsId = this.getRandTalk();
  10956. let ui = xGame.common.gameUI.ui;
  10957. ui.aiTalk.visible = true;
  10958. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10959. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10960. ui.aiTalk.t0.play();
  10961. }
  10962. getRandTalk() {
  10963. let rand = xGame.tools.random(0, this.talkList.length);
  10964. return this.emotionList[rand];
  10965. }
  10966. getRandEmotion() {
  10967. let rand = xGame.tools.random(0, this.emotionList.length);
  10968. return this.emotionList[rand];
  10969. }
  10970. showAIEmotion(emotionId) {
  10971. if (!this.aiSpeak)
  10972. return;
  10973. if (DataMgr.gameData.gameCount < 2)
  10974. return;
  10975. if (emotionId < 1)
  10976. emotionId = this.getRandEmotion();
  10977. let ui = xGame.common.gameUI.ui;
  10978. ui.aiTalk.visible = true;
  10979. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10980. this.aiSpine && this.aiSpine.dispose();
  10981. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10982. let spineData = cfgTable.emotionData[emotionId].spine;
  10983. this.aiSpine = new SpineMgr(spineData, () => {
  10984. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10985. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10986. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10987. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10988. });
  10989. ui.aiTalk.t0.play();
  10990. }
  10991. resetGame() {
  10992. let ui = xGame.common.gameUI.ui;
  10993. ui.aiTalk.visible = false;
  10994. ui.selfTalk.visible = false;
  10995. this.aiSpine && this.aiSpine.dispose();
  10996. this.selfSpine && this.selfSpine.dispose();
  10997. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10998. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10999. this.closeTalkView();
  11000. }
  11001. }
  11002. class WordsMgr {
  11003. constructor() {
  11004. this.comboTimes = 1;
  11005. this.skillTimes = 0;
  11006. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11007. this.comboSpine = new SpineMgr("yxz_liangan");
  11008. this.skillSpine = new SpineMgr("yiganxqiu");
  11009. this.scoreSpine = new SpineMgr("defen");
  11010. }
  11011. setClassicCombo(isInterrupt) {
  11012. if (isInterrupt) {
  11013. this.comboTimes = 0;
  11014. }
  11015. }
  11016. playClassicWords(type, callback) {
  11017. this.callback = callback;
  11018. let aniIndex = type;
  11019. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11020. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11021. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11022. mySpine.destroy(true);
  11023. this.playClassicTimes();
  11024. });
  11025. }
  11026. playClassicTimes() {
  11027. this.comboTimes++;
  11028. if (this.comboTimes <= 1) {
  11029. this.callback && this.callback();
  11030. }
  11031. else {
  11032. let aniIndex = this.comboTimes - 1;
  11033. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11034. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11035. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11036. mySpine.destroy(true);
  11037. this.callback && this.callback();
  11038. });
  11039. }
  11040. }
  11041. playBigSkillTimes(times, callback) {
  11042. if (times <= 0) {
  11043. callback && callback();
  11044. return;
  11045. }
  11046. this.callback = callback;
  11047. let pre = "sz_0";
  11048. let aniIndex = 0;
  11049. this.getWordsImg(times, pre, () => {
  11050. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11051. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11052. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11053. let r1 = ``;
  11054. let r2 = ``;
  11055. if (times <= 9) {
  11056. r1 = `res/d2Res/${pre}${times}.png`;
  11057. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11058. aniIndex = 0;
  11059. }
  11060. else {
  11061. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11062. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11063. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11064. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11065. aniIndex = 1;
  11066. }
  11067. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11068. mySpine.destroy(true);
  11069. xGame.common.gameMgr.playSkillTips();
  11070. this.playScore(times);
  11071. xGame.common.playRandomMutiBallBigSkillSound();
  11072. }, mySpine);
  11073. });
  11074. }
  11075. playScore(score) {
  11076. let pre = "sz_";
  11077. let aniIndex = 0;
  11078. this.getWordsImg(score, pre, () => {
  11079. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11080. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11081. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11082. let r1 = ``;
  11083. let r2 = ``;
  11084. if (score <= 9) {
  11085. r1 = `res/d2Res/${pre}${score}.png`;
  11086. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11087. aniIndex = 0;
  11088. }
  11089. else {
  11090. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11091. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11092. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11093. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11094. aniIndex = 1;
  11095. }
  11096. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11097. mySpine.destroy(true);
  11098. this.callback && this.callback();
  11099. }, mySpine);
  11100. });
  11101. }
  11102. getWordsImg(number, pre = "", callback) {
  11103. let arr = [];
  11104. if (number <= 9) {
  11105. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11106. }
  11107. else {
  11108. 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 });
  11109. }
  11110. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11111. callback && callback();
  11112. }));
  11113. }
  11114. }
  11115. class ui_UIRodMethod extends fgui.GComponent {
  11116. static createInstance() {
  11117. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11118. }
  11119. onConstruct() {
  11120. this.n24 = (this.getChild("n24"));
  11121. this.white = (this.getChild("white"));
  11122. this.dot = (this.getChild("dot"));
  11123. this.sureBtn = (this.getChild("sureBtn"));
  11124. this.n20 = (this.getChild("n20"));
  11125. this.n21 = (this.getChild("n21"));
  11126. this.n22 = (this.getChild("n22"));
  11127. this.n23 = (this.getChild("n23"));
  11128. this.n5 = (this.getChild("n5"));
  11129. this.n14 = (this.getChild("n14"));
  11130. this.t0 = this.getTransition("t0");
  11131. }
  11132. }
  11133. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11134. class UIRodMethod extends UIBase {
  11135. constructor() {
  11136. super();
  11137. this.isPressd = false;
  11138. }
  11139. onConstructor() {
  11140. this.ui = ui_UIRodMethod.createInstance();
  11141. this.contentPane = this.ui;
  11142. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11143. this.moveDir = new Laya.Vector2();
  11144. this.moveDest = new Laya.Vector2();
  11145. this.centerPos = new Laya.Vector2();
  11146. xGame.common.uiRodMethod = this;
  11147. }
  11148. show() {
  11149. super.show();
  11150. xGame.common.gameMgr.gamePause = true;
  11151. this.openPressDotEvent();
  11152. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11153. this.centerPos.x = this.ui.white.x;
  11154. this.centerPos.y = this.ui.white.y;
  11155. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11156. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11157. this.setDot();
  11158. }
  11159. setDot() {
  11160. this.ui.dot.x = this.moveDest.x;
  11161. this.ui.dot.y = this.moveDest.y;
  11162. }
  11163. closeSelf() {
  11164. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11165. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11166. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11167. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11168. xGame.common.gameMgr.gamePause = false;
  11169. this.hide();
  11170. }
  11171. openPressDotEvent() {
  11172. this.closePressDotEvent();
  11173. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11174. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11175. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11176. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11177. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11178. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11179. }
  11180. closePressDotEvent() {
  11181. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11182. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11183. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11184. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11185. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11186. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11187. }
  11188. onDown(e) {
  11189. if (e.type == Laya.Event.MOUSE_DOWN)
  11190. this.isPressd = true;
  11191. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11192. this.isPressd = false;
  11193. if (!this.isPressd)
  11194. return;
  11195. this.moveDest.x = e.stageX;
  11196. this.moveDest.y = e.stageY;
  11197. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11198. if (dis > 6724) {
  11199. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11200. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11201. }
  11202. this.setDot();
  11203. }
  11204. resetRod() {
  11205. this.ui.dot.x = this.ui.white.x;
  11206. this.ui.dot.y = this.ui.white.y;
  11207. this.gameRod.dot.x = this.gameRod.bg.x;
  11208. this.gameRod.dot.y = this.gameRod.bg.y;
  11209. xGame.common.rodOffest.x = 0;
  11210. xGame.common.rodOffest.y = 0;
  11211. }
  11212. }
  11213. UIRodMethod.uiName = "UIRodMethod";
  11214. class UIGame extends UIBase {
  11215. constructor() {
  11216. super();
  11217. this.powerNum = 0;
  11218. this.isD3Inited = false;
  11219. this.isPrePlay = false;
  11220. this.isMoveRod = false;
  11221. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11222. this.rulerDis = 20;
  11223. this.rulerOffset = 0;
  11224. }
  11225. onConstructor() {
  11226. this.ui = ui_UIGame.createInstance();
  11227. this.contentPane = this.ui;
  11228. this.ui.x += xGame.common.sysOffestNum;
  11229. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11230. this.isEject = false;
  11231. xGame.common.gameUI = this;
  11232. this.initSelf();
  11233. }
  11234. isTurnSelf() {
  11235. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11236. return true;
  11237. }
  11238. }
  11239. initSelf() {
  11240. let topUI = this.ui.topNode;
  11241. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11242. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11243. this.barInfo = {};
  11244. this.barInfo.curY = 0;
  11245. this.barInfo.height = this.ui.powerNode.height;
  11246. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11247. this.barInfo.powerStartY = this.ui.powerNode.y;
  11248. xGame.common.aiPlayer = new AIPlayer();
  11249. xGame.common.gameMgr = new GameMgr();
  11250. xGame.common.skillMgr = new SkillMgr();
  11251. xGame.common.wordsMgr = new WordsMgr();
  11252. xGame.common.talkMgr = new TalkMgr();
  11253. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11254. console.log("加载经典模式表情文件chenggon !");
  11255. });
  11256. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11257. console.log("挑战模式奖励模式spine加载成功!");
  11258. });
  11259. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11260. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11261. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11262. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11263. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11264. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11265. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11266. }
  11267. getGanZiImg() {
  11268. let index = DataMgr.getCurBallRod();
  11269. let data = cfgTable.ballrodData[index + 1];
  11270. let gan_url = xGame.common.getGameIconUrl(data.img);
  11271. console.log('zh:getGanZiImg gan_url==' + gan_url);
  11272. this.ui.powerNode.showImg.url = gan_url;
  11273. console.log('zh:修改杆子图标O K');
  11274. }
  11275. returnHome() {
  11276. let tips = "Are you sure to exit the game?";
  11277. let woman = "Boss, why don't you play for a while longer?";
  11278. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11279. }
  11280. addRodMethodClick() {
  11281. if (this.isTurnSelf()) {
  11282. xGame.uiMgr.Show(UIRodMethod);
  11283. }
  11284. }
  11285. clickHelpLineBtn(force = false) {
  11286. if (!this.isTurnSelf())
  11287. return;
  11288. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11289. if (success) {
  11290. xGame.common.longHelpLine = true;
  11291. xGame.common.d2World.getHelpLine();
  11292. Moyu.sendDataEvent("guideNum");
  11293. }
  11294. else {
  11295. }
  11296. });
  11297. }
  11298. renderSelfDisplayBalls(index, target) {
  11299. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11300. target.myImg.url = xGame.common.getGameIconUrl(str);
  11301. }
  11302. renderAIDisplayBalls(index, target) {
  11303. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11304. target.myImg.url = xGame.common.getGameIconUrl(str);
  11305. ;
  11306. }
  11307. updateMode() {
  11308. if (xGame.common.gameMode == GameMode.classic) {
  11309. this.ui.topNode.scoreNode.visible = false;
  11310. }
  11311. else if (xGame.common.gameMode == GameMode.bigMove) {
  11312. this.ui.topNode.scoreNode.visible = true;
  11313. }
  11314. }
  11315. show() {
  11316. super.show();
  11317. console.log("zh:uigame show AADD");
  11318. this.ui.alpha = 0;
  11319. this.updateSelf();
  11320. xGame.common.gameMgr.gamePause = false;
  11321. xGame.common.gameUI.ui.blackAni.visible = false;
  11322. xGame.common.gameUI.ui.whiteAni.visible = false;
  11323. this.ui.powerEft.visible = false;
  11324. this.ui.colorNode.visible = false;
  11325. this.updateHead();
  11326. let curUse = DataMgr.getCurBallRod();
  11327. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  11328. this.getGanZiImg();
  11329. }
  11330. updateSelf() {
  11331. if (xGame.common.gameMode == GameMode.classic) {
  11332. this.ui.c1.selectedIndex = 0;
  11333. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11334. this.ui.topNode.middleNode.visible = true;
  11335. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11336. }
  11337. else if (xGame.common.gameMode == GameMode.bigMove) {
  11338. this.ui.c1.selectedIndex = 0;
  11339. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11340. this.ui.topNode.middleNode.visible = false;
  11341. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11342. let rand = xGame.common.randomNum(1, max);
  11343. let guide = DataMgr.getSkillGuide();
  11344. if (guide == 0)
  11345. rand = 1;
  11346. xGame.common.bigMoveLevelIndex = rand;
  11347. }
  11348. else if (xGame.common.gameMode == GameMode.placeBall) {
  11349. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11350. this.ui.c1.selectedIndex = 1 + data.type;
  11351. this.ui.alpha = 1;
  11352. this.startGame();
  11353. }
  11354. this.updateMode();
  11355. this.initD3world();
  11356. this.initD2world();
  11357. }
  11358. startGame() {
  11359. this.ui.snowNode.visible = Math.random() <= 0.1;
  11360. this.ui.d2Node.visible = false;
  11361. xGame.common.d3World.d3Hand.gameObj.active = false;
  11362. xGame.common.d3World.tableSrc.init();
  11363. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11364. this.cameraViewChange(() => {
  11365. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11366. switch (xGame.common.gameMode) {
  11367. case GameMode.classic:
  11368. xGame.common.d3World.d3Hand.gameObj.active = true;
  11369. this.playPutBallD3Ani();
  11370. break;
  11371. case GameMode.bigMove:
  11372. this.enterGame();
  11373. Laya.timer.once(500, this, () => {
  11374. this.ui.topNode.middleNode.visible = true;
  11375. this.ui.topNode.middleNode.t0.play();
  11376. });
  11377. break;
  11378. case GameMode.placeBall:
  11379. this.enterGame();
  11380. break;
  11381. default:
  11382. break;
  11383. }
  11384. });
  11385. PlatMgr.showBanner(false);
  11386. }
  11387. enterGame() {
  11388. this.ui.d2Node.visible = true;
  11389. xGame.common.d3World.d3Hand.gameObj.active = false;
  11390. xGame.common.showOneCamera("mainCamera");
  11391. Moyu.recordGame(30, true);
  11392. if (!this.isPrePlay) {
  11393. this.isPrePlay = true;
  11394. xGame.common.d3World.prePlayEft();
  11395. }
  11396. xGame.common.gameMgr.gameReady();
  11397. this.openAllEvent();
  11398. this.ui.snowNode.visible = false;
  11399. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11400. this.ui.helpBtn.visible = condition;
  11401. }
  11402. showHelpLineGuide() {
  11403. let longGuide = DataMgr.getGuideHelpLine();
  11404. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11405. this.ui.helpBtn.visible = true;
  11406. this.ui.guideNode.visible = true;
  11407. }
  11408. }
  11409. setTurnAlpha(alpha) {
  11410. this.ui.keduNode.alpha = alpha;
  11411. this.ui.ganNode.alpha = alpha;
  11412. this.ui.rodMethodNode.alpha = alpha;
  11413. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11414. }
  11415. cameraViewChange(callback) {
  11416. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11417. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11418. xGame.common.showOneCamera("visitAngle");
  11419. cameraSrc.localRotationEulerY = 180;
  11420. cameraSrc.localRotationEulerZ = 0;
  11421. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11422. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11423. callback && callback();
  11424. }));
  11425. }));
  11426. }
  11427. playPutBallD3Ani() {
  11428. xGame.common.showOneCamera("mainCamera");
  11429. let handSrc = xGame.common.d3World.d3Hand;
  11430. handSrc.gameObj.active = true;
  11431. handSrc.transform.localPositionZ = 3;
  11432. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11433. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11434. handSrc.gameObj.active = false;
  11435. this.enterGame();
  11436. }), 400);
  11437. }));
  11438. }
  11439. updateHead() {
  11440. let user = Moyu.getUserInfo();
  11441. this.ui.topNode.selfNameTxt.text = user.nickName;
  11442. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11443. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11444. if (DataMgr.getSkillGuide() < 1) {
  11445. this.ui.topNode.aiNameTxt.text = 'billiards';
  11446. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11447. }
  11448. else {
  11449. this.ui.topNode.aiNameTxt.text = aiData.name;
  11450. let randNo = Math.floor(Math.random() * 10) + 1;
  11451. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11452. }
  11453. }
  11454. initD2world() {
  11455. let node = this.ui.d2Root.displayObject;
  11456. let src = node.getComponent(D2World);
  11457. if (!src) {
  11458. xGame.common.d2World = node.addComponent(D2World);
  11459. }
  11460. xGame.common.d2World.initSelf();
  11461. }
  11462. initD3world() {
  11463. if (this.isD3Inited)
  11464. return;
  11465. this.isD3Inited = true;
  11466. let scene3D = xGame.common.d3Scene;
  11467. this.ui.d3Root.displayObject.addChild(scene3D);
  11468. scene3D.active = true;
  11469. xGame.common.d3World.tableSrc.setBorderPos();
  11470. }
  11471. onRootMove(e) {
  11472. let rootBall = xGame.common.d2World.rootBall;
  11473. this.ui.moveNode.x = e.x;
  11474. this.ui.moveNode.y = e.y;
  11475. rootBall.gameObj.x = e.x;
  11476. rootBall.gameObj.y = e.y;
  11477. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11478. }
  11479. aiRootMove(move) {
  11480. if (move)
  11481. this.hideBallUI();
  11482. else {
  11483. this.showBallUI();
  11484. xGame.common.d2World.getHelpLine();
  11485. }
  11486. }
  11487. aiForce(type, force = 0) {
  11488. this.pressTarget = PressType.powerNode;
  11489. if (type == 1)
  11490. this.onEventUp({ force: true });
  11491. else if (type == 2)
  11492. this.onEventMove({ stageY: force, force: true });
  11493. }
  11494. onEventPress(e) {
  11495. if (e.stopPropagation)
  11496. e.stopPropagation();
  11497. if (!this.isTurnSelf())
  11498. return;
  11499. let target = e.target;
  11500. switch (target) {
  11501. case this.ui.myPowerNode.displayObject:
  11502. this.pressTarget = PressType.powerNode;
  11503. this.barInfo.curY = e.stageY;
  11504. this.updateBarInfo();
  11505. break;
  11506. case this.ui.moveNode.displayObject:
  11507. this.pressTarget = PressType.moveNode;
  11508. this.hideBallUI();
  11509. this.eventObj.curX = this.ui.moveNode.x;
  11510. this.eventObj.curY = this.ui.moveNode.y;
  11511. this.ui.moveNode.finger.visible = false;
  11512. this.eventObj.lastX = e.stageX;
  11513. this.eventObj.lastY = e.stageY;
  11514. break;
  11515. case this.ui.rulerClickNode.displayObject:
  11516. this.pressTarget = PressType.rulerNode;
  11517. this.eventObj.lastY = e.stageY;
  11518. break;
  11519. case this.ui.d2Root.displayObject:
  11520. this.pressTarget = PressType.d2Root;
  11521. this.eventObj.lastX = e.stageX;
  11522. this.eventObj.lastY = e.stageY;
  11523. this.eventObj.starX = e.stageX;
  11524. this.eventObj.starY = e.stageY;
  11525. this.eventObj.curX = 0;
  11526. this.eventObj.curY = 0;
  11527. xGame.common.d2World.d2Gan.setGanLastInfo();
  11528. this.rulerOffset = 0;
  11529. break;
  11530. default:
  11531. break;
  11532. }
  11533. }
  11534. onEventMove(e) {
  11535. if (e.stopPropagation)
  11536. e.stopPropagation();
  11537. if (e && e.force) {
  11538. }
  11539. else {
  11540. if (!this.isTurnSelf())
  11541. return;
  11542. }
  11543. switch (this.pressTarget) {
  11544. case PressType.powerNode:
  11545. this.barInfo.curY = e.stageY;
  11546. this.updateBarInfo();
  11547. this.isMoveRod = true;
  11548. break;
  11549. case PressType.moveNode:
  11550. let rootBall = xGame.common.d2World.rootBall;
  11551. let radius = rootBall.gameObj.width / 2;
  11552. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11553. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11554. let border = xGame.common.d2World.borderRect;
  11555. if (curX <= border.x + radius)
  11556. curX = border.x + radius;
  11557. else if (curX >= border.x + border.width - radius)
  11558. curX = border.x + border.width - radius;
  11559. if (curY <= border.y + radius)
  11560. curY = border.y + radius;
  11561. else if (curY >= border.y + border.height - radius)
  11562. curY = border.y + border.height - radius;
  11563. if (xGame.common.gameMgr.isOpenBall) {
  11564. if (curX >= border.x + border.openBallW - radius)
  11565. curX = border.x + border.openBallW - radius;
  11566. }
  11567. this.ui.moveNode.x = curX;
  11568. this.ui.moveNode.y = curY;
  11569. rootBall.gameObj.x = curX;
  11570. rootBall.gameObj.y = curY;
  11571. rootBall.d3BallSrc.setTransPos(curX, curY);
  11572. this.isMoveRod = true;
  11573. break;
  11574. case PressType.rulerNode:
  11575. let yy = e.stageY - this.eventObj.lastY;
  11576. this.eventObj.lastY = e.stageY;
  11577. let ruler1 = this.ui.rulerNode.img1;
  11578. let ruler2 = this.ui.rulerNode.img2;
  11579. ruler1.y += yy;
  11580. ruler2.y += yy;
  11581. this.rulerOffset += yy;
  11582. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11583. this.rulerOffset = 0;
  11584. xGame.soundMgr.playSound("inch", 1, 10);
  11585. }
  11586. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11587. let h = ruler1.height;
  11588. this.checkGuide();
  11589. this.isMoveRod = true;
  11590. if (ruler1.y >= h) {
  11591. ruler1.y = -h;
  11592. ruler2.y = 0;
  11593. return;
  11594. }
  11595. else if (ruler1.y <= -h) {
  11596. ruler1.y = h;
  11597. ruler2.y = 0;
  11598. return;
  11599. }
  11600. if (ruler2.y >= h) {
  11601. ruler2.y = -h;
  11602. ruler1.y = 0;
  11603. return;
  11604. }
  11605. else if (ruler2.y <= -h) {
  11606. ruler2.y = h;
  11607. ruler1.y = 0;
  11608. return;
  11609. }
  11610. break;
  11611. case PressType.d2Root:
  11612. this.eventObj.curX = e.stageX;
  11613. this.eventObj.curY = e.stageY;
  11614. let offset = this.checkRodMoveDir();
  11615. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11616. this.eventObj.lastX = e.stageX;
  11617. this.eventObj.lastY = e.stageY;
  11618. break;
  11619. default:
  11620. break;
  11621. }
  11622. }
  11623. onEventUp(e) {
  11624. if (e.stopPropagation)
  11625. e.stopPropagation();
  11626. if (e && e.force) {
  11627. }
  11628. else {
  11629. if (!this.isTurnSelf())
  11630. return;
  11631. }
  11632. switch (this.pressTarget) {
  11633. case PressType.powerNode:
  11634. this.ui.powerNode.value = 0;
  11635. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11636. this.ui.powerTxt.text = "";
  11637. if (this.powerNum > 0) {
  11638. xGame.eventMgr.event(BALL_SHOOT);
  11639. xGame.common.d2World.shoot(this.powerNum);
  11640. xGame.common.d2World.d2Gan.shoot();
  11641. xGame.common.d2World.d2HelpLine.shoot();
  11642. this.finishGuide();
  11643. this.ui.powerEft.visible = false;
  11644. this.ui.colorNode.visible = false;
  11645. let ganStr = "";
  11646. if (this.powerNum <= 30) {
  11647. ganStr = "gan_30";
  11648. }
  11649. else if (this.powerNum <= 60) {
  11650. ganStr = "gan_50";
  11651. }
  11652. else {
  11653. ganStr = "gan_80";
  11654. }
  11655. xGame.soundMgr.playSound(ganStr);
  11656. }
  11657. break;
  11658. case PressType.moveNode:
  11659. let rootBall = xGame.common.d2World.rootBall;
  11660. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11661. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11662. let isIntersect = this.judgeBallIntersect();
  11663. if (isIntersect) {
  11664. this.ui.moveNode.x = lastX;
  11665. this.ui.moveNode.y = lastY;
  11666. rootBall.gameObj.x = lastX;
  11667. rootBall.gameObj.y = lastY;
  11668. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11669. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11670. }
  11671. else {
  11672. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11673. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11674. }
  11675. this.showBallUI();
  11676. this.ui.moveNode.finger.visible = true;
  11677. xGame.common.d2World.getHelpLine();
  11678. break;
  11679. case PressType.rulerNode:
  11680. break;
  11681. case PressType.d2Root:
  11682. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11683. if (dis <= 25) {
  11684. this.moveToClickDot(e);
  11685. }
  11686. break;
  11687. default:
  11688. break;
  11689. }
  11690. this.pressTarget = -1;
  11691. }
  11692. checkGuide() {
  11693. let guide = DataMgr.getSkillGuide();
  11694. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11695. xGame.common.guideStep++;
  11696. xGame.common.gameUI.ui.guide2.visible = false;
  11697. xGame.common.gameUI.ui.guide3.visible = true;
  11698. }
  11699. }
  11700. finishGuide() {
  11701. let guide = DataMgr.getSkillGuide();
  11702. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11703. xGame.common.guideStep = 10;
  11704. this.closeAllGuide();
  11705. console.log('zh: 新手引导完毕');
  11706. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11707. }
  11708. }
  11709. closeAllGuide() {
  11710. xGame.common.gameUI.ui.guide1.visible = false;
  11711. xGame.common.gameUI.ui.guide2.visible = false;
  11712. xGame.common.gameUI.ui.guide3.visible = false;
  11713. }
  11714. updateBarInfo() {
  11715. let star = this.ui.powerNode.y;
  11716. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11717. if (rate >= 1)
  11718. rate = 1;
  11719. if (rate <= 0)
  11720. rate = 0;
  11721. this.powerNum = Math.ceil(rate * 100);
  11722. this.ui.powerNode.value = this.powerNum;
  11723. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11724. this.ui.colorNode.value = this.powerNum;
  11725. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11726. this.ui.powerEft.visible = this.powerNum != 0;
  11727. this.ui.colorNode.visible = this.powerNum != 0;
  11728. this.ui.powerTxt.text = this.powerNum + "";
  11729. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11730. }
  11731. forceCancel() {
  11732. this.ui.powerNode.value = 0;
  11733. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11734. this.ui.powerTxt.text = "";
  11735. }
  11736. checkRodMoveDir() {
  11737. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11738. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11739. if (tempX >= 0 && tempY <= 0) {
  11740. return this.checkDir();
  11741. }
  11742. else if (tempX < 0 && tempY < 0) {
  11743. return this.checkDir(1, -1);
  11744. }
  11745. else if (tempX < 0 && tempY > 0) {
  11746. return this.checkDir(-1, -1);
  11747. }
  11748. else {
  11749. return this.checkDir(-1, 1);
  11750. }
  11751. }
  11752. checkDir(flagX = 1, flagY = 1) {
  11753. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11754. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11755. if (offsetY == 0) {
  11756. return offsetX * flagX;
  11757. }
  11758. if (offsetX == 0) {
  11759. return offsetY * flagY;
  11760. }
  11761. let angle = offsetY / offsetX;
  11762. if (Math.abs(angle) >= 1) {
  11763. return offsetY * flagY;
  11764. }
  11765. else {
  11766. return offsetX * flagX;
  11767. }
  11768. }
  11769. judgeBallIntersect() {
  11770. let rootBall = xGame.common.d2World.rootBall;
  11771. let ballArr = xGame.common.d2World.ballArr;
  11772. let radius = rootBall.gameObj.width / 2;
  11773. let temp;
  11774. let isIntersect = false;
  11775. for (let index = 0; index < ballArr.length; index++) {
  11776. temp = ballArr[index];
  11777. if (temp.number == rootBall.number)
  11778. continue;
  11779. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11780. if (isIntersect) {
  11781. break;
  11782. }
  11783. }
  11784. return isIntersect;
  11785. }
  11786. hideBallUI() {
  11787. let d2Gan = xGame.common.d2World.d2Gan;
  11788. if (!d2Gan.ui.isDisposed)
  11789. d2Gan.ui.visible = false;
  11790. let d2Help = xGame.common.d2World.d2HelpLine;
  11791. if (!d2Help.ui.isDisposed)
  11792. d2Help.ui.visible = false;
  11793. let rootBall = xGame.common.d2World.rootBall;
  11794. if (!rootBall.destroyed) {
  11795. rootBall.gameObj.active = false;
  11796. }
  11797. }
  11798. showBallUI() {
  11799. let d2Gan = xGame.common.d2World.d2Gan;
  11800. if (!d2Gan.ui.isDisposed)
  11801. d2Gan.ui.visible = true;
  11802. let d2Help = xGame.common.d2World.d2HelpLine;
  11803. if (!d2Help.ui.isDisposed)
  11804. d2Help.ui.visible = true;
  11805. let rootBall = xGame.common.d2World.rootBall;
  11806. if (!rootBall.destroyed) {
  11807. rootBall.gameObj.active = true;
  11808. }
  11809. }
  11810. moveToClickDot(e) {
  11811. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11812. let root = xGame.common.d2World.rootBall.gameObj;
  11813. let xx = e.stageX - xGame.common.sysOffestNum;
  11814. let yy = e.stageY;
  11815. let x = xx - root.x;
  11816. let y = yy - root.y;
  11817. let angle = xGame.common.getfguiRotation(x, y);
  11818. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11819. xGame.common.d2World.getHelpLine();
  11820. }
  11821. this.isMoveRod = false;
  11822. xGame.common.clickedBall = false;
  11823. }
  11824. openAllEvent() {
  11825. this.closeAllEvent();
  11826. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11827. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11828. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11829. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11830. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11831. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11832. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11833. }
  11834. closeAllEvent() {
  11835. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11836. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11837. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11838. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11839. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11840. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11841. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11842. }
  11843. resetGame() {
  11844. this.closeAllEvent();
  11845. this.hideBallUI();
  11846. xGame.common.gameMgr.gamePause = true;
  11847. }
  11848. }
  11849. UIGame.uiName = "UIGame";
  11850. class UIAddProp extends UIBase {
  11851. constructor() {
  11852. super();
  11853. this.curType = "";
  11854. }
  11855. onConstructor() {
  11856. this.ui = ui_UIAddProp.createInstance();
  11857. this.contentPane = this.ui;
  11858. this.isEject = false;
  11859. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11860. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11861. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11862. this.updateUI();
  11863. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11864. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11865. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11866. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11867. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11868. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11869. }
  11870. show(type) {
  11871. super.show();
  11872. this.curType = type == 0 ? "coin" : "diamond";
  11873. this.switchBtn("");
  11874. this.ui.t0.play();
  11875. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11876. PlatMgr.showInsert(true);
  11877. }
  11878. closeSelf() {
  11879. this.hide();
  11880. }
  11881. updateUI() {
  11882. let data = cfgTable.moneyData;
  11883. let temp;
  11884. let obj;
  11885. for (const key in data) {
  11886. temp = data[key];
  11887. obj = this.ui.myNode["node" + key];
  11888. if (parseInt(key) <= 2) {
  11889. obj.diamondTxt.text = "+" + temp.num;
  11890. }
  11891. else {
  11892. obj.coinTxt.text = temp.num;
  11893. obj.diamondTxt.text = temp.get.split('_')[1];
  11894. }
  11895. }
  11896. this.updateDiamondShare();
  11897. }
  11898. updateDiamondShare() {
  11899. let data = DataMgr.getShareDiamondTimes();
  11900. if (data >= xGame.common.maxShareDiamondTimes) {
  11901. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11902. this.ui.myNode.node1.touchable = false;
  11903. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11904. }
  11905. else {
  11906. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11907. this.ui.myNode.node1.touchable = true;
  11908. }
  11909. }
  11910. switchBtn(type) {
  11911. if (type == "")
  11912. type = this.curType;
  11913. else {
  11914. if (this.curType == type) {
  11915. return;
  11916. }
  11917. else {
  11918. this.curType = type;
  11919. }
  11920. }
  11921. if (type == "coin") {
  11922. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11923. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11924. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11925. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11926. this.ui.myNode.c1.selectedIndex = 0;
  11927. }
  11928. else {
  11929. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11930. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11931. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11932. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11933. this.ui.myNode.c1.selectedIndex = 1;
  11934. }
  11935. }
  11936. convertCoin(index) {
  11937. let data = cfgTable.moneyData[index];
  11938. let coinNum = data.num;
  11939. let str = data.get.split('_')[1];
  11940. let needDiamond = parseInt(str);
  11941. if (DataMgr.diamondEnough(needDiamond)) {
  11942. DataMgr.setDiamond(-needDiamond);
  11943. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11944. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11945. }
  11946. else {
  11947. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11948. this.switchBtn("diamond");
  11949. }
  11950. }
  11951. videoGetDiamond() {
  11952. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11953. if (Laya.Browser.onAndroid) {
  11954. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11955. if (!boo) {
  11956. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11957. return;
  11958. }
  11959. }
  11960. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11961. }
  11962. else {
  11963. console.log('zh:AD 失败,直接发放奖励');
  11964. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11965. }
  11966. }
  11967. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11968. let num = cfgTable.moneyData[2].num;
  11969. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11970. this.closeSelf();
  11971. }
  11972. videoGetCoin() {
  11973. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11974. if (Laya.Browser.onAndroid) {
  11975. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11976. if (!boo) {
  11977. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11978. return;
  11979. }
  11980. }
  11981. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11982. }
  11983. else {
  11984. console.log('zh:AD 失败,直接发放奖励');
  11985. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11986. }
  11987. }
  11988. qjff_AD_for_uiAddProp_videoGetCoin() {
  11989. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11990. this.closeSelf();
  11991. }
  11992. shareGetDiamond() {
  11993. let times = DataMgr.getShareDiamondTimes();
  11994. if (times >= xGame.common.maxShareDiamondTimes) {
  11995. console.log('zh: 233333333333 maxShareDiamondTimes');
  11996. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11997. }
  11998. else {
  11999. console.log('zh:33333333333333ad');
  12000. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  12001. if (Laya.Browser.onAndroid) {
  12002. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12003. if (!boo) {
  12004. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12005. return;
  12006. }
  12007. }
  12008. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12009. }
  12010. else {
  12011. console.log('zh:AD 失败,直接发放奖励');
  12012. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12013. }
  12014. }
  12015. }
  12016. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12017. let diamond = xGame.common.randomNum(50, 100);
  12018. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12019. DataMgr.setShareDiamondTimes(1);
  12020. this.updateDiamondShare();
  12021. }
  12022. openPutBallView() {
  12023. let end = xGame.uiMgr.getUI(UIGameEnd);
  12024. let skill = xGame.uiMgr.getUI(UISkill);
  12025. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12026. let uigame = xGame.uiMgr.getUI(UIGame);
  12027. if (end && !end.isHide) {
  12028. xGame.uiMgr.Hide(UIGameEnd);
  12029. xGame.uiMgr.Show(UIMain);
  12030. }
  12031. if (skill && !skill.isHide)
  12032. xGame.uiMgr.Hide(UISkill);
  12033. if (uigame && !uigame.isHide)
  12034. xGame.uiMgr.Hide(UIGame);
  12035. if (level && !level.isHide) {
  12036. }
  12037. else {
  12038. xGame.uiMgr.Show(UILevelDisplay);
  12039. }
  12040. this.closeSelf();
  12041. }
  12042. }
  12043. UIAddProp.uiName = "UIAddProp";
  12044. class MoneyNode {
  12045. constructor(ui) {
  12046. this.leftTime = 0;
  12047. this.ui = ui;
  12048. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12049. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12050. this.ui.addPowerBtn.onClick(this, this.addPower);
  12051. this.ui.c1.selectedIndex = 1;
  12052. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12053. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12054. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12055. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12056. this.coinChange();
  12057. this.diamondChange();
  12058. this.powerChange();
  12059. }
  12060. addPower() {
  12061. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12062. xGame.uiMgr.Show(UIPower);
  12063. }
  12064. powerChange() {
  12065. let powerNum = DataMgr.getPower();
  12066. this.ui.powerTxt.text = powerNum + "";
  12067. }
  12068. checkPowerTime() {
  12069. let cur = new Date().getTime();
  12070. let last = DataMgr.getPowerTime();
  12071. if (last == 0) {
  12072. last = cur;
  12073. DataMgr.setPowerTime(cur);
  12074. }
  12075. let power = DataMgr.getPower();
  12076. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12077. Laya.timer.clearAll(this);
  12078. if (power >= xGame.common.natureMaxPower) {
  12079. this.ui.powerTimeTxt.text = "";
  12080. DataMgr.setPowerTime(cur);
  12081. return;
  12082. }
  12083. if (power + offset >= xGame.common.natureMaxPower) {
  12084. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12085. this.ui.powerTimeTxt.text = "";
  12086. DataMgr.setPowerTime(cur);
  12087. }
  12088. else {
  12089. if (offset > 0) {
  12090. DataMgr.setPower(offset);
  12091. DataMgr.setPowerTime(cur);
  12092. }
  12093. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12094. this.leftTime = xGame.common.powerRecoverNum - time;
  12095. if (this.leftTime <= 0)
  12096. this.leftTime = 0;
  12097. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12098. Laya.timer.loop(1000, this, this.updatePowerTime);
  12099. }
  12100. }
  12101. updatePowerTime() {
  12102. this.leftTime -= 1;
  12103. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12104. if (this.leftTime <= 0) {
  12105. this.checkPowerTime();
  12106. }
  12107. }
  12108. coinChange() {
  12109. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12110. }
  12111. diamondChange() {
  12112. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12113. }
  12114. addCoin() {
  12115. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12116. Moyu.sendDataEvent("AddCoinBtn");
  12117. xGame.uiMgr.Show(UIAddProp, 0);
  12118. }
  12119. addDiamond() {
  12120. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12121. Moyu.sendDataEvent("AddDiamondBtn");
  12122. xGame.uiMgr.Show(UIAddProp, 1);
  12123. }
  12124. }
  12125. class UIDraw extends UIBase {
  12126. constructor() {
  12127. super();
  12128. this.curKey = 0;
  12129. }
  12130. onConstructor() {
  12131. this.ui = ui_UIDraw.createInstance();
  12132. this.contentPane = this.ui;
  12133. this.isEject = false;
  12134. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12135. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12136. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12137. this.initDraw();
  12138. this.initUI();
  12139. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12140. }
  12141. show() {
  12142. super.show();
  12143. this.ui.t0.play();
  12144. this.playSecretaryIdle();
  12145. this.updateDraw();
  12146. this.checkFree();
  12147. if (PlatMgr.bannerDelay > 0) {
  12148. this.ui.closeNode.closeBtn.visible = false;
  12149. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12150. this.ui.closeNode.closeBtn.visible = true;
  12151. });
  12152. }
  12153. PlatMgr.showRateBanner();
  12154. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12155. }
  12156. hide() {
  12157. Laya.timer.clearAll(this);
  12158. super.hide();
  12159. }
  12160. checkFree() {
  12161. let isFree = DataMgr.getDailyfreeDrawTimes();
  12162. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12163. }
  12164. initDraw() {
  12165. this.drawObj = [];
  12166. let data = cfgTable.drawData;
  12167. let temp;
  12168. let weight = 0;
  12169. for (const key in data) {
  12170. temp = data[key];
  12171. weight += temp.weight;
  12172. this.drawObj.push(weight);
  12173. }
  12174. this.allWeight = weight;
  12175. }
  12176. initUI() {
  12177. let data = cfgTable.drawData;
  12178. let temp;
  12179. let img;
  12180. let txt;
  12181. for (const key in data) {
  12182. temp = data[key];
  12183. img = this.ui.myNode.rotNode["img" + key];
  12184. txt = this.ui.myNode.rotNode["txt" + key];
  12185. img.url = xGame.common.getGameIconUrl(temp.icon);
  12186. txt.visible = true;
  12187. if (temp.award > 2) {
  12188. img.rotation = 0;
  12189. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12190. }
  12191. else {
  12192. img.rotation = temp.rotation;
  12193. txt.text = temp.num;
  12194. }
  12195. }
  12196. }
  12197. getCurkey() {
  12198. let rand = Math.random() * this.allWeight;
  12199. let temp;
  12200. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12201. temp = this.drawObj[index];
  12202. if (index == 0) {
  12203. if (rand < temp) {
  12204. return index + 1;
  12205. }
  12206. }
  12207. else {
  12208. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12209. return index + 1;
  12210. }
  12211. }
  12212. }
  12213. return 2;
  12214. }
  12215. startDraw() {
  12216. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12217. if (freeTimes > 0) {
  12218. this.beginDraw();
  12219. DataMgr.setDailyfreeDrawTimes(0);
  12220. this.checkFree();
  12221. }
  12222. else {
  12223. if (Laya.Browser.onAndroid) {
  12224. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12225. if (!boo) {
  12226. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12227. return;
  12228. }
  12229. }
  12230. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12231. }
  12232. else {
  12233. console.log('zh:AD 失败,直接发放奖励');
  12234. this.qjff_chouJiang();
  12235. }
  12236. }
  12237. }
  12238. qjff_chouJiang() {
  12239. this.beginDraw();
  12240. }
  12241. beginDraw() {
  12242. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12243. this.ui.drawBtn.touchable = false;
  12244. this.curKey = this.getCurkey();
  12245. console.log("当前key", this.curKey);
  12246. let cell = 60;
  12247. let lap = 3;
  12248. let angle = cell * (this.curKey - 1) + lap * 360;
  12249. let target = this.ui.myNode.rotNode;
  12250. target.rotation = 0;
  12251. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12252. console.log("旋转完成");
  12253. this.ui.drawBtn.touchable = true;
  12254. this.getAward();
  12255. }));
  12256. }
  12257. getAward() {
  12258. let data = cfgTable.drawData[this.curKey];
  12259. let temp = new AwardType();
  12260. temp.type = data.award;
  12261. temp.num = data.num;
  12262. xGame.common.getAward([temp], () => {
  12263. DataMgr.setDrawTimes(1);
  12264. this.updateDraw();
  12265. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12266. });
  12267. }
  12268. updateDraw() {
  12269. let drawTimes = DataMgr.getDrawTimes();
  12270. let awardTimes = DataMgr.getDrawAwardTimes();
  12271. if (Math.floor(drawTimes / 3) > awardTimes) {
  12272. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12273. this.ui.extraNode.boxBtn.touchable = true;
  12274. this.ui.extraNode.tipsTxt.text = "3/3";
  12275. this.ui.extraNode.barNode.width = 265;
  12276. this.getExtraAward();
  12277. }
  12278. else {
  12279. this.ui.extraNode.boxBtn.t0.stop();
  12280. this.ui.extraNode.boxBtn.touchable = false;
  12281. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12282. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12283. }
  12284. let data = cfgTable.drawData[1];
  12285. if (awardTimes == 0) {
  12286. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12287. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12288. this.ui.myNode.rotNode.img1.rotation = 0;
  12289. }
  12290. else {
  12291. let award = data.nextid;
  12292. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12293. this.ui.myNode.rotNode.txt1.text = award[1];
  12294. this.ui.myNode.rotNode.img1.rotation = 0;
  12295. }
  12296. }
  12297. getExtraAward() {
  12298. let drawTimes = DataMgr.getDrawTimes();
  12299. let awardTimes = DataMgr.getDrawAwardTimes();
  12300. let data = cfgTable.drawData[1];
  12301. let award = new AwardType();
  12302. if (awardTimes == 0) {
  12303. award.num = data.num;
  12304. award.type = data.award;
  12305. xGame.common.getAward([award], () => {
  12306. let all = Math.floor(drawTimes / 3);
  12307. DataMgr.setDrawAwardTimes(all);
  12308. this.updateDraw();
  12309. });
  12310. }
  12311. else {
  12312. award.num = parseInt(data.nextid[1]);
  12313. award.type = parseInt(data.nextid[0]);
  12314. xGame.common.getAward([award], () => {
  12315. let all = Math.floor(drawTimes / 3);
  12316. DataMgr.setDrawAwardTimes(all);
  12317. this.updateDraw();
  12318. });
  12319. }
  12320. }
  12321. closeSelf() {
  12322. this.hide();
  12323. }
  12324. playSecretaryIdle() {
  12325. let parent = this.ui.secretary.displayObject;
  12326. parent.destroyChildren();
  12327. let xx = this.ui.secretary.width / 2;
  12328. let yy = this.ui.secretary.height;
  12329. let scale = xGame.common.getSecretaryScale();
  12330. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12331. xGame.common.secretary.play(data, 0, true, parent);
  12332. }
  12333. }
  12334. UIDraw.uiName = "UIDraw";
  12335. class ui_UIFlyEft extends fgui.GComponent {
  12336. static createInstance() {
  12337. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12338. }
  12339. onConstruct() {
  12340. this.n0 = (this.getChild("n0"));
  12341. this.n1 = (this.getChild("n1"));
  12342. this.n2 = (this.getChild("n2"));
  12343. this.n3 = (this.getChild("n3"));
  12344. this.n4 = (this.getChild("n4"));
  12345. this.n5 = (this.getChild("n5"));
  12346. this.n6 = (this.getChild("n6"));
  12347. this.n7 = (this.getChild("n7"));
  12348. this.iconNode = (this.getChild("iconNode"));
  12349. this.txt = (this.getChild("txt"));
  12350. this.txtNode = (this.getChild("txtNode"));
  12351. }
  12352. }
  12353. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12354. class UIFlyEft extends UIBase {
  12355. constructor() {
  12356. super();
  12357. this.max = 8;
  12358. this.delay = 0;
  12359. }
  12360. onConstructor() {
  12361. this.ui = ui_UIFlyEft.createInstance();
  12362. this.contentPane = this.ui;
  12363. this.isEject = false;
  12364. this.isMuti = true;
  12365. this.ui.x += xGame.common.sysOffestNum;
  12366. }
  12367. getArrPos() {
  12368. if (this.iconPos && this.iconPos.length > 0)
  12369. return;
  12370. this.iconPos = [];
  12371. let temp;
  12372. for (let index = 0; index < this.max; index++) {
  12373. temp = this.ui["n" + index];
  12374. this.iconPos.push([temp.x, temp.y]);
  12375. }
  12376. }
  12377. show(stPos, edPos, num, type, callback) {
  12378. super.show();
  12379. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12380. this.getArrPos();
  12381. this.updateUI(type);
  12382. this.updatePos();
  12383. this.runFly(edPos, callback);
  12384. this.runWorlds(stPos, num);
  12385. }
  12386. updateUI(type) {
  12387. let temp;
  12388. let str;
  12389. for (let index = 0; index < this.max; index++) {
  12390. temp = this.ui["n" + index];
  12391. str = this.getIconStr(type);
  12392. temp.url = xGame.common.getGameIconUrl(str);
  12393. }
  12394. }
  12395. getIconStr(type) {
  12396. switch (type) {
  12397. case Prop.diamond:
  12398. return "ty_zs";
  12399. case Prop.coin:
  12400. return "ty_jb";
  12401. default:
  12402. break;
  12403. }
  12404. }
  12405. updatePos() {
  12406. let temp;
  12407. for (let index = 0; index < this.max; index++) {
  12408. temp = this.ui["n" + index];
  12409. temp.x = this.iconPos[index][0];
  12410. temp.y = this.iconPos[index][1];
  12411. }
  12412. }
  12413. runFly(endPos, callback) {
  12414. let all = 0;
  12415. let temp;
  12416. for (let index = 0; index < this.max; index++) {
  12417. temp = this.ui["n" + index];
  12418. temp.visible = true;
  12419. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12420. temp.visible = false;
  12421. all++;
  12422. if (all >= this.max) {
  12423. callback && callback();
  12424. }
  12425. }), 20 * index);
  12426. }
  12427. }
  12428. runWorlds(stPos, num) {
  12429. let str = "+" + num;
  12430. this.ui.txt.text = str;
  12431. let starX = stPos.x;
  12432. let starY = stPos.y + 50;
  12433. this.ui.txt.x = starX;
  12434. this.ui.txt.y = starY;
  12435. this.ui.txt.visible = true;
  12436. this.ui.txt.alpha = 1;
  12437. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12438. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12439. this.ui.txt.visible = false;
  12440. this.hide();
  12441. }));
  12442. }));
  12443. }
  12444. }
  12445. UIFlyEft.uiName = "UIFlyEft";
  12446. class Common {
  12447. constructor() {
  12448. this.convertNum = 0.025;
  12449. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12450. this.scaleV3One = new Laya.Vector3();
  12451. this.scaleV3Two = new Laya.Vector3();
  12452. this.posV4 = new Laya.Vector4();
  12453. this.showDebug = false;
  12454. this.openGuide = true;
  12455. this.rodOffest = new Laya.Vector2(0, 0);
  12456. this.rodAngle = 0;
  12457. this.gameMode = GameMode.classic;
  12458. this.bigMoveLevelIndex = 1;
  12459. this.bigMoveNeedCoin = 1000;
  12460. this.classicNiceNeddCoin = 1000;
  12461. this.passAwardCoin = 2000;
  12462. this.classicRoomType = 1;
  12463. this.maxPower = 20;
  12464. this.natureMaxPower = 5;
  12465. this.videoPower = 2;
  12466. this.powerRecoverNum = 900;
  12467. this.curPlayerSkillType = 0;
  12468. this.isNewDay = false;
  12469. this.clickedBall = false;
  12470. this.placeBallCurLevel = 0;
  12471. this.placeBallStarNum = 0;
  12472. this.longHelpLine = false;
  12473. this.maxShareDiamondTimes = 3;
  12474. this.guideStep = 0;
  12475. this.temSelfLevel = 0;
  12476. this.extraMoveNum = 0;
  12477. this.curRankID = 0;
  12478. this.rankID = {
  12479. normalStar: 12000,
  12480. wxStar: 12001
  12481. };
  12482. this.skillNameList = ["Surging Break", "Skyfall Shot", "Frost Lock"];
  12483. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12484. this.btnClickStr = "buttonclick";
  12485. this.maxSkillLevel = 10;
  12486. this.upSkillLevel = false;
  12487. this.gameStartTime = 0;
  12488. this._sysOffestNum = 0;
  12489. this.angleV2 = new Laya.Vector2();
  12490. this.rootV = new Laya.Vector2(0, 1);
  12491. this.tempDir1 = new Laya.Vector2();
  12492. this.tempDir2 = new Laya.Vector2();
  12493. this.ballSize = 33;
  12494. this.stPos = new Laya.Point();
  12495. this.edPos = new Laya.Point();
  12496. Common._instance = this;
  12497. window["common"] = this;
  12498. }
  12499. static getInstance() {
  12500. if (!this._instance) {
  12501. this._instance = new Common();
  12502. }
  12503. return this._instance;
  12504. }
  12505. get sysOffestNum() {
  12506. if (this._sysOffestNum == 0) {
  12507. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12508. }
  12509. return this._sysOffestNum;
  12510. }
  12511. testShader() {
  12512. let test = new LightShader();
  12513. test.texture = "res/d3Res/ballTexture/ball1.png";
  12514. Laya.stage.addChild(test);
  12515. }
  12516. playScale(node) {
  12517. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12518. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12519. }));
  12520. }));
  12521. }
  12522. setGroup(colli, ...group) {
  12523. let out = 0;
  12524. for (let index = 0; index < group.length; index++) {
  12525. if (index == 0) {
  12526. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12527. }
  12528. else {
  12529. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12530. }
  12531. }
  12532. colli.collisionGroup = out;
  12533. }
  12534. setCanGroupWith(colli, ...group) {
  12535. let out = 0;
  12536. for (let index = 0; index < group.length; index++) {
  12537. if (index == 0) {
  12538. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12539. }
  12540. else {
  12541. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12542. }
  12543. }
  12544. colli.canCollideWith = out;
  12545. }
  12546. loadPrefab(name, callback) {
  12547. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12548. let prefab = new Laya.Prefab();
  12549. prefab.json = obj;
  12550. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12551. callback && callback(img);
  12552. }));
  12553. }
  12554. pos2to3Convert(x, y, d3Pos) {
  12555. x = x + this.sysOffestNum;
  12556. d3Pos.setValue(x, y, 0);
  12557. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12558. if (success) {
  12559. }
  12560. else {
  12561. console.error("转换出错了。。。。。。。。");
  12562. }
  12563. }
  12564. scale2to3Convert(num) {
  12565. this.scaleV3One.setValue(0, 0, 0);
  12566. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12567. this.scaleV3Two.setValue(0, num, 0);
  12568. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12569. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12570. return outNum;
  12571. }
  12572. pos3to2Convert(d3Pos) {
  12573. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12574. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12575. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12576. d3Pos.x -= this.sysOffestNum;
  12577. }
  12578. scale3to2Convert(num) {
  12579. let scale = this.scale2to3Convert(1);
  12580. let d2Out = num / scale;
  12581. return d2Out;
  12582. }
  12583. getCollider(type, restitution = 0.9, density = 10) {
  12584. let colli;
  12585. if (type == "box")
  12586. colli = new Laya.BoxCollider();
  12587. else
  12588. colli = new Laya.CircleCollider();
  12589. colli.friction = 0;
  12590. colli.restitution = restitution;
  12591. colli.density = density;
  12592. return colli;
  12593. }
  12594. getRigbody() {
  12595. let rigy = new Laya.RigidBody();
  12596. rigy.bullet = true;
  12597. rigy.allowRotation = false;
  12598. rigy.allowSleep = false;
  12599. rigy.gravityScale = 0;
  12600. return rigy;
  12601. }
  12602. getfguiRotation(x, y) {
  12603. this.angleV2.setValue(x, y);
  12604. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12605. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12606. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12607. angle = -angle;
  12608. }
  12609. return 180 + angle;
  12610. }
  12611. getAngle(x, y) {
  12612. this.angleV2.setValue(x, y);
  12613. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12614. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12615. return angle;
  12616. }
  12617. randomNum(a, b) {
  12618. return a + Math.floor((b - a + 1) * Math.random());
  12619. }
  12620. getRandArrEle(arr) {
  12621. return arr[Math.floor(arr.length * Math.random())];
  12622. }
  12623. getSign(val) {
  12624. return val >= 0 ? 1 : -1;
  12625. }
  12626. botherArr(arr) {
  12627. let times = arr.length + 2;
  12628. let length = arr.length;
  12629. let a;
  12630. let b;
  12631. let temp;
  12632. for (let index = 0; index < times; index++) {
  12633. a = Math.floor(Math.random() * length);
  12634. b = Math.floor(Math.random() * length);
  12635. temp = arr[a];
  12636. arr[a] = arr[b];
  12637. arr[b] = temp;
  12638. }
  12639. }
  12640. getGameIconUrl(id) {
  12641. return "ui://game/" + id;
  12642. }
  12643. getComponentUrl(id) {
  12644. return "ui://game/" + id;
  12645. }
  12646. getAnimation() {
  12647. }
  12648. judgeSkillType(type = SkillType.highSpace) {
  12649. if (this.gameMode == GameMode.classic)
  12650. return;
  12651. let gameMgr = this.gameMgr;
  12652. if (gameMgr.selfTurn) {
  12653. if (gameMgr.selfCurSkill == type) {
  12654. return true;
  12655. }
  12656. }
  12657. else {
  12658. if (gameMgr.aiCurSkill == type) {
  12659. return true;
  12660. }
  12661. }
  12662. }
  12663. ballColliHole(collider) {
  12664. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12665. xGame.common.gameMgr.isFirstInGame = false;
  12666. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12667. }
  12668. collider.owner.mySrc.checkWrongBall();
  12669. }
  12670. getArrMaxEle(arr) {
  12671. let max = -Infinity;
  12672. for (let index = 0; index < arr.length; index++) {
  12673. max = Math.max(arr[index], max);
  12674. }
  12675. return max;
  12676. }
  12677. getArrMinEle(arr) {
  12678. let min = Infinity;
  12679. for (let index = 0; index < arr.length; index++) {
  12680. min = Math.min(arr[index], min);
  12681. }
  12682. return min;
  12683. }
  12684. playRandomMutiBallBigSkillSound() {
  12685. if (Math.random() <= 0.5)
  12686. return;
  12687. let rand = this.randomNum(1, 6);
  12688. let str = "ganfa0" + rand;
  12689. xGame.soundMgr.playSound(str);
  12690. }
  12691. showOneCamera(type) {
  12692. let object = xGame.common.d3World.cameraObj;
  12693. for (const key in object) {
  12694. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12695. object[key].init();
  12696. object[key].owner.active = key == type;
  12697. }
  12698. }
  12699. }
  12700. checkBallOverBorder(x, y) {
  12701. let radius = 17;
  12702. let condition = this._checkBorder(x + radius, y) ||
  12703. this._checkBorder(x - radius, y) ||
  12704. this._checkBorder(x, y + radius) ||
  12705. this._checkBorder(x, y - radius);
  12706. if (condition) {
  12707. return true;
  12708. }
  12709. }
  12710. _checkBorder(x, y) {
  12711. let borderRect = this.d2World.borderRect;
  12712. let xOffest = 20;
  12713. let yOffest = 20;
  12714. if (y <= borderRect.y - yOffest) {
  12715. return true;
  12716. }
  12717. if (y >= borderRect.y + borderRect.height + yOffest) {
  12718. return true;
  12719. }
  12720. if (x <= borderRect.x - xOffest) {
  12721. return true;
  12722. }
  12723. if (x >= borderRect.x + borderRect.width + xOffest) {
  12724. return true;
  12725. }
  12726. }
  12727. initWeight(cfg) {
  12728. let allCfgData = { data: {}, allWeightNum: 0 };
  12729. let weightCfg = allCfgData.data;
  12730. let weight = 0;
  12731. for (const key in cfg) {
  12732. weightCfg[key] = {};
  12733. weightCfg[key].id = cfg[key].id;
  12734. weightCfg[key].minWeight = weight;
  12735. weight += cfg[key].weight;
  12736. weightCfg[key].maxWeight = weight;
  12737. }
  12738. allCfgData.allWeightNum = weight;
  12739. return allCfgData;
  12740. }
  12741. getRandomWeightData(cfg) {
  12742. let weightCfg = cfg.data;
  12743. let allWeightNum = cfg.allWeightNum;
  12744. let rand = Math.floor(Math.random() * allWeightNum);
  12745. for (const key in weightCfg) {
  12746. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12747. return weightCfg[key];
  12748. }
  12749. }
  12750. return weightCfg[1];
  12751. }
  12752. showGirlTalkPop(wordsIndex, node, msgNode) {
  12753. node.visible = true;
  12754. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12755. node.t0.play(Laya.Handler.create(this, () => {
  12756. node.visible = false;
  12757. }));
  12758. }
  12759. stopGirlPop(node) {
  12760. node.t0.stop();
  12761. node.visible = false;
  12762. }
  12763. createHead(loader, url, size = 107) {
  12764. if (Laya.Browser.name == "Browser") {
  12765. loader.url = url;
  12766. return;
  12767. }
  12768. else {
  12769. console.log('zh:url=', url);
  12770. loader.url = url;
  12771. }
  12772. }
  12773. addTestCoin(num) {
  12774. DataMgr.setCoin(num);
  12775. }
  12776. addTestDiamond(num) {
  12777. DataMgr.setDiamond(num);
  12778. }
  12779. addTestSkill() {
  12780. DataMgr.setBigSkill(0, 99);
  12781. DataMgr.setBigSkill(1, 99);
  12782. DataMgr.setBigSkill(2, 99);
  12783. }
  12784. playClassicEmotion(number, x, y) {
  12785. if (this.gameMode == GameMode.bigMove)
  12786. return;
  12787. let randIndex = this.randomNum(0, 2);
  12788. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12789. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12790. if (this.gameMgr.selfTurn) {
  12791. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12792. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12793. }
  12794. else {
  12795. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12796. }
  12797. else {
  12798. if (number == this.gameMgr.blackNum) {
  12799. if (this.gameMgr.selfBallArr.length == 0) {
  12800. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12801. }
  12802. else {
  12803. }
  12804. }
  12805. else {
  12806. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12807. }
  12808. }
  12809. }
  12810. }
  12811. else {
  12812. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12813. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12814. }
  12815. else {
  12816. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12817. }
  12818. else {
  12819. if (number == this.gameMgr.blackNum) {
  12820. if (this.gameMgr.aiBallArr.length == 0) {
  12821. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12822. }
  12823. else {
  12824. }
  12825. }
  12826. else {
  12827. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12828. }
  12829. }
  12830. }
  12831. }
  12832. }
  12833. playHappySound(number) {
  12834. if (this.gameMode != GameMode.classic)
  12835. return;
  12836. if (number == 8)
  12837. return;
  12838. let play = false;
  12839. if (this.gameMgr.selfTurn) {
  12840. if (this.gameMgr.ensureBallType) {
  12841. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12842. play = true;
  12843. }
  12844. }
  12845. else {
  12846. play = true;
  12847. }
  12848. }
  12849. else {
  12850. if (this.gameMgr.ensureBallType) {
  12851. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12852. play = true;
  12853. }
  12854. }
  12855. else {
  12856. play = true;
  12857. }
  12858. }
  12859. if (play)
  12860. xGame.soundMgr.playSound("applause");
  12861. }
  12862. destroyClassicEmotion() {
  12863. if (this.gameMode == GameMode.bigMove)
  12864. return;
  12865. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12866. parent.destroyChildren();
  12867. }
  12868. playAwardSpine(x, y) {
  12869. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12870. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12871. this.awardSpine.play(data, 0, false, parent);
  12872. }
  12873. destroyAwardSpine() {
  12874. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12875. parent.destroyChildren();
  12876. }
  12877. isBlock(bx, by, hx, hy, except = null) {
  12878. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12879. let balls = xGame.common.d2World.ballArr;
  12880. let outArr = [];
  12881. for (let index = 0; index < balls.length; index++) {
  12882. let obj = balls[index];
  12883. if (obj.number == 0)
  12884. continue;
  12885. if (obj == except)
  12886. continue;
  12887. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12888. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12889. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12890. if (num >= 1)
  12891. num = 1;
  12892. if (num < 0)
  12893. continue;
  12894. let gap = Math.sin(Math.acos(num)) * dis;
  12895. if (gap < this.ballSize) {
  12896. outArr.push({
  12897. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12898. disHon: Math.cos(Math.acos(num)) * dis,
  12899. disVer: Math.sin(Math.acos(num)) * dis,
  12900. src: balls[index],
  12901. dir: this.tempDir1
  12902. });
  12903. }
  12904. }
  12905. if (outArr.length > 0) {
  12906. outArr.sort((a, b) => { return a.dis - b.dis; });
  12907. return outArr[0];
  12908. }
  12909. }
  12910. AngleBetween(vector1, vector2) {
  12911. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12912. return rad * (180 / Math.PI);
  12913. }
  12914. getSecretaryScale() {
  12915. if (this.secretary.spineName == "mishu") {
  12916. return 1.28;
  12917. }
  12918. else {
  12919. return 1.024;
  12920. }
  12921. }
  12922. signAwardContainsRod(arr) {
  12923. let temp;
  12924. for (let index = 0; index < arr.length; index++) {
  12925. temp = arr[index].split('-')[0];
  12926. if (parseInt(temp) > 2) {
  12927. return true;
  12928. }
  12929. }
  12930. }
  12931. judgeSameDay() {
  12932. let lastTime = DataMgr.getSignTime();
  12933. let curTime = new Date().getTime();
  12934. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12935. return true;
  12936. }
  12937. return false;
  12938. }
  12939. getAward(arr, callback) {
  12940. let showTriple = arr[0].type <= 2;
  12941. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12942. let temp;
  12943. for (let index = 0; index < arr.length; index++) {
  12944. temp = arr[index];
  12945. switch (temp.type) {
  12946. case 1:
  12947. this.playObjFlyAnim(temp.num, temp.type);
  12948. break;
  12949. case 2:
  12950. this.playObjFlyAnim(temp.num, temp.type);
  12951. break;
  12952. case 3:
  12953. case 4:
  12954. case 5:
  12955. case 6:
  12956. DataMgr.setBallRod(temp.type - 2, 1);
  12957. DataMgr.setCurBallRod(temp.type - 2);
  12958. break;
  12959. default:
  12960. break;
  12961. }
  12962. }
  12963. callback && callback(watchVideo);
  12964. });
  12965. }
  12966. getMoneyNode() {
  12967. let moneyNode;
  12968. let sign = xGame.uiMgr.getUI(UISign);
  12969. let draw = xGame.uiMgr.getUI(UIDraw);
  12970. let end = xGame.uiMgr.getUI(UIGameEnd);
  12971. let skill = xGame.uiMgr.getUI(UISkill);
  12972. if (sign && !sign.isHide)
  12973. moneyNode = sign.ui.moneyNode;
  12974. if (draw && !draw.isHide)
  12975. moneyNode = draw.ui.moneyNode;
  12976. if (end && !end.isHide)
  12977. moneyNode = end.ui.moneyNode;
  12978. if (skill && !skill.isHide)
  12979. moneyNode = skill.ui.moneyNode;
  12980. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12981. let main = xGame.uiMgr.getUI(UIMain);
  12982. if (condition1 && main && !main.isHide) {
  12983. moneyNode = main.ui.moneyNode;
  12984. }
  12985. return moneyNode;
  12986. }
  12987. playObjFlyAnim(num, type, callback = null) {
  12988. this.stPos.x = Laya.stage.width / 2;
  12989. this.stPos.y = Laya.stage.height / 2;
  12990. let moneyNode = this.getMoneyNode();
  12991. switch (type) {
  12992. case Prop.diamond:
  12993. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12994. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12995. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12996. this.edPos.x /= 2;
  12997. this.edPos.y /= 2;
  12998. break;
  12999. case Prop.coin:
  13000. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  13001. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13002. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13003. this.edPos.x /= 2;
  13004. this.edPos.y /= 2;
  13005. break;
  13006. default:
  13007. break;
  13008. }
  13009. xGame.soundMgr.playSound("coinbag");
  13010. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13011. switch (type) {
  13012. case Prop.diamond:
  13013. DataMgr.setDiamond(num);
  13014. break;
  13015. case Prop.coin:
  13016. DataMgr.setCoin(num);
  13017. break;
  13018. default:
  13019. break;
  13020. }
  13021. callback && callback();
  13022. });
  13023. }
  13024. autoPopUIView() {
  13025. let arr = [];
  13026. let sign = this.judgeSameDay() ? false : true;
  13027. if (sign)
  13028. arr.push("sign");
  13029. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13030. if (draw)
  13031. arr.push("draw");
  13032. if (arr.length <= 0)
  13033. return;
  13034. let str = this.getRandArrEle(arr);
  13035. switch (str) {
  13036. case "sign":
  13037. xGame.uiMgr.Show(UISign);
  13038. break;
  13039. case "draw":
  13040. xGame.uiMgr.Show(UIDraw);
  13041. break;
  13042. default:
  13043. break;
  13044. }
  13045. }
  13046. getMSTime(time) {
  13047. let min = Math.floor(time / 60);
  13048. let sec = Math.floor((time - min * 60));
  13049. if (sec < 10)
  13050. sec = "0" + sec;
  13051. if (min < 10)
  13052. min = "0" + min;
  13053. return `${min}:${sec}`;
  13054. }
  13055. testPower() {
  13056. DataMgr.setPower(0, false);
  13057. }
  13058. getAllStarNum() {
  13059. let data = DataMgr.getPlaceBallLevelList();
  13060. let out = 0;
  13061. for (let index = 0; index < data.length; index++) {
  13062. out += data[index].star;
  13063. }
  13064. return out;
  13065. }
  13066. recoverCameraView() {
  13067. Laya.timer.once(900, this, () => {
  13068. xGame.common.showOneCamera("mainCamera");
  13069. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13070. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13071. xGame.common.gameUI.ui.border.alpha = 0;
  13072. if (Laya.physicsTimer.scale < 1) {
  13073. Laya.physicsTimer.scale = 1;
  13074. }
  13075. }
  13076. });
  13077. }
  13078. getClassicLevel() {
  13079. let successTimes = DataMgr.getClassicTimes();
  13080. let needKey = "";
  13081. let lastKey = "";
  13082. let cfg = cfgTable.classictimesData;
  13083. let data;
  13084. for (const key in cfg) {
  13085. data = cfg[key];
  13086. if (successTimes <= data.times) {
  13087. needKey = key;
  13088. }
  13089. lastKey = key;
  13090. }
  13091. if (needKey == "")
  13092. needKey = lastKey;
  13093. return cfg[needKey];
  13094. }
  13095. }
  13096. Common._instance = null;
  13097. class ui_Component92 extends fgui.GComponent {
  13098. static createInstance() {
  13099. return (fgui.UIPackage.createObject("game", "Component92"));
  13100. }
  13101. onConstruct() {
  13102. this.n0 = (this.getChild("n0"));
  13103. }
  13104. }
  13105. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13106. class ui_Component129 extends fgui.GProgressBar {
  13107. static createInstance() {
  13108. return (fgui.UIPackage.createObject("game", "Component129"));
  13109. }
  13110. onConstruct() {
  13111. this.bar_v = (this.getChild("bar_v"));
  13112. this.n84 = (this.getChild("n84"));
  13113. }
  13114. }
  13115. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13116. class ui_Component130 extends fgui.GComponent {
  13117. static createInstance() {
  13118. return (fgui.UIPackage.createObject("game", "Component130"));
  13119. }
  13120. onConstruct() {
  13121. this.ani = (this.getChild("ani"));
  13122. this.t0 = this.getTransition("t0");
  13123. }
  13124. }
  13125. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13126. class ui_powerEft extends fgui.GComponent {
  13127. static createInstance() {
  13128. return (fgui.UIPackage.createObject("game", "powerEft"));
  13129. }
  13130. onConstruct() {
  13131. this.ani = (this.getChild("ani"));
  13132. this.n88 = (this.getChild("n88"));
  13133. this.n89 = (this.getChild("n89"));
  13134. }
  13135. }
  13136. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13137. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13138. static createInstance() {
  13139. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13140. }
  13141. onConstruct() {
  13142. this.c1 = this.getController("c1");
  13143. this.n2 = (this.getChild("n2"));
  13144. this.n22 = (this.getChild("n22"));
  13145. this.n23 = (this.getChild("n23"));
  13146. this.n15 = (this.getChild("n15"));
  13147. this.challenge = (this.getChild("challenge"));
  13148. this.n17 = (this.getChild("n17"));
  13149. this.n3 = (this.getChild("n3"));
  13150. this.starNode = (this.getChild("starNode"));
  13151. this.levelTxt = (this.getChild("levelTxt"));
  13152. this.n14 = (this.getChild("n14"));
  13153. this.n19 = (this.getChild("n19"));
  13154. this.n20 = (this.getChild("n20"));
  13155. this.n21 = (this.getChild("n21"));
  13156. this.special = (this.getChild("special"));
  13157. }
  13158. }
  13159. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13160. class ui_Component79 extends fgui.GComponent {
  13161. static createInstance() {
  13162. return (fgui.UIPackage.createObject("game", "Component79"));
  13163. }
  13164. onConstruct() {
  13165. this.c1 = this.getController("c1");
  13166. this.n7 = (this.getChild("n7"));
  13167. this.n8 = (this.getChild("n8"));
  13168. this.n9 = (this.getChild("n9"));
  13169. this.n10 = (this.getChild("n10"));
  13170. this.n11 = (this.getChild("n11"));
  13171. this.n12 = (this.getChild("n12"));
  13172. }
  13173. }
  13174. ui_Component79.URL = "ui://isxx5ak7avag477";
  13175. class ui_Component80 extends fgui.GComponent {
  13176. static createInstance() {
  13177. return (fgui.UIPackage.createObject("game", "Component80"));
  13178. }
  13179. onConstruct() {
  13180. this.n0 = (this.getChild("n0"));
  13181. this.n1 = (this.getChild("n1"));
  13182. this.myList = (this.getChild("myList"));
  13183. this.t0 = this.getTransition("t0");
  13184. }
  13185. }
  13186. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13187. class ui_SignNormal extends fgui.GComponent {
  13188. static createInstance() {
  13189. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13190. }
  13191. onConstruct() {
  13192. this.c1 = this.getController("c1");
  13193. this.n7 = (this.getChild("n7"));
  13194. this.n15 = (this.getChild("n15"));
  13195. this.titleTxt = (this.getChild("titleTxt"));
  13196. this.n8 = (this.getChild("n8"));
  13197. this.myIcon = (this.getChild("myIcon"));
  13198. this.numTxt = (this.getChild("numTxt"));
  13199. this.n12 = (this.getChild("n12"));
  13200. this.n13 = (this.getChild("n13"));
  13201. this.n17 = (this.getChild("n17"));
  13202. this.n14 = (this.getChild("n14"));
  13203. }
  13204. }
  13205. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13206. class ui_Button_reg extends fgui.GButton {
  13207. static createInstance() {
  13208. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13209. }
  13210. onConstruct() {
  13211. this.button = this.getController("button");
  13212. this.n6 = (this.getChild("n6"));
  13213. this.n4 = (this.getChild("n4"));
  13214. }
  13215. }
  13216. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13217. class ui_screenNode extends fgui.GComponent {
  13218. static createInstance() {
  13219. return (fgui.UIPackage.createObject("game", "screenNode"));
  13220. }
  13221. onConstruct() {
  13222. this.n9 = (this.getChild("n9"));
  13223. this.screenImg = (this.getChild("screenImg"));
  13224. }
  13225. }
  13226. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13227. class ui_GetAwrad_com1 extends fgui.GComponent {
  13228. static createInstance() {
  13229. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13230. }
  13231. onConstruct() {
  13232. this.n38 = (this.getChild("n38"));
  13233. this.n39 = (this.getChild("n39"));
  13234. this.n40 = (this.getChild("n40"));
  13235. this.t0 = this.getTransition("t0");
  13236. this.t1 = this.getTransition("t1");
  13237. }
  13238. }
  13239. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13240. class ui_GetAwrad_com2 extends fgui.GComponent {
  13241. static createInstance() {
  13242. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13243. }
  13244. onConstruct() {
  13245. this.n39 = (this.getChild("n39"));
  13246. this.n40 = (this.getChild("n40"));
  13247. this.t0 = this.getTransition("t0");
  13248. }
  13249. }
  13250. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13251. class ui_Component128 extends fgui.GComponent {
  13252. static createInstance() {
  13253. return (fgui.UIPackage.createObject("game", "Component128"));
  13254. }
  13255. onConstruct() {
  13256. this.n38 = (this.getChild("n38"));
  13257. this.n40 = (this.getChild("n40"));
  13258. }
  13259. }
  13260. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13261. class ui_Component100_1 extends fgui.GComponent {
  13262. static createInstance() {
  13263. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13264. }
  13265. onConstruct() {
  13266. this.myNode = (this.getChild("myNode"));
  13267. this.t0 = this.getTransition("t0");
  13268. }
  13269. }
  13270. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13271. class ui_Component142 extends fgui.GComponent {
  13272. static createInstance() {
  13273. return (fgui.UIPackage.createObject("game", "Component142"));
  13274. }
  13275. onConstruct() {
  13276. this.n41 = (this.getChild("n41"));
  13277. this.n42 = (this.getChild("n42"));
  13278. }
  13279. }
  13280. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13281. class ui_main_guang extends fgui.GComponent {
  13282. static createInstance() {
  13283. return (fgui.UIPackage.createObject("game", "main_guang"));
  13284. }
  13285. onConstruct() {
  13286. this.n1 = (this.getChild("n1"));
  13287. this.n2 = (this.getChild("n2"));
  13288. this.n3 = (this.getChild("n3"));
  13289. this.n4 = (this.getChild("n4"));
  13290. this.n5 = (this.getChild("n5"));
  13291. this.n6 = (this.getChild("n6"));
  13292. this.n8 = (this.getChild("n8"));
  13293. this.t0 = this.getTransition("t0");
  13294. }
  13295. }
  13296. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13297. class ui_try_com1 extends fgui.GComponent {
  13298. static createInstance() {
  13299. return (fgui.UIPackage.createObject("game", "try_com1"));
  13300. }
  13301. onConstruct() {
  13302. this.c1 = this.getController("c1");
  13303. this.n0 = (this.getChild("n0"));
  13304. this.n2 = (this.getChild("n2"));
  13305. this.cancelBtn = (this.getChild("cancelBtn"));
  13306. this.videoBtn = (this.getChild("videoBtn"));
  13307. this.n9 = (this.getChild("n9"));
  13308. this.n24 = (this.getChild("n24"));
  13309. this.titleTxt = (this.getChild("titleTxt"));
  13310. this.n32 = (this.getChild("n32"));
  13311. this.n29 = (this.getChild("n29"));
  13312. this.n36 = (this.getChild("n36"));
  13313. this.txtTime = (this.getChild("txtTime"));
  13314. this.t0 = this.getTransition("t0");
  13315. }
  13316. }
  13317. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13318. class ui_try_com2 extends fgui.GComponent {
  13319. static createInstance() {
  13320. return (fgui.UIPackage.createObject("game", "try_com2"));
  13321. }
  13322. onConstruct() {
  13323. this.skillicon = (this.getChild("skillicon"));
  13324. this.n35 = (this.getChild("n35"));
  13325. this.n31 = (this.getChild("n31"));
  13326. this.n32 = (this.getChild("n32"));
  13327. this.n33 = (this.getChild("n33"));
  13328. this.n34 = (this.getChild("n34"));
  13329. }
  13330. }
  13331. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13332. class ui_try_com3 extends fgui.GComponent {
  13333. static createInstance() {
  13334. return (fgui.UIPackage.createObject("game", "try_com3"));
  13335. }
  13336. onConstruct() {
  13337. this.n33 = (this.getChild("n33"));
  13338. this.n34 = (this.getChild("n34"));
  13339. this.n35 = (this.getChild("n35"));
  13340. this.t0 = this.getTransition("t0");
  13341. }
  13342. }
  13343. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13344. class ui_huihe1 extends fgui.GComponent {
  13345. static createInstance() {
  13346. return (fgui.UIPackage.createObject("game", "huihe1"));
  13347. }
  13348. onConstruct() {
  13349. this.n0 = (this.getChild("n0"));
  13350. this.n1 = (this.getChild("n1"));
  13351. this.t0 = this.getTransition("t0");
  13352. }
  13353. }
  13354. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13355. class ui_huihe2 extends fgui.GComponent {
  13356. static createInstance() {
  13357. return (fgui.UIPackage.createObject("game", "huihe2"));
  13358. }
  13359. onConstruct() {
  13360. this.n0 = (this.getChild("n0"));
  13361. this.n1 = (this.getChild("n1"));
  13362. this.t0 = this.getTransition("t0");
  13363. }
  13364. }
  13365. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13366. class ui_Component143 extends fgui.GComponent {
  13367. static createInstance() {
  13368. return (fgui.UIPackage.createObject("game", "Component143"));
  13369. }
  13370. onConstruct() {
  13371. this.n3 = (this.getChild("n3"));
  13372. this.n4 = (this.getChild("n4"));
  13373. this.n5 = (this.getChild("n5"));
  13374. this.n6 = (this.getChild("n6"));
  13375. this.n7 = (this.getChild("n7"));
  13376. this.n8 = (this.getChild("n8"));
  13377. this.n9 = (this.getChild("n9"));
  13378. this.n10 = (this.getChild("n10"));
  13379. this.t0 = this.getTransition("t0");
  13380. }
  13381. }
  13382. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13383. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13384. static createInstance() {
  13385. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13386. }
  13387. onConstruct() {
  13388. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13389. }
  13390. }
  13391. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13392. class ui_dh_jingbi2 extends fgui.GComponent {
  13393. static createInstance() {
  13394. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13395. }
  13396. onConstruct() {
  13397. this.n0 = (this.getChild("n0"));
  13398. this.n1 = (this.getChild("n1"));
  13399. this.n2 = (this.getChild("n2"));
  13400. this.n3 = (this.getChild("n3"));
  13401. this.n4 = (this.getChild("n4"));
  13402. this.n5 = (this.getChild("n5"));
  13403. this.n6 = (this.getChild("n6"));
  13404. this.n8 = (this.getChild("n8"));
  13405. this.n10 = (this.getChild("n10"));
  13406. this.t0 = this.getTransition("t0");
  13407. }
  13408. }
  13409. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13410. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13411. static createInstance() {
  13412. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13413. }
  13414. onConstruct() {
  13415. this.n1 = (this.getChild("n1"));
  13416. this.n4 = (this.getChild("n4"));
  13417. this.t0 = this.getTransition("t0");
  13418. }
  13419. }
  13420. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13421. class ui_dh_jingbi3 extends fgui.GComponent {
  13422. static createInstance() {
  13423. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13424. }
  13425. onConstruct() {
  13426. this.n0 = (this.getChild("n0"));
  13427. this.n1 = (this.getChild("n1"));
  13428. this.n2 = (this.getChild("n2"));
  13429. this.n3 = (this.getChild("n3"));
  13430. this.n4 = (this.getChild("n4"));
  13431. this.n5 = (this.getChild("n5"));
  13432. this.n6 = (this.getChild("n6"));
  13433. this.n8 = (this.getChild("n8"));
  13434. this.n10 = (this.getChild("n10"));
  13435. this.t0 = this.getTransition("t0");
  13436. }
  13437. }
  13438. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13439. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13440. static createInstance() {
  13441. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13442. }
  13443. onConstruct() {
  13444. this.n3 = (this.getChild("n3"));
  13445. this.n1 = (this.getChild("n1"));
  13446. this.t0 = this.getTransition("t0");
  13447. }
  13448. }
  13449. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13450. class ui_hb_jinbi1 extends fgui.GButton {
  13451. static createInstance() {
  13452. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13453. }
  13454. onConstruct() {
  13455. this.n20 = (this.getChild("n20"));
  13456. this.n25 = (this.getChild("n25"));
  13457. this.coinTxt = (this.getChild("coinTxt"));
  13458. this.n28 = (this.getChild("n28"));
  13459. this.n32 = (this.getChild("n32"));
  13460. this.n38 = (this.getChild("n38"));
  13461. this.n45 = (this.getChild("n45"));
  13462. this.getTips = (this.getChild("getTips"));
  13463. this.n39 = (this.getChild("n39"));
  13464. this.diamondTxt = (this.getChild("diamondTxt"));
  13465. this.n41 = (this.getChild("n41"));
  13466. this.n42 = (this.getChild("n42"));
  13467. this.n46 = (this.getChild("n46"));
  13468. this.n47 = (this.getChild("n47"));
  13469. this.n48 = (this.getChild("n48"));
  13470. this.t0 = this.getTransition("t0");
  13471. }
  13472. }
  13473. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13474. class ui_hb_jinbi2 extends fgui.GButton {
  13475. static createInstance() {
  13476. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13477. }
  13478. onConstruct() {
  13479. this.n20 = (this.getChild("n20"));
  13480. this.n25 = (this.getChild("n25"));
  13481. this.coinTxt = (this.getChild("coinTxt"));
  13482. this.n28 = (this.getChild("n28"));
  13483. this.n32 = (this.getChild("n32"));
  13484. this.n38 = (this.getChild("n38"));
  13485. this.n39 = (this.getChild("n39"));
  13486. this.diamondTxt = (this.getChild("diamondTxt"));
  13487. this.n41 = (this.getChild("n41"));
  13488. this.n42 = (this.getChild("n42"));
  13489. this.n43 = (this.getChild("n43"));
  13490. this.n44 = (this.getChild("n44"));
  13491. this.n45 = (this.getChild("n45"));
  13492. this.t0 = this.getTransition("t0");
  13493. }
  13494. }
  13495. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13496. class ui_hb_jinbi3 extends fgui.GButton {
  13497. static createInstance() {
  13498. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13499. }
  13500. onConstruct() {
  13501. this.n20 = (this.getChild("n20"));
  13502. this.n25 = (this.getChild("n25"));
  13503. this.coinTxt = (this.getChild("coinTxt"));
  13504. this.n28 = (this.getChild("n28"));
  13505. this.n32 = (this.getChild("n32"));
  13506. this.n38 = (this.getChild("n38"));
  13507. this.n39 = (this.getChild("n39"));
  13508. this.diamondTxt = (this.getChild("diamondTxt"));
  13509. this.n41 = (this.getChild("n41"));
  13510. this.n42 = (this.getChild("n42"));
  13511. this.n43 = (this.getChild("n43"));
  13512. this.n44 = (this.getChild("n44"));
  13513. this.n45 = (this.getChild("n45"));
  13514. this.t0 = this.getTransition("t0");
  13515. }
  13516. }
  13517. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13518. class ui_Component104 extends fgui.GComponent {
  13519. static createInstance() {
  13520. return (fgui.UIPackage.createObject("game", "Component104"));
  13521. }
  13522. onConstruct() {
  13523. this.c1 = this.getController("c1");
  13524. this.n12 = (this.getChild("n12"));
  13525. this.coinBtn = (this.getChild("coinBtn"));
  13526. this.diamondBtn = (this.getChild("diamondBtn"));
  13527. this.node3 = (this.getChild("node3"));
  13528. this.node4 = (this.getChild("node4"));
  13529. this.node5 = (this.getChild("node5"));
  13530. this.node1 = (this.getChild("node1"));
  13531. this.node2 = (this.getChild("node2"));
  13532. this.node6 = (this.getChild("node6"));
  13533. this.t0 = this.getTransition("t0");
  13534. }
  13535. }
  13536. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13537. class ui_Component105 extends fgui.GButton {
  13538. static createInstance() {
  13539. return (fgui.UIPackage.createObject("game", "Component105"));
  13540. }
  13541. onConstruct() {
  13542. this.c1 = this.getController("c1");
  13543. this.n49 = (this.getChild("n49"));
  13544. this.n18 = (this.getChild("n18"));
  13545. this.n46 = (this.getChild("n46"));
  13546. this.n48 = (this.getChild("n48"));
  13547. }
  13548. }
  13549. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13550. class ui_Component106 extends fgui.GButton {
  13551. static createInstance() {
  13552. return (fgui.UIPackage.createObject("game", "Component106"));
  13553. }
  13554. onConstruct() {
  13555. this.c1 = this.getController("c1");
  13556. this.n49 = (this.getChild("n49"));
  13557. this.n18 = (this.getChild("n18"));
  13558. this.n46 = (this.getChild("n46"));
  13559. this.n48 = (this.getChild("n48"));
  13560. }
  13561. }
  13562. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13563. class ui_hb_zs1 extends fgui.GButton {
  13564. static createInstance() {
  13565. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13566. }
  13567. onConstruct() {
  13568. this.c1 = this.getController("c1");
  13569. this.n20 = (this.getChild("n20"));
  13570. this.n21 = (this.getChild("n21"));
  13571. this.n26 = (this.getChild("n26"));
  13572. this.n27 = (this.getChild("n27"));
  13573. this.shareTxt = (this.getChild("shareTxt"));
  13574. this.n32 = (this.getChild("n32"));
  13575. this.n38 = (this.getChild("n38"));
  13576. this.n39 = (this.getChild("n39"));
  13577. this.n44 = (this.getChild("n44"));
  13578. this.diamondTxt = (this.getChild("diamondTxt"));
  13579. this.n41 = (this.getChild("n41"));
  13580. this.n45 = (this.getChild("n45"));
  13581. this.n47 = (this.getChild("n47"));
  13582. this.n48 = (this.getChild("n48"));
  13583. this.randTxt = (this.getChild("randTxt"));
  13584. this.n50 = (this.getChild("n50"));
  13585. this.t0 = this.getTransition("t0");
  13586. }
  13587. }
  13588. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13589. class ui_dh_zs1 extends fgui.GComponent {
  13590. static createInstance() {
  13591. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13592. }
  13593. onConstruct() {
  13594. this.n10 = (this.getChild("n10"));
  13595. this.n9 = (this.getChild("n9"));
  13596. this.n1 = (this.getChild("n1"));
  13597. this.n2 = (this.getChild("n2"));
  13598. this.n3 = (this.getChild("n3"));
  13599. this.n4 = (this.getChild("n4"));
  13600. this.n5 = (this.getChild("n5"));
  13601. this.n6 = (this.getChild("n6"));
  13602. this.n8 = (this.getChild("n8"));
  13603. this.n11 = (this.getChild("n11"));
  13604. this.t0 = this.getTransition("t0");
  13605. }
  13606. }
  13607. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13608. class ui_dh_zs1_1 extends fgui.GComponent {
  13609. static createInstance() {
  13610. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13611. }
  13612. onConstruct() {
  13613. this.n3 = (this.getChild("n3"));
  13614. this.n1 = (this.getChild("n1"));
  13615. this.t0 = this.getTransition("t0");
  13616. }
  13617. }
  13618. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13619. class ui_hb_zs2 extends fgui.GButton {
  13620. static createInstance() {
  13621. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13622. }
  13623. onConstruct() {
  13624. this.n20 = (this.getChild("n20"));
  13625. this.n21 = (this.getChild("n21"));
  13626. this.n26 = (this.getChild("n26"));
  13627. this.n27 = (this.getChild("n27"));
  13628. this.n32 = (this.getChild("n32"));
  13629. this.n38 = (this.getChild("n38"));
  13630. this.n39 = (this.getChild("n39"));
  13631. this.n44 = (this.getChild("n44"));
  13632. this.diamondTxt = (this.getChild("diamondTxt"));
  13633. this.n41 = (this.getChild("n41"));
  13634. this.n45 = (this.getChild("n45"));
  13635. this.t0 = this.getTransition("t0");
  13636. }
  13637. }
  13638. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13639. class ui_hb_zs3 extends fgui.GButton {
  13640. static createInstance() {
  13641. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13642. }
  13643. onConstruct() {
  13644. this.n20 = (this.getChild("n20"));
  13645. this.n21 = (this.getChild("n21"));
  13646. this.n26 = (this.getChild("n26"));
  13647. this.n27 = (this.getChild("n27"));
  13648. this.n32 = (this.getChild("n32"));
  13649. this.n38 = (this.getChild("n38"));
  13650. this.n47 = (this.getChild("n47"));
  13651. this.t0 = this.getTransition("t0");
  13652. }
  13653. }
  13654. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13655. class ui_dh_zs2 extends fgui.GComponent {
  13656. static createInstance() {
  13657. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13658. }
  13659. onConstruct() {
  13660. this.n10 = (this.getChild("n10"));
  13661. this.n9 = (this.getChild("n9"));
  13662. this.n1 = (this.getChild("n1"));
  13663. this.n2 = (this.getChild("n2"));
  13664. this.n3 = (this.getChild("n3"));
  13665. this.n4 = (this.getChild("n4"));
  13666. this.n5 = (this.getChild("n5"));
  13667. this.n6 = (this.getChild("n6"));
  13668. this.n8 = (this.getChild("n8"));
  13669. this.n11 = (this.getChild("n11"));
  13670. this.t0 = this.getTransition("t0");
  13671. }
  13672. }
  13673. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13674. class ui_dh_zs2_1 extends fgui.GComponent {
  13675. static createInstance() {
  13676. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13677. }
  13678. onConstruct() {
  13679. this.n3 = (this.getChild("n3"));
  13680. this.n1 = (this.getChild("n1"));
  13681. this.t0 = this.getTransition("t0");
  13682. }
  13683. }
  13684. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13685. class ui_dh_zs3 extends fgui.GComponent {
  13686. static createInstance() {
  13687. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13688. }
  13689. onConstruct() {
  13690. this.n10 = (this.getChild("n10"));
  13691. this.n9 = (this.getChild("n9"));
  13692. this.n1 = (this.getChild("n1"));
  13693. this.n2 = (this.getChild("n2"));
  13694. this.n3 = (this.getChild("n3"));
  13695. this.n4 = (this.getChild("n4"));
  13696. this.n5 = (this.getChild("n5"));
  13697. this.n6 = (this.getChild("n6"));
  13698. this.n8 = (this.getChild("n8"));
  13699. this.n11 = (this.getChild("n11"));
  13700. this.t0 = this.getTransition("t0");
  13701. }
  13702. }
  13703. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13704. class ui_dh_zs3_1 extends fgui.GComponent {
  13705. static createInstance() {
  13706. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13707. }
  13708. onConstruct() {
  13709. this.n3 = (this.getChild("n3"));
  13710. this.n1 = (this.getChild("n1"));
  13711. this.t0 = this.getTransition("t0");
  13712. }
  13713. }
  13714. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13715. class ui_Component107 extends fgui.GComponent {
  13716. static createInstance() {
  13717. return (fgui.UIPackage.createObject("game", "Component107"));
  13718. }
  13719. onConstruct() {
  13720. this.n18 = (this.getChild("n18"));
  13721. this.n19 = (this.getChild("n19"));
  13722. this.n20 = (this.getChild("n20"));
  13723. this.n21 = (this.getChild("n21"));
  13724. this.n22 = (this.getChild("n22"));
  13725. this.levelTxt = (this.getChild("levelTxt"));
  13726. this.t0 = this.getTransition("t0");
  13727. }
  13728. }
  13729. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13730. class ui_box_com1 extends fgui.GComponent {
  13731. static createInstance() {
  13732. return (fgui.UIPackage.createObject("game", "box_com1"));
  13733. }
  13734. onConstruct() {
  13735. this.n14 = (this.getChild("n14"));
  13736. this.n6 = (this.getChild("n6"));
  13737. this.t0 = this.getTransition("t0");
  13738. }
  13739. }
  13740. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13741. class ui_box_com2 extends fgui.GProgressBar {
  13742. static createInstance() {
  13743. return (fgui.UIPackage.createObject("game", "box_com2"));
  13744. }
  13745. onConstruct() {
  13746. this.bg0 = (this.getChild("bg0"));
  13747. this.bg = (this.getChild("bg"));
  13748. this.bar = (this.getChild("bar"));
  13749. this.n7 = (this.getChild("n7"));
  13750. this.n8 = (this.getChild("n8"));
  13751. this.n10 = (this.getChild("n10"));
  13752. this.n11 = (this.getChild("n11"));
  13753. this.n12 = (this.getChild("n12"));
  13754. }
  13755. }
  13756. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13757. class ui_box_com4 extends fgui.GComponent {
  13758. static createInstance() {
  13759. return (fgui.UIPackage.createObject("game", "box_com4"));
  13760. }
  13761. onConstruct() {
  13762. this.n8 = (this.getChild("n8"));
  13763. this.t0 = this.getTransition("t0");
  13764. }
  13765. }
  13766. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13767. class ui_box_com3 extends fgui.GComponent {
  13768. static createInstance() {
  13769. return (fgui.UIPackage.createObject("game", "box_com3"));
  13770. }
  13771. onConstruct() {
  13772. this.n2 = (this.getChild("n2"));
  13773. this.n3 = (this.getChild("n3"));
  13774. this.n4 = (this.getChild("n4"));
  13775. this.n5 = (this.getChild("n5"));
  13776. this.t0 = this.getTransition("t0");
  13777. this.t1 = this.getTransition("t1");
  13778. }
  13779. }
  13780. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13781. class ui_Component97 extends fgui.GComponent {
  13782. static createInstance() {
  13783. return (fgui.UIPackage.createObject("game", "Component97"));
  13784. }
  13785. onConstruct() {
  13786. this.c1 = this.getController("c1");
  13787. this.n46 = (this.getChild("n46"));
  13788. this.diamondNode = (this.getChild("diamondNode"));
  13789. this.coinNode = (this.getChild("coinNode"));
  13790. this.t0 = this.getTransition("t0");
  13791. }
  13792. }
  13793. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13794. class ui_Component98 extends fgui.GButton {
  13795. static createInstance() {
  13796. return (fgui.UIPackage.createObject("game", "Component98"));
  13797. }
  13798. onConstruct() {
  13799. this.n8 = (this.getChild("n8"));
  13800. this.n40 = (this.getChild("n40"));
  13801. }
  13802. }
  13803. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13804. class ui_Component28_11 extends fgui.GButton {
  13805. static createInstance() {
  13806. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13807. }
  13808. onConstruct() {
  13809. this.c1 = this.getController("c1");
  13810. this.n12 = (this.getChild("n12"));
  13811. this.n17 = (this.getChild("n17"));
  13812. this.n13 = (this.getChild("n13"));
  13813. this.diamondTxt = (this.getChild("diamondTxt"));
  13814. this.n15 = (this.getChild("n15"));
  13815. this.n16 = (this.getChild("n16"));
  13816. }
  13817. }
  13818. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13819. class ui_Component58_11 extends fgui.GComponent {
  13820. static createInstance() {
  13821. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13822. }
  13823. onConstruct() {
  13824. this.c1 = this.getController("c1");
  13825. this.n23 = (this.getChild("n23"));
  13826. this.n41 = (this.getChild("n41"));
  13827. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13828. this.n_daoju = (this.getChild("n_daoju"));
  13829. this.myList = (this.getChild("myList"));
  13830. this.djList = (this.getChild("djList"));
  13831. this.t0 = this.getTransition("t0");
  13832. }
  13833. }
  13834. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13835. class ui_Component100 extends fgui.GComponent {
  13836. static createInstance() {
  13837. return (fgui.UIPackage.createObject("game", "Component100"));
  13838. }
  13839. onConstruct() {
  13840. this.c1 = this.getController("c1");
  13841. this.n75 = (this.getChild("n75"));
  13842. this.n76 = (this.getChild("n76"));
  13843. this.n80 = (this.getChild("n80"));
  13844. this.txt = (this.getChild("txt"));
  13845. this.spineRoot = (this.getChild("spineRoot"));
  13846. }
  13847. }
  13848. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13849. class ui_Component101 extends fgui.GComponent {
  13850. static createInstance() {
  13851. return (fgui.UIPackage.createObject("game", "Component101"));
  13852. }
  13853. onConstruct() {
  13854. this.c1 = this.getController("c1");
  13855. this.n36 = (this.getChild("n36"));
  13856. this.n35 = (this.getChild("n35"));
  13857. this.n33 = (this.getChild("n33"));
  13858. this.n34 = (this.getChild("n34"));
  13859. }
  13860. }
  13861. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13862. class ui_Component53 extends fgui.GComponent {
  13863. static createInstance() {
  13864. return (fgui.UIPackage.createObject("game", "Component53"));
  13865. }
  13866. onConstruct() {
  13867. this.n0 = (this.getChild("n0"));
  13868. this.n1 = (this.getChild("n1"));
  13869. this.n2 = (this.getChild("n2"));
  13870. this.n3 = (this.getChild("n3"));
  13871. this.n4 = (this.getChild("n4"));
  13872. this.n5 = (this.getChild("n5"));
  13873. this.n6 = (this.getChild("n6"));
  13874. this.n7 = (this.getChild("n7"));
  13875. this.n8 = (this.getChild("n8"));
  13876. this.n9 = (this.getChild("n9"));
  13877. this.n10 = (this.getChild("n10"));
  13878. this.n11 = (this.getChild("n11"));
  13879. this.n12 = (this.getChild("n12"));
  13880. this.n13 = (this.getChild("n13"));
  13881. this.n14 = (this.getChild("n14"));
  13882. this.n15 = (this.getChild("n15"));
  13883. this.n16 = (this.getChild("n16"));
  13884. this.n19 = (this.getChild("n19"));
  13885. this.n20 = (this.getChild("n20"));
  13886. this.n21 = (this.getChild("n21"));
  13887. this.n22 = (this.getChild("n22"));
  13888. this.n23 = (this.getChild("n23"));
  13889. this.n24 = (this.getChild("n24"));
  13890. this.n25 = (this.getChild("n25"));
  13891. this.n26 = (this.getChild("n26"));
  13892. this.n27 = (this.getChild("n27"));
  13893. this.n28 = (this.getChild("n28"));
  13894. this.n29 = (this.getChild("n29"));
  13895. this.n30 = (this.getChild("n30"));
  13896. this.n31 = (this.getChild("n31"));
  13897. this.n32 = (this.getChild("n32"));
  13898. this.n33 = (this.getChild("n33"));
  13899. this.n34 = (this.getChild("n34"));
  13900. this.n35 = (this.getChild("n35"));
  13901. this.t0 = this.getTransition("t0");
  13902. }
  13903. }
  13904. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13905. class ui_Component58 extends fgui.GComponent {
  13906. static createInstance() {
  13907. return (fgui.UIPackage.createObject("game", "Component58"));
  13908. }
  13909. onConstruct() {
  13910. this.n23 = (this.getChild("n23"));
  13911. this.n41 = (this.getChild("n41"));
  13912. this.n8 = (this.getChild("n8"));
  13913. this.skillList = (this.getChild("skillList"));
  13914. this.t0 = this.getTransition("t0");
  13915. }
  13916. }
  13917. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13918. class ui_Component59 extends fgui.GComponent {
  13919. static createInstance() {
  13920. return (fgui.UIPackage.createObject("game", "Component59"));
  13921. }
  13922. onConstruct() {
  13923. this.n3 = (this.getChild("n3"));
  13924. this.msgTxt = (this.getChild("msgTxt"));
  13925. this.t0 = this.getTransition("t0");
  13926. }
  13927. }
  13928. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13929. class ui_RulerNode extends fgui.GComponent {
  13930. static createInstance() {
  13931. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13932. }
  13933. onConstruct() {
  13934. this.n6 = (this.getChild("n6"));
  13935. this.n4 = (this.getChild("n4"));
  13936. this.img1 = (this.getChild("img1"));
  13937. this.img2 = (this.getChild("img2"));
  13938. }
  13939. }
  13940. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13941. class ui_Component108 extends fgui.GComponent {
  13942. static createInstance() {
  13943. return (fgui.UIPackage.createObject("game", "Component108"));
  13944. }
  13945. onConstruct() {
  13946. this.n19 = (this.getChild("n19"));
  13947. this.t0 = this.getTransition("t0");
  13948. }
  13949. }
  13950. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13951. class ui_Component63 extends fgui.GComponent {
  13952. static createInstance() {
  13953. return (fgui.UIPackage.createObject("game", "Component63"));
  13954. }
  13955. onConstruct() {
  13956. this.n66 = (this.getChild("n66"));
  13957. this.n56 = (this.getChild("n56"));
  13958. this.n63 = (this.getChild("n63"));
  13959. this.n65 = (this.getChild("n65"));
  13960. this.t0 = this.getTransition("t0");
  13961. }
  13962. }
  13963. ui_Component63.URL = "ui://isxx5ak7h657452";
  13964. class ui_topNode extends fgui.GComponent {
  13965. static createInstance() {
  13966. return (fgui.UIPackage.createObject("game", "topNode"));
  13967. }
  13968. onConstruct() {
  13969. this.selfProgress = (this.getChild("selfProgress"));
  13970. this.aiProgress = (this.getChild("aiProgress"));
  13971. this.selfKuang = (this.getChild("selfKuang"));
  13972. this.aiKuang = (this.getChild("aiKuang"));
  13973. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13974. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13975. this.n33 = (this.getChild("n33"));
  13976. this.n34 = (this.getChild("n34"));
  13977. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13978. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13979. this.selfBallList = (this.getChild("selfBallList"));
  13980. this.aiBallList = (this.getChild("aiBallList"));
  13981. this.middleNode = (this.getChild("middleNode"));
  13982. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13983. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13984. this.scoreNode = (this.getChild("scoreNode"));
  13985. this.selfTips = (this.getChild("selfTips"));
  13986. this.aiTips = (this.getChild("aiTips"));
  13987. }
  13988. }
  13989. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13990. class ui_selfProgress extends fgui.GProgressBar {
  13991. static createInstance() {
  13992. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13993. }
  13994. onConstruct() {
  13995. this.n3 = (this.getChild("n3"));
  13996. this.bar = (this.getChild("bar"));
  13997. }
  13998. }
  13999. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14000. class ui_aiProgress extends fgui.GProgressBar {
  14001. static createInstance() {
  14002. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14003. }
  14004. onConstruct() {
  14005. this.n3 = (this.getChild("n3"));
  14006. this.bar = (this.getChild("bar"));
  14007. }
  14008. }
  14009. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14010. class ui_ballDisplay extends fgui.GComponent {
  14011. static createInstance() {
  14012. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14013. }
  14014. onConstruct() {
  14015. this.myImg = (this.getChild("myImg"));
  14016. }
  14017. }
  14018. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14019. class ui_moveNode extends fgui.GComponent {
  14020. static createInstance() {
  14021. return (fgui.UIPackage.createObject("game", "moveNode"));
  14022. }
  14023. onConstruct() {
  14024. this.n8 = (this.getChild("n8"));
  14025. this.finger = (this.getChild("finger"));
  14026. }
  14027. }
  14028. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14029. class ui_cancelBtn extends fgui.GButton {
  14030. static createInstance() {
  14031. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14032. }
  14033. onConstruct() {
  14034. this.c1 = this.getController("c1");
  14035. this.n0 = (this.getChild("n0"));
  14036. this.n1 = (this.getChild("n1"));
  14037. }
  14038. }
  14039. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14040. class ui_shareBtn extends fgui.GButton {
  14041. static createInstance() {
  14042. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14043. }
  14044. onConstruct() {
  14045. this.c1 = this.getController("c1");
  14046. this.n2 = (this.getChild("n2"));
  14047. this.n1 = (this.getChild("n1"));
  14048. this.n3 = (this.getChild("n3"));
  14049. this.n4 = (this.getChild("n4"));
  14050. this.n5 = (this.getChild("n5"));
  14051. this.n6 = (this.getChild("n6"));
  14052. }
  14053. }
  14054. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14055. class ui_share2Btn extends fgui.GButton {
  14056. static createInstance() {
  14057. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14058. }
  14059. onConstruct() {
  14060. this.n3 = (this.getChild("n3"));
  14061. }
  14062. }
  14063. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14064. class ui_rodMethodNode extends fgui.GComponent {
  14065. static createInstance() {
  14066. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14067. }
  14068. onConstruct() {
  14069. this.bg = (this.getChild("bg"));
  14070. this.dot = (this.getChild("dot"));
  14071. }
  14072. }
  14073. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14074. class ui_sureBtn extends fgui.GButton {
  14075. static createInstance() {
  14076. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14077. }
  14078. onConstruct() {
  14079. this.n2 = (this.getChild("n2"));
  14080. this.n1 = (this.getChild("n1"));
  14081. }
  14082. }
  14083. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14084. class ui_Component18 extends fgui.GComponent {
  14085. static createInstance() {
  14086. return (fgui.UIPackage.createObject("game", "Component18"));
  14087. }
  14088. onConstruct() {
  14089. this.c1 = this.getController("c1");
  14090. this.nameTxt = (this.getChild("nameTxt"));
  14091. this.headImg = (this.getChild("headImg"));
  14092. this.n24 = (this.getChild("n24"));
  14093. this.skillImg = (this.getChild("skillImg"));
  14094. this.skillTxt = (this.getChild("skillTxt"));
  14095. }
  14096. }
  14097. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14098. class ui_Component45 extends fgui.GComponent {
  14099. static createInstance() {
  14100. return (fgui.UIPackage.createObject("game", "Component45"));
  14101. }
  14102. onConstruct() {
  14103. this.c1 = this.getController("c1");
  14104. this.n40 = (this.getChild("n40"));
  14105. this.n41 = (this.getChild("n41"));
  14106. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14107. this.n42 = (this.getChild("n42"));
  14108. this.awardTxt = (this.getChild("awardTxt"));
  14109. this.n44 = (this.getChild("n44"));
  14110. this.t0 = this.getTransition("t0");
  14111. }
  14112. }
  14113. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14114. class ui_emotionDisplay extends fgui.GButton {
  14115. static createInstance() {
  14116. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14117. }
  14118. onConstruct() {
  14119. this.myIcon = (this.getChild("myIcon"));
  14120. }
  14121. }
  14122. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14123. class ui_Component49 extends fgui.GButton {
  14124. static createInstance() {
  14125. return (fgui.UIPackage.createObject("game", "Component49"));
  14126. }
  14127. onConstruct() {
  14128. this.n69 = (this.getChild("n69"));
  14129. this.n56 = (this.getChild("n56"));
  14130. }
  14131. }
  14132. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14133. class ui_Component50 extends fgui.GButton {
  14134. static createInstance() {
  14135. return (fgui.UIPackage.createObject("game", "Component50"));
  14136. }
  14137. onConstruct() {
  14138. this.n54 = (this.getChild("n54"));
  14139. this.n65 = (this.getChild("n65"));
  14140. }
  14141. }
  14142. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14143. class ui_Component51 extends fgui.GButton {
  14144. static createInstance() {
  14145. return (fgui.UIPackage.createObject("game", "Component51"));
  14146. }
  14147. onConstruct() {
  14148. this.c1 = this.getController("c1");
  14149. this.n51 = (this.getChild("n51"));
  14150. this.n54 = (this.getChild("n54"));
  14151. }
  14152. }
  14153. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14154. class ui_Button5 extends fgui.GButton {
  14155. static createInstance() {
  14156. return (fgui.UIPackage.createObject("game", "Button5"));
  14157. }
  14158. onConstruct() {
  14159. this.c1 = this.getController("c1");
  14160. this.n0 = (this.getChild("n0"));
  14161. this.n2 = (this.getChild("n2"));
  14162. }
  14163. }
  14164. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14165. class ui_Component124 extends fgui.GComponent {
  14166. static createInstance() {
  14167. return (fgui.UIPackage.createObject("game", "Component124"));
  14168. }
  14169. onConstruct() {
  14170. this.n22 = (this.getChild("n22"));
  14171. this.shareNode = (this.getChild("shareNode"));
  14172. }
  14173. }
  14174. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14175. class ui_Component125 extends fgui.GComponent {
  14176. static createInstance() {
  14177. return (fgui.UIPackage.createObject("game", "Component125"));
  14178. }
  14179. onConstruct() {
  14180. this.n29 = (this.getChild("n29"));
  14181. this.coinTxt = (this.getChild("coinTxt"));
  14182. }
  14183. }
  14184. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14185. class ui_Component52 extends fgui.GButton {
  14186. static createInstance() {
  14187. return (fgui.UIPackage.createObject("game", "Component52"));
  14188. }
  14189. onConstruct() {
  14190. this.n35 = (this.getChild("n35"));
  14191. this.n36 = (this.getChild("n36"));
  14192. }
  14193. }
  14194. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14195. class ui_Component_denglu extends fgui.GComponent {
  14196. static createInstance() {
  14197. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14198. }
  14199. onConstruct() {
  14200. this.n102 = (this.getChild("n102"));
  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. this.t0 = this.getTransition("t0");
  15131. }
  15132. }
  15133. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15134. class ui_dh_zy_wanfa extends fgui.GButton {
  15135. static createInstance() {
  15136. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15137. }
  15138. onConstruct() {
  15139. this.n0 = (this.getChild("n0"));
  15140. }
  15141. }
  15142. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15143. class ui_Button_login extends fgui.GButton {
  15144. static createInstance() {
  15145. return (fgui.UIPackage.createObject("game", "Button_login"));
  15146. }
  15147. onConstruct() {
  15148. this.button = this.getController("button");
  15149. this.n5 = (this.getChild("n5"));
  15150. this.n3 = (this.getChild("n3"));
  15151. }
  15152. }
  15153. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15154. class ui_Component53_1 extends fgui.GComponent {
  15155. static createInstance() {
  15156. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15157. }
  15158. onConstruct() {
  15159. this.n0 = (this.getChild("n0"));
  15160. this.n1 = (this.getChild("n1"));
  15161. this.n2 = (this.getChild("n2"));
  15162. this.n3 = (this.getChild("n3"));
  15163. this.n4 = (this.getChild("n4"));
  15164. this.n5 = (this.getChild("n5"));
  15165. this.n6 = (this.getChild("n6"));
  15166. this.n7 = (this.getChild("n7"));
  15167. this.n8 = (this.getChild("n8"));
  15168. this.n9 = (this.getChild("n9"));
  15169. this.n10 = (this.getChild("n10"));
  15170. this.n11 = (this.getChild("n11"));
  15171. this.n12 = (this.getChild("n12"));
  15172. this.n13 = (this.getChild("n13"));
  15173. this.n14 = (this.getChild("n14"));
  15174. this.n15 = (this.getChild("n15"));
  15175. this.n16 = (this.getChild("n16"));
  15176. this.n19 = (this.getChild("n19"));
  15177. this.n20 = (this.getChild("n20"));
  15178. this.n21 = (this.getChild("n21"));
  15179. this.n22 = (this.getChild("n22"));
  15180. this.n23 = (this.getChild("n23"));
  15181. this.n24 = (this.getChild("n24"));
  15182. this.n25 = (this.getChild("n25"));
  15183. this.n26 = (this.getChild("n26"));
  15184. this.n27 = (this.getChild("n27"));
  15185. this.n28 = (this.getChild("n28"));
  15186. this.n29 = (this.getChild("n29"));
  15187. this.n30 = (this.getChild("n30"));
  15188. this.n31 = (this.getChild("n31"));
  15189. this.n32 = (this.getChild("n32"));
  15190. this.n33 = (this.getChild("n33"));
  15191. this.n34 = (this.getChild("n34"));
  15192. this.n35 = (this.getChild("n35"));
  15193. this.t0 = this.getTransition("t0");
  15194. }
  15195. }
  15196. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15197. class ui_Component30 extends fgui.GComponent {
  15198. static createInstance() {
  15199. return (fgui.UIPackage.createObject("game", "Component30"));
  15200. }
  15201. onConstruct() {
  15202. this.c1 = this.getController("c1");
  15203. this.n46 = (this.getChild("n46"));
  15204. this.n47 = (this.getChild("n47"));
  15205. this.numTxt = (this.getChild("numTxt"));
  15206. this.n50 = (this.getChild("n50"));
  15207. this.n53 = (this.getChild("n53"));
  15208. this.n54 = (this.getChild("n54"));
  15209. this.n55 = (this.getChild("n55"));
  15210. this.n56 = (this.getChild("n56"));
  15211. }
  15212. }
  15213. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15214. class ui_Component30_1 extends fgui.GComponent {
  15215. static createInstance() {
  15216. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15217. }
  15218. onConstruct() {
  15219. this.c1 = this.getController("c1");
  15220. this.n46 = (this.getChild("n46"));
  15221. this.n47 = (this.getChild("n47"));
  15222. this.numTxt = (this.getChild("numTxt"));
  15223. this.n50 = (this.getChild("n50"));
  15224. this.n51 = (this.getChild("n51"));
  15225. this.n52 = (this.getChild("n52"));
  15226. this.n53 = (this.getChild("n53"));
  15227. this.n54 = (this.getChild("n54"));
  15228. }
  15229. }
  15230. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15231. class ui_Component31 extends fgui.GComponent {
  15232. static createInstance() {
  15233. return (fgui.UIPackage.createObject("game", "Component31"));
  15234. }
  15235. onConstruct() {
  15236. this.n55 = (this.getChild("n55"));
  15237. this.n54 = (this.getChild("n54"));
  15238. this.conditionTxt = (this.getChild("conditionTxt"));
  15239. this.n57 = (this.getChild("n57"));
  15240. this.t0 = this.getTransition("t0");
  15241. }
  15242. }
  15243. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15244. class ui_Component32 extends fgui.GComponent {
  15245. static createInstance() {
  15246. return (fgui.UIPackage.createObject("game", "Component32"));
  15247. }
  15248. onConstruct() {
  15249. this.n5 = (this.getChild("n5"));
  15250. this.n6 = (this.getChild("n6"));
  15251. this.n7 = (this.getChild("n7"));
  15252. this.t0 = this.getTransition("t0");
  15253. }
  15254. }
  15255. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15256. class ui_AwardItem extends fgui.GComponent {
  15257. static createInstance() {
  15258. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15259. }
  15260. onConstruct() {
  15261. this.n9 = (this.getChild("n9"));
  15262. this.myIcon = (this.getChild("myIcon"));
  15263. this.numTxt = (this.getChild("numTxt"));
  15264. this.nameTxt = (this.getChild("nameTxt"));
  15265. this.n16 = (this.getChild("n16"));
  15266. this.n17 = (this.getChild("n17"));
  15267. }
  15268. }
  15269. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15270. class ui_ranking_com1 extends fgui.GButton {
  15271. static createInstance() {
  15272. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15273. }
  15274. onConstruct() {
  15275. this.c1 = this.getController("c1");
  15276. this.n49 = (this.getChild("n49"));
  15277. this.n18 = (this.getChild("n18"));
  15278. this.n46 = (this.getChild("n46"));
  15279. this.n48 = (this.getChild("n48"));
  15280. this.n50 = (this.getChild("n50"));
  15281. }
  15282. }
  15283. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15284. class ui_ranking_com2 extends fgui.GButton {
  15285. static createInstance() {
  15286. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15287. }
  15288. onConstruct() {
  15289. this.c1 = this.getController("c1");
  15290. this.n49 = (this.getChild("n49"));
  15291. this.n18 = (this.getChild("n18"));
  15292. this.n46 = (this.getChild("n46"));
  15293. this.n48 = (this.getChild("n48"));
  15294. this.n50 = (this.getChild("n50"));
  15295. }
  15296. }
  15297. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15298. class ui_ranking_com3 extends fgui.GComponent {
  15299. static createInstance() {
  15300. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15301. }
  15302. onConstruct() {
  15303. this.n17 = (this.getChild("n17"));
  15304. this.myIcon = (this.getChild("myIcon"));
  15305. }
  15306. }
  15307. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15308. class ui_ranking_com4 extends fgui.GComponent {
  15309. static createInstance() {
  15310. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15311. }
  15312. onConstruct() {
  15313. this.n16 = (this.getChild("n16"));
  15314. this.head = (this.getChild("head"));
  15315. }
  15316. }
  15317. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15318. class ui_ranking_com5 extends fgui.GComponent {
  15319. static createInstance() {
  15320. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15321. }
  15322. onConstruct() {
  15323. this.c1 = this.getController("c1");
  15324. this.c2 = this.getController("c2");
  15325. this.n2 = (this.getChild("n2"));
  15326. this.n3 = (this.getChild("n3"));
  15327. this.levelBtn = (this.getChild("levelBtn"));
  15328. this.starBtn = (this.getChild("starBtn"));
  15329. this.n23 = (this.getChild("n23"));
  15330. this.n24 = (this.getChild("n24"));
  15331. this.n25 = (this.getChild("n25"));
  15332. this.myList = (this.getChild("myList"));
  15333. this.selfNode = (this.getChild("selfNode"));
  15334. this.n9 = (this.getChild("n9"));
  15335. this.n12 = (this.getChild("n12"));
  15336. this.n13 = (this.getChild("n13"));
  15337. this.n14 = (this.getChild("n14"));
  15338. this.n39 = (this.getChild("n39"));
  15339. this.n41 = (this.getChild("n41"));
  15340. this.n42 = (this.getChild("n42"));
  15341. this.n45 = (this.getChild("n45"));
  15342. this.changeBtn = (this.getChild("changeBtn"));
  15343. this.closeBtn = (this.getChild("closeBtn"));
  15344. this.t0 = this.getTransition("t0");
  15345. }
  15346. }
  15347. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15348. class ui_RankItem extends fgui.GComponent {
  15349. static createInstance() {
  15350. return (fgui.UIPackage.createObject("game", "RankItem"));
  15351. }
  15352. onConstruct() {
  15353. this.n10 = (this.getChild("n10"));
  15354. this.n11 = (this.getChild("n11"));
  15355. this.rankTxt = (this.getChild("rankTxt"));
  15356. this.headNode = (this.getChild("headNode"));
  15357. this.nameTxt = (this.getChild("nameTxt"));
  15358. this.n19 = (this.getChild("n19"));
  15359. this.valueTxt = (this.getChild("valueTxt"));
  15360. this.img1 = (this.getChild("img1"));
  15361. this.img2 = (this.getChild("img2"));
  15362. this.img3 = (this.getChild("img3"));
  15363. }
  15364. }
  15365. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15366. class ui_ranking_com9 extends fgui.GComponent {
  15367. static createInstance() {
  15368. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15369. }
  15370. onConstruct() {
  15371. this.c1 = this.getController("c1");
  15372. this.n27 = (this.getChild("n27"));
  15373. this.n28 = (this.getChild("n28"));
  15374. this.headNode = (this.getChild("headNode"));
  15375. this.rankTxt = (this.getChild("rankTxt"));
  15376. this.nameTxt = (this.getChild("nameTxt"));
  15377. this.n34 = (this.getChild("n34"));
  15378. this.valueTxt = (this.getChild("valueTxt"));
  15379. this.n36 = (this.getChild("n36"));
  15380. this.n37 = (this.getChild("n37"));
  15381. this.n38 = (this.getChild("n38"));
  15382. this.n39 = (this.getChild("n39"));
  15383. this.n40 = (this.getChild("n40"));
  15384. }
  15385. }
  15386. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15387. class ui_ranking_com10 extends fgui.GComponent {
  15388. static createInstance() {
  15389. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15390. }
  15391. onConstruct() {
  15392. this.n23 = (this.getChild("n23"));
  15393. this.n24 = (this.getChild("n24"));
  15394. }
  15395. }
  15396. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15397. class ui_ranking_com11 extends fgui.GComponent {
  15398. static createInstance() {
  15399. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15400. }
  15401. onConstruct() {
  15402. this.n24 = (this.getChild("n24"));
  15403. this.n25 = (this.getChild("n25"));
  15404. this.t0 = this.getTransition("t0");
  15405. }
  15406. }
  15407. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15408. class ui_ranking_com13 extends fgui.GButton {
  15409. static createInstance() {
  15410. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15411. }
  15412. onConstruct() {
  15413. this.c1 = this.getController("c1");
  15414. this.n44 = (this.getChild("n44"));
  15415. this.n45 = (this.getChild("n45"));
  15416. this.n46 = (this.getChild("n46"));
  15417. }
  15418. }
  15419. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15420. class ui_Component_dl_zc extends fgui.GButton {
  15421. static createInstance() {
  15422. return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
  15423. }
  15424. onConstruct() {
  15425. this.c1 = this.getController("c1");
  15426. this.n0 = (this.getChild("n0"));
  15427. }
  15428. }
  15429. ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
  15430. class ui_Component122 extends fgui.GComponent {
  15431. static createInstance() {
  15432. return (fgui.UIPackage.createObject("game", "Component122"));
  15433. }
  15434. onConstruct() {
  15435. this.gameNode3 = (this.getChild("gameNode3"));
  15436. }
  15437. }
  15438. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15439. class ui_skillItem extends fgui.GComponent {
  15440. static createInstance() {
  15441. return (fgui.UIPackage.createObject("game", "skillItem"));
  15442. }
  15443. onConstruct() {
  15444. this.c1 = this.getController("c1");
  15445. this.n31 = (this.getChild("n31"));
  15446. this.n6 = (this.getChild("n6"));
  15447. this.skillImg = (this.getChild("skillImg"));
  15448. this.nameTxt = (this.getChild("nameTxt"));
  15449. this.levelTxt = (this.getChild("levelTxt"));
  15450. this.n28 = (this.getChild("n28"));
  15451. this.describeTxt = (this.getChild("describeTxt"));
  15452. this.n32 = (this.getChild("n32"));
  15453. this.mutiBtn = (this.getChild("mutiBtn"));
  15454. this.tryNode = (this.getChild("tryNode"));
  15455. this.normalBtn = (this.getChild("normalBtn"));
  15456. this.startBtn = (this.getChild("startBtn"));
  15457. this.n42 = (this.getChild("n42"));
  15458. this.n43 = (this.getChild("n43"));
  15459. this.n44 = (this.getChild("n44"));
  15460. }
  15461. }
  15462. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15463. class ui_Component26 extends fgui.GButton {
  15464. static createInstance() {
  15465. return (fgui.UIPackage.createObject("game", "Component26"));
  15466. }
  15467. onConstruct() {
  15468. this.n11 = (this.getChild("n11"));
  15469. this.n30 = (this.getChild("n30"));
  15470. this.n34 = (this.getChild("n34"));
  15471. }
  15472. }
  15473. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15474. class ui_Component28 extends fgui.GButton {
  15475. static createInstance() {
  15476. return (fgui.UIPackage.createObject("game", "Component28"));
  15477. }
  15478. onConstruct() {
  15479. this.n12 = (this.getChild("n12"));
  15480. this.n31 = (this.getChild("n31"));
  15481. this.curTxt = (this.getChild("curTxt"));
  15482. this.n33 = (this.getChild("n33"));
  15483. }
  15484. }
  15485. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15486. class ui_Component1302 extends fgui.GComponent {
  15487. static createInstance() {
  15488. return (fgui.UIPackage.createObject("game", "Component1302"));
  15489. }
  15490. onConstruct() {
  15491. this.n2 = (this.getChild("n2"));
  15492. this.n3 = (this.getChild("n3"));
  15493. }
  15494. }
  15495. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15496. class ui_Component113 extends fgui.GComponent {
  15497. static createInstance() {
  15498. return (fgui.UIPackage.createObject("game", "Component113"));
  15499. }
  15500. onConstruct() {
  15501. this.n85 = (this.getChild("n85"));
  15502. this.n86 = (this.getChild("n86"));
  15503. this.n77 = (this.getChild("n77"));
  15504. this.n79 = (this.getChild("n79"));
  15505. this.n80 = (this.getChild("n80"));
  15506. this.n81 = (this.getChild("n81"));
  15507. this.n82 = (this.getChild("n82"));
  15508. this.n84 = (this.getChild("n84"));
  15509. this.n87 = (this.getChild("n87"));
  15510. this.t0 = this.getTransition("t0");
  15511. }
  15512. }
  15513. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15514. class ui_Component114 extends fgui.GComponent {
  15515. static createInstance() {
  15516. return (fgui.UIPackage.createObject("game", "Component114"));
  15517. }
  15518. onConstruct() {
  15519. this.n77 = (this.getChild("n77"));
  15520. this.t0 = this.getTransition("t0");
  15521. }
  15522. }
  15523. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15524. class ui_Component115 extends fgui.GComponent {
  15525. static createInstance() {
  15526. return (fgui.UIPackage.createObject("game", "Component115"));
  15527. }
  15528. onConstruct() {
  15529. this.n83 = (this.getChild("n83"));
  15530. this.fingerNode = (this.getChild("fingerNode"));
  15531. this.n84 = (this.getChild("n84"));
  15532. }
  15533. }
  15534. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15535. class ui_Component117 extends fgui.GComponent {
  15536. static createInstance() {
  15537. return (fgui.UIPackage.createObject("game", "Component117"));
  15538. }
  15539. onConstruct() {
  15540. this.n87 = (this.getChild("n87"));
  15541. this.n88 = (this.getChild("n88"));
  15542. this.n84 = (this.getChild("n84"));
  15543. this.n85 = (this.getChild("n85"));
  15544. this.n86 = (this.getChild("n86"));
  15545. this.t0 = this.getTransition("t0");
  15546. }
  15547. }
  15548. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15549. class ui_Component98_1 extends fgui.GButton {
  15550. static createInstance() {
  15551. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15552. }
  15553. onConstruct() {
  15554. this.c1 = this.getController("c1");
  15555. this.n8 = (this.getChild("n8"));
  15556. this.n41 = (this.getChild("n41"));
  15557. this.n40 = (this.getChild("n40"));
  15558. }
  15559. }
  15560. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15561. class ui_Component61 extends fgui.GComponent {
  15562. static createInstance() {
  15563. return (fgui.UIPackage.createObject("game", "Component61"));
  15564. }
  15565. onConstruct() {
  15566. this.n14 = (this.getChild("n14"));
  15567. this.n6 = (this.getChild("n6"));
  15568. this.t0 = this.getTransition("t0");
  15569. }
  15570. }
  15571. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15572. class ui_Component62 extends fgui.GComponent {
  15573. static createInstance() {
  15574. return (fgui.UIPackage.createObject("game", "Component62"));
  15575. }
  15576. onConstruct() {
  15577. this.n66 = (this.getChild("n66"));
  15578. this.n56 = (this.getChild("n56"));
  15579. this.n63 = (this.getChild("n63"));
  15580. this.n65 = (this.getChild("n65"));
  15581. this.t0 = this.getTransition("t0");
  15582. }
  15583. }
  15584. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15585. class ui_d3Root extends fgui.GComponent {
  15586. static createInstance() {
  15587. return (fgui.UIPackage.createObject("game", "d3Root"));
  15588. }
  15589. onConstruct() {
  15590. }
  15591. }
  15592. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15593. class ui_d2Root extends fgui.GComponent {
  15594. static createInstance() {
  15595. return (fgui.UIPackage.createObject("game", "d2Root"));
  15596. }
  15597. onConstruct() {
  15598. }
  15599. }
  15600. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15601. class ui_ballNode extends fgui.GComponent {
  15602. static createInstance() {
  15603. return (fgui.UIPackage.createObject("game", "ballNode"));
  15604. }
  15605. onConstruct() {
  15606. }
  15607. }
  15608. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15609. class ui_border extends fgui.GComponent {
  15610. static createInstance() {
  15611. return (fgui.UIPackage.createObject("game", "border"));
  15612. }
  15613. onConstruct() {
  15614. this.bar1 = (this.getChild("bar1"));
  15615. this.bar2 = (this.getChild("bar2"));
  15616. this.bar3 = (this.getChild("bar3"));
  15617. this.bar4 = (this.getChild("bar4"));
  15618. this.bar5 = (this.getChild("bar5"));
  15619. this.bar6 = (this.getChild("bar6"));
  15620. this.circle1 = (this.getChild("circle1"));
  15621. this.circle2 = (this.getChild("circle2"));
  15622. this.circle3 = (this.getChild("circle3"));
  15623. this.circle4 = (this.getChild("circle4"));
  15624. this.circle5 = (this.getChild("circle5"));
  15625. this.circle6 = (this.getChild("circle6"));
  15626. this.n28 = (this.getChild("n28"));
  15627. }
  15628. }
  15629. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15630. class ui_btn_buy extends fgui.GButton {
  15631. static createInstance() {
  15632. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15633. }
  15634. onConstruct() {
  15635. this.button = this.getController("button");
  15636. this.n0 = (this.getChild("n0"));
  15637. this.n1 = (this.getChild("n1"));
  15638. this.n2 = (this.getChild("n2"));
  15639. }
  15640. }
  15641. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15642. class ui_Component41_2 extends fgui.GComponent {
  15643. static createInstance() {
  15644. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15645. }
  15646. onConstruct() {
  15647. this.c1 = this.getController("c1");
  15648. this.n0 = (this.getChild("n0"));
  15649. this.n2 = (this.getChild("n2"));
  15650. this.n19 = (this.getChild("n19"));
  15651. this.cancelBtn = (this.getChild("cancelBtn"));
  15652. this.videoBtn = (this.getChild("videoBtn"));
  15653. this.n9 = (this.getChild("n9"));
  15654. this.n22 = (this.getChild("n22"));
  15655. this.tipsTxt = (this.getChild("tipsTxt"));
  15656. this.n23 = (this.getChild("n23"));
  15657. this.n24 = (this.getChild("n24"));
  15658. this.n26 = (this.getChild("n26"));
  15659. this.n27 = (this.getChild("n27"));
  15660. this.titleTxt = (this.getChild("titleTxt"));
  15661. }
  15662. }
  15663. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15664. class ui_Component41_1 extends fgui.GComponent {
  15665. static createInstance() {
  15666. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15667. }
  15668. onConstruct() {
  15669. this.c1 = this.getController("c1");
  15670. this.n0 = (this.getChild("n0"));
  15671. this.n2 = (this.getChild("n2"));
  15672. this.cancelBtn = (this.getChild("cancelBtn"));
  15673. this.videoBtn = (this.getChild("videoBtn"));
  15674. this.n27 = (this.getChild("n27"));
  15675. this.n30 = (this.getChild("n30"));
  15676. this.n31 = (this.getChild("n31"));
  15677. this.n32 = (this.getChild("n32"));
  15678. this.n33 = (this.getChild("n33"));
  15679. this.n34 = (this.getChild("n34"));
  15680. this.n35 = (this.getChild("n35"));
  15681. this.n36 = (this.getChild("n36"));
  15682. this.n1 = (this.getChild("n1"));
  15683. this.n37 = (this.getChild("n37"));
  15684. this.t0 = this.getTransition("t0");
  15685. this.t1 = this.getTransition("t1");
  15686. this.t2 = this.getTransition("t2");
  15687. this.t3 = this.getTransition("t3");
  15688. }
  15689. }
  15690. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15691. class ui_againBtn extends fgui.GButton {
  15692. static createInstance() {
  15693. return (fgui.UIPackage.createObject("game", "againBtn"));
  15694. }
  15695. onConstruct() {
  15696. this.n2 = (this.getChild("n2"));
  15697. this.n1 = (this.getChild("n1"));
  15698. this.n5 = (this.getChild("n5"));
  15699. }
  15700. }
  15701. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15702. class ui_Component118 extends fgui.GButton {
  15703. static createInstance() {
  15704. return (fgui.UIPackage.createObject("game", "Component118"));
  15705. }
  15706. onConstruct() {
  15707. this.c1 = this.getController("c1");
  15708. this.n14 = (this.getChild("n14"));
  15709. this.n9 = (this.getChild("n9"));
  15710. this.n10 = (this.getChild("n10"));
  15711. this.diamondTxt = (this.getChild("diamondTxt"));
  15712. this.n13 = (this.getChild("n13"));
  15713. this.n15 = (this.getChild("n15"));
  15714. }
  15715. }
  15716. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15717. class ui_Component119 extends fgui.GComponent {
  15718. static createInstance() {
  15719. return (fgui.UIPackage.createObject("game", "Component119"));
  15720. }
  15721. onConstruct() {
  15722. this.n1 = (this.getChild("n1"));
  15723. this.n2 = (this.getChild("n2"));
  15724. this.n13 = (this.getChild("n13"));
  15725. this.n6 = (this.getChild("n6"));
  15726. this.screenNode = (this.getChild("screenNode"));
  15727. this.n15 = (this.getChild("n15"));
  15728. this.closeBtn = (this.getChild("closeBtn"));
  15729. this.share2Btn = (this.getChild("share2Btn"));
  15730. this.shareBtn = (this.getChild("shareBtn"));
  15731. this.tipsNode = (this.getChild("tipsNode"));
  15732. this.awardNode = (this.getChild("awardNode"));
  15733. }
  15734. }
  15735. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15736. class ui_daoJuDisplay extends fgui.GComponent {
  15737. static createInstance() {
  15738. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15739. }
  15740. onConstruct() {
  15741. this.n6 = (this.getChild("n6"));
  15742. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15743. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15744. this.btn_buy = (this.getChild("btn_buy"));
  15745. this.nameTxt = (this.getChild("nameTxt"));
  15746. this.zsImg = (this.getChild("zsImg"));
  15747. }
  15748. }
  15749. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15750. class ui_Component132_1 extends fgui.GComponent {
  15751. static createInstance() {
  15752. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15753. }
  15754. onConstruct() {
  15755. this.n25 = (this.getChild("n25"));
  15756. this.n26 = (this.getChild("n26"));
  15757. this.n27 = (this.getChild("n27"));
  15758. this.t0 = this.getTransition("t0");
  15759. }
  15760. }
  15761. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15762. class ui_SecretaryDisplay extends fgui.GComponent {
  15763. static createInstance() {
  15764. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15765. }
  15766. onConstruct() {
  15767. this.n2 = (this.getChild("n2"));
  15768. this.levelTxt = (this.getChild("levelTxt"));
  15769. this.n4 = (this.getChild("n4"));
  15770. this.secretary = (this.getChild("secretary"));
  15771. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15772. this.n16 = (this.getChild("n16"));
  15773. this.n37 = (this.getChild("n37"));
  15774. this.n41 = (this.getChild("n41"));
  15775. this.n14 = (this.getChild("n14"));
  15776. this.n17 = (this.getChild("n17"));
  15777. this.heightTxt = (this.getChild("heightTxt"));
  15778. this.n46 = (this.getChild("n46"));
  15779. this.n36 = (this.getChild("n36"));
  15780. this.n38 = (this.getChild("n38"));
  15781. this.foodTxt = (this.getChild("foodTxt"));
  15782. this.n47 = (this.getChild("n47"));
  15783. this.n40 = (this.getChild("n40"));
  15784. this.n42 = (this.getChild("n42"));
  15785. this.historyTxt = (this.getChild("historyTxt"));
  15786. this.n48 = (this.getChild("n48"));
  15787. this.nameImg = (this.getChild("nameImg"));
  15788. this.n12 = (this.getChild("n12"));
  15789. this.n49 = (this.getChild("n49"));
  15790. this.t0 = this.getTransition("t0");
  15791. }
  15792. }
  15793. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15794. class ui_BallRodDisplay extends fgui.GComponent {
  15795. static createInstance() {
  15796. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15797. }
  15798. onConstruct() {
  15799. this.c1 = this.getController("c1");
  15800. this.n31 = (this.getChild("n31"));
  15801. this.n6 = (this.getChild("n6"));
  15802. this.nameTxt = (this.getChild("nameTxt"));
  15803. this.rodImg = (this.getChild("rodImg"));
  15804. this.eftRod = (this.getChild("eftRod"));
  15805. this.levelNode = (this.getChild("levelNode"));
  15806. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15807. }
  15808. }
  15809. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15810. class ui_Component111_11 extends fgui.GComponent {
  15811. static createInstance() {
  15812. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15813. }
  15814. onConstruct() {
  15815. this.n68 = (this.getChild("n68"));
  15816. this.n69 = (this.getChild("n69"));
  15817. }
  15818. }
  15819. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15820. class ui_Component112 extends fgui.GComponent {
  15821. static createInstance() {
  15822. return (fgui.UIPackage.createObject("game", "Component112"));
  15823. }
  15824. onConstruct() {
  15825. this.n68 = (this.getChild("n68"));
  15826. this.n70 = (this.getChild("n70"));
  15827. this.myMask = (this.getChild("myMask"));
  15828. }
  15829. }
  15830. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15831. class ui_Component111 extends fgui.GComponent {
  15832. static createInstance() {
  15833. return (fgui.UIPackage.createObject("game", "Component111"));
  15834. }
  15835. onConstruct() {
  15836. this.n68 = (this.getChild("n68"));
  15837. this.myMask = (this.getChild("myMask"));
  15838. }
  15839. }
  15840. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15841. class ui_Component144 extends fgui.GButton {
  15842. static createInstance() {
  15843. return (fgui.UIPackage.createObject("game", "Component144"));
  15844. }
  15845. onConstruct() {
  15846. this.n8 = (this.getChild("n8"));
  15847. }
  15848. }
  15849. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15850. class ui_Sign_com2 extends fgui.GComponent {
  15851. static createInstance() {
  15852. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15853. }
  15854. onConstruct() {
  15855. this.n0 = (this.getChild("n0"));
  15856. this.n1 = (this.getChild("n1"));
  15857. this.t0 = this.getTransition("t0");
  15858. }
  15859. }
  15860. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15861. class ui_Sign_guang extends fgui.GComponent {
  15862. static createInstance() {
  15863. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15864. }
  15865. onConstruct() {
  15866. this.n1 = (this.getChild("n1"));
  15867. this.n2 = (this.getChild("n2"));
  15868. this.n3 = (this.getChild("n3"));
  15869. this.n4 = (this.getChild("n4"));
  15870. this.n5 = (this.getChild("n5"));
  15871. this.n6 = (this.getChild("n6"));
  15872. this.n8 = (this.getChild("n8"));
  15873. }
  15874. }
  15875. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15876. class ui_SignMax extends fgui.GComponent {
  15877. static createInstance() {
  15878. return (fgui.UIPackage.createObject("game", "SignMax"));
  15879. }
  15880. onConstruct() {
  15881. this.c1 = this.getController("c1");
  15882. this.n7 = (this.getChild("n7"));
  15883. this.n15 = (this.getChild("n15"));
  15884. this.n8 = (this.getChild("n8"));
  15885. this.titleTxt = (this.getChild("titleTxt"));
  15886. this.myIcon1 = (this.getChild("myIcon1"));
  15887. this.numTxt1 = (this.getChild("numTxt1"));
  15888. this.myIcon2 = (this.getChild("myIcon2"));
  15889. this.n20 = (this.getChild("n20"));
  15890. this.n17 = (this.getChild("n17"));
  15891. this.numTxt2 = (this.getChild("numTxt2"));
  15892. this.n12 = (this.getChild("n12"));
  15893. this.n13 = (this.getChild("n13"));
  15894. this.n21 = (this.getChild("n21"));
  15895. this.n14 = (this.getChild("n14"));
  15896. }
  15897. }
  15898. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15899. class ui_Sign_com2_1 extends fgui.GComponent {
  15900. static createInstance() {
  15901. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15902. }
  15903. onConstruct() {
  15904. this.n0 = (this.getChild("n0"));
  15905. this.n1 = (this.getChild("n1"));
  15906. this.t0 = this.getTransition("t0");
  15907. }
  15908. }
  15909. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15910. class ui_Sign_com5 extends fgui.GComponent {
  15911. static createInstance() {
  15912. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15913. }
  15914. onConstruct() {
  15915. this.n3 = (this.getChild("n3"));
  15916. this.n29 = (this.getChild("n29"));
  15917. this.n4 = (this.getChild("n4"));
  15918. this.day1 = (this.getChild("day1"));
  15919. this.day2 = (this.getChild("day2"));
  15920. this.day3 = (this.getChild("day3"));
  15921. this.day4 = (this.getChild("day4"));
  15922. this.day5 = (this.getChild("day5"));
  15923. this.day6 = (this.getChild("day6"));
  15924. this.day7 = (this.getChild("day7"));
  15925. this.t0 = this.getTransition("t0");
  15926. }
  15927. }
  15928. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15929. class ui_Sign_com8 extends fgui.GComponent {
  15930. static createInstance() {
  15931. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15932. }
  15933. onConstruct() {
  15934. this.n48 = (this.getChild("n48"));
  15935. this.womanTxt = (this.getChild("womanTxt"));
  15936. this.t0 = this.getTransition("t0");
  15937. }
  15938. }
  15939. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15940. class ui_Sign_com6 extends fgui.GComponent {
  15941. static createInstance() {
  15942. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15943. }
  15944. onConstruct() {
  15945. this.n2 = (this.getChild("n2"));
  15946. this.n3 = (this.getChild("n3"));
  15947. this.t0 = this.getTransition("t0");
  15948. }
  15949. }
  15950. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15951. class ui_Sign_com7 extends fgui.GComponent {
  15952. static createInstance() {
  15953. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15954. }
  15955. onConstruct() {
  15956. this.n29 = (this.getChild("n29"));
  15957. this.n2 = (this.getChild("n2"));
  15958. }
  15959. }
  15960. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15961. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15962. static createInstance() {
  15963. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15964. }
  15965. onConstruct() {
  15966. this.n5 = (this.getChild("n5"));
  15967. this.n4 = (this.getChild("n4"));
  15968. this.t0 = this.getTransition("t0");
  15969. }
  15970. }
  15971. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15972. class ui_UITurntable_com2 extends fgui.GComponent {
  15973. static createInstance() {
  15974. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15975. }
  15976. onConstruct() {
  15977. this.c1 = this.getController("c1");
  15978. this.n4 = (this.getChild("n4"));
  15979. this.n6 = (this.getChild("n6"));
  15980. this.n10 = (this.getChild("n10"));
  15981. this.n11 = (this.getChild("n11"));
  15982. this.n12 = (this.getChild("n12"));
  15983. this.n13 = (this.getChild("n13"));
  15984. this.n14 = (this.getChild("n14"));
  15985. this.n15 = (this.getChild("n15"));
  15986. this.n16 = (this.getChild("n16"));
  15987. this.n17 = (this.getChild("n17"));
  15988. this.n18 = (this.getChild("n18"));
  15989. this.n19 = (this.getChild("n19"));
  15990. this.n20 = (this.getChild("n20"));
  15991. this.n21 = (this.getChild("n21"));
  15992. this.n22 = (this.getChild("n22"));
  15993. this.n23 = (this.getChild("n23"));
  15994. this.n24 = (this.getChild("n24"));
  15995. this.n25 = (this.getChild("n25"));
  15996. this.n26 = (this.getChild("n26"));
  15997. this.n27 = (this.getChild("n27"));
  15998. this.n28 = (this.getChild("n28"));
  15999. this.n29 = (this.getChild("n29"));
  16000. this.n30 = (this.getChild("n30"));
  16001. this.n31 = (this.getChild("n31"));
  16002. this.n32 = (this.getChild("n32"));
  16003. this.n33 = (this.getChild("n33"));
  16004. }
  16005. }
  16006. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16007. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16008. static createInstance() {
  16009. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16010. }
  16011. onConstruct() {
  16012. this.n5 = (this.getChild("n5"));
  16013. this.n4 = (this.getChild("n4"));
  16014. this.t0 = this.getTransition("t0");
  16015. }
  16016. }
  16017. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16018. class ui_UITurntable_com5 extends fgui.GComponent {
  16019. static createInstance() {
  16020. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16021. }
  16022. onConstruct() {
  16023. this.flashNode = (this.getChild("flashNode"));
  16024. this.rotNode = (this.getChild("rotNode"));
  16025. this.n3 = (this.getChild("n3"));
  16026. this.n21 = (this.getChild("n21"));
  16027. this.t0 = this.getTransition("t0");
  16028. }
  16029. }
  16030. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16031. class ui_UITurntable_com7 extends fgui.GComponent {
  16032. static createInstance() {
  16033. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16034. }
  16035. onConstruct() {
  16036. this.n2 = (this.getChild("n2"));
  16037. this.n35 = (this.getChild("n35"));
  16038. this.img1 = (this.getChild("img1"));
  16039. this.img2 = (this.getChild("img2"));
  16040. this.img3 = (this.getChild("img3"));
  16041. this.img4 = (this.getChild("img4"));
  16042. this.img6 = (this.getChild("img6"));
  16043. this.img5 = (this.getChild("img5"));
  16044. this.txt1 = (this.getChild("txt1"));
  16045. this.txt2 = (this.getChild("txt2"));
  16046. this.txt3 = (this.getChild("txt3"));
  16047. this.txt4 = (this.getChild("txt4"));
  16048. this.txt5 = (this.getChild("txt5"));
  16049. this.txt6 = (this.getChild("txt6"));
  16050. }
  16051. }
  16052. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16053. class ui_UITurntable_com9 extends fgui.GComponent {
  16054. static createInstance() {
  16055. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16056. }
  16057. onConstruct() {
  16058. this.n38 = (this.getChild("n38"));
  16059. this.n39 = (this.getChild("n39"));
  16060. }
  16061. }
  16062. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16063. class ui_UITurntable_com10 extends fgui.GComponent {
  16064. static createInstance() {
  16065. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16066. }
  16067. onConstruct() {
  16068. this.n39 = (this.getChild("n39"));
  16069. this.n40 = (this.getChild("n40"));
  16070. this.t0 = this.getTransition("t0");
  16071. }
  16072. }
  16073. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16074. class ui_UITurntable_com11 extends fgui.GComponent {
  16075. static createInstance() {
  16076. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16077. }
  16078. onConstruct() {
  16079. this.n38 = (this.getChild("n38"));
  16080. this.n39 = (this.getChild("n39"));
  16081. this.n40 = (this.getChild("n40"));
  16082. this.t0 = this.getTransition("t0");
  16083. }
  16084. }
  16085. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16086. class ui_UITurntable_com12 extends fgui.GComponent {
  16087. static createInstance() {
  16088. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16089. }
  16090. onConstruct() {
  16091. this.n43 = (this.getChild("n43"));
  16092. this.barNode = (this.getChild("barNode"));
  16093. this.tipsTxt = (this.getChild("tipsTxt"));
  16094. this.n45 = (this.getChild("n45"));
  16095. this.boxBtn = (this.getChild("boxBtn"));
  16096. }
  16097. }
  16098. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16099. class ui_UITurntable_com1 extends fgui.GButton {
  16100. static createInstance() {
  16101. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16102. }
  16103. onConstruct() {
  16104. this.n41 = (this.getChild("n41"));
  16105. this.n42 = (this.getChild("n42"));
  16106. this.t0 = this.getTransition("t0");
  16107. }
  16108. }
  16109. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16110. class ui_UITurntable_com3 extends fgui.GComponent {
  16111. static createInstance() {
  16112. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16113. }
  16114. onConstruct() {
  16115. this.n48 = (this.getChild("n48"));
  16116. this.womanTxt = (this.getChild("womanTxt"));
  16117. this.t0 = this.getTransition("t0");
  16118. }
  16119. }
  16120. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16121. class ui_cancelBtn2 extends fgui.GButton {
  16122. static createInstance() {
  16123. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16124. }
  16125. onConstruct() {
  16126. this.c1 = this.getController("c1");
  16127. this.n0 = (this.getChild("n0"));
  16128. this.n1 = (this.getChild("n1"));
  16129. this.n2 = (this.getChild("n2"));
  16130. this.n3 = (this.getChild("n3"));
  16131. this.n4 = (this.getChild("n4"));
  16132. this.n5 = (this.getChild("n5"));
  16133. this.n6 = (this.getChild("n6"));
  16134. this.n7 = (this.getChild("n7"));
  16135. this.n8 = (this.getChild("n8"));
  16136. this.powerEft = (this.getChild("powerEft"));
  16137. }
  16138. }
  16139. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16140. class ui_shareBtn2 extends fgui.GButton {
  16141. static createInstance() {
  16142. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16143. }
  16144. onConstruct() {
  16145. this.c1 = this.getController("c1");
  16146. this.n2 = (this.getChild("n2"));
  16147. this.n24 = (this.getChild("n24"));
  16148. this.n1 = (this.getChild("n1"));
  16149. this.n3 = (this.getChild("n3"));
  16150. this.n23 = (this.getChild("n23"));
  16151. this.n4 = (this.getChild("n4"));
  16152. this.n5 = (this.getChild("n5"));
  16153. this.n6 = (this.getChild("n6"));
  16154. this.n20 = (this.getChild("n20"));
  16155. this.n21 = (this.getChild("n21"));
  16156. this.n22 = (this.getChild("n22"));
  16157. this.powerEft = (this.getChild("powerEft"));
  16158. }
  16159. }
  16160. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16161. class ui_UIMoney extends fgui.GComponent {
  16162. static createInstance() {
  16163. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16164. }
  16165. onConstruct() {
  16166. this.c1 = this.getController("c1");
  16167. this.n4 = (this.getChild("n4"));
  16168. this.coinImg = (this.getChild("coinImg"));
  16169. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16170. this.coinTxt = (this.getChild("coinTxt"));
  16171. this.n7 = (this.getChild("n7"));
  16172. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16173. this.diamondTxt = (this.getChild("diamondTxt"));
  16174. this.diamondImg = (this.getChild("diamondImg"));
  16175. this.n12 = (this.getChild("n12"));
  16176. this.powerImg = (this.getChild("powerImg"));
  16177. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16178. this.powerTxt = (this.getChild("powerTxt"));
  16179. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16180. }
  16181. }
  16182. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16183. class ui_backBtn extends fgui.GButton {
  16184. static createInstance() {
  16185. return (fgui.UIPackage.createObject("game", "backBtn"));
  16186. }
  16187. onConstruct() {
  16188. this.n0 = (this.getChild("n0"));
  16189. this.t0 = this.getTransition("t0");
  16190. this.t1 = this.getTransition("t1");
  16191. }
  16192. }
  16193. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16194. class ui_MoneyBtn extends fgui.GButton {
  16195. static createInstance() {
  16196. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16197. }
  16198. onConstruct() {
  16199. this.button = this.getController("button");
  16200. this.n0 = (this.getChild("n0"));
  16201. }
  16202. }
  16203. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16204. class ui_UIMoneyBtn extends fgui.GComponent {
  16205. static createInstance() {
  16206. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16207. }
  16208. onConstruct() {
  16209. this.n1 = (this.getChild("n1"));
  16210. this.closeBtn = (this.getChild("closeBtn"));
  16211. }
  16212. }
  16213. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16214. class ui_Component64 extends fgui.GComponent {
  16215. static createInstance() {
  16216. return (fgui.UIPackage.createObject("game", "Component64"));
  16217. }
  16218. onConstruct() {
  16219. this.n57 = (this.getChild("n57"));
  16220. this.n54 = (this.getChild("n54"));
  16221. this.n55 = (this.getChild("n55"));
  16222. this.n56 = (this.getChild("n56"));
  16223. this.t1 = this.getTransition("t1");
  16224. }
  16225. }
  16226. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16227. class ui_Component41_3 extends fgui.GComponent {
  16228. static createInstance() {
  16229. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16230. }
  16231. onConstruct() {
  16232. this.c1 = this.getController("c1");
  16233. this.n0 = (this.getChild("n0"));
  16234. this.n2 = (this.getChild("n2"));
  16235. this.cancelBtn = (this.getChild("cancelBtn"));
  16236. this.videoBtn = (this.getChild("videoBtn"));
  16237. this.n9 = (this.getChild("n9"));
  16238. this.n24 = (this.getChild("n24"));
  16239. this.n27 = (this.getChild("n27"));
  16240. this.titleTxt = (this.getChild("titleTxt"));
  16241. this.n28 = (this.getChild("n28"));
  16242. this.t0 = this.getTransition("t0");
  16243. }
  16244. }
  16245. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16246. class ui_dh_zs_4 extends fgui.GComponent {
  16247. static createInstance() {
  16248. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16249. }
  16250. onConstruct() {
  16251. this.n1 = (this.getChild("n1"));
  16252. this.n2 = (this.getChild("n2"));
  16253. this.n3 = (this.getChild("n3"));
  16254. this.n4 = (this.getChild("n4"));
  16255. this.n5 = (this.getChild("n5"));
  16256. this.n6 = (this.getChild("n6"));
  16257. this.n8 = (this.getChild("n8"));
  16258. this.t0 = this.getTransition("t0");
  16259. }
  16260. }
  16261. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16262. class ui_Component71_1 extends fgui.GButton {
  16263. static createInstance() {
  16264. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16265. }
  16266. onConstruct() {
  16267. this.n17 = (this.getChild("n17"));
  16268. this.t0 = this.getTransition("t0");
  16269. }
  16270. }
  16271. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16272. class ui_Component83 extends fgui.GComponent {
  16273. static createInstance() {
  16274. return (fgui.UIPackage.createObject("game", "Component83"));
  16275. }
  16276. onConstruct() {
  16277. this.c1 = this.getController("c1");
  16278. this.n17 = (this.getChild("n17"));
  16279. this.n19 = (this.getChild("n19"));
  16280. this.n20 = (this.getChild("n20"));
  16281. }
  16282. }
  16283. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16284. class ui_Component84 extends fgui.GComponent {
  16285. static createInstance() {
  16286. return (fgui.UIPackage.createObject("game", "Component84"));
  16287. }
  16288. onConstruct() {
  16289. this.c1 = this.getController("c1");
  16290. this.n4 = (this.getChild("n4"));
  16291. this.n22 = (this.getChild("n22"));
  16292. this.n23 = (this.getChild("n23"));
  16293. this.numTxt = (this.getChild("numTxt"));
  16294. this.n25 = (this.getChild("n25"));
  16295. this.n26 = (this.getChild("n26"));
  16296. }
  16297. }
  16298. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16299. class ui_Component84_1 extends fgui.GComponent {
  16300. static createInstance() {
  16301. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16302. }
  16303. onConstruct() {
  16304. this.c1 = this.getController("c1");
  16305. this.n4 = (this.getChild("n4"));
  16306. this.n22 = (this.getChild("n22"));
  16307. this.n23 = (this.getChild("n23"));
  16308. this.numTxt = (this.getChild("numTxt"));
  16309. this.n25 = (this.getChild("n25"));
  16310. this.n26 = (this.getChild("n26"));
  16311. }
  16312. }
  16313. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16314. class ui_Component85 extends fgui.GComponent {
  16315. static createInstance() {
  16316. return (fgui.UIPackage.createObject("game", "Component85"));
  16317. }
  16318. onConstruct() {
  16319. this.n1 = (this.getChild("n1"));
  16320. this.n6 = (this.getChild("n6"));
  16321. this.n2 = (this.getChild("n2"));
  16322. this.n3 = (this.getChild("n3"));
  16323. this.levelTxt = (this.getChild("levelTxt"));
  16324. this.n10 = (this.getChild("n10"));
  16325. this.n11 = (this.getChild("n11"));
  16326. this.n12 = (this.getChild("n12"));
  16327. this.n13 = (this.getChild("n13"));
  16328. this.n14 = (this.getChild("n14"));
  16329. this.modeNode = (this.getChild("modeNode"));
  16330. this.n18 = (this.getChild("n18"));
  16331. this.conditionTxt = (this.getChild("conditionTxt"));
  16332. this.diamondNode = (this.getChild("diamondNode"));
  16333. this.coinNode = (this.getChild("coinNode"));
  16334. this.startBtn = (this.getChild("startBtn"));
  16335. this.n28 = (this.getChild("n28"));
  16336. this.displayRoot = (this.getChild("displayRoot"));
  16337. this.t0 = this.getTransition("t0");
  16338. }
  16339. }
  16340. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16341. class ui_Component86 extends fgui.GButton {
  16342. static createInstance() {
  16343. return (fgui.UIPackage.createObject("game", "Component86"));
  16344. }
  16345. onConstruct() {
  16346. this.n15 = (this.getChild("n15"));
  16347. this.t0 = this.getTransition("t0");
  16348. }
  16349. }
  16350. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16351. class ui_Component87 extends fgui.GComponent {
  16352. static createInstance() {
  16353. return (fgui.UIPackage.createObject("game", "Component87"));
  16354. }
  16355. onConstruct() {
  16356. this.n66 = (this.getChild("n66"));
  16357. this.myProgress = (this.getChild("myProgress"));
  16358. this.starAni = (this.getChild("starAni"));
  16359. this.hpTxt = (this.getChild("hpTxt"));
  16360. this.n74 = (this.getChild("n74"));
  16361. this.n73 = (this.getChild("n73"));
  16362. this.ballTxt = (this.getChild("ballTxt"));
  16363. this.n76 = (this.getChild("n76"));
  16364. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16365. this.levelTxt = (this.getChild("levelTxt"));
  16366. this.star1 = (this.getChild("star1"));
  16367. this.star2 = (this.getChild("star2"));
  16368. this.star3 = (this.getChild("star3"));
  16369. }
  16370. }
  16371. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16372. class ui_Component88 extends fgui.GProgressBar {
  16373. static createInstance() {
  16374. return (fgui.UIPackage.createObject("game", "Component88"));
  16375. }
  16376. onConstruct() {
  16377. this.n68 = (this.getChild("n68"));
  16378. this.bar = (this.getChild("bar"));
  16379. }
  16380. }
  16381. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16382. class ui_Component89 extends fgui.GComponent {
  16383. static createInstance() {
  16384. return (fgui.UIPackage.createObject("game", "Component89"));
  16385. }
  16386. onConstruct() {
  16387. this.c1 = this.getController("c1");
  16388. this.n71 = (this.getChild("n71"));
  16389. this.n72 = (this.getChild("n72"));
  16390. }
  16391. }
  16392. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16393. class ui_Component90 extends fgui.GComponent {
  16394. static createInstance() {
  16395. return (fgui.UIPackage.createObject("game", "Component90"));
  16396. }
  16397. onConstruct() {
  16398. this.c1 = this.getController("c1");
  16399. this.n64 = (this.getChild("n64"));
  16400. this.n65 = (this.getChild("n65"));
  16401. this.n66 = (this.getChild("n66"));
  16402. this.t0 = this.getTransition("t0");
  16403. }
  16404. }
  16405. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16406. class ui_Component127 extends fgui.GButton {
  16407. static createInstance() {
  16408. return (fgui.UIPackage.createObject("game", "Component127"));
  16409. }
  16410. onConstruct() {
  16411. this.n5 = (this.getChild("n5"));
  16412. }
  16413. }
  16414. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16415. class gameBinder {
  16416. static bindAll() {
  16417. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16418. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16419. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16420. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16421. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16422. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16423. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16424. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16425. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16426. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16427. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16428. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16429. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16430. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16431. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16432. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16433. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16434. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16435. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16436. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16437. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16438. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16439. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16440. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16441. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16442. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16443. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16444. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16445. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16446. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16447. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16448. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16449. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16450. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16451. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16452. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16453. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16454. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16455. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16456. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16457. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16458. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16459. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16460. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16461. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16462. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16463. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16464. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16465. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16466. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16467. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16468. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16469. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16470. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16471. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16472. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16473. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16474. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16475. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16476. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16477. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16478. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16479. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16480. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16481. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16482. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16483. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16484. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16485. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16486. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16487. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16488. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16489. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16490. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16491. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16492. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16493. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16494. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16495. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16496. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16497. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16498. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16499. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16500. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16501. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16502. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16503. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16504. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16505. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16506. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16507. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16508. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16509. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16510. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16511. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16512. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16513. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16514. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16515. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16516. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16517. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16518. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16519. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16520. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16521. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16522. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16523. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16524. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16525. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16526. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16527. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16528. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16529. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16530. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16531. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16532. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16533. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16534. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16535. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16536. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16537. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16538. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16539. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16540. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16541. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16542. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16543. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16544. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16545. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16546. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16547. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16548. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16549. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16550. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16551. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16552. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16553. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16554. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16555. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16556. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16557. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16558. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16559. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16560. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16561. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16562. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16563. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16564. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16565. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16566. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16567. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16568. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16569. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16570. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16571. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16572. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16573. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16574. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16575. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16576. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16577. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16578. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16579. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16580. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16581. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16582. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16583. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16584. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16585. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16586. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16587. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16588. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16589. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16590. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16591. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16592. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16593. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16594. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16595. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16596. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16597. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16598. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16599. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16600. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16601. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16602. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16603. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16604. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16605. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16606. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16607. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16608. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16609. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16610. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16611. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16612. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16613. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16614. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16615. fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
  16616. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16617. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16618. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16619. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16620. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16621. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16622. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16623. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16624. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16625. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16626. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16627. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16628. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16629. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16630. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16631. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16632. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16633. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16634. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16635. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16636. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16637. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16638. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16639. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16640. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16641. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16642. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16643. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16644. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16645. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16646. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16647. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16648. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16649. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16650. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16651. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16652. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16653. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16654. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16655. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16656. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16657. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16658. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16659. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16660. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16661. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16662. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16663. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16664. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16665. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16666. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16667. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16668. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16669. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16670. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16671. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16672. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16673. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16674. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16675. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16676. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16677. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16678. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16679. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16680. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16681. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16682. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16683. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16684. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16685. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16686. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16687. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16688. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16689. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16690. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16691. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16692. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16693. }
  16694. }
  16695. class ui_btn6 extends fgui.GButton {
  16696. static createInstance() {
  16697. return (fgui.UIPackage.createObject("loading", "btn6"));
  16698. }
  16699. onConstruct() {
  16700. this.n6 = (this.getChild("n6"));
  16701. this.n1 = (this.getChild("n1"));
  16702. }
  16703. }
  16704. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16705. class ui_xyItem extends fgui.GComponent {
  16706. static createInstance() {
  16707. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16708. }
  16709. onConstruct() {
  16710. this.xyItem = (this.getChild("xyItem"));
  16711. }
  16712. }
  16713. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16714. class ui_loadinfo extends fgui.GProgressBar {
  16715. static createInstance() {
  16716. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16717. }
  16718. onConstruct() {
  16719. this.bg = (this.getChild("bg"));
  16720. this.bar = (this.getChild("bar"));
  16721. this.title = (this.getChild("title"));
  16722. this.ani = (this.getChild("ani"));
  16723. }
  16724. }
  16725. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16726. class ui_xyNode extends fgui.GComponent {
  16727. static createInstance() {
  16728. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16729. }
  16730. onConstruct() {
  16731. this.n0 = (this.getChild("n0"));
  16732. this.btnYes = (this.getChild("btnYes"));
  16733. this.btnNo = (this.getChild("btnNo"));
  16734. this.btnKnown = (this.getChild("btnKnown"));
  16735. this.btnSure = (this.getChild("btnSure"));
  16736. this.txtWelcom = (this.getChild("txtWelcom"));
  16737. this.txtXy = (this.getChild("txtXy"));
  16738. this.n75 = (this.getChild("n75"));
  16739. this.btnXy1 = (this.getChild("btnXy1"));
  16740. this.btnXy3 = (this.getChild("btnXy3"));
  16741. this.btnXy2 = (this.getChild("btnXy2"));
  16742. this.n74 = (this.getChild("n74"));
  16743. this.xy1 = (this.getChild("xy1"));
  16744. this.txtTitle = (this.getChild("txtTitle"));
  16745. this.btnBack = (this.getChild("btnBack"));
  16746. this.xyList = (this.getChild("xyList"));
  16747. this.xy2 = (this.getChild("xy2"));
  16748. this.xyNode = (this.getChild("xyNode"));
  16749. }
  16750. }
  16751. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16752. class ui_ageNode extends fgui.GComponent {
  16753. static createInstance() {
  16754. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16755. }
  16756. onConstruct() {
  16757. this.n3 = (this.getChild("n3"));
  16758. this.n7 = (this.getChild("n7"));
  16759. this.n4 = (this.getChild("n4"));
  16760. this.btnAge = (this.getChild("btnAge"));
  16761. this.ageNode = (this.getChild("ageNode"));
  16762. }
  16763. }
  16764. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16765. class ui_rnNode extends fgui.GComponent {
  16766. static createInstance() {
  16767. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16768. }
  16769. onConstruct() {
  16770. this.n28 = (this.getChild("n28"));
  16771. this.n30 = (this.getChild("n30"));
  16772. this.n33 = (this.getChild("n33"));
  16773. this.rn1 = (this.getChild("rn1"));
  16774. this.n40 = (this.getChild("n40"));
  16775. this.n41 = (this.getChild("n41"));
  16776. this.rn3 = (this.getChild("rn3"));
  16777. this.n37 = (this.getChild("n37"));
  16778. this.n39 = (this.getChild("n39"));
  16779. this.rn2 = (this.getChild("rn2"));
  16780. this.n47 = (this.getChild("n47"));
  16781. this.n49 = (this.getChild("n49"));
  16782. this.n44 = (this.getChild("n44"));
  16783. this.inputCode = (this.getChild("inputCode"));
  16784. this.inputName = (this.getChild("inputName"));
  16785. this.n48 = (this.getChild("n48"));
  16786. this.n50 = (this.getChild("n50"));
  16787. this.rn4 = (this.getChild("rn4"));
  16788. this.btnCheck = (this.getChild("btnCheck"));
  16789. this.btnExit = (this.getChild("btnExit"));
  16790. this.btnDone = (this.getChild("btnDone"));
  16791. this.rnNode = (this.getChild("rnNode"));
  16792. }
  16793. }
  16794. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16795. class ui_tipNode extends fgui.GComponent {
  16796. static createInstance() {
  16797. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16798. }
  16799. onConstruct() {
  16800. this.bg = (this.getChild("bg"));
  16801. this.n55 = (this.getChild("n55"));
  16802. this.n56 = (this.getChild("n56"));
  16803. this.tipNode = (this.getChild("tipNode"));
  16804. }
  16805. }
  16806. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16807. class ui_fcmNode extends fgui.GComponent {
  16808. static createInstance() {
  16809. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16810. }
  16811. onConstruct() {
  16812. this.n63 = (this.getChild("n63"));
  16813. this.n62 = (this.getChild("n62"));
  16814. this.btnRn = (this.getChild("btnRn"));
  16815. this.n61 = (this.getChild("n61"));
  16816. this.n58 = (this.getChild("n58"));
  16817. this.fcmNode = (this.getChild("fcmNode"));
  16818. }
  16819. }
  16820. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16821. class ui_msgNode extends fgui.GComponent {
  16822. static createInstance() {
  16823. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16824. }
  16825. onConstruct() {
  16826. this.n69 = (this.getChild("n69"));
  16827. this.txtMsg = (this.getChild("txtMsg"));
  16828. this.msgNode = (this.getChild("msgNode"));
  16829. }
  16830. }
  16831. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16832. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16833. static createInstance() {
  16834. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16835. }
  16836. onConstruct() {
  16837. this.n1 = (this.getChild("n1"));
  16838. this.n13 = (this.getChild("n13"));
  16839. this.n14 = (this.getChild("n14"));
  16840. this.n15 = (this.getChild("n15"));
  16841. this.n3 = (this.getChild("n3"));
  16842. this.n4 = (this.getChild("n4"));
  16843. this.n5 = (this.getChild("n5"));
  16844. this.n6 = (this.getChild("n6"));
  16845. this.n7 = (this.getChild("n7"));
  16846. this.n8 = (this.getChild("n8"));
  16847. this.n9 = (this.getChild("n9"));
  16848. this.n10 = (this.getChild("n10"));
  16849. this.n12 = (this.getChild("n12"));
  16850. this.n11 = (this.getChild("n11"));
  16851. this.n16 = (this.getChild("n16"));
  16852. this.n17 = (this.getChild("n17"));
  16853. this.n18 = (this.getChild("n18"));
  16854. this.n20 = (this.getChild("n20"));
  16855. this.n21 = (this.getChild("n21"));
  16856. this.t0 = this.getTransition("t0");
  16857. }
  16858. }
  16859. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16860. class ui_btn5 extends fgui.GButton {
  16861. static createInstance() {
  16862. return (fgui.UIPackage.createObject("loading", "btn5"));
  16863. }
  16864. onConstruct() {
  16865. this.n9 = (this.getChild("n9"));
  16866. this.n1 = (this.getChild("n1"));
  16867. }
  16868. }
  16869. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16870. class ui_UILoading extends fgui.GComponent {
  16871. static createInstance() {
  16872. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16873. }
  16874. onConstruct() {
  16875. this.n12 = (this.getChild("n12"));
  16876. this.loadinfo = (this.getChild("loadinfo"));
  16877. this.n13 = (this.getChild("n13"));
  16878. this.txtLoad = (this.getChild("txtLoad"));
  16879. this.n18 = (this.getChild("n18"));
  16880. }
  16881. }
  16882. ui_UILoading.URL = "ui://37nctnhwphc33";
  16883. class ui_AgeItem extends fgui.GComponent {
  16884. static createInstance() {
  16885. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16886. }
  16887. onConstruct() {
  16888. this.txtAge = (this.getChild("txtAge"));
  16889. }
  16890. }
  16891. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16892. class ui_btn1 extends fgui.GButton {
  16893. static createInstance() {
  16894. return (fgui.UIPackage.createObject("loading", "btn1"));
  16895. }
  16896. onConstruct() {
  16897. this.n6 = (this.getChild("n6"));
  16898. this.n1 = (this.getChild("n1"));
  16899. }
  16900. }
  16901. ui_btn1.URL = "ui://37nctnhwxe622p";
  16902. class ui_btn3 extends fgui.GButton {
  16903. static createInstance() {
  16904. return (fgui.UIPackage.createObject("loading", "btn3"));
  16905. }
  16906. onConstruct() {
  16907. this.n9 = (this.getChild("n9"));
  16908. this.n1 = (this.getChild("n1"));
  16909. }
  16910. }
  16911. ui_btn3.URL = "ui://37nctnhwxe622s";
  16912. class ui_btn2 extends fgui.GButton {
  16913. static createInstance() {
  16914. return (fgui.UIPackage.createObject("loading", "btn2"));
  16915. }
  16916. onConstruct() {
  16917. this.n6 = (this.getChild("n6"));
  16918. this.n1 = (this.getChild("n1"));
  16919. }
  16920. }
  16921. ui_btn2.URL = "ui://37nctnhwxe622t";
  16922. class ui_btnBack extends fgui.GButton {
  16923. static createInstance() {
  16924. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16925. }
  16926. onConstruct() {
  16927. this.n6 = (this.getChild("n6"));
  16928. this.n7 = (this.getChild("n7"));
  16929. }
  16930. }
  16931. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16932. class ui_btnXy1 extends fgui.GButton {
  16933. static createInstance() {
  16934. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16935. }
  16936. onConstruct() {
  16937. this.n1 = (this.getChild("n1"));
  16938. }
  16939. }
  16940. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16941. class ui_btnXy2 extends fgui.GButton {
  16942. static createInstance() {
  16943. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16944. }
  16945. onConstruct() {
  16946. this.n1 = (this.getChild("n1"));
  16947. }
  16948. }
  16949. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16950. class ui_btnXy3 extends fgui.GButton {
  16951. static createInstance() {
  16952. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16953. }
  16954. onConstruct() {
  16955. this.n1 = (this.getChild("n1"));
  16956. }
  16957. }
  16958. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16959. class ui_btn4 extends fgui.GButton {
  16960. static createInstance() {
  16961. return (fgui.UIPackage.createObject("loading", "btn4"));
  16962. }
  16963. onConstruct() {
  16964. this.n9 = (this.getChild("n9"));
  16965. this.n1 = (this.getChild("n1"));
  16966. }
  16967. }
  16968. ui_btn4.URL = "ui://37nctnhwxe622z";
  16969. class loadingBinder {
  16970. static bindAll() {
  16971. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16972. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16973. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16974. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16975. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16976. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16977. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16978. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16979. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16980. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16981. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16982. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16983. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16984. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16985. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16986. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16987. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16988. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16989. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16990. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16991. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16992. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16993. }
  16994. }
  16995. class UIMgr {
  16996. constructor() {
  16997. this._stage = null;
  16998. this._uiList = [];
  16999. this._showList = [];
  17000. this._bindPkgList = [];
  17001. this.uiIndex = 0;
  17002. }
  17003. static get inst() {
  17004. if (UIMgr._inst == null) {
  17005. UIMgr._inst = new UIMgr();
  17006. }
  17007. return UIMgr._inst;
  17008. }
  17009. setStage(s) {
  17010. if (this._stage) {
  17011. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17012. return;
  17013. }
  17014. this._stage = s;
  17015. }
  17016. clearTempData() {
  17017. console.log('zh:clearTempData start');
  17018. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17019. console.log('zh:clearTempData end');
  17020. }
  17021. init() {
  17022. this.setStage(Laya.stage);
  17023. fairygui.UIConfig.defaultFont = "微软雅黑";
  17024. fairygui.UIConfig.modalLayerColor = "rgba(0,0,0,0.9)";
  17025. fairygui.UIConfig.packageFileExtension = "obj";
  17026. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17027. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17028. fairygui.GRoot.inst.width = Laya.stage.width;
  17029. fairygui.GRoot.inst.height = Laya.stage.height;
  17030. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17031. }
  17032. addAllUpdate() {
  17033. this.uiIndex = 0;
  17034. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17035. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17036. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17037. }
  17038. }
  17039. }
  17040. bindFUI(pkgname) {
  17041. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17042. return;
  17043. }
  17044. switch (pkgname) {
  17045. case fguiRes.loading:
  17046. fairygui.UIPackage.addPackage(pkgname);
  17047. loadingBinder.bindAll();
  17048. this._bindPkgList.push(pkgname);
  17049. break;
  17050. case fguiRes.game:
  17051. fairygui.UIPackage.addPackage(pkgname);
  17052. gameBinder.bindAll();
  17053. this._bindPkgList.push(pkgname);
  17054. break;
  17055. default:
  17056. break;
  17057. }
  17058. }
  17059. Show(cls, ...param) {
  17060. let nameStr = cls.uiName;
  17061. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17062. let temp = this._uiList[i];
  17063. let str = temp.className;
  17064. if (str == nameStr) {
  17065. if (temp.isMuti) {
  17066. if (temp.isHide) {
  17067. temp.show(...param);
  17068. this._uiList.splice(i, 1);
  17069. this._uiList.push(temp);
  17070. return temp;
  17071. }
  17072. }
  17073. else {
  17074. temp.show(...param);
  17075. this._uiList.splice(i, 1);
  17076. this._uiList.push(temp);
  17077. return temp;
  17078. }
  17079. }
  17080. }
  17081. let ui = new cls();
  17082. ui.className = nameStr;
  17083. this._showUI(ui, param);
  17084. return ui;
  17085. }
  17086. destroyUI(ui) {
  17087. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17088. let temp = this._uiList[i].className;
  17089. if (temp == ui.className) {
  17090. this._uiList.splice(i, 1);
  17091. break;
  17092. }
  17093. }
  17094. this.checkUIState();
  17095. }
  17096. _showUI(ui, param) {
  17097. this._uiList.push(ui);
  17098. ui.show(...param);
  17099. }
  17100. Hide(uiClass) {
  17101. let ui = this.getUI(uiClass);
  17102. if (ui && !ui.isHide) {
  17103. ui.hide();
  17104. }
  17105. }
  17106. getUI(ui) {
  17107. let nameStr = ui.uiName;
  17108. for (let index = 0; index < this._uiList.length; index++) {
  17109. let temp = this._uiList[index];
  17110. if (temp.className == nameStr) {
  17111. return temp;
  17112. }
  17113. }
  17114. return null;
  17115. }
  17116. isShow(cls) {
  17117. for (var i of this._uiList) {
  17118. if (i instanceof cls) {
  17119. return i.isShowing;
  17120. }
  17121. }
  17122. return false;
  17123. }
  17124. showUINum() {
  17125. let num = 0;
  17126. for (var i of this._uiList) {
  17127. if (i.isShowing) {
  17128. num++;
  17129. }
  17130. }
  17131. return num;
  17132. }
  17133. checkUIState() {
  17134. Laya.timer.clear(this, this._uiCheck);
  17135. Laya.timer.once(400, this, this._uiCheck);
  17136. }
  17137. _uiCheck() {
  17138. let showList = [];
  17139. for (var i of this._uiList) {
  17140. if (!i.isHide) {
  17141. showList.push(i);
  17142. }
  17143. }
  17144. for (let index = 0; index < showList.length; index++) {
  17145. if (index == showList.length - 1) {
  17146. showList[index].checkActive(true);
  17147. }
  17148. else {
  17149. showList[index].checkActive(false);
  17150. }
  17151. }
  17152. }
  17153. showTip(msg, time = 600, size = 30) {
  17154. }
  17155. }
  17156. class UIShowList {
  17157. }
  17158. class SoundMgr {
  17159. constructor() {
  17160. this.soundMax = 4;
  17161. this.isLoad = false;
  17162. this.soundMap = {};
  17163. this.isSound = true;
  17164. this.openShake = true;
  17165. SoundMgr._instance = this;
  17166. }
  17167. static getInstance() {
  17168. if (!this._instance) {
  17169. this._instance = new SoundMgr();
  17170. }
  17171. return this._instance;
  17172. }
  17173. init() {
  17174. console.log('zh:sm init 1');
  17175. Laya.SoundManager.autoReleaseSound = true;
  17176. Laya.SoundManager.autoStopMusic = true;
  17177. Laya.SoundManager.musicVolume = 0.3;
  17178. Laya.SoundManager.soundVolume = 0.5;
  17179. this.musicPlayed = false;
  17180. this.audioUrl = "asset/sound/ogg/";
  17181. console.log('zh:sm init 2');
  17182. console.log('zh:dev type ');
  17183. if (Laya.Browser.onAndroid) {
  17184. console.log('zh:dev type android');
  17185. this.audioUrl = "asset/sound/ogg/";
  17186. this.isLoad = true;
  17187. }
  17188. else {
  17189. console.log('zh:dev type not android');
  17190. this.audioUrl = "asset/sound/mp3/";
  17191. this.isLoad = true;
  17192. }
  17193. }
  17194. onSetting(isS) {
  17195. this.isSound = isS;
  17196. this.mute(!this.isSound);
  17197. }
  17198. clearCount() {
  17199. for (var key in this.soundMap) {
  17200. delete this.soundMap[key];
  17201. }
  17202. }
  17203. playMusic(path, loop = 0) {
  17204. console.log('zh:playMusic 1 PATH=' + path);
  17205. this.musicPath = path;
  17206. if (!this.isLoad) {
  17207. return;
  17208. }
  17209. if (!path || path == "") {
  17210. return;
  17211. }
  17212. if (!this.isSound) {
  17213. return;
  17214. }
  17215. this.musicPlayed = true;
  17216. let url = this.getUrl(path);
  17217. if (!Laya.Browser.onAndroid) {
  17218. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17219. this.play(url, loop);
  17220. }));
  17221. }
  17222. else {
  17223. this.play(url, loop);
  17224. }
  17225. }
  17226. play(url, loop) {
  17227. Laya.SoundManager.playMusic(url, loop);
  17228. }
  17229. getUrl(path) {
  17230. let url = this.audioUrl + path;
  17231. if (Laya.Browser.onAndroid) {
  17232. url += ".ogg";
  17233. }
  17234. else {
  17235. url += ".mp3";
  17236. }
  17237. return url;
  17238. }
  17239. pauseMusic(pause) {
  17240. if (pause) {
  17241. this.mute(true);
  17242. }
  17243. else if (this.isSound)
  17244. this.mute(false);
  17245. }
  17246. stopMusic() {
  17247. Laya.SoundManager.stopMusic();
  17248. if (Moyu.isNeedPlatAudio) {
  17249. Moyu.stopMusic();
  17250. }
  17251. }
  17252. mute(mute) {
  17253. if (Moyu.isNeedPlatAudio) {
  17254. Moyu.pauseMusic(mute);
  17255. }
  17256. else {
  17257. Laya.SoundManager.musicMuted = mute;
  17258. if (!mute && !this.musicPlayed && this.musicPath) {
  17259. this.playMusic(this.musicPath);
  17260. }
  17261. }
  17262. }
  17263. stopSound(path) {
  17264. let url = this.getUrl(path);
  17265. Laya.SoundManager.stopSound(url);
  17266. }
  17267. playSound(path, loop = 1, soundMax = this.soundMax) {
  17268. if (!this.isLoad)
  17269. return;
  17270. if (!this.isSound)
  17271. return;
  17272. if (!path || path == "")
  17273. return;
  17274. let url = this.getUrl(path);
  17275. if (Moyu.isNeedPlatAudio) {
  17276. Moyu.playSound(path, loop == 0);
  17277. }
  17278. else {
  17279. let count = 1;
  17280. if (this.soundMap[path])
  17281. count = this.soundMap[path] + 1;
  17282. if (count > soundMax)
  17283. return;
  17284. this.soundMap[path] = count;
  17285. Laya.SoundManager.playSound(url, loop);
  17286. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17287. }
  17288. }
  17289. removePath(path) {
  17290. if (this.soundMap[path]) {
  17291. let count = this.soundMap[path];
  17292. count--;
  17293. if (count < 1)
  17294. delete this.soundMap[path];
  17295. else
  17296. this.soundMap[path] = count;
  17297. }
  17298. }
  17299. playBtnSound() {
  17300. this.playSound("btn");
  17301. }
  17302. playGetSound() {
  17303. }
  17304. playCloseUISound() {
  17305. }
  17306. }
  17307. SoundMgr._instance = null;
  17308. var Handler$1 = Laya.Handler;
  17309. var EResType;
  17310. (function (EResType) {
  17311. EResType[EResType["none"] = 0] = "none";
  17312. EResType[EResType["nromal"] = 1] = "nromal";
  17313. EResType[EResType["td"] = 2] = "td";
  17314. EResType[EResType["sk"] = 3] = "sk";
  17315. })(EResType || (EResType = {}));
  17316. class CResLoader {
  17317. constructor(doneCall, proCall) {
  17318. this.completrCall = doneCall;
  17319. this.progressCall = proCall;
  17320. this.progressHander = new Handler$1(this, this.onProgress);
  17321. this.tdResMap = {};
  17322. }
  17323. load(resList) {
  17324. this.resCount = 0;
  17325. this.loadCount = 0;
  17326. for (let i = 0; i < resList.length; i++) {
  17327. let path = resList[i];
  17328. if (!path)
  17329. continue;
  17330. this.resCount++;
  17331. let type = this.getResType(path);
  17332. if (type == EResType.nromal)
  17333. this.loadNromal(path);
  17334. else if (type == EResType.td)
  17335. this.loadTd(path);
  17336. }
  17337. }
  17338. getRes(path) {
  17339. let type = this.getResType(path);
  17340. if (type == EResType.nromal)
  17341. return Laya.loader.getRes(path);
  17342. else if (type == EResType.td) {
  17343. let res = this.tdResMap[path];
  17344. if (res)
  17345. return res.clone();
  17346. return null;
  17347. }
  17348. }
  17349. destroy() {
  17350. this.progressHander.clear();
  17351. this.progressHander = null;
  17352. }
  17353. clearRes(path) {
  17354. let type = this.getResType(path);
  17355. if (type == EResType.nromal)
  17356. Laya.loader.clearRes(path);
  17357. else if (type == EResType.td) {
  17358. let obj = this.tdResMap[path];
  17359. if (obj)
  17360. obj.destroy();
  17361. delete this.tdResMap[path];
  17362. }
  17363. }
  17364. getResType(path) {
  17365. let exs = this.getExtension(path);
  17366. if (exs == "sk")
  17367. return EResType.sk;
  17368. if (exs == "ls" || exs == "lh" || exs == "lm")
  17369. return EResType.td;
  17370. else
  17371. return EResType.nromal;
  17372. }
  17373. getExtension(res) {
  17374. var index = res.lastIndexOf(".");
  17375. return res.substr(index + 1);
  17376. }
  17377. loadNromal(path) {
  17378. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17379. if (res) {
  17380. this.onLoad();
  17381. }
  17382. else
  17383. console.log("load res fail:" + path);
  17384. }), this.progressHander);
  17385. }
  17386. loadSk() {
  17387. }
  17388. loadTd(path) {
  17389. if (this.tdResMap[path]) {
  17390. this.onLoad();
  17391. return;
  17392. }
  17393. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17394. if (res) {
  17395. this.tdResMap[path] = res;
  17396. this.onLoad();
  17397. }
  17398. else
  17399. console.log("load res fail:" + path);
  17400. }));
  17401. }
  17402. onLoad() {
  17403. this.loadCount++;
  17404. this.onProgress(1);
  17405. if (this.loadCount >= this.resCount) {
  17406. this.completrCall.run();
  17407. }
  17408. }
  17409. onProgress(pro) {
  17410. let progress = (this.loadCount + pro) / this.resCount;
  17411. this.progressCall.runWith(progress);
  17412. }
  17413. }
  17414. var Handler$2 = Laya.Handler;
  17415. class ResInfo {
  17416. constructor() {
  17417. this.index = 0;
  17418. }
  17419. }
  17420. class ResMgr {
  17421. constructor() {
  17422. this.resList = [];
  17423. this.doneList = [];
  17424. this.resMap = {};
  17425. this.currentLoad = null;
  17426. this.completeHandler = new Handler$2(this, this.onComplete);
  17427. this.progressHandler = new Handler$2(this, this.onProgress);
  17428. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17429. }
  17430. static getInstance() {
  17431. if (ResMgr._instance == null) {
  17432. ResMgr._instance = new ResMgr();
  17433. }
  17434. return ResMgr._instance;
  17435. }
  17436. loadList(list, completeHandler, progressHandler) {
  17437. if (list.length < 1) {
  17438. completeHandler.run();
  17439. return;
  17440. }
  17441. let info = this.getResInfo();
  17442. info.resList = list;
  17443. info.completeHandler = completeHandler;
  17444. info.progressHandler = progressHandler;
  17445. this.resList.push(info);
  17446. this.startLoad();
  17447. }
  17448. loadFguiRes(list, completeHandler, progressHandler) {
  17449. Laya.loader.load(list, completeHandler, progressHandler);
  17450. }
  17451. loadAny(list, completeHandler, progressHandler) {
  17452. Laya.loader.load(list, completeHandler, progressHandler);
  17453. }
  17454. load(path, completeHandler, progressHandler) {
  17455. let count = this.resMap[path];
  17456. if (count && count > 0) {
  17457. if (completeHandler)
  17458. completeHandler.run();
  17459. }
  17460. else
  17461. this.loadList([path], completeHandler, progressHandler);
  17462. }
  17463. getRes(path) {
  17464. let res = this.resMap[path];
  17465. if (!res)
  17466. this.showLog("资源不存在:" + path);
  17467. else
  17468. return this.loader.getRes(path);
  17469. }
  17470. clearList(list, force = false) {
  17471. if (!list || list.length < 1)
  17472. return;
  17473. let cr = () => {
  17474. for (const k in list) {
  17475. let v = list[k];
  17476. if (!v)
  17477. continue;
  17478. if (force) {
  17479. this.loader.clearRes(v);
  17480. delete this.resMap[v];
  17481. }
  17482. else {
  17483. let count = this.resMap[v];
  17484. if (count && count > 1) {
  17485. count--;
  17486. this.resMap[v] = count;
  17487. }
  17488. else {
  17489. this.loader.clearRes(v);
  17490. delete this.resMap[v];
  17491. }
  17492. }
  17493. }
  17494. if (!window.hasOwnProperty("ks"))
  17495. Laya.Resource.destroyUnusedResources();
  17496. };
  17497. Laya.timer.clearAll(this);
  17498. Laya.timer.once(2000, this, cr);
  17499. }
  17500. clear3D() {
  17501. for (const k in this.loader.tdResMap) {
  17502. this.loader.clearRes(k);
  17503. if (this.resMap[k])
  17504. delete this.resMap[k];
  17505. }
  17506. if (!window.hasOwnProperty("ks"))
  17507. Laya.Resource.destroyUnusedResources();
  17508. }
  17509. clear(path, force = false) {
  17510. this.clearList([path], force);
  17511. }
  17512. getResInfo() {
  17513. if (this.doneList.length > 0)
  17514. return this.doneList.pop();
  17515. else
  17516. return new ResInfo();
  17517. }
  17518. startLoad() {
  17519. if (this.currentLoad)
  17520. return;
  17521. this.currentLoad = this.resList.pop();
  17522. if (this.currentLoad) {
  17523. this.loader.load(this.currentLoad.resList);
  17524. }
  17525. }
  17526. onComplete() {
  17527. if (!this.currentLoad)
  17528. return;
  17529. for (const k in this.currentLoad.resList) {
  17530. let v = this.currentLoad.resList[k];
  17531. let count = this.resMap[v];
  17532. if (count)
  17533. count++;
  17534. else
  17535. count = 1;
  17536. this.resMap[v] = count;
  17537. }
  17538. if (this.currentLoad.completeHandler)
  17539. this.currentLoad.completeHandler.run();
  17540. this.doneList.push(this.currentLoad);
  17541. this.currentLoad = null;
  17542. this.startLoad();
  17543. }
  17544. onProgress(pro) {
  17545. if (!this.currentLoad)
  17546. return;
  17547. if (this.currentLoad.progressHandler)
  17548. this.currentLoad.progressHandler.runWith(pro);
  17549. }
  17550. showLog(str, ...args) {
  17551. console.log("[ResLoader] " + str);
  17552. }
  17553. }
  17554. ResMgr._instance = null;
  17555. class EventMgr extends Laya.EventDispatcher {
  17556. }
  17557. let eventMgr = new EventMgr();
  17558. /*! *****************************************************************************
  17559. Copyright (c) Microsoft Corporation. All rights reserved.
  17560. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17561. this file except in compliance with the License. You may obtain a copy of the
  17562. License at http://www.apache.org/licenses/LICENSE-2.0
  17563. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17564. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17565. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17566. MERCHANTABLITY OR NON-INFRINGEMENT.
  17567. See the Apache Version 2.0 License for specific language governing permissions
  17568. and limitations under the License.
  17569. ***************************************************************************** */
  17570. /* global Reflect, Promise */
  17571. var extendStatics = function(d, b) {
  17572. extendStatics = Object.setPrototypeOf ||
  17573. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17574. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17575. return extendStatics(d, b);
  17576. };
  17577. function __extends(d, b) {
  17578. extendStatics(d, b);
  17579. function __() { this.constructor = d; }
  17580. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17581. }
  17582. var __assign = function() {
  17583. __assign = Object.assign || function __assign(t) {
  17584. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17585. s = arguments[i];
  17586. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17587. }
  17588. return t;
  17589. };
  17590. return __assign.apply(this, arguments);
  17591. };
  17592. function __rest(s, e) {
  17593. var t = {};
  17594. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17595. t[p] = s[p];
  17596. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17597. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17598. t[p[i]] = s[p[i]];
  17599. return t;
  17600. }
  17601. function __decorate(decorators, target, key, desc) {
  17602. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17603. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17604. 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;
  17605. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17606. }
  17607. function __param(paramIndex, decorator) {
  17608. return function (target, key) { decorator(target, key, paramIndex); }
  17609. }
  17610. function __metadata(metadataKey, metadataValue) {
  17611. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17612. }
  17613. function __awaiter(thisArg, _arguments, P, generator) {
  17614. return new (P || (P = Promise))(function (resolve, reject) {
  17615. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17616. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17617. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17618. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17619. });
  17620. }
  17621. function __generator(thisArg, body) {
  17622. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17623. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17624. function verb(n) { return function (v) { return step([n, v]); }; }
  17625. function step(op) {
  17626. if (f) throw new TypeError("Generator is already executing.");
  17627. while (_) try {
  17628. 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;
  17629. if (y = 0, t) op = [op[0] & 2, t.value];
  17630. switch (op[0]) {
  17631. case 0: case 1: t = op; break;
  17632. case 4: _.label++; return { value: op[1], done: false };
  17633. case 5: _.label++; y = op[1]; op = [0]; continue;
  17634. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17635. default:
  17636. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17637. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17638. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17639. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17640. if (t[2]) _.ops.pop();
  17641. _.trys.pop(); continue;
  17642. }
  17643. op = body.call(thisArg, _);
  17644. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17645. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17646. }
  17647. }
  17648. function __exportStar(m, exports) {
  17649. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17650. }
  17651. function __values(o) {
  17652. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17653. if (m) return m.call(o);
  17654. return {
  17655. next: function () {
  17656. if (o && i >= o.length) o = void 0;
  17657. return { value: o && o[i++], done: !o };
  17658. }
  17659. };
  17660. }
  17661. function __read(o, n) {
  17662. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17663. if (!m) return o;
  17664. var i = m.call(o), r, ar = [], e;
  17665. try {
  17666. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17667. }
  17668. catch (error) { e = { error: error }; }
  17669. finally {
  17670. try {
  17671. if (r && !r.done && (m = i["return"])) m.call(i);
  17672. }
  17673. finally { if (e) throw e.error; }
  17674. }
  17675. return ar;
  17676. }
  17677. function __spread() {
  17678. for (var ar = [], i = 0; i < arguments.length; i++)
  17679. ar = ar.concat(__read(arguments[i]));
  17680. return ar;
  17681. }
  17682. function __await(v) {
  17683. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17684. }
  17685. function __asyncGenerator(thisArg, _arguments, generator) {
  17686. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17687. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17688. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17689. 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); }); }; }
  17690. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17691. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17692. function fulfill(value) { resume("next", value); }
  17693. function reject(value) { resume("throw", value); }
  17694. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17695. }
  17696. function __asyncDelegator(o) {
  17697. var i, p;
  17698. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17699. 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; }
  17700. }
  17701. function __asyncValues(o) {
  17702. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17703. var m = o[Symbol.asyncIterator], i;
  17704. 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);
  17705. 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); }); }; }
  17706. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17707. }
  17708. function __makeTemplateObject(cooked, raw) {
  17709. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17710. return cooked;
  17711. };
  17712. function __importStar(mod) {
  17713. if (mod && mod.__esModule) return mod;
  17714. var result = {};
  17715. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17716. result.default = mod;
  17717. return result;
  17718. }
  17719. function __importDefault(mod) {
  17720. return (mod && mod.__esModule) ? mod : { default: mod };
  17721. }
  17722. class CustomAlert {
  17723. static show(title, content, buttons) {
  17724. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17725. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17726. return;
  17727. }
  17728. const bg = new Laya.Box();
  17729. bg.alpha = 0;
  17730. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17731. Laya.stage.addChild(bg);
  17732. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17733. const panel = new Laya.Box();
  17734. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17735. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17736. bg.addChild(panel);
  17737. const titleText = new Laya.Text();
  17738. titleText.text = title;
  17739. titleText.fontSize = 32;
  17740. titleText.color = "#333333";
  17741. titleText.bold = true;
  17742. titleText.pos(20, 20);
  17743. titleText.width = 360;
  17744. titleText.align = "center";
  17745. panel.addChild(titleText);
  17746. const contentText = new Laya.Text();
  17747. contentText.text = content;
  17748. contentText.fontSize = 21;
  17749. contentText.color = "#555555";
  17750. contentText.pos(20, 70);
  17751. contentText.width = 360;
  17752. contentText.wordWrap = true;
  17753. contentText.align = "center";
  17754. panel.addChild(contentText);
  17755. const buttonContainer = new Laya.Box();
  17756. buttonContainer.pos(20, 160);
  17757. panel.addChild(buttonContainer);
  17758. const btnWidth = 120;
  17759. const spacing = 30;
  17760. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17761. buttons.forEach((btn, index) => {
  17762. const button = new Laya.Button();
  17763. button.label = btn.label;
  17764. button.size(btnWidth, 40);
  17765. button.labelSize = 22;
  17766. button.pos(index * (btnWidth + spacing), 0);
  17767. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17768. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17769. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17770. button.alpha = 0.9;
  17771. });
  17772. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17773. button.alpha = 1;
  17774. });
  17775. button.on(Laya.Event.CLICK, this, () => {
  17776. btn.handler();
  17777. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17778. bg.removeSelf();
  17779. }));
  17780. });
  17781. buttonContainer.addChild(button);
  17782. });
  17783. buttonContainer.x = (panel.width - totalWidth) / 2;
  17784. }
  17785. }
  17786. class ConfigMgr {
  17787. constructor() {
  17788. this.httpReqCount = 4;
  17789. this.httpReqOkCount = 0;
  17790. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17791. try {
  17792. this.httpReqOkCount = 0;
  17793. let reqData = xGame.httpMgr.getReqData();
  17794. console.log('zh:第1个请求getClassicCfg');
  17795. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17796. this.classicCfg = classicCfg;
  17797. this.httpReqOkCount++;
  17798. console.log('zh:第2个请求getLevelCfg');
  17799. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17800. this.levelCfg = levelCfg;
  17801. this.httpReqOkCount++;
  17802. console.log('zh:第3个请求 getPlaceBallCfg');
  17803. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17804. this.placeBallCfg = placeBallCfg;
  17805. this.httpReqOkCount++;
  17806. console.log('zh:第4个请求 npc');
  17807. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17808. this.npcJson = npc.Data;
  17809. this.httpReqOkCount++;
  17810. console.log('zh:所有配置加载完成');
  17811. }
  17812. catch (error) {
  17813. console.error('❌请求失败:', error);
  17814. Laya.timer.once(5000, this, () => {
  17815. let retryCount = 0;
  17816. const maxRetries = 3;
  17817. const tryFetchConfig = () => {
  17818. try {
  17819. xGame.cfgMgr.getConfigFromServer();
  17820. }
  17821. catch (error) {
  17822. if (retryCount < maxRetries) {
  17823. retryCount++;
  17824. console.log(`🔄 第${retryCount}次重试获取配置...`);
  17825. Laya.timer.once(5000, this, tryFetchConfig);
  17826. }
  17827. else {
  17828. console.error("❌ 达到最大重试次数,配置获取失败");
  17829. }
  17830. }
  17831. };
  17832. tryFetchConfig();
  17833. });
  17834. }
  17835. finally {
  17836. if (this.httpReqCount > this.httpReqOkCount) {
  17837. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [
  17838. {
  17839. label: "Okay", handler: () => {
  17840. console.log("zh:好的知道了");
  17841. JSBridgeUtils.instance.exitAndCloseGame();
  17842. }
  17843. }
  17844. ]);
  17845. }
  17846. }
  17847. });
  17848. this.sendPostAsync = (action, reqData) => {
  17849. return new Promise((resolve, reject) => {
  17850. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17851. try {
  17852. let code = res.code;
  17853. if (code == 200) {
  17854. const parsedData = JSON.parse(res.msg);
  17855. resolve(parsedData);
  17856. }
  17857. else {
  17858. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17859. reject(new Error(`Request failed with code: ${code}`));
  17860. }
  17861. }
  17862. catch (error) {
  17863. console.error(`ERROR=${error}`);
  17864. alert("Please check your network connection.");
  17865. reject(error);
  17866. }
  17867. finally {
  17868. console.log(`zh:${action}的请求处理完毕`);
  17869. }
  17870. });
  17871. });
  17872. };
  17873. }
  17874. static getInstance() {
  17875. if (!this._instance) {
  17876. this._instance = new ConfigMgr();
  17877. }
  17878. return this._instance;
  17879. }
  17880. init() {
  17881. this.getConfigFromServer();
  17882. }
  17883. test() {
  17884. let reqData = xGame.httpMgr.getReqData();
  17885. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17886. console.log('zh:1s');
  17887. try {
  17888. let code = res.code;
  17889. let data = res.data;
  17890. if (code == 200) {
  17891. const parsedData = JSON.parse(data);
  17892. this.classicCfg = parsedData;
  17893. }
  17894. else {
  17895. console.log('zh:res = ' + JSON.stringify(res));
  17896. }
  17897. }
  17898. catch (error) {
  17899. console.log('error=' + error);
  17900. alert("Please check your network connection.");
  17901. }
  17902. finally {
  17903. console.log('zh:1');
  17904. }
  17905. });
  17906. }
  17907. getUserInfoByIndex(index) {
  17908. return this.npcJson[index];
  17909. }
  17910. getRandomUserInfo() {
  17911. let index = xGame.tools.random(0, this.npcJson.length);
  17912. let rs = this.npcJson[index];
  17913. return rs;
  17914. }
  17915. getMaxBigMoveLength() {
  17916. return Object.keys(this.levelCfg).length;
  17917. }
  17918. getBigMoveLevelByIndex(index) {
  17919. let cfg = this.levelCfg;
  17920. cfg = cfg[index];
  17921. return cfg;
  17922. }
  17923. getRandomClassicLevel() {
  17924. let cfg = this.classicCfg;
  17925. let num = Object.keys(cfg).length;
  17926. let rand = xGame.common.randomNum(1, num);
  17927. return cfg[rand];
  17928. }
  17929. getPlaceBallByLevel(level) {
  17930. return this.placeBallCfg[level];
  17931. }
  17932. getMaxPlaceBall() {
  17933. return Object.keys(this.placeBallCfg).length;
  17934. }
  17935. }
  17936. class PoolD3Mgr {
  17937. constructor() {
  17938. this.pool = {};
  17939. }
  17940. static get ins() {
  17941. return this._ins || (this._ins = new PoolD3Mgr);
  17942. }
  17943. createList(key, prefab, parent) {
  17944. if (!this.pool[key]) {
  17945. this.pool[key] = {};
  17946. this.pool[key].prefab = prefab;
  17947. this.pool[key].list = [];
  17948. this.pool[key].parent = parent;
  17949. }
  17950. }
  17951. getItem(key) {
  17952. if (!this.pool[key]) {
  17953. return;
  17954. }
  17955. let temp;
  17956. if (this.pool[key].list.length > 0) {
  17957. temp = this.pool[key].list.pop();
  17958. }
  17959. else {
  17960. temp = this.pool[key].prefab.clone();
  17961. if (this.pool[key].parent) {
  17962. this.pool[key].parent.addChild(temp);
  17963. }
  17964. }
  17965. temp.active = true;
  17966. return temp;
  17967. }
  17968. putItem(key, obj) {
  17969. if (!this.pool[key]) {
  17970. return;
  17971. }
  17972. obj.active = false;
  17973. this.pool[key].list.push(obj);
  17974. }
  17975. }
  17976. let context$1 = context;
  17977. let uiMgr = UIMgr.inst;
  17978. let soundMgr = SoundMgr.getInstance();
  17979. let resMgr = ResMgr.getInstance();
  17980. let httpMgr = HttpMgr.getInstance();
  17981. let common = Common.getInstance();
  17982. let cfgMgr = ConfigMgr.getInstance();
  17983. let poolD3Mgr = PoolD3Mgr.ins;
  17984. let d3TexUrl = "res/d3Res/";
  17985. let d3ModeUrl = "res/unityRes/";
  17986. function setStageSize(view) {
  17987. if (view.width) {
  17988. view.width = Laya.stage.width;
  17989. view.height = Laya.stage.height;
  17990. }
  17991. }
  17992. function filledBg(view) {
  17993. let wh = Laya.stage.height / Laya.stage.width;
  17994. if (wh > 16 / 9) {
  17995. view.height = Laya.stage.height;
  17996. view.width = Laya.stage.height / 1334 * 750;
  17997. }
  17998. else {
  17999. view.width = Laya.stage.width;
  18000. view.height = Laya.stage.width / 750 * 1334;
  18001. }
  18002. }
  18003. function setNotch(view) {
  18004. if (view.height) {
  18005. view.y += context$1.notchHeight;
  18006. }
  18007. }
  18008. function showTip(str) {
  18009. uiMgr.Show(UIMsg, str);
  18010. }
  18011. function log(...args) {
  18012. console.log(args);
  18013. }
  18014. let xGame = {
  18015. context: context$1,
  18016. eventMgr,
  18017. resMgr,
  18018. uiMgr,
  18019. soundMgr,
  18020. define,
  18021. tools,
  18022. httpMgr,
  18023. d3TexUrl,
  18024. d3ModeUrl,
  18025. common,
  18026. cfgMgr,
  18027. poolD3Mgr,
  18028. setStageSize,
  18029. filledBg,
  18030. setNotch,
  18031. showTip,
  18032. log,
  18033. };
  18034. window["xGame"] = xGame;
  18035. let dataName = 'tBall_';
  18036. class UserData {
  18037. constructor() {
  18038. this.userId = "";
  18039. this.isAgree = false;
  18040. this.coinNum = 0;
  18041. this.gemNum = 0;
  18042. this.sound = true;
  18043. this.vibration = true;
  18044. this.currentDate = 0;
  18045. this.createTime = 0;
  18046. this.awardTime = 0;
  18047. this.roleId = 1;
  18048. this.roleList = [];
  18049. this.roleAds = [];
  18050. this.dressId = 101;
  18051. this.itemId = 201;
  18052. this.bigSkills = [1, 1, 1, 1, 1];
  18053. this.coin = 4000;
  18054. this.diamond = 0;
  18055. this.skillSuccessTimes = 0;
  18056. this.skillGuide = 0;
  18057. this.skillAccTimes = 0;
  18058. this.placeBallData = [];
  18059. this.shareDiamondTimes = 0;
  18060. this.dailyVideoShareTimes = 0;
  18061. this.secretary = [1, 0];
  18062. this.curSecretary = 0;
  18063. this.ballRod = [1, 0, 0, 0, 0, 1];
  18064. this.curBallRod = 5;
  18065. this.signData = 0;
  18066. this.signTime = 0;
  18067. this.drawTimes = 0;
  18068. this.drawAwardTimes = 0;
  18069. this.dailyfreeDrawTimes = 1;
  18070. this.power = 5;
  18071. this.powerTime = 0;
  18072. this.challengeTimes = 0;
  18073. this.extraSign = 0;
  18074. this.classicTimes = 0;
  18075. this.guideHelpLine = 0;
  18076. this.newUser = true;
  18077. this.rootBallFoul = 0;
  18078. this.timeoutFoul = 0;
  18079. this.roleList = [1];
  18080. }
  18081. saveData() {
  18082. let data = {};
  18083. for (let k in this) {
  18084. data[k.toString()] = this[k];
  18085. }
  18086. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18087. }
  18088. getData() {
  18089. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18090. if (ld) {
  18091. let localData = JSON.parse(ld);
  18092. if (localData) {
  18093. for (let k in this) {
  18094. let key = k.toString();
  18095. let data = localData[key];
  18096. if (data != undefined) {
  18097. this[k] = data;
  18098. }
  18099. }
  18100. }
  18101. }
  18102. }
  18103. }
  18104. class ItemData {
  18105. constructor() {
  18106. this.itemList = {};
  18107. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18108. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18109. }
  18110. saveData() {
  18111. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18112. }
  18113. getData() {
  18114. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18115. if (ld) {
  18116. let localData = JSON.parse(ld);
  18117. if (localData) {
  18118. this.itemList = localData;
  18119. }
  18120. }
  18121. }
  18122. }
  18123. class GameData {
  18124. constructor() {
  18125. this.curLevel = 0;
  18126. this.gameType = 1;
  18127. this.signIdx = 0;
  18128. this.signMax = 0;
  18129. this.rotaryTime = 0;
  18130. this.rotaryCount = 0;
  18131. this.rotaryList = [];
  18132. this.diyCount = 3;
  18133. this.awardIdx = 0;
  18134. this.shareNum = 2;
  18135. this.rankWeek = 0;
  18136. this.rankScore = 0;
  18137. this.gameCount = 0;
  18138. this.trySkill = -1;
  18139. this.tryTime = 0;
  18140. }
  18141. saveData() {
  18142. let data = {};
  18143. for (let k in this) {
  18144. data[k.toString()] = this[k];
  18145. }
  18146. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18147. }
  18148. getData() {
  18149. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18150. if (ld) {
  18151. let localData = JSON.parse(ld);
  18152. if (localData) {
  18153. for (let k in this) {
  18154. let key = k.toString();
  18155. let data = localData[key];
  18156. if (data != undefined) {
  18157. this[k] = data;
  18158. }
  18159. }
  18160. }
  18161. }
  18162. }
  18163. }
  18164. class Diy2025GameData {
  18165. constructor() {
  18166. this.challengeMode_overLev = 0;
  18167. this.xszyForClassic = false;
  18168. this.xszyForChallenge = false;
  18169. }
  18170. saveData() {
  18171. let data = {};
  18172. for (let k in this) {
  18173. data[k.toString()] = this[k];
  18174. }
  18175. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18176. }
  18177. getData() {
  18178. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18179. if (ld) {
  18180. let localData = JSON.parse(ld);
  18181. if (localData) {
  18182. for (let k in this) {
  18183. let key = k.toString();
  18184. let data = localData[key];
  18185. if (data != undefined) {
  18186. this[k] = data;
  18187. }
  18188. }
  18189. }
  18190. }
  18191. }
  18192. }
  18193. class DataMgr {
  18194. static Init() {
  18195. this.userData = new UserData();
  18196. this.gameData = new GameData();
  18197. this.itemData = new ItemData();
  18198. this.diyGameData = new Diy2025GameData();
  18199. this.userData.getData();
  18200. this.gameData.getData();
  18201. this.itemData.getData();
  18202. this.diyGameData.getData();
  18203. this.roleId = this.userData.roleId;
  18204. this.resetUse();
  18205. }
  18206. static isNewDay() {
  18207. Moyu.isNewDay(this, (isnew) => {
  18208. xGame.common.isNewDay = isnew;
  18209. if (!isnew)
  18210. return;
  18211. DataMgr.setShareDiamondTimes(0, false);
  18212. DataMgr.setDailyVideoShareTimes(0, false);
  18213. DataMgr.setDailyfreeDrawTimes(1);
  18214. DataMgr.setExtraSign(0);
  18215. });
  18216. }
  18217. static deletData() {
  18218. Laya.LocalStorage.clear();
  18219. }
  18220. static upRankData() {
  18221. let num = xGame.common.getAllStarNum();
  18222. if (num > 0)
  18223. Moyu.upRankData(xGame.common.curRankID, num);
  18224. }
  18225. static addItem(id, count = 1) {
  18226. let v = this.itemData.itemList[id];
  18227. if (!v)
  18228. v = { id: id, count: count, adnum: 0, active: true };
  18229. else {
  18230. if (v.active) {
  18231. v.count += count;
  18232. }
  18233. else {
  18234. v.count = count;
  18235. v.active = true;
  18236. }
  18237. }
  18238. this.itemData.itemList[id] = v;
  18239. xGame.soundMgr.playGetSound();
  18240. this.saveItemData();
  18241. }
  18242. static hasItem(id) {
  18243. let v = this.itemData.itemList[id];
  18244. if (v && v.active)
  18245. return true;
  18246. return false;
  18247. }
  18248. static getItem(id) {
  18249. let v = this.itemData.itemList[id];
  18250. return v;
  18251. }
  18252. static getItemCount(id) {
  18253. let v = this.itemData.itemList[id];
  18254. if (v && v.active)
  18255. return v.count;
  18256. return 0;
  18257. }
  18258. static getItemAd(id) {
  18259. let v = this.itemData.itemList[id];
  18260. if (v) {
  18261. return v.adnum;
  18262. }
  18263. return 0;
  18264. }
  18265. static onItemAd(id, num = 1) {
  18266. let v = this.itemData.itemList[id];
  18267. if (!v)
  18268. v = { id: id, count: 1, adnum: num, active: false };
  18269. else
  18270. v.adnum += num;
  18271. this.itemData.itemList[id] = v;
  18272. this.saveItemData();
  18273. }
  18274. static costItem(id, count) {
  18275. let v = this.itemData.itemList[id];
  18276. if (v && v.active) {
  18277. if (v.count < count)
  18278. return false;
  18279. else {
  18280. v.count -= count;
  18281. this.itemData.itemList[id] = v;
  18282. return true;
  18283. }
  18284. }
  18285. return false;
  18286. }
  18287. static resetUse() {
  18288. this.dressId = this.userData.dressId;
  18289. this.itemId = this.userData.itemId;
  18290. }
  18291. static passLevel() {
  18292. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18293. this.gameData.curLevel++;
  18294. this.curLevel = this.gameData.curLevel;
  18295. this.saveGameData();
  18296. }
  18297. static useRole(id) {
  18298. this.roleId = id;
  18299. if (this.hasRole(id)) {
  18300. this.userData.roleId = id;
  18301. this.saveUserData();
  18302. }
  18303. }
  18304. static addRole(id) {
  18305. if (this.hasRole(id))
  18306. return;
  18307. this.userData.roleList.push(id);
  18308. this.saveUserData();
  18309. }
  18310. static hasRole(id) {
  18311. return this.userData.roleList.indexOf(id) >= 0;
  18312. }
  18313. static gemEnough(num) {
  18314. return this.userData.gemNum >= num;
  18315. }
  18316. static roleHasAd(id) {
  18317. let count = this.userData.roleAds[id];
  18318. if (count != undefined && count >= 0)
  18319. return true;
  18320. else
  18321. return false;
  18322. }
  18323. static saveUserData(time = 500, event, arg) {
  18324. if (this.userSaving)
  18325. return;
  18326. this.userSaving = true;
  18327. Laya.timer.once(time, this, () => {
  18328. this.userSaving = false;
  18329. this.userData.saveData();
  18330. if (event)
  18331. xGame.eventMgr.event(event, arg);
  18332. });
  18333. }
  18334. static updateUserNickName(loginUserName) {
  18335. let kyeStr = 'moyudata_180';
  18336. console.log('zh:################### kyeStr=' + kyeStr);
  18337. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18338. if (moyudata) {
  18339. const obj = JSON.parse(moyudata);
  18340. obj.nickName = loginUserName;
  18341. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18342. console.log('zh:################### updateUserNickName');
  18343. }
  18344. }
  18345. static saveGameData() {
  18346. if (this.gameSaving)
  18347. return;
  18348. this.gameSaving = true;
  18349. Laya.timer.once(1000, this, () => {
  18350. this.gameSaving = false;
  18351. this.gameData.saveData();
  18352. });
  18353. }
  18354. static saveItemData() {
  18355. let fun = () => {
  18356. this.itemData.saveData();
  18357. };
  18358. Laya.timer.clear(this, fun);
  18359. Laya.timer.once(500, this, fun);
  18360. }
  18361. static saveData() {
  18362. this.saveUserData();
  18363. this.saveGameData();
  18364. }
  18365. static getBigSkillList() {
  18366. return this.userData.bigSkills;
  18367. }
  18368. static getBigSkillByIndex(index) {
  18369. return this.userData.bigSkills[index];
  18370. }
  18371. static setBigSkill(index, val, addUp = true) {
  18372. if (addUp) {
  18373. this.userData.bigSkills[index] += val;
  18374. }
  18375. else {
  18376. this.userData.bigSkills[index] = val;
  18377. }
  18378. this.saveUserData();
  18379. }
  18380. static coinEnough(need) {
  18381. if (typeof need != "number") {
  18382. console.error("金币格式错误");
  18383. return;
  18384. }
  18385. return this.userData.coin >= need;
  18386. }
  18387. static setCoin(val) {
  18388. if (typeof val != "number") {
  18389. return;
  18390. }
  18391. this.userData.coin += val;
  18392. this.saveUserData();
  18393. xGame.eventMgr.event(COIN_CHANGE);
  18394. this.updateUserInfo2Server("jb");
  18395. }
  18396. static setCoin2(val) {
  18397. if (typeof val != "number") {
  18398. return;
  18399. }
  18400. this.userData.coin = val;
  18401. this.saveUserData();
  18402. xGame.eventMgr.event(COIN_CHANGE);
  18403. }
  18404. static setCoinFormServer(val) {
  18405. if (typeof val != "number") {
  18406. return;
  18407. }
  18408. this.userData.coin = val;
  18409. this.saveUserData();
  18410. xGame.eventMgr.event(COIN_CHANGE);
  18411. }
  18412. static getCoin() {
  18413. return this.userData.coin;
  18414. }
  18415. static diamondEnough(need) {
  18416. if (typeof need != "number") {
  18417. console.error("金币格式错误");
  18418. return;
  18419. }
  18420. return this.userData.diamond >= need;
  18421. }
  18422. static setDiamond(val) {
  18423. if (typeof val != "number") {
  18424. return;
  18425. }
  18426. this.userData.diamond += val;
  18427. this.saveUserData();
  18428. xGame.eventMgr.event(DIAMOND_CHANGE);
  18429. this.updateUserInfo2Server("zs");
  18430. }
  18431. static setDiamond2(val) {
  18432. if (typeof val != "number") {
  18433. return;
  18434. }
  18435. this.userData.diamond = val;
  18436. this.saveUserData();
  18437. xGame.eventMgr.event(DIAMOND_CHANGE);
  18438. }
  18439. static setDiamondFormServer(val) {
  18440. if (typeof val != "number") {
  18441. return;
  18442. }
  18443. this.userData.diamond = val;
  18444. this.saveUserData();
  18445. xGame.eventMgr.event(DIAMOND_CHANGE);
  18446. }
  18447. static getDiamond() {
  18448. return this.userData.diamond;
  18449. }
  18450. static getSkillSuccessTimes() {
  18451. return this.userData.skillSuccessTimes;
  18452. }
  18453. static setSkillSuccessTimes(val, addUp = true) {
  18454. if (addUp)
  18455. this.userData.skillSuccessTimes += val;
  18456. else
  18457. this.userData.skillSuccessTimes = val;
  18458. this.saveUserData();
  18459. }
  18460. static getSkillAccTimes() {
  18461. return this.userData.skillAccTimes;
  18462. }
  18463. static setSkillAccTimes(val) {
  18464. this.userData.skillAccTimes += val;
  18465. this.saveUserData();
  18466. }
  18467. static getSkillGuide() {
  18468. if (!xGame.common.openGuide) {
  18469. return 1;
  18470. }
  18471. return this.userData.skillGuide;
  18472. }
  18473. static setSkillGuide(val) {
  18474. this.userData.skillGuide = val;
  18475. this.saveUserData();
  18476. }
  18477. static getPlaceBallLevelList() {
  18478. return this.userData.placeBallData;
  18479. }
  18480. static setPlaceBallLevelList(objStr) {
  18481. if (objStr) {
  18482. let obj = JSON.parse(objStr);
  18483. this.userData.placeBallData = obj;
  18484. this.saveUserData();
  18485. }
  18486. else {
  18487. this.userData.placeBallData = [];
  18488. this.saveUserData();
  18489. }
  18490. }
  18491. static getPlaceBallLevel(level) {
  18492. let arr = this.userData.placeBallData;
  18493. let index = level - 1;
  18494. let out;
  18495. if (arr[index]) {
  18496. out = arr[index];
  18497. }
  18498. else {
  18499. let max = arr.length;
  18500. if (max == index) {
  18501. out = {
  18502. star: 0,
  18503. play: true,
  18504. isCur: true,
  18505. getAward: false
  18506. };
  18507. }
  18508. else {
  18509. out = {
  18510. star: 0,
  18511. play: false,
  18512. getAward: false
  18513. };
  18514. }
  18515. }
  18516. return out;
  18517. }
  18518. static setPlaceBallLevel(level, star) {
  18519. let arr = this.userData.placeBallData;
  18520. let index = level - 1;
  18521. if (arr[index]) {
  18522. arr[index].star = Math.max(arr[index].star, star);
  18523. }
  18524. else {
  18525. let max = arr.length;
  18526. if (max == index) {
  18527. arr.push({
  18528. star: star,
  18529. play: true,
  18530. getAward: false
  18531. });
  18532. }
  18533. else {
  18534. console.error("关卡存储出错");
  18535. }
  18536. }
  18537. this.saveUserData();
  18538. }
  18539. static setPlaceBallAward(level) {
  18540. let arr = this.userData.placeBallData;
  18541. let index = level - 1;
  18542. if (arr[index]) {
  18543. arr[index].getAward = true;
  18544. }
  18545. this.saveUserData();
  18546. }
  18547. static getShareDiamondTimes() {
  18548. return this.userData.shareDiamondTimes;
  18549. }
  18550. static setShareDiamondTimes(val, addUp = true) {
  18551. if (addUp) {
  18552. this.userData.shareDiamondTimes += val;
  18553. }
  18554. else {
  18555. this.userData.shareDiamondTimes = val;
  18556. }
  18557. this.saveUserData();
  18558. }
  18559. static getDailyVideoShareTimes() {
  18560. return this.userData.dailyVideoShareTimes;
  18561. }
  18562. static setDailyVideoShareTimes(val, addUp = true) {
  18563. if (addUp) {
  18564. this.userData.dailyVideoShareTimes += val;
  18565. }
  18566. else {
  18567. this.userData.dailyVideoShareTimes = val;
  18568. }
  18569. this.saveUserData();
  18570. }
  18571. static getSecretary(index) {
  18572. return this.userData.secretary[index];
  18573. }
  18574. static setSecretary(index, val) {
  18575. this.userData.secretary[index] = val;
  18576. this.saveUserData();
  18577. }
  18578. static getCurSecretary() {
  18579. return this.userData.curSecretary;
  18580. }
  18581. static setCurSecretary(index) {
  18582. this.userData.curSecretary = index;
  18583. this.saveUserData();
  18584. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18585. }
  18586. static getBallRod(index) {
  18587. return this.userData.ballRod[index];
  18588. }
  18589. static setBallRod(index, val) {
  18590. this.userData.ballRod[index] = val;
  18591. this.saveUserData();
  18592. }
  18593. static setBallRodFormServer(haveQiuGanJsonStr) {
  18594. console.log('zh:haveQiuGanJsonStr = ' + haveQiuGanJsonStr);
  18595. if (!haveQiuGanJsonStr) {
  18596. console.log("setBallRodFormServer数据为空或未定义");
  18597. return;
  18598. }
  18599. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18600. const keys = Object.keys(haveQiuGanJsonObj);
  18601. keys.forEach(key => {
  18602. let v = haveQiuGanJsonObj[key];
  18603. let k = parseInt(key);
  18604. let idx = k - 1;
  18605. console.log('zh:开始更新IDX = ' + idx);
  18606. console.log('this.userData.ballRod[idx]===' + this.userData.ballRod[idx]);
  18607. this.userData.ballRod[idx] = v;
  18608. });
  18609. }
  18610. static getCurBallRod() {
  18611. return this.userData.curBallRod;
  18612. }
  18613. static setCurBallRod(index) {
  18614. this.userData.curBallRod = index;
  18615. this.saveUserData();
  18616. }
  18617. static setSignData(val) {
  18618. this.userData.signData = val;
  18619. this.saveUserData();
  18620. }
  18621. static getSignData() {
  18622. return this.userData.signData;
  18623. }
  18624. static setSignTime(val) {
  18625. this.userData.signTime = val;
  18626. this.saveUserData();
  18627. }
  18628. static getSignTime() {
  18629. return this.userData.signTime;
  18630. }
  18631. static getDrawTimes() {
  18632. return this.userData.drawTimes;
  18633. }
  18634. static setDrawTimes(val, addUp = true) {
  18635. if (addUp) {
  18636. this.userData.drawTimes += val;
  18637. }
  18638. else {
  18639. this.userData.drawTimes = val;
  18640. }
  18641. this.saveUserData();
  18642. }
  18643. static getDrawAwardTimes() {
  18644. return this.userData.drawAwardTimes;
  18645. }
  18646. static setDrawAwardTimes(val) {
  18647. this.userData.drawAwardTimes = val;
  18648. this.saveUserData();
  18649. }
  18650. static getDailyfreeDrawTimes() {
  18651. return this.userData.dailyfreeDrawTimes;
  18652. }
  18653. static setDailyfreeDrawTimes(val) {
  18654. this.userData.dailyfreeDrawTimes = val;
  18655. this.saveUserData();
  18656. }
  18657. static setPower(val, addUp = true) {
  18658. if (addUp)
  18659. this.userData.power += val;
  18660. else
  18661. this.userData.power = val;
  18662. if (this.userData.power >= xGame.common.maxPower) {
  18663. this.userData.power = xGame.common.maxPower;
  18664. }
  18665. xGame.eventMgr.event(POWER_CHANGE, val);
  18666. this.saveUserData();
  18667. }
  18668. static getPower() {
  18669. return this.userData.power;
  18670. }
  18671. static setPowerTime(val) {
  18672. this.userData.powerTime = val;
  18673. this.saveUserData();
  18674. }
  18675. static getPowerTime() {
  18676. return this.userData.powerTime;
  18677. }
  18678. static powerEnough() {
  18679. return this.getPower() > 0;
  18680. }
  18681. static getChallengeTimes() {
  18682. return this.userData.challengeTimes;
  18683. }
  18684. static setChallengeTimes(val) {
  18685. this.userData.challengeTimes += val;
  18686. this.saveUserData();
  18687. }
  18688. static getExtraSign() {
  18689. return this.userData.extraSign;
  18690. }
  18691. static setExtraSign(val) {
  18692. this.userData.extraSign = val;
  18693. this.saveUserData();
  18694. }
  18695. static getClassicTimes() {
  18696. return this.userData.classicTimes;
  18697. }
  18698. static setClassicTimes() {
  18699. this.userData.classicTimes += 1;
  18700. this.saveUserData();
  18701. }
  18702. static getGuideHelpLine() {
  18703. return this.userData.guideHelpLine;
  18704. }
  18705. static setGuideHelpLine() {
  18706. this.userData.guideHelpLine = 1;
  18707. this.saveUserData();
  18708. }
  18709. static getNewUser() {
  18710. return this.userData.newUser;
  18711. }
  18712. static setNewUser() {
  18713. this.userData.newUser = false;
  18714. this.saveUserData();
  18715. }
  18716. static getRootBallFoul() {
  18717. return this.userData.rootBallFoul;
  18718. }
  18719. static setRootBallFoul() {
  18720. this.userData.rootBallFoul = 1;
  18721. this.saveUserData();
  18722. }
  18723. static getTimeoutFoul() {
  18724. return this.userData.timeoutFoul;
  18725. }
  18726. static setTimeoutFoul() {
  18727. this.userData.timeoutFoul = 1;
  18728. this.saveUserData();
  18729. }
  18730. static saveDiyGameData() {
  18731. if (this.diyGameSaving)
  18732. return;
  18733. this.diyGameSaving = true;
  18734. Laya.timer.once(500, this, () => {
  18735. this.diyGameSaving = false;
  18736. this.diyGameData.saveData();
  18737. });
  18738. }
  18739. static getChallengeMode_overLev() {
  18740. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18741. return this.challengeMode_overLev;
  18742. }
  18743. static setChallengeMode_overLev(levNum) {
  18744. this.diyGameData.challengeMode_overLev = levNum;
  18745. this.saveDiyGameData();
  18746. }
  18747. static updateUserInfo2Server(type, count = 0) {
  18748. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18749. if (userInfoData == null) {
  18750. return;
  18751. }
  18752. let reqData = xGame.httpMgr.getReqData();
  18753. let rd = JSON.parse(reqData);
  18754. rd.dataType = type;
  18755. let dataValue = 0;
  18756. if (type == "zs") {
  18757. dataValue = this.getDiamond();
  18758. }
  18759. if (type == "jb") {
  18760. dataValue = this.getCoin();
  18761. }
  18762. rd.dataValue = dataValue;
  18763. reqData = JSON.stringify(rd);
  18764. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18765. try {
  18766. let code = res.code;
  18767. let data = res.data;
  18768. if (code == 401) {
  18769. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18770. console.log('zh:保存资产信息失败,请重新登录 ');
  18771. return;
  18772. }
  18773. if (code == 200) {
  18774. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18775. }
  18776. else {
  18777. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18778. }
  18779. }
  18780. catch (error) {
  18781. console.log('error=' + error);
  18782. alert("Please check your network connection.");
  18783. }
  18784. finally {
  18785. }
  18786. });
  18787. }
  18788. static getUserZiChanInfo() {
  18789. console.log('zh:开始获取用户资产信息');
  18790. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18791. if (userInfoData == null) {
  18792. return;
  18793. }
  18794. let reqData = xGame.httpMgr.getReqData();
  18795. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18796. try {
  18797. console.log('zh:buySp res = ' + JSON.stringify(res));
  18798. let code = res.code;
  18799. let msg = res.msg;
  18800. if (code == 401) {
  18801. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  18802. alert(TIP_MSG_key.pleaseLoginIn);
  18803. return;
  18804. }
  18805. if (code == 200) {
  18806. let d = res.data;
  18807. let zuanShi = d.zuanShi;
  18808. let jinBi = d.jinBi;
  18809. let haveQiuGanJson = d.haveQiuGanJson;
  18810. let signData = d.signData;
  18811. let placeBallData = d.placeBallData;
  18812. DataMgr.setDiamondFormServer(zuanShi);
  18813. DataMgr.setCoinFormServer(jinBi);
  18814. console.log('zh:更新球杆信息');
  18815. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18816. console.log('zh:更新关卡信息');
  18817. DataMgr.setPlaceBallLevelList(placeBallData);
  18818. if (signData && signData > 0) {
  18819. DataMgr.setSignData(signData);
  18820. }
  18821. }
  18822. else {
  18823. alert(msg);
  18824. }
  18825. }
  18826. catch (error) {
  18827. console.log('error=' + error);
  18828. alert(error);
  18829. }
  18830. finally {
  18831. }
  18832. });
  18833. }
  18834. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18835. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18836. console.log('zh:updateLocalUserData=' + userInfo);
  18837. if (userInfo != null) {
  18838. if (!userInfo.buySpids) {
  18839. userInfo.buySpids = { 1: false, 7: false };
  18840. }
  18841. else {
  18842. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18843. }
  18844. userInfo.buySpids[spid] = isBuyOk;
  18845. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18846. }
  18847. else {
  18848. }
  18849. }
  18850. }
  18851. DataMgr.isNewUser = false;
  18852. DataMgr.fristEnter = true;
  18853. DataMgr.levelType = 0;
  18854. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18855. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18856. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18857. DataMgr.challengeMode_overLev = 0;
  18858. DataMgr.xszyForClassic = false;
  18859. DataMgr.xszyForChallenge = false;
  18860. DataMgr.awardId = 0;
  18861. DataMgr.awardCoin = 0;
  18862. DataMgr.sceneId = -1;
  18863. DataMgr.tryId = 0;
  18864. DataMgr.curLevel = 1;
  18865. DataMgr.vipLevel = 0;
  18866. DataMgr.maxLevel = 0;
  18867. DataMgr.awardRatio = 1;
  18868. DataMgr.gameList = [];
  18869. DataMgr.rankList = [];
  18870. DataMgr.recoverTime = 480000;
  18871. DataMgr.minScore = 0;
  18872. DataMgr.rankDis = 0;
  18873. DataMgr.userSaving = false;
  18874. DataMgr.gameSaving = false;
  18875. DataMgr.diyGameSaving = false;
  18876. class D3Tween extends Laya.Script3D {
  18877. constructor() {
  18878. super();
  18879. this.isInited = false;
  18880. }
  18881. ;
  18882. init() {
  18883. if (this.isInited)
  18884. return;
  18885. this.isInited = true;
  18886. this.gameObj = this.owner;
  18887. this.transform = this.gameObj.transform;
  18888. }
  18889. get rotX() {
  18890. return this.transform.localRotationEulerX;
  18891. }
  18892. set rotX(v) {
  18893. this.transform.localRotationEulerX = v;
  18894. }
  18895. get rotY() {
  18896. return this.transform.localRotationEulerY;
  18897. }
  18898. set rotY(v) {
  18899. this.transform.localRotationEulerY = v;
  18900. }
  18901. get rotZ() {
  18902. return this.transform.localRotationEulerZ;
  18903. }
  18904. set rotZ(v) {
  18905. this.transform.localRotationEulerZ = v;
  18906. }
  18907. get posX() {
  18908. return this.transform.localPositionX;
  18909. }
  18910. set posX(v) {
  18911. this.transform.localPositionX = v;
  18912. }
  18913. get posY() {
  18914. return this.transform.localPositionY;
  18915. }
  18916. set posY(v) {
  18917. this.transform.localPositionY = v;
  18918. }
  18919. get posZ() {
  18920. return this.transform.localPositionZ;
  18921. }
  18922. set posZ(v) {
  18923. this.transform.localPositionZ = v;
  18924. }
  18925. get rotation() {
  18926. return this.transform.localRotation;
  18927. }
  18928. set rotation(v) {
  18929. this.transform.localRotation = v;
  18930. }
  18931. }
  18932. class D2Hole extends Laya.Script {
  18933. constructor() { super(); }
  18934. onTriggerEnter(collider) {
  18935. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  18936. return;
  18937. }
  18938. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  18939. if (collider.owner["mySrc"].isRunSkillAni) {
  18940. return;
  18941. }
  18942. if (collider.owner["mySrc"].number != 0) {
  18943. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  18944. }
  18945. xGame.common.ballColliHole(collider);
  18946. xGame.common.recoverCameraView();
  18947. }
  18948. }
  18949. }
  18950. class Table extends Laya.Script3D {
  18951. constructor() {
  18952. super();
  18953. this.isSetBorder = false;
  18954. this.inited = false;
  18955. }
  18956. ;
  18957. onAwake() {
  18958. this.init();
  18959. }
  18960. init() {
  18961. if (this.inited)
  18962. return;
  18963. this.inited = true;
  18964. this.gameObj = this.owner;
  18965. this.border = this.gameObj.getChildByName("border");
  18966. }
  18967. setBorderPos() {
  18968. if (this.isSetBorder)
  18969. return;
  18970. this.isSetBorder = true;
  18971. let ui = xGame.common.gameUI.ui;
  18972. let bar1 = this.border.getChildByName("bar1");
  18973. let bar2 = this.border.getChildByName("bar2");
  18974. let bar3 = this.border.getChildByName("bar3");
  18975. let bar4 = this.border.getChildByName("bar4");
  18976. let bar5 = this.border.getChildByName("bar5");
  18977. let bar6 = this.border.getChildByName("bar6");
  18978. this.setInfo(bar1, ui.border.bar1, "box");
  18979. this.setInfo(bar2, ui.border.bar2, "box");
  18980. this.setInfo(bar3, ui.border.bar3, "box");
  18981. this.setInfo(bar4, ui.border.bar4, "box");
  18982. this.setInfo(bar5, ui.border.bar5, "box");
  18983. this.setInfo(bar6, ui.border.bar6, "box");
  18984. let circle1 = this.border.getChildByName("circle1");
  18985. let circle2 = this.border.getChildByName("circle2");
  18986. let circle3 = this.border.getChildByName("circle3");
  18987. let circle4 = this.border.getChildByName("circle4");
  18988. let circle5 = this.border.getChildByName("circle5");
  18989. let circle6 = this.border.getChildByName("circle6");
  18990. this.setInfo(circle1, ui.border.circle1, "circle");
  18991. this.setInfo(circle2, ui.border.circle2, "circle");
  18992. this.setInfo(circle3, ui.border.circle3, "circle");
  18993. this.setInfo(circle4, ui.border.circle4, "circle");
  18994. this.setInfo(circle5, ui.border.circle5, "circle");
  18995. this.setInfo(circle6, ui.border.circle6, "circle");
  18996. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  18997. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  18998. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  18999. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19000. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19001. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19002. let arr = xGame.common.gameMgr.holePosList;
  19003. xGame.common.gameMgr.posObj = {
  19004. "1": arr[0],
  19005. "3": arr[2],
  19006. "4": arr[3],
  19007. "6": arr[5]
  19008. };
  19009. }
  19010. initHolePos(x, y) {
  19011. if (x < 300)
  19012. x += 25;
  19013. else if (x > 1000)
  19014. x -= 25;
  19015. else if (y > 200)
  19016. y -= 10;
  19017. else
  19018. y += 10;
  19019. if (y < 200)
  19020. y += 30;
  19021. else if (y > 500)
  19022. y -= 30;
  19023. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19024. }
  19025. setInfo(d3Obj, d2Obj, type) {
  19026. let ui = xGame.common.gameUI.ui;
  19027. let sprite = new Laya.Sprite();
  19028. ui.border.displayObject.addChild(sprite);
  19029. let colli = xGame.common.getCollider(type);
  19030. sprite.addComponentIntance(colli);
  19031. let rigy = xGame.common.getRigbody();
  19032. rigy.type = "static";
  19033. sprite.addComponentIntance(rigy);
  19034. let d3Pos = d3Obj.transform.position;
  19035. xGame.common.pos3to2Convert(d3Pos);
  19036. let scaleX = d3Obj.transform.localScaleX;
  19037. let scaleZ = d3Obj.transform.localScaleZ;
  19038. let width = xGame.common.scale3to2Convert(scaleZ);
  19039. let height = xGame.common.scale3to2Convert(scaleX);
  19040. sprite.pivotX = width / 2;
  19041. sprite.pivotY = height / 2;
  19042. sprite.x = d3Pos.x;
  19043. sprite.y = d3Pos.y;
  19044. sprite.width = width;
  19045. sprite.height = height;
  19046. d2Obj.x = d3Pos.x;
  19047. d2Obj.y = d3Pos.y;
  19048. d2Obj.width = width;
  19049. d2Obj.height = height;
  19050. if (type == "box") {
  19051. colli.width = width;
  19052. colli.height = height;
  19053. colli.isSensor = false;
  19054. colli.label = "border";
  19055. }
  19056. else {
  19057. colli.radius = width / 2;
  19058. colli.isSensor = true;
  19059. colli.label = "hole";
  19060. sprite.addComponent(D2Hole);
  19061. }
  19062. }
  19063. }
  19064. class D3World extends Laya.Script3D {
  19065. constructor() {
  19066. super();
  19067. this.loadNum = 0;
  19068. this.setLoadNum = 7;
  19069. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19070. }
  19071. onAwake() {
  19072. }
  19073. loadScene() {
  19074. this.scene = this.owner;
  19075. let url = `res/unityRes/root.lh`;
  19076. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19077. this.scene.addChild(prefab);
  19078. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19079. this.putCameraInfo();
  19080. this.camera.enableHDR = false;
  19081. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19082. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19083. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19084. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19085. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19086. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19087. this.knife.active = false;
  19088. this.loadD3Obj();
  19089. }));
  19090. }
  19091. putCameraInfo() {
  19092. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19093. this.cameraObj = new cameraType();
  19094. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19095. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19096. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19097. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19098. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19099. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19100. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19101. this.visitAngleChild.init();
  19102. this.visitRootObj.posX = this.visitAngleChild.posX;
  19103. this.visitRootObj.posY = this.visitAngleChild.posY;
  19104. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19105. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19106. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19107. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19108. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19109. xGame.common.showOneCamera("mainCamera");
  19110. }
  19111. loadD3Obj() {
  19112. this.loadTable();
  19113. this.loadRoom();
  19114. this.loadInHoleParticial();
  19115. this.loadIceParticial();
  19116. this.loadHitParticial();
  19117. this.loadFireworksParticial();
  19118. this.loadBall();
  19119. }
  19120. loadInHoleParticial() {
  19121. this.loadD3Res("inHoleEft", "", (prefab) => {
  19122. prefab.addComponent(Partical);
  19123. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19124. });
  19125. }
  19126. loadIceParticial() {
  19127. this.loadD3Res("iceEft", "", (prefab) => {
  19128. prefab.addComponent(Partical);
  19129. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19130. });
  19131. }
  19132. loadHitParticial() {
  19133. this.loadD3Res("hitEft", "", (prefab) => {
  19134. prefab.addComponent(Partical);
  19135. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19136. });
  19137. }
  19138. loadFireworksParticial() {
  19139. this.loadD3Res("fireworksEft", "", (prefab) => {
  19140. prefab.addComponent(Partical);
  19141. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19142. });
  19143. }
  19144. loadBall(index = 1) {
  19145. this.loadD3Res("ball", index, (prefab) => {
  19146. this.ballPrefab = prefab;
  19147. this.ballPrefab.addComponent(Ball);
  19148. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19149. });
  19150. }
  19151. loadTable(index = 1) {
  19152. this.loadD3Res("table", index, (prefab) => {
  19153. this.tableSrc = prefab.addComponent(Table);
  19154. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19155. this.d3Hand.init();
  19156. this.tableRoot.addChild(prefab);
  19157. });
  19158. }
  19159. loadRoom(index = 1) {
  19160. this.loadD3Res("room", index, (prefab) => {
  19161. this.roomRoot.addChild(prefab);
  19162. });
  19163. }
  19164. loadD3Res(type, index, callback) {
  19165. let url = `res/unityRes/${type}${index}.lh`;
  19166. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19167. callback && callback(prefab);
  19168. this.checkResLoad();
  19169. }));
  19170. }
  19171. checkResLoad() {
  19172. this.loadNum++;
  19173. if (this.loadNum >= this.setLoadNum) {
  19174. xGame.eventMgr.event(D3RES_LOADED);
  19175. }
  19176. }
  19177. prePlayEft() {
  19178. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19179. eft.transform.localPositionX = 0;
  19180. eft.transform.localPositionY = -5;
  19181. eft.transform.localPositionZ = 0;
  19182. eft.active = true;
  19183. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19184. ice.transform.localPositionX = 0;
  19185. ice.transform.localPositionY = -5;
  19186. ice.transform.localPositionZ = 0;
  19187. ice.active = true;
  19188. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19189. hit.transform.localPositionX = 0;
  19190. hit.transform.localPositionY = -5;
  19191. hit.transform.localPositionZ = 0;
  19192. hit.active = true;
  19193. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19194. fireworks.transform.localPositionX = 0;
  19195. fireworks.transform.localPositionY = -5;
  19196. fireworks.transform.localPositionZ = 0;
  19197. fireworks.active = true;
  19198. }
  19199. }
  19200. class cameraType {
  19201. }
  19202. class MoyuMgr$1 {
  19203. static initMoyu() {
  19204. this.moyuView = new MoyuView$1();
  19205. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19206. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19207. this.moyuView.ui.displayObject.zOrder = 1000;
  19208. this.moyuView.init();
  19209. this.moyuView.showTip(true);
  19210. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19211. window['XApk'] = this;
  19212. }
  19213. static showAge(show) {
  19214. if (this.moyuView)
  19215. this.moyuView.showAge(show);
  19216. }
  19217. static onPlatMsg(idx) {
  19218. if (!MoyuMgr$1.moyuView)
  19219. return;
  19220. if (idx == '0') {
  19221. MoyuMgr$1.moyuView.showTip(false);
  19222. }
  19223. }
  19224. static showAgree(call) {
  19225. if (this.moyuView)
  19226. this.moyuView.showAgree(call);
  19227. else
  19228. call && call();
  19229. }
  19230. static showXy(type = 1) {
  19231. if (this.moyuView)
  19232. this.moyuView.showXy(type);
  19233. }
  19234. }
  19235. MoyuMgr$1.isAdvise = false;
  19236. class MoyuView$1 {
  19237. constructor() {
  19238. this.ysxyNum = 1;
  19239. this.ysJson = null;
  19240. this.ui = ui_UIMoyu.createInstance();
  19241. }
  19242. init() {
  19243. this.ui.mainBg.visible = false;
  19244. this.ui.xyNode.visible = false;
  19245. this.ui.ageNode.visible = false;
  19246. this.ui.tipNode.visible = false;
  19247. this.ui.rnNode.visible = false;
  19248. this.ui.fcmNode.visible = false;
  19249. this.ui.ageTip.visible = false;
  19250. this.ui.msgNode.visible = false;
  19251. this.ui.visible = false;
  19252. this.ui.xyNode.xyList.setVirtual();
  19253. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19254. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19255. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19256. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19257. this.ui.xyNode.btnKnown.visible = false;
  19258. this.ui.xyNode.xy1.visible = false;
  19259. this.ui.xyNode.xy2.visible = false;
  19260. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19261. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19262. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19263. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19264. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19265. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19266. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19267. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19268. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19269. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19270. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19271. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19272. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19273. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19274. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19275. this.ysxyNum = 2;
  19276. }
  19277. }
  19278. onClick(obj) {
  19279. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19280. switch (obj) {
  19281. case this.ui.ageTip:
  19282. if (Moyu.isTTApk) {
  19283. this.ui.ageNode.visible = true;
  19284. this.ui.mainBg.visible = true;
  19285. }
  19286. break;
  19287. case this.ui.tipNode:
  19288. this.showTip(false);
  19289. break;
  19290. case this.ui.ageNode.btnAge:
  19291. this.ui.ageNode.visible = false;
  19292. this.ui.mainBg.visible = false;
  19293. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19294. this.ui.visible = false;
  19295. break;
  19296. case this.ui.xyNode.btnXy3:
  19297. case this.ui.xyNode.btnXy1:
  19298. this.loadXy(1);
  19299. break;
  19300. case this.ui.xyNode.btnXy2:
  19301. this.loadXy(2);
  19302. break;
  19303. case this.ui.xyNode.btnBack:
  19304. this.ui.xyNode.xy1.visible = true;
  19305. this.ui.xyNode.xy2.visible = false;
  19306. break;
  19307. case this.ui.xyNode.btnKnown:
  19308. this.ui.xyNode.visible = false;
  19309. this.ui.mainBg.visible = false;
  19310. this.ui.visible = false;
  19311. break;
  19312. case this.ui.rnNode.btnCheck:
  19313. this.check();
  19314. break;
  19315. case this.ui.rnNode.btnExit:
  19316. case this.ui.xyNode.btnNo:
  19317. this.ysxyNum--;
  19318. if (this.ysxyNum > 0)
  19319. this.showMsg("Refuse to quit the game once again");
  19320. else {
  19321. Moyu.userAgree(false);
  19322. Moyu.exit();
  19323. }
  19324. break;
  19325. case this.ui.xyNode.btnSure:
  19326. case this.ui.xyNode.btnYes:
  19327. DataMgr.userData.isAgree = true;
  19328. DataMgr.saveUserData();
  19329. this.onAgree();
  19330. break;
  19331. case this.ui.rnNode.btnDone:
  19332. this.ui.rnNode.visible = false;
  19333. this.ui.visible = false;
  19334. break;
  19335. case this.ui.fcmNode.btnRn:
  19336. this.showRn();
  19337. break;
  19338. }
  19339. }
  19340. showTip(show) {
  19341. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19342. return;
  19343. if (show) {
  19344. MoyuMgr$1.isAdvise = true;
  19345. this.ui.visible = true;
  19346. this.ui.tipNode.visible = true;
  19347. this.ui.tipNode.alpha = 1;
  19348. Laya.timer.once(1000, this, this.showTip, [false]);
  19349. }
  19350. else {
  19351. this.ui.tipNode.alpha = 1;
  19352. this.ui.tipNode.visible = true;
  19353. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19354. this.ui.tipNode.visible = false;
  19355. MoyuMgr$1.isAdvise = false;
  19356. }), 1000);
  19357. }
  19358. }
  19359. showAge(show, px = 0, py = 0) {
  19360. if (Moyu.platType > 10 && !Moyu.isIos) {
  19361. this.ui.ageTip.x = px;
  19362. this.ui.ageTip.y = py;
  19363. this.ui.ageTip.visible = show;
  19364. if (show)
  19365. this.ui.visible = true;
  19366. }
  19367. }
  19368. showAgree(call) {
  19369. this.agreeCall = call;
  19370. this.onAgree();
  19371. return;
  19372. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19373. this.showXy(0);
  19374. }
  19375. else
  19376. this.onAgree();
  19377. }
  19378. onAgree() {
  19379. if (!this.ui.ageNode.visible)
  19380. this.ui.visible = false;
  19381. this.ui.xyNode.visible = false;
  19382. Moyu.userAgree(true);
  19383. this.showAge(false);
  19384. this.agreeCall && this.agreeCall();
  19385. this.showRn();
  19386. }
  19387. showMsg(txt) {
  19388. this.ui.msgNode.txtMsg.text = txt;
  19389. this.ui.msgNode.visible = true;
  19390. this.ui.msgNode.alpha = 1;
  19391. this.ui.visible = true;
  19392. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19393. this.ui.msgNode.visible = false;
  19394. }), 2500, true);
  19395. }
  19396. showRn() {
  19397. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19398. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19399. this.ui.rnNode.rn1.visible = true;
  19400. this.ui.rnNode.rn2.visible = false;
  19401. this.ui.rnNode.rn3.visible = false;
  19402. this.ui.rnNode.rn4.visible = false;
  19403. this.ui.rnNode.visible = true;
  19404. this.ui.mainBg.visible = true;
  19405. this.ui.rnNode.btnDone.visible = false;
  19406. this.ui.rnNode.btnExit.visible = true;
  19407. this.ui.rnNode.btnCheck.visible = true;
  19408. this.ui.fcmNode.visible = false;
  19409. this.ui.visible = true;
  19410. return;
  19411. }
  19412. }
  19413. this.showFcm();
  19414. }
  19415. showFcm() {
  19416. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19417. Moyu.initFCM(true);
  19418. if (Moyu.gameTime < 1)
  19419. this.fcmLoop();
  19420. else if (Moyu.gameTime < 999)
  19421. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19422. }
  19423. }
  19424. fcmLoop() {
  19425. if (Moyu.gameTime < 1) {
  19426. this.ui.rnNode.visible = false;
  19427. this.ui.fcmNode.visible = true;
  19428. this.ui.mainBg.visible = true;
  19429. this.ui.visible = true;
  19430. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19431. Laya.timer.clear(this.ui, this.fcmLoop);
  19432. }
  19433. }
  19434. check() {
  19435. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19436. this.ui.rnNode.rn1.visible = false;
  19437. this.ui.rnNode.rn2.visible = false;
  19438. this.ui.rnNode.rn4.visible = true;
  19439. }
  19440. else if (this.ui.rnNode.rn4.visible) {
  19441. let name = this.ui.rnNode.inputName.text;
  19442. let code = this.ui.rnNode.inputCode.text;
  19443. if (code && code.length == 18) {
  19444. this.ui.rnNode.rn1.visible = false;
  19445. this.ui.rnNode.rn4.visible = false;
  19446. Moyu.authenticate(name, code, (res) => {
  19447. this.ui.rnNode.rn2.visible = !res;
  19448. this.ui.rnNode.rn3.visible = res;
  19449. this.ui.rnNode.btnDone.visible = res;
  19450. this.ui.rnNode.btnExit.visible = !res;
  19451. this.ui.rnNode.btnCheck.visible = !res;
  19452. if (res)
  19453. this.showFcm();
  19454. });
  19455. }
  19456. else
  19457. this.showMsg("信息填写不完整");
  19458. }
  19459. }
  19460. loadXy(type = 0) {
  19461. this.ui.xyNode.xy1.visible = false;
  19462. this.ui.xyNode.xy2.visible = true;
  19463. this.ui.xyNode.xyList.scrollToView(0);
  19464. if (type == 1) {
  19465. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19466. }
  19467. else if (type == 2) {
  19468. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19469. }
  19470. }
  19471. showXy(type = 0) {
  19472. this.xyBtn();
  19473. if (type == 0) {
  19474. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19475. this.ui.xyNode.btnSure.visible = true;
  19476. }
  19477. else {
  19478. this.ui.xyNode.btnYes.visible = true;
  19479. this.ui.xyNode.btnNo.visible = true;
  19480. }
  19481. }
  19482. else {
  19483. this.ui.xyNode.btnKnown.visible = true;
  19484. this.ui.mainBg.visible = true;
  19485. }
  19486. this.ui.xyNode.xy1.visible = true;
  19487. this.ui.xyNode.xy2.visible = false;
  19488. this.ui.xyNode.visible = true;
  19489. this.ui.visible = true;
  19490. }
  19491. xyBtn() {
  19492. this.ui.xyNode.btnSure.visible = false;
  19493. this.ui.xyNode.btnYes.visible = false;
  19494. this.ui.xyNode.btnNo.visible = false;
  19495. this.ui.xyNode.btnKnown.visible = false;
  19496. {
  19497. this.ui.xyNode.btnXy3.visible = false;
  19498. this.ui.xyNode.btnXy2.visible = true;
  19499. this.ui.xyNode.btnXy1.visible = true;
  19500. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19501. }
  19502. }
  19503. createXY(json) {
  19504. this.ysJson = json.content;
  19505. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19506. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19507. this.ui.xyNode.xy2.visible = true;
  19508. }
  19509. renderListItem(idx, cell) {
  19510. let xy = this.ysJson[idx];
  19511. cell.height = xy.line * 30;
  19512. cell.xyItem.text = xy.text;
  19513. }
  19514. onDestroy() {
  19515. this.agreeCall = null;
  19516. }
  19517. }
  19518. class UILoading extends UIBase {
  19519. constructor() {
  19520. super();
  19521. this.accTime = 0;
  19522. this.curNum = 0;
  19523. this.rate = 1;
  19524. this.loadSubOk = false;
  19525. this.loadResOK = false;
  19526. this.openLoading = true;
  19527. this.beginLoadRes = false;
  19528. this.finishD2 = false;
  19529. this.finishD3 = false;
  19530. }
  19531. onConstructor() {
  19532. this.ui = ui_UILoading.createInstance();
  19533. this.contentPane = this.ui;
  19534. this.isEject = false;
  19535. this._initUI();
  19536. this._addEvent();
  19537. }
  19538. _initUI() {
  19539. MoyuMgr$1.initMoyu();
  19540. }
  19541. _addEvent() {
  19542. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19543. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19544. }
  19545. show() {
  19546. super.show();
  19547. console.log('zh:加载分包资源');
  19548. loadSubRes(this.subResProgress.bind(this));
  19549. this.ui.txtLoad.text = "Loading...";
  19550. }
  19551. subResProgress(pro, finish) {
  19552. this.curNum = pro;
  19553. if (finish) {
  19554. this.curNum = 1;
  19555. this.loadSubOk = true;
  19556. }
  19557. }
  19558. laodD3Res() {
  19559. let scene3D = new Laya.Scene3D();
  19560. xGame.common.d3Scene = scene3D;
  19561. xGame.common.d3World = scene3D.addComponent(D3World);
  19562. xGame.common.d3World.loadScene();
  19563. }
  19564. loadD2Res() {
  19565. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19566. this.finishD2 = true;
  19567. this.checkLoadAll();
  19568. this.curNum = 1;
  19569. }), Laya.Handler.create(this, (pro) => {
  19570. this.curNum = pro;
  19571. }, null, false));
  19572. }
  19573. d3ResFinish() {
  19574. this.finishD3 = true;
  19575. this.checkLoadAll();
  19576. }
  19577. checkLoadAll() {
  19578. if (this.finishD2 && this.finishD3) {
  19579. this.loadResOK = true;
  19580. }
  19581. }
  19582. loadRes() {
  19583. this.laodD3Res();
  19584. this.loadD2Res();
  19585. }
  19586. myUpdate(dt) {
  19587. if (!this.openLoading)
  19588. return;
  19589. this.accTime += dt * this.rate;
  19590. if (this.accTime >= this.curNum)
  19591. this.accTime = this.curNum;
  19592. this.ui.loadinfo.value = this.accTime * 100;
  19593. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19594. if (!this.beginLoadRes) {
  19595. this.beginLoadRes = true;
  19596. this.ui.txtLoad.text = "Loading...";
  19597. this.curNum = 0;
  19598. this.accTime = 0;
  19599. this.loadRes();
  19600. }
  19601. if (this.loadResOK) {
  19602. this.openLoading = false;
  19603. Laya.timer.once(300, this, () => {
  19604. xGame.common.d3Scene.active = false;
  19605. MoyuMgr$1.showAgree(enterGame);
  19606. });
  19607. }
  19608. }
  19609. }
  19610. release() {
  19611. }
  19612. hide() {
  19613. super.hide();
  19614. this.release();
  19615. }
  19616. onClose() {
  19617. this.hide();
  19618. }
  19619. }
  19620. UILoading.uiName = "UILoading";
  19621. class UIRepentProp$1 extends UIBase {
  19622. constructor() {
  19623. super();
  19624. this.viewType = 0;
  19625. this.regretType = 0;
  19626. }
  19627. onConstructor() {
  19628. this.ui = ui_UIRepentProp.createInstance();
  19629. this.contentPane = this.ui;
  19630. this.isEject = false;
  19631. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19632. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19633. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19634. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19635. }
  19636. show(viewType, regretType, callback) {
  19637. PlatMgr.showInsert(true);
  19638. this.viewType = viewType;
  19639. this.regretType = regretType;
  19640. this.callback = callback;
  19641. super.show();
  19642. this.ui.t0.play();
  19643. this.ui.c1.selectedIndex = this.viewType;
  19644. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19645. if (this.viewType == 0) {
  19646. let guide = DataMgr.getGuideHelpLine();
  19647. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19648. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19649. }
  19650. xGame.common.gameMgr.gamePause = true;
  19651. }
  19652. hideSelf() {
  19653. xGame.common.gameMgr.gamePause = false;
  19654. this.callback && this.callback(false);
  19655. this.hide();
  19656. }
  19657. videoRegret() {
  19658. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19659. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19660. }
  19661. else {
  19662. console.log('zh:AD 失败,直接发放奖励');
  19663. this.qjff_AD_for_UIrepentProp_videoRegret();
  19664. }
  19665. }
  19666. qjff_AD_for_UIrepentProp_videoRegret() {
  19667. this.callback && this.callback(true);
  19668. this.hideSelf();
  19669. }
  19670. videoAddHelpLine() {
  19671. let guide = DataMgr.getGuideHelpLine();
  19672. if (guide == 0) {
  19673. this.callback && this.callback(true);
  19674. this.hideSelf();
  19675. DataMgr.setGuideHelpLine();
  19676. xGame.common.gameUI.ui.guideNode.visible = false;
  19677. }
  19678. else {
  19679. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19680. if (Laya.Browser.onAndroid) {
  19681. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19682. if (!boo) {
  19683. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19684. return;
  19685. }
  19686. }
  19687. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19688. }
  19689. else {
  19690. console.log('zh:AD 失败,直接发放奖励');
  19691. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19692. }
  19693. }
  19694. }
  19695. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19696. this.callback && this.callback(true);
  19697. this.hideSelf();
  19698. }
  19699. }
  19700. UIRepentProp$1.uiName = "UIRepentProp";
  19701. class UIRodMethod$1 extends UIBase {
  19702. constructor() {
  19703. super();
  19704. this.isPressd = false;
  19705. }
  19706. onConstructor() {
  19707. this.ui = ui_UIRodMethod.createInstance();
  19708. this.contentPane = this.ui;
  19709. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19710. this.moveDir = new Laya.Vector2();
  19711. this.moveDest = new Laya.Vector2();
  19712. this.centerPos = new Laya.Vector2();
  19713. xGame.common.uiRodMethod = this;
  19714. }
  19715. show() {
  19716. super.show();
  19717. xGame.common.gameMgr.gamePause = true;
  19718. this.openPressDotEvent();
  19719. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19720. this.centerPos.x = this.ui.white.x;
  19721. this.centerPos.y = this.ui.white.y;
  19722. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19723. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19724. this.setDot();
  19725. }
  19726. setDot() {
  19727. this.ui.dot.x = this.moveDest.x;
  19728. this.ui.dot.y = this.moveDest.y;
  19729. }
  19730. closeSelf() {
  19731. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19732. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19733. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19734. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19735. xGame.common.gameMgr.gamePause = false;
  19736. this.hide();
  19737. }
  19738. openPressDotEvent() {
  19739. this.closePressDotEvent();
  19740. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19741. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19742. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19743. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19744. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19745. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19746. }
  19747. closePressDotEvent() {
  19748. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19749. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19750. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19751. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19752. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19753. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19754. }
  19755. onDown(e) {
  19756. if (e.type == Laya.Event.MOUSE_DOWN)
  19757. this.isPressd = true;
  19758. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19759. this.isPressd = false;
  19760. if (!this.isPressd)
  19761. return;
  19762. this.moveDest.x = e.stageX;
  19763. this.moveDest.y = e.stageY;
  19764. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19765. if (dis > 6724) {
  19766. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19767. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19768. }
  19769. this.setDot();
  19770. }
  19771. resetRod() {
  19772. this.ui.dot.x = this.ui.white.x;
  19773. this.ui.dot.y = this.ui.white.y;
  19774. this.gameRod.dot.x = this.gameRod.bg.x;
  19775. this.gameRod.dot.y = this.gameRod.bg.y;
  19776. xGame.common.rodOffest.x = 0;
  19777. xGame.common.rodOffest.y = 0;
  19778. }
  19779. }
  19780. UIRodMethod$1.uiName = "UIRodMethod";
  19781. class UIMsg$1 extends UIBase {
  19782. constructor() {
  19783. super();
  19784. }
  19785. onConstructor() {
  19786. this.ui = ui_UIMsg.createInstance();
  19787. this.contentPane = this.ui;
  19788. this.isEject = false;
  19789. this.isMuti = true;
  19790. }
  19791. show(msg, callback) {
  19792. super.show();
  19793. this.ui.tipsNode.msgTxt.text = msg;
  19794. this.ui.alpha = 1;
  19795. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19796. this.hide();
  19797. callback && callback();
  19798. }), 1000);
  19799. }
  19800. }
  19801. UIMsg$1.uiName = "UIMsg";
  19802. class UITips$1 extends UIBase {
  19803. constructor() {
  19804. super();
  19805. this.type = 0;
  19806. }
  19807. onConstructor() {
  19808. this.ui = ui_UITips.createInstance();
  19809. this.contentPane = this.ui;
  19810. this.isEject = false;
  19811. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19812. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19813. }
  19814. show(tipsTxt, womanTxt, type) {
  19815. super.show();
  19816. this.ui.t0.play();
  19817. this.ui.myNode.tipsTxt.text = tipsTxt;
  19818. this.ui.myNode.womanTxt.text = womanTxt;
  19819. PlatMgr.showInsert(true);
  19820. this.ui.myNode.c1.selectedIndex = type;
  19821. this.type = type;
  19822. switch (this.type) {
  19823. case TipsType.exitGame:
  19824. xGame.common.gameMgr.gamePause = true;
  19825. break;
  19826. case TipsType.foul:
  19827. Laya.timer.once(200, this, () => {
  19828. xGame.common.gameMgr.gamePause = true;
  19829. });
  19830. break;
  19831. default:
  19832. break;
  19833. }
  19834. }
  19835. clickLeftBtn() {
  19836. this.hide();
  19837. xGame.common.gameMgr.gamePause = false;
  19838. switch (this.type) {
  19839. case TipsType.exitGame:
  19840. break;
  19841. case TipsType.foul:
  19842. break;
  19843. default:
  19844. break;
  19845. }
  19846. }
  19847. clickRightBtn() {
  19848. this.hide();
  19849. switch (this.type) {
  19850. case TipsType.exitGame:
  19851. xGame.eventMgr.event(RESET_GAME);
  19852. xGame.uiMgr.Show(UIMain$1);
  19853. Moyu.recordEnd(this, null);
  19854. xGame.common.longHelpLine = false;
  19855. break;
  19856. case TipsType.foul:
  19857. xGame.common.gameMgr.gamePause = false;
  19858. Laya.timer.clearAll(this);
  19859. break;
  19860. default:
  19861. break;
  19862. }
  19863. }
  19864. }
  19865. UITips$1.uiName = "UITips";
  19866. class UIGame$1 extends UIBase {
  19867. constructor() {
  19868. super();
  19869. this.powerNum = 0;
  19870. this.isD3Inited = false;
  19871. this.isPrePlay = false;
  19872. this.isMoveRod = false;
  19873. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19874. this.rulerDis = 20;
  19875. this.rulerOffset = 0;
  19876. }
  19877. onConstructor() {
  19878. this.ui = ui_UIGame.createInstance();
  19879. this.contentPane = this.ui;
  19880. this.ui.x += xGame.common.sysOffestNum;
  19881. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19882. this.isEject = false;
  19883. xGame.common.gameUI = this;
  19884. this.initSelf();
  19885. }
  19886. isTurnSelf() {
  19887. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19888. return true;
  19889. }
  19890. }
  19891. initSelf() {
  19892. let topUI = this.ui.topNode;
  19893. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  19894. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  19895. this.barInfo = {};
  19896. this.barInfo.curY = 0;
  19897. this.barInfo.height = this.ui.powerNode.height;
  19898. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  19899. this.barInfo.powerStartY = this.ui.powerNode.y;
  19900. xGame.common.aiPlayer = new AIPlayer();
  19901. xGame.common.gameMgr = new GameMgr();
  19902. xGame.common.skillMgr = new SkillMgr();
  19903. xGame.common.wordsMgr = new WordsMgr();
  19904. xGame.common.talkMgr = new TalkMgr();
  19905. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  19906. console.log("加载经典模式表情文件chenggon !");
  19907. });
  19908. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  19909. console.log("挑战模式奖励模式spine加载成功!");
  19910. });
  19911. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  19912. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  19913. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  19914. this.addUIClick(this.ui.returnBtn, this.returnHome);
  19915. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  19916. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  19917. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  19918. }
  19919. getGanZiImg() {
  19920. let index = DataMgr.getCurBallRod();
  19921. let data = cfgTable.ballrodData[index + 1];
  19922. let gan_url = xGame.common.getGameIconUrl(data.img);
  19923. console.log('zh:getGanZiImg gan_url==' + gan_url);
  19924. this.ui.powerNode.showImg.url = gan_url;
  19925. console.log('zh:修改杆子图标O K');
  19926. }
  19927. returnHome() {
  19928. let tips = "Are you sure to exit the game?";
  19929. let woman = "Boss, why don't you play for a while longer?";
  19930. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  19931. }
  19932. addRodMethodClick() {
  19933. if (this.isTurnSelf()) {
  19934. xGame.uiMgr.Show(UIRodMethod$1);
  19935. }
  19936. }
  19937. clickHelpLineBtn(force = false) {
  19938. if (!this.isTurnSelf())
  19939. return;
  19940. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  19941. if (success) {
  19942. xGame.common.longHelpLine = true;
  19943. xGame.common.d2World.getHelpLine();
  19944. Moyu.sendDataEvent("guideNum");
  19945. }
  19946. else {
  19947. }
  19948. });
  19949. }
  19950. renderSelfDisplayBalls(index, target) {
  19951. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  19952. target.myImg.url = xGame.common.getGameIconUrl(str);
  19953. }
  19954. renderAIDisplayBalls(index, target) {
  19955. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  19956. target.myImg.url = xGame.common.getGameIconUrl(str);
  19957. ;
  19958. }
  19959. updateMode() {
  19960. if (xGame.common.gameMode == GameMode.classic) {
  19961. this.ui.topNode.scoreNode.visible = false;
  19962. }
  19963. else if (xGame.common.gameMode == GameMode.bigMove) {
  19964. this.ui.topNode.scoreNode.visible = true;
  19965. }
  19966. }
  19967. show() {
  19968. super.show();
  19969. console.log("zh:uigame show AADD");
  19970. this.ui.alpha = 0;
  19971. this.updateSelf();
  19972. xGame.common.gameMgr.gamePause = false;
  19973. xGame.common.gameUI.ui.blackAni.visible = false;
  19974. xGame.common.gameUI.ui.whiteAni.visible = false;
  19975. this.ui.powerEft.visible = false;
  19976. this.ui.colorNode.visible = false;
  19977. this.updateHead();
  19978. let curUse = DataMgr.getCurBallRod();
  19979. console.log('zh:UIGame 选择的球杆234 = ' + curUse);
  19980. this.getGanZiImg();
  19981. }
  19982. updateSelf() {
  19983. if (xGame.common.gameMode == GameMode.classic) {
  19984. this.ui.c1.selectedIndex = 0;
  19985. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  19986. this.ui.topNode.middleNode.visible = true;
  19987. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  19988. }
  19989. else if (xGame.common.gameMode == GameMode.bigMove) {
  19990. this.ui.c1.selectedIndex = 0;
  19991. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  19992. this.ui.topNode.middleNode.visible = false;
  19993. let max = xGame.cfgMgr.getMaxBigMoveLength();
  19994. let rand = xGame.common.randomNum(1, max);
  19995. let guide = DataMgr.getSkillGuide();
  19996. if (guide == 0)
  19997. rand = 1;
  19998. xGame.common.bigMoveLevelIndex = rand;
  19999. }
  20000. else if (xGame.common.gameMode == GameMode.placeBall) {
  20001. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20002. this.ui.c1.selectedIndex = 1 + data.type;
  20003. this.ui.alpha = 1;
  20004. this.startGame();
  20005. }
  20006. this.updateMode();
  20007. this.initD3world();
  20008. this.initD2world();
  20009. }
  20010. startGame() {
  20011. this.ui.snowNode.visible = Math.random() <= 0.1;
  20012. this.ui.d2Node.visible = false;
  20013. xGame.common.d3World.d3Hand.gameObj.active = false;
  20014. xGame.common.d3World.tableSrc.init();
  20015. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20016. this.cameraViewChange(() => {
  20017. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20018. switch (xGame.common.gameMode) {
  20019. case GameMode.classic:
  20020. xGame.common.d3World.d3Hand.gameObj.active = true;
  20021. this.playPutBallD3Ani();
  20022. break;
  20023. case GameMode.bigMove:
  20024. this.enterGame();
  20025. Laya.timer.once(500, this, () => {
  20026. this.ui.topNode.middleNode.visible = true;
  20027. this.ui.topNode.middleNode.t0.play();
  20028. });
  20029. break;
  20030. case GameMode.placeBall:
  20031. this.enterGame();
  20032. break;
  20033. default:
  20034. break;
  20035. }
  20036. });
  20037. PlatMgr.showBanner(false);
  20038. }
  20039. enterGame() {
  20040. this.ui.d2Node.visible = true;
  20041. xGame.common.d3World.d3Hand.gameObj.active = false;
  20042. xGame.common.showOneCamera("mainCamera");
  20043. Moyu.recordGame(30, true);
  20044. if (!this.isPrePlay) {
  20045. this.isPrePlay = true;
  20046. xGame.common.d3World.prePlayEft();
  20047. }
  20048. xGame.common.gameMgr.gameReady();
  20049. this.openAllEvent();
  20050. this.ui.snowNode.visible = false;
  20051. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20052. this.ui.helpBtn.visible = condition;
  20053. }
  20054. showHelpLineGuide() {
  20055. let longGuide = DataMgr.getGuideHelpLine();
  20056. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20057. this.ui.helpBtn.visible = true;
  20058. this.ui.guideNode.visible = true;
  20059. }
  20060. }
  20061. setTurnAlpha(alpha) {
  20062. this.ui.keduNode.alpha = alpha;
  20063. this.ui.ganNode.alpha = alpha;
  20064. this.ui.rodMethodNode.alpha = alpha;
  20065. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20066. }
  20067. cameraViewChange(callback) {
  20068. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20069. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20070. xGame.common.showOneCamera("visitAngle");
  20071. cameraSrc.localRotationEulerY = 180;
  20072. cameraSrc.localRotationEulerZ = 0;
  20073. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20074. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20075. callback && callback();
  20076. }));
  20077. }));
  20078. }
  20079. playPutBallD3Ani() {
  20080. xGame.common.showOneCamera("mainCamera");
  20081. let handSrc = xGame.common.d3World.d3Hand;
  20082. handSrc.gameObj.active = true;
  20083. handSrc.transform.localPositionZ = 3;
  20084. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20085. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20086. handSrc.gameObj.active = false;
  20087. this.enterGame();
  20088. }), 400);
  20089. }));
  20090. }
  20091. updateHead() {
  20092. let user = Moyu.getUserInfo();
  20093. this.ui.topNode.selfNameTxt.text = user.nickName;
  20094. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20095. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20096. if (DataMgr.getSkillGuide() < 1) {
  20097. this.ui.topNode.aiNameTxt.text = 'billiards';
  20098. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20099. }
  20100. else {
  20101. this.ui.topNode.aiNameTxt.text = aiData.name;
  20102. let randNo = Math.floor(Math.random() * 10) + 1;
  20103. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20104. }
  20105. }
  20106. initD2world() {
  20107. let node = this.ui.d2Root.displayObject;
  20108. let src = node.getComponent(D2World);
  20109. if (!src) {
  20110. xGame.common.d2World = node.addComponent(D2World);
  20111. }
  20112. xGame.common.d2World.initSelf();
  20113. }
  20114. initD3world() {
  20115. if (this.isD3Inited)
  20116. return;
  20117. this.isD3Inited = true;
  20118. let scene3D = xGame.common.d3Scene;
  20119. this.ui.d3Root.displayObject.addChild(scene3D);
  20120. scene3D.active = true;
  20121. xGame.common.d3World.tableSrc.setBorderPos();
  20122. }
  20123. onRootMove(e) {
  20124. let rootBall = xGame.common.d2World.rootBall;
  20125. this.ui.moveNode.x = e.x;
  20126. this.ui.moveNode.y = e.y;
  20127. rootBall.gameObj.x = e.x;
  20128. rootBall.gameObj.y = e.y;
  20129. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20130. }
  20131. aiRootMove(move) {
  20132. if (move)
  20133. this.hideBallUI();
  20134. else {
  20135. this.showBallUI();
  20136. xGame.common.d2World.getHelpLine();
  20137. }
  20138. }
  20139. aiForce(type, force = 0) {
  20140. this.pressTarget = PressType.powerNode;
  20141. if (type == 1)
  20142. this.onEventUp({ force: true });
  20143. else if (type == 2)
  20144. this.onEventMove({ stageY: force, force: true });
  20145. }
  20146. onEventPress(e) {
  20147. if (e.stopPropagation)
  20148. e.stopPropagation();
  20149. if (!this.isTurnSelf())
  20150. return;
  20151. let target = e.target;
  20152. switch (target) {
  20153. case this.ui.myPowerNode.displayObject:
  20154. this.pressTarget = PressType.powerNode;
  20155. this.barInfo.curY = e.stageY;
  20156. this.updateBarInfo();
  20157. break;
  20158. case this.ui.moveNode.displayObject:
  20159. this.pressTarget = PressType.moveNode;
  20160. this.hideBallUI();
  20161. this.eventObj.curX = this.ui.moveNode.x;
  20162. this.eventObj.curY = this.ui.moveNode.y;
  20163. this.ui.moveNode.finger.visible = false;
  20164. this.eventObj.lastX = e.stageX;
  20165. this.eventObj.lastY = e.stageY;
  20166. break;
  20167. case this.ui.rulerClickNode.displayObject:
  20168. this.pressTarget = PressType.rulerNode;
  20169. this.eventObj.lastY = e.stageY;
  20170. break;
  20171. case this.ui.d2Root.displayObject:
  20172. this.pressTarget = PressType.d2Root;
  20173. this.eventObj.lastX = e.stageX;
  20174. this.eventObj.lastY = e.stageY;
  20175. this.eventObj.starX = e.stageX;
  20176. this.eventObj.starY = e.stageY;
  20177. this.eventObj.curX = 0;
  20178. this.eventObj.curY = 0;
  20179. xGame.common.d2World.d2Gan.setGanLastInfo();
  20180. this.rulerOffset = 0;
  20181. break;
  20182. default:
  20183. break;
  20184. }
  20185. }
  20186. onEventMove(e) {
  20187. if (e.stopPropagation)
  20188. e.stopPropagation();
  20189. if (e && e.force) {
  20190. }
  20191. else {
  20192. if (!this.isTurnSelf())
  20193. return;
  20194. }
  20195. switch (this.pressTarget) {
  20196. case PressType.powerNode:
  20197. this.barInfo.curY = e.stageY;
  20198. this.updateBarInfo();
  20199. this.isMoveRod = true;
  20200. break;
  20201. case PressType.moveNode:
  20202. let rootBall = xGame.common.d2World.rootBall;
  20203. let radius = rootBall.gameObj.width / 2;
  20204. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20205. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20206. let border = xGame.common.d2World.borderRect;
  20207. if (curX <= border.x + radius)
  20208. curX = border.x + radius;
  20209. else if (curX >= border.x + border.width - radius)
  20210. curX = border.x + border.width - radius;
  20211. if (curY <= border.y + radius)
  20212. curY = border.y + radius;
  20213. else if (curY >= border.y + border.height - radius)
  20214. curY = border.y + border.height - radius;
  20215. if (xGame.common.gameMgr.isOpenBall) {
  20216. if (curX >= border.x + border.openBallW - radius)
  20217. curX = border.x + border.openBallW - radius;
  20218. }
  20219. this.ui.moveNode.x = curX;
  20220. this.ui.moveNode.y = curY;
  20221. rootBall.gameObj.x = curX;
  20222. rootBall.gameObj.y = curY;
  20223. rootBall.d3BallSrc.setTransPos(curX, curY);
  20224. this.isMoveRod = true;
  20225. break;
  20226. case PressType.rulerNode:
  20227. let yy = e.stageY - this.eventObj.lastY;
  20228. this.eventObj.lastY = e.stageY;
  20229. let ruler1 = this.ui.rulerNode.img1;
  20230. let ruler2 = this.ui.rulerNode.img2;
  20231. ruler1.y += yy;
  20232. ruler2.y += yy;
  20233. this.rulerOffset += yy;
  20234. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20235. this.rulerOffset = 0;
  20236. xGame.soundMgr.playSound("inch", 1, 10);
  20237. }
  20238. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20239. let h = ruler1.height;
  20240. this.checkGuide();
  20241. this.isMoveRod = true;
  20242. if (ruler1.y >= h) {
  20243. ruler1.y = -h;
  20244. ruler2.y = 0;
  20245. return;
  20246. }
  20247. else if (ruler1.y <= -h) {
  20248. ruler1.y = h;
  20249. ruler2.y = 0;
  20250. return;
  20251. }
  20252. if (ruler2.y >= h) {
  20253. ruler2.y = -h;
  20254. ruler1.y = 0;
  20255. return;
  20256. }
  20257. else if (ruler2.y <= -h) {
  20258. ruler2.y = h;
  20259. ruler1.y = 0;
  20260. return;
  20261. }
  20262. break;
  20263. case PressType.d2Root:
  20264. this.eventObj.curX = e.stageX;
  20265. this.eventObj.curY = e.stageY;
  20266. let offset = this.checkRodMoveDir();
  20267. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20268. this.eventObj.lastX = e.stageX;
  20269. this.eventObj.lastY = e.stageY;
  20270. break;
  20271. default:
  20272. break;
  20273. }
  20274. }
  20275. onEventUp(e) {
  20276. if (e.stopPropagation)
  20277. e.stopPropagation();
  20278. if (e && e.force) {
  20279. }
  20280. else {
  20281. if (!this.isTurnSelf())
  20282. return;
  20283. }
  20284. switch (this.pressTarget) {
  20285. case PressType.powerNode:
  20286. this.ui.powerNode.value = 0;
  20287. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20288. this.ui.powerTxt.text = "";
  20289. if (this.powerNum > 0) {
  20290. xGame.eventMgr.event(BALL_SHOOT);
  20291. xGame.common.d2World.shoot(this.powerNum);
  20292. xGame.common.d2World.d2Gan.shoot();
  20293. xGame.common.d2World.d2HelpLine.shoot();
  20294. this.finishGuide();
  20295. this.ui.powerEft.visible = false;
  20296. this.ui.colorNode.visible = false;
  20297. let ganStr = "";
  20298. if (this.powerNum <= 30) {
  20299. ganStr = "gan_30";
  20300. }
  20301. else if (this.powerNum <= 60) {
  20302. ganStr = "gan_50";
  20303. }
  20304. else {
  20305. ganStr = "gan_80";
  20306. }
  20307. xGame.soundMgr.playSound(ganStr);
  20308. }
  20309. break;
  20310. case PressType.moveNode:
  20311. let rootBall = xGame.common.d2World.rootBall;
  20312. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20313. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20314. let isIntersect = this.judgeBallIntersect();
  20315. if (isIntersect) {
  20316. this.ui.moveNode.x = lastX;
  20317. this.ui.moveNode.y = lastY;
  20318. rootBall.gameObj.x = lastX;
  20319. rootBall.gameObj.y = lastY;
  20320. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20321. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20322. }
  20323. else {
  20324. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20325. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20326. }
  20327. this.showBallUI();
  20328. this.ui.moveNode.finger.visible = true;
  20329. xGame.common.d2World.getHelpLine();
  20330. break;
  20331. case PressType.rulerNode:
  20332. break;
  20333. case PressType.d2Root:
  20334. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20335. if (dis <= 25) {
  20336. this.moveToClickDot(e);
  20337. }
  20338. break;
  20339. default:
  20340. break;
  20341. }
  20342. this.pressTarget = -1;
  20343. }
  20344. checkGuide() {
  20345. let guide = DataMgr.getSkillGuide();
  20346. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20347. xGame.common.guideStep++;
  20348. xGame.common.gameUI.ui.guide2.visible = false;
  20349. xGame.common.gameUI.ui.guide3.visible = true;
  20350. }
  20351. }
  20352. finishGuide() {
  20353. let guide = DataMgr.getSkillGuide();
  20354. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20355. xGame.common.guideStep = 10;
  20356. this.closeAllGuide();
  20357. console.log('zh: 新手引导完毕');
  20358. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20359. }
  20360. }
  20361. closeAllGuide() {
  20362. xGame.common.gameUI.ui.guide1.visible = false;
  20363. xGame.common.gameUI.ui.guide2.visible = false;
  20364. xGame.common.gameUI.ui.guide3.visible = false;
  20365. }
  20366. updateBarInfo() {
  20367. let star = this.ui.powerNode.y;
  20368. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20369. if (rate >= 1)
  20370. rate = 1;
  20371. if (rate <= 0)
  20372. rate = 0;
  20373. this.powerNum = Math.ceil(rate * 100);
  20374. this.ui.powerNode.value = this.powerNum;
  20375. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20376. this.ui.colorNode.value = this.powerNum;
  20377. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20378. this.ui.powerEft.visible = this.powerNum != 0;
  20379. this.ui.colorNode.visible = this.powerNum != 0;
  20380. this.ui.powerTxt.text = this.powerNum + "";
  20381. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20382. }
  20383. forceCancel() {
  20384. this.ui.powerNode.value = 0;
  20385. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20386. this.ui.powerTxt.text = "";
  20387. }
  20388. checkRodMoveDir() {
  20389. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20390. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20391. if (tempX >= 0 && tempY <= 0) {
  20392. return this.checkDir();
  20393. }
  20394. else if (tempX < 0 && tempY < 0) {
  20395. return this.checkDir(1, -1);
  20396. }
  20397. else if (tempX < 0 && tempY > 0) {
  20398. return this.checkDir(-1, -1);
  20399. }
  20400. else {
  20401. return this.checkDir(-1, 1);
  20402. }
  20403. }
  20404. checkDir(flagX = 1, flagY = 1) {
  20405. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20406. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20407. if (offsetY == 0) {
  20408. return offsetX * flagX;
  20409. }
  20410. if (offsetX == 0) {
  20411. return offsetY * flagY;
  20412. }
  20413. let angle = offsetY / offsetX;
  20414. if (Math.abs(angle) >= 1) {
  20415. return offsetY * flagY;
  20416. }
  20417. else {
  20418. return offsetX * flagX;
  20419. }
  20420. }
  20421. judgeBallIntersect() {
  20422. let rootBall = xGame.common.d2World.rootBall;
  20423. let ballArr = xGame.common.d2World.ballArr;
  20424. let radius = rootBall.gameObj.width / 2;
  20425. let temp;
  20426. let isIntersect = false;
  20427. for (let index = 0; index < ballArr.length; index++) {
  20428. temp = ballArr[index];
  20429. if (temp.number == rootBall.number)
  20430. continue;
  20431. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20432. if (isIntersect) {
  20433. break;
  20434. }
  20435. }
  20436. return isIntersect;
  20437. }
  20438. hideBallUI() {
  20439. let d2Gan = xGame.common.d2World.d2Gan;
  20440. if (!d2Gan.ui.isDisposed)
  20441. d2Gan.ui.visible = false;
  20442. let d2Help = xGame.common.d2World.d2HelpLine;
  20443. if (!d2Help.ui.isDisposed)
  20444. d2Help.ui.visible = false;
  20445. let rootBall = xGame.common.d2World.rootBall;
  20446. if (!rootBall.destroyed) {
  20447. rootBall.gameObj.active = false;
  20448. }
  20449. }
  20450. showBallUI() {
  20451. let d2Gan = xGame.common.d2World.d2Gan;
  20452. if (!d2Gan.ui.isDisposed)
  20453. d2Gan.ui.visible = true;
  20454. let d2Help = xGame.common.d2World.d2HelpLine;
  20455. if (!d2Help.ui.isDisposed)
  20456. d2Help.ui.visible = true;
  20457. let rootBall = xGame.common.d2World.rootBall;
  20458. if (!rootBall.destroyed) {
  20459. rootBall.gameObj.active = true;
  20460. }
  20461. }
  20462. moveToClickDot(e) {
  20463. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20464. let root = xGame.common.d2World.rootBall.gameObj;
  20465. let xx = e.stageX - xGame.common.sysOffestNum;
  20466. let yy = e.stageY;
  20467. let x = xx - root.x;
  20468. let y = yy - root.y;
  20469. let angle = xGame.common.getfguiRotation(x, y);
  20470. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20471. xGame.common.d2World.getHelpLine();
  20472. }
  20473. this.isMoveRod = false;
  20474. xGame.common.clickedBall = false;
  20475. }
  20476. openAllEvent() {
  20477. this.closeAllEvent();
  20478. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20479. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20480. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20481. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20482. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20483. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20484. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20485. }
  20486. closeAllEvent() {
  20487. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20488. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20489. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20490. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20491. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20492. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20493. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20494. }
  20495. resetGame() {
  20496. this.closeAllEvent();
  20497. this.hideBallUI();
  20498. xGame.common.gameMgr.gamePause = true;
  20499. }
  20500. }
  20501. UIGame$1.uiName = "UIGame";
  20502. class UIAddCoin$1 extends UIBase {
  20503. constructor() {
  20504. super();
  20505. this.coinNum = 2000;
  20506. }
  20507. onConstructor() {
  20508. this.ui = ui_UIAddCoin.createInstance();
  20509. this.contentPane = this.ui;
  20510. this.isEject = false;
  20511. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20512. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20513. }
  20514. show() {
  20515. super.show();
  20516. this.ui.t0.play();
  20517. }
  20518. videoAddCoin() {
  20519. console.log('zh:qjff_AD_for_UIAddCoin');
  20520. if (Laya.Browser.onAndroid) {
  20521. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20522. if (!boo) {
  20523. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20524. return;
  20525. }
  20526. }
  20527. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20528. }
  20529. else {
  20530. console.log('zh:AD 失败,直接发放奖励');
  20531. this.qjff_AD_for_UIAddCoin();
  20532. }
  20533. }
  20534. qjff_AD_for_UIAddCoin() {
  20535. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20536. this.hide();
  20537. }
  20538. }
  20539. UIAddCoin$1.uiName = "UIAddCoin";
  20540. class UIInvitation$1 extends UIBase {
  20541. constructor() {
  20542. super();
  20543. }
  20544. onConstructor() {
  20545. this.ui = ui_UIInvitation.createInstance();
  20546. this.contentPane = this.ui;
  20547. this.isEject = false;
  20548. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20549. }
  20550. show() {
  20551. super.show();
  20552. }
  20553. enterGame() {
  20554. xGame.common.gameMode = GameMode.classic;
  20555. DataMgr.setChallengeTimes(1);
  20556. xGame.common.passAwardCoin = 2000;
  20557. let need = xGame.common.classicNiceNeddCoin;
  20558. if (DataMgr.coinEnough(need)) {
  20559. DataMgr.setCoin(-need);
  20560. xGame.eventMgr.event(RESTART_GAME, true);
  20561. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20562. }
  20563. else {
  20564. xGame.eventMgr.event(RESTART_GAME, true);
  20565. }
  20566. this.hide();
  20567. }
  20568. hide() {
  20569. super.hide();
  20570. }
  20571. }
  20572. UIInvitation$1.uiName = "UIInvitation";
  20573. class UIPower$1 extends UIBase {
  20574. constructor() {
  20575. super();
  20576. }
  20577. onConstructor() {
  20578. this.ui = ui_UIPower.createInstance();
  20579. this.contentPane = this.ui;
  20580. this.isEject = false;
  20581. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20582. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20583. }
  20584. show() {
  20585. super.show();
  20586. this.ui.t0.play();
  20587. }
  20588. videoGetPower() {
  20589. console.log('zh:qjff_AD_for_uipower');
  20590. if (Laya.Browser.onAndroid) {
  20591. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20592. if (!boo) {
  20593. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20594. return;
  20595. }
  20596. }
  20597. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20598. }
  20599. else {
  20600. console.log('zh:AD 失败,直接发放奖励');
  20601. this.qjff_AD_for_uipower();
  20602. }
  20603. }
  20604. qjff_AD_for_uipower() {
  20605. DataMgr.setPower(xGame.common.videoPower, true);
  20606. xGame.eventMgr.event(POWER_TIME);
  20607. this.hide();
  20608. }
  20609. }
  20610. UIPower$1.uiName = "UIPower";
  20611. class UIGameEnd$1 extends UIBase {
  20612. constructor() {
  20613. super();
  20614. this.success = false;
  20615. this.awardCoinNum = 1000;
  20616. this.awardDiamondNum = 10;
  20617. }
  20618. onConstructor() {
  20619. this.ui = ui_UIGameEnd.createInstance();
  20620. this.contentPane = this.ui;
  20621. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20622. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20623. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20624. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20625. this.ui.talkNode.visible = false;
  20626. if (Moyu.isKs)
  20627. this.ui.closeNode.closeBtn.x += 100;
  20628. }
  20629. updateType() {
  20630. switch (xGame.common.gameMode) {
  20631. case GameMode.classic:
  20632. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20633. this.ui.coinNode.visible = this.success;
  20634. if (!this.success) {
  20635. Laya.timer.once(500, this, () => {
  20636. xGame.uiMgr.Show(UIAddCoin$1);
  20637. });
  20638. }
  20639. else {
  20640. this.logEventForClassic_win();
  20641. }
  20642. this.logEventForClassic_complete();
  20643. this.ui.isGetAward.visible = false;
  20644. this.ui.leftBtn.c1.selectedIndex = 3;
  20645. this.ui.rightBtn.c1.selectedIndex = 0;
  20646. this.moneyNode.ui.c1.selectedIndex = 1;
  20647. break;
  20648. case GameMode.bigMove:
  20649. console.log('zh:招法模式 aaaaaa bigMove');
  20650. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20651. this.ui.coinNode.visible = this.success;
  20652. if (xGame.common.gameMode == GameMode.bigMove) {
  20653. if (this.success) {
  20654. DataMgr.setSkillSuccessTimes(1, true);
  20655. DataMgr.setSkillAccTimes(1);
  20656. }
  20657. else {
  20658. DataMgr.setSkillSuccessTimes(0, false);
  20659. }
  20660. }
  20661. this.logEventForRod_complete_N();
  20662. if (!this.success) {
  20663. Laya.timer.once(500, this, () => {
  20664. xGame.uiMgr.Show(UIAddCoin$1);
  20665. });
  20666. }
  20667. else {
  20668. this.logEventForRod_win();
  20669. }
  20670. this.ui.isGetAward.visible = false;
  20671. this.ui.leftBtn.c1.selectedIndex = 3;
  20672. this.ui.rightBtn.c1.selectedIndex = 0;
  20673. this.moneyNode.ui.c1.selectedIndex = 1;
  20674. break;
  20675. case GameMode.placeBall:
  20676. this.ui.coinNode.visible = false;
  20677. if (this.success) {
  20678. if (xGame.common.placeBallStarNum == 3) {
  20679. this.ui.c1.selectedIndex = 2;
  20680. }
  20681. else {
  20682. this.ui.c1.selectedIndex = 3;
  20683. }
  20684. let level = xGame.common.placeBallCurLevel;
  20685. if (level > 59) {
  20686. this.logEventForChallenge_level_complete(level);
  20687. }
  20688. else {
  20689. this.logEventForChallenge_level_N(level);
  20690. }
  20691. }
  20692. else {
  20693. this.ui.c1.selectedIndex = 4;
  20694. }
  20695. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20696. if (cfg.type == PlaceBallType.challenge) {
  20697. this.ui.c1.selectedIndex = 2;
  20698. }
  20699. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20700. this.updatePlaceBallBtn();
  20701. this.updatePlaceBallStarNum();
  20702. this.updatePlaceBallAwardState();
  20703. this.moneyNode.ui.c1.selectedIndex = 2;
  20704. this.moneyNode.checkPowerTime();
  20705. this.moneyNode.powerChange();
  20706. DataMgr.upRankData();
  20707. break;
  20708. default:
  20709. break;
  20710. }
  20711. }
  20712. logEventForRod_complete_N() {
  20713. let gfmsIdx = xGame.common.curPlayerSkillType;
  20714. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20715. let gfmc = 'Skyfall Shot';
  20716. if (gfmsIdx == 0) {
  20717. gfmc = 'Skyfall Shot';
  20718. }
  20719. if (gfmsIdx == 1) {
  20720. gfmc = 'Surging break';
  20721. }
  20722. if (gfmsIdx == 2) {
  20723. gfmc = 'Frost Lock';
  20724. }
  20725. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20726. console.log('zh:logEventForRod_complete_N level = ' + level);
  20727. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20728. let jsonStr = {
  20729. "count": 0,
  20730. "name": gfmc
  20731. };
  20732. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20733. const d = LocalStorageManager.getItem(keyStr);
  20734. jsonStr.count = d.count + 1;
  20735. LocalStorageManager.setItem(keyStr, jsonStr);
  20736. }
  20737. else {
  20738. LocalStorageManager.setItem(keyStr, jsonStr);
  20739. }
  20740. const d2 = LocalStorageManager.getItem(keyStr);
  20741. let count = d2.count;
  20742. console.log('zh:logEventForRod_complete_N count = ' + count);
  20743. if (count % 5 == 0) {
  20744. const reqStr = JSON.stringify(jsonStr);
  20745. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20746. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20747. }
  20748. }
  20749. logEventForRod_win() {
  20750. console.log('zh:logEventForRod_win,胜利');
  20751. let gfmsIdx = xGame.common.curPlayerSkillType;
  20752. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20753. let gfmc = 'Skyfall Shot';
  20754. if (gfmsIdx == 0) {
  20755. gfmc = 'Skyfall Shot';
  20756. }
  20757. if (gfmsIdx == 1) {
  20758. gfmc = 'Surging break';
  20759. }
  20760. if (gfmsIdx == 2) {
  20761. gfmc = 'Frost Lock';
  20762. }
  20763. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20764. console.log('zh:logEventForRod_win level = ' + level);
  20765. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20766. let jsonStr = {
  20767. "count": 1,
  20768. "name": gfmc + ' Lev' + level
  20769. };
  20770. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20771. const d = LocalStorageManager.getItem(keyStr);
  20772. jsonStr.count = d.count + 1;
  20773. LocalStorageManager.setItem(keyStr, jsonStr);
  20774. }
  20775. else {
  20776. LocalStorageManager.setItem(keyStr, jsonStr);
  20777. }
  20778. const reqStr = JSON.stringify(jsonStr);
  20779. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20780. }
  20781. logEventForClassic_win() {
  20782. console.log('zh:logEventForClassic_win,胜利');
  20783. let rtype = xGame.common.classicRoomType;
  20784. let msmc = '';
  20785. if (rtype == 1) {
  20786. msmc = 'beginner';
  20787. }
  20788. if (rtype == 2) {
  20789. msmc = 'expert';
  20790. }
  20791. if (rtype == 3) {
  20792. msmc = 'master';
  20793. }
  20794. let keyStr = 'sjmd_classic_win_' + rtype;
  20795. let jsonStr = {
  20796. "difficulty": msmc,
  20797. "classic_count": 1,
  20798. "difficulty_count": 1
  20799. };
  20800. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20801. const d = LocalStorageManager.getItem(keyStr);
  20802. jsonStr.classic_count = d.classic_count + 1;
  20803. jsonStr.difficulty_count = d.difficulty_count + 1;
  20804. LocalStorageManager.setItem(keyStr, jsonStr);
  20805. }
  20806. else {
  20807. LocalStorageManager.setItem(keyStr, jsonStr);
  20808. }
  20809. const reqStr = JSON.stringify(jsonStr);
  20810. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20811. }
  20812. logEventForClassic_complete() {
  20813. console.log('zh:logEventForClassic_complete,胜利');
  20814. let rtype = xGame.common.classicRoomType;
  20815. let msmc = '';
  20816. if (rtype == 1) {
  20817. msmc = 'beginner';
  20818. }
  20819. if (rtype == 2) {
  20820. msmc = 'expert';
  20821. }
  20822. if (rtype == 3) {
  20823. msmc = 'master';
  20824. }
  20825. let keyStr = 'sjmd_classic_complete_' + rtype;
  20826. let jsonStr = {
  20827. "msmc": msmc,
  20828. "count": 0
  20829. };
  20830. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20831. const d = LocalStorageManager.getItem(keyStr);
  20832. jsonStr.count = d.count + 1;
  20833. LocalStorageManager.setItem(keyStr, jsonStr);
  20834. }
  20835. else {
  20836. LocalStorageManager.setItem(keyStr, jsonStr);
  20837. }
  20838. if (jsonStr.count % 5 == 0) {
  20839. const reqStr = JSON.stringify(jsonStr);
  20840. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20841. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20842. }
  20843. }
  20844. updatePlaceBallBtn() {
  20845. this.ui.leftBtn.c1.selectedIndex = 5;
  20846. if (this.success) {
  20847. this.ui.rightBtn.c1.selectedIndex = 14;
  20848. }
  20849. else {
  20850. if (xGame.common.placeBallStarNum == 3) {
  20851. this.ui.rightBtn.c1.selectedIndex = 14;
  20852. }
  20853. else {
  20854. this.ui.rightBtn.c1.selectedIndex = 1;
  20855. }
  20856. }
  20857. }
  20858. updatePlaceBallStarNum() {
  20859. let starNum = xGame.common.placeBallStarNum;
  20860. if (starNum == 0)
  20861. this.ui.starNumNode.c1.selectedIndex = 3;
  20862. else {
  20863. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20864. }
  20865. }
  20866. updatePlaceBallAwardState() {
  20867. let level = xGame.common.placeBallCurLevel;
  20868. let starNum = xGame.common.placeBallStarNum;
  20869. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20870. let data = cfgTable.placeballData[level].award;
  20871. let cfg = cfgTable.placeballData[level];
  20872. this.awardDiamondNum = data[1];
  20873. this.awardCoinNum = data[0];
  20874. if (cfg.type == PlaceBallType.challenge) {
  20875. this.awardDiamondNum = 0;
  20876. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20877. }
  20878. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20879. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20880. if (cfg.type == PlaceBallType.challenge) {
  20881. this.ui.awardNode.coinNode.visible = true;
  20882. }
  20883. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20884. this.ui.awardNode.diamondNode.x = 265;
  20885. this.ui.awardNode.coinNode.x = 354;
  20886. }
  20887. else {
  20888. this.ui.awardNode.diamondNode.x = 291;
  20889. this.ui.awardNode.coinNode.x = 291;
  20890. }
  20891. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20892. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20893. if (this.awardCoinNum == 0) {
  20894. this.ui.awardNode.coinNode.numTxt.text = "";
  20895. }
  20896. if (getAward) {
  20897. this.ui.isGetAward.visible = true;
  20898. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  20899. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  20900. }
  20901. else {
  20902. this.ui.isGetAward.visible = false;
  20903. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  20904. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  20905. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  20906. }
  20907. else {
  20908. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  20909. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  20910. }
  20911. }
  20912. }
  20913. show(success) {
  20914. super.show();
  20915. xGame.eventMgr.event(RESET_GAME);
  20916. this.success = success;
  20917. Laya.timer.clearAll(this);
  20918. this.playSecretaryAni();
  20919. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  20920. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  20921. offsetTime = Math.floor(offsetTime / 1000);
  20922. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  20923. this.updateType();
  20924. Laya.timer.once(200, this, () => {
  20925. this.addAward(() => {
  20926. this.updateType();
  20927. Laya.timer.once(500, this, () => {
  20928. this.showChallengeLevel();
  20929. });
  20930. });
  20931. });
  20932. if (this.success) {
  20933. JSBridgeUtils.instance.showInternAd('gameend_success');
  20934. console.log('zh:game end 成功');
  20935. xGame.soundMgr.playSound('slots_roll01');
  20936. xGame.soundMgr.playSound("s_win");
  20937. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20938. this.diyGameDataUtilForGameWin();
  20939. this.updateGamePlaceBallData2Server();
  20940. }
  20941. else {
  20942. JSBridgeUtils.instance.showInternAd('gameend_faill');
  20943. console.log('zh:game end失败');
  20944. xGame.soundMgr.playSound('matchwin01');
  20945. xGame.soundMgr.playSound("s_lose");
  20946. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  20947. }
  20948. let challengeNum = DataMgr.getChallengeTimes();
  20949. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  20950. DataMgr.setChallengeTimes(1);
  20951. }
  20952. if (this.success && xGame.common.gameMode == GameMode.classic) {
  20953. DataMgr.setClassicTimes();
  20954. }
  20955. }
  20956. diyGameDataUtilForGameWin() {
  20957. console.log('zh: DiyGameDataUtilForGameWin diy ');
  20958. switch (xGame.common.gameMode) {
  20959. case GameMode.classic:
  20960. console.log('zh:DiyGameDataUtilForGameWin 111');
  20961. case GameMode.bigMove:
  20962. console.log('zh:DiyGameDataUtilForGameWin 222');
  20963. this.restartGame();
  20964. break;
  20965. case GameMode.placeBall:
  20966. console.log('zh:DiyGameDataUtilForGameWin 333');
  20967. var level = xGame.common.placeBallCurLevel;
  20968. console.log('zh:练习模式 联系了多少LEV=' + level);
  20969. let db_over_lev = DataMgr.getChallengeMode_overLev();
  20970. if (level > db_over_lev) {
  20971. DataMgr.setChallengeMode_overLev(level);
  20972. }
  20973. break;
  20974. default:
  20975. console.log('zh:DiyGameDataUtilForGameWin 444');
  20976. break;
  20977. }
  20978. }
  20979. updateGamePlaceBallData2Server() {
  20980. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  20981. if (userInfo == null) {
  20982. return;
  20983. }
  20984. let pbdObj = DataMgr.getPlaceBallLevelList();
  20985. let reqData = xGame.httpMgr.getReqData();
  20986. let pd = JSON.parse(reqData);
  20987. pd.placeBallData = JSON.stringify(pbdObj);
  20988. reqData = JSON.stringify(pd);
  20989. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  20990. try {
  20991. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  20992. let code = res.code;
  20993. let msg = res.msg;
  20994. if (code == 401) {
  20995. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  20996. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  20997. return;
  20998. }
  20999. if (code == 200) {
  21000. let data = res.data;
  21001. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21002. }
  21003. else {
  21004. xGame.uiMgr.Show(UIMsg$1, msg);
  21005. }
  21006. }
  21007. catch (error) {
  21008. console.log('error=' + error);
  21009. alert(error);
  21010. }
  21011. finally {
  21012. }
  21013. });
  21014. }
  21015. showChallengeLevel() {
  21016. if (DataMgr.getChallengeTimes() != 0)
  21017. return;
  21018. let skill = DataMgr.getSkillAccTimes();
  21019. let put = DataMgr.getPlaceBallLevelList().length;
  21020. if (skill >= 3 || put >= 5) {
  21021. xGame.uiMgr.Show(UIInvitation$1);
  21022. this.hide();
  21023. }
  21024. }
  21025. addAward(callback) {
  21026. if (!this.success) {
  21027. callback && callback();
  21028. return;
  21029. }
  21030. switch (xGame.common.gameMode) {
  21031. case GameMode.classic:
  21032. this.awardCoinNum = xGame.common.passAwardCoin;
  21033. this.awardDiamondNum = 0;
  21034. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21035. break;
  21036. case GameMode.bigMove:
  21037. this.awardCoinNum = xGame.common.passAwardCoin;
  21038. this.awardDiamondNum = 0;
  21039. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21040. callback && callback();
  21041. break;
  21042. case GameMode.placeBall:
  21043. let level = xGame.common.placeBallCurLevel;
  21044. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21045. if (xGame.common.placeBallStarNum != 3) {
  21046. callback && callback();
  21047. return;
  21048. }
  21049. else {
  21050. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21051. if (getAward) {
  21052. callback && callback();
  21053. return;
  21054. }
  21055. }
  21056. let cfg = cfgTable.placeballData[level];
  21057. let data = cfgTable.placeballData[level].award;
  21058. this.awardCoinNum = data[0];
  21059. this.awardDiamondNum = data[1];
  21060. if (cfg.type == PlaceBallType.challenge) {
  21061. this.awardDiamondNum = 0;
  21062. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21063. }
  21064. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21065. let diamondAward;
  21066. if (this.awardDiamondNum > 0) {
  21067. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21068. xGame.common.getAward([diamondAward, coinAward], callback);
  21069. }
  21070. else {
  21071. xGame.common.getAward([coinAward], callback);
  21072. }
  21073. if (cfg.type == PlaceBallType.normal) {
  21074. DataMgr.setPlaceBallAward(level);
  21075. }
  21076. break;
  21077. default:
  21078. break;
  21079. }
  21080. }
  21081. playSecretaryAni_old() {
  21082. let parent = this.ui.secretary.displayObject;
  21083. parent.destroyChildren();
  21084. let xx = this.ui.secretary.width / 2;
  21085. let yy = this.ui.secretary.height;
  21086. let scale = xGame.common.getSecretaryScale();
  21087. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21088. if (this.success) {
  21089. let rand = Math.random() <= 0.5 ? 2 : 3;
  21090. xGame.common.secretary.play(data, rand, false, parent, () => {
  21091. xGame.common.secretary.play(data, 1, true, parent);
  21092. });
  21093. }
  21094. else {
  21095. xGame.common.secretary.play(data, 0, true, parent);
  21096. }
  21097. }
  21098. playSecretaryAni() {
  21099. let parent = this.ui.secretary.displayObject;
  21100. parent.destroyChildren();
  21101. let xx = this.ui.secretary.width / 2;
  21102. let yy = this.ui.secretary.height;
  21103. let scale = xGame.common.getSecretaryScale();
  21104. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21105. if (this.success) {
  21106. let rand = 0;
  21107. xGame.common.secretary.play(data, 0, true, parent);
  21108. }
  21109. else {
  21110. xGame.common.secretary.play(data, 0, true, parent);
  21111. }
  21112. }
  21113. restartGame() {
  21114. switch (xGame.common.gameMode) {
  21115. case GameMode.classic:
  21116. xGame.eventMgr.event(RESTART_GAME);
  21117. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21118. break;
  21119. case GameMode.bigMove:
  21120. this.hide();
  21121. xGame.eventMgr.event(RESTART_GAME);
  21122. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21123. break;
  21124. default:
  21125. break;
  21126. }
  21127. }
  21128. hide() {
  21129. super.hide();
  21130. xGame.common.stopGirlPop(this.ui.talkNode);
  21131. PlatMgr.showBanner(false);
  21132. }
  21133. returnHome() {
  21134. this.hide();
  21135. let showFailWords = !this.success;
  21136. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21137. }
  21138. clickLeftBtn() {
  21139. switch (xGame.common.gameMode) {
  21140. case GameMode.classic:
  21141. case GameMode.bigMove:
  21142. this.returnHome();
  21143. break;
  21144. case GameMode.placeBall:
  21145. let level = xGame.common.placeBallCurLevel;
  21146. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21147. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21148. break;
  21149. default:
  21150. break;
  21151. }
  21152. }
  21153. powerStartPlaceBallLevel(level, btn) {
  21154. if (DataMgr.powerEnough()) {
  21155. btn.touchable = false;
  21156. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21157. btn.touchable = true;
  21158. DataMgr.setPower(-1);
  21159. xGame.eventMgr.event(POWER_TIME);
  21160. this.startPlaceBallLevel(level);
  21161. this.logEventForChallenge_level_start(level);
  21162. }));
  21163. }
  21164. else {
  21165. xGame.uiMgr.Show(UIPower$1, 0);
  21166. }
  21167. }
  21168. clickRightBtn() {
  21169. switch (xGame.common.gameMode) {
  21170. case GameMode.classic:
  21171. console.log('zh:clickRightBtn 111');
  21172. case GameMode.bigMove:
  21173. console.log('zh:clickRightBtn 222');
  21174. this.restartGame();
  21175. break;
  21176. case GameMode.placeBall:
  21177. console.log('zh:clickRightBtn 333');
  21178. let level = xGame.common.placeBallCurLevel;
  21179. let data = DataMgr.getPlaceBallLevel(level);
  21180. let curPss = data.play && !data.isCur;
  21181. if (curPss) {
  21182. console.log('zh:clickRightBtn 333-111');
  21183. console.log('zh:当前LV=' + level);
  21184. if (level == 60) {
  21185. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21186. Laya.timer.once(3000, this, () => {
  21187. this.returnHome();
  21188. });
  21189. }
  21190. else {
  21191. let lev = level + 1;
  21192. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21193. }
  21194. }
  21195. else {
  21196. console.log('zh:clickRightBtn 333-000');
  21197. Moyu.sendDataEvent("placeBallNextLevel");
  21198. console.log('zh:qjff_AD_for_uiGameEnd');
  21199. if (Laya.Browser.onAndroid) {
  21200. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21201. if (!boo) {
  21202. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21203. return;
  21204. }
  21205. }
  21206. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21207. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21208. }
  21209. else {
  21210. console.log('zh:AD 失败,直接发放奖励');
  21211. this.qjff_AD_for_uiGameEnd(level);
  21212. }
  21213. }
  21214. break;
  21215. default:
  21216. console.log('zh:clickRightBtn 444');
  21217. break;
  21218. }
  21219. }
  21220. logEventForChallenge_level_start(level) {
  21221. let keyStr = 'sjmd_challenge_level_start';
  21222. let jsonStr = {
  21223. "count": 0,
  21224. "gold_balance ": DataMgr.getCoin(),
  21225. "level": level,
  21226. "diamond_balance ": DataMgr.getDiamond()
  21227. };
  21228. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21229. const d = LocalStorageManager.getItem(keyStr);
  21230. if (level > d.level) {
  21231. jsonStr.count = d.count + 1;
  21232. LocalStorageManager.setItem(keyStr, jsonStr);
  21233. }
  21234. else {
  21235. }
  21236. }
  21237. else {
  21238. LocalStorageManager.setItem(keyStr, jsonStr);
  21239. }
  21240. const reqStr = JSON.stringify(jsonStr);
  21241. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21242. }
  21243. qjff_AD_for_uiGameEnd(level) {
  21244. DataMgr.setPlaceBallLevel(level, 1);
  21245. this.startPlaceBallLevel(level + 1);
  21246. }
  21247. startPlaceBallLevel(level) {
  21248. xGame.common.gameMode = GameMode.placeBall;
  21249. xGame.common.placeBallCurLevel = level;
  21250. xGame.uiMgr.Show(UIGame$1);
  21251. this.hide();
  21252. }
  21253. logEventForChallenge_level_complete(level) {
  21254. let keyStr = 'sjmd_challenge_level_complete';
  21255. let jsonStr = {
  21256. "count": 1,
  21257. "gold_balance ": DataMgr.getCoin(),
  21258. "level": level,
  21259. "diamond_balance ": DataMgr.getDiamond()
  21260. };
  21261. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21262. const d = LocalStorageManager.getItem(keyStr);
  21263. jsonStr.count = d.count + 1;
  21264. LocalStorageManager.setItem(keyStr, jsonStr);
  21265. }
  21266. else {
  21267. LocalStorageManager.setItem(keyStr, jsonStr);
  21268. }
  21269. const reqStr = JSON.stringify(jsonStr);
  21270. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21271. }
  21272. logEventForChallenge_level_N(level) {
  21273. console.log('zh:logEventForChallenge_level_N ' + level);
  21274. let keyStr = 'sjmd_challenge_level_N';
  21275. if (LocalStorageManager.hasKey(keyStr)) {
  21276. let lev = LocalStorageManager.getItem(keyStr);
  21277. if (level > lev) {
  21278. LocalStorageManager.setItem(keyStr, level);
  21279. }
  21280. if ((level) % 5 == 0) {
  21281. console.log('zh:每5关上报1次');
  21282. let sjmc = 'challenge_level_' + level;
  21283. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21284. let sjmcForFirebase = 'challenge_level_' + level;
  21285. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21286. }
  21287. else {
  21288. console.log('zh:5 no 上报');
  21289. }
  21290. }
  21291. else {
  21292. LocalStorageManager.setItem(keyStr, level);
  21293. }
  21294. }
  21295. }
  21296. UIGameEnd$1.uiName = "UIGameEnd";
  21297. class ShowItem$1 {
  21298. constructor() {
  21299. this.ui = ui_ShowItem.createInstance();
  21300. }
  21301. destroySelf() {
  21302. if (!this.ui.isDisposed) {
  21303. this.ui.removeFromParent();
  21304. this.ui.dispose();
  21305. }
  21306. }
  21307. setParent(parent) {
  21308. parent.addChild(this.ui);
  21309. }
  21310. setPos(x, y) {
  21311. this.ui.x = x;
  21312. this.ui.y = y;
  21313. }
  21314. setUrl(index) {
  21315. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21316. }
  21317. }
  21318. class UILevelProp$1 extends UIBase {
  21319. constructor() {
  21320. super();
  21321. this.firstPos = 385;
  21322. this.secondPos = 467;
  21323. this.showItemArr = [];
  21324. }
  21325. onFontLoaded() {
  21326. try {
  21327. this.ui.myNode.conditionTxt.font = "arial";
  21328. console.log("zh: onFontLoaded 设置arial字体成功");
  21329. }
  21330. catch (error) {
  21331. console.log("zh: constructor onFontLoaded加载arial字体失败");
  21332. }
  21333. }
  21334. onConstructor() {
  21335. this.ui = ui_UILevelProp.createInstance();
  21336. this.contentPane = this.ui;
  21337. this.isEject = false;
  21338. this.addUIClick(this.ui.closeBtn, this.hide);
  21339. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21340. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21341. }
  21342. show(level) {
  21343. super.show();
  21344. this.ui.t1.play();
  21345. this.level = level;
  21346. this.data = cfgTable.placeballData[this.level];
  21347. this.updateSelf();
  21348. this.showPreView();
  21349. this.moneyNode.ui.c1.selectedIndex = 2;
  21350. this.moneyNode.checkPowerTime();
  21351. this.moneyNode.powerChange();
  21352. }
  21353. showPreView() {
  21354. let item;
  21355. let data;
  21356. for (let index = 0; index < this.showItemArr.length; index++) {
  21357. item = this.showItemArr[index];
  21358. item.destroySelf();
  21359. }
  21360. this.showItemArr = [];
  21361. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21362. for (const key in cfgData) {
  21363. data = cfgData[key];
  21364. item = new ShowItem$1();
  21365. item.setParent(this.ui.myNode.displayRoot);
  21366. item.setPos(data.x, data.y);
  21367. item.setUrl(data.value);
  21368. this.showItemArr.push(item);
  21369. }
  21370. }
  21371. updateSelf() {
  21372. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21373. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21374. if (this.data.ball == -1) {
  21375. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21376. }
  21377. else {
  21378. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21379. }
  21380. let localData = DataMgr.getPlaceBallLevel(this.level);
  21381. let getAward = localData.getAward;
  21382. let cfg = cfgTable.placeballData[this.level];
  21383. let coin = this.data.award[0];
  21384. let diamond = this.data.award[1];
  21385. if (cfg.type == PlaceBallType.challenge) {
  21386. diamond = 0;
  21387. coin = 100;
  21388. }
  21389. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21390. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21391. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21392. if (cfg.type == PlaceBallType.challenge) {
  21393. this.ui.myNode.coinNode.numTxt.text = "";
  21394. }
  21395. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21396. if (coin > 0 && diamond > 0) {
  21397. this.ui.myNode.diamondNode.x = 385;
  21398. this.ui.myNode.coinNode.x = 467;
  21399. }
  21400. else {
  21401. this.ui.myNode.diamondNode.x = 385;
  21402. this.ui.myNode.coinNode.x = 385;
  21403. }
  21404. if (!getAward) {
  21405. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21406. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21407. }
  21408. else {
  21409. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21410. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21411. }
  21412. }
  21413. startGame() {
  21414. if (DataMgr.powerEnough()) {
  21415. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21416. this.ui.myNode.startBtn.touchable = false;
  21417. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21418. console.log('zh:startGame ');
  21419. this.ui.myNode.startBtn.touchable = true;
  21420. DataMgr.setPower(-1);
  21421. xGame.eventMgr.event(POWER_TIME);
  21422. xGame.common.gameMode = GameMode.placeBall;
  21423. xGame.common.placeBallCurLevel = this.level;
  21424. xGame.uiMgr.Show(UIGame$1);
  21425. this.logEventForChallenge_level_start(this.level);
  21426. xGame.uiMgr.Hide(UILevelDisplay$1);
  21427. xGame.uiMgr.Hide(UIMain$1);
  21428. this.hide();
  21429. }));
  21430. }
  21431. else {
  21432. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21433. xGame.uiMgr.Show(UIPower$1);
  21434. }
  21435. }
  21436. logEventForChallenge_level_start(level) {
  21437. let keyStr = 'sjmd_challenge_level_start';
  21438. let jsonStr = {
  21439. "count": 1,
  21440. "gold_balance ": DataMgr.getCoin(),
  21441. "level": level,
  21442. "diamond_balance ": DataMgr.getDiamond()
  21443. };
  21444. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21445. const d = LocalStorageManager.getItem(keyStr);
  21446. if (level > d.level) {
  21447. jsonStr.count = d.count + 1;
  21448. LocalStorageManager.setItem(keyStr, jsonStr);
  21449. }
  21450. else {
  21451. }
  21452. }
  21453. else {
  21454. LocalStorageManager.setItem(keyStr, jsonStr);
  21455. }
  21456. const reqStr = JSON.stringify(jsonStr);
  21457. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21458. }
  21459. hide() {
  21460. super.hide();
  21461. }
  21462. }
  21463. UILevelProp$1.uiName = "UILevelProp";
  21464. class PutBallLevelDisplay$1 {
  21465. constructor(ui, index) {
  21466. this.index = 0;
  21467. this.ui = ui;
  21468. this.index = index;
  21469. this.ui.onClick(this, this.clickSelf);
  21470. this.updateSelf();
  21471. this.ui.levelTxt.text = (this.index + 1) + "";
  21472. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21473. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21474. }
  21475. updateSelf() {
  21476. let level = this.index + 1;
  21477. this.data = DataMgr.getPlaceBallLevel(level);
  21478. this.ui.starNode.c1.selectedIndex = this.data.star;
  21479. let isChallenge = cfgTable.placeballData[level].type;
  21480. if (this.data.isCur) {
  21481. if (isChallenge) {
  21482. this.ui.c1.selectedIndex = 5;
  21483. }
  21484. else {
  21485. this.ui.c1.selectedIndex = 2;
  21486. }
  21487. }
  21488. else {
  21489. if (this.data.play) {
  21490. if (this.data.star == 3) {
  21491. this.ui.c1.selectedIndex = 0;
  21492. }
  21493. else {
  21494. this.ui.c1.selectedIndex = 1;
  21495. }
  21496. }
  21497. else {
  21498. if (isChallenge) {
  21499. this.ui.c1.selectedIndex = 4;
  21500. }
  21501. else {
  21502. this.ui.c1.selectedIndex = 3;
  21503. }
  21504. }
  21505. }
  21506. }
  21507. clickSelf() {
  21508. if (!this.data.play)
  21509. return;
  21510. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21511. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21512. }
  21513. }
  21514. class UILevelDisplay$1 extends UIBase {
  21515. constructor() {
  21516. super();
  21517. }
  21518. onConstructor() {
  21519. this.ui = ui_UILevelDisplay.createInstance();
  21520. this.contentPane = this.ui;
  21521. this.isEject = false;
  21522. this.myList = this.ui.myNode.myList;
  21523. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21524. this.levelItemArr = [];
  21525. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21526. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21527. this.myList.numItems = levelNum;
  21528. }
  21529. levelItemRender(index, target) {
  21530. let item = new PutBallLevelDisplay$1(target, index);
  21531. this.levelItemArr.push(item);
  21532. }
  21533. show() {
  21534. super.show();
  21535. this.updateLevel();
  21536. this.scrollToPlace();
  21537. }
  21538. updateLevel() {
  21539. let temp;
  21540. for (let index = 0; index < this.levelItemArr.length; index++) {
  21541. temp = this.levelItemArr[index];
  21542. temp.updateSelf();
  21543. }
  21544. }
  21545. scrollToPlace() {
  21546. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21547. let passArr = DataMgr.getPlaceBallLevelList();
  21548. let offest = passArr.length;
  21549. if (offest >= maxNum - 1)
  21550. offest = maxNum - 1;
  21551. this.myList.scrollToView(offest, true, true);
  21552. }
  21553. hide() {
  21554. super.hide();
  21555. }
  21556. }
  21557. UILevelDisplay$1.uiName = "UILevelDisplay";
  21558. class UIMatching$1 extends UIBase {
  21559. constructor() {
  21560. super();
  21561. }
  21562. onConstructor() {
  21563. this.ui = ui_UIMatching.createInstance();
  21564. this.contentPane = this.ui;
  21565. this.isEject = false;
  21566. }
  21567. show(callback) {
  21568. super.show();
  21569. PlatMgr.showBanner(true);
  21570. this.callback = callback;
  21571. let user = Moyu.getUserInfo();
  21572. if (!this.selfPot) {
  21573. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21574. }
  21575. if (!this.aiPot) {
  21576. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21577. }
  21578. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21579. this.ui.selfHead.nameTxt.text = user.nickName;
  21580. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21581. this.ui.aiHead.nameTxt.text = "???";
  21582. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21583. this.ui.selfHead.c1.selectedIndex = 0;
  21584. this.ui.aiHead.c1.selectedIndex = 0;
  21585. this.ui.selfHead.x = this.selfPot.x;
  21586. this.ui.selfHead.y = this.selfPot.y;
  21587. this.ui.aiHead.x = this.aiPot.x;
  21588. this.ui.aiHead.y = this.aiPot.y;
  21589. switch (xGame.common.gameMode) {
  21590. case GameMode.classic:
  21591. break;
  21592. case GameMode.bigMove:
  21593. this.initSkillData();
  21594. break;
  21595. default:
  21596. break;
  21597. }
  21598. this.ui.t1.play(Laya.Handler.create(this, () => {
  21599. this.ui.t2.play(Laya.Handler.create(this, () => {
  21600. switch (xGame.common.gameMode) {
  21601. case GameMode.classic:
  21602. this.waitingPeople();
  21603. break;
  21604. case GameMode.bigMove:
  21605. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21606. break;
  21607. default:
  21608. break;
  21609. }
  21610. }));
  21611. }));
  21612. }
  21613. initSkillData() {
  21614. this.skillSelectData = [];
  21615. let skillUrl = xGame.common.skillIconList;
  21616. let skillName = xGame.common.skillNameList;
  21617. let skillLevel = DataMgr.getBigSkillList();
  21618. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21619. for (let index = 0; index < 5; index++) {
  21620. let obj = {};
  21621. obj.skillImg = skillUrl[index];
  21622. obj.skillName = skillName[index];
  21623. obj.skillType = skillType[index];
  21624. obj.skillLevel = skillLevel[index];
  21625. this.skillSelectData.push(obj);
  21626. }
  21627. }
  21628. getAISkillLevel(myLevel) {
  21629. let video = xGame.common.upSkillLevel;
  21630. let aiLevel;
  21631. let temp;
  21632. if (video) {
  21633. temp = xGame.common.randomNum(-2, -1);
  21634. }
  21635. else {
  21636. if (myLevel <= 5) {
  21637. temp = xGame.common.randomNum(1, 3);
  21638. }
  21639. else if (myLevel <= 9) {
  21640. temp = xGame.common.randomNum(-2, 1);
  21641. }
  21642. else {
  21643. temp = xGame.common.randomNum(-4, 0);
  21644. }
  21645. }
  21646. aiLevel = temp + myLevel;
  21647. if (aiLevel <= 1)
  21648. aiLevel = 1;
  21649. if (aiLevel >= 10)
  21650. aiLevel = 10;
  21651. return aiLevel;
  21652. }
  21653. getAISkillType() {
  21654. return xGame.common.randomNum(1, 4);
  21655. let successTimes = DataMgr.getSkillSuccessTimes();
  21656. let info = cfgTable.aiskillData[successTimes];
  21657. if (!info) {
  21658. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21659. info = cfgTable.aiskillData[max];
  21660. }
  21661. let dataArr = info.skillselect;
  21662. let myCfg = {};
  21663. for (let index = 0; index < dataArr.length; index++) {
  21664. let temp = dataArr[index].split('-');
  21665. myCfg[temp[0]] = {};
  21666. myCfg[temp[0]].id = parseInt(temp[0]);
  21667. myCfg[temp[0]].weight = parseInt(temp[1]);
  21668. }
  21669. let aiCfg = xGame.common.initWeight(myCfg);
  21670. let curData = xGame.common.getRandomWeightData(aiCfg);
  21671. return parseInt(curData.id);
  21672. }
  21673. getAISkillData(index) {
  21674. let myLevel = this.skillSelectData[index].skillLevel;
  21675. let aiLevel = this.getAISkillLevel(myLevel);
  21676. let aiType = this.getAISkillType() - 1;
  21677. return { aiLevel, aiType } = { aiLevel, aiType };
  21678. }
  21679. skillSelectFinish(index) {
  21680. let aiInfo = this.getAISkillData(index);
  21681. xGame.common.gameMgr.selfCurSkill = index;
  21682. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21683. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21684. this.ui.selfHead.c1.selectedIndex = 1;
  21685. this.ui.aiHead.c1.selectedIndex = 1;
  21686. let myData = this.skillSelectData[index];
  21687. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21688. let guide = DataMgr.getSkillGuide();
  21689. if (guide == 0) {
  21690. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21691. }
  21692. else {
  21693. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21694. }
  21695. let aiData = this.skillSelectData[aiInfo.aiType];
  21696. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21697. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21698. this.waitingPeople();
  21699. }
  21700. waitingPeople() {
  21701. let time = xGame.common.randomNum(1000, 3000);
  21702. time += 1000;
  21703. Laya.timer.once(time, this, () => {
  21704. this.matchingSuccess();
  21705. });
  21706. }
  21707. matchingSuccess() {
  21708. let gameUI = xGame.common.gameUI;
  21709. let name = gameUI.ui.topNode.aiNameTxt.text;
  21710. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21711. this.ui.aiHead.nameTxt.text = name;
  21712. this.ui.aiHead.headImg.url = url;
  21713. name = gameUI.ui.topNode.selfNameTxt.text;
  21714. url = gameUI.ui.topNode.selfHeadLoader.url;
  21715. this.ui.selfHead.nameTxt.text = name;
  21716. this.ui.selfHead.headImg.url = url;
  21717. this.ui.t3.play(Laya.Handler.create(this, () => {
  21718. this.callback && this.callback();
  21719. this.ui.t4.play(Laya.Handler.create(this, () => {
  21720. this.destroySelf();
  21721. }));
  21722. }));
  21723. }
  21724. destroySelf() {
  21725. this.callback = null;
  21726. this.skillSelectData = null;
  21727. this.selfPot = null;
  21728. this.aiPot = null;
  21729. if (!this.ui.isDisposed) {
  21730. this.ui.removeFromParent();
  21731. this.ui.dispose();
  21732. }
  21733. xGame.uiMgr.destroyUI(this);
  21734. }
  21735. }
  21736. UIMatching$1.uiName = "UIMatching";
  21737. class SkillDisplay$1 {
  21738. constructor(ui, data, uiIndex) {
  21739. this.starX = 0;
  21740. this.starY = 0;
  21741. this.index = 0;
  21742. this.ui = ui;
  21743. this.data = data;
  21744. this.index = uiIndex;
  21745. this.initSelf();
  21746. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21747. }
  21748. initSelf() {
  21749. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21750. this.ui.nameTxt.text = this.data.name;
  21751. this.ui.describeTxt.text = this.data.describe;
  21752. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21753. this.ui.startBtn.onClick(this, this.startGame);
  21754. this.updateSelf();
  21755. }
  21756. updateSelf() {
  21757. this.checkTry();
  21758. let level = DataMgr.getBigSkillByIndex(this.index);
  21759. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21760. }
  21761. checkTry() {
  21762. let index = this.index;
  21763. let level = DataMgr.getBigSkillByIndex(index);
  21764. if (level == null) {
  21765. DataMgr.setBigSkill(index, 1, false);
  21766. level = 1;
  21767. }
  21768. this.ui.levelTxt.text = "LV." + level;
  21769. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21770. this.ui.tryNode.visible = true;
  21771. else
  21772. this.ui.tryNode.visible = false;
  21773. }
  21774. clickAddLevel() {
  21775. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21776. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21777. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21778. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21779. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21780. }
  21781. else {
  21782. console.log('zh:AD 失败,直接发放奖励');
  21783. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21784. }
  21785. }
  21786. qjff_AD_for_skilldisplay_clickAddLevel() {
  21787. DataMgr.setBigSkill(this.data.index, 1);
  21788. this.updateSelf();
  21789. xGame.common.upSkillLevel = true;
  21790. }
  21791. startGame() {
  21792. console.log('zh:rod skill startgame');
  21793. if (this.data.index == 3) {
  21794. alert('Coming soon!');
  21795. return;
  21796. }
  21797. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21798. let needCoin = xGame.common.bigMoveNeedCoin;
  21799. xGame.common.passAwardCoin = 2000;
  21800. let guide = DataMgr.getSkillGuide();
  21801. console.log('zh:startGame guide=' + guide);
  21802. xGame.common.temSelfLevel = 0;
  21803. if (guide == 0) {
  21804. needCoin = 0;
  21805. xGame.common.temSelfLevel = 100;
  21806. }
  21807. if (DataMgr.coinEnough(needCoin)) {
  21808. DataMgr.setCoin(-needCoin);
  21809. xGame.common.curPlayerSkillType = this.index;
  21810. if (guide == 0)
  21811. xGame.common.curPlayerSkillType = 0;
  21812. console.log('zh: skilldisplay 1');
  21813. xGame.uiMgr.Show(UIGame$1);
  21814. xGame.uiMgr.Hide(UIMain$1);
  21815. xGame.uiMgr.Show(UIMatching$1, () => {
  21816. xGame.common.gameUI.ui.alpha = 1;
  21817. xGame.common.gameUI.startGame();
  21818. xGame.uiMgr.Hide(UISkill$1);
  21819. });
  21820. this.logEventForRod_start();
  21821. }
  21822. else {
  21823. console.log('zh: skilldisplay 2');
  21824. xGame.uiMgr.Show(UIAddProp$1, 0);
  21825. Moyu.sendDataEvent("AddCoinVideo");
  21826. }
  21827. }
  21828. logEventForRod_start() {
  21829. let gfmsIdx = xGame.common.curPlayerSkillType;
  21830. console.log('zh:选择的技能=' + gfmsIdx);
  21831. let gfmc = 'Skyfall Shot';
  21832. if (gfmsIdx == 0) {
  21833. gfmc = 'Skyfall Shot';
  21834. }
  21835. if (gfmsIdx == 1) {
  21836. gfmc = 'Surging break';
  21837. }
  21838. if (gfmsIdx == 2) {
  21839. gfmc = 'Frost Lock';
  21840. }
  21841. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21842. let jsonStr = {
  21843. "count": 0,
  21844. "name": gfmc
  21845. };
  21846. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21847. const d = LocalStorageManager.getItem(keyStr);
  21848. jsonStr.count = d.count + 1;
  21849. LocalStorageManager.setItem(keyStr, jsonStr);
  21850. }
  21851. else {
  21852. LocalStorageManager.setItem(keyStr, jsonStr);
  21853. }
  21854. const reqStr = JSON.stringify(jsonStr);
  21855. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21856. }
  21857. }
  21858. class UISkill$1 extends UIBase {
  21859. constructor() {
  21860. super();
  21861. this.skillData = [];
  21862. }
  21863. onConstructor() {
  21864. this.ui = ui_UISkill.createInstance();
  21865. this.contentPane = this.ui;
  21866. this.isEject = false;
  21867. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21868. this.initSkillData();
  21869. console.log('zh:aaaaaa1111111111');
  21870. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21871. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21872. console.log('zh:aaaaaa22222222');
  21873. this.displayList = [];
  21874. this.ui.skillNode.skillList.numItems = 3;
  21875. this.addUIClick(this.ui, this.interuptSecretary);
  21876. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21877. this.ui.talkNode.visible = false;
  21878. if (Moyu.isKs)
  21879. this.ui.closeNode.closeBtn.x += 100;
  21880. }
  21881. show() {
  21882. super.show();
  21883. this.playSecretaryIdle();
  21884. this.moneyNode.ui.c1.selectedIndex = 1;
  21885. Laya.timer.clearAll(this);
  21886. xGame.soundMgr.playSound("s_start");
  21887. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21888. let guide = DataMgr.getSkillGuide();
  21889. this.ui.guideNode.visible = guide == 0;
  21890. let item = this.getSkillItemByUIIndex(0);
  21891. if (guide == 0) {
  21892. item.ui.c1.selectedIndex = 1;
  21893. }
  21894. else {
  21895. item.ui.c1.selectedIndex = 0;
  21896. }
  21897. this.ui.guideNode.guideBtn.visible = guide == 0;
  21898. for (let index = 0; index < this.displayList.length; index++) {
  21899. this.displayList[index].checkTry();
  21900. }
  21901. }
  21902. getSkillItemByUIIndex(cur) {
  21903. for (let index = 0; index < this.displayList.length; index++) {
  21904. if (this.displayList[index].index == cur) {
  21905. return this.displayList[index];
  21906. }
  21907. }
  21908. }
  21909. enterGuideLevel() {
  21910. let item = this.getSkillItemByUIIndex(0);
  21911. item.startGame();
  21912. if (DataMgr.getNewUser())
  21913. Moyu.sendDataEvent("gameStart1");
  21914. }
  21915. initSkillData() {
  21916. this.skillData = [];
  21917. let nameList = xGame.common.skillNameList;
  21918. let iconList = xGame.common.skillIconList;
  21919. let describeList = [
  21920. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  21921. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  21922. "The power of frost descends—freezing the flow and taking full control of the game!"
  21923. ];
  21924. console.log('zh:initSkillData 111111111');
  21925. let data;
  21926. for (let index = 0; index < nameList.length; index++) {
  21927. data = {};
  21928. data.name = nameList[index];
  21929. data.icon = iconList[index];
  21930. data.describe = describeList[index];
  21931. data.index = index;
  21932. this.skillData.push(data);
  21933. }
  21934. }
  21935. updateSkillItem(index, target) {
  21936. if (this.displayList[index] == null) {
  21937. let uiIndex;
  21938. switch (index) {
  21939. case 0:
  21940. uiIndex = 1;
  21941. break;
  21942. case 1:
  21943. uiIndex = 0;
  21944. break;
  21945. case 2:
  21946. uiIndex = 2;
  21947. break;
  21948. case 3:
  21949. uiIndex = 3;
  21950. break;
  21951. default:
  21952. break;
  21953. }
  21954. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  21955. this.displayList.push(temp);
  21956. }
  21957. }
  21958. playSecretaryIdle() {
  21959. let parent = this.ui.secretary.displayObject;
  21960. parent.destroyChildren();
  21961. let xx = this.ui.secretary.width / 2;
  21962. let yy = this.ui.secretary.height;
  21963. let scale = xGame.common.getSecretaryScale();
  21964. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21965. xGame.common.secretary.play(data, 0, true, parent);
  21966. }
  21967. returnUIMain() {
  21968. this.hide();
  21969. xGame.common.stopGirlPop(this.ui.talkNode);
  21970. xGame.uiMgr.Show(UIMain$1);
  21971. }
  21972. interuptSecretary() {
  21973. Laya.timer.clearAll(this);
  21974. this.playSecretaryRandomSound();
  21975. }
  21976. playSecretaryRandomSound() {
  21977. if (this.isHide)
  21978. return;
  21979. let time = xGame.common.randomNum(45000, 60000);
  21980. Laya.timer.once(time, this, () => {
  21981. if (this.isHide)
  21982. return;
  21983. let index = xGame.common.randomNum(4, 7);
  21984. xGame.soundMgr.playSound("s_main0" + index);
  21985. let words = 1;
  21986. switch (index) {
  21987. case 4:
  21988. words = 5;
  21989. break;
  21990. case 5:
  21991. words = 3;
  21992. break;
  21993. case 6:
  21994. words = 6;
  21995. break;
  21996. case 7:
  21997. words = 7;
  21998. break;
  21999. default:
  22000. break;
  22001. }
  22002. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22003. this.playSecretaryRandomSound();
  22004. });
  22005. }
  22006. }
  22007. UISkill$1.uiName = "UISkill";
  22008. class UIAddProp$1 extends UIBase {
  22009. constructor() {
  22010. super();
  22011. this.curType = "";
  22012. }
  22013. onConstructor() {
  22014. this.ui = ui_UIAddProp.createInstance();
  22015. this.contentPane = this.ui;
  22016. this.isEject = false;
  22017. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22018. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22019. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22020. this.updateUI();
  22021. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22022. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22023. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22024. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22025. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22026. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22027. }
  22028. show(type) {
  22029. super.show();
  22030. this.curType = type == 0 ? "coin" : "diamond";
  22031. this.switchBtn("");
  22032. this.ui.t0.play();
  22033. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22034. PlatMgr.showInsert(true);
  22035. }
  22036. closeSelf() {
  22037. this.hide();
  22038. }
  22039. updateUI() {
  22040. let data = cfgTable.moneyData;
  22041. let temp;
  22042. let obj;
  22043. for (const key in data) {
  22044. temp = data[key];
  22045. obj = this.ui.myNode["node" + key];
  22046. if (parseInt(key) <= 2) {
  22047. obj.diamondTxt.text = "+" + temp.num;
  22048. }
  22049. else {
  22050. obj.coinTxt.text = temp.num;
  22051. obj.diamondTxt.text = temp.get.split('_')[1];
  22052. }
  22053. }
  22054. this.updateDiamondShare();
  22055. }
  22056. updateDiamondShare() {
  22057. let data = DataMgr.getShareDiamondTimes();
  22058. if (data >= xGame.common.maxShareDiamondTimes) {
  22059. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22060. this.ui.myNode.node1.touchable = false;
  22061. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22062. }
  22063. else {
  22064. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22065. this.ui.myNode.node1.touchable = true;
  22066. }
  22067. }
  22068. switchBtn(type) {
  22069. if (type == "")
  22070. type = this.curType;
  22071. else {
  22072. if (this.curType == type) {
  22073. return;
  22074. }
  22075. else {
  22076. this.curType = type;
  22077. }
  22078. }
  22079. if (type == "coin") {
  22080. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22081. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22082. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22083. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22084. this.ui.myNode.c1.selectedIndex = 0;
  22085. }
  22086. else {
  22087. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22088. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22089. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22090. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22091. this.ui.myNode.c1.selectedIndex = 1;
  22092. }
  22093. }
  22094. convertCoin(index) {
  22095. let data = cfgTable.moneyData[index];
  22096. let coinNum = data.num;
  22097. let str = data.get.split('_')[1];
  22098. let needDiamond = parseInt(str);
  22099. if (DataMgr.diamondEnough(needDiamond)) {
  22100. DataMgr.setDiamond(-needDiamond);
  22101. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22102. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22103. }
  22104. else {
  22105. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22106. this.switchBtn("diamond");
  22107. }
  22108. }
  22109. videoGetDiamond() {
  22110. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22111. if (Laya.Browser.onAndroid) {
  22112. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22113. if (!boo) {
  22114. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22115. return;
  22116. }
  22117. }
  22118. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22119. }
  22120. else {
  22121. console.log('zh:AD 失败,直接发放奖励');
  22122. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22123. }
  22124. }
  22125. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22126. let num = cfgTable.moneyData[2].num;
  22127. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22128. this.closeSelf();
  22129. }
  22130. videoGetCoin() {
  22131. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22132. if (Laya.Browser.onAndroid) {
  22133. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22134. if (!boo) {
  22135. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22136. return;
  22137. }
  22138. }
  22139. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22140. }
  22141. else {
  22142. console.log('zh:AD 失败,直接发放奖励');
  22143. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22144. }
  22145. }
  22146. qjff_AD_for_uiAddProp_videoGetCoin() {
  22147. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22148. this.closeSelf();
  22149. }
  22150. shareGetDiamond() {
  22151. let times = DataMgr.getShareDiamondTimes();
  22152. if (times >= xGame.common.maxShareDiamondTimes) {
  22153. console.log('zh: 233333333333 maxShareDiamondTimes');
  22154. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22155. }
  22156. else {
  22157. console.log('zh:33333333333333ad');
  22158. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22159. if (Laya.Browser.onAndroid) {
  22160. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22161. if (!boo) {
  22162. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22163. return;
  22164. }
  22165. }
  22166. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22167. }
  22168. else {
  22169. console.log('zh:AD 失败,直接发放奖励');
  22170. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22171. }
  22172. }
  22173. }
  22174. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22175. let diamond = xGame.common.randomNum(50, 100);
  22176. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22177. DataMgr.setShareDiamondTimes(1);
  22178. this.updateDiamondShare();
  22179. }
  22180. openPutBallView() {
  22181. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22182. let skill = xGame.uiMgr.getUI(UISkill$1);
  22183. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22184. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22185. if (end && !end.isHide) {
  22186. xGame.uiMgr.Hide(UIGameEnd$1);
  22187. xGame.uiMgr.Show(UIMain$1);
  22188. }
  22189. if (skill && !skill.isHide)
  22190. xGame.uiMgr.Hide(UISkill$1);
  22191. if (uigame && !uigame.isHide)
  22192. xGame.uiMgr.Hide(UIGame$1);
  22193. if (level && !level.isHide) {
  22194. }
  22195. else {
  22196. xGame.uiMgr.Show(UILevelDisplay$1);
  22197. }
  22198. this.closeSelf();
  22199. }
  22200. }
  22201. UIAddProp$1.uiName = "UIAddProp";
  22202. class MoneyNode$1 {
  22203. constructor(ui) {
  22204. this.leftTime = 0;
  22205. this.ui = ui;
  22206. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22207. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22208. this.ui.addPowerBtn.onClick(this, this.addPower);
  22209. this.ui.c1.selectedIndex = 1;
  22210. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22211. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22212. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22213. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22214. this.coinChange();
  22215. this.diamondChange();
  22216. this.powerChange();
  22217. }
  22218. addPower() {
  22219. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22220. xGame.uiMgr.Show(UIPower$1);
  22221. }
  22222. powerChange() {
  22223. let powerNum = DataMgr.getPower();
  22224. this.ui.powerTxt.text = powerNum + "";
  22225. }
  22226. checkPowerTime() {
  22227. let cur = new Date().getTime();
  22228. let last = DataMgr.getPowerTime();
  22229. if (last == 0) {
  22230. last = cur;
  22231. DataMgr.setPowerTime(cur);
  22232. }
  22233. let power = DataMgr.getPower();
  22234. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22235. Laya.timer.clearAll(this);
  22236. if (power >= xGame.common.natureMaxPower) {
  22237. this.ui.powerTimeTxt.text = "";
  22238. DataMgr.setPowerTime(cur);
  22239. return;
  22240. }
  22241. if (power + offset >= xGame.common.natureMaxPower) {
  22242. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22243. this.ui.powerTimeTxt.text = "";
  22244. DataMgr.setPowerTime(cur);
  22245. }
  22246. else {
  22247. if (offset > 0) {
  22248. DataMgr.setPower(offset);
  22249. DataMgr.setPowerTime(cur);
  22250. }
  22251. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22252. this.leftTime = xGame.common.powerRecoverNum - time;
  22253. if (this.leftTime <= 0)
  22254. this.leftTime = 0;
  22255. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22256. Laya.timer.loop(1000, this, this.updatePowerTime);
  22257. }
  22258. }
  22259. updatePowerTime() {
  22260. this.leftTime -= 1;
  22261. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22262. if (this.leftTime <= 0) {
  22263. this.checkPowerTime();
  22264. }
  22265. }
  22266. coinChange() {
  22267. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22268. }
  22269. diamondChange() {
  22270. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22271. }
  22272. addCoin() {
  22273. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22274. Moyu.sendDataEvent("AddCoinBtn");
  22275. xGame.uiMgr.Show(UIAddProp$1, 0);
  22276. }
  22277. addDiamond() {
  22278. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22279. Moyu.sendDataEvent("AddDiamondBtn");
  22280. xGame.uiMgr.Show(UIAddProp$1, 1);
  22281. }
  22282. }
  22283. class SettingNode$1 {
  22284. constructor(ui) {
  22285. this.showSetting = false;
  22286. this.openSound = true;
  22287. this.openShake = true;
  22288. this.ui = ui;
  22289. this.ui.soundBtn.onClick(this, this.switchSound);
  22290. this.ui.shakeBtn.onClick(this, this.switchShake);
  22291. this.ui.xyBtn.onClick(this, this.onXy);
  22292. this.ui.clickNode.onClick(this, this.changeSetting);
  22293. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22294. this.ui.xyBtn.visible = false;
  22295. this.ui.shakeBtn.visible = false;
  22296. }
  22297. changeSetting() {
  22298. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22299. this.showSetting = !this.showSetting;
  22300. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22301. }
  22302. switchSound() {
  22303. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22304. this.openSound = !this.openSound;
  22305. Moyu.onSetting(this.openSound, this.openShake);
  22306. xGame.soundMgr.onSetting(this.openSound);
  22307. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22308. }
  22309. switchShake() {
  22310. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22311. this.openShake = !this.openShake;
  22312. Moyu.onSetting(this.openSound, this.openShake);
  22313. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22314. }
  22315. onXy() {
  22316. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22317. MoyuMgr$1.showXy(1);
  22318. }
  22319. }
  22320. class UIDraw$1 extends UIBase {
  22321. constructor() {
  22322. super();
  22323. this.curKey = 0;
  22324. }
  22325. onConstructor() {
  22326. this.ui = ui_UIDraw.createInstance();
  22327. this.contentPane = this.ui;
  22328. this.isEject = false;
  22329. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22330. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22331. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22332. this.initDraw();
  22333. this.initUI();
  22334. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22335. }
  22336. show() {
  22337. super.show();
  22338. this.ui.t0.play();
  22339. this.playSecretaryIdle();
  22340. this.updateDraw();
  22341. this.checkFree();
  22342. if (PlatMgr.bannerDelay > 0) {
  22343. this.ui.closeNode.closeBtn.visible = false;
  22344. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22345. this.ui.closeNode.closeBtn.visible = true;
  22346. });
  22347. }
  22348. PlatMgr.showRateBanner();
  22349. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22350. }
  22351. hide() {
  22352. Laya.timer.clearAll(this);
  22353. super.hide();
  22354. }
  22355. checkFree() {
  22356. let isFree = DataMgr.getDailyfreeDrawTimes();
  22357. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22358. }
  22359. initDraw() {
  22360. this.drawObj = [];
  22361. let data = cfgTable.drawData;
  22362. let temp;
  22363. let weight = 0;
  22364. for (const key in data) {
  22365. temp = data[key];
  22366. weight += temp.weight;
  22367. this.drawObj.push(weight);
  22368. }
  22369. this.allWeight = weight;
  22370. }
  22371. initUI() {
  22372. let data = cfgTable.drawData;
  22373. let temp;
  22374. let img;
  22375. let txt;
  22376. for (const key in data) {
  22377. temp = data[key];
  22378. img = this.ui.myNode.rotNode["img" + key];
  22379. txt = this.ui.myNode.rotNode["txt" + key];
  22380. img.url = xGame.common.getGameIconUrl(temp.icon);
  22381. txt.visible = true;
  22382. if (temp.award > 2) {
  22383. img.rotation = 0;
  22384. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22385. }
  22386. else {
  22387. img.rotation = temp.rotation;
  22388. txt.text = temp.num;
  22389. }
  22390. }
  22391. }
  22392. getCurkey() {
  22393. let rand = Math.random() * this.allWeight;
  22394. let temp;
  22395. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22396. temp = this.drawObj[index];
  22397. if (index == 0) {
  22398. if (rand < temp) {
  22399. return index + 1;
  22400. }
  22401. }
  22402. else {
  22403. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22404. return index + 1;
  22405. }
  22406. }
  22407. }
  22408. return 2;
  22409. }
  22410. startDraw() {
  22411. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22412. if (freeTimes > 0) {
  22413. this.beginDraw();
  22414. DataMgr.setDailyfreeDrawTimes(0);
  22415. this.checkFree();
  22416. }
  22417. else {
  22418. if (Laya.Browser.onAndroid) {
  22419. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22420. if (!boo) {
  22421. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22422. return;
  22423. }
  22424. }
  22425. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22426. }
  22427. else {
  22428. console.log('zh:AD 失败,直接发放奖励');
  22429. this.qjff_chouJiang();
  22430. }
  22431. }
  22432. }
  22433. qjff_chouJiang() {
  22434. this.beginDraw();
  22435. }
  22436. beginDraw() {
  22437. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22438. this.ui.drawBtn.touchable = false;
  22439. this.curKey = this.getCurkey();
  22440. console.log("当前key", this.curKey);
  22441. let cell = 60;
  22442. let lap = 3;
  22443. let angle = cell * (this.curKey - 1) + lap * 360;
  22444. let target = this.ui.myNode.rotNode;
  22445. target.rotation = 0;
  22446. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22447. console.log("旋转完成");
  22448. this.ui.drawBtn.touchable = true;
  22449. this.getAward();
  22450. }));
  22451. }
  22452. getAward() {
  22453. let data = cfgTable.drawData[this.curKey];
  22454. let temp = new AwardType();
  22455. temp.type = data.award;
  22456. temp.num = data.num;
  22457. xGame.common.getAward([temp], () => {
  22458. DataMgr.setDrawTimes(1);
  22459. this.updateDraw();
  22460. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22461. });
  22462. }
  22463. updateDraw() {
  22464. let drawTimes = DataMgr.getDrawTimes();
  22465. let awardTimes = DataMgr.getDrawAwardTimes();
  22466. if (Math.floor(drawTimes / 3) > awardTimes) {
  22467. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22468. this.ui.extraNode.boxBtn.touchable = true;
  22469. this.ui.extraNode.tipsTxt.text = "3/3";
  22470. this.ui.extraNode.barNode.width = 265;
  22471. this.getExtraAward();
  22472. }
  22473. else {
  22474. this.ui.extraNode.boxBtn.t0.stop();
  22475. this.ui.extraNode.boxBtn.touchable = false;
  22476. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22477. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22478. }
  22479. let data = cfgTable.drawData[1];
  22480. if (awardTimes == 0) {
  22481. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22482. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22483. this.ui.myNode.rotNode.img1.rotation = 0;
  22484. }
  22485. else {
  22486. let award = data.nextid;
  22487. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22488. this.ui.myNode.rotNode.txt1.text = award[1];
  22489. this.ui.myNode.rotNode.img1.rotation = 0;
  22490. }
  22491. }
  22492. getExtraAward() {
  22493. let drawTimes = DataMgr.getDrawTimes();
  22494. let awardTimes = DataMgr.getDrawAwardTimes();
  22495. let data = cfgTable.drawData[1];
  22496. let award = new AwardType();
  22497. if (awardTimes == 0) {
  22498. award.num = data.num;
  22499. award.type = data.award;
  22500. xGame.common.getAward([award], () => {
  22501. let all = Math.floor(drawTimes / 3);
  22502. DataMgr.setDrawAwardTimes(all);
  22503. this.updateDraw();
  22504. });
  22505. }
  22506. else {
  22507. award.num = parseInt(data.nextid[1]);
  22508. award.type = parseInt(data.nextid[0]);
  22509. xGame.common.getAward([award], () => {
  22510. let all = Math.floor(drawTimes / 3);
  22511. DataMgr.setDrawAwardTimes(all);
  22512. this.updateDraw();
  22513. });
  22514. }
  22515. }
  22516. closeSelf() {
  22517. this.hide();
  22518. }
  22519. playSecretaryIdle() {
  22520. let parent = this.ui.secretary.displayObject;
  22521. parent.destroyChildren();
  22522. let xx = this.ui.secretary.width / 2;
  22523. let yy = this.ui.secretary.height;
  22524. let scale = xGame.common.getSecretaryScale();
  22525. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22526. xGame.common.secretary.play(data, 0, true, parent);
  22527. }
  22528. }
  22529. UIDraw$1.uiName = "UIDraw";
  22530. class UIRanking$1 extends UIBase {
  22531. constructor() {
  22532. super();
  22533. this.showSelf = true;
  22534. this.rankType = 1;
  22535. this.rankList = [];
  22536. this.topX = 10;
  22537. this.myIndex = this.topX + 1;
  22538. this.myStar = 0;
  22539. }
  22540. onConstructor() {
  22541. this.ui = ui_UIRanking.createInstance();
  22542. this.contentPane = this.ui;
  22543. this.isEject = false;
  22544. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22545. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22546. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22547. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22548. this.ui.myNode.myList.setVirtual();
  22549. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22550. }
  22551. show() {
  22552. super.show();
  22553. this.getPaiHangBangDataFormJosnFile();
  22554. this.updateSelf();
  22555. let self = Moyu.getUserInfo();
  22556. if (!self.isAuth) {
  22557. Moyu.initUser(this, () => {
  22558. DataMgr.upRankData();
  22559. });
  22560. }
  22561. }
  22562. getPaiHangBangDataFormJosnFile() {
  22563. const rankingList = cfgTable.paiHangBangData.list;
  22564. this.updateItemData(rankingList);
  22565. }
  22566. updateSelfItem() {
  22567. console.log('zh:Moyu.platType =' + Moyu.platType);
  22568. let self = Moyu.getUserInfo();
  22569. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22570. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22571. if (this.myIndex > this.topX) {
  22572. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22573. }
  22574. else {
  22575. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22576. }
  22577. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22578. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22579. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22580. }
  22581. updateItemData(data) {
  22582. this.myStar = xGame.common.getAllStarNum();
  22583. if (this.rankList.length < 2) {
  22584. this.rankList = data;
  22585. let self = Moyu.getUserInfo();
  22586. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22587. self.headIcon = self.headIcon;
  22588. for (let i = 0; i < data.length; i++) {
  22589. let data = this.rankList[i];
  22590. if (data.userId == self.userId) {
  22591. this.rankList.splice(i, 1);
  22592. break;
  22593. }
  22594. }
  22595. for (let i = 0; i < data.length; i++) {
  22596. let data = this.rankList[i];
  22597. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22598. this.myIndex = i + 1;
  22599. let user = { headIcon: self.headIcon, nickName: "myself" };
  22600. let ud = { user: user, data: {} };
  22601. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22602. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22603. if (Moyu.platType < 11) {
  22604. user.headIcon = self.headIcon;
  22605. user.nickName = self.nickName;
  22606. }
  22607. this.rankList.splice(i, 0, md);
  22608. break;
  22609. }
  22610. }
  22611. }
  22612. this.updateSelfItem();
  22613. this.ui.myNode.myList.numItems = this.rankList.length;
  22614. }
  22615. updateItemUI(index, obj) {
  22616. let data = this.rankList[index];
  22617. let userData = JSON.parse(data.userData).user;
  22618. obj.nameTxt.text = userData.nickName.toString();
  22619. obj.valueTxt.text = data.rankScore;
  22620. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22621. obj.rankTxt.text = index + 1;
  22622. switch (index) {
  22623. case 0:
  22624. this.setImg(obj, 1, 0, 0);
  22625. obj.rankTxt.color = "#FFC047";
  22626. break;
  22627. case 1:
  22628. this.setImg(obj, 0, 1, 0);
  22629. obj.rankTxt.color = "#ACACAC";
  22630. break;
  22631. case 2:
  22632. this.setImg(obj, 0, 0, 1);
  22633. obj.rankTxt.color = "#D09672";
  22634. break;
  22635. default:
  22636. this.setImg(obj, 0, 0, 0);
  22637. obj.rankTxt.color = "#496FAB";
  22638. break;
  22639. }
  22640. }
  22641. setImg(obj, a, b, c) {
  22642. obj.img1.visible = a ? true : false;
  22643. obj.img2.visible = b ? true : false;
  22644. obj.img3.visible = c ? true : false;
  22645. }
  22646. changeList(type) {
  22647. this.rankType = type;
  22648. this.updateSelf();
  22649. }
  22650. changeSelfNode() {
  22651. this.showSelf = !this.showSelf;
  22652. this.updateSelf();
  22653. }
  22654. updateSelf() {
  22655. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22656. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22657. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22658. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22659. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22660. }
  22661. }
  22662. UIRanking$1.uiName = "UIRanking";
  22663. class UISecretary$1 extends UIBase {
  22664. constructor() {
  22665. super();
  22666. this.curIndex = 1;
  22667. }
  22668. onConstructor() {
  22669. this.ui = ui_UISecretary.createInstance();
  22670. this.contentPane = this.ui;
  22671. this.isEject = false;
  22672. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22673. this.nodeObj = { left: null, right: null, cur: null };
  22674. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22675. }
  22676. show() {
  22677. super.show();
  22678. this.ui.t0.play();
  22679. this.updateData();
  22680. }
  22681. addSecretarySpine(node, spineName) {
  22682. if (spineName == "mishu") {
  22683. if (this.secretarySpine1) {
  22684. node.displayObject.destroyChildren();
  22685. this.playWoman(this.secretarySpine1, node.displayObject);
  22686. }
  22687. else {
  22688. let spine1 = new SpineMgr("mishu", () => {
  22689. this.secretarySpine1 = spine1;
  22690. this.playWoman(this.secretarySpine1, node.displayObject);
  22691. });
  22692. }
  22693. }
  22694. else {
  22695. if (this.secretarySpine2) {
  22696. node.displayObject.destroyChildren();
  22697. this.playWoman(this.secretarySpine2, node.displayObject);
  22698. }
  22699. else {
  22700. let spine2 = new SpineMgr("xiaomishu2", () => {
  22701. this.secretarySpine2 = spine2;
  22702. this.playWoman(this.secretarySpine2, node.displayObject);
  22703. });
  22704. }
  22705. }
  22706. }
  22707. playWoman(node, parent) {
  22708. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22709. let yy = this.ui.myNode.gameNode3.secretary.height;
  22710. let scale = 1.5;
  22711. if (node == this.secretarySpine2) {
  22712. scale = 1.2;
  22713. }
  22714. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22715. node.play(data, 0, true, parent);
  22716. }
  22717. turnLeft() {
  22718. this.curIndex--;
  22719. if (this.curIndex < 1) {
  22720. this.curIndex = 2;
  22721. }
  22722. let left = this.nodeObj.left;
  22723. let right = this.nodeObj.right;
  22724. let cur = this.nodeObj.cur;
  22725. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22726. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22727. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22728. this.updateData();
  22729. }));
  22730. this.ui.myNode.setChildIndex(right, 2);
  22731. this.nodeObj.left = cur;
  22732. this.nodeObj.right = left;
  22733. this.nodeObj.cur = right;
  22734. }
  22735. turnRight() {
  22736. this.curIndex++;
  22737. if (this.curIndex > 2) {
  22738. this.curIndex = 1;
  22739. }
  22740. let left = this.nodeObj.left;
  22741. let right = this.nodeObj.right;
  22742. let cur = this.nodeObj.cur;
  22743. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22744. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22745. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22746. this.updateData();
  22747. }));
  22748. this.ui.myNode.setChildIndex(left, 2);
  22749. this.nodeObj.left = right;
  22750. this.nodeObj.right = cur;
  22751. this.nodeObj.cur = left;
  22752. }
  22753. updateData() {
  22754. console.log('zh: updateData FFFFFFFFFF');
  22755. let data = cfgTable.secretaryshopData;
  22756. let children = this.ui.myNode._children;
  22757. let temp;
  22758. let curData;
  22759. for (let index = 0; index < children.length; index++) {
  22760. temp = children[index];
  22761. curData = data[1];
  22762. temp.heightTxt.text = curData.height;
  22763. temp.foodTxt.text = curData.food;
  22764. temp.historyTxt.text = curData.history;
  22765. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22766. this.addSecretarySpine(temp.secretary, curData.spine);
  22767. let womanIndex = curData.id - 1;
  22768. let getWoman = DataMgr.getSecretary(womanIndex);
  22769. let curUse = DataMgr.getCurSecretary();
  22770. if (getWoman) {
  22771. if (curUse == womanIndex) {
  22772. temp.purchaseBtn.c1.selectedIndex = 1;
  22773. }
  22774. else {
  22775. temp.purchaseBtn.c1.selectedIndex = 2;
  22776. }
  22777. }
  22778. else {
  22779. temp.purchaseBtn.c1.selectedIndex = 0;
  22780. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22781. }
  22782. temp.purchaseBtn.visible = false;
  22783. }
  22784. }
  22785. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22786. console.log('zh: 点击了clickSecretary ');
  22787. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22788. if (getWoman) {
  22789. if (curUse != womanIndex) {
  22790. console.log();
  22791. DataMgr.setCurSecretary(womanIndex);
  22792. this.updateData();
  22793. }
  22794. }
  22795. else {
  22796. console.log('zh:点击购买了');
  22797. let need = needDiamond;
  22798. if (DataMgr.diamondEnough(need)) {
  22799. DataMgr.setDiamond(-need);
  22800. DataMgr.setSecretary(womanIndex, 1);
  22801. DataMgr.setCurSecretary(womanIndex);
  22802. this.updateData();
  22803. }
  22804. else {
  22805. xGame.uiMgr.Show(UIAddProp$1, 1);
  22806. }
  22807. }
  22808. }
  22809. closeSelf() {
  22810. this.hide();
  22811. }
  22812. }
  22813. UISecretary$1.uiName = "UISecretary";
  22814. class BallRodDisplay$1 {
  22815. constructor(ui, index) {
  22816. this.index = 0;
  22817. this.uiIndex = 0;
  22818. this.ui = ui;
  22819. this.index = index;
  22820. this.initData();
  22821. }
  22822. initData() {
  22823. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22824. let data = cfgTable.ballrodData[this.index + 1];
  22825. this.ui.nameTxt.text = data.name;
  22826. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22827. this.ui.levelNode.c1.selectedIndex = data.quality;
  22828. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22829. if (data.spine) {
  22830. this.mySpine = new SpineMgr(data.spine, () => {
  22831. let xx = 150;
  22832. let yy = 70;
  22833. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22834. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22835. });
  22836. }
  22837. }
  22838. updateSelf() {
  22839. console.log('zh:updateSelf -------------- ');
  22840. let get = DataMgr.getBallRod(this.index);
  22841. if (get == null)
  22842. get = 1;
  22843. let curUse = DataMgr.getCurBallRod();
  22844. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22845. if (get) {
  22846. if (curUse == this.index) {
  22847. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22848. }
  22849. else {
  22850. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22851. }
  22852. }
  22853. else {
  22854. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22855. }
  22856. }
  22857. buyBallRod() {
  22858. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22859. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22860. switch (selectedIndex) {
  22861. case 0:
  22862. break;
  22863. case 1:
  22864. console.log('zh:点击了 USE THIS');
  22865. DataMgr.setCurBallRod(this.index);
  22866. let curUse = DataMgr.getCurBallRod();
  22867. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22868. let ui = xGame.uiMgr.getUI(UIShop$1);
  22869. ui.updateBallRod();
  22870. break;
  22871. case 2:
  22872. let data = cfgTable.ballrodData[this.index + 1];
  22873. let need = data.price;
  22874. if (DataMgr.diamondEnough(need)) {
  22875. this.buyQiuGan(data);
  22876. DataMgr.setDiamond(-need);
  22877. DataMgr.setBallRod(this.index, 1);
  22878. DataMgr.setCurBallRod(this.index);
  22879. let ui = xGame.uiMgr.getUI(UIShop$1);
  22880. ui.updateBallRod();
  22881. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22882. }
  22883. else {
  22884. xGame.uiMgr.Show(UIAddProp$1, 1);
  22885. }
  22886. break;
  22887. default:
  22888. break;
  22889. }
  22890. }
  22891. buyQiuGan(qgItem) {
  22892. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22893. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22894. if (userInfo == null) {
  22895. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22896. return;
  22897. }
  22898. let reqData = xGame.httpMgr.getReqData();
  22899. let pd = JSON.parse(reqData);
  22900. pd.qiuGanData = qgItem;
  22901. reqData = JSON.stringify(pd);
  22902. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  22903. try {
  22904. console.log('zh:buySp res = ' + JSON.stringify(res));
  22905. let code = res.code;
  22906. let msg = res.msg;
  22907. if (code == 401) {
  22908. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22909. alert(TIP_MSG_key.loginTimeOut);
  22910. xGame.uiMgr.Show(UIMsg$1, msg);
  22911. return;
  22912. }
  22913. if (code == 200) {
  22914. xGame.uiMgr.Show(UIMsg$1, msg);
  22915. DataMgr.getUserZiChanInfo();
  22916. }
  22917. else {
  22918. xGame.uiMgr.Show(UIMsg$1, msg);
  22919. }
  22920. }
  22921. catch (error) {
  22922. console.log('error=' + error);
  22923. alert(error);
  22924. }
  22925. finally {
  22926. }
  22927. });
  22928. }
  22929. logEventForGouMaiGan(qiuGanName) {
  22930. const ev = {
  22931. value: qiuGanName
  22932. };
  22933. const jsonStr = JSON.stringify(ev);
  22934. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  22935. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  22936. }
  22937. }
  22938. class DaoJuDisplay$1 {
  22939. constructor(ui, index) {
  22940. this.index = 0;
  22941. this.uiIndex = 0;
  22942. this.ggSpid = "";
  22943. this.spid = 0;
  22944. this.ui = ui;
  22945. this.index = index;
  22946. this.initData();
  22947. }
  22948. initData() {
  22949. this.ui.btn_buy.onClick(this, this.gotoBuy);
  22950. let data = cfgTable.daoJuData[this.index + 1];
  22951. console.log('zh:' + JSON.stringify(data));
  22952. this.ui.nameTxt.text = data.spbt;
  22953. this.ui.n_jiaGe.text = data.spjg + "";
  22954. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  22955. this.ggSpid = data.ggSpid;
  22956. this.spid = data.spid;
  22957. let baseUrl = "asset/sound/ogg/";
  22958. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  22959. }
  22960. gotoBuy() {
  22961. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22962. if (userInfo != null) {
  22963. let token = userInfo.token;
  22964. let ggSpid = this.ggSpid;
  22965. let spid = this.spid;
  22966. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  22967. console.log('zh:gotoBuy1 spid =' + spid);
  22968. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  22969. return;
  22970. }
  22971. else {
  22972. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22973. }
  22974. }
  22975. gotoBuy1() {
  22976. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22977. let djItem = cfgTable.daoJuData[this.index + 1];
  22978. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  22979. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22980. if (userInfo == null) {
  22981. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22982. return;
  22983. }
  22984. let reqData = xGame.httpMgr.getReqData();
  22985. let pd = JSON.parse(reqData);
  22986. pd.spItem = djItem;
  22987. reqData = JSON.stringify(pd);
  22988. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  22989. try {
  22990. console.log('zh:buySp res = ' + JSON.stringify(res));
  22991. let code = res.code;
  22992. let msg = res.msg;
  22993. if (code == 401) {
  22994. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  22995. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22996. return;
  22997. }
  22998. if (code == 200) {
  22999. xGame.uiMgr.Show(UIMsg$1, msg);
  23000. DataMgr.getUserZiChanInfo();
  23001. }
  23002. else {
  23003. xGame.uiMgr.Show(UIMsg$1, msg);
  23004. }
  23005. }
  23006. catch (error) {
  23007. console.log('error=' + error);
  23008. alert(error);
  23009. }
  23010. finally {
  23011. }
  23012. });
  23013. }
  23014. }
  23015. class UIShop$1 extends UIBase {
  23016. constructor() {
  23017. super();
  23018. this.itemNums = 0;
  23019. this.itemNumsForDj = 0;
  23020. this.curType = "";
  23021. }
  23022. onConstructor() {
  23023. this.ui = ui_UIShop.createInstance();
  23024. this.contentPane = this.ui;
  23025. this.isEject = false;
  23026. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23027. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23028. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23029. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23030. this.addUIClick(this.ui, this.interuptSecretary);
  23031. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23032. this.ballRodArr = [];
  23033. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23034. this.ui.myNode.myList.numItems = this.itemNums;
  23035. this.loadDjdata_old();
  23036. }
  23037. loadDjdata_old() {
  23038. let fff = cfgTable.daoJuData;
  23039. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23040. this.daoJuArr = [];
  23041. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23042. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23043. }
  23044. getProductList() {
  23045. let reqData = xGame.httpMgr.getReqData();
  23046. let pd = JSON.parse(reqData);
  23047. pd.splx = "Consumable";
  23048. reqData = JSON.stringify(pd);
  23049. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23050. try {
  23051. let code = res.code;
  23052. let msg = res.msg;
  23053. if (code == 401) {
  23054. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23055. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23056. return;
  23057. }
  23058. if (code == 200) {
  23059. let data = res.data;
  23060. for (let index = 0; index < data.length; index++) {
  23061. let element = data[index];
  23062. cfgTable.daoJuData[element.spid] = element;
  23063. }
  23064. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23065. }
  23066. else {
  23067. xGame.uiMgr.Show(UIMsg, msg);
  23068. }
  23069. }
  23070. catch (error) {
  23071. console.log('error=' + error);
  23072. alert(error);
  23073. }
  23074. finally {
  23075. }
  23076. });
  23077. }
  23078. show(type) {
  23079. super.show();
  23080. this.curType = type == 0 ? "qiugan" : "daoju";
  23081. this.switchBtn("");
  23082. this.playSecretaryIdle();
  23083. this.updateBallRod();
  23084. }
  23085. test123() {
  23086. console.log('zh:test123 ');
  23087. }
  23088. switchBtn(type) {
  23089. console.log('zh:1111切換 sel type=' + type);
  23090. if (type == "") {
  23091. type = this.curType;
  23092. }
  23093. else {
  23094. if (this.curType == type) {
  23095. return;
  23096. }
  23097. else {
  23098. this.curType = type;
  23099. }
  23100. }
  23101. if (type == "qiugan") {
  23102. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23103. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23104. this.ui.myNode.c1.selectedIndex = 0;
  23105. this.ui.myNode.myList.visible = true;
  23106. this.ui.myNode.djList.visible = false;
  23107. }
  23108. else {
  23109. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23110. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23111. this.ui.myNode.c1.selectedIndex = 1;
  23112. this.ui.myNode.myList.visible = false;
  23113. this.ui.myNode.djList.visible = true;
  23114. }
  23115. }
  23116. updateBallRod() {
  23117. for (let index = 0; index < this.ballRodArr.length; index++) {
  23118. this.ballRodArr[index].updateSelf();
  23119. }
  23120. }
  23121. renderBallRod(sort, obj) {
  23122. let index = this.getIndexBySort(sort + 1) - 1;
  23123. let ballRod = new BallRodDisplay$1(obj, index);
  23124. this.ballRodArr.push(ballRod);
  23125. }
  23126. renderDaoJu(idx, obj) {
  23127. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23128. let b = new DaoJuDisplay$1(obj, index);
  23129. this.daoJuArr.push(b);
  23130. }
  23131. getIndexBySort(sort) {
  23132. let object = cfgTable.ballrodData;
  23133. for (const key in object) {
  23134. if (object[key].sort == sort) {
  23135. return parseInt(key);
  23136. }
  23137. }
  23138. }
  23139. getIndexBySortForDj(idx) {
  23140. let object = cfgTable.daoJuData;
  23141. for (const key in object) {
  23142. if (object[key].idx == idx) {
  23143. return parseInt(key);
  23144. }
  23145. }
  23146. }
  23147. playSecretaryIdle() {
  23148. let parent = this.ui.secretary.displayObject;
  23149. parent.destroyChildren();
  23150. let xx = this.ui.secretary.width / 2;
  23151. let yy = this.ui.secretary.height;
  23152. let scale = xGame.common.getSecretaryScale();
  23153. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23154. xGame.common.secretary.play(data, 0, true, parent);
  23155. }
  23156. interuptSecretary() {
  23157. Laya.timer.clearAll(this);
  23158. this.playSecretaryRandomSound();
  23159. }
  23160. playSecretaryRandomSound() {
  23161. if (this.isHide)
  23162. return;
  23163. let time = xGame.common.randomNum(45000, 60000);
  23164. Laya.timer.once(time, this, () => {
  23165. if (this.isHide)
  23166. return;
  23167. let index = xGame.common.randomNum(4, 7);
  23168. xGame.soundMgr.playSound("s_main0" + index);
  23169. let words = 1;
  23170. switch (index) {
  23171. case 4:
  23172. words = 5;
  23173. break;
  23174. case 5:
  23175. words = 3;
  23176. break;
  23177. case 6:
  23178. words = 6;
  23179. break;
  23180. case 7:
  23181. words = 7;
  23182. break;
  23183. default:
  23184. break;
  23185. }
  23186. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23187. this.playSecretaryRandomSound();
  23188. });
  23189. }
  23190. closeSelf() {
  23191. this.hide();
  23192. }
  23193. }
  23194. UIShop$1.uiName = "UIShop";
  23195. class SignMax$1 {
  23196. constructor(ui) {
  23197. this.ui = ui;
  23198. }
  23199. updateSelf(index, sameDay, curDayIndex) {
  23200. let data = cfgTable.signData[index + 1];
  23201. this.ui.titleTxt.text = data.title;
  23202. let arr1 = data.award[0].split('-');
  23203. let arr2 = data.award[1].split('-');
  23204. let num1 = parseInt(arr1[1]);
  23205. let num2 = parseInt(arr2[1]);
  23206. this.ui.numTxt1.text = num1 + "";
  23207. this.ui.numTxt2.text = num2 + "";
  23208. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23209. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23210. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23211. this.ui.numTxt1.visible = false;
  23212. }
  23213. else {
  23214. this.ui.numTxt1.visible = true;
  23215. }
  23216. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23217. this.ui.numTxt2.visible = false;
  23218. }
  23219. else {
  23220. this.ui.numTxt2.visible = true;
  23221. }
  23222. if (index < curDayIndex) {
  23223. this.ui.c1.selectedIndex = 1;
  23224. }
  23225. else if (index == curDayIndex) {
  23226. if (sameDay) {
  23227. this.ui.c1.selectedIndex = 2;
  23228. }
  23229. else {
  23230. this.ui.c1.selectedIndex = 2;
  23231. }
  23232. }
  23233. else {
  23234. this.ui.c1.selectedIndex = 0;
  23235. }
  23236. }
  23237. }
  23238. class SignNormal$1 {
  23239. constructor(ui) {
  23240. this.ui = ui;
  23241. }
  23242. updateSelf(index, sameDay, curDayIndex) {
  23243. let data = cfgTable.signData[index + 1];
  23244. this.ui.titleTxt.text = data.title;
  23245. let arr = data.award[0].split('-');
  23246. let type = parseInt(arr[0]);
  23247. let num = parseInt(arr[1]);
  23248. this.ui.numTxt.text = num + "";
  23249. if (type > 2) {
  23250. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23251. this.ui.myIcon.rotation = 0;
  23252. }
  23253. else {
  23254. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23255. this.ui.myIcon.rotation = 0;
  23256. }
  23257. if (xGame.common.signAwardContainsRod(data.award)) {
  23258. this.ui.numTxt.visible = false;
  23259. }
  23260. else {
  23261. this.ui.numTxt.visible = true;
  23262. }
  23263. if (index < curDayIndex) {
  23264. this.ui.c1.selectedIndex = 1;
  23265. }
  23266. else if (index == curDayIndex) {
  23267. if (sameDay) {
  23268. this.ui.c1.selectedIndex = 2;
  23269. }
  23270. else {
  23271. this.ui.c1.selectedIndex = 2;
  23272. }
  23273. }
  23274. else {
  23275. this.ui.c1.selectedIndex = 0;
  23276. }
  23277. }
  23278. }
  23279. class UISign$1 extends UIBase {
  23280. constructor() {
  23281. super();
  23282. this.curDayIndex = 0;
  23283. this.starX = 0;
  23284. }
  23285. onConstructor() {
  23286. this.ui = ui_UISign.createInstance();
  23287. this.contentPane = this.ui;
  23288. this.isEject = false;
  23289. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23290. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23291. this.initSignItem();
  23292. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23293. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23294. }
  23295. show() {
  23296. super.show();
  23297. this.ui.t0.play();
  23298. this.playSecretaryIdle();
  23299. this.updateSign();
  23300. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23301. }
  23302. initSignItem() {
  23303. this.signArr = [];
  23304. for (let index = 0; index < 6; index++) {
  23305. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23306. this.signArr.push(temp);
  23307. }
  23308. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23309. if (Moyu.isKs)
  23310. this.ui.closeNode.closeBtn.x += 100;
  23311. }
  23312. updateSign() {
  23313. let sameDay = xGame.common.judgeSameDay();
  23314. let max = 7;
  23315. this.curDayIndex = DataMgr.getSignData();
  23316. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23317. this.curDayIndex = 0;
  23318. if (!sameDay) {
  23319. this.ui.normalBtn.visible = true;
  23320. this.ui.tipsNode.visible = false;
  23321. this.ui.againBtn.visible = false;
  23322. }
  23323. else {
  23324. this.ui.normalBtn.visible = false;
  23325. let again = DataMgr.getExtraSign();
  23326. let isCurrency = false;
  23327. let index = this.curDayIndex;
  23328. if (index == 0)
  23329. index = 7;
  23330. let award = cfgTable.signData[index].award;
  23331. let num = award[0].split("-")[0];
  23332. if (num == "1" || num == "2")
  23333. isCurrency = true;
  23334. let showAgain = again == 0 && isCurrency;
  23335. this.ui.againBtn.visible = showAgain;
  23336. this.ui.tipsNode.visible = !showAgain;
  23337. }
  23338. for (let index = 0; index < this.signArr.length; index++) {
  23339. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23340. }
  23341. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23342. }
  23343. playSecretaryIdle() {
  23344. let parent = this.ui.secretary.displayObject;
  23345. parent.destroyChildren();
  23346. let xx = this.ui.secretary.width / 2;
  23347. let yy = this.ui.secretary.height;
  23348. let scale = xGame.common.getSecretaryScale();
  23349. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23350. xGame.common.secretary.play(data, 0, true, parent);
  23351. }
  23352. closeSelf() {
  23353. this.hide();
  23354. }
  23355. normalGetAward() {
  23356. let sameDay = xGame.common.judgeSameDay();
  23357. if (!sameDay) {
  23358. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23359. let temp;
  23360. let type;
  23361. let num;
  23362. let arr = [];
  23363. for (let index = 0; index < award.length; index++) {
  23364. temp = award[index].split("-");
  23365. type = parseInt(temp[0]);
  23366. num = parseInt(temp[1]);
  23367. let awardType = new AwardType();
  23368. awardType.num = num;
  23369. awardType.type = type;
  23370. arr.push(awardType);
  23371. }
  23372. xGame.common.getAward(arr, (watchVideo) => {
  23373. this.curDayIndex++;
  23374. if (this.curDayIndex > 7)
  23375. this.curDayIndex = 0;
  23376. DataMgr.setSignData(this.curDayIndex);
  23377. this.updateSignData2Server(this.curDayIndex);
  23378. DataMgr.setSignTime(new Date().getTime());
  23379. if (watchVideo) {
  23380. DataMgr.setExtraSign(1);
  23381. Moyu.sendDataEvent("signIn1");
  23382. }
  23383. this.updateSign();
  23384. });
  23385. }
  23386. }
  23387. againGetAward() {
  23388. Moyu.sendDataEvent("signIn2");
  23389. console.log('zh:qjff_AD_for_uisign');
  23390. if (Laya.Browser.onAndroid) {
  23391. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23392. if (!boo) {
  23393. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23394. return;
  23395. }
  23396. }
  23397. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23398. }
  23399. else {
  23400. console.log('zh:AD 失败,直接发放奖励');
  23401. this.qjff_AD_for_uisign();
  23402. }
  23403. }
  23404. qjff_AD_for_uisign() {
  23405. let index = this.curDayIndex;
  23406. if (index == 0)
  23407. index = 7;
  23408. let award = cfgTable.signData[index].award;
  23409. let temp;
  23410. let type;
  23411. let num;
  23412. for (let index = 0; index < award.length; index++) {
  23413. temp = award[index].split("-");
  23414. type = parseInt(temp[0]);
  23415. num = parseInt(temp[1]) * 3;
  23416. xGame.common.playObjFlyAnim(num, type);
  23417. }
  23418. DataMgr.setExtraSign(1);
  23419. this.updateSign();
  23420. }
  23421. updateSignData2Server(day) {
  23422. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23423. if (userInfo == null) {
  23424. return;
  23425. }
  23426. let reqData = xGame.httpMgr.getReqData();
  23427. let pd = JSON.parse(reqData);
  23428. pd.signData = day;
  23429. reqData = JSON.stringify(pd);
  23430. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  23431. try {
  23432. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  23433. let code = res.code;
  23434. let msg = res.msg;
  23435. if (code == 401) {
  23436. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23437. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23438. return;
  23439. }
  23440. if (code == 200) {
  23441. let data = res.data;
  23442. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  23443. }
  23444. else {
  23445. xGame.uiMgr.Show(UIMsg$1, msg);
  23446. }
  23447. }
  23448. catch (error) {
  23449. console.log('error=' + error);
  23450. alert(error);
  23451. }
  23452. finally {
  23453. }
  23454. });
  23455. }
  23456. }
  23457. UISign$1.uiName = "UISign";
  23458. class UIModeSelection$1 extends UIBase {
  23459. constructor() {
  23460. super();
  23461. }
  23462. onConstructor() {
  23463. this.ui = ui_UIModeSelection.createInstance();
  23464. this.contentPane = this.ui;
  23465. this.isEject = false;
  23466. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23467. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23468. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23469. this.addUIClick(this.ui.closeBtn, this.hide);
  23470. this.peopleArr = [65, 990, 580];
  23471. this.peopleOffest = [5, 10, 10];
  23472. }
  23473. show(callback) {
  23474. this.updateSelf();
  23475. super.show();
  23476. this.ui.t0.play();
  23477. this.callback = callback;
  23478. }
  23479. updateSelf() {
  23480. let cfg = cfgTable.modeselectData;
  23481. for (let index = 1; index <= 3; index++) {
  23482. let node = this.ui.myNode["type" + index];
  23483. node.need.text = cfg[index].need;
  23484. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23485. node.peopleTxt.text = this.getRandPeople(index - 1);
  23486. }
  23487. }
  23488. enterGame(type) {
  23489. console.log('zh: 进入经典模式 type: ' + type);
  23490. xGame.common.classicRoomType = type;
  23491. let cfg = cfgTable.modeselectData[type];
  23492. let need = cfg.need;
  23493. xGame.common.passAwardCoin = cfg.award;
  23494. if (DataMgr.coinEnough(need)) {
  23495. DataMgr.setCoin(-need);
  23496. this.ui.myNode["type" + type].t0.play();
  23497. Laya.timer.once(200, this, () => {
  23498. this.callback && this.callback();
  23499. });
  23500. this.logEventForClassic_start();
  23501. }
  23502. else {
  23503. Moyu.sendDataEvent("AddCoinVideo");
  23504. xGame.uiMgr.Show(UIAddProp$1, 0);
  23505. }
  23506. }
  23507. getRandPeople(index) {
  23508. let rand = this.peopleOffest[index];
  23509. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23510. }
  23511. logEventForClassic_start() {
  23512. let rtype = xGame.common.classicRoomType;
  23513. let msmc = '';
  23514. if (rtype == 1) {
  23515. msmc = 'beginner';
  23516. }
  23517. if (rtype == 2) {
  23518. msmc = 'expert';
  23519. }
  23520. if (rtype == 3) {
  23521. msmc = 'master';
  23522. }
  23523. let keyStr = 'sjmd_classic_start_' + rtype;
  23524. let jsonStr = {
  23525. "difficulty": msmc,
  23526. "classic_count": 1,
  23527. "difficulty_count": 1
  23528. };
  23529. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23530. const d = LocalStorageManager.getItem(keyStr);
  23531. jsonStr.classic_count = d.classic_count + 1;
  23532. jsonStr.difficulty_count = d.difficulty_count + 1;
  23533. LocalStorageManager.setItem(keyStr, jsonStr);
  23534. }
  23535. else {
  23536. LocalStorageManager.setItem(keyStr, jsonStr);
  23537. }
  23538. const reqStr = JSON.stringify(jsonStr);
  23539. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23540. }
  23541. }
  23542. UIModeSelection$1.uiName = "UIModeSelection";
  23543. class UILogin$1 extends UIBase {
  23544. constructor() {
  23545. super();
  23546. }
  23547. onConstructor() {
  23548. this.ui = ui_UILogin.createInstance();
  23549. this.contentPane = this.ui;
  23550. this.isEject = false;
  23551. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23552. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23553. this.addUIClick(this.ui.btn_login, this.userLogin);
  23554. }
  23555. show() {
  23556. super.show();
  23557. this.x = (Laya.stage.width - this.width) / 2;
  23558. this.y = (Laya.stage.height - this.height) / 2;
  23559. }
  23560. closeSelf() {
  23561. this.hide();
  23562. }
  23563. userLogin() {
  23564. let ua = this.ui.txt_ua.text;
  23565. let up = this.ui.txt_up.text;
  23566. if (ua && up) {
  23567. let reqData = JSON.stringify({
  23568. username: ua.trim(),
  23569. password: up.trim(),
  23570. fromMark: 'app_game'
  23571. });
  23572. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23573. try {
  23574. console.log('zh:res = ' + JSON.stringify(res));
  23575. let code = res.code;
  23576. let msg = res.msg;
  23577. if (code == 200) {
  23578. let keyStr = keyForLoginInfo;
  23579. let jsonStr = {
  23580. "username": res.username,
  23581. "token": res.token,
  23582. "buySpids": { 1: false, 7: false }
  23583. };
  23584. LocalStorageManager.setItem(keyStr, jsonStr);
  23585. let myu = Moyu.getUserInfo();
  23586. console.log('zh:myu = ' + JSON.stringify(myu));
  23587. DataMgr.updateUserNickName(res.username);
  23588. Moyu.updateUserInfo(res.username);
  23589. xGame.uiMgr.Show(UIMsg$1, msg);
  23590. DataMgr.getUserZiChanInfo();
  23591. xGame.eventMgr.event(LOGIN_IN);
  23592. this.closeSelf();
  23593. }
  23594. else {
  23595. xGame.uiMgr.Show(UIMsg$1, msg);
  23596. }
  23597. }
  23598. catch (error) {
  23599. console.log('error=' + error);
  23600. alert(error);
  23601. }
  23602. finally {
  23603. }
  23604. });
  23605. }
  23606. else {
  23607. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23608. }
  23609. }
  23610. gotoRegPage() {
  23611. this.closeSelf();
  23612. xGame.uiMgr.Show(UIReg$1);
  23613. }
  23614. }
  23615. UILogin$1.uiName = "UILogin";
  23616. class UIReg$1 extends UIBase {
  23617. constructor() {
  23618. super();
  23619. }
  23620. onConstructor() {
  23621. this.ui = ui_UIReg.createInstance();
  23622. this.contentPane = this.ui;
  23623. this.isEject = false;
  23624. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23625. this.addUIClick(this.ui.btn_reg, this.regUser);
  23626. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23627. }
  23628. show() {
  23629. super.show();
  23630. this.x = (Laya.stage.width - this.width) / 2;
  23631. this.y = (Laya.stage.height - this.height) / 2;
  23632. }
  23633. closeSelf() {
  23634. this.hide();
  23635. }
  23636. regUser() {
  23637. this.ui.lab_tip.visible = false;
  23638. let ua = this.ui.txt_ua.text;
  23639. let up1 = this.ui.txt_up1.text;
  23640. let up2 = this.ui.txt_up2.text;
  23641. if (ua && up1 && up2 && up1 == up2) {
  23642. let reqData = JSON.stringify({
  23643. username: ua.trim(),
  23644. password: up1.trim(),
  23645. fromMark: 'app_game'
  23646. });
  23647. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23648. try {
  23649. console.log('zh:res = ' + JSON.stringify(res));
  23650. let code = res.code;
  23651. let msg = res.msg;
  23652. xGame.uiMgr.Show(UIMsg$1, msg);
  23653. if (code == 200) {
  23654. this.ui.lab_tip.color = "#FFFFFF";
  23655. xGame.uiMgr.Show(UIMsg$1, msg);
  23656. this.closeSelf();
  23657. }
  23658. else {
  23659. this.ui.lab_tip.color = "#FF0000";
  23660. xGame.uiMgr.Show(UIMsg$1, msg);
  23661. }
  23662. }
  23663. catch (error) {
  23664. console.log('error=' + error);
  23665. alert(error);
  23666. }
  23667. finally {
  23668. }
  23669. });
  23670. }
  23671. else {
  23672. if (up1 != up2) {
  23673. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23674. }
  23675. else {
  23676. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23677. }
  23678. }
  23679. }
  23680. gotoLogin() {
  23681. this.closeSelf();
  23682. xGame.uiMgr.Show(UILogin$1);
  23683. }
  23684. }
  23685. UIReg$1.uiName = "UIReg";
  23686. class UIFuli1$1 extends UIBase {
  23687. constructor() {
  23688. super();
  23689. }
  23690. onConstructor() {
  23691. this.ui = ui_UIFuli1.createInstance();
  23692. this.contentPane = this.ui;
  23693. this.isEject = false;
  23694. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23695. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23696. }
  23697. show() {
  23698. super.show();
  23699. this.x = (Laya.stage.width - this.width) / 2;
  23700. this.y = (Laya.stage.height - this.height) / 2;
  23701. }
  23702. closeSelf() {
  23703. this.hide();
  23704. }
  23705. gotoBuy() {
  23706. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23707. if (userInfo != null) {
  23708. let token = userInfo.token;
  23709. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23710. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  23711. return;
  23712. }
  23713. else {
  23714. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23715. }
  23716. }
  23717. gotoBuy2() {
  23718. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23719. if (userInfo == null) {
  23720. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23721. return;
  23722. }
  23723. let reqData = xGame.httpMgr.getReqData();
  23724. let pd = JSON.parse(reqData);
  23725. pd.productId = 1;
  23726. reqData = JSON.stringify(pd);
  23727. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23728. try {
  23729. console.log('zh:buySp res = ' + JSON.stringify(res));
  23730. let code = res.code;
  23731. let msg = res.msg;
  23732. if (code == 401) {
  23733. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23734. alert(TIP_MSG_key.loginTimeOut);
  23735. xGame.uiMgr.Show(UIMsg$1, msg);
  23736. return;
  23737. }
  23738. if (code == 200) {
  23739. xGame.uiMgr.Show(UIMsg$1, msg);
  23740. DataMgr.getUserZiChanInfo();
  23741. this.closeSelf();
  23742. }
  23743. else {
  23744. xGame.uiMgr.Show(UIMsg$1, msg);
  23745. }
  23746. }
  23747. catch (error) {
  23748. console.log('error=' + error);
  23749. alert(error);
  23750. }
  23751. finally {
  23752. }
  23753. });
  23754. }
  23755. }
  23756. UIFuli1$1.uiName = "UIFuli1";
  23757. class UIFuli2$1 extends UIBase {
  23758. constructor() {
  23759. super();
  23760. }
  23761. onConstructor() {
  23762. this.ui = ui_UIFuli2.createInstance();
  23763. this.contentPane = this.ui;
  23764. this.isEject = false;
  23765. this.addUIClick(this.ui.n0.n_buy, this.gotoBuy);
  23766. this.addUIClick(this.ui.n0.n_no, this.closeSelf);
  23767. }
  23768. show() {
  23769. super.show();
  23770. this.x = (Laya.stage.width - this.width) / 2;
  23771. this.y = (Laya.stage.height - this.height) / 2;
  23772. }
  23773. closeSelf() {
  23774. this.hide();
  23775. }
  23776. gotoBuy() {
  23777. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23778. if (userInfo != null) {
  23779. let token = userInfo.token;
  23780. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23781. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  23782. return;
  23783. }
  23784. else {
  23785. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23786. }
  23787. }
  23788. gotoBuy1() {
  23789. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23790. if (userInfo == null) {
  23791. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23792. return;
  23793. }
  23794. let reqData = xGame.httpMgr.getReqData();
  23795. let pd = JSON.parse(reqData);
  23796. pd.productId = 2;
  23797. reqData = JSON.stringify(pd);
  23798. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23799. try {
  23800. console.log('zh:buySp res = ' + JSON.stringify(res));
  23801. let code = res.code;
  23802. let msg = res.msg;
  23803. if (code == 401) {
  23804. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  23805. alert(TIP_MSG_key.loginTimeOut);
  23806. xGame.uiMgr.Show(UIMsg$1, msg);
  23807. return;
  23808. }
  23809. if (code == 200) {
  23810. xGame.uiMgr.Show(UIMsg$1, msg);
  23811. DataMgr.getUserZiChanInfo();
  23812. this.closeSelf();
  23813. }
  23814. else {
  23815. xGame.uiMgr.Show(UIMsg$1, msg);
  23816. }
  23817. }
  23818. catch (error) {
  23819. console.log('error=' + error);
  23820. alert(error);
  23821. }
  23822. finally {
  23823. }
  23824. });
  23825. }
  23826. }
  23827. UIFuli2$1.uiName = "UIFuli2";
  23828. class UITry$1 extends UIBase {
  23829. constructor() {
  23830. super();
  23831. this.closeTime = 0;
  23832. this.closeNum = 0;
  23833. this.skillUrl = xGame.common.skillIconList;
  23834. }
  23835. onConstructor() {
  23836. this.ui = ui_UITry.createInstance();
  23837. this.contentPane = this.ui;
  23838. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23839. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23840. }
  23841. show() {
  23842. super.show();
  23843. this.closeNum = 0;
  23844. this.closeTime = 15;
  23845. this.ui.t0.play();
  23846. PlatMgr.showRateBanner();
  23847. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23848. Laya.timer.loop(1000, this, this.updateTime);
  23849. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23850. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23851. xGame.common.gameMgr.gamePause = true;
  23852. }
  23853. updateTime() {
  23854. if (this.closeTime > 1) {
  23855. this.closeTime--;
  23856. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23857. }
  23858. else
  23859. this.hide();
  23860. }
  23861. hide() {
  23862. Laya.timer.clearAll(this);
  23863. Moyu.showBannerAd(false);
  23864. super.hide();
  23865. xGame.common.gameMgr.gamePause = false;
  23866. }
  23867. onTry() {
  23868. console.log('zh:qjff_AD_for_uitry');
  23869. if (Laya.Browser.onAndroid) {
  23870. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23871. if (!boo) {
  23872. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23873. return;
  23874. }
  23875. }
  23876. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23877. }
  23878. else {
  23879. console.log('zh:AD 失败,直接发放奖励');
  23880. this.qjff_AD_for_uitry();
  23881. }
  23882. }
  23883. qjff_AD_for_uitry() {
  23884. let select = xGame.common.curPlayerSkillType;
  23885. DataMgr.gameData.trySkill = select;
  23886. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  23887. DataMgr.saveGameData();
  23888. DataMgr.setBigSkill(select, 1);
  23889. xGame.showTip("Trial Successful");
  23890. this.hide();
  23891. }
  23892. onCancel() {
  23893. if (this.closeNum > 0) {
  23894. this.closeNum--;
  23895. if (this.closeNum < 2)
  23896. this.hide();
  23897. return;
  23898. }
  23899. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  23900. this.onTry();
  23901. }
  23902. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  23903. this.closeNum = 3;
  23904. }
  23905. else
  23906. this.hide();
  23907. }
  23908. }
  23909. UITry$1.uiName = "UITry";
  23910. class UIGetAward$1 extends UIBase {
  23911. constructor() {
  23912. super();
  23913. this.showTriple = true;
  23914. }
  23915. onConstructor() {
  23916. this.ui = ui_UIGetAward.createInstance();
  23917. this.contentPane = this.ui;
  23918. this.isEject = false;
  23919. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  23920. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  23921. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  23922. }
  23923. show(arr, showTriple, callback) {
  23924. super.show();
  23925. this.ui.t0.play();
  23926. this.ui.eftNode.visible = true;
  23927. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  23928. this.ui.eftNode.visible = false;
  23929. }), 1, 0, 0, 0.9);
  23930. this.awardArr = arr;
  23931. this.showTriple = showTriple;
  23932. this.callback = callback;
  23933. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  23934. this.ui.myList.numItems = arr.length;
  23935. xGame.soundMgr.playSound("getaward");
  23936. }
  23937. updateSelf(index, obj) {
  23938. let temp = this.awardArr[index];
  23939. let icon = this.getIcon(temp.type);
  23940. let str = icon;
  23941. if (temp.type > 2) {
  23942. str = "s" + icon;
  23943. }
  23944. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  23945. obj.myIcon.rotation = 0;
  23946. obj.numTxt.text = temp.num + "";
  23947. obj.numTxt.visible = temp.type > 2 ? false : true;
  23948. obj.nameTxt.text = this.getNameStr(temp.type);
  23949. }
  23950. renderItem(index, obj) {
  23951. this.updateSelf(index, obj);
  23952. }
  23953. tripleGetAward() {
  23954. console.log('zh:qjff_AD_for_uigetAward');
  23955. if (Laya.Browser.onAndroid) {
  23956. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23957. if (!boo) {
  23958. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23959. return;
  23960. }
  23961. }
  23962. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  23963. }
  23964. else {
  23965. console.log('zh:AD 失败,直接发放奖励');
  23966. this.qjff_AD_for_uigetAward();
  23967. }
  23968. }
  23969. qjff_AD_for_uigetAward() {
  23970. this.getAward(3);
  23971. }
  23972. normalGetAward() {
  23973. if (PlatMgr.isMisVideo())
  23974. this.tripleGetAward();
  23975. else
  23976. this.getAward();
  23977. }
  23978. getAward(times = 1) {
  23979. this.hide();
  23980. for (let index = 0; index < this.awardArr.length; index++) {
  23981. this.awardArr[index].num *= times;
  23982. }
  23983. this.callback && this.callback(times != 1);
  23984. }
  23985. getIcon(type) {
  23986. switch (type) {
  23987. case Prop.diamond:
  23988. return "ty_zs";
  23989. case Prop.coin:
  23990. return "ty_jb";
  23991. case Prop.gan1:
  23992. return "qg1";
  23993. case Prop.gan2:
  23994. return "qg2";
  23995. case Prop.gan3:
  23996. return "qg3";
  23997. case Prop.gan4:
  23998. return "qg4";
  23999. default:
  24000. break;
  24001. }
  24002. }
  24003. getNameStr(type) {
  24004. switch (type) {
  24005. case Prop.diamond:
  24006. return "Diamond";
  24007. case Prop.coin:
  24008. return "Coins";
  24009. case Prop.gan1:
  24010. case Prop.gan2:
  24011. case Prop.gan3:
  24012. case Prop.gan4:
  24013. return cfgTable.ballrodData[type - 1].name;
  24014. default:
  24015. break;
  24016. }
  24017. }
  24018. }
  24019. UIGetAward$1.uiName = "UIGetAward";
  24020. class UIBox$1 extends UIBase {
  24021. constructor() {
  24022. super();
  24023. this.boxNum = 0;
  24024. this.boxMax = 10;
  24025. this.inAd = false;
  24026. this.isClose = false;
  24027. }
  24028. onConstructor() {
  24029. this.ui = ui_UIBox.createInstance();
  24030. this.contentPane = this.ui;
  24031. this.isEject = false;
  24032. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24033. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24034. Laya.timer.loop(1000, this, this.update);
  24035. }
  24036. update() {
  24037. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24038. this.boxNum -= 1;
  24039. this.upBar();
  24040. }
  24041. }
  24042. upBar() {
  24043. if (this.boxNum > this.boxMax)
  24044. this.boxNum = this.boxMax;
  24045. this.ui.bar.value = this.boxNum * 10;
  24046. }
  24047. show() {
  24048. super.show();
  24049. this.isClose = false;
  24050. this.boxNum = 0;
  24051. this.inAd = false;
  24052. this.upBar();
  24053. this.ui.t0.play();
  24054. this.ui.closeBtn.visible = false;
  24055. Laya.timer.once(3000, this, () => {
  24056. this.ui.closeBtn.visible = true;
  24057. this.ui.bar.alpha = 1;
  24058. });
  24059. Laya.timer.once(500, this, () => {
  24060. this.ui.t1.play();
  24061. });
  24062. }
  24063. hide() {
  24064. Laya.timer.clearAll(this);
  24065. Moyu.showBannerAd(false);
  24066. super.hide();
  24067. }
  24068. onOpenBox() {
  24069. this.boxNum++;
  24070. if (this.boxNum < this.boxMax) {
  24071. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24072. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24073. }
  24074. }
  24075. else if (this.boxNum == this.boxMax) {
  24076. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24077. this.ui.openBtn.c1.selectedIndex = 13;
  24078. this.inAd = true;
  24079. }
  24080. else
  24081. this.getAward();
  24082. }
  24083. else if (this.inAd) {
  24084. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24085. if (Laya.Browser.onAndroid) {
  24086. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24087. if (!boo) {
  24088. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24089. return;
  24090. }
  24091. }
  24092. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24093. }
  24094. else {
  24095. console.log('zh:AD 失败,直接发放奖励');
  24096. this.qjff_AD_for_UIBOX_onOpenBox();
  24097. }
  24098. }
  24099. this.upBar();
  24100. }
  24101. qjff_AD_for_UIBOX_onOpenBox() {
  24102. this.getAward();
  24103. }
  24104. onCloseBox() {
  24105. if (this.isClose)
  24106. this.hide();
  24107. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24108. this.isClose = true;
  24109. PlatMgr.showBanner(true, 0, 3000);
  24110. }
  24111. else
  24112. this.hide();
  24113. }
  24114. getAward() {
  24115. let str = "";
  24116. if (Math.random() < 0.5) {
  24117. let max = Moyu.isLegal ? 500 : 2500;
  24118. let num = xGame.tools.random(max, 500 + max);
  24119. DataMgr.setCoin(num);
  24120. str = "金币x" + num;
  24121. }
  24122. else {
  24123. let max = Moyu.isLegal ? 10 : 30;
  24124. let num = xGame.tools.random(max, 30 + max);
  24125. DataMgr.setDiamond(num);
  24126. str = "钻石x" + num;
  24127. }
  24128. xGame.showTip("恭喜获得-" + str);
  24129. this.hide();
  24130. }
  24131. }
  24132. UIBox$1.uiName = "UIBox";
  24133. class UIMain$1 extends UIBase {
  24134. constructor() {
  24135. super();
  24136. this.firstEnter = true;
  24137. }
  24138. nativeCallJs(msg) {
  24139. let t = msg;
  24140. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24141. switch (t) {
  24142. case 'qjff_chouJiang':
  24143. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24144. dui.qjff_chouJiang();
  24145. break;
  24146. case 'qjff_AD_for_uisign':
  24147. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24148. dui2.qjff_AD_for_uisign();
  24149. break;
  24150. case 'qjff_AD_for_uitry':
  24151. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24152. dui3.qjff_AD_for_uitry();
  24153. break;
  24154. case 'qjff_AD_for_uipower':
  24155. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24156. dui4.qjff_AD_for_uipower();
  24157. break;
  24158. case 'qjff_AD_for_uigetAward':
  24159. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24160. dui5.qjff_AD_for_uigetAward();
  24161. break;
  24162. case 'qjff_AD_for_uiGameEnd':
  24163. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24164. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24165. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24166. break;
  24167. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24168. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24169. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24170. break;
  24171. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24172. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24173. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24174. break;
  24175. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24176. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24177. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24178. break;
  24179. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24180. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24181. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24182. break;
  24183. case 'qjff_AD_for_UIBOX_onOpenBox':
  24184. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24185. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24186. break;
  24187. case 'qjff_AD_for_UIAddCoin':
  24188. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24189. dui12.qjff_AD_for_UIAddCoin();
  24190. break;
  24191. case '111a':
  24192. let dui14 = xGame.uiMgr.getUI(UISign$1);
  24193. dui14.qjff_AD_for_uisign();
  24194. break;
  24195. case '222a':
  24196. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24197. dui15.qjff_AD_for_uisign();
  24198. break;
  24199. case '333a':
  24200. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24201. dui16.qjff_AD_for_uisign();
  24202. break;
  24203. default:
  24204. console.log('zh:未知的方法名字' + t);
  24205. break;
  24206. }
  24207. }
  24208. onConstructor() {
  24209. console.log('zh: UIMain onConstructor');
  24210. this.ui = ui_UIMain.createInstance();
  24211. this.contentPane = this.ui;
  24212. this.isEject = false;
  24213. this.addEvent();
  24214. this.addClickSpine();
  24215. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24216. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24217. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24218. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24219. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24220. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24221. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24222. let curUse = DataMgr.getCurSecretary();
  24223. this.changeSecretary(curUse);
  24224. this.ui.talkNode.visible = false;
  24225. let guide = DataMgr.getSkillGuide();
  24226. if (xGame.common.isNewDay && guide == 1) {
  24227. xGame.common.isNewDay = false;
  24228. xGame.soundMgr.playSound("s_main01");
  24229. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24230. console.log("zh:播放小秘书每天语音");
  24231. }
  24232. this.onGetUserInfo();
  24233. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24234. DataMgr.getUserZiChanInfo();
  24235. }
  24236. this.ui.n83.visible = false;
  24237. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24238. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24239. let ua = d.username;
  24240. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24241. }
  24242. this.c_btn_for_user();
  24243. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24244. this.loadUserSpOrderForAd();
  24245. }
  24246. Logout() {
  24247. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24248. LocalStorageManager.removeItem(keyForLoginInfo);
  24249. this.freshUser();
  24250. }
  24251. JSBridgeUtils.instance.loginOutForApp();
  24252. this.setUserDefaultNickname();
  24253. DataMgr.setCoin2(4000);
  24254. DataMgr.setDiamond2(0);
  24255. this.setDefaultQiuGanInfo();
  24256. DataMgr.setPlaceBallLevelList("");
  24257. }
  24258. setDefaultQiuGanInfo() {
  24259. DataMgr.setBallRod(0, 1);
  24260. DataMgr.setBallRod(1, 0);
  24261. DataMgr.setBallRod(2, 0);
  24262. DataMgr.setBallRod(3, 0);
  24263. DataMgr.setBallRod(4, 0);
  24264. DataMgr.setBallRod(5, 1);
  24265. }
  24266. setUserDefaultNickname() {
  24267. let defUsername = "player";
  24268. this.ui.headNode.nameTxt.text = defUsername;
  24269. DataMgr.updateUserNickName(defUsername);
  24270. Moyu.updateUserInfo(defUsername);
  24271. }
  24272. gotoLogin() {
  24273. xGame.uiMgr.Show(UILogin$1);
  24274. }
  24275. gotoRegUser() {
  24276. xGame.uiMgr.Show(UIReg$1);
  24277. }
  24278. showFuLiSp1() {
  24279. console.log('zh:福利1');
  24280. this.checkForShowFuLi17(1);
  24281. }
  24282. showFuLiSp7() {
  24283. console.log('zh:福利7');
  24284. this.checkForShowFuLi17(7);
  24285. }
  24286. loadUserSpOrderForAd() {
  24287. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24288. if (userInfo == null) {
  24289. return;
  24290. }
  24291. let reqData = xGame.httpMgr.getReqData();
  24292. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  24293. try {
  24294. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  24295. let code = res.code;
  24296. let msg = res.msg;
  24297. if (code == 401) {
  24298. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  24299. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24300. return;
  24301. }
  24302. if (code == 200) {
  24303. let data = res.data;
  24304. let buy_spid1 = false;
  24305. let buy_spid7 = false;
  24306. for (let index = 0; index < data.length; index++) {
  24307. let element = data[index];
  24308. console.log('zh:list element.spid = ' + element.spid);
  24309. if (element.spid == 1) {
  24310. buy_spid1 = true;
  24311. }
  24312. if (element.spid == 7) {
  24313. buy_spid7 = true;
  24314. }
  24315. }
  24316. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  24317. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  24318. }
  24319. else {
  24320. xGame.uiMgr.Show(UIMsg$1, msg);
  24321. }
  24322. }
  24323. catch (error) {
  24324. console.log('error=' + error);
  24325. alert(error);
  24326. }
  24327. finally {
  24328. }
  24329. });
  24330. }
  24331. checkForShowFuLi17(spid) {
  24332. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24333. if (userInfo == null) {
  24334. if (spid === 1) {
  24335. xGame.uiMgr.Show(UIFuli1$1);
  24336. }
  24337. if (spid === 7) {
  24338. xGame.uiMgr.Show(UIFuli2$1);
  24339. }
  24340. return;
  24341. }
  24342. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  24343. let reqData = xGame.httpMgr.getReqData();
  24344. let pd = JSON.parse(reqData);
  24345. pd.productId = spid;
  24346. reqData = JSON.stringify(pd);
  24347. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  24348. try {
  24349. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  24350. let code = res.code;
  24351. let msg = res.msg;
  24352. if (code == 401) {
  24353. Laya.LocalStorage.setItem(keyForLoginInfo, null);
  24354. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24355. return;
  24356. }
  24357. if (code == 200) {
  24358. let isBuyOk = res.data;
  24359. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  24360. if (isBuyOk === false) {
  24361. if (spid === 1) {
  24362. xGame.uiMgr.Show(UIFuli1$1);
  24363. }
  24364. if (spid === 7) {
  24365. xGame.uiMgr.Show(UIFuli2$1);
  24366. }
  24367. }
  24368. else {
  24369. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  24370. }
  24371. }
  24372. else {
  24373. xGame.uiMgr.Show(UIMsg$1, msg);
  24374. }
  24375. }
  24376. catch (error) {
  24377. console.log('error=' + error);
  24378. alert(error);
  24379. }
  24380. finally {
  24381. }
  24382. });
  24383. }
  24384. c_btn_for_user() {
  24385. this.ui.n_Logout.visible = false;
  24386. this.ui.n_dengLu.visible = false;
  24387. this.ui.n_zhuCe.visible = false;
  24388. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24389. this.ui.n_Logout.visible = true;
  24390. }
  24391. else {
  24392. this.ui.n_dengLu.visible = true;
  24393. }
  24394. }
  24395. changeSecretary(curUse) {
  24396. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24397. xGame.common.secretary && xGame.common.secretary.dispose();
  24398. this.addSecretarySpine(name);
  24399. }
  24400. addSecretarySpine(name) {
  24401. let spine = new SpineMgr(name, () => {
  24402. this.playSecretaryIdle();
  24403. });
  24404. xGame.common.secretary = spine;
  24405. }
  24406. addClickSpine() {
  24407. let clickSpine = new SpineMgr("dianji", () => {
  24408. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24409. let parent = Laya.stage;
  24410. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24411. clickSpine.play(data, 0, false, parent, (spine) => {
  24412. spine.destroy(true);
  24413. });
  24414. });
  24415. });
  24416. }
  24417. addEvent() {
  24418. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24419. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24420. this.addUIClick(this.ui.ganFaMoShiBtn, this.startGame, [GameMode.bigMove]);
  24421. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24422. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24423. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24424. this.addUIClick(this.ui, this.interuptSecretary);
  24425. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24426. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24427. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24428. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24429. this.addUIClick(this.ui.signBtn, this.openSignView);
  24430. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24431. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24432. this.addUIClick(this.ui.n_Logout, this.Logout);
  24433. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24434. this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
  24435. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24436. }
  24437. show(showFailWords) {
  24438. super.show();
  24439. this.loadUserSpOrderForAd();
  24440. this.moneyNode.ui.c1.selectedIndex = 1;
  24441. this.playSecretaryIdle();
  24442. xGame.soundMgr.playMusic("caromhall01", 0);
  24443. Laya.timer.clearAll(this);
  24444. this.playSecretaryRandomSound();
  24445. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24446. if (showFailWords) {
  24447. console.log('zh:uimain.ts ');
  24448. setTimeout(() => {
  24449. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24450. let words = -1;
  24451. if (str == "s_main02") {
  24452. words = 2;
  24453. }
  24454. else {
  24455. words = 3;
  24456. }
  24457. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24458. xGame.soundMgr.playSound(str);
  24459. }, 300);
  24460. }
  24461. this.showGuide();
  24462. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24463. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24464. let guide = DataMgr.getSkillGuide();
  24465. if (guide == 1) {
  24466. let randTime = xGame.common.randomNum(300, 800);
  24467. if (this.firstEnter) {
  24468. console.log("zh: firstEnter");
  24469. this.firstEnter = false;
  24470. randTime += 900;
  24471. }
  24472. else {
  24473. console.log("zh: no firstEnter");
  24474. }
  24475. Laya.timer.once(randTime, this, () => {
  24476. });
  24477. Laya.timer.once(1000, this, () => {
  24478. console.log('zh: 1秒后 showFuLiSp1');
  24479. this.showFuLiSp1();
  24480. });
  24481. Laya.timer.once(10000, this, () => {
  24482. console.log('zh: 10秒后 showFuLiSp1');
  24483. this.showFuLiSp7();
  24484. });
  24485. }
  24486. }
  24487. checkActive(show) {
  24488. }
  24489. showGuide() {
  24490. let guide = DataMgr.getSkillGuide();
  24491. this.ui.guideBtn.visible = guide == 0;
  24492. this.ui.enterGuide.visible = false;
  24493. this.ui.secretaryGuide.visible = guide == 0;
  24494. if (guide == 0) {
  24495. console.log("zh:显示引导");
  24496. xGame.soundMgr.playSound("s_guide");
  24497. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24498. }
  24499. else {
  24500. console.log("zh:不需要显示引导");
  24501. }
  24502. }
  24503. ensureSecretary() {
  24504. console.log('zh: ensureSecretary ensureSecretaryensureSecretaryensureSecretaryensureSecretaryensureSecretary');
  24505. this.ui.secretaryGuide.visible = false;
  24506. this.ui.enterGuide.visible = true;
  24507. this.ui.wordsNode.t0.play();
  24508. if (DataMgr.getNewUser())
  24509. Moyu.sendDataEvent("gameReady");
  24510. }
  24511. playSecretaryIdle() {
  24512. let parent = this.ui.secretary.displayObject;
  24513. parent.destroyChildren();
  24514. let xx = this.ui.secretary.width / 2;
  24515. let yy = this.ui.secretary.height;
  24516. let scale = xGame.common.getSecretaryScale();
  24517. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24518. xGame.common.secretary.play(data, 0, true, parent);
  24519. }
  24520. startGame(type) {
  24521. if (!this.isReadyForLoadNetSource()) {
  24522. return;
  24523. }
  24524. xGame.common.gameMode = type;
  24525. Moyu.sendDataEvent("PlayGame", { type: type });
  24526. console.log('zh:进入游戏gameMode =' + xGame.common.gameMode);
  24527. switch (xGame.common.gameMode) {
  24528. case GameMode.classic:
  24529. console.log('zh:进入经典模式111111111');
  24530. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24531. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24532. console.log('zh:classic db_over_lev=', db_over_lev);
  24533. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24534. console.log('zh:判断是否可以玩该模式classic =NO');
  24535. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24536. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24537. return;
  24538. }
  24539. else {
  24540. console.log('zh:可以玩该模式classic 66666666666666');
  24541. this.beginGame();
  24542. }
  24543. }
  24544. else {
  24545. console.log('zh:不需要判断是否可以玩该classic');
  24546. let challengeTimes = DataMgr.getChallengeTimes();
  24547. if (challengeTimes == 0) {
  24548. xGame.uiMgr.Show(UIInvitation$1);
  24549. }
  24550. else {
  24551. this.beginGame();
  24552. }
  24553. break;
  24554. }
  24555. case GameMode.bigMove:
  24556. console.error('zh:bigMove check');
  24557. let guide = DataMgr.getSkillGuide();
  24558. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24559. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24560. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24561. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24562. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24563. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24564. return;
  24565. }
  24566. else {
  24567. console.log('zh:可以玩该模式 bigMove');
  24568. this.beginGame();
  24569. if (DataMgr.getNewUser())
  24570. Moyu.sendDataEvent("gameStart0");
  24571. }
  24572. }
  24573. else {
  24574. this.beginGame();
  24575. if (DataMgr.getNewUser())
  24576. Moyu.sendDataEvent("gameStart0");
  24577. }
  24578. break;
  24579. default:
  24580. console.error('zh:未知错误!!!!');
  24581. break;
  24582. }
  24583. }
  24584. beginGame(isNice = false) {
  24585. console.log('zh:beginGame ');
  24586. let guide = DataMgr.getSkillGuide();
  24587. if (guide == 1) {
  24588. console.log('zh:非新手引导,showInternAd ');
  24589. JSBridgeUtils.instance.showInternAd('beginGame');
  24590. }
  24591. else {
  24592. console.log('zh:新手引导,不显示AD ');
  24593. }
  24594. console.log('zh:beginGame 2 go');
  24595. if (xGame.common.gameMode == GameMode.classic) {
  24596. if (isNice) {
  24597. this.enterClassic();
  24598. }
  24599. else {
  24600. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24601. console.log('zh:BBBBBBBBBBBBBBB');
  24602. this.enterClassic();
  24603. });
  24604. }
  24605. }
  24606. else if (xGame.common.gameMode == GameMode.bigMove) {
  24607. this.ui.enterGuide.visible = false;
  24608. xGame.uiMgr.Show(UISkill$1);
  24609. }
  24610. }
  24611. enterClassic() {
  24612. xGame.uiMgr.Show(UIGame$1);
  24613. xGame.uiMgr.Show(UIMatching$1, () => {
  24614. if (!this.isHide)
  24615. this.hide();
  24616. xGame.common.gameUI.ui.alpha = 1;
  24617. xGame.common.gameUI.startGame();
  24618. xGame.uiMgr.Hide(UIGameEnd$1);
  24619. });
  24620. }
  24621. start_debug_for_moni_payOk() {
  24622. console.log('zh:start_debug_for_moni_payOk');
  24623. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24624. if (userInfo != null) {
  24625. let token = userInfo.token;
  24626. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24627. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24628. alert('模拟支付OK');
  24629. return;
  24630. }
  24631. else {
  24632. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24633. }
  24634. }
  24635. startGlobal() {
  24636. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24637. }
  24638. startWeekly() {
  24639. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24640. }
  24641. zhouSaiMonth() {
  24642. console.log('zh: zhouSaiMonth 被调用');
  24643. }
  24644. isReadyForLoadNetSource() {
  24645. let reqCount = xGame.cfgMgr.httpReqCount;
  24646. let ok = xGame.cfgMgr.httpReqOkCount;
  24647. if (reqCount > ok) {
  24648. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24649. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24650. Laya.timer.once(5000, this, () => {
  24651. let retryCount = 0;
  24652. const maxRetries = 3;
  24653. const tryFetchConfig = () => {
  24654. try {
  24655. xGame.cfgMgr.getConfigFromServer();
  24656. }
  24657. catch (error) {
  24658. if (retryCount < maxRetries) {
  24659. retryCount++;
  24660. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24661. Laya.timer.once(5000, this, tryFetchConfig);
  24662. }
  24663. else {
  24664. console.error("❌ 达到最大重试次数,配置获取失败");
  24665. }
  24666. }
  24667. };
  24668. tryFetchConfig();
  24669. });
  24670. return false;
  24671. }
  24672. return true;
  24673. }
  24674. startPlaceBall() {
  24675. if (!this.isReadyForLoadNetSource()) {
  24676. return;
  24677. }
  24678. xGame.uiMgr.Show(UILevelDisplay$1);
  24679. }
  24680. hide() {
  24681. console.log('zh:uimain hide ...');
  24682. super.hide();
  24683. xGame.common.stopGirlPop(this.ui.talkNode);
  24684. }
  24685. onGetUserInfo(force = false) {
  24686. if (Moyu.isWx) {
  24687. let info = Moyu.getSystemInfo();
  24688. if (info)
  24689. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24690. }
  24691. else {
  24692. Moyu.initUser(this, this.freshUser, force);
  24693. }
  24694. this.freshUser();
  24695. console.log('zh:5秒后更新用戶資產信息');
  24696. setTimeout(() => {
  24697. console.log('setTimeout 5秒over 執行');
  24698. DataMgr.getUserZiChanInfo();
  24699. }, 5000);
  24700. }
  24701. event_login_in() {
  24702. console.log("zh:event_login_in被触发");
  24703. this.freshUser();
  24704. }
  24705. freshUser() {
  24706. let user = Moyu.getUserInfo();
  24707. if (!user.isAuth) {
  24708. user.headIcon = 'res/ty_touxiang.png';
  24709. }
  24710. else {
  24711. DataMgr.upRankData();
  24712. }
  24713. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24714. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24715. let keyStr = keyForLoginInfo;
  24716. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24717. const d = LocalStorageManager.getItem(keyStr);
  24718. let ua = d.username;
  24719. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24720. }
  24721. else {
  24722. }
  24723. this.c_btn_for_user();
  24724. }
  24725. interuptSecretary() {
  24726. Laya.timer.clearAll(this);
  24727. this.playSecretaryRandomSound();
  24728. }
  24729. playSecretaryRandomSound() {
  24730. if (this.isHide)
  24731. return;
  24732. let time = xGame.common.randomNum(45000, 60000);
  24733. Laya.timer.once(time, this, () => {
  24734. if (this.isHide)
  24735. return;
  24736. let index = xGame.common.randomNum(4, 7);
  24737. xGame.soundMgr.playSound("s_main0" + index);
  24738. let words = 1;
  24739. switch (index) {
  24740. case 4:
  24741. words = 5;
  24742. break;
  24743. case 5:
  24744. words = 3;
  24745. break;
  24746. case 6:
  24747. words = 6;
  24748. break;
  24749. case 7:
  24750. words = 7;
  24751. break;
  24752. default:
  24753. break;
  24754. }
  24755. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24756. this.playSecretaryRandomSound();
  24757. });
  24758. }
  24759. openSecretaryView() {
  24760. xGame.uiMgr.Show(UISecretary$1);
  24761. Moyu.sendDataEvent("secretary");
  24762. }
  24763. openShopView() {
  24764. xGame.uiMgr.Show(UIShop$1, 0);
  24765. }
  24766. openSignView() {
  24767. xGame.uiMgr.Show(UISign$1);
  24768. }
  24769. openDrawView() {
  24770. xGame.uiMgr.Show(UIDraw$1);
  24771. }
  24772. openRanking() {
  24773. console.log('zh:phb openRanking');
  24774. xGame.uiMgr.Show(UIRanking$1);
  24775. Moyu.sendDataEvent("rankingList");
  24776. }
  24777. }
  24778. UIMain$1.uiName = "UIMain";
  24779. function InitShader() {
  24780. }
  24781. function appInit() {
  24782. xGame.context.init(getLoadingResList(), initCallback);
  24783. }
  24784. function getLoadingResList() {
  24785. return [
  24786. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24787. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24788. ];
  24789. }
  24790. function getGameResList() {
  24791. return [
  24792. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24793. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24794. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24795. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24796. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24797. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24798. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24799. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24800. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24801. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24802. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24803. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24804. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24805. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24806. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24807. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24808. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24809. ];
  24810. }
  24811. function initCallback() {
  24812. window["DataMgr"] = DataMgr;
  24813. DataMgr.Init();
  24814. Moyu.init(getPlat(), this, () => {
  24815. DataMgr.isNewDay();
  24816. PlatMgr.initConfig();
  24817. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24818. }, true);
  24819. console.log('zh:开始sm init1 start');
  24820. xGame.soundMgr.init();
  24821. console.log('zh:开始sm init1 end');
  24822. xGame.uiMgr.init();
  24823. xGame.uiMgr.clearTempData();
  24824. xGame.uiMgr.bindFUI(fguiRes.loading);
  24825. xGame.uiMgr.Show(UILoading);
  24826. }
  24827. function loadSubRes(callback) {
  24828. var tab = ["asset", "res", "spine"];
  24829. let subDone = 0;
  24830. for (var i = 0; i < tab.length; i++) {
  24831. let sub = tab[i];
  24832. Moyu.loadSubRes(sub, (pro) => {
  24833. callback && callback(pro, false);
  24834. }).then(() => {
  24835. subDone++;
  24836. if (subDone >= tab.length)
  24837. callback && callback(1, true);
  24838. });
  24839. }
  24840. }
  24841. function enterGame() {
  24842. xGame.cfgMgr.init();
  24843. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24844. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24845. xGame.uiMgr.Hide(UILoading);
  24846. fgui.UIPackage.removePackage(fguiRes.loading);
  24847. xGame.uiMgr.bindFUI(fguiRes.game);
  24848. xGame.uiMgr.Show(UIMain$1);
  24849. if (DataMgr.getNewUser())
  24850. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24851. }
  24852. function getPlat() {
  24853. let cfg = new MoyuCfg();
  24854. cfg.plat = MoyuPlat.web;
  24855. cfg.myId = 180;
  24856. cfg.myKey = '8848a885774230a4';
  24857. cfg.version = 0;
  24858. if (window.hasOwnProperty("gamebox")) {
  24859. cfg.plat = MoyuPlat.f399;
  24860. cfg.version = 0;
  24861. }
  24862. else if (window.hasOwnProperty("ks")) {
  24863. cfg.plat = MoyuPlat.ks;
  24864. cfg.version = 0;
  24865. cfg.ads.ksVideoId = '2300002254_01';
  24866. cfg.ads.ksInsertId = '2300002254_02';
  24867. }
  24868. else if (Laya.Browser.onTTMiniGame) {
  24869. cfg.plat = MoyuPlat.tt;
  24870. cfg.version = 0;
  24871. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24872. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24873. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24874. }
  24875. else if (Laya.Browser.onMiniGame) {
  24876. cfg.plat = MoyuPlat.wx;
  24877. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24878. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24879. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24880. }
  24881. else if (Laya.Browser.onQQMiniGame) {
  24882. cfg.plat = MoyuPlat.qq;
  24883. }
  24884. else if (Laya.Browser.onQGMiniGame) {
  24885. cfg.plat = MoyuPlat.op;
  24886. cfg.ads.opVideoId = '455502';
  24887. cfg.ads.opBannerId = '455507';
  24888. }
  24889. else if (Laya.Browser.onVVMiniGame) {
  24890. cfg.plat = MoyuPlat.vv;
  24891. cfg.version = 0;
  24892. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24893. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24894. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24895. }
  24896. else if (Laya.Browser.onHWMiniGame) {
  24897. cfg.plat = MoyuPlat.hw;
  24898. }
  24899. else if (window["mz"]) {
  24900. cfg.plat = MoyuPlat.mz;
  24901. }
  24902. else {
  24903. let cfg = window['conchConfig'];
  24904. if (cfg) {
  24905. var os = cfg.getOS();
  24906. if (os == "Conch-ios") {
  24907. cfg.plat = MoyuPlat.ios;
  24908. }
  24909. else if (os == "Conch-android") {
  24910. }
  24911. }
  24912. }
  24913. return cfg;
  24914. }
  24915. class Main {
  24916. constructor() {
  24917. if (window["Laya3D"])
  24918. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24919. else {
  24920. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  24921. this.initMain();
  24922. }
  24923. }
  24924. initMain() {
  24925. Laya["Physics"] && Laya["Physics"].enable();
  24926. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  24927. Laya.stage.scaleMode = GameConfig.scaleMode;
  24928. Laya.stage.screenMode = GameConfig.screenMode;
  24929. Laya.stage.alignV = GameConfig.alignV;
  24930. Laya.stage.alignH = GameConfig.alignH;
  24931. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  24932. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  24933. Laya.enableDebugPanel();
  24934. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  24935. Laya["PhysicsDebugDraw"].enable();
  24936. if (GameConfig.stat)
  24937. Laya.Stat.show();
  24938. Laya.alertGlobalError(true);
  24939. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  24940. }
  24941. onVersionLoaded() {
  24942. appInit();
  24943. }
  24944. }
  24945. new Main();
  24946. }());
  24947. //# sourceMappingURL=bundle.js.map