bundle.js 979 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526
  1. (function () {
  2. 'use strict';
  3. class GameConfig {
  4. constructor() {
  5. }
  6. static init() {
  7. var reg = Laya.ClassUtils.regClass;
  8. }
  9. }
  10. GameConfig.width = 1334;
  11. GameConfig.height = 750;
  12. GameConfig.scaleMode = "fixedheight";
  13. GameConfig.screenMode = "horizontal";
  14. GameConfig.alignV = "top";
  15. GameConfig.alignH = "left";
  16. GameConfig.startScene = "";
  17. GameConfig.sceneRoot = "";
  18. GameConfig.debug = false;
  19. GameConfig.stat = false;
  20. GameConfig.physicsDebug = false;
  21. GameConfig.exportSceneToJson = true;
  22. GameConfig.init();
  23. let fguiRes = {
  24. game: "asset/fgui/game",
  25. loading: "fgui/loading"
  26. };
  27. let ballCamp = {
  28. full: "full",
  29. flower: "flower"
  30. };
  31. let FoulType = {
  32. "timeOut": "1",
  33. "notTouch": "2",
  34. "wrongTouch": "3",
  35. "wrongHole": "4",
  36. "rootHole": "5",
  37. };
  38. let ALL_BALL_STOP = "ALL_BALL_STOP";
  39. let WAIT_SHOOT = "WAIT_SHOOT";
  40. let D3RES_LOADED = "D3RES_LOADED";
  41. let BALL_SHOOT = "BALL_SHOOT";
  42. let FIRST_BALL_HOLE = "FIRST_BALL_HOLE";
  43. let RESET_GAME = "RESET_GAME";
  44. let COIN_CHANGE = "COIN_CHANGE";
  45. let DIAMOND_CHANGE = "DIAMOND_CHANGE";
  46. let RESTART_GAME = "RESTART_GAME";
  47. let GET_USER_INFO = "GET_USER_INFO";
  48. let CHANGE_SECRETARY = "CHANGE_SECRETARY";
  49. let POWER_CHANGE = "POWER_CHANGE";
  50. let POWER_TIME = "POWER_TIME";
  51. let LOGIN_OUT = "LOGIN_OUT";
  52. let LOGIN_IN = "LOGIN_IN";
  53. let keyForLoginInfo = "userInfo";
  54. let TIP_MSG_key = {
  55. loginTimeOut: "Login timed out, please log in again.",
  56. pleaseLoginIn: "Please log in."
  57. };
  58. let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
  59. let poolKey = {
  60. inHoleEft: "inHoleEft",
  61. d3ball: "d3ball",
  62. iceEft: "iceEft",
  63. hitEft: "hitEft",
  64. fireworksEft: "fireworksEft",
  65. };
  66. var GameMode;
  67. (function (GameMode) {
  68. GameMode[GameMode["classic"] = 0] = "classic";
  69. GameMode[GameMode["bigMove"] = 1] = "bigMove";
  70. GameMode[GameMode["placeBall"] = 2] = "placeBall";
  71. })(GameMode || (GameMode = {}));
  72. var SkillType;
  73. (function (SkillType) {
  74. SkillType[SkillType["highSpace"] = 0] = "highSpace";
  75. SkillType[SkillType["breakArmy"] = 1] = "breakArmy";
  76. SkillType[SkillType["ice"] = 2] = "ice";
  77. SkillType[SkillType["fireworks"] = 3] = "fireworks";
  78. SkillType[SkillType["GuanYu"] = 4] = "GuanYu";
  79. })(SkillType || (SkillType = {}));
  80. var ClassicWordsType;
  81. (function (ClassicWordsType) {
  82. ClassicWordsType[ClassicWordsType["directShoot"] = 0] = "directShoot";
  83. ClassicWordsType[ClassicWordsType["bigPower"] = 1] = "bigPower";
  84. ClassicWordsType[ClassicWordsType["anotherShoot"] = 2] = "anotherShoot";
  85. ClassicWordsType[ClassicWordsType["perfectShow"] = 3] = "perfectShow";
  86. ClassicWordsType[ClassicWordsType["hardShoot"] = 4] = "hardShoot";
  87. })(ClassicWordsType || (ClassicWordsType = {}));
  88. var PressType;
  89. (function (PressType) {
  90. PressType[PressType["powerNode"] = 0] = "powerNode";
  91. PressType[PressType["d2Root"] = 1] = "d2Root";
  92. PressType[PressType["moveNode"] = 2] = "moveNode";
  93. PressType[PressType["rulerNode"] = 3] = "rulerNode";
  94. })(PressType || (PressType = {}));
  95. var PlaceBallType;
  96. (function (PlaceBallType) {
  97. PlaceBallType[PlaceBallType["normal"] = 0] = "normal";
  98. PlaceBallType[PlaceBallType["challenge"] = 1] = "challenge";
  99. })(PlaceBallType || (PlaceBallType = {}));
  100. var EAdType;
  101. (function (EAdType) {
  102. EAdType[EAdType["upSkill"] = 0] = "upSkill";
  103. EAdType[EAdType["addDiamond"] = 1] = "addDiamond";
  104. EAdType[EAdType["placeBallNextLevel"] = 2] = "placeBallNextLevel";
  105. EAdType[EAdType["regretBall"] = 3] = "regretBall";
  106. EAdType[EAdType["longHelpLine"] = 4] = "longHelpLine";
  107. EAdType[EAdType["addFailCoin"] = 5] = "addFailCoin";
  108. EAdType[EAdType["sign"] = 6] = "sign";
  109. EAdType[EAdType["draw"] = 7] = "draw";
  110. EAdType[EAdType["triple"] = 8] = "triple";
  111. EAdType[EAdType["randomDiamond"] = 9] = "randomDiamond";
  112. EAdType[EAdType["getPower"] = 10] = "getPower";
  113. EAdType[EAdType["box"] = 11] = "box";
  114. EAdType[EAdType["try"] = 12] = "try";
  115. EAdType[EAdType["againSign"] = 13] = "againSign";
  116. EAdType[EAdType["addCoin"] = 14] = "addCoin";
  117. })(EAdType || (EAdType = {}));
  118. var Prop;
  119. (function (Prop) {
  120. Prop[Prop["diamond"] = 1] = "diamond";
  121. Prop[Prop["coin"] = 2] = "coin";
  122. Prop[Prop["gan1"] = 3] = "gan1";
  123. Prop[Prop["gan2"] = 4] = "gan2";
  124. Prop[Prop["gan3"] = 5] = "gan3";
  125. Prop[Prop["gan4"] = 6] = "gan4";
  126. })(Prop || (Prop = {}));
  127. var TipsType;
  128. (function (TipsType) {
  129. TipsType[TipsType["exitGame"] = 0] = "exitGame";
  130. TipsType[TipsType["foul"] = 1] = "foul";
  131. })(TipsType || (TipsType = {}));
  132. class AwardType {
  133. constructor(type, num) {
  134. this.type = type;
  135. this.num = num;
  136. }
  137. }
  138. var define = /*#__PURE__*/Object.freeze({
  139. fguiRes: fguiRes,
  140. ballCamp: ballCamp,
  141. FoulType: FoulType,
  142. ALL_BALL_STOP: ALL_BALL_STOP,
  143. WAIT_SHOOT: WAIT_SHOOT,
  144. D3RES_LOADED: D3RES_LOADED,
  145. BALL_SHOOT: BALL_SHOOT,
  146. FIRST_BALL_HOLE: FIRST_BALL_HOLE,
  147. RESET_GAME: RESET_GAME,
  148. COIN_CHANGE: COIN_CHANGE,
  149. DIAMOND_CHANGE: DIAMOND_CHANGE,
  150. RESTART_GAME: RESTART_GAME,
  151. GET_USER_INFO: GET_USER_INFO,
  152. CHANGE_SECRETARY: CHANGE_SECRETARY,
  153. POWER_CHANGE: POWER_CHANGE,
  154. POWER_TIME: POWER_TIME,
  155. LOGIN_OUT: LOGIN_OUT,
  156. LOGIN_IN: LOGIN_IN,
  157. keyForLoginInfo: keyForLoginInfo,
  158. TIP_MSG_key: TIP_MSG_key,
  159. baseHeadUrl: baseHeadUrl,
  160. poolKey: poolKey,
  161. get GameMode () { return GameMode; },
  162. get SkillType () { return SkillType; },
  163. get ClassicWordsType () { return ClassicWordsType; },
  164. get PressType () { return PressType; },
  165. get PlaceBallType () { return PlaceBallType; },
  166. get EAdType () { return EAdType; },
  167. get Prop () { return Prop; },
  168. get TipsType () { return TipsType; },
  169. AwardType: AwardType
  170. });
  171. class CContext {
  172. constructor() {
  173. this.winSize = { width: 0, height: 0 };
  174. this.notchHeight = 0;
  175. this.bannerHeight = 0;
  176. }
  177. init(resList, callback) {
  178. this.winSize = { width: Laya.Browser.clientWidth, height: Laya.Browser.clientHeight };
  179. this.notchHeight = this.getNotchHeight();
  180. this.bannerHeight = this.getBannerHeight();
  181. Laya.loader.load(resList, Laya.Handler.create(this, () => {
  182. callback && callback();
  183. }));
  184. }
  185. getNotchHeight() {
  186. let notchHeight = 50;
  187. if (Laya.Browser.onMiniGame) {
  188. let deviceInfo = wx.getSystemInfoSync();
  189. if (Laya.Browser.onIOS) {
  190. if (deviceInfo.model.search('iPhone X') != -1) {
  191. notchHeight = deviceInfo.statusBarHeight - 10;
  192. }
  193. else {
  194. if ((deviceInfo.screenWidth == 375 && deviceInfo.screenHeight == 812) ||
  195. (deviceInfo.screenWidth == 414 && deviceInfo.screenHeight == 896)) {
  196. notchHeight = deviceInfo.statusBarHeight - 10;
  197. }
  198. }
  199. }
  200. else if (Laya.Browser.onAndroid) {
  201. if (deviceInfo.screenWidth / deviceInfo.screenHeight < (9 / 16)) {
  202. notchHeight = deviceInfo.statusBarHeight;
  203. }
  204. }
  205. }
  206. return notchHeight;
  207. }
  208. getBannerHeight() {
  209. return 0;
  210. }
  211. }
  212. let context = new CContext();
  213. var Handler = Laya.Handler;
  214. var Tween = Laya.Tween;
  215. function playClickEffect(btn) {
  216. if (!btn)
  217. return;
  218. Laya.Tween.to(btn, { scaleX: 1.05, scaleY: 1.05 }, 20, null, Laya.Handler.create(null, () => {
  219. if (!btn)
  220. return;
  221. Laya.Tween.to(btn, { scaleX: 0.96, scaleY: 0.96 }, 30, null, Laya.Handler.create(null, () => {
  222. if (!btn)
  223. return;
  224. Laya.Tween.to(btn, { scaleX: 1, scaleY: 1 }, 20, null, null, 0, true);
  225. }), 0, true);
  226. }), 0, true);
  227. }
  228. function getNumList(strList) {
  229. let dataList = [];
  230. if (strList) {
  231. let list = strList;
  232. let array = list.split(',');
  233. for (var v in array) {
  234. dataList.push(Number(array[v]));
  235. }
  236. }
  237. return dataList;
  238. }
  239. function getStrList(strList) {
  240. let dataList = [];
  241. if (strList) {
  242. let list = strList;
  243. let array = list.split('|');
  244. for (var v in array) {
  245. dataList.push(String(array[v]));
  246. }
  247. }
  248. return dataList;
  249. }
  250. function getRandStr(len) {
  251. let list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'];
  252. let str = "";
  253. for (let i = 0; i < len; i++) {
  254. let rand = random(0, list.length);
  255. str += list[rand];
  256. }
  257. return str;
  258. }
  259. function getUserId() {
  260. let str = getRandStr(12) + Laya.timer.currTimer % 1000000;
  261. return str;
  262. }
  263. function formatPos(pos, len = 2) {
  264. let v = Math.pow(10, len);
  265. pos.x = Math.floor(pos.x * v) / v;
  266. pos.y = Math.floor(pos.y * v) / v;
  267. if (pos.z)
  268. pos.z = Math.floor(pos.z * v) / v;
  269. return pos;
  270. }
  271. function setPosInt(pos) {
  272. pos.x = pos.x > 0 ? Math.ceil(pos.x) : Math.floor(pos.x);
  273. pos.y = pos.y > 0 ? Math.ceil(pos.y) : Math.floor(pos.y);
  274. pos.z = pos.z > 0 ? Math.ceil(pos.z) : Math.floor(pos.z);
  275. return pos;
  276. }
  277. function random(min, max) {
  278. var rang = max - min;
  279. var rand = Math.random() * rang;
  280. return Math.floor(rand) + min;
  281. }
  282. function randomList(list, num) {
  283. if (list.length <= num)
  284. return list;
  285. let arry = [];
  286. list.forEach(item => {
  287. arry.push(item);
  288. });
  289. let nums = [];
  290. for (let i = 0; i < num; i++) {
  291. let rand = random(0, arry.length);
  292. let v = arry[rand];
  293. nums.push(v);
  294. arry.splice(rand, 1);
  295. }
  296. return nums;
  297. }
  298. function worldToScreen(camera, point, pos) {
  299. camera.viewport.project(point, camera.projectionViewMatrix, pos);
  300. pos.x = pos.x / Laya.stage.clientScaleX;
  301. pos.y = pos.y / Laya.stage.clientScaleY;
  302. }
  303. function getStringLenght(str) {
  304. return str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  305. }
  306. function reviseString(str, len) {
  307. let ld = str.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  308. if (ld > len) {
  309. let sl = Math.floor(len / 2);
  310. let rs = str.substring(0, sl);
  311. let d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  312. while (d + 2 < len) {
  313. sl++;
  314. rs = str.substring(0, sl);
  315. d = rs.replace(/[\u4e00-\u9fa5]/g, "xx").length;
  316. }
  317. return rs + "...";
  318. }
  319. return str;
  320. }
  321. function getCoinString(coin) {
  322. if (coin < 10000)
  323. return coin.toString();
  324. else if (coin < 1000000) {
  325. let vh = Math.ceil(coin / 100);
  326. return (vh / 10) + "k";
  327. }
  328. else if (coin < 1000000000) {
  329. var vh = Math.ceil(coin / 100000);
  330. return (vh / 10) + "m";
  331. }
  332. else if (coin < 1000000000000) {
  333. var vh = Math.ceil(coin / 100000000);
  334. return (vh / 10) + "b";
  335. }
  336. else if (coin < 1000000000000000) {
  337. var vh = Math.ceil(coin / 100000000000);
  338. return (vh / 10) + "t";
  339. }
  340. }
  341. function getV3Dest(pos, dir, dis, dest) {
  342. dir.x *= dis;
  343. dir.y *= dis;
  344. dir.z *= dis;
  345. Laya.Vector3.add(pos, dir, dest);
  346. return dest;
  347. }
  348. function getV2Dest(x1, y1, dir, dis, dest) {
  349. dest.x = x1 + dir.x * dis;
  350. dest.y = y1 + dir.y * dis;
  351. return dest;
  352. }
  353. function getV2Dir(x1, y1, x2, y2, dir) {
  354. dir.x = x2 - x1;
  355. dir.y = y2 - y1;
  356. Laya.Vector2.normalize(dir, dir);
  357. return dir;
  358. }
  359. function getV3Dir(p1, p2, dir) {
  360. Laya.Vector3.subtract(p1, p2, dir);
  361. Laya.Vector3.normalize(dir, dir);
  362. return dir;
  363. }
  364. function copyPos(ip, op) {
  365. op.x = ip.x;
  366. op.y = ip.y;
  367. if (ip.z)
  368. op.z = ip.z;
  369. return op;
  370. }
  371. function getScreenImg() {
  372. let gl = Laya.WebGLContext.mainContext;
  373. let pixels = new Uint8Array(gl.drawingBufferWidth * gl.drawingBufferHeight * 4);
  374. gl.readPixels(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight, gl.RGBA, gl.UNSIGNED_BYTE, pixels);
  375. let w = gl.drawingBufferWidth;
  376. let h = gl.drawingBufferHeight;
  377. let texture2d = new Laya.Texture2D(w, h, Laya.TextureFormat.R8G8B8A8, false, false);
  378. texture2d.setPixels(pixels);
  379. return new Laya.Texture(texture2d);
  380. }
  381. function playMoveByPositions(sp, positions, v, completeCallback) {
  382. let p;
  383. let play = () => {
  384. if (positions.length == 0) {
  385. completeCallback();
  386. return;
  387. }
  388. p = positions[0];
  389. positions.splice(0, 1);
  390. Laya.Tween.to(sp, { x: p.x, y: p.y }, getDistance(sp.x, sp.y, p.x, p.y) / v * 1000, null, Handler.create(this, () => {
  391. play();
  392. }));
  393. };
  394. play();
  395. }
  396. function setStarPos(node, num, max) {
  397. for (let i = 1; i <= 5; i++) {
  398. let img = node.getChildAt(i - 1);
  399. img.width = img.height = 30;
  400. img.pivotX = img.pivotY = 0.5;
  401. img.gray = i > num;
  402. img.visible = i <= max;
  403. if (max == 3) {
  404. img.x = node.width / 2 + (i - 2) * 30 - 15;
  405. img.y = node.height - 40;
  406. if (i == 2)
  407. img.y = node.height - 30;
  408. }
  409. else if (max == 5) {
  410. let ly = Math.abs(i - 3);
  411. img.x = node.width / 2 + (i - 3) * 20 - 15;
  412. img.y = node.height - ly * 8 - 30;
  413. }
  414. }
  415. }
  416. function playLoopAnimRotate(sp, time, clockwise = true) {
  417. let rotation;
  418. sp.rotation = sp.rotation % 360;
  419. if (clockwise) {
  420. rotation = -360;
  421. }
  422. else {
  423. rotation = 360;
  424. }
  425. Tween.to(sp, { rotation: rotation }, time, null, Handler.create(this, () => {
  426. this.playLoopAnimRotate(sp, time, clockwise);
  427. }));
  428. }
  429. function playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, isBig = true) {
  430. let x, y;
  431. if (isBig) {
  432. x = valueXMin;
  433. y = valueYMin;
  434. }
  435. else {
  436. x = valueXMax;
  437. y = valueYMax;
  438. }
  439. Tween.to(sp, { x: x, y: y }, time, null, Handler.create(this, () => {
  440. this.playLoopAnimPosition(sp, valueXMin, valueXMax, valueYMin, valueYMax, time, !isBig);
  441. }));
  442. }
  443. function playLoopAnimScale(sp, valueMin, valueMax, time, isBig = true) {
  444. let scale;
  445. if (isBig) {
  446. scale = valueMin;
  447. }
  448. else {
  449. scale = valueMax;
  450. }
  451. Tween.to(sp, { scaleX: scale, scaleY: scale }, time, null, Handler.create(this, () => {
  452. playLoopAnimScale(sp, valueMin, valueMax, time, !isBig);
  453. }));
  454. }
  455. function playLoopAnimRotation(sp, valueMin, valueMax, time, isBig = true, count = 8) {
  456. let value;
  457. if (isBig) {
  458. value = valueMin;
  459. }
  460. else {
  461. value = valueMax;
  462. }
  463. if (count) {
  464. count--;
  465. Tween.to(sp, { rotation: value }, time, null, Handler.create(this, () => {
  466. playLoopAnimRotation(sp, valueMin, valueMax, time, !isBig, count);
  467. }));
  468. }
  469. else {
  470. sp.rotation = 0;
  471. }
  472. }
  473. function inRect(rect, p) {
  474. if (p.x >= rect.x && p.x <= rect.x + rect.w) {
  475. if (p.y >= rect.y && p.y <= rect.y + rect.h) {
  476. return true;
  477. }
  478. }
  479. return false;
  480. }
  481. function getNumberK(number) {
  482. if (number < 1000) {
  483. return number.toString();
  484. }
  485. else {
  486. return (number / 1000).toFixed(1) + "k";
  487. }
  488. }
  489. function pointInsideCircle(point, circle, r) {
  490. if (r === 0)
  491. return false;
  492. var dx = circle.x - point.x;
  493. var dy = circle.y - point.y;
  494. return dx * dx + dy * dy <= r * r;
  495. }
  496. function formatString(str, data) {
  497. if (!str || data == undefined) {
  498. return str;
  499. }
  500. if (typeof data === "object") {
  501. for (var key in data) {
  502. if (data.hasOwnProperty(key)) {
  503. str = str.replace(new RegExp("\{" + key + "\}", "g"), data[key]);
  504. }
  505. }
  506. }
  507. else {
  508. var args = arguments, reg = new RegExp("\{([0-" + (args.length - 1) + "])\}", "g");
  509. return str.replace(reg, function (match, index) {
  510. return args[index - (-1)];
  511. });
  512. }
  513. return str;
  514. }
  515. function getIntersection(a, b) {
  516. let t = [];
  517. for (var i = 0; i < a.length; i++) {
  518. for (var j = 0; j < b.length; j++) {
  519. if (a[i] == b[j]) {
  520. t.push(a[i]);
  521. }
  522. }
  523. }
  524. return t;
  525. }
  526. function getComplement(a, b) {
  527. let t = [];
  528. let count = false;
  529. for (var i = 0; i < a.length; i++) {
  530. count = false;
  531. for (var j = 0; j < b.length; j++) {
  532. if (a[i] == b[j]) {
  533. count = true;
  534. break;
  535. }
  536. }
  537. if (!count) {
  538. t.push(a[i]);
  539. }
  540. }
  541. return t;
  542. }
  543. function geSpriteStageRect(sp) {
  544. var point = sp.localToGlobal(Laya.Point.TEMP.setTo(0, 0));
  545. let rect = {
  546. x: point.x,
  547. y: point.y,
  548. width: sp.width * sp.globalScaleX,
  549. height: sp.height * sp.globalScaleY
  550. };
  551. return rect;
  552. }
  553. function touchButton(button) {
  554. let event = new Laya.Event();
  555. button.event(Laya.Event.CLICK, event.setTo(Laya.Event.CLICK, button, button));
  556. }
  557. function setColor(sprite, r, g, b) {
  558. var redMat = [
  559. r / 255, 0, 0, 0, 0,
  560. g / 255, 0, 0, 0, 0,
  561. b / 255, 0, 0, 0, 0,
  562. 0, 0, 0, 1, 0,
  563. ];
  564. var filter = new Laya.ColorFilter(redMat);
  565. sprite.filters = [filter];
  566. }
  567. function clone(obj, newobj = {}) {
  568. for (var attr in obj) {
  569. if (typeof obj[attr] == "object") {
  570. newobj[attr] = clone(obj[attr], newobj[attr]);
  571. }
  572. else {
  573. newobj[attr] = obj[attr];
  574. }
  575. }
  576. return newobj;
  577. }
  578. function _ms(arr, compare, begin, end) {
  579. const size = end - begin;
  580. if (size <= 1) {
  581. return;
  582. }
  583. const middle = (end + begin) >> 1;
  584. _ms(arr, compare, begin, middle);
  585. _ms(arr, compare, middle, end);
  586. if (compare(arr[middle - 1], arr[middle]) <= 0) {
  587. return;
  588. }
  589. const merged = [];
  590. let leftIndex = begin, rightIndex = middle;
  591. while (merged.length < size) {
  592. if (leftIndex === middle) {
  593. merged.push(arr[rightIndex++]);
  594. }
  595. else if (rightIndex === end) {
  596. merged.push(arr[leftIndex++]);
  597. }
  598. else {
  599. const c = compare(arr[leftIndex], arr[rightIndex]);
  600. if (c <= 0) {
  601. merged.push(arr[leftIndex++]);
  602. }
  603. else {
  604. merged.push(arr[rightIndex++]);
  605. }
  606. }
  607. }
  608. arr.splice(begin, size, ...merged);
  609. }
  610. function sort(arr, compare) {
  611. if (!Array.isArray(arr)) {
  612. throw new Error('sort的参数必须为数组');
  613. }
  614. _ms(arr, compare, 0, arr.length);
  615. return arr;
  616. }
  617. function getLanguage(id) {
  618. }
  619. function getLanguageByTip(id) {
  620. }
  621. function toWeights(array) {
  622. let max = 0;
  623. for (var i = 0; i < array.length; i++) {
  624. max = max + array[i];
  625. if (array[i] == 0) {
  626. array[i] = 0;
  627. }
  628. else {
  629. array[i] = max;
  630. }
  631. }
  632. return array;
  633. }
  634. function unique(array) {
  635. var n = {}, r = [], len = array.length, val, type;
  636. for (var i = 0; i < array.length; i++) {
  637. val = array[i];
  638. type = typeof val;
  639. if (!n[val]) {
  640. n[val] = [type];
  641. r.push(val);
  642. }
  643. else if (n[val].indexOf(type) < 0) {
  644. n[val].push(type);
  645. r.push(val);
  646. }
  647. }
  648. return r;
  649. }
  650. function unique1(array) {
  651. var r = [];
  652. for (var i = 0, l = array.length; i < l; i++) {
  653. for (var j = i + 1; j < l; j++)
  654. if (array[i] == array[j])
  655. j == ++i;
  656. r.push(array[i]);
  657. }
  658. return r;
  659. }
  660. function getDistance(x1, y1, x2, y2) {
  661. return Math.pow(((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)), 0.5);
  662. }
  663. function getV2Dis(pos1, pos2) {
  664. return Math.pow(((pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y)), 0.5);
  665. }
  666. function getV2SqDis(pos1, pos2) {
  667. return (pos1.x - pos2.x) * (pos1.x - pos2.x) + (pos1.y - pos2.y) * (pos1.y - pos2.y);
  668. }
  669. function getDis(x1, y1, x2, y2) {
  670. return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  671. }
  672. function getDeltaxy(x1, y1, x2, y2) {
  673. return Math.abs(x1 - x2) + Math.abs(y1 - y2);
  674. }
  675. function getSymbolNumber(num) {
  676. if (num > 0) {
  677. return "+" + num;
  678. }
  679. else if (num < 0) {
  680. return num.toString();
  681. }
  682. return num.toString();
  683. }
  684. function fixNumber(num, length) {
  685. return ('' + num).length < length ? ((new Array(length + 1)).join('0') + num).slice(-length) : '' + num;
  686. }
  687. function toThousands(num) {
  688. return num.replace(/(\d)(?=(?:\d{3})+$)/g, '$1,');
  689. }
  690. let moneyUnitStr = ["", "K", "M", "B", "T", "AK", "AM", "AB", "AT", "BK", "BM", "BB", "BT", "CK", "CM", "CB", "CT"];
  691. function fmtMoney(money) {
  692. money = toThousands(money.replace(/^0+/, ''));
  693. if (money.length == 0) {
  694. money = "0";
  695. }
  696. let unit = 0;
  697. for (var i = 0; i < money.length; i++) {
  698. if (money.charAt(i) == ",") {
  699. unit++;
  700. }
  701. }
  702. if (unit == 0) {
  703. return money;
  704. }
  705. else {
  706. let idx = money.indexOf(",");
  707. if (idx) {
  708. money = money.slice(0, idx + 2) + moneyUnitStr[unit];
  709. }
  710. return money.replace(",", ".");
  711. }
  712. }
  713. function flatten(arr) {
  714. while (arr.some(item => Array.isArray(item))) {
  715. arr = [].concat(...arr);
  716. }
  717. return arr;
  718. }
  719. function getDistanceByPoint(p1, p2) {
  720. return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
  721. }
  722. function getAngleByPoint(p1, p2) {
  723. return Math.atan2((p2.y - p1.y), (p2.x - p1.x)) * (180 / Math.PI);
  724. }
  725. function toIntByArray(array) {
  726. for (var index = 0; index < array.length; index++) {
  727. array[index] = parseInt(array[index]);
  728. }
  729. return array;
  730. }
  731. function getAngle0To360(angle) {
  732. while (angle < 0) {
  733. angle += 360;
  734. }
  735. while (angle >= 360) {
  736. angle -= 360;
  737. }
  738. return angle;
  739. }
  740. function toAngle(radian) {
  741. return radian * 180 / Math.PI;
  742. }
  743. function toRadian(angle) {
  744. return angle * Math.PI / 180;
  745. }
  746. function getArrayValueRandom(array) {
  747. return array[random(0, array.length - 1)];
  748. }
  749. function promptByTip(tipId, color = "#FFFFFF", strokeColor = null, time = 1000, fontSize = 35, opacity = 1) {
  750. }
  751. function promptByErrorCode(id, color = "#FFFFFF", strokeColor = "#FF8B00", time = 1000, fontSize = 35, opacity = 1) {
  752. }
  753. function fmtTimeMMSS(time) {
  754. if (time < 0) {
  755. time = 0;
  756. }
  757. else
  758. time = Math.floor(time);
  759. return fixNumber(Math.floor(time / 60), 2) + ":" + fixNumber(time % 60, 2);
  760. }
  761. function fmtTimeMS(time) {
  762. if (time < 0) {
  763. time = 0;
  764. }
  765. return fixNumber(Math.floor(time / 60), 2) + "m" + fixNumber(time % 60, 2) + "s";
  766. }
  767. function fmtTimeHHMM(time) {
  768. if (time < 0) {
  769. time = 0;
  770. }
  771. time = Math.floor(time / 1000);
  772. return fixNumber(Math.floor(time / 3600), 2) + ":" + fixNumber(Math.floor((time % 3600) / 60), 2) + ":" + fixNumber(Math.floor(time % 60), 2);
  773. }
  774. let severTime = 0;
  775. function getServerTime() {
  776. return new Date(new Date().getTime() - severTime);
  777. }
  778. function setServerTime(data) {
  779. severTime = (new Date().getTime() - data);
  780. }
  781. var tools = /*#__PURE__*/Object.freeze({
  782. playClickEffect: playClickEffect,
  783. getNumList: getNumList,
  784. getStrList: getStrList,
  785. getRandStr: getRandStr,
  786. getUserId: getUserId,
  787. formatPos: formatPos,
  788. setPosInt: setPosInt,
  789. random: random,
  790. randomList: randomList,
  791. worldToScreen: worldToScreen,
  792. getStringLenght: getStringLenght,
  793. reviseString: reviseString,
  794. getCoinString: getCoinString,
  795. getV3Dest: getV3Dest,
  796. getV2Dest: getV2Dest,
  797. getV2Dir: getV2Dir,
  798. getV3Dir: getV3Dir,
  799. copyPos: copyPos,
  800. getScreenImg: getScreenImg,
  801. playMoveByPositions: playMoveByPositions,
  802. setStarPos: setStarPos,
  803. playLoopAnimRotate: playLoopAnimRotate,
  804. playLoopAnimPosition: playLoopAnimPosition,
  805. playLoopAnimScale: playLoopAnimScale,
  806. playLoopAnimRotation: playLoopAnimRotation,
  807. inRect: inRect,
  808. getNumberK: getNumberK,
  809. pointInsideCircle: pointInsideCircle,
  810. formatString: formatString,
  811. getIntersection: getIntersection,
  812. getComplement: getComplement,
  813. geSpriteStageRect: geSpriteStageRect,
  814. touchButton: touchButton,
  815. setColor: setColor,
  816. clone: clone,
  817. sort: sort,
  818. getLanguage: getLanguage,
  819. getLanguageByTip: getLanguageByTip,
  820. toWeights: toWeights,
  821. unique: unique,
  822. unique1: unique1,
  823. getDistance: getDistance,
  824. getV2Dis: getV2Dis,
  825. getV2SqDis: getV2SqDis,
  826. getDis: getDis,
  827. getDeltaxy: getDeltaxy,
  828. getSymbolNumber: getSymbolNumber,
  829. fixNumber: fixNumber,
  830. toThousands: toThousands,
  831. fmtMoney: fmtMoney,
  832. flatten: flatten,
  833. getDistanceByPoint: getDistanceByPoint,
  834. getAngleByPoint: getAngleByPoint,
  835. toIntByArray: toIntByArray,
  836. getAngle0To360: getAngle0To360,
  837. toAngle: toAngle,
  838. toRadian: toRadian,
  839. getArrayValueRandom: getArrayValueRandom,
  840. promptByTip: promptByTip,
  841. promptByErrorCode: promptByErrorCode,
  842. fmtTimeMMSS: fmtTimeMMSS,
  843. fmtTimeMS: fmtTimeMS,
  844. fmtTimeHHMM: fmtTimeHHMM,
  845. getServerTime: getServerTime,
  846. setServerTime: setServerTime
  847. });
  848. class HttpMgr {
  849. constructor() {
  850. this.isDev = false;
  851. HttpMgr._instance = this;
  852. }
  853. static getInstance() {
  854. if (!this._instance) {
  855. this._instance = new HttpMgr();
  856. }
  857. return this._instance;
  858. }
  859. sendPost(url, data, call) {
  860. let httpObj = new Laya.HttpRequest();
  861. httpObj.http.timeout = 5000;
  862. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  863. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  864. httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
  865. function errorHandler(error) {
  866. console.log("errorHandler:" + error);
  867. alert("Please check your network connection.");
  868. }
  869. function completeHandler(data) {
  870. if (data && data.length > 0) {
  871. let jsonData = JSON.parse(data);
  872. if (call)
  873. call(jsonData);
  874. }
  875. }
  876. }
  877. getReqData() {
  878. let reqData = JSON.stringify({
  879. gameName: "TQ",
  880. gameUserName: "zhangSan",
  881. isDev: this.isDev
  882. });
  883. return reqData;
  884. }
  885. sendPost2025(reqUrl, data, call) {
  886. let isDev = this.isDev;
  887. let urlTop = "https://api.kessongame.site/";
  888. let urlMid = urlTop + "prod-api/api/";
  889. if (isDev) {
  890. urlTop = "http://192.168.1.13:8090/";
  891. urlMid = urlTop + "api/";
  892. console.log('zh:TEST环境');
  893. }
  894. else {
  895. console.log('zh:SC环境');
  896. }
  897. let url = urlMid + reqUrl;
  898. if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
  899. if (isDev) {
  900. url = urlTop + reqUrl;
  901. }
  902. else {
  903. url = urlTop + "prod-api/" + reqUrl;
  904. }
  905. }
  906. let headers = ["Content-Type", "application/json; charset=UTF-8"];
  907. if (reqUrl.indexOf("/api/game/") >= 0) {
  908. }
  909. const keyForLoginInfo = "userInfo";
  910. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  911. if (userInfoData != null) {
  912. try {
  913. let bb = JSON.parse(userInfoData);
  914. if (bb) {
  915. let token = bb.token;
  916. headers.push("Authorization");
  917. headers.push(`Bearer ${token}`);
  918. }
  919. }
  920. catch (e) {
  921. }
  922. }
  923. let httpObj = new Laya.HttpRequest();
  924. httpObj.http.timeout = 5000;
  925. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  926. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  927. httpObj.send(url, data, 'post', 'text', headers);
  928. function errorHandler(error) {
  929. if (call) {
  930. call("{'msg':'Network exception','code':500}");
  931. }
  932. else {
  933. alert("Tip:Please check your network connection.");
  934. }
  935. }
  936. function completeHandler(data) {
  937. if (data && data.length > 0) {
  938. let jsonData = JSON.parse(data);
  939. if (call)
  940. call(jsonData);
  941. }
  942. }
  943. }
  944. sendGet(url, call) {
  945. let httpObj = new Laya.HttpRequest();
  946. httpObj.http.timeout = 5000;
  947. httpObj.once(Laya.Event.COMPLETE, this, completeHandler);
  948. httpObj.once(Laya.Event.ERROR, this, errorHandler);
  949. httpObj.send(url, '', 'get');
  950. function errorHandler(error) {
  951. console.log("errorHandler:" + error);
  952. }
  953. function completeHandler(data) {
  954. if (data && data.length > 0) {
  955. if (call)
  956. call(data);
  957. }
  958. }
  959. }
  960. }
  961. HttpMgr._instance = null;
  962. class LightShader extends Laya.Sprite {
  963. constructor() {
  964. super();
  965. this._time = 0;
  966. this._sin = 0;
  967. this.initShader();
  968. }
  969. initShader() {
  970. var vs = `
  971. #define FSHIGHPRECISION
  972. attribute vec4 posuv;
  973. uniform vec2 size;
  974. varying vec4 v_texcoord;
  975. void main() {
  976. vec4 pos = vec4(posuv.xy,0.,1.);
  977. vec4 pos1 =vec4((pos.x/size.x-0.5)*2.0,(0.5-pos.y/size.y)*2.0,0.,1.0);
  978. gl_Position=pos1;
  979. v_texcoord.xy = posuv.xy;
  980. }
  981. `;
  982. var ps = `
  983. #define FSHIGHPRECISION
  984. precision highp float;
  985. varying vec4 v_texcoord;
  986. uniform vec2 size;
  987. uniform sampler2D texture;
  988. uniform float u_Time;
  989. void main() {
  990. vec4 color= texture2D(texture, v_texcoord.xy);
  991. float width = 0.2;
  992. float start = u_Time;
  993. float offset = 1.0;
  994. vec2 myuv = vec2(v_texcoord.x/size.x,v_texcoord.y/size.y);
  995. if( myuv.x < (start - offset * myuv.y) && myuv.x > (start - offset * myuv.y - width))
  996. {
  997. color.r=1.1;
  998. color.g=1.1;
  999. color.b=1.1;
  1000. gl_FragColor = color;
  1001. } else {
  1002. gl_FragColor = color;
  1003. }
  1004. }
  1005. `;
  1006. this.shaderValue = new Laya.Value2D(LightShader.DissolveSurfaceSaveName, LightShader.DissolveSurfaceSaveName);
  1007. this.customRenderEnable = true;
  1008. this.shaderValue.shader = new Laya.Shader2X(vs, ps, LightShader.DissolveSurfaceSaveName);
  1009. }
  1010. customRender(context, x, y) {
  1011. this.onUpdate();
  1012. if (!this.texture)
  1013. return;
  1014. let xx = x - this.pivotX;
  1015. let yy = y - this.pivotY;
  1016. context.drawTarget(this.texture, xx, yy, this.width, this.height, null, this.shaderValue);
  1017. }
  1018. onUpdate() {
  1019. this._time += 2 * Laya.timer.delta * 0.001;
  1020. this._sin = Math.sin(this._time);
  1021. if (this._sin > 0.99) {
  1022. this._sin = 0;
  1023. this._time = 0;
  1024. }
  1025. this.shaderValue['u_Time'] = this._sin;
  1026. }
  1027. }
  1028. LightShader.DissolveSurfaceSaveName = 9997;
  1029. class UIBase extends fairygui.Window {
  1030. constructor() {
  1031. super();
  1032. this.isEject = true;
  1033. this.isHide = true;
  1034. this.showbanner = true;
  1035. this.className = "";
  1036. this.isMuti = false;
  1037. this.showbanner = false;
  1038. this.onConstructor();
  1039. }
  1040. checkActive(show) {
  1041. }
  1042. getUIName() {
  1043. return UIBase.uiName;
  1044. }
  1045. onConstructor() {
  1046. try {
  1047. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoadedForBase));
  1048. console.log("zh: base加载arial字体成功");
  1049. }
  1050. catch (error) {
  1051. console.log("zh: base加载arial字体失败");
  1052. }
  1053. }
  1054. onFontLoadedForBase() {
  1055. try {
  1056. Laya.Text.defaultFont = "arial";
  1057. console.log("zh: base 设置arial字体成功");
  1058. }
  1059. catch (error) {
  1060. console.log("zh: base 设置arial字体失败");
  1061. }
  1062. }
  1063. onInit() {
  1064. if (!!this.contentPane) {
  1065. this.contentPane.setSize(fairygui.GRoot.inst.width, fairygui.GRoot.inst.height);
  1066. }
  1067. this.setPivot(0.5, 0.5, false);
  1068. }
  1069. doShowAnimation() {
  1070. if (!this.isEject)
  1071. return;
  1072. super.doShowAnimation();
  1073. Laya.Tween.clearTween(this);
  1074. this.scaleX = this.scaleY = 0.8;
  1075. let tweenFunc1 = (func) => {
  1076. Laya.Tween.to(this, { scaleX: 1.1, scaleY: 1.1 }, 100, Laya.Ease.linearIn, Laya.Handler.create(this, func));
  1077. };
  1078. let tweenFunc2 = (func) => {
  1079. Laya.Tween.to(this, { scaleX: 1, scaleY: 1 }, 60, Laya.Ease.linearOut, Laya.Handler.create(this, this.refresh));
  1080. };
  1081. tweenFunc1(tweenFunc2);
  1082. }
  1083. show(...args) {
  1084. super.show();
  1085. this._openParam = args;
  1086. this.isHide = false;
  1087. xGame.uiMgr.checkUIState();
  1088. }
  1089. moveBannerButton() {
  1090. }
  1091. showBannerButton() {
  1092. this.bannerButton.visible = true;
  1093. Laya.Tween.to(this.bannerButton, { alpha: 1 }, 500, Laya.Ease.linearOut, Laya.Handler.create(this, () => {
  1094. this.bannerButton.touchable = true;
  1095. }));
  1096. }
  1097. hide() {
  1098. super.hide();
  1099. this.isHide = true;
  1100. xGame.uiMgr.checkUIState();
  1101. }
  1102. Dispose() {
  1103. super.dispose();
  1104. }
  1105. myUpdate(delay) {
  1106. }
  1107. refresh() { }
  1108. setGlobalFont(root) {
  1109. try {
  1110. console.log('zh: setGlobalFont start');
  1111. let fontName = "arial";
  1112. const setFont = (obj) => {
  1113. if (obj instanceof fairygui.GTextField) {
  1114. obj.font = fontName;
  1115. }
  1116. if (obj instanceof fairygui.GComponent) {
  1117. for (let i = 0; i < obj.numChildren; i++) {
  1118. setFont(obj.getChildAt(i));
  1119. }
  1120. }
  1121. };
  1122. const rootNode = root || this.contentPane;
  1123. if (rootNode) {
  1124. setFont(rootNode);
  1125. }
  1126. }
  1127. catch (error) {
  1128. console.log('zh: setGlobalFont error=' + error);
  1129. }
  1130. finally {
  1131. console.log('zh: setGlobalFont end');
  1132. }
  1133. }
  1134. addUIClick(obj, func, arr = null) {
  1135. obj.onClick(this, func, arr);
  1136. obj.onClick(this, this.playBtnSound);
  1137. }
  1138. offUIClick(obj, func) {
  1139. obj.offClick(this, func);
  1140. }
  1141. playBtnSound() {
  1142. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  1143. }
  1144. }
  1145. UIBase.lastShowBanner = 0;
  1146. UIBase.showBannerNum = 0;
  1147. UIBase.uiName = "";
  1148. class ui_UIDraw extends fgui.GComponent {
  1149. static createInstance() {
  1150. return (fgui.UIPackage.createObject("game", "UIDraw"));
  1151. }
  1152. onConstruct() {
  1153. this.n_bj = (this.getChild("n_bj"));
  1154. this.n1 = (this.getChild("n1"));
  1155. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  1156. this.myNode = (this.getChild("myNode"));
  1157. this.extraNode = (this.getChild("extraNode"));
  1158. this.closeNode = (this.getChild("closeNode"));
  1159. this.moneyNode = (this.getChild("moneyNode"));
  1160. this.n38 = (this.getChild("n38"));
  1161. this.talkNode = (this.getChild("talkNode"));
  1162. this.secretary = (this.getChild("secretary"));
  1163. this.drawBtn = (this.getChild("drawBtn"));
  1164. this.t0 = this.getTransition("t0");
  1165. }
  1166. }
  1167. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1168. class ui_UIBox extends fgui.GComponent {
  1169. static createInstance() {
  1170. return (fgui.UIPackage.createObject("game", "UIBox"));
  1171. }
  1172. onConstruct() {
  1173. this.n0 = (this.getChild("n0"));
  1174. this.n12 = (this.getChild("n12"));
  1175. this.n1 = (this.getChild("n1"));
  1176. this.n2 = (this.getChild("n2"));
  1177. this.bar = (this.getChild("bar"));
  1178. this.closeBtn = (this.getChild("closeBtn"));
  1179. this.openBtn = (this.getChild("openBtn"));
  1180. this.t0 = this.getTransition("t0");
  1181. this.t1 = this.getTransition("t1");
  1182. }
  1183. }
  1184. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1185. class LocalStorageManager {
  1186. test1() {
  1187. LocalStorageManager.setItem("playerName", "Tom");
  1188. LocalStorageManager.setItem("playerLevel", 5);
  1189. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1190. const name = LocalStorageManager.getItem("playerName");
  1191. const level = LocalStorageManager.getItem("playerLevel");
  1192. const data = LocalStorageManager.getItem("playerData");
  1193. console.log(name);
  1194. console.log(level);
  1195. console.log(data);
  1196. LocalStorageManager.removeItem("playerLevel");
  1197. }
  1198. static setItem(key, value) {
  1199. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1200. }
  1201. static getItem(key) {
  1202. const data = Laya.LocalStorage.getItem(key);
  1203. if (data === null)
  1204. return null;
  1205. try {
  1206. return JSON.parse(data);
  1207. }
  1208. catch (e) {
  1209. return data;
  1210. }
  1211. }
  1212. static removeItem(key) {
  1213. Laya.LocalStorage.removeItem(key);
  1214. }
  1215. static clear() {
  1216. Laya.LocalStorage.clear();
  1217. }
  1218. static hasJosnKey(key) {
  1219. var value = Laya.LocalStorage.getJSON(key);
  1220. if (value != null) {
  1221. return true;
  1222. }
  1223. else {
  1224. return false;
  1225. }
  1226. }
  1227. static hasKey(key) {
  1228. return Laya.LocalStorage.getItem(key) !== null;
  1229. }
  1230. }
  1231. class GlobalManager {
  1232. constructor() {
  1233. }
  1234. registerMethod(name, method) {
  1235. console.log('zh: 注册全局方法', name);
  1236. this[name] = method;
  1237. }
  1238. callMethod(name, ...args) {
  1239. console.log('zh: 调用全局方法', name);
  1240. if (this[name]) {
  1241. return this[name](...args);
  1242. }
  1243. else {
  1244. console.error(`zh: 全局方法 Method ${name} not found`);
  1245. }
  1246. }
  1247. }
  1248. GlobalManager.instance = new GlobalManager();
  1249. class JSBridgeUtils {
  1250. constructor() { }
  1251. static get instance() {
  1252. if (!this._instance) {
  1253. this._instance = new JSBridgeUtils();
  1254. }
  1255. return this._instance;
  1256. }
  1257. initBridge() {
  1258. if (!Laya.Browser.onAndroid) {
  1259. console.log('zh:非android dev');
  1260. return;
  1261. }
  1262. let cfg = window['conchConfig'];
  1263. if (cfg) {
  1264. var os = cfg.getOS();
  1265. if (os == "Conch-android") {
  1266. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1267. if (this.bridge) {
  1268. return true;
  1269. }
  1270. else {
  1271. return false;
  1272. }
  1273. }
  1274. else {
  1275. return false;
  1276. }
  1277. }
  1278. else {
  1279. return false;
  1280. }
  1281. }
  1282. testAd1() {
  1283. if (!Laya.Browser.onAndroid) {
  1284. console.log('zh:非android dev');
  1285. return;
  1286. }
  1287. if (!this.initBridge()) {
  1288. return;
  1289. }
  1290. let rs = this.bridge.call("testString", "hello");
  1291. console.log('zh:testString rs=' + rs);
  1292. }
  1293. testAdCallBack() {
  1294. if (!this.initBridge()) {
  1295. return;
  1296. }
  1297. console.log("zh:testAdCallBack start");
  1298. const defaultObj = { code: 200, msg: "req update Ui" };
  1299. const reqObj = { code: 300, msg: "hello java ui" };
  1300. this.bridge.callWithBack((rsStr) => {
  1301. const rsObj = JSON.parse(rsStr);
  1302. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1303. }, "testAsyncCallback", JSON.stringify(reqObj));
  1304. }
  1305. showInternAd(mark) {
  1306. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1307. if (boo1) {
  1308. console.log('zh: VIP SPID = 1,免除插页AD');
  1309. return false;
  1310. }
  1311. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1312. if (boo7) {
  1313. console.log('zh: VIP SPID = 7,免除任何AD');
  1314. return false;
  1315. }
  1316. console.log('zh:showInternAd start');
  1317. if (!Laya.Browser.onAndroid) {
  1318. console.log('zh:showInternAd 非android dev');
  1319. return false;
  1320. }
  1321. if (!this.initBridge()) {
  1322. return false;
  1323. }
  1324. let rs = this.bridge.call("showInternAd", mark);
  1325. try {
  1326. const result = JSON.parse(rs);
  1327. if (result.code === 200) {
  1328. console.log("zh:showInternAd OK");
  1329. return true;
  1330. }
  1331. else {
  1332. console.warn("zh:showInternAd FAILL:", result.msg);
  1333. return false;
  1334. }
  1335. }
  1336. catch (e) {
  1337. console.error("zh:解析桥接返回值失败:", e);
  1338. return false;
  1339. }
  1340. }
  1341. exitAndCloseGame() {
  1342. if (!Laya.Browser.onAndroid) {
  1343. return;
  1344. }
  1345. if (!this.initBridge()) {
  1346. return;
  1347. }
  1348. console.log('zh:开始关闭游戏-');
  1349. this.bridge.call("exitAndCloseGame");
  1350. }
  1351. checkAdForUserOrderForSpid17(spid) {
  1352. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1353. if (userInfo != null) {
  1354. if (!userInfo.buySpids) {
  1355. userInfo.buySpids = { 1: false, 7: false };
  1356. }
  1357. else {
  1358. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1359. }
  1360. let boo = userInfo.buySpids[spid];
  1361. if (!boo) {
  1362. console.log('zh:刷新一下用户的AD权利');
  1363. DataMgr.loadUserSpOrderForAd();
  1364. }
  1365. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1366. return boo;
  1367. }
  1368. return false;
  1369. }
  1370. showRewardAd(mark) {
  1371. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1372. if (boo7) {
  1373. console.log('zh: VIP SPID = 7,免除任何AD');
  1374. return false;
  1375. }
  1376. if (!Laya.Browser.onAndroid) {
  1377. return false;
  1378. }
  1379. if (!this.initBridge()) {
  1380. return false;
  1381. }
  1382. let rs = this.bridge.call("showRewardAd", mark);
  1383. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1384. try {
  1385. const result = JSON.parse(rs);
  1386. if (result.code === 200) {
  1387. console.log("zh:广告显示成功");
  1388. return true;
  1389. }
  1390. else {
  1391. console.warn("zh:广告显示失败:", result.msg);
  1392. return false;
  1393. }
  1394. }
  1395. catch (e) {
  1396. console.error("zh:解析桥接返回值失败:", e);
  1397. return false;
  1398. }
  1399. }
  1400. logEventForAdNoParams(eventName) {
  1401. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1402. if (!Laya.Browser.onAndroid) {
  1403. return;
  1404. }
  1405. if (!this.initBridge()) {
  1406. return;
  1407. }
  1408. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1409. this.bridge.call("logEventForAdNoParams", eventName);
  1410. }
  1411. logEventForAdHaveParams(eventName, jsonStr) {
  1412. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1413. if (!Laya.Browser.onAndroid) {
  1414. return;
  1415. }
  1416. if (!this.initBridge()) {
  1417. return;
  1418. }
  1419. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1420. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1421. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1422. }
  1423. logEventForFirebase(eventName, jsonStr) {
  1424. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1425. if (!Laya.Browser.onAndroid) {
  1426. return;
  1427. }
  1428. if (!this.initBridge()) {
  1429. return;
  1430. }
  1431. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1432. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1433. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1434. }
  1435. testNetTip() {
  1436. if (Laya.Browser.onAndroid) {
  1437. let boo = this.getNetworkAvailable();
  1438. this.showToast2("Network error, reward unavailable");
  1439. return;
  1440. }
  1441. }
  1442. getNetworkAvailable() {
  1443. if (!Laya.Browser.onAndroid) {
  1444. return;
  1445. }
  1446. if (!this.initBridge()) {
  1447. return;
  1448. }
  1449. let boo = this.bridge.call("getNetworkAvailable");
  1450. console.log("zh:getNetworkAvailable boo=" + boo);
  1451. return boo;
  1452. }
  1453. showToast2(msg) {
  1454. if (!Laya.Browser.onAndroid) {
  1455. return;
  1456. }
  1457. if (!this.initBridge()) {
  1458. return;
  1459. }
  1460. this.bridge.call("showToast2", msg);
  1461. }
  1462. showConfirmationDialogForExit(title, msg) {
  1463. if (!Laya.Browser.onAndroid) {
  1464. return;
  1465. }
  1466. if (!this.initBridge()) {
  1467. return;
  1468. }
  1469. this.bridge.call("showConfirmationDialogForExit", title, msg);
  1470. }
  1471. loginOutForApp() {
  1472. if (!Laya.Browser.onAndroid) {
  1473. return;
  1474. }
  1475. if (!this.initBridge()) {
  1476. return;
  1477. }
  1478. this.bridge.call("loginOutForApp");
  1479. }
  1480. startGgPay(token, ggSpid, spid) {
  1481. if (!Laya.Browser.onAndroid) {
  1482. return;
  1483. }
  1484. if (!this.initBridge()) {
  1485. return;
  1486. }
  1487. let jsonObj = {
  1488. token: token,
  1489. ggSpid: ggSpid,
  1490. spid: spid,
  1491. spsl: 1
  1492. };
  1493. let reqData = JSON.stringify(jsonObj);
  1494. console.log("zh:startGgPay ts reqData=" + reqData);
  1495. this.bridge.call("startGgPay", reqData);
  1496. }
  1497. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1498. if (!Laya.Browser.onAndroid) {
  1499. return;
  1500. }
  1501. if (!this.initBridge()) {
  1502. return;
  1503. }
  1504. let jsonObj = {
  1505. token: token,
  1506. ggSpid: ggSpid,
  1507. spid: spid,
  1508. spsl: 1
  1509. };
  1510. let reqData = JSON.stringify(jsonObj);
  1511. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1512. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1513. }
  1514. nativeCallJs(msg) {
  1515. console.log("zh:nativeCallJs received data: 1111", msg);
  1516. if (msg === 'Ad1') {
  1517. GlobalManager.instance.callMethod('Ad1');
  1518. console.log("zh: Ad1 奖励发送成功");
  1519. }
  1520. else if (msg === 'Ad2') {
  1521. GlobalManager.instance.callMethod('Ad2');
  1522. console.log("zh: Ad2 奖励发送成功");
  1523. }
  1524. else if (msg === 'Ad3') {
  1525. GlobalManager.instance.callMethod('Ad3');
  1526. console.log("zh: Ad3 奖励发送成功");
  1527. }
  1528. else if (msg === 'Ad4') {
  1529. GlobalManager.instance.callMethod('Ad4');
  1530. console.log("zh: Ad4 奖励发送成功");
  1531. }
  1532. else if (msg === 'Ad5') {
  1533. console.log("zh: Ad5 奖励发送成功");
  1534. GlobalManager.instance.callMethod('Ad5');
  1535. }
  1536. }
  1537. }
  1538. class UIBox extends UIBase {
  1539. constructor() {
  1540. super();
  1541. this.boxNum = 0;
  1542. this.boxMax = 10;
  1543. this.inAd = false;
  1544. this.isClose = false;
  1545. }
  1546. onConstructor() {
  1547. this.ui = ui_UIBox.createInstance();
  1548. this.contentPane = this.ui;
  1549. this.isEject = false;
  1550. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1551. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1552. Laya.timer.loop(1000, this, this.update);
  1553. }
  1554. update() {
  1555. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1556. this.boxNum -= 1;
  1557. this.upBar();
  1558. }
  1559. }
  1560. upBar() {
  1561. if (this.boxNum > this.boxMax)
  1562. this.boxNum = this.boxMax;
  1563. this.ui.bar.value = this.boxNum * 10;
  1564. }
  1565. show() {
  1566. super.show();
  1567. this.isClose = false;
  1568. this.boxNum = 0;
  1569. this.inAd = false;
  1570. this.upBar();
  1571. this.ui.t0.play();
  1572. this.ui.closeBtn.visible = false;
  1573. Laya.timer.once(3000, this, () => {
  1574. this.ui.closeBtn.visible = true;
  1575. this.ui.bar.alpha = 1;
  1576. });
  1577. Laya.timer.once(500, this, () => {
  1578. this.ui.t1.play();
  1579. });
  1580. this.setGlobalFont(this.ui);
  1581. }
  1582. hide() {
  1583. Laya.timer.clearAll(this);
  1584. Moyu.showBannerAd(false);
  1585. super.hide();
  1586. }
  1587. onOpenBox() {
  1588. this.boxNum++;
  1589. if (this.boxNum < this.boxMax) {
  1590. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1591. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1592. }
  1593. }
  1594. else if (this.boxNum == this.boxMax) {
  1595. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1596. this.ui.openBtn.c1.selectedIndex = 13;
  1597. this.inAd = true;
  1598. }
  1599. else
  1600. this.getAward();
  1601. }
  1602. else if (this.inAd) {
  1603. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1604. if (Laya.Browser.onAndroid) {
  1605. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1606. if (!boo) {
  1607. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1608. return;
  1609. }
  1610. }
  1611. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1612. }
  1613. else {
  1614. console.log('zh:AD 失败,直接发放奖励');
  1615. this.qjff_AD_for_UIBOX_onOpenBox();
  1616. }
  1617. }
  1618. this.upBar();
  1619. }
  1620. qjff_AD_for_UIBOX_onOpenBox() {
  1621. this.getAward();
  1622. }
  1623. onCloseBox() {
  1624. if (this.isClose)
  1625. this.hide();
  1626. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1627. this.isClose = true;
  1628. PlatMgr.showBanner(true, 0, 3000);
  1629. }
  1630. else
  1631. this.hide();
  1632. }
  1633. getAward() {
  1634. let str = "";
  1635. if (Math.random() < 0.5) {
  1636. let max = Moyu.isLegal ? 500 : 2500;
  1637. let num = xGame.tools.random(max, 500 + max);
  1638. DataMgr.setCoin(num);
  1639. str = "金币x" + num;
  1640. }
  1641. else {
  1642. let max = Moyu.isLegal ? 10 : 30;
  1643. let num = xGame.tools.random(max, 30 + max);
  1644. DataMgr.setDiamond(num);
  1645. str = "钻石x" + num;
  1646. }
  1647. xGame.showTip("恭喜获得-" + str);
  1648. this.hide();
  1649. }
  1650. }
  1651. UIBox.uiName = "UIBox";
  1652. class ui_UITry extends fgui.GComponent {
  1653. static createInstance() {
  1654. return (fgui.UIPackage.createObject("game", "UITry"));
  1655. }
  1656. onConstruct() {
  1657. this.n11 = (this.getChild("n11"));
  1658. this.myNode = (this.getChild("myNode"));
  1659. this.t0 = this.getTransition("t0");
  1660. }
  1661. }
  1662. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1663. class UITry extends UIBase {
  1664. constructor() {
  1665. super();
  1666. this.closeTime = 0;
  1667. this.closeNum = 0;
  1668. this.skillUrl = xGame.common.skillIconList;
  1669. }
  1670. onConstructor() {
  1671. this.ui = ui_UITry.createInstance();
  1672. this.contentPane = this.ui;
  1673. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1674. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1675. }
  1676. show() {
  1677. super.show();
  1678. this.closeNum = 0;
  1679. this.closeTime = 15;
  1680. this.ui.t0.play();
  1681. PlatMgr.showRateBanner();
  1682. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1683. Laya.timer.loop(1000, this, this.updateTime);
  1684. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1685. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1686. xGame.common.gameMgr.gamePause = true;
  1687. this.setGlobalFont(this.ui);
  1688. }
  1689. updateTime() {
  1690. if (this.closeTime > 1) {
  1691. this.closeTime--;
  1692. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1693. }
  1694. else
  1695. this.hide();
  1696. }
  1697. hide() {
  1698. Laya.timer.clearAll(this);
  1699. Moyu.showBannerAd(false);
  1700. super.hide();
  1701. xGame.common.gameMgr.gamePause = false;
  1702. }
  1703. onTry() {
  1704. console.log('zh:qjff_AD_for_uitry');
  1705. if (Laya.Browser.onAndroid) {
  1706. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1707. if (!boo) {
  1708. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1709. return;
  1710. }
  1711. }
  1712. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1713. }
  1714. else {
  1715. console.log('zh:AD 失败,直接发放奖励');
  1716. this.qjff_AD_for_uitry();
  1717. }
  1718. }
  1719. qjff_AD_for_uitry() {
  1720. let select = xGame.common.curPlayerSkillType;
  1721. DataMgr.gameData.trySkill = select;
  1722. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1723. DataMgr.saveGameData();
  1724. DataMgr.setBigSkill(select, 1);
  1725. xGame.showTip("Trial Successful");
  1726. this.hide();
  1727. }
  1728. onCancel() {
  1729. if (this.closeNum > 0) {
  1730. this.closeNum--;
  1731. if (this.closeNum < 2)
  1732. this.hide();
  1733. return;
  1734. }
  1735. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1736. this.onTry();
  1737. }
  1738. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1739. this.closeNum = 3;
  1740. }
  1741. else
  1742. this.hide();
  1743. }
  1744. }
  1745. UITry.uiName = "UITry";
  1746. class PlatMgr {
  1747. static initConfig() {
  1748. this.lastVt = 0;
  1749. if (!Moyu.platConfig)
  1750. return;
  1751. for (let k in Moyu.platConfig) {
  1752. let pd = this[k];
  1753. let pc = Moyu.platConfig[k];
  1754. if (pd != undefined && pc != undefined)
  1755. this[k] = pc;
  1756. }
  1757. Moyu.setBannerPos(0.5, 1);
  1758. }
  1759. static rand100(num) {
  1760. return xGame.tools.random(0, 100) < num;
  1761. }
  1762. static isMisVideo() {
  1763. let dt = Laya.timer.currTimer - this.lastVt;
  1764. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1765. this.lastVt = Laya.timer.currTimer;
  1766. return true;
  1767. }
  1768. else {
  1769. if (this.rand100(this.fullVideoRate)) {
  1770. console.log('zh:插屏 ad start');
  1771. JSBridgeUtils.instance.showInternAd('platMgr');
  1772. }
  1773. return false;
  1774. }
  1775. }
  1776. static showVideo(call, type) {
  1777. Moyu.showVideoAd(() => {
  1778. this.lastVt = Laya.timer.currTimer;
  1779. call && call();
  1780. }, type);
  1781. }
  1782. static showInsert(delay = false) {
  1783. if (this.getRand() < this.insertRate) {
  1784. let dt = delay ? this.insertDelay : 0;
  1785. console.log('zh:插屏 ad start');
  1786. JSBridgeUtils.instance.showInternAd('gameInsert');
  1787. }
  1788. }
  1789. static gameInsert() {
  1790. let t = this.getRand();
  1791. let r = this.gameInsertRate;
  1792. if (t < r) {
  1793. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1794. }
  1795. }
  1796. static showRateBanner() {
  1797. if (this.getRand() < this.bannerRate)
  1798. this.showBanner(true, this.bannerDelay, 3000);
  1799. }
  1800. static showBanner(show, delay = 0, hide = 0) {
  1801. if (2 > 1) {
  1802. console.log('zh:显示showBanner广告 直接返回');
  1803. return;
  1804. }
  1805. if (!show)
  1806. Moyu.showBannerAd(false);
  1807. else {
  1808. Laya.timer.clear(this, this.bannerShow);
  1809. if (delay > 0)
  1810. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1811. else
  1812. this.bannerShow(true);
  1813. if (hide > 0)
  1814. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1815. }
  1816. }
  1817. static bannerShow(show) {
  1818. if (2 > 1) {
  1819. console.log('zh:显示showBanner广告 直接返回');
  1820. return;
  1821. }
  1822. Moyu.showBannerAd(show);
  1823. console.log("showBanner" + show);
  1824. }
  1825. static getRand() {
  1826. return xGame.tools.random(0, 100);
  1827. }
  1828. static openBox() {
  1829. if (this.getRand() < this.boxRate)
  1830. xGame.uiMgr.Show(UIBox);
  1831. }
  1832. static openTry() {
  1833. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1834. return;
  1835. if (this.getRand() < this.tryRate)
  1836. xGame.uiMgr.Show(UITry);
  1837. else if (DataMgr.gameData.gameCount == 1)
  1838. xGame.uiMgr.Show(UITry);
  1839. }
  1840. }
  1841. PlatMgr.forceShare = 0;
  1842. PlatMgr.signAdRate = 0;
  1843. PlatMgr.forceVideoRate = 0;
  1844. PlatMgr.forceVideoGap = 0;
  1845. PlatMgr.fullVideoRate = 0;
  1846. PlatMgr.gameInsertRate = 0;
  1847. PlatMgr.insertGap = 0;
  1848. PlatMgr.insertDelay = 0;
  1849. PlatMgr.insertRate = 0;
  1850. PlatMgr.boxRate = 0;
  1851. PlatMgr.boxVideoRate = 0;
  1852. PlatMgr.boxInsertRate = 0;
  1853. PlatMgr.boxBannerRate = 0;
  1854. PlatMgr.tryRate = 0;
  1855. PlatMgr.tryClose3Rate = 0;
  1856. PlatMgr.tryVideoRate = 0;
  1857. PlatMgr.bannerRate = 0;
  1858. PlatMgr.lastVt = 0;
  1859. class ui_UIAddProp extends fgui.GComponent {
  1860. static createInstance() {
  1861. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1862. }
  1863. onConstruct() {
  1864. this.n11 = (this.getChild("n11"));
  1865. this.myNode = (this.getChild("myNode"));
  1866. this.closeBtn = (this.getChild("closeBtn"));
  1867. this.t0 = this.getTransition("t0");
  1868. }
  1869. }
  1870. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1871. class SpineMgr {
  1872. constructor(name, loadCb = null) {
  1873. this.loaded = false;
  1874. this.spineName = '';
  1875. this.loadedCallback = loadCb;
  1876. this.templet = new Laya.Templet();
  1877. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1878. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1879. if (name === 'mishu') {
  1880. this.templet.loadAni('spine/nvmishu.sk');
  1881. }
  1882. else {
  1883. this.templet.loadAni(`spine/${name}.sk`);
  1884. }
  1885. this.templet.lock = true;
  1886. this.spineName = name;
  1887. }
  1888. onError() {
  1889. console.log("zh:spine加载出错");
  1890. }
  1891. parseComplete() {
  1892. this.loaded = true;
  1893. this.loadedCallback && this.loadedCallback();
  1894. }
  1895. dispose() {
  1896. if (this.templet && !this.templet.destroyed) {
  1897. this.templet.destroy();
  1898. }
  1899. this.templet = null;
  1900. }
  1901. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1902. if (!this.loaded) {
  1903. return;
  1904. }
  1905. let spine;
  1906. if (mySpine) {
  1907. spine = mySpine;
  1908. }
  1909. else {
  1910. spine = this.createSpine(data, parent);
  1911. }
  1912. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1913. if (!isLoop) {
  1914. spine.on(Laya.Event.STOPPED, this, () => {
  1915. spine.offAll(Laya.Event.STOPPED);
  1916. callback && callback(spine);
  1917. });
  1918. }
  1919. return spine;
  1920. }
  1921. createSpine(data, parent, type = 1) {
  1922. let spine;
  1923. spine = this.templet.buildArmature(type);
  1924. spine.showSkinByIndex(0);
  1925. parent.addChild(spine);
  1926. spine.pos(data.x, data.y);
  1927. spine.scale(data.scaleX, data.scaleY, true);
  1928. return spine;
  1929. }
  1930. }
  1931. var AIState;
  1932. (function (AIState) {
  1933. AIState[AIState["none"] = 0] = "none";
  1934. AIState[AIState["idle"] = 1] = "idle";
  1935. AIState[AIState["reset"] = 2] = "reset";
  1936. AIState[AIState["move"] = 3] = "move";
  1937. AIState[AIState["wait"] = 4] = "wait";
  1938. AIState[AIState["select"] = 5] = "select";
  1939. AIState[AIState["turn"] = 6] = "turn";
  1940. AIState[AIState["shoot"] = 7] = "shoot";
  1941. AIState[AIState["leave"] = 8] = "leave";
  1942. })(AIState || (AIState = {}));
  1943. class AIPlayer {
  1944. constructor() {
  1945. this.dtime = 30;
  1946. this.awayTime = 0;
  1947. this.awayNum = 0;
  1948. this.hideTime = 0;
  1949. this.rootMoveTime = 0;
  1950. this.isGuide = false;
  1951. this.state = AIState.none;
  1952. this.waitTime = 0;
  1953. this.forceNum = 0;
  1954. this.forceMax = 0;
  1955. this.ballSize = 33;
  1956. this.selectNum = 0;
  1957. this.destRot = 0;
  1958. this.aiLv = 10;
  1959. this.kickBall = [];
  1960. this.lineBall = [];
  1961. this.scoreBall = [];
  1962. this.holeBall = [];
  1963. this.turnNum = 0;
  1964. this.setNum = 0;
  1965. this.setMax = 0;
  1966. this.setRate = 0;
  1967. this.rectL = 0;
  1968. this.rectR = 0;
  1969. this.rectT = 0;
  1970. this.rectB = 0;
  1971. this.rootPos = { x: 0, y: 0 };
  1972. this.bestForce = 0;
  1973. this.bestAngle = 180;
  1974. this.bestPos = { x: 0, y: 0 };
  1975. this.bestKick = { x: 0, y: 0 };
  1976. this.posList = [];
  1977. this.posIdx = 0;
  1978. this.chatTime = 3000;
  1979. this.tempDir1 = new Laya.Vector2();
  1980. this.tempDir2 = new Laya.Vector2();
  1981. this.tempDir3 = new Laya.Vector2();
  1982. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1983. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1984. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1985. this.gameSrc = xGame.common.gameUI;
  1986. this.hideTime = Laya.timer.currTimer;
  1987. Moyu.setOnTipCall((id) => {
  1988. if (id == 20012)
  1989. this.hideTime = Laya.timer.currTimer;
  1990. else
  1991. (id == 20011);
  1992. {
  1993. let dt = Laya.timer.currTimer - this.hideTime;
  1994. console.log("onshow" + dt);
  1995. if (dt > 30000 && this.state > AIState.none)
  1996. xGame.common.gameMgr.aiGameEnd(false);
  1997. }
  1998. }, this);
  1999. }
  2000. init() {
  2001. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  2002. this.awayTime = xGame.tools.random(5000, 10000);
  2003. this.awayNum = 0;
  2004. this.hideTime = Laya.timer.currTimer;
  2005. let rect = xGame.common.d2World.borderRect;
  2006. this.rectL = Math.ceil(rect.x) + 17;
  2007. this.rectT = Math.ceil(rect.y) + 17;
  2008. this.rectR = Math.floor(rect.x + rect.width) - 17;
  2009. this.rectB = Math.floor(rect.y + rect.height) - 17;
  2010. this.wBall = xGame.common.d2World.rootBall;
  2011. this.ballSize = this.wBall.gameObj.width - 1;
  2012. if (this.posList.length < 1) {
  2013. let dp = 40;
  2014. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  2015. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  2016. let dx = i < this.rectR ? i : this.rectR;
  2017. let dy = j < this.rectB ? j : this.rectB;
  2018. let order = xGame.tools.random(0, 1000);
  2019. this.posList.push({ x: dx, y: dy, order: order });
  2020. }
  2021. }
  2022. this.posList.sort(function (a, b) {
  2023. return a.order - b.order;
  2024. });
  2025. this.setMax = this.posList.length;
  2026. }
  2027. this.state = AIState.idle;
  2028. }
  2029. setAiLevel(num) {
  2030. this.aiLv = num;
  2031. }
  2032. initBall() {
  2033. this.rootPos.x = this.wBall.gameObj.x;
  2034. this.rootPos.y = this.wBall.gameObj.y;
  2035. this.initHoleBall();
  2036. }
  2037. initHoleBall() {
  2038. this.kickBall = [];
  2039. this.lineBall = [];
  2040. this.scoreBall = [];
  2041. this.holeBall = [];
  2042. this.selectNum = 0;
  2043. this.forceNum = 0;
  2044. this.forceMax = 0;
  2045. this.turnNum = 0;
  2046. let list = xGame.common.d2World.ballArr;
  2047. if (list.length < 20 && !this.isGuide) {
  2048. let holes = xGame.common.gameMgr.holePosList;
  2049. for (let i = 0; i < list.length; i++) {
  2050. let obj = list[i];
  2051. if (!obj)
  2052. continue;
  2053. obj.kickPos.x = 0;
  2054. obj.kickPos.y = 0;
  2055. obj.poleAngle = 0;
  2056. obj.hard = 0;
  2057. obj.borderDis = 0;
  2058. obj.kickAngle = 180;
  2059. if (obj.number == 0)
  2060. continue;
  2061. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  2062. continue;
  2063. if (obj.number == 8 && xGame.common.gameMode == 0) {
  2064. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2065. continue;
  2066. }
  2067. let b = obj.gameObj;
  2068. let wbp = this.rootPos;
  2069. let bx = wbp.x - b.x;
  2070. let by = wbp.y - b.y;
  2071. obj.borderDis = xGame.tools.random(0, 100);
  2072. this.kickBall.push(obj);
  2073. if (!this.isLine(wbp, obj))
  2074. continue;
  2075. obj.kickAngle = xGame.tools.random(90, 180);
  2076. obj.kickPos.x = b.x;
  2077. obj.kickPos.y = b.y;
  2078. this.lineBall.push(obj);
  2079. let minDis = 999999;
  2080. let hole = false;
  2081. for (let j = 0; j < holes.length; j++) {
  2082. let hp = holes[j];
  2083. if (bx >= 0 && hp.x > b.x + 100)
  2084. continue;
  2085. if (bx <= 0 && hp.x < b.x - 100)
  2086. continue;
  2087. if (by < -10 && hp.y < wbp.y)
  2088. continue;
  2089. if (by > 10 && hp.y > wbp.y)
  2090. continue;
  2091. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2092. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2093. if (dis < minDis) {
  2094. let dx = b.x - this.tempDir1.x * this.ballSize;
  2095. let dy = b.y - this.tempDir1.y * this.ballSize;
  2096. this.tempDir3.x = this.tempDir1.x;
  2097. this.tempDir3.y = this.tempDir1.y;
  2098. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2099. obj.kickPos.x = dx;
  2100. obj.kickPos.y = dy;
  2101. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2102. if (num > 1)
  2103. num = 1;
  2104. obj.kickAngle = Math.acos(num) * 57.3;
  2105. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2106. dis = dis * 2;
  2107. if (Math.abs(hp.x - 600) < 100)
  2108. dis += 50;
  2109. obj.hard = dis + obj.kickAngle * 3;
  2110. hole = true;
  2111. }
  2112. }
  2113. }
  2114. }
  2115. if (hole) {
  2116. this.scoreBall.push(obj);
  2117. this.holeBall.push(obj);
  2118. }
  2119. }
  2120. this.scoreBall.sort(function (a, b) {
  2121. return a.hard - b.hard;
  2122. });
  2123. this.holeBall.sort(function (a, b) {
  2124. return a.kickAngle - b.kickAngle;
  2125. });
  2126. this.kickBall.sort(function (a, b) {
  2127. return a.borderDis - b.borderDis;
  2128. });
  2129. }
  2130. else {
  2131. let max = list.length - 1;
  2132. let i = xGame.tools.random(0, max);
  2133. for (i; i <= max; i++) {
  2134. let idx = i >= max ? i -= max : i;
  2135. let obj = list[idx];
  2136. if (obj && obj.number != 0) {
  2137. obj.kickAngle = xGame.tools.random(90, 180);
  2138. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2139. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2140. this.lineBall.push(obj);
  2141. break;
  2142. }
  2143. }
  2144. }
  2145. }
  2146. selectBall() {
  2147. let ball = null;
  2148. this.destRot = 0;
  2149. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2150. let ai = 110 - this.aiLv * 10;
  2151. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2152. let score = false;
  2153. if (this.scoreBall.length < 1) {
  2154. if (this.lineBall.length < 1) {
  2155. for (let i = 0; i < this.kickBall.length; i++) {
  2156. let list = [];
  2157. let bo = this.kickBall[i];
  2158. let bobj = bo.gameObj;
  2159. let rect = xGame.common.d2World.borderRect;
  2160. let mobj = this.wBall.gameObj;
  2161. let minb = bobj.y - rect.y - 20;
  2162. let minw = mobj.y - rect.y - 50;
  2163. if (minb > 0 && minw > 0) {
  2164. let dlenx = 0;
  2165. let dleny = mobj.y - rect.y;
  2166. let spx = mobj.x;
  2167. let spy = rect.y - dleny;
  2168. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2169. }
  2170. minb = rect.y + rect.height - bobj.y - 20;
  2171. minw = rect.y + rect.height - mobj.y - 50;
  2172. if (minb > 0 && minw > 0) {
  2173. let dlenx = 0;
  2174. let dleny = rect.y + rect.height - mobj.y;
  2175. let spx = mobj.x;
  2176. let spy = rect.y + rect.height + dleny;
  2177. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2178. }
  2179. minb = bobj.x - rect.x - 20;
  2180. minw = mobj.x - rect.x - 50;
  2181. if (minb > 0 && minw > 0) {
  2182. let dlenx = mobj.x - rect.x;
  2183. let dleny = 0;
  2184. let spx = rect.x - dlenx;
  2185. let spy = mobj.y;
  2186. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2187. }
  2188. minb = rect.x + rect.width - bobj.x - 20;
  2189. minw = rect.x + rect.width - mobj.x - 50;
  2190. if (minb > 0 && minw > 0) {
  2191. let dlenx = rect.x + rect.width - mobj.x;
  2192. let dleny = 0;
  2193. let spx = rect.x + rect.width + dlenx;
  2194. let spy = mobj.y;
  2195. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2196. }
  2197. list.sort(function (a, b) {
  2198. return a.order - b.order;
  2199. });
  2200. for (let i = 0; i < list.length; i++) {
  2201. let data = list[i];
  2202. let mx = mobj.x - bobj.x;
  2203. let my = mobj.y - bobj.y;
  2204. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2205. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2206. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2207. if (num > 1)
  2208. num = 1;
  2209. let cos = Math.acos(num);
  2210. if (cos > 1.57)
  2211. cos = 1.57;
  2212. else if (cos < 0.01)
  2213. cos = 0.01;
  2214. let tan = Math.tan(cos);
  2215. let dx = tan * data.dleny;
  2216. let dy = tan * data.dlenx;
  2217. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2218. if (Math.abs(bx - 667) < 40)
  2219. continue;
  2220. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2221. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2222. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2223. this.forceMax = dis * 0.08;
  2224. this.destRot += mis * 0.1;
  2225. this.setKick(bx, by);
  2226. return true;
  2227. }
  2228. }
  2229. }
  2230. }
  2231. else {
  2232. ball = xGame.common.getRandArrEle(this.lineBall);
  2233. }
  2234. }
  2235. else {
  2236. for (let i = 0; i < this.scoreBall.length; i++) {
  2237. if (i < this.scoreBall.length - 1) {
  2238. let rand = 70 + this.aiLv * 10 + i * 10;
  2239. if (xGame.tools.random(0, 100) < rand) {
  2240. ball = this.scoreBall[i];
  2241. break;
  2242. }
  2243. }
  2244. else {
  2245. ball = this.scoreBall[i];
  2246. break;
  2247. }
  2248. }
  2249. score = true;
  2250. this.selectNum++;
  2251. }
  2252. if (!ball)
  2253. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2254. if (this.selectNum >= max) {
  2255. let dx = ball.gameObj.x;
  2256. let dy = ball.gameObj.y;
  2257. let kickAngle = 0;
  2258. if (score) {
  2259. dx = ball.kickPos.x;
  2260. dy = ball.kickPos.y;
  2261. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2262. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2263. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2264. if (adot > 1)
  2265. adot = 1;
  2266. kickAngle = Math.acos(adot) * 57.3;
  2267. if (kickAngle > 45) {
  2268. let kdx = ball.kickPos.x - ball.gameObj.x;
  2269. let kdy = ball.kickPos.y - ball.gameObj.y;
  2270. dx = ball.kickPos.x - kdx * mis * 0.3;
  2271. dy = ball.kickPos.y - kdy * mis * 0.3;
  2272. }
  2273. else
  2274. this.destRot += mis;
  2275. }
  2276. else if (ball.poleAngle != 0) {
  2277. this.destRot += ball.poleAngle;
  2278. }
  2279. if (xGame.common.gameMode == 0) {
  2280. let af = kickAngle * 0.08;
  2281. this.forceMax = ball.hard * 0.1 + af * af;
  2282. }
  2283. this.setKick(dx, dy);
  2284. }
  2285. else {
  2286. let rand = this.aiLv * 5 + 40;
  2287. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2288. ball = xGame.common.getRandArrEle(this.scoreBall);
  2289. else
  2290. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2291. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2292. if (xGame.tools.random(0, 100) > rand) {
  2293. this.selectNum = max;
  2294. }
  2295. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2296. this.selectNum++;
  2297. }
  2298. ball.onClick(0, true);
  2299. }
  2300. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2301. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2302. let balls = xGame.common.d2World.ballArr;
  2303. let max = xGame.tools.getDis(hx, hy, bx, by);
  2304. for (let index = 0; index < balls.length; index++) {
  2305. let obj = balls[index];
  2306. if (obj.number == 0)
  2307. continue;
  2308. if (obj.number == bn || obj.number == dn)
  2309. continue;
  2310. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2311. if (dis * dis > max)
  2312. continue;
  2313. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2314. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2315. if (num > 1)
  2316. num = 1;
  2317. if (num < 0)
  2318. continue;
  2319. let gap = Math.sin(Math.acos(num)) * dis;
  2320. if (gap < this.ballSize)
  2321. return true;
  2322. }
  2323. return false;
  2324. }
  2325. isLine(xy, ball) {
  2326. let bx = xy.x;
  2327. let by = xy.y;
  2328. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2329. let dis = ball.getDestDis(xy);
  2330. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2331. let sin = Math.sin(angle);
  2332. let cos = Math.cos(angle);
  2333. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2334. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2335. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2336. let dx = bx + this.tempDir2.x * dis;
  2337. let dy = by + this.tempDir2.y * dis;
  2338. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2339. sin = Math.sin(-angle);
  2340. cos = Math.cos(-angle);
  2341. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2342. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2343. dx = bx + this.tempDir2.x * dis;
  2344. dy = by + this.tempDir2.y * dis;
  2345. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2346. if (isr && isl)
  2347. return false;
  2348. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2349. }
  2350. return true;
  2351. }
  2352. turnPole() {
  2353. this.turnNum++;
  2354. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2355. let dr = rot - this.destRot;
  2356. let abs = Math.abs(dr) % 360;
  2357. if (abs > 180) {
  2358. if (rot > 180)
  2359. rot -= 360;
  2360. if (this.destRot > 180)
  2361. this.destRot -= 360;
  2362. }
  2363. let max = this.turnNum * 5 + this.aiLv * 5;
  2364. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2365. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2366. let at = xGame.tools.random(1000, 2000);
  2367. if (!this.onAway(3))
  2368. at += xGame.tools.random(10000, 15000);
  2369. this.setState(AIState.shoot, at);
  2370. }
  2371. else {
  2372. let mr = 0;
  2373. if (abs > 3)
  2374. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2375. else if (Math.random() > 0.6)
  2376. mr = xGame.tools.random(1, 10) * 0.1;
  2377. mr = dr > 0 ? -mr : mr;
  2378. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2379. }
  2380. }
  2381. setKick(dx, dy) {
  2382. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2383. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2384. this.tempDir1.x = 0;
  2385. this.tempDir1.y = 1;
  2386. this.tempDir2.y = -this.tempDir2.y;
  2387. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2388. if (num > 1)
  2389. num = 1;
  2390. let rot = Math.acos(num) * 57.3;
  2391. if (this.tempDir2.x < 0)
  2392. rot = 360 - rot;
  2393. this.destRot += rot;
  2394. if (!xGame.common.gameMgr.finishOneShoot) {
  2395. this.forceMax += xGame.tools.random(10, 50);
  2396. this.forceMax -= this.aiLv * 2;
  2397. if (this.forceMax < 20)
  2398. this.forceMax = 20;
  2399. }
  2400. if (this.forceMax > 100)
  2401. this.forceMax = 101;
  2402. else if (this.forceMax < 10)
  2403. this.forceMax += xGame.tools.random(0, 10);
  2404. if (xGame.common.gameMode == 1)
  2405. this.forceMax = xGame.tools.random(80, 100);
  2406. else
  2407. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2408. let max = 2000 - this.aiLv * 100;
  2409. if (Math.random() > 0.8)
  2410. max += xGame.tools.random(100, 2000);
  2411. this.setState(AIState.turn, xGame.tools.random(500, max));
  2412. }
  2413. shoot() {
  2414. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2415. if (Math.random() > 0.8) {
  2416. this.gameSrc.aiForce(1);
  2417. this.setState(AIState.wait);
  2418. }
  2419. }
  2420. else {
  2421. let df = xGame.tools.random(3, 8);
  2422. if (this.forceNum < this.forceMax)
  2423. this.forceNum += df;
  2424. else
  2425. this.forceNum -= df;
  2426. let startY = this.gameSrc.ui.powerNode.y;
  2427. let height = this.gameSrc.ui.powerNode.height;
  2428. let force = startY + height * this.forceNum * 0.01;
  2429. this.gameSrc.aiForce(2, force);
  2430. }
  2431. }
  2432. reset() {
  2433. for (let i = 0; i < 4; i++) {
  2434. this.setRate--;
  2435. this.setNum++;
  2436. let pos = this.posList[this.posIdx];
  2437. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2438. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2439. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2440. this.rootPos.x = 387;
  2441. if (this.rootPos.x < this.rectL)
  2442. this.rootPos.x = this.rectL;
  2443. else if (this.rootPos.x > this.rectR)
  2444. this.rootPos.x = this.rectR;
  2445. if (this.rootPos.y < this.rectT)
  2446. this.rootPos.y = this.rectT;
  2447. else if (this.rootPos.y > this.rectB)
  2448. this.rootPos.y = this.rectB;
  2449. this.posIdx++;
  2450. let max = this.posList.length;
  2451. if (this.posIdx >= max)
  2452. this.posIdx -= max;
  2453. this.initHoleBall();
  2454. let ball = null;
  2455. if (this.scoreBall.length > 0)
  2456. ball = this.scoreBall[0];
  2457. else if (this.lineBall.length > 0)
  2458. ball = xGame.common.getRandArrEle(this.lineBall);
  2459. if (ball && ball.kickAngle < this.bestAngle) {
  2460. this.bestAngle = ball.kickAngle;
  2461. this.bestKick.x = ball.kickPos.x;
  2462. this.bestKick.y = ball.kickPos.y;
  2463. this.bestPos.x = this.rootPos.x;
  2464. this.bestPos.y = this.rootPos.y;
  2465. this.bestForce = ball.hard * 0.08;
  2466. }
  2467. }
  2468. if (this.setNum >= this.setMax)
  2469. this.setMax = 0;
  2470. if (this.setRate < 1) {
  2471. this.setState(AIState.move, 0);
  2472. this.rootMoveTime = Laya.timer.currTimer;
  2473. this.gameSrc.aiRootMove(true);
  2474. }
  2475. }
  2476. delayLine() {
  2477. this.gameSrc.aiRootMove(false);
  2478. }
  2479. move() {
  2480. if (this.bestPos.x < 1)
  2481. this.bestPos = this.rootPos;
  2482. let wObj = this.wBall.gameObj;
  2483. let destx = wObj.x;
  2484. let desty = wObj.y;
  2485. let dx = Math.abs(destx - this.bestPos.x);
  2486. let dy = Math.abs(desty - this.bestPos.y);
  2487. let mx = 3 + dx * 0.03;
  2488. let my = 3 + dy * 0.03;
  2489. if (dx < 4 && dy < 4) {
  2490. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2491. dt = dt < 1000 ? 1000 - dt : 0;
  2492. if (this.setMax > 0) {
  2493. let min = this.setMax * 0.3 + this.aiLv * 5;
  2494. this.setRate = xGame.tools.random(min, this.setMax);
  2495. this.setState(AIState.reset, 0);
  2496. }
  2497. else {
  2498. this.destRot = 0;
  2499. this.forceMax = this.bestForce;
  2500. this.setKick(this.bestKick.x, this.bestKick.y);
  2501. }
  2502. if (dt > 100) {
  2503. Laya.timer.clear(this, this.delayLine);
  2504. Laya.timer.once(dt, this, this.delayLine);
  2505. }
  2506. else
  2507. this.gameSrc.aiRootMove(false);
  2508. }
  2509. else {
  2510. if (dx > 4)
  2511. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2512. if (dy > 4)
  2513. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2514. this.gameSrc.onRootMove({ x: destx, y: desty });
  2515. }
  2516. }
  2517. resetRoot() {
  2518. this.bestAngle = 180;
  2519. this.bestForce = 0;
  2520. this.setMax = this.posList.length;
  2521. this.posIdx = xGame.tools.random(0, this.setMax);
  2522. let min = this.setMax * 0.3 + this.aiLv * 5;
  2523. this.setRate = xGame.tools.random(min, this.setMax);
  2524. let max = 2000 - this.aiLv * 100;
  2525. if (Math.random() > 0.8)
  2526. max += xGame.tools.random(100, 1000);
  2527. if (this.isGuide)
  2528. this.setState(AIState.select, 500);
  2529. else if (this.onAway(2))
  2530. this.setState(AIState.reset, xGame.tools.random(400, max));
  2531. else
  2532. this.setState(AIState.none);
  2533. if (xGame.common.gameMgr.finishOneShoot)
  2534. this.chat();
  2535. }
  2536. runAI() {
  2537. if (this.state > AIState.idle)
  2538. return;
  2539. this.initBall();
  2540. this.onGame(2500);
  2541. if (Math.random() > 0.6)
  2542. this.chat();
  2543. }
  2544. stopRun() {
  2545. this.setState(AIState.idle);
  2546. }
  2547. onGame(base) {
  2548. let max = base - this.aiLv * 100;
  2549. if (Math.random() > 0.8)
  2550. max += xGame.tools.random(100, 1000);
  2551. if (this.onAway(2))
  2552. this.setState(AIState.select, xGame.tools.random(500, max));
  2553. else
  2554. this.setState(AIState.none);
  2555. }
  2556. setState(sta, wt = 0) {
  2557. if (this.state == AIState.none)
  2558. return;
  2559. this.state = sta;
  2560. this.waitTime = wt;
  2561. }
  2562. onUpdate() {
  2563. if (this.state == AIState.none)
  2564. return;
  2565. this.awayTime -= this.dtime;
  2566. if (this.awayTime < 1) {
  2567. this.awayTime = xGame.tools.random(6000, 10000);
  2568. this.awayNum += (11 - this.aiLv);
  2569. this.onAway(1);
  2570. }
  2571. if (this.waitTime >= 0) {
  2572. this.waitTime -= this.dtime;
  2573. return;
  2574. }
  2575. switch (this.state) {
  2576. case AIState.idle:
  2577. this.chat();
  2578. break;
  2579. case AIState.reset:
  2580. this.reset();
  2581. break;
  2582. case AIState.move:
  2583. this.move();
  2584. break;
  2585. case AIState.leave:
  2586. this.state = AIState.none;
  2587. xGame.common.gameMgr.aiGameEnd(true);
  2588. break;
  2589. case AIState.select:
  2590. this.selectBall();
  2591. break;
  2592. case AIState.turn:
  2593. this.turnPole();
  2594. break;
  2595. case AIState.shoot:
  2596. this.shoot();
  2597. break;
  2598. }
  2599. }
  2600. onAway(type) {
  2601. if (type == 1) {
  2602. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2603. let num = this.awayNum + db * 20;
  2604. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2605. xGame.common.gameMgr.aiLeave();
  2606. this.setState(AIState.leave, 6666);
  2607. }
  2608. }
  2609. else if (type == 2) {
  2610. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2611. let num = this.awayNum + db * 30;
  2612. if (xGame.tools.random(0, 10000) < num)
  2613. return false;
  2614. }
  2615. else if (type == 3) {
  2616. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2617. let num = this.awayNum + db * 10;
  2618. if (xGame.tools.random(0, 4000) < num)
  2619. return false;
  2620. }
  2621. return true;
  2622. }
  2623. chat() {
  2624. if (this.chatTime > 0) {
  2625. this.chatTime -= this.dtime;
  2626. return;
  2627. }
  2628. this.chatTime = xGame.tools.random(2000, 10000);
  2629. let rand = xGame.tools.random(0, 100);
  2630. if (rand < 15)
  2631. this.talk();
  2632. else if (rand < 35)
  2633. this.emotion();
  2634. }
  2635. talk() {
  2636. xGame.common.talkMgr.showAITalk(0);
  2637. }
  2638. emotion() {
  2639. xGame.common.talkMgr.showAIEmotion(0);
  2640. }
  2641. resetAI() {
  2642. this.stopRun();
  2643. this.state = AIState.none;
  2644. }
  2645. }
  2646. class Partical extends Laya.Script3D {
  2647. constructor() {
  2648. super();
  2649. this.duration = 2000;
  2650. }
  2651. ;
  2652. onAwake() {
  2653. this.gameObj = this.owner;
  2654. }
  2655. onEnable() {
  2656. this.openTimer();
  2657. }
  2658. openTimer() {
  2659. Laya.timer.once(this.duration, this, this.disappear);
  2660. }
  2661. setCallback(obj, callback) {
  2662. this.obj = obj;
  2663. this.callback = callback;
  2664. Laya.timer.clearAll(this);
  2665. Laya.timer.once(this.duration, this, this.disappear);
  2666. }
  2667. disappear() {
  2668. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2669. this.callback && this.callback(this.obj);
  2670. }
  2671. }
  2672. class Ball extends Laya.Script3D {
  2673. constructor() {
  2674. super();
  2675. this.posV3 = new Laya.Vector3();
  2676. this.rotRate = 2.1;
  2677. this.rotSpeed = new Laya.Vector3();
  2678. this.myIndex = 0;
  2679. }
  2680. onAwake() {
  2681. this.gameObj = this.owner;
  2682. this.transform = this.gameObj.transform;
  2683. this.ballNode = this.gameObj.getChildByName("Ball");
  2684. this.shadowNode = this.gameObj.getChildByName("shadow");
  2685. }
  2686. initSelf(index, x, y, owner) {
  2687. this.d2BallSrc = owner;
  2688. this.myIndex = index;
  2689. this.setAlbedoTexture();
  2690. this.setTransPos(x, y);
  2691. this.setScale();
  2692. this.ballNode.transform.localRotationEulerX = 90;
  2693. if (index == 0) {
  2694. }
  2695. }
  2696. setAlbedoTexture(isIce = false) {
  2697. let url;
  2698. if (isIce) {
  2699. url = `res/d3Res/ballTexture/ice.jpg`;
  2700. }
  2701. else {
  2702. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2703. }
  2704. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2705. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2706. }));
  2707. }
  2708. runFireworks(obj, delay, callback) {
  2709. Laya.timer.clearAll(this);
  2710. Laya.timer.once(delay + 1, this, () => {
  2711. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2712. fire.transform.localPositionX = this.transform.localPositionX;
  2713. fire.transform.localPositionY = this.transform.localPositionY;
  2714. fire.transform.localPositionZ = this.transform.localPositionZ;
  2715. let src = fire.getComponent(Partical);
  2716. src.duration = 1000;
  2717. src.setCallback(obj, callback);
  2718. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2719. eft.transform.localPositionX = this.transform.localPositionX;
  2720. eft.transform.localPositionY = this.transform.localPositionY;
  2721. eft.transform.localPositionZ = this.transform.localPositionZ;
  2722. });
  2723. }
  2724. setTransPos(x, y) {
  2725. this.setRotation();
  2726. xGame.common.pos2to3Convert(x, y, this.posV3);
  2727. this.transform.localPositionX = this.posV3.x;
  2728. this.transform.localPositionY = 0;
  2729. this.transform.localPositionZ = this.posV3.z;
  2730. this.transform.localRotationEulerX = 0;
  2731. this.transform.localRotationEulerY = 0;
  2732. this.transform.localRotationEulerZ = 0;
  2733. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2734. this.shadowNode.transform.localPositionY = 0.1;
  2735. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2736. }
  2737. setRotation() {
  2738. if (this.d2BallSrc.canRot) {
  2739. let speed = this.d2BallSrc.rigy.linearVelocity;
  2740. this.rotSpeed.x = speed.x * this.rotRate;
  2741. this.rotSpeed.z = speed.y * this.rotRate;
  2742. this.rotSpeed.y = this.d2BallSrc.rotY;
  2743. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2744. }
  2745. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2746. this.rotSpeed.x = this.rotSpeed.y = 0;
  2747. this.rotSpeed.y = this.d2BallSrc.rotY;
  2748. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2749. }
  2750. }
  2751. setScale() {
  2752. let radius = xGame.common.d2World.rootBall.ui.width;
  2753. let scale = xGame.common.scale2to3Convert(radius);
  2754. this.transform.localScaleX = scale;
  2755. this.transform.localScaleY = scale;
  2756. this.transform.localScaleZ = scale;
  2757. }
  2758. playInHoleEft() {
  2759. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2760. eft.transform.position = this.transform.position;
  2761. }
  2762. playIceEft() {
  2763. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2764. eft.transform.position = this.transform.position;
  2765. }
  2766. get scaleXYZ() {
  2767. return this.transform.localScaleX;
  2768. }
  2769. set scaleXYZ(val) {
  2770. this.transform.localScaleX = val;
  2771. this.transform.localScaleY = val;
  2772. this.transform.localScaleZ = val;
  2773. }
  2774. get posX() {
  2775. return this.transform.localPositionX;
  2776. }
  2777. set posX(val) {
  2778. this.transform.localPositionX = val;
  2779. }
  2780. get posY() {
  2781. return this.transform.localPositionY;
  2782. }
  2783. set posY(val) {
  2784. this.transform.localPositionY = val;
  2785. }
  2786. get posZ() {
  2787. return this.transform.localPositionZ;
  2788. }
  2789. set posZ(val) {
  2790. this.transform.localPositionZ = val;
  2791. }
  2792. destroySelf() {
  2793. this.posV3 = null;
  2794. this.rotSpeed = null;
  2795. this.d2BallSrc = null;
  2796. this.ballNode = null;
  2797. this.gameObj.destroy(true);
  2798. this.transform = null;
  2799. this.destroy();
  2800. }
  2801. }
  2802. class ui_D2Ball extends fgui.GComponent {
  2803. static createInstance() {
  2804. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2805. }
  2806. onConstruct() {
  2807. this.myIcon = (this.getChild("myIcon"));
  2808. this.inner = (this.getChild("inner"));
  2809. this.n8 = (this.getChild("n8"));
  2810. this.n4 = (this.getChild("n4"));
  2811. this.wrongTips = (this.getChild("wrongTips"));
  2812. this.rightTips = (this.getChild("rightTips"));
  2813. this.breathAni = this.getTransition("breathAni");
  2814. }
  2815. }
  2816. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2817. class D2BallSrc extends Laya.Script {
  2818. constructor() {
  2819. super();
  2820. this.number = 0;
  2821. this.startX = 0;
  2822. this.startY = 0;
  2823. this.angleV2 = new Laya.Vector2();
  2824. this.isRootBall = false;
  2825. this.isBlackBall = false;
  2826. this.ballType = "";
  2827. this.canRot = true;
  2828. this.rotY = 0;
  2829. this.poleAngle = 0;
  2830. this.kickPos = { x: 0, y: 0 };
  2831. this.hard = 0;
  2832. this.kickAngle = 0;
  2833. this.borderDis = 0;
  2834. this.speedP10 = 5.6;
  2835. this.lastSpeed = { x: 0, y: 0 };
  2836. this.stillSpeed = 0.12;
  2837. this.ballFunc = "normal";
  2838. this.isRunSkillAni = false;
  2839. this.isInHole = false;
  2840. this.iceOwner = "";
  2841. this.forceRun = false;
  2842. this.myUNID = "";
  2843. this.rectL = 0;
  2844. this.rectR = 0;
  2845. this.rectT = 0;
  2846. this.rectB = 0;
  2847. this.forceVec = new Laya.Vector2();
  2848. this.lastDis = 0;
  2849. this.helpOut = { type: "", x: 0, y: 0 };
  2850. }
  2851. initSelf(number, x, y, d3Ball) {
  2852. if (!this.gameObj)
  2853. this.gameObj = this.owner;
  2854. this.number = number;
  2855. this.startX = x;
  2856. this.startY = y;
  2857. this.d3Ball = d3Ball;
  2858. this.isRootBall = false;
  2859. this.isBlackBall = false;
  2860. this.ballType = "";
  2861. if (number == 0) {
  2862. this.isRootBall = true;
  2863. }
  2864. else if (number == 8) {
  2865. this.isBlackBall = true;
  2866. }
  2867. else {
  2868. if (number <= 7) {
  2869. this.ballType = ballCamp.full;
  2870. }
  2871. else {
  2872. this.ballType = ballCamp.flower;
  2873. }
  2874. }
  2875. this.setInfo();
  2876. this.setD3Ball();
  2877. this.owner["mySrc"] = this;
  2878. this.rigy.linearDamping = 1;
  2879. D2BallSrc._unid++;
  2880. this.myUNID = "d2ball" + D2BallSrc._unid;
  2881. let rect = xGame.common.d2World.borderRect;
  2882. this.rectL = Math.ceil(rect.x) + 20;
  2883. this.rectT = Math.ceil(rect.y) + 20;
  2884. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2885. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2886. }
  2887. setInfo() {
  2888. this.gameObj.x = this.startX;
  2889. this.gameObj.y = this.startY;
  2890. let radius = this.ui.width / 2;
  2891. this.gameObj.width = radius * 2;
  2892. this.gameObj.height = radius * 2;
  2893. if (xGame.common.showDebug) {
  2894. this.ui.myIcon.alpha = 1;
  2895. this.ui.inner.alpha = 1;
  2896. }
  2897. else {
  2898. this.ui.myIcon.alpha = 0;
  2899. this.ui.inner.alpha = 0;
  2900. }
  2901. }
  2902. setD3Ball() {
  2903. this.d3Ball = this.d3Ball;
  2904. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2905. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2906. }
  2907. onUpdate() {
  2908. if (xGame.common.gameMgr.gamePause)
  2909. return;
  2910. if (this.isInHole)
  2911. return;
  2912. if (!xGame.common.d2World.openCheckStill)
  2913. return;
  2914. this.runBall();
  2915. }
  2916. runBall() {
  2917. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2918. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2919. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2920. this.judgeBorder();
  2921. }
  2922. getDestDis(dest) {
  2923. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2924. }
  2925. setmyXY(x, y) {
  2926. this.d3BallSrc.setTransPos(x, y);
  2927. }
  2928. getSpeed() {
  2929. let speed = this.rigy.linearVelocity;
  2930. return speed.x * speed.x + speed.y * speed.y;
  2931. }
  2932. onTriggerEnter(collider) {
  2933. if (!collider || !collider.owner)
  2934. return;
  2935. let coll = "collide";
  2936. let speed = this.getSpeed();
  2937. let sv2 = this.speedP10 * this.speedP10;
  2938. if (collider.label == "ball") {
  2939. if (speed < 9 && this.number != 0)
  2940. coll = "";
  2941. else if (speed < sv2)
  2942. coll = "collide_4";
  2943. else if (speed < sv2 * 6.2)
  2944. coll = "collide_3";
  2945. else if (speed < sv2 * 25)
  2946. coll = "collide_2";
  2947. else if (speed < sv2 * 56)
  2948. coll = "collide_1";
  2949. xGame.soundMgr.playSound(coll);
  2950. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2951. if (collider.owner) {
  2952. let rig = collider.owner.getComponent(D2BallSrc);
  2953. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2954. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2955. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2956. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2957. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2958. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2959. let rx = 0;
  2960. let ry = 0;
  2961. if (this.gameObj.x < this.rectL)
  2962. rx = vx;
  2963. else if (this.gameObj.x > this.rectR)
  2964. rx = -vx;
  2965. else if (this.gameObj.y < this.rectT)
  2966. ry = vy;
  2967. else if (this.gameObj.y > this.rectB)
  2968. ry = -vy;
  2969. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2970. }
  2971. }
  2972. if (this.number != 0) {
  2973. return;
  2974. }
  2975. else {
  2976. if (this.forceRun) {
  2977. console.log("randon force");
  2978. this.applyForce(collider);
  2979. }
  2980. }
  2981. if (xGame.common.d2World.isOnSameLine) {
  2982. xGame.common.d2World.isOnSameLine = false;
  2983. this.rigy.linearVelocity = { x: 0, y: 0 };
  2984. }
  2985. if (xGame.common.gameMgr.firstColliObj == null) {
  2986. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2987. xGame.common.gameMgr.isTouchedBall = true;
  2988. }
  2989. }
  2990. else {
  2991. xGame.common.recoverCameraView();
  2992. let wallStr = "";
  2993. if (speed < 9) { }
  2994. else if (speed < sv2) { }
  2995. else if (speed < sv2 * 6.2)
  2996. wallStr = "wall_30";
  2997. else if (speed < sv2 * 25)
  2998. wallStr = "wall_50";
  2999. else if (speed < sv2 * 56)
  3000. wallStr = "wall_80";
  3001. xGame.soundMgr.playSound(wallStr);
  3002. }
  3003. }
  3004. applyForce(collider) {
  3005. let src = collider.owner.mySrc;
  3006. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  3007. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  3008. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  3009. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  3010. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  3011. }
  3012. checkWrongBall(playEft = true) {
  3013. if (this.isInHole)
  3014. return;
  3015. xGame.common.gameMgr.inHoleBalls.push(this.number);
  3016. if (this.number != 0 && playEft)
  3017. this.d3BallSrc.playInHoleEft();
  3018. let coll = "inpocket_1";
  3019. let speed = this.getSpeed();
  3020. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  3021. if (speed < 9 && this.number != 0)
  3022. coll = "";
  3023. else if (speed < sv2 * 6.2)
  3024. coll = "inpocket_4";
  3025. else if (speed < sv2 * 25)
  3026. coll = "collide_3";
  3027. else if (speed < sv2 * 56)
  3028. coll = "collide_2";
  3029. xGame.soundMgr.playSound(coll);
  3030. this.isInHole = true;
  3031. if (this.number == 0) {
  3032. console.log("白球进了。。");
  3033. this.reset();
  3034. this.rigy.linearVelocity = { x: 0, y: 0 };
  3035. this.hideSelf();
  3036. xGame.common.gameUI.ui.whiteAni.visible = true;
  3037. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  3038. xGame.common.gameUI.ui.whiteAni.visible = false;
  3039. }));
  3040. }
  3041. else {
  3042. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  3043. xGame.common.d2World.removeOneBall(this);
  3044. this.destroySelf();
  3045. xGame.common.playHappySound(this.number);
  3046. this.runFlyEft();
  3047. }
  3048. }
  3049. runFlyEft() {
  3050. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  3051. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  3052. }
  3053. }
  3054. hideSelf() {
  3055. if (this.d3Ball)
  3056. this.d3Ball.active = false;
  3057. }
  3058. showSelf() {
  3059. this.isInHole = false;
  3060. if (this.d3Ball && !this.d3Ball.active)
  3061. this.d3Ball.active = true;
  3062. }
  3063. isStill() {
  3064. let speed = this.rigy.linearVelocity;
  3065. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3066. this.rigy.linearVelocity = { x: 0, y: 0 };
  3067. return true;
  3068. }
  3069. return false;
  3070. }
  3071. reset() {
  3072. }
  3073. destroySelf() {
  3074. this.d3BallSrc.destroySelf();
  3075. if (!this.ui.isDisposed) {
  3076. this.ui.removeFromParent();
  3077. this.ui.dispose();
  3078. this.ui = null;
  3079. }
  3080. this.outColli = null;
  3081. this.innerColli = null;
  3082. this.rigy = null;
  3083. this.d3Ball = null;
  3084. this.d3BallSrc = null;
  3085. this.angleV2 = null;
  3086. this.gameObj.destroy(true);
  3087. this.destroy();
  3088. }
  3089. judgeBorder() {
  3090. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3091. return;
  3092. }
  3093. if (this.destroyed)
  3094. return;
  3095. if (xGame.common.gameMode == GameMode.classic)
  3096. return;
  3097. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3098. if (isOver) {
  3099. this.checkWrongBall();
  3100. }
  3101. }
  3102. onClick(e, force = false) {
  3103. if (this.number == 0)
  3104. return;
  3105. if (force) {
  3106. }
  3107. else {
  3108. if (xGame.common.d2World.openCheckStill)
  3109. return;
  3110. if (!xGame.common.gameMgr.selfTurn) {
  3111. return;
  3112. }
  3113. }
  3114. if (!xGame.common.gameMgr.finishOneShoot)
  3115. return;
  3116. let root = xGame.common.d2World.rootBall.gameObj;
  3117. let x = this.gameObj.x - root.x;
  3118. let y = this.gameObj.y - root.y;
  3119. let angle = xGame.common.getfguiRotation(x, y);
  3120. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3121. xGame.common.d2World.getHelpLine();
  3122. xGame.common.clickedBall = true;
  3123. this.checkGuide();
  3124. }
  3125. checkGuide() {
  3126. let guide = DataMgr.getSkillGuide();
  3127. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3128. xGame.common.guideStep++;
  3129. xGame.common.gameUI.ui.guide1.visible = false;
  3130. xGame.common.gameUI.ui.guide2.visible = true;
  3131. }
  3132. }
  3133. checkDistance(disX, disY, angle) {
  3134. let diameter = this.gameObj.width - 1;
  3135. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3136. if (!this.lastDis)
  3137. this.lastDis = dis;
  3138. else {
  3139. if (dis > this.lastDis) {
  3140. this.helpOut.type = "remove";
  3141. return this.helpOut;
  3142. }
  3143. }
  3144. if (dis <= Math.pow(diameter, 2)) {
  3145. let del = 0.01;
  3146. let offest = 0;
  3147. let realX = disX - this.gameObj.x;
  3148. let realY = disY - this.gameObj.y;
  3149. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3150. offest += del;
  3151. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3152. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3153. }
  3154. this.helpOut.type = "ok";
  3155. this.helpOut.x = realX + this.gameObj.x;
  3156. this.helpOut.y = realY + this.gameObj.y;
  3157. return this.helpOut;
  3158. }
  3159. else {
  3160. this.helpOut.type = "no";
  3161. return this.helpOut;
  3162. }
  3163. }
  3164. clearBallEft() {
  3165. this.clearBallRightEft();
  3166. this.clearBallWrongEft();
  3167. }
  3168. clearBallRightEft() {
  3169. this.ui.breathAni.stop();
  3170. this.ui.rightTips.visible = false;
  3171. }
  3172. clearBallWrongEft() {
  3173. this.ui.wrongTips.visible = false;
  3174. }
  3175. showWrongEft() {
  3176. if (!xGame.common.gameMgr.selfTurn)
  3177. return;
  3178. this.ui.wrongTips.visible = true;
  3179. }
  3180. showRightEft() {
  3181. if (!xGame.common.gameMgr.selfTurn)
  3182. return;
  3183. this.ui.rightTips.visible = true;
  3184. this.ui.rightTips.scaleX = 1;
  3185. this.ui.rightTips.scaleY = 1;
  3186. this.ui.breathAni.play();
  3187. }
  3188. setBallFunc(type, owner) {
  3189. if (type == "ice") {
  3190. this.ballFunc = type;
  3191. this.d3BallSrc.setAlbedoTexture(true);
  3192. this.rigy.type = "static";
  3193. this.iceOwner = owner;
  3194. }
  3195. else {
  3196. if (owner == this.iceOwner) {
  3197. this.ballFunc = type;
  3198. this.d3BallSrc.setAlbedoTexture(false);
  3199. this.rigy.type = "dynamic";
  3200. }
  3201. }
  3202. }
  3203. }
  3204. D2BallSrc._unid = 0;
  3205. class D2RootBallSrc extends D2BallSrc {
  3206. constructor() {
  3207. super();
  3208. this.maxSpeed = 0;
  3209. this.classicMaxSpeed = 2.2;
  3210. this.bigSkillMaxSpeed = 4;
  3211. this.angle = 0;
  3212. this.allPercent = 0;
  3213. this.linearPercent = 0;
  3214. this.anglePercent = 0;
  3215. this.maxAngleRate = 0.6;
  3216. this.baseRot = 7;
  3217. this.angleMax = 0;
  3218. this.speed = new Laya.Vector2();
  3219. this.rotSpeed = new Laya.Vector2();
  3220. }
  3221. isStill() {
  3222. let speed = this.rigy.linearVelocity;
  3223. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3224. if (this.anglePercent <= 0.1) {
  3225. this.rigy.linearVelocity = { x: 0, y: 0 };
  3226. return true;
  3227. }
  3228. }
  3229. return false;
  3230. }
  3231. reset() {
  3232. this.linearPercent = 0;
  3233. this.anglePercent = 0;
  3234. }
  3235. setSpeed(percent, angle) {
  3236. this.allPercent = percent;
  3237. this.angle = angle;
  3238. this.setAngleSpeed();
  3239. this.setLinearSpeed();
  3240. let hit = "hit";
  3241. if (percent < 25)
  3242. hit = "hit03";
  3243. else if (percent < 50)
  3244. hit = "hit02";
  3245. else if (percent < 75)
  3246. hit = "hit01";
  3247. xGame.soundMgr.playSound(hit);
  3248. }
  3249. setAngleSpeed() {
  3250. let offest = xGame.common.rodOffest;
  3251. let radius = 82;
  3252. let rate = Math.abs(offest.y / radius) * 0.5;
  3253. if (offest.y > 0)
  3254. this.angleMax = -this.baseRot * 2;
  3255. else
  3256. this.angleMax = this.baseRot;
  3257. this.rotY = -offest.x / radius * 100;
  3258. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3259. this.linearPercent = this.allPercent - this.anglePercent;
  3260. }
  3261. setLinearSpeed() {
  3262. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3263. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3264. if (!xGame.common.longHelpLine) {
  3265. let offset = -150 + xGame.common.randomNum(0, 300);
  3266. offset /= 100;
  3267. this.angle += offset;
  3268. }
  3269. }
  3270. }
  3271. let sin = Math.sin(this.angle * Math.PI / 180);
  3272. let cos = Math.cos(this.angle * Math.PI / 180);
  3273. switch (xGame.common.gameMode) {
  3274. case GameMode.classic:
  3275. this.maxSpeed = this.classicMaxSpeed;
  3276. break;
  3277. case GameMode.bigMove:
  3278. this.maxSpeed = this.bigSkillMaxSpeed;
  3279. break;
  3280. case GameMode.placeBall:
  3281. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3282. if (data.type == 1) {
  3283. this.maxSpeed = this.bigSkillMaxSpeed;
  3284. }
  3285. else {
  3286. this.maxSpeed = this.classicMaxSpeed;
  3287. }
  3288. break;
  3289. default:
  3290. break;
  3291. }
  3292. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3293. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3294. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3295. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3296. this.rigy.applyLinearImpulseToCenter(this.speed);
  3297. }
  3298. onUpdate() {
  3299. if (this.anglePercent > 0.1) {
  3300. this.anglePercent *= 0.97;
  3301. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3302. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3303. this.rigy.applyForceToCenter(this.rotSpeed);
  3304. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3305. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3306. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3307. if (num > 0.9)
  3308. this.canRot = true;
  3309. }
  3310. else
  3311. this.canRot = true;
  3312. if (Math.abs(this.rotY) > 0.1)
  3313. this.rotY *= 0.98;
  3314. super.onUpdate();
  3315. }
  3316. destroySelf() {
  3317. super.destroySelf();
  3318. this.speed = null;
  3319. }
  3320. }
  3321. class D2Ball extends Laya.Sprite {
  3322. constructor(isRootBall = false) {
  3323. super();
  3324. this.ui = ui_D2Ball.createInstance();
  3325. this.pivotX = this.ui.width / 2;
  3326. this.pivotY = this.ui.width / 2;
  3327. this.x = 0;
  3328. this.y = 0;
  3329. this.addChild(this.ui.displayObject);
  3330. this.ui.displayObject.x += this.ui.width / 2;
  3331. this.ui.displayObject.y += this.ui.width / 2;
  3332. if (isRootBall) {
  3333. this.d2Src = this.addComponent(D2RootBallSrc);
  3334. }
  3335. else {
  3336. this.d2Src = this.addComponent(D2BallSrc);
  3337. }
  3338. this.d2Src.ui = this.ui;
  3339. this.addCircleCollider();
  3340. this.addInnerCircleCollider();
  3341. this.addRigyBody();
  3342. }
  3343. addCircleCollider() {
  3344. let colli = xGame.common.getCollider("circle");
  3345. colli.radius = this.ui.width / 2;
  3346. this.addComponentIntance(colli);
  3347. this.d2Src.outColli = colli;
  3348. colli.label = "ball";
  3349. }
  3350. addInnerCircleCollider() {
  3351. let colli = xGame.common.getCollider("circle");
  3352. colli.radius = this.ui.inner.width / 2;
  3353. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3354. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3355. this.addComponentIntance(colli);
  3356. this.d2Src.innerColli = colli;
  3357. colli.label = "inner";
  3358. }
  3359. addRigyBody() {
  3360. let rigy = xGame.common.getRigbody();
  3361. rigy.type = "dynamic";
  3362. this.addComponentIntance(rigy);
  3363. this.d2Src.rigy = rigy;
  3364. }
  3365. disposeSelf() {
  3366. if (!this.ui.isDisposed) {
  3367. this.ui.dispose();
  3368. this.ui.removeFromParent();
  3369. this.ui = null;
  3370. }
  3371. }
  3372. }
  3373. class ui_D2Gan extends fgui.GComponent {
  3374. static createInstance() {
  3375. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3376. }
  3377. onConstruct() {
  3378. this.myIcon = (this.getChild("myIcon"));
  3379. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3380. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3381. this.self = (this.getChild("self"));
  3382. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3383. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3384. this.ai = (this.getChild("ai"));
  3385. }
  3386. }
  3387. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3388. class D2Gan {
  3389. constructor() {
  3390. this.offset = 0.15;
  3391. this.cell = 1.5;
  3392. this.onBallCell = 0.4;
  3393. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3394. this.moveNum = 70;
  3395. this.rulerRate = 0.1;
  3396. this.ui = ui_D2Gan.createInstance();
  3397. this.changeSelfRod();
  3398. this.changeAIRod();
  3399. }
  3400. changeSelfRod() {
  3401. let index = DataMgr.getCurBallRod();
  3402. let data = cfgTable.ballrodData[index + 1];
  3403. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3404. this.selfMySpine && this.selfMySpine.dispose();
  3405. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3406. if (data.spine) {
  3407. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3408. this.selfMySpine = new SpineMgr(data.spine, () => {
  3409. let xx = this.ui.selfEftRoot.width / 2;
  3410. let yy = this.ui.selfEftRoot.height / 2;
  3411. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3412. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3413. outSpine.rotation = -90;
  3414. });
  3415. }
  3416. }
  3417. changeAIRod() {
  3418. let length = Object.keys(cfgTable.ballrodData).length;
  3419. let rand = Math.floor(length * Math.random()) + 1;
  3420. let data = cfgTable.ballrodData[rand];
  3421. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3422. this.aiMySpine && this.aiMySpine.dispose();
  3423. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3424. if (data.spine) {
  3425. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3426. this.aiMySpine = new SpineMgr(data.spine, () => {
  3427. let xx = this.ui.aiEftRoot.width / 2;
  3428. let yy = this.ui.aiEftRoot.height / 2;
  3429. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3430. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3431. outSpine.rotation = -90;
  3432. });
  3433. }
  3434. }
  3435. setGanLastInfo() {
  3436. this.lastInfo.rotation = this.ui.rotation;
  3437. this.lastInfo.x = this.ui.x;
  3438. this.lastInfo.y = this.ui.y;
  3439. }
  3440. rotateSelf(flag, isRuler = false) {
  3441. let angle;
  3442. flag = flag * this.offset;
  3443. if (xGame.common.d2World.isHelpLineOnBall) {
  3444. angle = flag * this.onBallCell;
  3445. }
  3446. else {
  3447. angle = flag * this.cell;
  3448. }
  3449. if (isRuler) {
  3450. angle *= this.rulerRate;
  3451. }
  3452. this.ui.rotation += angle;
  3453. xGame.common.d2World.getHelpLine();
  3454. }
  3455. checkDistance() {
  3456. let target = xGame.common.d2World.targetBall;
  3457. let root = xGame.common.d2World.rootBall;
  3458. if (target == null) {
  3459. return 1;
  3460. }
  3461. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3462. if (dis <= 2500) {
  3463. return 5;
  3464. }
  3465. return 1;
  3466. }
  3467. rotDest(rot) {
  3468. this.ui.rotation = rot;
  3469. xGame.common.d2World.getHelpLine();
  3470. }
  3471. storagePower(powerNum) {
  3472. let pos = (powerNum / 100) * this.moveNum;
  3473. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3474. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3475. this.ui.x = this.lastInfo.x + xx;
  3476. this.ui.y = this.lastInfo.y + yy;
  3477. }
  3478. shoot() {
  3479. this.storagePower(0);
  3480. this.ui.visible = false;
  3481. }
  3482. destroySelf() {
  3483. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3484. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3485. this.selfMySpine && this.selfMySpine.dispose();
  3486. this.aiMySpine && this.aiMySpine.dispose();
  3487. this.lastInfo = null;
  3488. if (!this.ui.isDisposed) {
  3489. this.ui.removeFromParent();
  3490. this.ui.dispose();
  3491. }
  3492. }
  3493. }
  3494. class ui_HelpLine extends fgui.GComponent {
  3495. static createInstance() {
  3496. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3497. }
  3498. onConstruct() {
  3499. this.n10 = (this.getChild("n10"));
  3500. this.rect = (this.getChild("rect"));
  3501. this.dir11 = (this.getChild("dir11"));
  3502. this.dir = (this.getChild("dir"));
  3503. this.rootDir = (this.getChild("rootDir"));
  3504. this.dirDot = (this.getChild("dirDot"));
  3505. }
  3506. }
  3507. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3508. class D2HelpLine {
  3509. constructor() {
  3510. this.starX = 0;
  3511. this.starY = 0;
  3512. this.ui = ui_HelpLine.createInstance();
  3513. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3514. this.starX = this.ui.rect.x;
  3515. this.starY = this.ui.rect.y;
  3516. }
  3517. shoot() {
  3518. this.ui.visible = false;
  3519. }
  3520. destroySelf() {
  3521. if (this.ui.isDisposed) {
  3522. this.ui.removeFromParent();
  3523. this.ui.dispose();
  3524. }
  3525. }
  3526. }
  3527. class D2World extends Laya.Script {
  3528. constructor() {
  3529. super();
  3530. this.ballArr = [];
  3531. this.openCheckStill = false;
  3532. this.checkArr = [];
  3533. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3534. this.isHelpLineOnBall = false;
  3535. this.isOnSameLine = false;
  3536. this.reflectAngle = 0;
  3537. this.powerPercent = 0;
  3538. this.inHolesSpeed = [];
  3539. this.outDir = new Laya.Vector2();
  3540. this.rootDir = new Laya.Vector2();
  3541. this.aiLv = 0;
  3542. this.rootPos = new Laya.Vector2();
  3543. this.tempDir1 = new Laya.Vector2();
  3544. this.tempDir2 = new Laya.Vector2();
  3545. this.tempDir3 = new Laya.Vector2();
  3546. this.ballSize = 33;
  3547. this.destRot = 0;
  3548. }
  3549. initSelf() {
  3550. this.createBalls();
  3551. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3552. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3553. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3554. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3555. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3556. }
  3557. setBorderRect() {
  3558. let ui = xGame.common.gameUI.ui;
  3559. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3560. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3561. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3562. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3563. this.borderRect.x = starX;
  3564. this.borderRect.y = starY;
  3565. this.borderRect.width = width;
  3566. this.borderRect.height = height;
  3567. }
  3568. resetGame() {
  3569. this.openCheckStill = false;
  3570. let temp;
  3571. for (let index = 0; index < this.ballArr.length; index++) {
  3572. temp = this.ballArr[index];
  3573. temp.destroySelf();
  3574. }
  3575. xGame.common.d3World.ballRoot.destroyChildren();
  3576. xGame.common.gameUI.ui.ballNode.removeChildren();
  3577. console.log("进入摧毁逻辑");
  3578. this.d2Gan.destroySelf();
  3579. this.d2HelpLine.destroySelf();
  3580. this.ballArr = [];
  3581. }
  3582. setD2Gan() {
  3583. let ballNode = this.rootBall.ui;
  3584. let d2Gan = new D2Gan();
  3585. this.d2Gan = d2Gan;
  3586. let ganNode = d2Gan.ui;
  3587. ballNode.addChild(ganNode);
  3588. ganNode.pivotX = ganNode.pivotX;
  3589. ganNode.pivotY = ganNode.pivotY;
  3590. ganNode.x = ganNode.myIcon.width / 2;
  3591. ganNode.y = this.rootBall.gameObj.width;
  3592. d2Gan.setGanLastInfo();
  3593. }
  3594. setHelpLine() {
  3595. let d2Help = new D2HelpLine();
  3596. this.d2HelpLine = d2Help;
  3597. }
  3598. createBalls() {
  3599. let cfg;
  3600. switch (xGame.common.gameMode) {
  3601. case GameMode.classic:
  3602. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3603. break;
  3604. case GameMode.bigMove:
  3605. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3606. break;
  3607. case GameMode.placeBall:
  3608. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3609. break;
  3610. default:
  3611. break;
  3612. }
  3613. cfg = JSON.parse(JSON.stringify(cfg));
  3614. for (const key in cfg) {
  3615. if (cfg[key].value == 0) {
  3616. this.createRootBall(cfg[key]);
  3617. delete cfg[key];
  3618. break;
  3619. }
  3620. }
  3621. this.createOtherBalls(cfg);
  3622. }
  3623. createRootBall(data) {
  3624. let root = new D2Ball(true);
  3625. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3626. this.rootBall = root.d2Src;
  3627. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3628. let d3BallSrc = d3Ball.getComponent(Ball);
  3629. xGame.common.d3World.rootBall = d3Ball;
  3630. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3631. let xx = data.x;
  3632. let yy = data.y;
  3633. let numer = data.value;
  3634. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3635. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3636. this.ballArr.push(this.rootBall);
  3637. this.setD2Gan();
  3638. this.setHelpLine();
  3639. }
  3640. createOtherBalls(cfg) {
  3641. let temp;
  3642. let src;
  3643. let data;
  3644. for (const key in cfg) {
  3645. data = cfg[key];
  3646. temp = new D2Ball();
  3647. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3648. src = temp.d2Src;
  3649. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3650. src.initSelf(data.value, data.x, data.y, d3Ball);
  3651. this.ballArr.push(src);
  3652. }
  3653. }
  3654. shoot(percent) {
  3655. this.powerPercent = percent;
  3656. this.openCheckStill = true;
  3657. let d2Angle = this.d2Gan.ui.rotation;
  3658. this.rootBall.setSpeed(percent, d2Angle);
  3659. this.clearBallAllEft();
  3660. this.changePlayerView();
  3661. }
  3662. onUpdate() {
  3663. if (!this.openCheckStill)
  3664. return;
  3665. this.checkStill();
  3666. }
  3667. checkStill() {
  3668. for (let index = 0; index < this.ballArr.length; index++) {
  3669. if (!this.ballArr[index].isStill()) {
  3670. return;
  3671. }
  3672. }
  3673. xGame.eventMgr.event(ALL_BALL_STOP);
  3674. }
  3675. allBallStop() {
  3676. this.openCheckStill = false;
  3677. xGame.common.recoverCameraView();
  3678. }
  3679. waitShoot() {
  3680. if (!this.d2Gan.ui.isDisposed) {
  3681. this.d2Gan.ui.visible = true;
  3682. }
  3683. if (!this.d2HelpLine.ui.isDisposed) {
  3684. this.d2HelpLine.ui.visible = true;
  3685. }
  3686. this.clearBallAllEft();
  3687. this.showBallRightEft();
  3688. this.getHelpLine();
  3689. this.inHolesSpeed = [];
  3690. this.selectOneBall();
  3691. }
  3692. _getAllBallArr() {
  3693. let arr = this.ballArr;
  3694. let outArr = [];
  3695. for (let index = 0; index < arr.length; index++) {
  3696. if (arr[index] instanceof D2RootBallSrc)
  3697. continue;
  3698. if (arr[index].ballFunc == "ice")
  3699. continue;
  3700. if (arr[index].destroyed)
  3701. continue;
  3702. outArr.push(arr[index]);
  3703. }
  3704. return outArr;
  3705. }
  3706. _getBlackObj() {
  3707. let arr = this.ballArr;
  3708. for (let index = 0; index < arr.length; index++) {
  3709. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3710. return arr[index];
  3711. }
  3712. }
  3713. }
  3714. selectOneBall() {
  3715. let all = this._getAllBallArr();
  3716. let target;
  3717. switch (xGame.common.gameMode) {
  3718. case GameMode.classic:
  3719. if (xGame.common.gameMgr.selfTurn) {
  3720. let self = xGame.common.gameMgr.selfBallArr;
  3721. let black = this._getBlackObj();
  3722. if (xGame.common.gameMgr.ensureBallType) {
  3723. if (self.length > 0) {
  3724. let out = [];
  3725. for (let j = 0; j < all.length; j++) {
  3726. if (self.indexOf(all[j].number) > -1) {
  3727. out.push(all[j]);
  3728. }
  3729. }
  3730. target = this.selectBestEnterOne(out);
  3731. }
  3732. else {
  3733. target = this.selectBestEnterOne([black]);
  3734. }
  3735. }
  3736. else {
  3737. target = this.selectBestEnterOne(all);
  3738. }
  3739. }
  3740. else {
  3741. target = this.selectBestEnterOne(all);
  3742. }
  3743. break;
  3744. case GameMode.bigMove:
  3745. target = this.selectBestEnterOne(all);
  3746. break;
  3747. case GameMode.placeBall:
  3748. if (all.length > 0) {
  3749. target = this.selectBestEnterOne(all);
  3750. }
  3751. break;
  3752. default:
  3753. break;
  3754. }
  3755. if (target && !target.destroyed && target.onClick) {
  3756. target.onClick(0, true);
  3757. let num = -200 + xGame.common.randomNum(0, 400);
  3758. num /= 150;
  3759. if (xGame.common.longHelpLine) {
  3760. num = 0;
  3761. }
  3762. this.destRot += num;
  3763. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3764. }
  3765. }
  3766. removeOneBall(ball) {
  3767. for (let index = 0; index < this.ballArr.length; index++) {
  3768. if (this.ballArr[index].id == ball.id) {
  3769. this.ballArr.splice(index, 1);
  3770. break;
  3771. }
  3772. }
  3773. }
  3774. getHelpLine() {
  3775. this.d2HelpLine.ui.dirDot.visible = false;
  3776. this.isOnSameLine = false;
  3777. let startX = this.rootBall.gameObj.x;
  3778. let startY = this.rootBall.gameObj.y;
  3779. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3780. if (dis == null) {
  3781. this.d2HelpLine.ui.visible = false;
  3782. console.error("辅助线异常");
  3783. return;
  3784. }
  3785. this.d2HelpLine.ui.visible = true;
  3786. let angle = this.d2Gan.ui.rotation;
  3787. let radius = 16.5;
  3788. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3789. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3790. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3791. if (colliObj == null) {
  3792. this.getColliPos(disX, disY, radius, angle);
  3793. xGame.common.d2World.isHelpLineOnBall = false;
  3794. this.targetBall = null;
  3795. this.reflectAngle = 0;
  3796. this.showBallWrongEft();
  3797. }
  3798. else {
  3799. let target = colliObj.src;
  3800. let radius = 16.5;
  3801. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3802. dis1 = Math.sqrt(dis1);
  3803. let realDis = colliObj.disHon - dis1;
  3804. let dir = colliObj.dir;
  3805. let xx = startX + dir.x * realDis;
  3806. let yy = startY + dir.y * realDis;
  3807. this.getColliPos(xx, yy, radius, angle);
  3808. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3809. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3810. let offset = xGame.common.rodOffest;
  3811. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3812. this.isOnSameLine = true;
  3813. }
  3814. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3815. xGame.common.d2World.isHelpLineOnBall = true;
  3816. this.targetBall = target;
  3817. this.reflectAngle = reflectAngle;
  3818. this.showBallWrongEft();
  3819. if (xGame.common.longHelpLine) {
  3820. this.delayReflectLine(target, reflectAngle);
  3821. }
  3822. }
  3823. }
  3824. getBorderDot(startX, startY, angle) {
  3825. let radius = 17;
  3826. let distance;
  3827. let isDone;
  3828. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3829. isDone = this.judgeUpDown(distance, angle, startX);
  3830. if (isDone != null) {
  3831. return isDone;
  3832. }
  3833. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3834. isDone = this.judgeUpDown(distance, angle, startX);
  3835. if (isDone != null) {
  3836. return isDone;
  3837. }
  3838. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3839. isDone = this.judgeLeftRight(distance, angle, startY);
  3840. if (isDone != null) {
  3841. return isDone;
  3842. }
  3843. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3844. isDone = this.judgeLeftRight(distance, angle, startY);
  3845. if (isDone != null) {
  3846. return isDone;
  3847. }
  3848. }
  3849. judgeUpDown(distance, angle, startX) {
  3850. let flag = Math.sin(angle * Math.PI / 180);
  3851. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3852. if (distance >= 0) {
  3853. if (flag > 0) {
  3854. if (temp < this.borderRect.x + this.borderRect.width) {
  3855. return distance;
  3856. }
  3857. }
  3858. else {
  3859. if (temp > this.borderRect.x) {
  3860. return distance;
  3861. }
  3862. }
  3863. }
  3864. }
  3865. judgeLeftRight(distance, angle, starY) {
  3866. let flag = -Math.cos(angle * Math.PI / 180);
  3867. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3868. if (distance >= 0) {
  3869. if (flag > 0) {
  3870. if (temp < this.borderRect.y + this.borderRect.height) {
  3871. return distance;
  3872. }
  3873. }
  3874. else {
  3875. if (temp > this.borderRect.y) {
  3876. return distance;
  3877. }
  3878. }
  3879. }
  3880. }
  3881. clearBallAllEft() {
  3882. let temp;
  3883. for (let index = 0; index < this.ballArr.length; index++) {
  3884. temp = this.ballArr[index];
  3885. temp.clearBallEft();
  3886. }
  3887. }
  3888. showBallRightEft() {
  3889. let gameMgr = xGame.common.gameMgr;
  3890. let temp;
  3891. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3892. if (targetArr.length <= 0)
  3893. return;
  3894. for (let index = 0; index < this.ballArr.length; index++) {
  3895. temp = this.ballArr[index];
  3896. if (targetArr.indexOf(temp.number) > -1) {
  3897. temp.showRightEft();
  3898. }
  3899. }
  3900. }
  3901. showBallWrongEft() {
  3902. let gameMgr = xGame.common.gameMgr;
  3903. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3904. if (targetArr.length <= 0)
  3905. return;
  3906. let temp;
  3907. for (let index = 0; index < this.ballArr.length; index++) {
  3908. temp = this.ballArr[index];
  3909. if (this.targetBall && this.targetBall.number == temp.number) {
  3910. if (targetArr.indexOf(temp.number) <= -1) {
  3911. temp.showWrongEft();
  3912. }
  3913. else {
  3914. temp.clearBallWrongEft();
  3915. }
  3916. }
  3917. else {
  3918. temp.clearBallWrongEft();
  3919. }
  3920. }
  3921. }
  3922. getColliPos(x, y, radius, angle) {
  3923. this.d2HelpLine.ui.x = x;
  3924. this.d2HelpLine.ui.y = y;
  3925. let dirX = x - this.rootBall.gameObj.x;
  3926. let dirY = y - this.rootBall.gameObj.y;
  3927. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3928. if (rectH <= 0)
  3929. rectH = 0;
  3930. this.d2HelpLine.ui.rect.height = 0;
  3931. this.d2HelpLine.ui.rect.height = rectH;
  3932. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3933. if (rectH < this.rootBall.gameObj.width) {
  3934. this.d2HelpLine.ui.rect.visible = false;
  3935. }
  3936. else {
  3937. this.d2HelpLine.ui.rect.visible = true;
  3938. }
  3939. this.d2HelpLine.ui.dir.visible = false;
  3940. this.d2HelpLine.ui.rootDir.visible = false;
  3941. }
  3942. getReflectLine(x, y, radius, target) {
  3943. this.d2HelpLine.ui.dir.visible = true;
  3944. let dirX = target.x - x;
  3945. let dirY = target.y - y;
  3946. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3947. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3948. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3949. this.d2HelpLine.ui.dir.height = 48;
  3950. this.d2HelpLine.ui.dir.rotation = angle;
  3951. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3952. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3953. return angle;
  3954. }
  3955. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3956. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3957. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3958. let targetX = target.gameObj.x;
  3959. let targetY = target.gameObj.y;
  3960. this.outDir.setValue(targetX - xx, targetY - yy);
  3961. this.rootDir.setValue(rtX - xx, rtY - yy);
  3962. let ver = Math.PI / 2;
  3963. let sin = Math.sin(ver);
  3964. let cos = Math.cos(ver);
  3965. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3966. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3967. this.outDir.setValue(outX, outY);
  3968. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3969. Laya.Vector2.normalize(this.outDir, this.outDir);
  3970. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3971. if (Math.abs(result) <= 0.08) {
  3972. this.d2HelpLine.ui.rootDir.visible = false;
  3973. return;
  3974. }
  3975. if (result > 0) {
  3976. angle += 90;
  3977. }
  3978. else if (result < 0) {
  3979. angle -= 90;
  3980. }
  3981. this.d2HelpLine.ui.rootDir.visible = true;
  3982. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3983. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3984. this.d2HelpLine.ui.rootDir.rotation = angle;
  3985. }
  3986. delayReflectLine(obj, angle) {
  3987. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3988. return;
  3989. }
  3990. this.isOnSameLine = false;
  3991. let startX = obj.gameObj.x;
  3992. let startY = obj.gameObj.y;
  3993. let dis = this.getBorderDot(startX, startY, angle);
  3994. if (dis == null) {
  3995. this.d2HelpLine.ui.dirDot.visible = false;
  3996. return;
  3997. }
  3998. this.d2HelpLine.ui.visible = true;
  3999. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4000. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4001. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4002. if (colliObj == null) {
  4003. this.setDelayLine(disX, disY, obj, angle);
  4004. }
  4005. else {
  4006. let radius = 16;
  4007. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4008. dis1 = Math.sqrt(dis1);
  4009. let realDis = colliObj.disHon - dis1;
  4010. let dir = colliObj.dir;
  4011. let xx = startX + dir.x * realDis;
  4012. let yy = startY + dir.y * realDis;
  4013. this.setDelayLine(xx, yy, obj, angle);
  4014. }
  4015. }
  4016. setDelayLine(x, y, obj, angle) {
  4017. let dirX = x - obj.gameObj.x;
  4018. let dirY = y - obj.gameObj.y;
  4019. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4020. if (rectH <= 0)
  4021. rectH = 0;
  4022. this.d2HelpLine.ui.dir.height = rectH;
  4023. this.d2HelpLine.ui.dirDot.visible = true;
  4024. this.d2HelpLine.ui.dirDot.x = 17;
  4025. this.d2HelpLine.ui.dirDot.y = 17;
  4026. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4027. ;
  4028. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4029. }
  4030. changePlayerView() {
  4031. if (Math.random() >= 0.7)
  4032. return;
  4033. if (!this.targetBall) {
  4034. return;
  4035. }
  4036. if (!xGame.common.gameMgr.selfTurn)
  4037. return;
  4038. switch (xGame.common.gameMode) {
  4039. case GameMode.classic:
  4040. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4041. if (this.targetBall.number != 8) {
  4042. return;
  4043. }
  4044. }
  4045. break;
  4046. case GameMode.bigMove:
  4047. return;
  4048. case GameMode.placeBall:
  4049. break;
  4050. default:
  4051. break;
  4052. }
  4053. let startX = this.targetBall.gameObj.x;
  4054. let startY = this.targetBall.gameObj.y;
  4055. let angle = this.reflectAngle;
  4056. let dis = this.getBorderDot(startX, startY, angle);
  4057. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4058. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4059. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4060. if (colliObj) {
  4061. return;
  4062. }
  4063. let offset = 40;
  4064. let posObj = xGame.common.gameMgr.posObj;
  4065. let temp;
  4066. let radius;
  4067. let tarX, tarY;
  4068. for (const key in posObj) {
  4069. temp = posObj[key];
  4070. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4071. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4072. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4073. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4074. xGame.common.showOneCamera("angle" + key);
  4075. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4076. Laya.physicsTimer.scale = 0.7;
  4077. break;
  4078. }
  4079. }
  4080. }
  4081. selectBestEnterOne(arr) {
  4082. this.aiLv = xGame.tools.random(1, 11);
  4083. this.aiLv = 10;
  4084. this.wBall = xGame.common.d2World.rootBall;
  4085. this.rootPos.x = this.wBall.gameObj.x;
  4086. this.rootPos.y = this.wBall.gameObj.y;
  4087. this.initHoleBall(arr);
  4088. return this.selectBall();
  4089. }
  4090. selectBall() {
  4091. let ball = null;
  4092. this.destRot = 0;
  4093. let ai = 110 - this.aiLv * 10;
  4094. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4095. let score = false;
  4096. if (this.scoreBall.length < 1) {
  4097. if (this.lineBall.length < 1) {
  4098. for (let i = 0; i < this.kickBall.length; i++) {
  4099. let list = [];
  4100. let bo = this.kickBall[i];
  4101. let bobj = bo.gameObj;
  4102. let rect = xGame.common.d2World.borderRect;
  4103. let mobj = this.wBall.gameObj;
  4104. let minb = bobj.y - rect.y - 20;
  4105. let minw = mobj.y - rect.y - 50;
  4106. if (minb > 0 && minw > 0) {
  4107. let dlenx = 0;
  4108. let dleny = mobj.y - rect.y;
  4109. let spx = mobj.x;
  4110. let spy = rect.y - dleny;
  4111. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4112. }
  4113. minb = rect.y + rect.height - bobj.y - 20;
  4114. minw = rect.y + rect.height - mobj.y - 50;
  4115. if (minb > 0 && minw > 0) {
  4116. let dlenx = 0;
  4117. let dleny = rect.y + rect.height - mobj.y;
  4118. let spx = mobj.x;
  4119. let spy = rect.y + rect.height + dleny;
  4120. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4121. }
  4122. minb = bobj.x - rect.x - 20;
  4123. minw = mobj.x - rect.x - 50;
  4124. if (minb > 0 && minw > 0) {
  4125. let dlenx = mobj.x - rect.x;
  4126. let dleny = 0;
  4127. let spx = rect.x - dlenx;
  4128. let spy = mobj.y;
  4129. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4130. }
  4131. minb = rect.x + rect.width - bobj.x - 20;
  4132. minw = rect.x + rect.width - mobj.x - 50;
  4133. if (minb > 0 && minw > 0) {
  4134. let dlenx = rect.x + rect.width - mobj.x;
  4135. let dleny = 0;
  4136. let spx = rect.x + rect.width + dlenx;
  4137. let spy = mobj.y;
  4138. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4139. }
  4140. list.sort(function (a, b) {
  4141. return a.order - b.order;
  4142. });
  4143. for (let i = 0; i < list.length; i++) {
  4144. let data = list[i];
  4145. let mx = mobj.x - bobj.x;
  4146. let my = mobj.y - bobj.y;
  4147. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4148. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4149. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4150. if (num > 1)
  4151. num = 1;
  4152. let cos = Math.acos(num);
  4153. if (cos > 1.57)
  4154. cos = 1.57;
  4155. else if (cos < 0.01)
  4156. cos = 0.01;
  4157. let tan = Math.tan(cos);
  4158. let dx = tan * data.dleny;
  4159. let dy = tan * data.dlenx;
  4160. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4161. if (Math.abs(bx - 667) < 40)
  4162. continue;
  4163. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4164. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4165. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4166. this.forceMax = dis * 0.08;
  4167. this.destRot += mis * 0.1;
  4168. this.setKick(bx, by);
  4169. return true;
  4170. }
  4171. }
  4172. }
  4173. }
  4174. else {
  4175. ball = xGame.common.getRandArrEle(this.lineBall);
  4176. }
  4177. }
  4178. else {
  4179. for (let i = 0; i < this.scoreBall.length; i++) {
  4180. if (i < this.scoreBall.length - 1) {
  4181. let rand = 70 + this.aiLv * 10 + i * 10;
  4182. if (xGame.tools.random(0, 100) < rand) {
  4183. ball = this.scoreBall[i];
  4184. break;
  4185. }
  4186. }
  4187. else {
  4188. ball = this.scoreBall[i];
  4189. break;
  4190. }
  4191. }
  4192. score = true;
  4193. this.selectNum++;
  4194. }
  4195. if (!ball)
  4196. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4197. let dx = ball.gameObj.x;
  4198. let dy = ball.gameObj.y;
  4199. let kickAngle = 0;
  4200. if (score) {
  4201. dx = ball.kickPos.x;
  4202. dy = ball.kickPos.y;
  4203. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4204. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4205. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4206. if (adot > 1)
  4207. adot = 1;
  4208. kickAngle = Math.acos(adot) * 57.3;
  4209. if (kickAngle > 45) {
  4210. let kdx = ball.kickPos.x - ball.gameObj.x;
  4211. let kdy = ball.kickPos.y - ball.gameObj.y;
  4212. dx = ball.kickPos.x - kdx * mis * 0.3;
  4213. dy = ball.kickPos.y - kdy * mis * 0.3;
  4214. }
  4215. else
  4216. this.destRot += mis;
  4217. }
  4218. else if (ball.poleAngle != 0) {
  4219. this.destRot += ball.poleAngle;
  4220. }
  4221. if (xGame.common.gameMode == 0) {
  4222. let af = kickAngle * 0.08;
  4223. this.forceMax = ball.hard * 0.1 + af * af;
  4224. }
  4225. this.setKick(dx, dy);
  4226. return ball;
  4227. }
  4228. initHoleBall(arr) {
  4229. this.kickBall = [];
  4230. this.lineBall = [];
  4231. this.scoreBall = [];
  4232. this.holeBall = [];
  4233. this.selectNum = 0;
  4234. this.forceNum = 0;
  4235. this.forceMax = 0;
  4236. this.turnNum = 0;
  4237. let list = arr;
  4238. let holes = xGame.common.gameMgr.holePosList;
  4239. let self = xGame.common.aiPlayer;
  4240. for (let i = 0; i < list.length; i++) {
  4241. let obj = list[i];
  4242. if (!obj)
  4243. continue;
  4244. obj.kickPos.x = 0;
  4245. obj.kickPos.y = 0;
  4246. obj.poleAngle = 0;
  4247. obj.hard = 0;
  4248. obj.borderDis = 0;
  4249. obj.kickAngle = 180;
  4250. let b = obj.gameObj;
  4251. let wbp = this.rootPos;
  4252. let bx = wbp.x - b.x;
  4253. let by = wbp.y - b.y;
  4254. obj.borderDis = xGame.tools.random(0, 100);
  4255. this.kickBall.push(obj);
  4256. if (!this.isLine(wbp, obj))
  4257. continue;
  4258. obj.kickAngle = xGame.tools.random(90, 180);
  4259. obj.kickPos.x = b.x;
  4260. obj.kickPos.y = b.y;
  4261. this.lineBall.push(obj);
  4262. let minDis = 999999;
  4263. let hole = false;
  4264. for (let j = 0; j < holes.length; j++) {
  4265. let hp = holes[j];
  4266. if (bx >= 0 && hp.x > b.x + 100)
  4267. continue;
  4268. if (bx <= 0 && hp.x < b.x - 100)
  4269. continue;
  4270. if (by < -10 && hp.y < wbp.y)
  4271. continue;
  4272. if (by > 10 && hp.y > wbp.y)
  4273. continue;
  4274. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4275. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4276. if (dis < minDis) {
  4277. let dx = b.x - this.tempDir1.x * this.ballSize;
  4278. let dy = b.y - this.tempDir1.y * this.ballSize;
  4279. this.tempDir3.x = this.tempDir1.x;
  4280. this.tempDir3.y = this.tempDir1.y;
  4281. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4282. obj.kickPos.x = dx;
  4283. obj.kickPos.y = dy;
  4284. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4285. if (num > 1)
  4286. num = 1;
  4287. obj.kickAngle = Math.acos(num) * 57.3;
  4288. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4289. dis = dis * 2;
  4290. if (Math.abs(hp.x - 600) < 100)
  4291. dis += 50;
  4292. obj.hard = dis + obj.kickAngle * 3;
  4293. hole = true;
  4294. }
  4295. }
  4296. }
  4297. }
  4298. if (hole) {
  4299. this.scoreBall.push(obj);
  4300. this.holeBall.push(obj);
  4301. }
  4302. }
  4303. this.scoreBall.sort(function (a, b) {
  4304. return a.hard - b.hard;
  4305. });
  4306. this.holeBall.sort(function (a, b) {
  4307. return a.kickAngle - b.kickAngle;
  4308. });
  4309. this.kickBall.sort(function (a, b) {
  4310. return a.borderDis - b.borderDis;
  4311. });
  4312. }
  4313. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4314. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4315. let balls = xGame.common.d2World.ballArr;
  4316. let max = xGame.tools.getDis(hx, hy, bx, by);
  4317. for (let index = 0; index < balls.length; index++) {
  4318. let obj = balls[index];
  4319. if (obj.number == 0)
  4320. continue;
  4321. if (obj.number == bn || obj.number == dn)
  4322. continue;
  4323. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4324. if (dis * dis > max)
  4325. continue;
  4326. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4327. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4328. if (num > 1)
  4329. num = 1;
  4330. if (num < 0)
  4331. continue;
  4332. let gap = Math.sin(Math.acos(num)) * dis;
  4333. if (gap < this.ballSize)
  4334. return true;
  4335. }
  4336. return false;
  4337. }
  4338. isLine(xy, ball) {
  4339. let bx = xy.x;
  4340. let by = xy.y;
  4341. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4342. let dis = ball.getDestDis(xy);
  4343. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4344. let sin = Math.sin(angle);
  4345. let cos = Math.cos(angle);
  4346. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4347. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4348. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4349. let dx = bx + this.tempDir2.x * dis;
  4350. let dy = by + this.tempDir2.y * dis;
  4351. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4352. sin = Math.sin(-angle);
  4353. cos = Math.cos(-angle);
  4354. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4355. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4356. dx = bx + this.tempDir2.x * dis;
  4357. dy = by + this.tempDir2.y * dis;
  4358. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4359. if (isr && isl)
  4360. return false;
  4361. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4362. }
  4363. return true;
  4364. }
  4365. setKick(dx, dy) {
  4366. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4367. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4368. this.tempDir1.x = 0;
  4369. this.tempDir1.y = 1;
  4370. this.tempDir2.y = -this.tempDir2.y;
  4371. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4372. if (num > 1)
  4373. num = 1;
  4374. let rot = Math.acos(num) * 57.3;
  4375. if (this.tempDir2.x < 0)
  4376. rot = 360 - rot;
  4377. this.destRot += rot;
  4378. }
  4379. }
  4380. class ui_UIGame extends fgui.GComponent {
  4381. static createInstance() {
  4382. return (fgui.UIPackage.createObject("game", "UIGame"));
  4383. }
  4384. onConstruct() {
  4385. this.c1 = this.getController("c1");
  4386. this.d3Root = (this.getChild("d3Root"));
  4387. this.clickNode = (this.getChild("clickNode"));
  4388. this.d2Root = (this.getChild("d2Root"));
  4389. this.topNode = (this.getChild("topNode"));
  4390. this.n72 = (this.getChild("n72"));
  4391. this.n40 = (this.getChild("n40"));
  4392. this.rulerNode = (this.getChild("rulerNode"));
  4393. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4394. this.n50 = (this.getChild("n50"));
  4395. this.keduNode = (this.getChild("keduNode"));
  4396. this.powerTxt = (this.getChild("powerTxt"));
  4397. this.powerNode = (this.getChild("powerNode"));
  4398. this.colorNode = (this.getChild("colorNode"));
  4399. this.powerEft = (this.getChild("powerEft"));
  4400. this.myPowerNode = (this.getChild("myPowerNode"));
  4401. this.ganNode = (this.getChild("ganNode"));
  4402. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4403. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4404. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4405. this.skillRod = (this.getChild("skillRod"));
  4406. this.border = (this.getChild("border"));
  4407. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4408. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4409. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4410. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4411. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4412. this.guanyuNode = (this.getChild("guanyuNode"));
  4413. this.helpBtn = (this.getChild("helpBtn"));
  4414. this.wordsBtn = (this.getChild("wordsBtn"));
  4415. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4416. this.returnBtn = (this.getChild("returnBtn"));
  4417. this.ballNode = (this.getChild("ballNode"));
  4418. this.whiteAni = (this.getChild("whiteAni"));
  4419. this.blackAni = (this.getChild("blackAni"));
  4420. this.selfTurn = (this.getChild("selfTurn"));
  4421. this.aiTurn = (this.getChild("aiTurn"));
  4422. this.deskNode = (this.getChild("deskNode"));
  4423. this.moveNode = (this.getChild("moveNode"));
  4424. this.selfTalk = (this.getChild("selfTalk"));
  4425. this.aiTalk = (this.getChild("aiTalk"));
  4426. this.d2Node = (this.getChild("d2Node"));
  4427. this.snowNode = (this.getChild("snowNode"));
  4428. this.guide2 = (this.getChild("guide2"));
  4429. this.guide1 = (this.getChild("guide1"));
  4430. this.guide3 = (this.getChild("guide3"));
  4431. this.guideNode = (this.getChild("guideNode"));
  4432. }
  4433. }
  4434. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4435. class ui_UIGameEnd extends fgui.GComponent {
  4436. static createInstance() {
  4437. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4438. }
  4439. onConstruct() {
  4440. this.c1 = this.getController("c1");
  4441. this.n22 = (this.getChild("n22"));
  4442. this.n2 = (this.getChild("n2"));
  4443. this.n52 = (this.getChild("n52"));
  4444. this.n53 = (this.getChild("n53"));
  4445. this.coinNode = (this.getChild("coinNode"));
  4446. this.closeNode = (this.getChild("closeNode"));
  4447. this.moneyNode = (this.getChild("moneyNode"));
  4448. this.secretary = (this.getChild("secretary"));
  4449. this.n27 = (this.getChild("n27"));
  4450. this.n29 = (this.getChild("n29"));
  4451. this.talkNode = (this.getChild("talkNode"));
  4452. this.n38 = (this.getChild("n38"));
  4453. this.n39 = (this.getChild("n39"));
  4454. this.n40 = (this.getChild("n40"));
  4455. this.awardNode = (this.getChild("awardNode"));
  4456. this.starNumNode = (this.getChild("starNumNode"));
  4457. this.n47 = (this.getChild("n47"));
  4458. this.conditionNode = (this.getChild("conditionNode"));
  4459. this.isGetAward = (this.getChild("isGetAward"));
  4460. this.leftBtn = (this.getChild("leftBtn"));
  4461. this.rightBtn = (this.getChild("rightBtn"));
  4462. this.btnNode = (this.getChild("btnNode"));
  4463. }
  4464. }
  4465. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4466. class ui_UIAddCoin extends fgui.GComponent {
  4467. static createInstance() {
  4468. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4469. }
  4470. onConstruct() {
  4471. this.n11 = (this.getChild("n11"));
  4472. this.myNode = (this.getChild("myNode"));
  4473. this.t0 = this.getTransition("t0");
  4474. }
  4475. }
  4476. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4477. class UIAddCoin extends UIBase {
  4478. constructor() {
  4479. super();
  4480. this.coinNum = 2000;
  4481. }
  4482. onConstructor() {
  4483. this.ui = ui_UIAddCoin.createInstance();
  4484. this.contentPane = this.ui;
  4485. this.isEject = false;
  4486. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4487. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4488. }
  4489. show() {
  4490. super.show();
  4491. this.ui.t0.play();
  4492. this.setGlobalFont(this.ui);
  4493. }
  4494. videoAddCoin() {
  4495. console.log('zh:qjff_AD_for_UIAddCoin');
  4496. if (Laya.Browser.onAndroid) {
  4497. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4498. if (!boo) {
  4499. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4500. return;
  4501. }
  4502. }
  4503. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4504. }
  4505. else {
  4506. console.log('zh:AD 失败,直接发放奖励');
  4507. this.qjff_AD_for_UIAddCoin();
  4508. }
  4509. }
  4510. qjff_AD_for_UIAddCoin() {
  4511. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4512. this.hide();
  4513. }
  4514. }
  4515. UIAddCoin.uiName = "UIAddCoin";
  4516. class ui_UIInvitation extends fgui.GComponent {
  4517. static createInstance() {
  4518. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4519. }
  4520. onConstruct() {
  4521. this.n14 = (this.getChild("n14"));
  4522. this.myNode = (this.getChild("myNode"));
  4523. this.t0 = this.getTransition("t0");
  4524. }
  4525. }
  4526. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4527. class UIInvitation extends UIBase {
  4528. constructor() {
  4529. super();
  4530. }
  4531. onConstructor() {
  4532. this.ui = ui_UIInvitation.createInstance();
  4533. this.contentPane = this.ui;
  4534. this.isEject = false;
  4535. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4536. }
  4537. show() {
  4538. super.show();
  4539. this.setGlobalFont(this.ui);
  4540. }
  4541. enterGame() {
  4542. xGame.common.gameMode = GameMode.classic;
  4543. DataMgr.setChallengeTimes(1);
  4544. xGame.common.passAwardCoin = 2000;
  4545. let need = xGame.common.classicNiceNeddCoin;
  4546. if (DataMgr.coinEnough(need)) {
  4547. DataMgr.setCoin(-need);
  4548. xGame.eventMgr.event(RESTART_GAME, true);
  4549. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4550. }
  4551. else {
  4552. xGame.eventMgr.event(RESTART_GAME, true);
  4553. }
  4554. this.hide();
  4555. }
  4556. hide() {
  4557. super.hide();
  4558. }
  4559. }
  4560. UIInvitation.uiName = "UIInvitation";
  4561. class ui_UIMain extends fgui.GComponent {
  4562. static createInstance() {
  4563. return (fgui.UIPackage.createObject("game", "UIMain"));
  4564. }
  4565. onConstruct() {
  4566. this.n47 = (this.getChild("n47"));
  4567. this.n10 = (this.getChild("n10"));
  4568. this.secretary = (this.getChild("secretary"));
  4569. this.moneyNode = (this.getChild("moneyNode"));
  4570. this.headNode = (this.getChild("headNode"));
  4571. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4572. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4573. this.classicBtn = (this.getChild("classicBtn"));
  4574. this.globalBtn = (this.getChild("globalBtn"));
  4575. this.n44 = (this.getChild("n44"));
  4576. this.n_dengLu = (this.getChild("n_dengLu"));
  4577. this.settingNode = (this.getChild("settingNode"));
  4578. this.drawBtn = (this.getChild("drawBtn"));
  4579. this.signBtn = (this.getChild("signBtn"));
  4580. this.shopBtn = (this.getChild("shopBtn"));
  4581. this.n45 = (this.getChild("n45"));
  4582. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4583. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4584. this.rankBtn = (this.getChild("rankBtn"));
  4585. this.n46 = (this.getChild("n46"));
  4586. this.liucheng1 = (this.getChild("liucheng1"));
  4587. this.rightBtn = (this.getChild("rightBtn"));
  4588. this.n75 = (this.getChild("n75"));
  4589. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4590. this.liucheng2 = (this.getChild("liucheng2"));
  4591. this.guideBtn = (this.getChild("guideBtn"));
  4592. this.n73 = (this.getChild("n73"));
  4593. this.wordsNode = (this.getChild("wordsNode"));
  4594. this.enterGuide = (this.getChild("enterGuide"));
  4595. this.talkNode = (this.getChild("talkNode"));
  4596. this.n83 = (this.getChild("n83"));
  4597. this.n84 = (this.getChild("n84"));
  4598. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4599. }
  4600. }
  4601. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4602. class ui_UIMoyu extends fgui.GComponent {
  4603. static createInstance() {
  4604. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4605. }
  4606. onConstruct() {
  4607. this.ageTip = (this.getChild("ageTip"));
  4608. this.mainBg = (this.getChild("mainBg"));
  4609. this.xyNode = (this.getChild("xyNode"));
  4610. this.rnNode = (this.getChild("rnNode"));
  4611. this.fcmNode = (this.getChild("fcmNode"));
  4612. this.ageNode = (this.getChild("ageNode"));
  4613. this.tipNode = (this.getChild("tipNode"));
  4614. this.msgNode = (this.getChild("msgNode"));
  4615. }
  4616. }
  4617. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4618. class MoyuMgr {
  4619. static initMoyu() {
  4620. this.moyuView = new MoyuView();
  4621. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4622. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4623. this.moyuView.ui.displayObject.zOrder = 1000;
  4624. this.moyuView.init();
  4625. this.moyuView.showTip(true);
  4626. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4627. window['XApk'] = this;
  4628. }
  4629. static showAge(show) {
  4630. if (this.moyuView)
  4631. this.moyuView.showAge(show);
  4632. }
  4633. static onPlatMsg(idx) {
  4634. if (!MoyuMgr.moyuView)
  4635. return;
  4636. if (idx == '0') {
  4637. MoyuMgr.moyuView.showTip(false);
  4638. }
  4639. }
  4640. static showAgree(call) {
  4641. if (this.moyuView)
  4642. this.moyuView.showAgree(call);
  4643. else
  4644. call && call();
  4645. }
  4646. static showXy(type = 1) {
  4647. if (this.moyuView)
  4648. this.moyuView.showXy(type);
  4649. }
  4650. }
  4651. MoyuMgr.isAdvise = false;
  4652. class MoyuView {
  4653. constructor() {
  4654. this.ysxyNum = 1;
  4655. this.ysJson = null;
  4656. this.ui = ui_UIMoyu.createInstance();
  4657. }
  4658. init() {
  4659. this.ui.mainBg.visible = false;
  4660. this.ui.xyNode.visible = false;
  4661. this.ui.ageNode.visible = false;
  4662. this.ui.tipNode.visible = false;
  4663. this.ui.rnNode.visible = false;
  4664. this.ui.fcmNode.visible = false;
  4665. this.ui.ageTip.visible = false;
  4666. this.ui.msgNode.visible = false;
  4667. this.ui.visible = false;
  4668. this.ui.xyNode.xyList.setVirtual();
  4669. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4670. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4671. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4672. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4673. this.ui.xyNode.btnKnown.visible = false;
  4674. this.ui.xyNode.xy1.visible = false;
  4675. this.ui.xyNode.xy2.visible = false;
  4676. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4677. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4678. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4679. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4680. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4681. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4682. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4683. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4684. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4685. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4686. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4687. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4688. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4689. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4690. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4691. this.ysxyNum = 2;
  4692. }
  4693. }
  4694. onClick(obj) {
  4695. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4696. switch (obj) {
  4697. case this.ui.ageTip:
  4698. if (Moyu.isTTApk) {
  4699. this.ui.ageNode.visible = true;
  4700. this.ui.mainBg.visible = true;
  4701. }
  4702. break;
  4703. case this.ui.tipNode:
  4704. this.showTip(false);
  4705. break;
  4706. case this.ui.ageNode.btnAge:
  4707. this.ui.ageNode.visible = false;
  4708. this.ui.mainBg.visible = false;
  4709. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4710. this.ui.visible = false;
  4711. break;
  4712. case this.ui.xyNode.btnXy3:
  4713. case this.ui.xyNode.btnXy1:
  4714. this.loadXy(1);
  4715. break;
  4716. case this.ui.xyNode.btnXy2:
  4717. this.loadXy(2);
  4718. break;
  4719. case this.ui.xyNode.btnBack:
  4720. this.ui.xyNode.xy1.visible = true;
  4721. this.ui.xyNode.xy2.visible = false;
  4722. break;
  4723. case this.ui.xyNode.btnKnown:
  4724. this.ui.xyNode.visible = false;
  4725. this.ui.mainBg.visible = false;
  4726. this.ui.visible = false;
  4727. break;
  4728. case this.ui.rnNode.btnCheck:
  4729. this.check();
  4730. break;
  4731. case this.ui.rnNode.btnExit:
  4732. case this.ui.xyNode.btnNo:
  4733. this.ysxyNum--;
  4734. if (this.ysxyNum > 0)
  4735. this.showMsg("Refuse to quit the game once again");
  4736. else {
  4737. Moyu.userAgree(false);
  4738. Moyu.exit();
  4739. }
  4740. break;
  4741. case this.ui.xyNode.btnSure:
  4742. case this.ui.xyNode.btnYes:
  4743. DataMgr.userData.isAgree = true;
  4744. DataMgr.saveUserData();
  4745. this.onAgree();
  4746. break;
  4747. case this.ui.rnNode.btnDone:
  4748. this.ui.rnNode.visible = false;
  4749. this.ui.visible = false;
  4750. break;
  4751. case this.ui.fcmNode.btnRn:
  4752. this.showRn();
  4753. break;
  4754. }
  4755. }
  4756. showTip(show) {
  4757. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4758. return;
  4759. if (show) {
  4760. MoyuMgr.isAdvise = true;
  4761. this.ui.visible = true;
  4762. this.ui.tipNode.visible = true;
  4763. this.ui.tipNode.alpha = 1;
  4764. Laya.timer.once(1000, this, this.showTip, [false]);
  4765. }
  4766. else {
  4767. this.ui.tipNode.alpha = 1;
  4768. this.ui.tipNode.visible = true;
  4769. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4770. this.ui.tipNode.visible = false;
  4771. MoyuMgr.isAdvise = false;
  4772. }), 1000);
  4773. }
  4774. }
  4775. showAge(show, px = 0, py = 0) {
  4776. if (Moyu.platType > 10 && !Moyu.isIos) {
  4777. this.ui.ageTip.x = px;
  4778. this.ui.ageTip.y = py;
  4779. this.ui.ageTip.visible = show;
  4780. if (show)
  4781. this.ui.visible = true;
  4782. }
  4783. }
  4784. showAgree(call) {
  4785. this.agreeCall = call;
  4786. this.onAgree();
  4787. return;
  4788. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4789. this.showXy(0);
  4790. }
  4791. else
  4792. this.onAgree();
  4793. }
  4794. onAgree() {
  4795. if (!this.ui.ageNode.visible)
  4796. this.ui.visible = false;
  4797. this.ui.xyNode.visible = false;
  4798. Moyu.userAgree(true);
  4799. this.showAge(false);
  4800. this.agreeCall && this.agreeCall();
  4801. this.showRn();
  4802. }
  4803. showMsg(txt) {
  4804. this.ui.msgNode.txtMsg.text = txt;
  4805. this.ui.msgNode.visible = true;
  4806. this.ui.msgNode.alpha = 1;
  4807. this.ui.visible = true;
  4808. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4809. this.ui.msgNode.visible = false;
  4810. }), 2500, true);
  4811. }
  4812. showRn() {
  4813. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4814. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4815. this.ui.rnNode.rn1.visible = true;
  4816. this.ui.rnNode.rn2.visible = false;
  4817. this.ui.rnNode.rn3.visible = false;
  4818. this.ui.rnNode.rn4.visible = false;
  4819. this.ui.rnNode.visible = true;
  4820. this.ui.mainBg.visible = true;
  4821. this.ui.rnNode.btnDone.visible = false;
  4822. this.ui.rnNode.btnExit.visible = true;
  4823. this.ui.rnNode.btnCheck.visible = true;
  4824. this.ui.fcmNode.visible = false;
  4825. this.ui.visible = true;
  4826. return;
  4827. }
  4828. }
  4829. this.showFcm();
  4830. }
  4831. showFcm() {
  4832. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4833. Moyu.initFCM(true);
  4834. if (Moyu.gameTime < 1)
  4835. this.fcmLoop();
  4836. else if (Moyu.gameTime < 999)
  4837. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4838. }
  4839. }
  4840. fcmLoop() {
  4841. if (Moyu.gameTime < 1) {
  4842. this.ui.rnNode.visible = false;
  4843. this.ui.fcmNode.visible = true;
  4844. this.ui.mainBg.visible = true;
  4845. this.ui.visible = true;
  4846. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4847. Laya.timer.clear(this.ui, this.fcmLoop);
  4848. }
  4849. }
  4850. check() {
  4851. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4852. this.ui.rnNode.rn1.visible = false;
  4853. this.ui.rnNode.rn2.visible = false;
  4854. this.ui.rnNode.rn4.visible = true;
  4855. }
  4856. else if (this.ui.rnNode.rn4.visible) {
  4857. let name = this.ui.rnNode.inputName.text;
  4858. let code = this.ui.rnNode.inputCode.text;
  4859. if (code && code.length == 18) {
  4860. this.ui.rnNode.rn1.visible = false;
  4861. this.ui.rnNode.rn4.visible = false;
  4862. Moyu.authenticate(name, code, (res) => {
  4863. this.ui.rnNode.rn2.visible = !res;
  4864. this.ui.rnNode.rn3.visible = res;
  4865. this.ui.rnNode.btnDone.visible = res;
  4866. this.ui.rnNode.btnExit.visible = !res;
  4867. this.ui.rnNode.btnCheck.visible = !res;
  4868. if (res)
  4869. this.showFcm();
  4870. });
  4871. }
  4872. else
  4873. this.showMsg("信息填写不完整");
  4874. }
  4875. }
  4876. loadXy(type = 0) {
  4877. this.ui.xyNode.xy1.visible = false;
  4878. this.ui.xyNode.xy2.visible = true;
  4879. this.ui.xyNode.xyList.scrollToView(0);
  4880. if (type == 1) {
  4881. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4882. }
  4883. else if (type == 2) {
  4884. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4885. }
  4886. }
  4887. showXy(type = 0) {
  4888. this.xyBtn();
  4889. if (type == 0) {
  4890. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4891. this.ui.xyNode.btnSure.visible = true;
  4892. }
  4893. else {
  4894. this.ui.xyNode.btnYes.visible = true;
  4895. this.ui.xyNode.btnNo.visible = true;
  4896. }
  4897. }
  4898. else {
  4899. this.ui.xyNode.btnKnown.visible = true;
  4900. this.ui.mainBg.visible = true;
  4901. }
  4902. this.ui.xyNode.xy1.visible = true;
  4903. this.ui.xyNode.xy2.visible = false;
  4904. this.ui.xyNode.visible = true;
  4905. this.ui.visible = true;
  4906. }
  4907. xyBtn() {
  4908. this.ui.xyNode.btnSure.visible = false;
  4909. this.ui.xyNode.btnYes.visible = false;
  4910. this.ui.xyNode.btnNo.visible = false;
  4911. this.ui.xyNode.btnKnown.visible = false;
  4912. {
  4913. this.ui.xyNode.btnXy3.visible = false;
  4914. this.ui.xyNode.btnXy2.visible = true;
  4915. this.ui.xyNode.btnXy1.visible = true;
  4916. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4917. }
  4918. }
  4919. createXY(json) {
  4920. this.ysJson = json.content;
  4921. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4922. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4923. this.ui.xyNode.xy2.visible = true;
  4924. }
  4925. renderListItem(idx, cell) {
  4926. let xy = this.ysJson[idx];
  4927. cell.height = xy.line * 30;
  4928. cell.xyItem.text = xy.text;
  4929. }
  4930. onDestroy() {
  4931. this.agreeCall = null;
  4932. }
  4933. }
  4934. class SettingNode {
  4935. constructor(ui) {
  4936. this.showSetting = false;
  4937. this.openSound = true;
  4938. this.openShake = true;
  4939. this.ui = ui;
  4940. this.ui.soundBtn.onClick(this, this.switchSound);
  4941. this.ui.shakeBtn.onClick(this, this.switchShake);
  4942. this.ui.xyBtn.onClick(this, this.onXy);
  4943. this.ui.clickNode.onClick(this, this.changeSetting);
  4944. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4945. this.ui.xyBtn.visible = false;
  4946. this.ui.shakeBtn.visible = false;
  4947. }
  4948. changeSetting() {
  4949. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4950. this.showSetting = !this.showSetting;
  4951. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4952. }
  4953. switchSound() {
  4954. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4955. this.openSound = !this.openSound;
  4956. Moyu.onSetting(this.openSound, this.openShake);
  4957. xGame.soundMgr.onSetting(this.openSound);
  4958. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4959. }
  4960. switchShake() {
  4961. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4962. this.openShake = !this.openShake;
  4963. Moyu.onSetting(this.openSound, this.openShake);
  4964. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4965. }
  4966. onXy() {
  4967. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4968. MoyuMgr.showXy(1);
  4969. }
  4970. }
  4971. class ui_UILevelDisplay extends fgui.GComponent {
  4972. static createInstance() {
  4973. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4974. }
  4975. onConstruct() {
  4976. this.n9 = (this.getChild("n9"));
  4977. this.myNode = (this.getChild("myNode"));
  4978. this.closeNode = (this.getChild("closeNode"));
  4979. }
  4980. }
  4981. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4982. class ui_UILevelProp extends fgui.GComponent {
  4983. static createInstance() {
  4984. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4985. }
  4986. onConstruct() {
  4987. this.n16 = (this.getChild("n16"));
  4988. this.myNode = (this.getChild("myNode"));
  4989. this.closeBtn = (this.getChild("closeBtn"));
  4990. this.moneyNode = (this.getChild("moneyNode"));
  4991. this.t1 = this.getTransition("t1");
  4992. }
  4993. }
  4994. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  4995. class ui_ShowItem extends fgui.GComponent {
  4996. static createInstance() {
  4997. return (fgui.UIPackage.createObject("game", "ShowItem"));
  4998. }
  4999. onConstruct() {
  5000. this.myImg = (this.getChild("myImg"));
  5001. }
  5002. }
  5003. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5004. class ShowItem {
  5005. constructor() {
  5006. this.ui = ui_ShowItem.createInstance();
  5007. }
  5008. destroySelf() {
  5009. if (!this.ui.isDisposed) {
  5010. this.ui.removeFromParent();
  5011. this.ui.dispose();
  5012. }
  5013. }
  5014. setParent(parent) {
  5015. parent.addChild(this.ui);
  5016. }
  5017. setPos(x, y) {
  5018. this.ui.x = x;
  5019. this.ui.y = y;
  5020. }
  5021. setUrl(index) {
  5022. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5023. }
  5024. }
  5025. class ui_UIPower extends fgui.GComponent {
  5026. static createInstance() {
  5027. return (fgui.UIPackage.createObject("game", "UIPower"));
  5028. }
  5029. onConstruct() {
  5030. this.n11 = (this.getChild("n11"));
  5031. this.myNode = (this.getChild("myNode"));
  5032. this.t0 = this.getTransition("t0");
  5033. }
  5034. }
  5035. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5036. class UIPower extends UIBase {
  5037. constructor() {
  5038. super();
  5039. }
  5040. onConstructor() {
  5041. this.ui = ui_UIPower.createInstance();
  5042. this.contentPane = this.ui;
  5043. this.isEject = false;
  5044. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5045. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5046. }
  5047. show() {
  5048. super.show();
  5049. this.ui.t0.play();
  5050. this.setGlobalFont(this.ui);
  5051. }
  5052. videoGetPower() {
  5053. console.log('zh:qjff_AD_for_uipower');
  5054. if (Laya.Browser.onAndroid) {
  5055. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5056. if (!boo) {
  5057. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5058. return;
  5059. }
  5060. }
  5061. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5062. }
  5063. else {
  5064. console.log('zh:AD 失败,直接发放奖励');
  5065. this.qjff_AD_for_uipower();
  5066. }
  5067. }
  5068. qjff_AD_for_uipower() {
  5069. DataMgr.setPower(xGame.common.videoPower, true);
  5070. xGame.eventMgr.event(POWER_TIME);
  5071. this.hide();
  5072. }
  5073. }
  5074. UIPower.uiName = "UIPower";
  5075. class UILevelProp extends UIBase {
  5076. constructor() {
  5077. super();
  5078. this.firstPos = 385;
  5079. this.secondPos = 467;
  5080. this.showItemArr = [];
  5081. }
  5082. onConstructor() {
  5083. this.ui = ui_UILevelProp.createInstance();
  5084. this.contentPane = this.ui;
  5085. this.isEject = false;
  5086. this.addUIClick(this.ui.closeBtn, this.hide);
  5087. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5088. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5089. }
  5090. show(level) {
  5091. super.show();
  5092. this.ui.t1.play();
  5093. this.level = level;
  5094. this.data = cfgTable.placeballData[this.level];
  5095. this.updateSelf();
  5096. this.showPreView();
  5097. this.moneyNode.ui.c1.selectedIndex = 2;
  5098. this.moneyNode.checkPowerTime();
  5099. this.moneyNode.powerChange();
  5100. this.setGlobalFont(this.ui);
  5101. }
  5102. showPreView() {
  5103. let item;
  5104. let data;
  5105. for (let index = 0; index < this.showItemArr.length; index++) {
  5106. item = this.showItemArr[index];
  5107. item.destroySelf();
  5108. }
  5109. this.showItemArr = [];
  5110. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5111. for (const key in cfgData) {
  5112. data = cfgData[key];
  5113. item = new ShowItem();
  5114. item.setParent(this.ui.myNode.displayRoot);
  5115. item.setPos(data.x, data.y);
  5116. item.setUrl(data.value);
  5117. this.showItemArr.push(item);
  5118. }
  5119. }
  5120. updateSelf() {
  5121. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5122. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5123. if (this.data.ball == -1) {
  5124. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5125. }
  5126. else {
  5127. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5128. }
  5129. let localData = DataMgr.getPlaceBallLevel(this.level);
  5130. let getAward = localData.getAward;
  5131. let cfg = cfgTable.placeballData[this.level];
  5132. let coin = this.data.award[0];
  5133. let diamond = this.data.award[1];
  5134. if (cfg.type == PlaceBallType.challenge) {
  5135. diamond = 0;
  5136. coin = 100;
  5137. }
  5138. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5139. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5140. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5141. if (cfg.type == PlaceBallType.challenge) {
  5142. this.ui.myNode.coinNode.numTxt.text = "";
  5143. }
  5144. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5145. if (coin > 0 && diamond > 0) {
  5146. this.ui.myNode.diamondNode.x = 385;
  5147. this.ui.myNode.coinNode.x = 467;
  5148. }
  5149. else {
  5150. this.ui.myNode.diamondNode.x = 385;
  5151. this.ui.myNode.coinNode.x = 385;
  5152. }
  5153. if (!getAward) {
  5154. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5155. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5156. }
  5157. else {
  5158. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5159. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5160. }
  5161. }
  5162. startGame() {
  5163. if (DataMgr.powerEnough()) {
  5164. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5165. this.ui.myNode.startBtn.touchable = false;
  5166. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5167. console.log('zh:startGame ');
  5168. this.ui.myNode.startBtn.touchable = true;
  5169. DataMgr.setPower(-1);
  5170. xGame.eventMgr.event(POWER_TIME);
  5171. xGame.common.gameMode = GameMode.placeBall;
  5172. xGame.common.placeBallCurLevel = this.level;
  5173. xGame.uiMgr.Show(UIGame);
  5174. this.logEventForChallenge_level_start(this.level);
  5175. xGame.uiMgr.Hide(UILevelDisplay);
  5176. xGame.uiMgr.Hide(UIMain);
  5177. this.hide();
  5178. }));
  5179. }
  5180. else {
  5181. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5182. xGame.uiMgr.Show(UIPower);
  5183. }
  5184. }
  5185. logEventForChallenge_level_start(level) {
  5186. let keyStr = 'sjmd_challenge_level_start';
  5187. let jsonStr = {
  5188. "count": 1,
  5189. "gold_balance ": DataMgr.getCoin(),
  5190. "level": level,
  5191. "diamond_balance ": DataMgr.getDiamond()
  5192. };
  5193. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5194. const d = LocalStorageManager.getItem(keyStr);
  5195. if (level > d.level) {
  5196. jsonStr.count = d.count + 1;
  5197. LocalStorageManager.setItem(keyStr, jsonStr);
  5198. }
  5199. else {
  5200. }
  5201. }
  5202. else {
  5203. LocalStorageManager.setItem(keyStr, jsonStr);
  5204. }
  5205. const reqStr = JSON.stringify(jsonStr);
  5206. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5207. }
  5208. hide() {
  5209. super.hide();
  5210. }
  5211. }
  5212. UILevelProp.uiName = "UILevelProp";
  5213. class PutBallLevelDisplay {
  5214. constructor(ui, index) {
  5215. this.index = 0;
  5216. this.ui = ui;
  5217. this.index = index;
  5218. this.ui.onClick(this, this.clickSelf);
  5219. this.updateSelf();
  5220. this.ui.levelTxt.text = (this.index + 1) + "";
  5221. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5222. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5223. }
  5224. updateSelf() {
  5225. let level = this.index + 1;
  5226. this.data = DataMgr.getPlaceBallLevel(level);
  5227. this.ui.starNode.c1.selectedIndex = this.data.star;
  5228. let isChallenge = cfgTable.placeballData[level].type;
  5229. if (this.data.isCur) {
  5230. if (isChallenge) {
  5231. this.ui.c1.selectedIndex = 5;
  5232. }
  5233. else {
  5234. this.ui.c1.selectedIndex = 2;
  5235. }
  5236. }
  5237. else {
  5238. if (this.data.play) {
  5239. if (this.data.star == 3) {
  5240. this.ui.c1.selectedIndex = 0;
  5241. }
  5242. else {
  5243. this.ui.c1.selectedIndex = 1;
  5244. }
  5245. }
  5246. else {
  5247. if (isChallenge) {
  5248. this.ui.c1.selectedIndex = 4;
  5249. }
  5250. else {
  5251. this.ui.c1.selectedIndex = 3;
  5252. }
  5253. }
  5254. }
  5255. }
  5256. clickSelf() {
  5257. if (!this.data.play)
  5258. return;
  5259. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5260. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5261. }
  5262. }
  5263. class UILevelDisplay extends UIBase {
  5264. constructor() {
  5265. super();
  5266. }
  5267. onConstructor() {
  5268. this.ui = ui_UILevelDisplay.createInstance();
  5269. this.contentPane = this.ui;
  5270. this.isEject = false;
  5271. this.myList = this.ui.myNode.myList;
  5272. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5273. this.levelItemArr = [];
  5274. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5275. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5276. this.myList.numItems = levelNum;
  5277. }
  5278. levelItemRender(index, target) {
  5279. let item = new PutBallLevelDisplay(target, index);
  5280. this.levelItemArr.push(item);
  5281. }
  5282. show() {
  5283. super.show();
  5284. this.updateLevel();
  5285. this.scrollToPlace();
  5286. this.setGlobalFont(this.ui);
  5287. }
  5288. updateLevel() {
  5289. let temp;
  5290. for (let index = 0; index < this.levelItemArr.length; index++) {
  5291. temp = this.levelItemArr[index];
  5292. temp.updateSelf();
  5293. }
  5294. }
  5295. scrollToPlace() {
  5296. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5297. let passArr = DataMgr.getPlaceBallLevelList();
  5298. let offest = passArr.length;
  5299. if (offest >= maxNum - 1)
  5300. offest = maxNum - 1;
  5301. this.myList.scrollToView(offest, true, true);
  5302. }
  5303. hide() {
  5304. super.hide();
  5305. }
  5306. }
  5307. UILevelDisplay.uiName = "UILevelDisplay";
  5308. class ui_UIMatching extends fgui.GComponent {
  5309. static createInstance() {
  5310. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5311. }
  5312. onConstruct() {
  5313. this.n5 = (this.getChild("n5"));
  5314. this.n49 = (this.getChild("n49"));
  5315. this.n51 = (this.getChild("n51"));
  5316. this.n64 = (this.getChild("n64"));
  5317. this.n2 = (this.getChild("n2"));
  5318. this.n53 = (this.getChild("n53"));
  5319. this.n54 = (this.getChild("n54"));
  5320. this.n56 = (this.getChild("n56"));
  5321. this.n58 = (this.getChild("n58"));
  5322. this.n59 = (this.getChild("n59"));
  5323. this.n57 = (this.getChild("n57"));
  5324. this.n60 = (this.getChild("n60"));
  5325. this.n62 = (this.getChild("n62"));
  5326. this.awardTxt = (this.getChild("awardTxt"));
  5327. this.n61 = (this.getChild("n61"));
  5328. this.selfHead = (this.getChild("selfHead"));
  5329. this.aiHead = (this.getChild("aiHead"));
  5330. this.n82 = (this.getChild("n82"));
  5331. this.n84 = (this.getChild("n84"));
  5332. this.n83 = (this.getChild("n83"));
  5333. this.t1 = this.getTransition("t1");
  5334. this.t2 = this.getTransition("t2");
  5335. this.t3 = this.getTransition("t3");
  5336. this.t4 = this.getTransition("t4");
  5337. }
  5338. }
  5339. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5340. class UIMatching extends UIBase {
  5341. constructor() {
  5342. super();
  5343. }
  5344. onConstructor() {
  5345. this.ui = ui_UIMatching.createInstance();
  5346. this.contentPane = this.ui;
  5347. this.isEject = false;
  5348. }
  5349. show(callback) {
  5350. super.show();
  5351. PlatMgr.showBanner(true);
  5352. this.callback = callback;
  5353. let user = Moyu.getUserInfo();
  5354. if (!this.selfPot) {
  5355. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5356. }
  5357. if (!this.aiPot) {
  5358. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5359. }
  5360. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5361. this.ui.selfHead.nameTxt.text = user.nickName;
  5362. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5363. this.ui.aiHead.nameTxt.text = "???";
  5364. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5365. this.ui.selfHead.c1.selectedIndex = 0;
  5366. this.ui.aiHead.c1.selectedIndex = 0;
  5367. this.ui.selfHead.x = this.selfPot.x;
  5368. this.ui.selfHead.y = this.selfPot.y;
  5369. this.ui.aiHead.x = this.aiPot.x;
  5370. this.ui.aiHead.y = this.aiPot.y;
  5371. switch (xGame.common.gameMode) {
  5372. case GameMode.classic:
  5373. break;
  5374. case GameMode.bigMove:
  5375. this.initSkillData();
  5376. break;
  5377. default:
  5378. break;
  5379. }
  5380. this.ui.t1.play(Laya.Handler.create(this, () => {
  5381. this.ui.t2.play(Laya.Handler.create(this, () => {
  5382. switch (xGame.common.gameMode) {
  5383. case GameMode.classic:
  5384. this.waitingPeople();
  5385. break;
  5386. case GameMode.bigMove:
  5387. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5388. break;
  5389. default:
  5390. break;
  5391. }
  5392. }));
  5393. }));
  5394. this.setGlobalFont(this.ui);
  5395. }
  5396. initSkillData() {
  5397. this.skillSelectData = [];
  5398. let skillUrl = xGame.common.skillIconList;
  5399. let skillName = xGame.common.skillNameList;
  5400. let skillLevel = DataMgr.getBigSkillList();
  5401. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5402. for (let index = 0; index < 5; index++) {
  5403. let obj = {};
  5404. obj.skillImg = skillUrl[index];
  5405. obj.skillName = skillName[index];
  5406. obj.skillType = skillType[index];
  5407. obj.skillLevel = skillLevel[index];
  5408. this.skillSelectData.push(obj);
  5409. }
  5410. }
  5411. getAISkillLevel(myLevel) {
  5412. let video = xGame.common.upSkillLevel;
  5413. let aiLevel;
  5414. let temp;
  5415. if (video) {
  5416. temp = xGame.common.randomNum(-2, -1);
  5417. }
  5418. else {
  5419. if (myLevel <= 5) {
  5420. temp = xGame.common.randomNum(1, 3);
  5421. }
  5422. else if (myLevel <= 9) {
  5423. temp = xGame.common.randomNum(-2, 1);
  5424. }
  5425. else {
  5426. temp = xGame.common.randomNum(-4, 0);
  5427. }
  5428. }
  5429. aiLevel = temp + myLevel;
  5430. if (aiLevel <= 1)
  5431. aiLevel = 1;
  5432. if (aiLevel >= 10)
  5433. aiLevel = 10;
  5434. return aiLevel;
  5435. }
  5436. getAISkillType() {
  5437. return xGame.common.randomNum(1, 4);
  5438. let successTimes = DataMgr.getSkillSuccessTimes();
  5439. let info = cfgTable.aiskillData[successTimes];
  5440. if (!info) {
  5441. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5442. info = cfgTable.aiskillData[max];
  5443. }
  5444. let dataArr = info.skillselect;
  5445. let myCfg = {};
  5446. for (let index = 0; index < dataArr.length; index++) {
  5447. let temp = dataArr[index].split('-');
  5448. myCfg[temp[0]] = {};
  5449. myCfg[temp[0]].id = parseInt(temp[0]);
  5450. myCfg[temp[0]].weight = parseInt(temp[1]);
  5451. }
  5452. let aiCfg = xGame.common.initWeight(myCfg);
  5453. let curData = xGame.common.getRandomWeightData(aiCfg);
  5454. return parseInt(curData.id);
  5455. }
  5456. getAISkillData(index) {
  5457. let myLevel = this.skillSelectData[index].skillLevel;
  5458. let aiLevel = this.getAISkillLevel(myLevel);
  5459. let aiType = this.getAISkillType() - 1;
  5460. return { aiLevel, aiType } = { aiLevel, aiType };
  5461. }
  5462. skillSelectFinish(index) {
  5463. let aiInfo = this.getAISkillData(index);
  5464. xGame.common.gameMgr.selfCurSkill = index;
  5465. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5466. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5467. this.ui.selfHead.c1.selectedIndex = 1;
  5468. this.ui.aiHead.c1.selectedIndex = 1;
  5469. let myData = this.skillSelectData[index];
  5470. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5471. let guide = DataMgr.getSkillGuide();
  5472. if (guide == 0) {
  5473. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5474. }
  5475. else {
  5476. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5477. }
  5478. let aiData = this.skillSelectData[aiInfo.aiType];
  5479. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5480. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5481. this.waitingPeople();
  5482. }
  5483. waitingPeople() {
  5484. let time = xGame.common.randomNum(1000, 3000);
  5485. time += 1000;
  5486. Laya.timer.once(time, this, () => {
  5487. this.matchingSuccess();
  5488. });
  5489. }
  5490. matchingSuccess() {
  5491. let gameUI = xGame.common.gameUI;
  5492. let name = gameUI.ui.topNode.aiNameTxt.text;
  5493. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5494. this.ui.aiHead.nameTxt.text = name;
  5495. this.ui.aiHead.headImg.url = url;
  5496. name = gameUI.ui.topNode.selfNameTxt.text;
  5497. url = gameUI.ui.topNode.selfHeadLoader.url;
  5498. this.ui.selfHead.nameTxt.text = name;
  5499. this.ui.selfHead.headImg.url = url;
  5500. this.ui.t3.play(Laya.Handler.create(this, () => {
  5501. this.callback && this.callback();
  5502. this.ui.t4.play(Laya.Handler.create(this, () => {
  5503. this.destroySelf();
  5504. }));
  5505. }));
  5506. }
  5507. destroySelf() {
  5508. this.callback = null;
  5509. this.skillSelectData = null;
  5510. this.selfPot = null;
  5511. this.aiPot = null;
  5512. if (!this.ui.isDisposed) {
  5513. this.ui.removeFromParent();
  5514. this.ui.dispose();
  5515. }
  5516. xGame.uiMgr.destroyUI(this);
  5517. }
  5518. }
  5519. UIMatching.uiName = "UIMatching";
  5520. class ui_UIRanking extends fgui.GComponent {
  5521. static createInstance() {
  5522. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5523. }
  5524. onConstruct() {
  5525. this.n26 = (this.getChild("n26"));
  5526. this.myNode = (this.getChild("myNode"));
  5527. }
  5528. }
  5529. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5530. class UIRanking extends UIBase {
  5531. constructor() {
  5532. super();
  5533. this.showSelf = true;
  5534. this.rankType = 1;
  5535. this.rankList = [];
  5536. this.topX = 10;
  5537. this.myIndex = this.topX + 1;
  5538. this.myStar = 0;
  5539. }
  5540. onConstructor() {
  5541. this.ui = ui_UIRanking.createInstance();
  5542. this.contentPane = this.ui;
  5543. this.isEject = false;
  5544. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5545. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5546. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5547. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5548. this.ui.myNode.myList.setVirtual();
  5549. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5550. }
  5551. show() {
  5552. super.show();
  5553. this.getPaiHangBangDataFormJosnFile();
  5554. this.updateSelf();
  5555. let self = Moyu.getUserInfo();
  5556. if (!self.isAuth) {
  5557. Moyu.initUser(this, () => {
  5558. DataMgr.upRankData();
  5559. });
  5560. }
  5561. this.setGlobalFont(this.ui);
  5562. }
  5563. getPaiHangBangDataFormJosnFile() {
  5564. const rankingList = cfgTable.paiHangBangData.list;
  5565. this.updateItemData(rankingList);
  5566. }
  5567. updateSelfItem() {
  5568. console.log('zh:Moyu.platType =' + Moyu.platType);
  5569. let self = Moyu.getUserInfo();
  5570. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5571. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5572. if (this.myIndex > this.topX) {
  5573. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5574. }
  5575. else {
  5576. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5577. }
  5578. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5579. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5580. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5581. }
  5582. updateItemData(data) {
  5583. this.myStar = xGame.common.getAllStarNum();
  5584. if (this.rankList.length < 2) {
  5585. this.rankList = data;
  5586. let self = Moyu.getUserInfo();
  5587. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5588. self.headIcon = self.headIcon;
  5589. for (let i = 0; i < data.length; i++) {
  5590. let data = this.rankList[i];
  5591. if (data.userId == self.userId) {
  5592. this.rankList.splice(i, 1);
  5593. break;
  5594. }
  5595. }
  5596. for (let i = 0; i < data.length; i++) {
  5597. let data = this.rankList[i];
  5598. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5599. this.myIndex = i + 1;
  5600. let user = { headIcon: self.headIcon, nickName: "myself" };
  5601. let ud = { user: user, data: {} };
  5602. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5603. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5604. if (Moyu.platType < 11) {
  5605. user.headIcon = self.headIcon;
  5606. user.nickName = self.nickName;
  5607. }
  5608. this.rankList.splice(i, 0, md);
  5609. break;
  5610. }
  5611. }
  5612. }
  5613. this.updateSelfItem();
  5614. this.ui.myNode.myList.numItems = this.rankList.length;
  5615. }
  5616. updateItemUI(index, obj) {
  5617. let data = this.rankList[index];
  5618. let userData = JSON.parse(data.userData).user;
  5619. obj.nameTxt.text = userData.nickName.toString();
  5620. obj.valueTxt.text = data.rankScore;
  5621. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5622. obj.rankTxt.text = index + 1;
  5623. switch (index) {
  5624. case 0:
  5625. this.setImg(obj, 1, 0, 0);
  5626. obj.rankTxt.color = "#FFC047";
  5627. break;
  5628. case 1:
  5629. this.setImg(obj, 0, 1, 0);
  5630. obj.rankTxt.color = "#ACACAC";
  5631. break;
  5632. case 2:
  5633. this.setImg(obj, 0, 0, 1);
  5634. obj.rankTxt.color = "#D09672";
  5635. break;
  5636. default:
  5637. this.setImg(obj, 0, 0, 0);
  5638. obj.rankTxt.color = "#496FAB";
  5639. break;
  5640. }
  5641. }
  5642. setImg(obj, a, b, c) {
  5643. obj.img1.visible = a ? true : false;
  5644. obj.img2.visible = b ? true : false;
  5645. obj.img3.visible = c ? true : false;
  5646. }
  5647. changeList(type) {
  5648. this.rankType = type;
  5649. this.updateSelf();
  5650. }
  5651. changeSelfNode() {
  5652. this.showSelf = !this.showSelf;
  5653. this.updateSelf();
  5654. }
  5655. updateSelf() {
  5656. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5657. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5658. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5659. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5660. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5661. }
  5662. }
  5663. UIRanking.uiName = "UIRanking";
  5664. class ui_UISecretary extends fgui.GComponent {
  5665. static createInstance() {
  5666. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5667. }
  5668. onConstruct() {
  5669. this.n0 = (this.getChild("n0"));
  5670. this.myNode = (this.getChild("myNode"));
  5671. this.closeBtn = (this.getChild("closeBtn"));
  5672. this.t0 = this.getTransition("t0");
  5673. }
  5674. }
  5675. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5676. class UISecretary extends UIBase {
  5677. constructor() {
  5678. super();
  5679. this.curIndex = 1;
  5680. }
  5681. onConstructor() {
  5682. this.ui = ui_UISecretary.createInstance();
  5683. this.contentPane = this.ui;
  5684. this.isEject = false;
  5685. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5686. this.nodeObj = { left: null, right: null, cur: null };
  5687. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5688. }
  5689. show() {
  5690. super.show();
  5691. this.ui.t0.play();
  5692. this.updateData();
  5693. this.setGlobalFont(this.ui);
  5694. }
  5695. addSecretarySpine(node, spineName) {
  5696. if (spineName == "mishu") {
  5697. if (this.secretarySpine1) {
  5698. node.displayObject.destroyChildren();
  5699. this.playWoman(this.secretarySpine1, node.displayObject);
  5700. }
  5701. else {
  5702. let spine1 = new SpineMgr("mishu", () => {
  5703. this.secretarySpine1 = spine1;
  5704. this.playWoman(this.secretarySpine1, node.displayObject);
  5705. });
  5706. }
  5707. }
  5708. else {
  5709. if (this.secretarySpine2) {
  5710. node.displayObject.destroyChildren();
  5711. this.playWoman(this.secretarySpine2, node.displayObject);
  5712. }
  5713. else {
  5714. let spine2 = new SpineMgr("xiaomishu2", () => {
  5715. this.secretarySpine2 = spine2;
  5716. this.playWoman(this.secretarySpine2, node.displayObject);
  5717. });
  5718. }
  5719. }
  5720. }
  5721. playWoman(node, parent) {
  5722. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5723. let yy = this.ui.myNode.gameNode3.secretary.height;
  5724. let scale = 1.5;
  5725. if (node == this.secretarySpine2) {
  5726. scale = 1.2;
  5727. }
  5728. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5729. node.play(data, 0, true, parent);
  5730. }
  5731. turnLeft() {
  5732. this.curIndex--;
  5733. if (this.curIndex < 1) {
  5734. this.curIndex = 2;
  5735. }
  5736. let left = this.nodeObj.left;
  5737. let right = this.nodeObj.right;
  5738. let cur = this.nodeObj.cur;
  5739. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5740. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5741. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5742. this.updateData();
  5743. }));
  5744. this.ui.myNode.setChildIndex(right, 2);
  5745. this.nodeObj.left = cur;
  5746. this.nodeObj.right = left;
  5747. this.nodeObj.cur = right;
  5748. }
  5749. turnRight() {
  5750. this.curIndex++;
  5751. if (this.curIndex > 2) {
  5752. this.curIndex = 1;
  5753. }
  5754. let left = this.nodeObj.left;
  5755. let right = this.nodeObj.right;
  5756. let cur = this.nodeObj.cur;
  5757. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5758. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5759. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5760. this.updateData();
  5761. }));
  5762. this.ui.myNode.setChildIndex(left, 2);
  5763. this.nodeObj.left = right;
  5764. this.nodeObj.right = cur;
  5765. this.nodeObj.cur = left;
  5766. }
  5767. updateData() {
  5768. console.log('zh: updateData FFFFFFFFFF');
  5769. let data = cfgTable.secretaryshopData;
  5770. let children = this.ui.myNode._children;
  5771. let temp;
  5772. let curData;
  5773. for (let index = 0; index < children.length; index++) {
  5774. temp = children[index];
  5775. curData = data[1];
  5776. temp.heightTxt.text = curData.height;
  5777. temp.foodTxt.text = curData.food;
  5778. temp.historyTxt.text = curData.history;
  5779. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5780. this.addSecretarySpine(temp.secretary, curData.spine);
  5781. let womanIndex = curData.id - 1;
  5782. let getWoman = DataMgr.getSecretary(womanIndex);
  5783. let curUse = DataMgr.getCurSecretary();
  5784. if (getWoman) {
  5785. if (curUse == womanIndex) {
  5786. temp.purchaseBtn.c1.selectedIndex = 1;
  5787. }
  5788. else {
  5789. temp.purchaseBtn.c1.selectedIndex = 2;
  5790. }
  5791. }
  5792. else {
  5793. temp.purchaseBtn.c1.selectedIndex = 0;
  5794. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5795. }
  5796. temp.purchaseBtn.visible = false;
  5797. }
  5798. }
  5799. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5800. console.log('zh: 点击了clickSecretary ');
  5801. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5802. if (getWoman) {
  5803. if (curUse != womanIndex) {
  5804. console.log();
  5805. DataMgr.setCurSecretary(womanIndex);
  5806. this.updateData();
  5807. }
  5808. }
  5809. else {
  5810. console.log('zh:点击购买了');
  5811. let need = needDiamond;
  5812. if (DataMgr.diamondEnough(need)) {
  5813. DataMgr.setDiamond(-need);
  5814. DataMgr.setSecretary(womanIndex, 1);
  5815. DataMgr.setCurSecretary(womanIndex);
  5816. this.updateData();
  5817. }
  5818. else {
  5819. xGame.uiMgr.Show(UIAddProp, 1);
  5820. }
  5821. }
  5822. }
  5823. closeSelf() {
  5824. this.hide();
  5825. }
  5826. }
  5827. UISecretary.uiName = "UISecretary";
  5828. class ui_UIShop extends fgui.GComponent {
  5829. static createInstance() {
  5830. return (fgui.UIPackage.createObject("game", "UIShop"));
  5831. }
  5832. onConstruct() {
  5833. this.n48 = (this.getChild("n48"));
  5834. this.n0 = (this.getChild("n0"));
  5835. this.secretary = (this.getChild("secretary"));
  5836. this.talkNode = (this.getChild("talkNode"));
  5837. this.closeNode = (this.getChild("closeNode"));
  5838. this.moneyNode = (this.getChild("moneyNode"));
  5839. this.myNode = (this.getChild("myNode"));
  5840. }
  5841. }
  5842. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5843. class ui_UIMsg extends fgui.GComponent {
  5844. static createInstance() {
  5845. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5846. }
  5847. onConstruct() {
  5848. this.tipsNode = (this.getChild("tipsNode"));
  5849. }
  5850. }
  5851. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5852. class UIMsg extends UIBase {
  5853. constructor() {
  5854. super();
  5855. }
  5856. onConstructor() {
  5857. this.ui = ui_UIMsg.createInstance();
  5858. this.contentPane = this.ui;
  5859. this.isEject = false;
  5860. this.isMuti = true;
  5861. }
  5862. show(msg, callback) {
  5863. super.show();
  5864. this.ui.tipsNode.msgTxt.text = msg;
  5865. this.ui.alpha = 1;
  5866. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5867. this.hide();
  5868. callback && callback();
  5869. }), 1000);
  5870. this.setGlobalFont(this.ui);
  5871. }
  5872. }
  5873. UIMsg.uiName = "UIMsg";
  5874. class BallRodDisplay {
  5875. constructor(ui, index) {
  5876. this.index = 0;
  5877. this.uiIndex = 0;
  5878. this.ui = ui;
  5879. this.index = index;
  5880. this.initData();
  5881. }
  5882. initData() {
  5883. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5884. let data = cfgTable.ballrodData[this.index + 1];
  5885. this.ui.nameTxt.text = data.name;
  5886. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5887. this.ui.levelNode.c1.selectedIndex = data.quality;
  5888. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5889. if (data.spine) {
  5890. this.mySpine = new SpineMgr(data.spine, () => {
  5891. let xx = 150;
  5892. let yy = 70;
  5893. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5894. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5895. });
  5896. }
  5897. }
  5898. updateSelf() {
  5899. let get = DataMgr.getBallRod(this.index);
  5900. if (get == null)
  5901. get = 1;
  5902. let curUse = DataMgr.getCurBallRod();
  5903. if (get) {
  5904. if (curUse == this.index) {
  5905. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5906. }
  5907. else {
  5908. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5909. }
  5910. }
  5911. else {
  5912. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5913. }
  5914. }
  5915. buyBallRod() {
  5916. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5917. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5918. switch (selectedIndex) {
  5919. case 0:
  5920. break;
  5921. case 1:
  5922. console.log('zh:点击了 USE THIS');
  5923. DataMgr.setCurBallRod(this.index);
  5924. let curUse = DataMgr.getCurBallRod();
  5925. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5926. let ui = xGame.uiMgr.getUI(UIShop);
  5927. ui.updateBallRod();
  5928. break;
  5929. case 2:
  5930. let data = cfgTable.ballrodData[this.index + 1];
  5931. let need = data.price;
  5932. if (DataMgr.diamondEnough(need)) {
  5933. this.buyQiuGan(data);
  5934. DataMgr.setDiamond(-need);
  5935. DataMgr.setBallRod(this.index, 1);
  5936. DataMgr.setCurBallRod(this.index);
  5937. let ui = xGame.uiMgr.getUI(UIShop);
  5938. ui.updateBallRod();
  5939. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5940. }
  5941. else {
  5942. xGame.uiMgr.Show(UIAddProp, 1);
  5943. }
  5944. break;
  5945. default:
  5946. break;
  5947. }
  5948. }
  5949. buyQiuGan(qgItem) {
  5950. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5951. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5952. if (userInfo == null) {
  5953. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5954. return;
  5955. }
  5956. let reqData = xGame.httpMgr.getReqData();
  5957. let pd = JSON.parse(reqData);
  5958. pd.qiuGanData = qgItem;
  5959. reqData = JSON.stringify(pd);
  5960. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5961. try {
  5962. console.log('zh:buySp res = ' + JSON.stringify(res));
  5963. let code = res.code;
  5964. let msg = res.msg;
  5965. if (code == 401) {
  5966. Laya.LocalStorage.removeItem(keyForLoginInfo);
  5967. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  5968. return;
  5969. }
  5970. if (code == 200) {
  5971. xGame.uiMgr.Show(UIMsg, msg);
  5972. DataMgr.getUserZiChanInfo(false);
  5973. }
  5974. else {
  5975. xGame.uiMgr.Show(UIMsg, msg);
  5976. }
  5977. }
  5978. catch (error) {
  5979. console.log('error=' + error);
  5980. alert(error);
  5981. }
  5982. finally {
  5983. }
  5984. });
  5985. }
  5986. logEventForGouMaiGan(qiuGanName) {
  5987. const ev = {
  5988. value: qiuGanName
  5989. };
  5990. const jsonStr = JSON.stringify(ev);
  5991. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  5992. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  5993. }
  5994. }
  5995. class DaoJuDisplay {
  5996. constructor(ui, index) {
  5997. this.index = 0;
  5998. this.uiIndex = 0;
  5999. this.ggSpid = "";
  6000. this.spid = 0;
  6001. this.ui = ui;
  6002. this.index = index;
  6003. this.initData();
  6004. }
  6005. initData() {
  6006. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6007. let data = cfgTable.daoJuData[this.index + 1];
  6008. this.ui.nameTxt.text = data.spbt;
  6009. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6010. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6011. this.ggSpid = data.ggSpid;
  6012. this.spid = data.spid;
  6013. let baseUrl = "asset/sound/ogg/";
  6014. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6015. }
  6016. gotoBuy() {
  6017. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6018. if (userInfo != null) {
  6019. let token = userInfo.token;
  6020. let ggSpid = this.ggSpid;
  6021. let spid = this.spid;
  6022. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6023. console.log('zh:gotoBuy1 spid =' + spid);
  6024. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6025. return;
  6026. }
  6027. else {
  6028. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6029. }
  6030. }
  6031. gotoBuy1() {
  6032. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6033. let djItem = cfgTable.daoJuData[this.index + 1];
  6034. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6035. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6036. if (userInfo == null) {
  6037. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6038. return;
  6039. }
  6040. let reqData = xGame.httpMgr.getReqData();
  6041. let pd = JSON.parse(reqData);
  6042. pd.spItem = djItem;
  6043. reqData = JSON.stringify(pd);
  6044. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6045. try {
  6046. console.log('zh:buySp res = ' + JSON.stringify(res));
  6047. let code = res.code;
  6048. let msg = res.msg;
  6049. if (code == 401) {
  6050. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6051. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6052. return;
  6053. }
  6054. if (code == 200) {
  6055. xGame.uiMgr.Show(UIMsg, msg);
  6056. DataMgr.getUserZiChanInfo(false);
  6057. }
  6058. else {
  6059. xGame.uiMgr.Show(UIMsg, msg);
  6060. }
  6061. }
  6062. catch (error) {
  6063. console.log('error=' + error);
  6064. alert(error);
  6065. }
  6066. finally {
  6067. }
  6068. });
  6069. }
  6070. }
  6071. class UIShop extends UIBase {
  6072. constructor() {
  6073. super();
  6074. this.itemNums = 0;
  6075. this.itemNumsForDj = 0;
  6076. this.curType = "";
  6077. }
  6078. onConstructor() {
  6079. this.ui = ui_UIShop.createInstance();
  6080. this.contentPane = this.ui;
  6081. this.isEject = false;
  6082. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6083. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6084. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6085. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6086. this.addUIClick(this.ui, this.interuptSecretary);
  6087. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6088. this.ballRodArr = [];
  6089. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6090. this.ui.myNode.myList.numItems = this.itemNums;
  6091. this.loadDjdata_old();
  6092. }
  6093. loadDjdata_old() {
  6094. let fff = cfgTable.daoJuData;
  6095. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6096. this.daoJuArr = [];
  6097. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6098. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6099. }
  6100. getProductList() {
  6101. let reqData = xGame.httpMgr.getReqData();
  6102. let pd = JSON.parse(reqData);
  6103. pd.splx = "Consumable";
  6104. reqData = JSON.stringify(pd);
  6105. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6106. try {
  6107. let code = res.code;
  6108. let msg = res.msg;
  6109. if (code == 401) {
  6110. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6111. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6112. return;
  6113. }
  6114. if (code == 200) {
  6115. let data = res.data;
  6116. for (let index = 0; index < data.length; index++) {
  6117. let element = data[index];
  6118. cfgTable.daoJuData[element.spid] = element;
  6119. }
  6120. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6121. }
  6122. else {
  6123. xGame.uiMgr.Show(UIMsg, msg);
  6124. }
  6125. }
  6126. catch (error) {
  6127. console.log('error=' + error);
  6128. alert(error);
  6129. }
  6130. finally {
  6131. }
  6132. });
  6133. }
  6134. show(type) {
  6135. super.show();
  6136. this.curType = type == 0 ? "qiugan" : "daoju";
  6137. this.switchBtn("");
  6138. this.playSecretaryIdle();
  6139. this.updateBallRod();
  6140. this.setGlobalFont(this.ui);
  6141. }
  6142. test123() {
  6143. console.log('zh:test123 ');
  6144. }
  6145. switchBtn(type) {
  6146. console.log('zh:1111切換 sel type=' + type);
  6147. if (type == "") {
  6148. type = this.curType;
  6149. }
  6150. else {
  6151. if (this.curType == type) {
  6152. return;
  6153. }
  6154. else {
  6155. this.curType = type;
  6156. }
  6157. }
  6158. if (type == "qiugan") {
  6159. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6160. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6161. this.ui.myNode.c1.selectedIndex = 0;
  6162. this.ui.myNode.myList.visible = true;
  6163. this.ui.myNode.djList.visible = false;
  6164. }
  6165. else {
  6166. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6167. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6168. this.ui.myNode.c1.selectedIndex = 1;
  6169. this.ui.myNode.myList.visible = false;
  6170. this.ui.myNode.djList.visible = true;
  6171. }
  6172. }
  6173. updateBallRod() {
  6174. for (let index = 0; index < this.ballRodArr.length; index++) {
  6175. this.ballRodArr[index].updateSelf();
  6176. }
  6177. }
  6178. renderBallRod(sort, obj) {
  6179. let index = this.getIndexBySort(sort + 1) - 1;
  6180. let ballRod = new BallRodDisplay(obj, index);
  6181. this.ballRodArr.push(ballRod);
  6182. }
  6183. renderDaoJu(idx, obj) {
  6184. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6185. let b = new DaoJuDisplay(obj, index);
  6186. this.daoJuArr.push(b);
  6187. }
  6188. getIndexBySort(sort) {
  6189. let object = cfgTable.ballrodData;
  6190. for (const key in object) {
  6191. if (object[key].sort == sort) {
  6192. return parseInt(key);
  6193. }
  6194. }
  6195. }
  6196. getIndexBySortForDj(idx) {
  6197. let object = cfgTable.daoJuData;
  6198. for (const key in object) {
  6199. if (object[key].idx == idx) {
  6200. return parseInt(key);
  6201. }
  6202. }
  6203. }
  6204. playSecretaryIdle() {
  6205. let parent = this.ui.secretary.displayObject;
  6206. parent.destroyChildren();
  6207. let xx = this.ui.secretary.width / 2;
  6208. let yy = this.ui.secretary.height;
  6209. let scale = xGame.common.getSecretaryScale();
  6210. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6211. xGame.common.secretary.play(data, 0, true, parent);
  6212. }
  6213. interuptSecretary() {
  6214. Laya.timer.clearAll(this);
  6215. this.playSecretaryRandomSound();
  6216. }
  6217. playSecretaryRandomSound() {
  6218. if (this.isHide)
  6219. return;
  6220. let time = xGame.common.randomNum(45000, 60000);
  6221. Laya.timer.once(time, this, () => {
  6222. if (this.isHide)
  6223. return;
  6224. let index = xGame.common.randomNum(4, 7);
  6225. xGame.soundMgr.playSound("s_main0" + index);
  6226. let words = 1;
  6227. switch (index) {
  6228. case 4:
  6229. words = 5;
  6230. break;
  6231. case 5:
  6232. words = 3;
  6233. break;
  6234. case 6:
  6235. words = 6;
  6236. break;
  6237. case 7:
  6238. words = 7;
  6239. break;
  6240. default:
  6241. break;
  6242. }
  6243. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6244. this.playSecretaryRandomSound();
  6245. });
  6246. }
  6247. closeSelf() {
  6248. this.hide();
  6249. }
  6250. }
  6251. UIShop.uiName = "UIShop";
  6252. class ui_UISign extends fgui.GComponent {
  6253. static createInstance() {
  6254. return (fgui.UIPackage.createObject("game", "UISign"));
  6255. }
  6256. onConstruct() {
  6257. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6258. this.n6 = (this.getChild("n6"));
  6259. this.closeNode = (this.getChild("closeNode"));
  6260. this.myNode = (this.getChild("myNode"));
  6261. this.moneyNode = (this.getChild("moneyNode"));
  6262. this.secretary = (this.getChild("secretary"));
  6263. this.talkNode = (this.getChild("talkNode"));
  6264. this.tripleBtn = (this.getChild("tripleBtn"));
  6265. this.normalBtn = (this.getChild("normalBtn"));
  6266. this.tipsNode = (this.getChild("tipsNode"));
  6267. this.againBtn = (this.getChild("againBtn"));
  6268. this.t0 = this.getTransition("t0");
  6269. }
  6270. }
  6271. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6272. class SignMax {
  6273. constructor(ui) {
  6274. this.ui = ui;
  6275. }
  6276. updateSelf(index, sameDay, curDayIndex) {
  6277. let data = cfgTable.signData[index + 1];
  6278. this.ui.titleTxt.text = data.title;
  6279. let arr1 = data.award[0].split('-');
  6280. let arr2 = data.award[1].split('-');
  6281. let num1 = parseInt(arr1[1]);
  6282. let num2 = parseInt(arr2[1]);
  6283. this.ui.numTxt1.text = num1 + "";
  6284. this.ui.numTxt2.text = num2 + "";
  6285. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6286. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6287. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6288. this.ui.numTxt1.visible = false;
  6289. }
  6290. else {
  6291. this.ui.numTxt1.visible = true;
  6292. }
  6293. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6294. this.ui.numTxt2.visible = false;
  6295. }
  6296. else {
  6297. this.ui.numTxt2.visible = true;
  6298. }
  6299. if (index < curDayIndex) {
  6300. this.ui.c1.selectedIndex = 1;
  6301. }
  6302. else if (index == curDayIndex) {
  6303. if (sameDay) {
  6304. this.ui.c1.selectedIndex = 2;
  6305. }
  6306. else {
  6307. this.ui.c1.selectedIndex = 2;
  6308. }
  6309. }
  6310. else {
  6311. this.ui.c1.selectedIndex = 0;
  6312. }
  6313. }
  6314. }
  6315. class SignNormal {
  6316. constructor(ui) {
  6317. this.ui = ui;
  6318. }
  6319. updateSelf(index, sameDay, curDayIndex) {
  6320. let data = cfgTable.signData[index + 1];
  6321. this.ui.titleTxt.text = data.title;
  6322. let arr = data.award[0].split('-');
  6323. let type = parseInt(arr[0]);
  6324. let num = parseInt(arr[1]);
  6325. this.ui.numTxt.text = num + "";
  6326. if (type > 2) {
  6327. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6328. this.ui.myIcon.rotation = 0;
  6329. }
  6330. else {
  6331. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6332. this.ui.myIcon.rotation = 0;
  6333. }
  6334. if (xGame.common.signAwardContainsRod(data.award)) {
  6335. this.ui.numTxt.visible = false;
  6336. }
  6337. else {
  6338. this.ui.numTxt.visible = true;
  6339. }
  6340. if (index < curDayIndex) {
  6341. this.ui.c1.selectedIndex = 1;
  6342. }
  6343. else if (index == curDayIndex) {
  6344. if (sameDay) {
  6345. this.ui.c1.selectedIndex = 2;
  6346. }
  6347. else {
  6348. this.ui.c1.selectedIndex = 2;
  6349. }
  6350. }
  6351. else {
  6352. this.ui.c1.selectedIndex = 0;
  6353. }
  6354. }
  6355. }
  6356. class UISign extends UIBase {
  6357. constructor() {
  6358. super();
  6359. this.curDayIndex = 0;
  6360. this.starX = 0;
  6361. }
  6362. onConstructor() {
  6363. this.ui = ui_UISign.createInstance();
  6364. this.contentPane = this.ui;
  6365. this.isEject = false;
  6366. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6367. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6368. this.initSignItem();
  6369. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6370. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6371. }
  6372. show() {
  6373. super.show();
  6374. this.ui.t0.play();
  6375. this.playSecretaryIdle();
  6376. this.updateSign();
  6377. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6378. this.setGlobalFont(this.ui);
  6379. }
  6380. initSignItem() {
  6381. this.signArr = [];
  6382. for (let index = 0; index < 6; index++) {
  6383. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6384. this.signArr.push(temp);
  6385. }
  6386. this.signMax = new SignMax(this.ui.myNode.day7);
  6387. if (Moyu.isKs)
  6388. this.ui.closeNode.closeBtn.x += 100;
  6389. }
  6390. updateSign() {
  6391. let sameDay = xGame.common.judgeSameDay();
  6392. let max = 7;
  6393. this.curDayIndex = DataMgr.getSignData();
  6394. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6395. this.curDayIndex = 0;
  6396. if (!sameDay) {
  6397. this.ui.normalBtn.visible = true;
  6398. this.ui.tipsNode.visible = false;
  6399. this.ui.againBtn.visible = false;
  6400. }
  6401. else {
  6402. this.ui.normalBtn.visible = false;
  6403. let again = DataMgr.getExtraSign();
  6404. let isCurrency = false;
  6405. let index = this.curDayIndex;
  6406. if (index == 0)
  6407. index = 7;
  6408. let award = cfgTable.signData[index].award;
  6409. let num = award[0].split("-")[0];
  6410. if (num == "1" || num == "2")
  6411. isCurrency = true;
  6412. let showAgain = again == 0 && isCurrency;
  6413. this.ui.againBtn.visible = showAgain;
  6414. this.ui.tipsNode.visible = !showAgain;
  6415. }
  6416. for (let index = 0; index < this.signArr.length; index++) {
  6417. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6418. }
  6419. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6420. }
  6421. playSecretaryIdle() {
  6422. let parent = this.ui.secretary.displayObject;
  6423. parent.destroyChildren();
  6424. let xx = this.ui.secretary.width / 2;
  6425. let yy = this.ui.secretary.height;
  6426. let scale = xGame.common.getSecretaryScale();
  6427. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6428. xGame.common.secretary.play(data, 0, true, parent);
  6429. }
  6430. closeSelf() {
  6431. this.hide();
  6432. }
  6433. normalGetAward() {
  6434. let sameDay = xGame.common.judgeSameDay();
  6435. if (!sameDay) {
  6436. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6437. let temp;
  6438. let type;
  6439. let num;
  6440. let arr = [];
  6441. for (let index = 0; index < award.length; index++) {
  6442. temp = award[index].split("-");
  6443. type = parseInt(temp[0]);
  6444. num = parseInt(temp[1]);
  6445. let awardType = new AwardType();
  6446. awardType.num = num;
  6447. awardType.type = type;
  6448. arr.push(awardType);
  6449. }
  6450. xGame.common.getAward(arr, (watchVideo) => {
  6451. this.curDayIndex++;
  6452. if (this.curDayIndex > 7)
  6453. this.curDayIndex = 0;
  6454. DataMgr.setSignData(this.curDayIndex);
  6455. this.updateSignData2Server(this.curDayIndex);
  6456. DataMgr.setSignTime(new Date().getTime());
  6457. if (watchVideo) {
  6458. DataMgr.setExtraSign(1);
  6459. Moyu.sendDataEvent("signIn1");
  6460. }
  6461. this.updateSign();
  6462. });
  6463. }
  6464. }
  6465. againGetAward() {
  6466. Moyu.sendDataEvent("signIn2");
  6467. console.log('zh:qjff_AD_for_uisign');
  6468. if (Laya.Browser.onAndroid) {
  6469. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6470. if (!boo) {
  6471. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6472. return;
  6473. }
  6474. }
  6475. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6476. }
  6477. else {
  6478. console.log('zh:AD 失败,直接发放奖励');
  6479. this.qjff_AD_for_uisign();
  6480. }
  6481. }
  6482. qjff_AD_for_uisign() {
  6483. let index = this.curDayIndex;
  6484. if (index == 0)
  6485. index = 7;
  6486. let award = cfgTable.signData[index].award;
  6487. let temp;
  6488. let type;
  6489. let num;
  6490. for (let index = 0; index < award.length; index++) {
  6491. temp = award[index].split("-");
  6492. type = parseInt(temp[0]);
  6493. num = parseInt(temp[1]) * 3;
  6494. xGame.common.playObjFlyAnim(num, type);
  6495. }
  6496. DataMgr.setExtraSign(1);
  6497. this.updateSign();
  6498. }
  6499. updateSignData2Server(day) {
  6500. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6501. if (userInfo == null) {
  6502. return;
  6503. }
  6504. let reqData = xGame.httpMgr.getReqData();
  6505. let pd = JSON.parse(reqData);
  6506. pd.signData = day;
  6507. reqData = JSON.stringify(pd);
  6508. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6509. try {
  6510. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6511. let code = res.code;
  6512. let msg = res.msg;
  6513. if (code == 401) {
  6514. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6515. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6516. return;
  6517. }
  6518. if (code == 200) {
  6519. let data = res.data;
  6520. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6521. }
  6522. else {
  6523. xGame.uiMgr.Show(UIMsg, msg);
  6524. }
  6525. }
  6526. catch (error) {
  6527. console.log('error=' + error);
  6528. alert(error);
  6529. }
  6530. finally {
  6531. }
  6532. });
  6533. }
  6534. }
  6535. UISign.uiName = "UISign";
  6536. class ui_UISkill extends fgui.GComponent {
  6537. static createInstance() {
  6538. return (fgui.UIPackage.createObject("game", "UISkill"));
  6539. }
  6540. onConstruct() {
  6541. this.n48 = (this.getChild("n48"));
  6542. this.n0 = (this.getChild("n0"));
  6543. this.secretary = (this.getChild("secretary"));
  6544. this.talkNode = (this.getChild("talkNode"));
  6545. this.closeNode = (this.getChild("closeNode"));
  6546. this.moneyNode = (this.getChild("moneyNode"));
  6547. this.skillNode = (this.getChild("skillNode"));
  6548. this.guideNode = (this.getChild("guideNode"));
  6549. }
  6550. }
  6551. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6552. class SkillDisplay {
  6553. constructor(ui, data, uiIndex) {
  6554. this.starX = 0;
  6555. this.starY = 0;
  6556. this.index = 0;
  6557. this.ui = ui;
  6558. this.data = data;
  6559. this.index = uiIndex;
  6560. this.initSelf();
  6561. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6562. }
  6563. initSelf() {
  6564. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6565. this.ui.nameTxt.text = this.data.name;
  6566. this.ui.describeTxt.text = this.data.describe;
  6567. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6568. this.ui.startBtn.onClick(this, this.startGame);
  6569. this.updateSelf();
  6570. }
  6571. updateSelf() {
  6572. this.checkTry();
  6573. let level = DataMgr.getBigSkillByIndex(this.index);
  6574. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6575. }
  6576. checkTry() {
  6577. let index = this.index;
  6578. let level = DataMgr.getBigSkillByIndex(index);
  6579. if (level == null) {
  6580. DataMgr.setBigSkill(index, 1, false);
  6581. level = 1;
  6582. }
  6583. this.ui.levelTxt.text = "LV." + level;
  6584. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6585. this.ui.tryNode.visible = true;
  6586. else
  6587. this.ui.tryNode.visible = false;
  6588. }
  6589. clickAddLevel() {
  6590. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6591. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6592. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6593. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6594. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6595. }
  6596. else {
  6597. console.log('zh:AD 失败,直接发放奖励');
  6598. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6599. }
  6600. }
  6601. qjff_AD_for_skilldisplay_clickAddLevel() {
  6602. DataMgr.setBigSkill(this.data.index, 1);
  6603. this.updateSelf();
  6604. xGame.common.upSkillLevel = true;
  6605. }
  6606. startGame() {
  6607. console.log('zh:rod skill startgame');
  6608. if (this.data.index == 3) {
  6609. alert('Coming soon!');
  6610. return;
  6611. }
  6612. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6613. let needCoin = xGame.common.bigMoveNeedCoin;
  6614. xGame.common.passAwardCoin = 2000;
  6615. let guide = DataMgr.getSkillGuide();
  6616. console.log('zh:startGame guide=' + guide);
  6617. xGame.common.temSelfLevel = 0;
  6618. if (guide == 0) {
  6619. needCoin = 0;
  6620. xGame.common.temSelfLevel = 100;
  6621. }
  6622. if (DataMgr.coinEnough(needCoin)) {
  6623. DataMgr.setCoin(-needCoin);
  6624. xGame.common.curPlayerSkillType = this.index;
  6625. if (guide == 0)
  6626. xGame.common.curPlayerSkillType = 0;
  6627. console.log('zh: skilldisplay 1');
  6628. xGame.uiMgr.Show(UIGame);
  6629. xGame.uiMgr.Hide(UIMain);
  6630. xGame.uiMgr.Show(UIMatching, () => {
  6631. xGame.common.gameUI.ui.alpha = 1;
  6632. xGame.common.gameUI.startGame();
  6633. xGame.uiMgr.Hide(UISkill);
  6634. });
  6635. this.logEventForRod_start();
  6636. }
  6637. else {
  6638. console.log('zh: skilldisplay 2');
  6639. xGame.uiMgr.Show(UIAddProp, 0);
  6640. Moyu.sendDataEvent("AddCoinVideo");
  6641. }
  6642. }
  6643. logEventForRod_start() {
  6644. let gfmsIdx = xGame.common.curPlayerSkillType;
  6645. console.log('zh:选择的技能=' + gfmsIdx);
  6646. let gfmc = 'Skyfall Shot';
  6647. if (gfmsIdx == 0) {
  6648. gfmc = 'Skyfall Shot';
  6649. }
  6650. if (gfmsIdx == 1) {
  6651. gfmc = 'Surging break';
  6652. }
  6653. if (gfmsIdx == 2) {
  6654. gfmc = 'Frost Lock';
  6655. }
  6656. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6657. let jsonStr = {
  6658. "count": 0,
  6659. "name": gfmc
  6660. };
  6661. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6662. const d = LocalStorageManager.getItem(keyStr);
  6663. jsonStr.count = d.count + 1;
  6664. LocalStorageManager.setItem(keyStr, jsonStr);
  6665. }
  6666. else {
  6667. LocalStorageManager.setItem(keyStr, jsonStr);
  6668. }
  6669. const reqStr = JSON.stringify(jsonStr);
  6670. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6671. }
  6672. }
  6673. class UISkill extends UIBase {
  6674. constructor() {
  6675. super();
  6676. this.skillData = [];
  6677. }
  6678. onConstructor() {
  6679. this.ui = ui_UISkill.createInstance();
  6680. this.contentPane = this.ui;
  6681. this.isEject = false;
  6682. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6683. this.initSkillData();
  6684. console.log('zh:aaaaaa1111111111');
  6685. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6686. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6687. console.log('zh:aaaaaa22222222');
  6688. this.displayList = [];
  6689. this.ui.skillNode.skillList.numItems = 3;
  6690. this.addUIClick(this.ui, this.interuptSecretary);
  6691. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6692. this.ui.talkNode.visible = false;
  6693. if (Moyu.isKs)
  6694. this.ui.closeNode.closeBtn.x += 100;
  6695. }
  6696. show() {
  6697. super.show();
  6698. this.playSecretaryIdle();
  6699. this.moneyNode.ui.c1.selectedIndex = 1;
  6700. Laya.timer.clearAll(this);
  6701. xGame.soundMgr.playSound("s_start");
  6702. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6703. let guide = DataMgr.getSkillGuide();
  6704. this.ui.guideNode.visible = guide == 0;
  6705. let item = this.getSkillItemByUIIndex(0);
  6706. if (guide == 0) {
  6707. item.ui.c1.selectedIndex = 1;
  6708. }
  6709. else {
  6710. item.ui.c1.selectedIndex = 0;
  6711. }
  6712. this.ui.guideNode.guideBtn.visible = guide == 0;
  6713. for (let index = 0; index < this.displayList.length; index++) {
  6714. this.displayList[index].checkTry();
  6715. }
  6716. this.setGlobalFont(this.ui);
  6717. }
  6718. getSkillItemByUIIndex(cur) {
  6719. for (let index = 0; index < this.displayList.length; index++) {
  6720. if (this.displayList[index].index == cur) {
  6721. return this.displayList[index];
  6722. }
  6723. }
  6724. }
  6725. enterGuideLevel() {
  6726. let item = this.getSkillItemByUIIndex(0);
  6727. item.startGame();
  6728. if (DataMgr.getNewUser())
  6729. Moyu.sendDataEvent("gameStart1");
  6730. }
  6731. initSkillData() {
  6732. this.skillData = [];
  6733. let nameList = xGame.common.skillNameList;
  6734. let iconList = xGame.common.skillIconList;
  6735. let describeList = [
  6736. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6737. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6738. "The power of frost descends—freezing the flow and taking full control of the game!"
  6739. ];
  6740. console.log('zh:initSkillData 111111111');
  6741. let data;
  6742. for (let index = 0; index < nameList.length; index++) {
  6743. data = {};
  6744. data.name = nameList[index];
  6745. data.icon = iconList[index];
  6746. data.describe = describeList[index];
  6747. data.index = index;
  6748. this.skillData.push(data);
  6749. }
  6750. }
  6751. updateSkillItem(index, target) {
  6752. if (this.displayList[index] == null) {
  6753. let uiIndex;
  6754. switch (index) {
  6755. case 0:
  6756. uiIndex = 1;
  6757. break;
  6758. case 1:
  6759. uiIndex = 0;
  6760. break;
  6761. case 2:
  6762. uiIndex = 2;
  6763. break;
  6764. case 3:
  6765. uiIndex = 3;
  6766. break;
  6767. default:
  6768. break;
  6769. }
  6770. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6771. this.displayList.push(temp);
  6772. }
  6773. }
  6774. playSecretaryIdle() {
  6775. let parent = this.ui.secretary.displayObject;
  6776. parent.destroyChildren();
  6777. let xx = this.ui.secretary.width / 2;
  6778. let yy = this.ui.secretary.height;
  6779. let scale = xGame.common.getSecretaryScale();
  6780. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6781. xGame.common.secretary.play(data, 0, true, parent);
  6782. }
  6783. returnUIMain() {
  6784. this.hide();
  6785. xGame.common.stopGirlPop(this.ui.talkNode);
  6786. xGame.uiMgr.Show(UIMain);
  6787. }
  6788. interuptSecretary() {
  6789. Laya.timer.clearAll(this);
  6790. this.playSecretaryRandomSound();
  6791. }
  6792. playSecretaryRandomSound() {
  6793. if (this.isHide)
  6794. return;
  6795. let time = xGame.common.randomNum(45000, 60000);
  6796. Laya.timer.once(time, this, () => {
  6797. if (this.isHide)
  6798. return;
  6799. let index = xGame.common.randomNum(4, 7);
  6800. xGame.soundMgr.playSound("s_main0" + index);
  6801. let words = 1;
  6802. switch (index) {
  6803. case 4:
  6804. words = 5;
  6805. break;
  6806. case 5:
  6807. words = 3;
  6808. break;
  6809. case 6:
  6810. words = 6;
  6811. break;
  6812. case 7:
  6813. words = 7;
  6814. break;
  6815. default:
  6816. break;
  6817. }
  6818. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6819. this.playSecretaryRandomSound();
  6820. });
  6821. }
  6822. }
  6823. UISkill.uiName = "UISkill";
  6824. class ui_UIModeSelection extends fgui.GComponent {
  6825. static createInstance() {
  6826. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6827. }
  6828. onConstruct() {
  6829. this.n19 = (this.getChild("n19"));
  6830. this.closeBtn = (this.getChild("closeBtn"));
  6831. this.myNode = (this.getChild("myNode"));
  6832. this.t0 = this.getTransition("t0");
  6833. }
  6834. }
  6835. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6836. class UIModeSelection extends UIBase {
  6837. constructor() {
  6838. super();
  6839. }
  6840. onConstructor() {
  6841. this.ui = ui_UIModeSelection.createInstance();
  6842. this.contentPane = this.ui;
  6843. this.isEject = false;
  6844. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6845. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6846. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6847. this.addUIClick(this.ui.closeBtn, this.hide);
  6848. this.peopleArr = [65, 990, 580];
  6849. this.peopleOffest = [5, 10, 10];
  6850. }
  6851. show(callback) {
  6852. this.updateSelf();
  6853. super.show();
  6854. this.ui.t0.play();
  6855. this.callback = callback;
  6856. this.setGlobalFont(this.ui);
  6857. }
  6858. updateSelf() {
  6859. let cfg = cfgTable.modeselectData;
  6860. for (let index = 1; index <= 3; index++) {
  6861. let node = this.ui.myNode["type" + index];
  6862. node.need.text = cfg[index].need;
  6863. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6864. node.peopleTxt.text = this.getRandPeople(index - 1);
  6865. }
  6866. }
  6867. enterGame(type) {
  6868. console.log('zh: 进入经典模式 type: ' + type);
  6869. xGame.common.classicRoomType = type;
  6870. let cfg = cfgTable.modeselectData[type];
  6871. let need = cfg.need;
  6872. xGame.common.passAwardCoin = cfg.award;
  6873. if (DataMgr.coinEnough(need)) {
  6874. DataMgr.setCoin(-need);
  6875. this.ui.myNode["type" + type].t0.play();
  6876. Laya.timer.once(200, this, () => {
  6877. this.callback && this.callback();
  6878. });
  6879. this.logEventForClassic_start();
  6880. }
  6881. else {
  6882. Moyu.sendDataEvent("AddCoinVideo");
  6883. xGame.uiMgr.Show(UIAddProp, 0);
  6884. }
  6885. }
  6886. getRandPeople(index) {
  6887. let rand = this.peopleOffest[index];
  6888. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6889. }
  6890. logEventForClassic_start() {
  6891. let rtype = xGame.common.classicRoomType;
  6892. let msmc = '';
  6893. if (rtype == 1) {
  6894. msmc = 'beginner';
  6895. }
  6896. if (rtype == 2) {
  6897. msmc = 'expert';
  6898. }
  6899. if (rtype == 3) {
  6900. msmc = 'master';
  6901. }
  6902. let keyStr = 'sjmd_classic_start_' + rtype;
  6903. let jsonStr = {
  6904. "difficulty": msmc,
  6905. "classic_count": 1,
  6906. "difficulty_count": 1
  6907. };
  6908. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6909. const d = LocalStorageManager.getItem(keyStr);
  6910. jsonStr.classic_count = d.classic_count + 1;
  6911. jsonStr.difficulty_count = d.difficulty_count + 1;
  6912. LocalStorageManager.setItem(keyStr, jsonStr);
  6913. }
  6914. else {
  6915. LocalStorageManager.setItem(keyStr, jsonStr);
  6916. }
  6917. const reqStr = JSON.stringify(jsonStr);
  6918. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6919. }
  6920. }
  6921. UIModeSelection.uiName = "UIModeSelection";
  6922. class ui_UIReg extends fgui.GComponent {
  6923. static createInstance() {
  6924. return (fgui.UIPackage.createObject("game", "UIReg"));
  6925. }
  6926. onConstruct() {
  6927. this.n38 = (this.getChild("n38"));
  6928. this.n9 = (this.getChild("n9"));
  6929. this.n14 = (this.getChild("n14"));
  6930. this.n15 = (this.getChild("n15"));
  6931. this.n34 = (this.getChild("n34"));
  6932. this.closeBtn = (this.getChild("closeBtn"));
  6933. this.lab_tip = (this.getChild("lab_tip"));
  6934. this.n43 = (this.getChild("n43"));
  6935. this.txt_ua = (this.getChild("txt_ua"));
  6936. this.n44 = (this.getChild("n44"));
  6937. this.txt_up1 = (this.getChild("txt_up1"));
  6938. this.n45 = (this.getChild("n45"));
  6939. this.txt_up2 = (this.getChild("txt_up2"));
  6940. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6941. this.btn_reg = (this.getChild("btn_reg"));
  6942. this.n50 = (this.getChild("n50"));
  6943. }
  6944. }
  6945. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6946. class ui_UILogin extends fgui.GComponent {
  6947. static createInstance() {
  6948. return (fgui.UIPackage.createObject("game", "UILogin"));
  6949. }
  6950. onConstruct() {
  6951. this.c1 = this.getController("c1");
  6952. this.n18 = (this.getChild("n18"));
  6953. this.n7 = (this.getChild("n7"));
  6954. this.n5 = (this.getChild("n5"));
  6955. this.n6 = (this.getChild("n6"));
  6956. this.closeBtn = (this.getChild("closeBtn"));
  6957. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6958. this.btn_login = (this.getChild("btn_login"));
  6959. this.n31 = (this.getChild("n31"));
  6960. this.txt_up = (this.getChild("txt_up"));
  6961. this.n32 = (this.getChild("n32"));
  6962. this.txt_ua = (this.getChild("txt_ua"));
  6963. this.n40 = (this.getChild("n40"));
  6964. }
  6965. }
  6966. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6967. class UILogin extends UIBase {
  6968. constructor() {
  6969. super();
  6970. }
  6971. onConstructor() {
  6972. this.ui = ui_UILogin.createInstance();
  6973. this.contentPane = this.ui;
  6974. this.isEject = false;
  6975. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  6976. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  6977. this.addUIClick(this.ui.btn_login, this.userLogin);
  6978. }
  6979. show() {
  6980. super.show();
  6981. this.x = (Laya.stage.width - this.width) / 2;
  6982. this.y = (Laya.stage.height - this.height) / 2;
  6983. this.setGlobalFont(this.ui);
  6984. }
  6985. closeSelf() {
  6986. this.hide();
  6987. }
  6988. userLogin() {
  6989. let ua = this.ui.txt_ua.text;
  6990. let up = this.ui.txt_up.text;
  6991. if (ua && up) {
  6992. let reqData = JSON.stringify({
  6993. username: ua.trim(),
  6994. password: up.trim(),
  6995. fromMark: 'app_game'
  6996. });
  6997. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  6998. try {
  6999. console.log('zh:res = ' + JSON.stringify(res));
  7000. let code = res.code;
  7001. let msg = res.msg;
  7002. if (code == 200) {
  7003. let keyStr = keyForLoginInfo;
  7004. let jsonStr = {
  7005. "username": res.username,
  7006. "token": res.token,
  7007. "buySpids": { 1: false, 7: false }
  7008. };
  7009. LocalStorageManager.setItem(keyStr, jsonStr);
  7010. let myu = Moyu.getUserInfo();
  7011. console.log('zh:myu = ' + JSON.stringify(myu));
  7012. DataMgr.updateUserNickName(res.username);
  7013. Moyu.updateUserInfo(res.username);
  7014. xGame.uiMgr.Show(UIMsg, msg);
  7015. DataMgr.loadUserSpOrderForAd();
  7016. DataMgr.getUserZiChanInfo(false);
  7017. xGame.eventMgr.event(LOGIN_IN);
  7018. this.closeSelf();
  7019. }
  7020. else {
  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. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7034. }
  7035. }
  7036. gotoRegPage() {
  7037. this.closeSelf();
  7038. xGame.uiMgr.Show(UIReg);
  7039. }
  7040. }
  7041. UILogin.uiName = "UILogin";
  7042. class UIReg extends UIBase {
  7043. constructor() {
  7044. super();
  7045. }
  7046. onConstructor() {
  7047. this.ui = ui_UIReg.createInstance();
  7048. this.contentPane = this.ui;
  7049. this.isEject = false;
  7050. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7051. this.addUIClick(this.ui.btn_reg, this.regUser);
  7052. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7053. }
  7054. show() {
  7055. super.show();
  7056. this.x = (Laya.stage.width - this.width) / 2;
  7057. this.y = (Laya.stage.height - this.height) / 2;
  7058. this.setGlobalFont(this.ui);
  7059. }
  7060. closeSelf() {
  7061. this.hide();
  7062. }
  7063. regUser() {
  7064. this.ui.lab_tip.visible = false;
  7065. let ua = this.ui.txt_ua.text;
  7066. let up1 = this.ui.txt_up1.text;
  7067. let up2 = this.ui.txt_up2.text;
  7068. if (ua && up1 && up2 && up1 == up2) {
  7069. let reqData = JSON.stringify({
  7070. username: ua.trim(),
  7071. password: up1.trim(),
  7072. fromMark: 'app_game'
  7073. });
  7074. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7075. try {
  7076. console.log('zh:res = ' + JSON.stringify(res));
  7077. let code = res.code;
  7078. let msg = res.msg;
  7079. xGame.uiMgr.Show(UIMsg, msg);
  7080. if (code == 200) {
  7081. this.ui.lab_tip.color = "#FFFFFF";
  7082. xGame.uiMgr.Show(UIMsg, msg);
  7083. this.closeSelf();
  7084. }
  7085. else {
  7086. this.ui.lab_tip.color = "#FF0000";
  7087. xGame.uiMgr.Show(UIMsg, msg);
  7088. }
  7089. }
  7090. catch (error) {
  7091. console.log('error=' + error);
  7092. alert(error);
  7093. }
  7094. finally {
  7095. }
  7096. });
  7097. }
  7098. else {
  7099. if (up1 != up2) {
  7100. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7101. }
  7102. else {
  7103. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7104. }
  7105. }
  7106. }
  7107. gotoLogin() {
  7108. this.closeSelf();
  7109. xGame.uiMgr.Show(UILogin);
  7110. }
  7111. }
  7112. UIReg.uiName = "UIReg";
  7113. class ui_UIFuli1 extends fgui.GComponent {
  7114. static createInstance() {
  7115. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  7116. }
  7117. onConstruct() {
  7118. this.n1 = (this.getChild("n1"));
  7119. this.n2 = (this.getChild("n2"));
  7120. }
  7121. }
  7122. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  7123. class UIFuli1 extends UIBase {
  7124. constructor() {
  7125. super();
  7126. this.jiage = 4.99;
  7127. }
  7128. onConstructor() {
  7129. this.ui = ui_UIFuli1.createInstance();
  7130. this.contentPane = this.ui;
  7131. this.isEject = false;
  7132. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7133. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7134. }
  7135. show() {
  7136. super.show();
  7137. this.x = (Laya.stage.width - this.width) / 2;
  7138. this.y = (Laya.stage.height - this.height) / 2;
  7139. this.ui.n2.txt_price.text = "$" + this.jiage;
  7140. this.setGlobalFont(this.ui);
  7141. }
  7142. closeSelf() {
  7143. DataMgr.loadUserSpOrderForAd();
  7144. this.hide();
  7145. }
  7146. gotoBuy() {
  7147. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7148. if (userInfo != null) {
  7149. let token = userInfo.token;
  7150. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  7151. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  7152. DataMgr.loadUserSpOrderForAd();
  7153. return;
  7154. }
  7155. else {
  7156. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7157. }
  7158. }
  7159. gotoBuy2() {
  7160. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7161. if (userInfo == null) {
  7162. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7163. return;
  7164. }
  7165. let reqData = xGame.httpMgr.getReqData();
  7166. let pd = JSON.parse(reqData);
  7167. pd.productId = 1;
  7168. reqData = JSON.stringify(pd);
  7169. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7170. try {
  7171. console.log('zh:buySp res = ' + JSON.stringify(res));
  7172. let code = res.code;
  7173. let msg = res.msg;
  7174. if (code == 401) {
  7175. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7176. alert(TIP_MSG_key.loginTimeOut);
  7177. xGame.uiMgr.Show(UIMsg, msg);
  7178. return;
  7179. }
  7180. if (code == 200) {
  7181. xGame.uiMgr.Show(UIMsg, msg);
  7182. DataMgr.loadUserSpOrderForAd();
  7183. DataMgr.getUserZiChanInfo(false);
  7184. this.closeSelf();
  7185. }
  7186. else {
  7187. xGame.uiMgr.Show(UIMsg, msg);
  7188. }
  7189. }
  7190. catch (error) {
  7191. console.log('error=' + error);
  7192. alert(error);
  7193. }
  7194. finally {
  7195. }
  7196. });
  7197. }
  7198. }
  7199. UIFuli1.uiName = "UIFuli1";
  7200. class ui_UIFuli2 extends fgui.GComponent {
  7201. static createInstance() {
  7202. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  7203. }
  7204. onConstruct() {
  7205. this.n1 = (this.getChild("n1"));
  7206. this.n2 = (this.getChild("n2"));
  7207. }
  7208. }
  7209. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  7210. class UIFuli2 extends UIBase {
  7211. constructor() {
  7212. super();
  7213. this.jiage = 14.99;
  7214. }
  7215. onConstructor() {
  7216. this.ui = ui_UIFuli2.createInstance();
  7217. this.contentPane = this.ui;
  7218. this.isEject = false;
  7219. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  7220. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  7221. }
  7222. show() {
  7223. super.show();
  7224. this.x = (Laya.stage.width - this.width) / 2;
  7225. this.y = (Laya.stage.height - this.height) / 2;
  7226. this.ui.n2.txt_price.text = "$" + this.jiage;
  7227. this.setGlobalFont(this.ui);
  7228. }
  7229. closeSelf() {
  7230. DataMgr.loadUserSpOrderForAd();
  7231. this.hide();
  7232. }
  7233. gotoBuy() {
  7234. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7235. if (userInfo != null) {
  7236. let token = userInfo.token;
  7237. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  7238. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  7239. DataMgr.loadUserSpOrderForAd();
  7240. return;
  7241. }
  7242. else {
  7243. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7244. }
  7245. }
  7246. gotoBuy1() {
  7247. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7248. if (userInfo == null) {
  7249. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7250. return;
  7251. }
  7252. let reqData = xGame.httpMgr.getReqData();
  7253. let pd = JSON.parse(reqData);
  7254. pd.productId = 2;
  7255. reqData = JSON.stringify(pd);
  7256. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  7257. try {
  7258. console.log('zh:buySp res = ' + JSON.stringify(res));
  7259. let code = res.code;
  7260. let msg = res.msg;
  7261. if (code == 401) {
  7262. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7263. alert(TIP_MSG_key.loginTimeOut);
  7264. xGame.uiMgr.Show(UIMsg, msg);
  7265. return;
  7266. }
  7267. if (code == 200) {
  7268. xGame.uiMgr.Show(UIMsg, msg);
  7269. DataMgr.loadUserSpOrderForAd();
  7270. DataMgr.getUserZiChanInfo(false);
  7271. this.closeSelf();
  7272. }
  7273. else {
  7274. xGame.uiMgr.Show(UIMsg, msg);
  7275. }
  7276. }
  7277. catch (error) {
  7278. console.log('error=' + error);
  7279. alert(error);
  7280. }
  7281. finally {
  7282. }
  7283. });
  7284. }
  7285. }
  7286. UIFuli2.uiName = "UIFuli2";
  7287. class ui_UIGetAward extends fgui.GComponent {
  7288. static createInstance() {
  7289. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7290. }
  7291. onConstruct() {
  7292. this.n4 = (this.getChild("n4"));
  7293. this.n0 = (this.getChild("n0"));
  7294. this.myList = (this.getChild("myList"));
  7295. this.n1 = (this.getChild("n1"));
  7296. this.eftNode = (this.getChild("eftNode"));
  7297. this.btnNode = (this.getChild("btnNode"));
  7298. this.t0 = this.getTransition("t0");
  7299. }
  7300. }
  7301. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7302. class UIGetAward extends UIBase {
  7303. constructor() {
  7304. super();
  7305. this.showTriple = true;
  7306. }
  7307. onConstructor() {
  7308. this.ui = ui_UIGetAward.createInstance();
  7309. this.contentPane = this.ui;
  7310. this.isEject = false;
  7311. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7312. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7313. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7314. }
  7315. show(arr, showTriple, callback) {
  7316. super.show();
  7317. this.ui.t0.play();
  7318. this.ui.eftNode.visible = true;
  7319. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7320. this.ui.eftNode.visible = false;
  7321. }), 1, 0, 0, 0.9);
  7322. this.awardArr = arr;
  7323. this.showTriple = showTriple;
  7324. this.callback = callback;
  7325. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7326. this.ui.myList.numItems = arr.length;
  7327. xGame.soundMgr.playSound("getaward");
  7328. this.setGlobalFont(this.ui);
  7329. }
  7330. updateSelf(index, obj) {
  7331. let temp = this.awardArr[index];
  7332. let icon = this.getIcon(temp.type);
  7333. let str = icon;
  7334. if (temp.type > 2) {
  7335. str = "s" + icon;
  7336. }
  7337. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7338. obj.myIcon.rotation = 0;
  7339. obj.numTxt.text = temp.num + "";
  7340. obj.numTxt.visible = temp.type > 2 ? false : true;
  7341. obj.nameTxt.text = this.getNameStr(temp.type);
  7342. }
  7343. renderItem(index, obj) {
  7344. this.updateSelf(index, obj);
  7345. }
  7346. tripleGetAward() {
  7347. console.log('zh:qjff_AD_for_uigetAward');
  7348. if (Laya.Browser.onAndroid) {
  7349. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7350. if (!boo) {
  7351. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7352. return;
  7353. }
  7354. }
  7355. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7356. }
  7357. else {
  7358. console.log('zh:AD 失败,直接发放奖励');
  7359. this.qjff_AD_for_uigetAward();
  7360. }
  7361. }
  7362. qjff_AD_for_uigetAward() {
  7363. this.getAward(3);
  7364. }
  7365. normalGetAward() {
  7366. if (PlatMgr.isMisVideo())
  7367. this.tripleGetAward();
  7368. else
  7369. this.getAward();
  7370. }
  7371. getAward(times = 1) {
  7372. this.hide();
  7373. for (let index = 0; index < this.awardArr.length; index++) {
  7374. this.awardArr[index].num *= times;
  7375. }
  7376. this.callback && this.callback(times != 1);
  7377. }
  7378. getIcon(type) {
  7379. switch (type) {
  7380. case Prop.diamond:
  7381. return "ty_zs";
  7382. case Prop.coin:
  7383. return "ty_jb";
  7384. case Prop.gan1:
  7385. return "qg1";
  7386. case Prop.gan2:
  7387. return "qg2";
  7388. case Prop.gan3:
  7389. return "qg3";
  7390. case Prop.gan4:
  7391. return "qg4";
  7392. default:
  7393. break;
  7394. }
  7395. }
  7396. getNameStr(type) {
  7397. switch (type) {
  7398. case Prop.diamond:
  7399. return "Diamond";
  7400. case Prop.coin:
  7401. return "Coins";
  7402. case Prop.gan1:
  7403. case Prop.gan2:
  7404. case Prop.gan3:
  7405. case Prop.gan4:
  7406. return cfgTable.ballrodData[type - 1].name;
  7407. default:
  7408. break;
  7409. }
  7410. }
  7411. }
  7412. UIGetAward.uiName = "UIGetAward";
  7413. class ui_UIRepentProp extends fgui.GComponent {
  7414. static createInstance() {
  7415. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7416. }
  7417. onConstruct() {
  7418. this.c1 = this.getController("c1");
  7419. this.n11 = (this.getChild("n11"));
  7420. this.regretNode = (this.getChild("regretNode"));
  7421. this.helpLineNode = (this.getChild("helpLineNode"));
  7422. this.t0 = this.getTransition("t0");
  7423. }
  7424. }
  7425. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7426. class UIRepentProp extends UIBase {
  7427. constructor() {
  7428. super();
  7429. this.viewType = 0;
  7430. this.regretType = 0;
  7431. }
  7432. onConstructor() {
  7433. this.ui = ui_UIRepentProp.createInstance();
  7434. this.contentPane = this.ui;
  7435. this.isEject = false;
  7436. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7437. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7438. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7439. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7440. }
  7441. show(viewType, regretType, callback) {
  7442. PlatMgr.showInsert(true);
  7443. this.viewType = viewType;
  7444. this.regretType = regretType;
  7445. this.callback = callback;
  7446. super.show();
  7447. this.ui.t0.play();
  7448. this.ui.c1.selectedIndex = this.viewType;
  7449. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7450. if (this.viewType == 0) {
  7451. let guide = DataMgr.getGuideHelpLine();
  7452. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7453. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7454. }
  7455. xGame.common.gameMgr.gamePause = true;
  7456. this.setGlobalFont(this.ui);
  7457. }
  7458. hideSelf() {
  7459. xGame.common.gameMgr.gamePause = false;
  7460. this.callback && this.callback(false);
  7461. this.hide();
  7462. }
  7463. videoRegret() {
  7464. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7465. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7466. }
  7467. else {
  7468. console.log('zh:AD 失败,直接发放奖励');
  7469. this.qjff_AD_for_UIrepentProp_videoRegret();
  7470. }
  7471. }
  7472. qjff_AD_for_UIrepentProp_videoRegret() {
  7473. this.callback && this.callback(true);
  7474. this.hideSelf();
  7475. }
  7476. videoAddHelpLine() {
  7477. let guide = DataMgr.getGuideHelpLine();
  7478. if (guide == 0) {
  7479. this.callback && this.callback(true);
  7480. this.hideSelf();
  7481. DataMgr.setGuideHelpLine();
  7482. xGame.common.gameUI.ui.guideNode.visible = false;
  7483. }
  7484. else {
  7485. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7486. if (Laya.Browser.onAndroid) {
  7487. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7488. if (!boo) {
  7489. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7490. return;
  7491. }
  7492. }
  7493. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7494. }
  7495. else {
  7496. console.log('zh:AD 失败,直接发放奖励');
  7497. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7498. }
  7499. }
  7500. }
  7501. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7502. this.callback && this.callback(true);
  7503. this.hideSelf();
  7504. }
  7505. }
  7506. UIRepentProp.uiName = "UIRepentProp";
  7507. class UIMain extends UIBase {
  7508. constructor() {
  7509. super();
  7510. this.firstEnter = true;
  7511. }
  7512. nativeCallJs(msg) {
  7513. let t = msg;
  7514. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7515. switch (t) {
  7516. case 'qjff_chouJiang':
  7517. let dui = xGame.uiMgr.getUI(UIDraw);
  7518. dui.qjff_chouJiang();
  7519. break;
  7520. case 'qjff_AD_for_uisign':
  7521. let dui2 = xGame.uiMgr.getUI(UISign);
  7522. dui2.qjff_AD_for_uisign();
  7523. break;
  7524. case 'qjff_AD_for_uitry':
  7525. let dui3 = xGame.uiMgr.getUI(UITry);
  7526. dui3.qjff_AD_for_uitry();
  7527. break;
  7528. case 'qjff_AD_for_uipower':
  7529. let dui4 = xGame.uiMgr.getUI(UIPower);
  7530. dui4.qjff_AD_for_uipower();
  7531. break;
  7532. case 'qjff_AD_for_uigetAward':
  7533. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7534. dui5.qjff_AD_for_uigetAward();
  7535. break;
  7536. case 'qjff_AD_for_uiGameEnd':
  7537. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7538. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7539. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7540. break;
  7541. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7542. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7543. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7544. break;
  7545. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7546. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7547. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7548. break;
  7549. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7550. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7551. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7552. break;
  7553. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7554. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7555. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7556. break;
  7557. case 'qjff_AD_for_UIBOX_onOpenBox':
  7558. let dui11 = xGame.uiMgr.getUI(UIBox);
  7559. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7560. break;
  7561. case 'qjff_AD_for_UIAddCoin':
  7562. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7563. dui12.qjff_AD_for_UIAddCoin();
  7564. break;
  7565. case 'app_sign_for_buyProduct_onSuccess':
  7566. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7567. DataMgr.getUserZiChanInfo(false);
  7568. break;
  7569. case '222axxxxxx':
  7570. let dui15 = xGame.uiMgr.getUI(UISign);
  7571. dui15.qjff_AD_for_uisign();
  7572. break;
  7573. case '333axsxxxxxx':
  7574. let dui16 = xGame.uiMgr.getUI(UISign);
  7575. dui16.qjff_AD_for_uisign();
  7576. break;
  7577. default:
  7578. console.log('zh:未知的方法名字' + t);
  7579. break;
  7580. }
  7581. }
  7582. onConstructor() {
  7583. console.log('zh: UIMain onConstructor');
  7584. this.ui = ui_UIMain.createInstance();
  7585. this.contentPane = this.ui;
  7586. this.isEject = false;
  7587. this.addEvent();
  7588. this.addClickSpine();
  7589. this.settingNode = new SettingNode(this.ui.settingNode);
  7590. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7591. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7592. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7593. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7594. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7595. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7596. let curUse = DataMgr.getCurSecretary();
  7597. this.changeSecretary(curUse);
  7598. this.ui.talkNode.visible = false;
  7599. let guide = DataMgr.getSkillGuide();
  7600. if (xGame.common.isNewDay && guide == 1) {
  7601. xGame.common.isNewDay = false;
  7602. xGame.soundMgr.playSound("s_main01");
  7603. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7604. console.log("zh:播放小秘书每天语音");
  7605. }
  7606. this.onGetUserInfo();
  7607. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7608. DataMgr.getUserZiChanInfo(false);
  7609. }
  7610. this.ui.n83.visible = false;
  7611. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7612. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7613. let ua = d.username;
  7614. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7615. }
  7616. this.c_btn_for_user();
  7617. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7618. }
  7619. Logout() {
  7620. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7621. LocalStorageManager.removeItem(keyForLoginInfo);
  7622. this.freshUser();
  7623. }
  7624. JSBridgeUtils.instance.loginOutForApp();
  7625. this.setUserDefaultNickname();
  7626. DataMgr.setCoin2(4000);
  7627. DataMgr.setDiamond2(0);
  7628. this.setDefaultQiuGanInfo();
  7629. DataMgr.setPlaceBallLevelList("");
  7630. DataMgr.setChallengeMode_overLev(1);
  7631. this.setDefaultSignData();
  7632. }
  7633. setDefaultSignData() {
  7634. DataMgr.setSignData(1);
  7635. DataMgr.setSignTime(new Date().getTime());
  7636. }
  7637. setDefaultQiuGanInfo() {
  7638. DataMgr.setBallRod(0, 1);
  7639. DataMgr.setBallRod(1, 0);
  7640. DataMgr.setBallRod(2, 0);
  7641. DataMgr.setBallRod(3, 0);
  7642. DataMgr.setBallRod(4, 0);
  7643. DataMgr.setBallRod(5, 1);
  7644. }
  7645. setUserDefaultNickname() {
  7646. let defUsername = "player";
  7647. this.ui.headNode.nameTxt.text = defUsername;
  7648. DataMgr.updateUserNickName(defUsername);
  7649. Moyu.updateUserInfo(defUsername);
  7650. }
  7651. gotoLogin() {
  7652. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7653. xGame.uiMgr.Show(UILogin);
  7654. }
  7655. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7656. this.Logout();
  7657. }
  7658. }
  7659. gotoRegUser() {
  7660. xGame.uiMgr.Show(UIReg);
  7661. }
  7662. showFuLiSp1() {
  7663. console.log('zh:福利1');
  7664. this.checkForShowFuLi17(1);
  7665. }
  7666. showFuLiSp7() {
  7667. console.log('zh:福利7');
  7668. this.checkForShowFuLi17(7);
  7669. }
  7670. checkForShowFuLi17(spid) {
  7671. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7672. if (userInfo == null) {
  7673. if (spid === 1) {
  7674. xGame.uiMgr.Show(UIFuli1);
  7675. }
  7676. if (spid === 7) {
  7677. xGame.uiMgr.Show(UIFuli2);
  7678. }
  7679. return;
  7680. }
  7681. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  7682. let reqData = xGame.httpMgr.getReqData();
  7683. let pd = JSON.parse(reqData);
  7684. pd.productId = spid;
  7685. reqData = JSON.stringify(pd);
  7686. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  7687. try {
  7688. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  7689. let code = res.code;
  7690. let msg = res.msg;
  7691. if (code == 401) {
  7692. Laya.LocalStorage.removeItem(keyForLoginInfo);
  7693. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7694. return;
  7695. }
  7696. if (code == 200) {
  7697. let isBuyOk = res.data;
  7698. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  7699. if (isBuyOk === false) {
  7700. if (spid === 1) {
  7701. xGame.uiMgr.Show(UIFuli1);
  7702. }
  7703. if (spid === 7) {
  7704. xGame.uiMgr.Show(UIFuli2);
  7705. }
  7706. }
  7707. else {
  7708. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  7709. }
  7710. }
  7711. else {
  7712. xGame.uiMgr.Show(UIMsg, msg);
  7713. }
  7714. }
  7715. catch (error) {
  7716. console.log('error=' + error);
  7717. alert(error);
  7718. }
  7719. finally {
  7720. }
  7721. });
  7722. }
  7723. c_btn_for_user() {
  7724. this.ui.n_dengLu.c1.selectedIndex = 0;
  7725. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7726. this.ui.n_dengLu.c1.selectedIndex = 1;
  7727. }
  7728. else {
  7729. this.ui.n_dengLu.c1.selectedIndex = 0;
  7730. }
  7731. }
  7732. changeSecretary(curUse) {
  7733. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7734. xGame.common.secretary && xGame.common.secretary.dispose();
  7735. this.addSecretarySpine(name);
  7736. }
  7737. addSecretarySpine(name) {
  7738. let spine = new SpineMgr(name, () => {
  7739. this.playSecretaryIdle();
  7740. });
  7741. xGame.common.secretary = spine;
  7742. }
  7743. addClickSpine() {
  7744. let clickSpine = new SpineMgr("dianji", () => {
  7745. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7746. let parent = Laya.stage;
  7747. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7748. clickSpine.play(data, 0, false, parent, (spine) => {
  7749. spine.destroy(true);
  7750. });
  7751. });
  7752. });
  7753. }
  7754. addEvent() {
  7755. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7756. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7757. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7758. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7759. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7760. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7761. this.addUIClick(this.ui, this.interuptSecretary);
  7762. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7763. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7764. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7765. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7766. this.addUIClick(this.ui.signBtn, this.openSignView);
  7767. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7768. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7769. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7770. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7771. }
  7772. show(showFailWords) {
  7773. super.show();
  7774. DataMgr.loadUserSpOrderForAd();
  7775. this.moneyNode.ui.c1.selectedIndex = 1;
  7776. this.playSecretaryIdle();
  7777. xGame.soundMgr.playMusic("caromhall01", 0);
  7778. Laya.timer.clearAll(this);
  7779. this.playSecretaryRandomSound();
  7780. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7781. if (showFailWords) {
  7782. console.log('zh:uimain.ts ');
  7783. setTimeout(() => {
  7784. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7785. let words = -1;
  7786. if (str == "s_main02") {
  7787. words = 2;
  7788. }
  7789. else {
  7790. words = 3;
  7791. }
  7792. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7793. xGame.soundMgr.playSound(str);
  7794. }, 300);
  7795. }
  7796. this.showGuide();
  7797. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7798. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7799. let guide = DataMgr.getSkillGuide();
  7800. if (guide == 1) {
  7801. let randTime = xGame.common.randomNum(300, 800);
  7802. if (this.firstEnter) {
  7803. console.log("zh: firstEnter");
  7804. this.firstEnter = false;
  7805. randTime += 900;
  7806. }
  7807. else {
  7808. console.log("zh: no firstEnter");
  7809. }
  7810. Laya.timer.once(randTime, this, () => {
  7811. });
  7812. Laya.timer.once(1000, this, () => {
  7813. console.log('zh: 1秒后 showFuLiSp1');
  7814. this.showFuLiSp1();
  7815. });
  7816. Laya.timer.once(10000, this, () => {
  7817. console.log('zh: 10秒后 showFuLiSp1');
  7818. this.showFuLiSp7();
  7819. });
  7820. }
  7821. this.setGlobalFont(this.ui);
  7822. }
  7823. checkActive(show) {
  7824. }
  7825. showGuide() {
  7826. let guide = DataMgr.getSkillGuide();
  7827. this.ui.guideBtn.visible = guide == 0;
  7828. this.ui.enterGuide.visible = false;
  7829. this.ui.secretaryGuide.visible = guide == 0;
  7830. if (guide == 0) {
  7831. console.log("zh:显示引导");
  7832. xGame.soundMgr.playSound("s_guide");
  7833. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7834. }
  7835. else {
  7836. console.log("zh:不需要显示引导");
  7837. }
  7838. }
  7839. ensureSecretary() {
  7840. console.log('zh: ensureSecretary ');
  7841. this.ui.secretaryGuide.visible = false;
  7842. this.ui.enterGuide.visible = true;
  7843. this.ui.wordsNode.t0.play();
  7844. if (DataMgr.getNewUser())
  7845. Moyu.sendDataEvent("gameReady");
  7846. }
  7847. playSecretaryIdle() {
  7848. let parent = this.ui.secretary.displayObject;
  7849. parent.destroyChildren();
  7850. let xx = this.ui.secretary.width / 2;
  7851. let yy = this.ui.secretary.height;
  7852. let scale = xGame.common.getSecretaryScale();
  7853. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7854. xGame.common.secretary.play(data, 0, true, parent);
  7855. }
  7856. startGame(type) {
  7857. if (!this.isReadyForLoadNetSource()) {
  7858. return;
  7859. }
  7860. xGame.common.gameMode = type;
  7861. Moyu.sendDataEvent("PlayGame", { type: type });
  7862. let gm = xGame.common.gameMode;
  7863. console.log('zh:进入游戏gameMode =' + gm);
  7864. switch (gm) {
  7865. case GameMode.classic:
  7866. console.log('zh:进入经典模式111111111');
  7867. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7868. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7869. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7870. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7871. console.log('zh:判断是否可以玩该模式classic =NO');
  7872. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7873. xGame.uiMgr.Show(UIMsg, tipStr);
  7874. return;
  7875. }
  7876. else {
  7877. console.log('zh:可以玩该模式classic');
  7878. this.beginGame();
  7879. }
  7880. }
  7881. else {
  7882. console.log('zh:不需要判断是否可以玩该classic');
  7883. let challengeTimes = DataMgr.getChallengeTimes();
  7884. if (challengeTimes == 0) {
  7885. xGame.uiMgr.Show(UIInvitation);
  7886. }
  7887. else {
  7888. this.beginGame();
  7889. }
  7890. }
  7891. break;
  7892. case GameMode.bigMove:
  7893. console.info('zh:bigMove check 大招');
  7894. let guide = DataMgr.getSkillGuide();
  7895. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7896. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7897. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7898. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7899. console.log('zh:提示不可以玩');
  7900. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7901. xGame.uiMgr.Show(UIMsg, tipStr);
  7902. return;
  7903. }
  7904. else {
  7905. console.log('zh:可以玩该模式 bigMove');
  7906. this.beginGame();
  7907. if (DataMgr.getNewUser())
  7908. Moyu.sendDataEvent("gameStart0");
  7909. }
  7910. }
  7911. else {
  7912. this.beginGame();
  7913. if (DataMgr.getNewUser())
  7914. Moyu.sendDataEvent("gameStart0");
  7915. }
  7916. break;
  7917. default:
  7918. console.error('zh:未知错误!!!!');
  7919. break;
  7920. }
  7921. }
  7922. beginGame(isNice = false) {
  7923. console.log('zh:beginGame ');
  7924. let guide = DataMgr.getSkillGuide();
  7925. if (guide == 1) {
  7926. console.log('zh:非新手引导,showInternAd ');
  7927. JSBridgeUtils.instance.showInternAd('beginGame');
  7928. }
  7929. else {
  7930. console.log('zh:新手引导,不显示AD ');
  7931. }
  7932. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7933. console.log('zh:beginGame 1');
  7934. if (xGame.common.gameMode == GameMode.classic) {
  7935. console.log('zh:beginGame 2');
  7936. if (isNice) {
  7937. console.log('zh:进入巅峰赛');
  7938. this.enterClassic();
  7939. }
  7940. else {
  7941. console.log('zh:beginGame 3-1');
  7942. xGame.uiMgr.Show(UIModeSelection, () => {
  7943. console.log('zh:beginGame 3-2');
  7944. this.enterClassic();
  7945. });
  7946. }
  7947. }
  7948. else if (xGame.common.gameMode == GameMode.bigMove) {
  7949. console.log('zh:beginGame 5');
  7950. this.ui.enterGuide.visible = false;
  7951. xGame.uiMgr.Show(UISkill);
  7952. }
  7953. }
  7954. enterClassic() {
  7955. console.log('zh:beginGame 7');
  7956. xGame.uiMgr.Show(UIGame);
  7957. xGame.uiMgr.Show(UIMatching, () => {
  7958. if (!this.isHide)
  7959. this.hide();
  7960. xGame.common.gameUI.ui.alpha = 1;
  7961. console.log('zh:beginGame 8');
  7962. xGame.common.gameUI.startGame();
  7963. xGame.uiMgr.Hide(UIGameEnd);
  7964. });
  7965. }
  7966. start_debug_for_moni_payOk() {
  7967. console.log('zh:start_debug_for_moni_payOk');
  7968. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7969. if (userInfo != null) {
  7970. let token = userInfo.token;
  7971. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7972. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7973. alert('模拟支付OK');
  7974. return;
  7975. }
  7976. else {
  7977. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7978. }
  7979. }
  7980. startGlobal() {
  7981. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7982. }
  7983. startWeekly() {
  7984. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7985. }
  7986. zhouSaiMonth() {
  7987. console.log('zh: zhouSaiMonth 被调用');
  7988. }
  7989. isReadyForLoadNetSource() {
  7990. let reqCount = xGame.cfgMgr.httpReqCount;
  7991. let ok = xGame.cfgMgr.httpReqOkCount;
  7992. if (reqCount > ok) {
  7993. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7994. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7995. Laya.timer.once(5000, this, () => {
  7996. let retryCount = 0;
  7997. const maxRetries = 3;
  7998. const tryFetchConfig = () => {
  7999. try {
  8000. xGame.cfgMgr.getConfigFromServer();
  8001. }
  8002. catch (error) {
  8003. if (retryCount < maxRetries) {
  8004. retryCount++;
  8005. console.log(`🔄 第${retryCount}次重试获取配置...`);
  8006. Laya.timer.once(5000, this, tryFetchConfig);
  8007. }
  8008. else {
  8009. console.error("❌ 达到最大重试次数,配置获取失败");
  8010. }
  8011. }
  8012. };
  8013. tryFetchConfig();
  8014. });
  8015. return false;
  8016. }
  8017. return true;
  8018. }
  8019. startPlaceBall() {
  8020. if (!this.isReadyForLoadNetSource()) {
  8021. return;
  8022. }
  8023. xGame.uiMgr.Show(UILevelDisplay);
  8024. }
  8025. hide() {
  8026. console.log('zh:uimain hide ...');
  8027. super.hide();
  8028. xGame.common.stopGirlPop(this.ui.talkNode);
  8029. }
  8030. onGetUserInfo(force = false) {
  8031. if (Moyu.isWx) {
  8032. let info = Moyu.getSystemInfo();
  8033. if (info)
  8034. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  8035. }
  8036. else {
  8037. Moyu.initUser(this, this.freshUser, force);
  8038. }
  8039. this.freshUser();
  8040. console.log('zh:5秒后更新用户信息');
  8041. setTimeout(() => {
  8042. DataMgr.getUserZiChanInfo(true);
  8043. }, 5000);
  8044. }
  8045. event_login_in() {
  8046. console.log("zh:event_login_in被触发");
  8047. this.freshUser();
  8048. }
  8049. freshUser() {
  8050. let user = Moyu.getUserInfo();
  8051. if (!user.isAuth) {
  8052. user.headIcon = 'res/ty_touxiang.png';
  8053. }
  8054. else {
  8055. DataMgr.upRankData();
  8056. }
  8057. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8058. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8059. let keyStr = keyForLoginInfo;
  8060. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8061. const d = LocalStorageManager.getItem(keyStr);
  8062. let ua = d.username;
  8063. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8064. }
  8065. else {
  8066. }
  8067. this.c_btn_for_user();
  8068. }
  8069. interuptSecretary() {
  8070. Laya.timer.clearAll(this);
  8071. this.playSecretaryRandomSound();
  8072. }
  8073. playSecretaryRandomSound() {
  8074. if (this.isHide)
  8075. return;
  8076. let time = xGame.common.randomNum(45000, 60000);
  8077. Laya.timer.once(time, this, () => {
  8078. if (this.isHide)
  8079. return;
  8080. let index = xGame.common.randomNum(4, 7);
  8081. xGame.soundMgr.playSound("s_main0" + index);
  8082. let words = 1;
  8083. switch (index) {
  8084. case 4:
  8085. words = 5;
  8086. break;
  8087. case 5:
  8088. words = 3;
  8089. break;
  8090. case 6:
  8091. words = 6;
  8092. break;
  8093. case 7:
  8094. words = 7;
  8095. break;
  8096. default:
  8097. break;
  8098. }
  8099. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8100. this.playSecretaryRandomSound();
  8101. });
  8102. }
  8103. openSecretaryView() {
  8104. xGame.uiMgr.Show(UISecretary);
  8105. Moyu.sendDataEvent("secretary");
  8106. }
  8107. openShopView() {
  8108. xGame.uiMgr.Show(UIShop, 1);
  8109. }
  8110. openShopView0() {
  8111. xGame.uiMgr.Show(UIShop, 0);
  8112. }
  8113. openSignView() {
  8114. xGame.uiMgr.Show(UISign);
  8115. }
  8116. openDrawView() {
  8117. xGame.uiMgr.Show(UIDraw);
  8118. }
  8119. openRanking() {
  8120. console.log('zh:phb openRanking');
  8121. xGame.uiMgr.Show(UIRanking);
  8122. Moyu.sendDataEvent("rankingList");
  8123. }
  8124. }
  8125. UIMain.uiName = "UIMain";
  8126. class UIGameEnd extends UIBase {
  8127. constructor() {
  8128. super();
  8129. this.success = false;
  8130. this.awardCoinNum = 1000;
  8131. this.awardDiamondNum = 10;
  8132. }
  8133. onConstructor() {
  8134. this.ui = ui_UIGameEnd.createInstance();
  8135. this.contentPane = this.ui;
  8136. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8137. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8138. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8139. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8140. this.ui.talkNode.visible = false;
  8141. if (Moyu.isKs)
  8142. this.ui.closeNode.closeBtn.x += 100;
  8143. }
  8144. updateType() {
  8145. switch (xGame.common.gameMode) {
  8146. case GameMode.classic:
  8147. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8148. this.ui.coinNode.visible = this.success;
  8149. if (!this.success) {
  8150. Laya.timer.once(500, this, () => {
  8151. xGame.uiMgr.Show(UIAddCoin);
  8152. });
  8153. }
  8154. else {
  8155. this.logEventForClassic_win();
  8156. }
  8157. this.logEventForClassic_complete();
  8158. this.ui.isGetAward.visible = false;
  8159. this.ui.leftBtn.c1.selectedIndex = 3;
  8160. this.ui.rightBtn.c1.selectedIndex = 0;
  8161. this.moneyNode.ui.c1.selectedIndex = 1;
  8162. break;
  8163. case GameMode.bigMove:
  8164. console.log('zh:招法模式 aaaaaa bigMove');
  8165. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8166. this.ui.coinNode.visible = this.success;
  8167. if (xGame.common.gameMode == GameMode.bigMove) {
  8168. if (this.success) {
  8169. DataMgr.setSkillSuccessTimes(1, true);
  8170. DataMgr.setSkillAccTimes(1);
  8171. }
  8172. else {
  8173. DataMgr.setSkillSuccessTimes(0, false);
  8174. }
  8175. }
  8176. this.logEventForRod_complete_N();
  8177. if (!this.success) {
  8178. Laya.timer.once(500, this, () => {
  8179. xGame.uiMgr.Show(UIAddCoin);
  8180. });
  8181. }
  8182. else {
  8183. this.logEventForRod_win();
  8184. }
  8185. this.ui.isGetAward.visible = false;
  8186. this.ui.leftBtn.c1.selectedIndex = 3;
  8187. this.ui.rightBtn.c1.selectedIndex = 0;
  8188. this.moneyNode.ui.c1.selectedIndex = 1;
  8189. break;
  8190. case GameMode.placeBall:
  8191. this.ui.coinNode.visible = false;
  8192. if (this.success) {
  8193. if (xGame.common.placeBallStarNum == 3) {
  8194. this.ui.c1.selectedIndex = 2;
  8195. }
  8196. else {
  8197. this.ui.c1.selectedIndex = 3;
  8198. }
  8199. let level = xGame.common.placeBallCurLevel;
  8200. if (level > 59) {
  8201. this.logEventForChallenge_level_complete(level);
  8202. }
  8203. else {
  8204. this.logEventForChallenge_level_N(level);
  8205. }
  8206. }
  8207. else {
  8208. this.ui.c1.selectedIndex = 4;
  8209. }
  8210. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8211. if (cfg.type == PlaceBallType.challenge) {
  8212. this.ui.c1.selectedIndex = 2;
  8213. }
  8214. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8215. this.updatePlaceBallBtn();
  8216. this.updatePlaceBallStarNum();
  8217. this.updatePlaceBallAwardState();
  8218. this.moneyNode.ui.c1.selectedIndex = 2;
  8219. this.moneyNode.checkPowerTime();
  8220. this.moneyNode.powerChange();
  8221. DataMgr.upRankData();
  8222. break;
  8223. default:
  8224. break;
  8225. }
  8226. }
  8227. logEventForRod_complete_N() {
  8228. let gfmsIdx = xGame.common.curPlayerSkillType;
  8229. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8230. let gfmc = 'Skyfall Shot';
  8231. if (gfmsIdx == 0) {
  8232. gfmc = 'Skyfall Shot';
  8233. }
  8234. if (gfmsIdx == 1) {
  8235. gfmc = 'Surging break';
  8236. }
  8237. if (gfmsIdx == 2) {
  8238. gfmc = 'Frost Lock';
  8239. }
  8240. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8241. console.log('zh:logEventForRod_complete_N level = ' + level);
  8242. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8243. let jsonStr = {
  8244. "count": 0,
  8245. "name": gfmc
  8246. };
  8247. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8248. const d = LocalStorageManager.getItem(keyStr);
  8249. jsonStr.count = d.count + 1;
  8250. LocalStorageManager.setItem(keyStr, jsonStr);
  8251. }
  8252. else {
  8253. LocalStorageManager.setItem(keyStr, jsonStr);
  8254. }
  8255. const d2 = LocalStorageManager.getItem(keyStr);
  8256. let count = d2.count;
  8257. console.log('zh:logEventForRod_complete_N count = ' + count);
  8258. if (count % 5 == 0) {
  8259. const reqStr = JSON.stringify(jsonStr);
  8260. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8261. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8262. }
  8263. }
  8264. logEventForRod_win() {
  8265. console.log('zh:logEventForRod_win,胜利');
  8266. let gfmsIdx = xGame.common.curPlayerSkillType;
  8267. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8268. let gfmc = 'Skyfall Shot';
  8269. if (gfmsIdx == 0) {
  8270. gfmc = 'Skyfall Shot';
  8271. }
  8272. if (gfmsIdx == 1) {
  8273. gfmc = 'Surging break';
  8274. }
  8275. if (gfmsIdx == 2) {
  8276. gfmc = 'Frost Lock';
  8277. }
  8278. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8279. console.log('zh:logEventForRod_win level = ' + level);
  8280. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8281. let jsonStr = {
  8282. "count": 1,
  8283. "name": gfmc + ' Lev' + level
  8284. };
  8285. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8286. const d = LocalStorageManager.getItem(keyStr);
  8287. jsonStr.count = d.count + 1;
  8288. LocalStorageManager.setItem(keyStr, jsonStr);
  8289. }
  8290. else {
  8291. LocalStorageManager.setItem(keyStr, jsonStr);
  8292. }
  8293. const reqStr = JSON.stringify(jsonStr);
  8294. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8295. }
  8296. logEventForClassic_win() {
  8297. console.log('zh:logEventForClassic_win,胜利');
  8298. let rtype = xGame.common.classicRoomType;
  8299. let msmc = '';
  8300. if (rtype == 1) {
  8301. msmc = 'beginner';
  8302. }
  8303. if (rtype == 2) {
  8304. msmc = 'expert';
  8305. }
  8306. if (rtype == 3) {
  8307. msmc = 'master';
  8308. }
  8309. let keyStr = 'sjmd_classic_win_' + rtype;
  8310. let jsonStr = {
  8311. "difficulty": msmc,
  8312. "classic_count": 1,
  8313. "difficulty_count": 1
  8314. };
  8315. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8316. const d = LocalStorageManager.getItem(keyStr);
  8317. jsonStr.classic_count = d.classic_count + 1;
  8318. jsonStr.difficulty_count = d.difficulty_count + 1;
  8319. LocalStorageManager.setItem(keyStr, jsonStr);
  8320. }
  8321. else {
  8322. LocalStorageManager.setItem(keyStr, jsonStr);
  8323. }
  8324. const reqStr = JSON.stringify(jsonStr);
  8325. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8326. }
  8327. logEventForClassic_complete() {
  8328. console.log('zh:logEventForClassic_complete,胜利');
  8329. let rtype = xGame.common.classicRoomType;
  8330. let msmc = '';
  8331. if (rtype == 1) {
  8332. msmc = 'beginner';
  8333. }
  8334. if (rtype == 2) {
  8335. msmc = 'expert';
  8336. }
  8337. if (rtype == 3) {
  8338. msmc = 'master';
  8339. }
  8340. let keyStr = 'sjmd_classic_complete_' + rtype;
  8341. let jsonStr = {
  8342. "msmc": msmc,
  8343. "count": 0
  8344. };
  8345. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8346. const d = LocalStorageManager.getItem(keyStr);
  8347. jsonStr.count = d.count + 1;
  8348. LocalStorageManager.setItem(keyStr, jsonStr);
  8349. }
  8350. else {
  8351. LocalStorageManager.setItem(keyStr, jsonStr);
  8352. }
  8353. if (jsonStr.count % 5 == 0) {
  8354. const reqStr = JSON.stringify(jsonStr);
  8355. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8356. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8357. }
  8358. }
  8359. updatePlaceBallBtn() {
  8360. this.ui.leftBtn.c1.selectedIndex = 5;
  8361. if (this.success) {
  8362. this.ui.rightBtn.c1.selectedIndex = 14;
  8363. }
  8364. else {
  8365. if (xGame.common.placeBallStarNum == 3) {
  8366. this.ui.rightBtn.c1.selectedIndex = 14;
  8367. }
  8368. else {
  8369. this.ui.rightBtn.c1.selectedIndex = 1;
  8370. }
  8371. }
  8372. }
  8373. updatePlaceBallStarNum() {
  8374. let starNum = xGame.common.placeBallStarNum;
  8375. if (starNum == 0)
  8376. this.ui.starNumNode.c1.selectedIndex = 3;
  8377. else {
  8378. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8379. }
  8380. }
  8381. updatePlaceBallAwardState() {
  8382. let level = xGame.common.placeBallCurLevel;
  8383. let starNum = xGame.common.placeBallStarNum;
  8384. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8385. let data = cfgTable.placeballData[level].award;
  8386. let cfg = cfgTable.placeballData[level];
  8387. this.awardDiamondNum = data[1];
  8388. this.awardCoinNum = data[0];
  8389. if (cfg.type == PlaceBallType.challenge) {
  8390. this.awardDiamondNum = 0;
  8391. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8392. }
  8393. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8394. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8395. if (cfg.type == PlaceBallType.challenge) {
  8396. this.ui.awardNode.coinNode.visible = true;
  8397. }
  8398. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8399. this.ui.awardNode.diamondNode.x = 265;
  8400. this.ui.awardNode.coinNode.x = 354;
  8401. }
  8402. else {
  8403. this.ui.awardNode.diamondNode.x = 291;
  8404. this.ui.awardNode.coinNode.x = 291;
  8405. }
  8406. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8407. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8408. if (this.awardCoinNum == 0) {
  8409. this.ui.awardNode.coinNode.numTxt.text = "";
  8410. }
  8411. if (getAward) {
  8412. this.ui.isGetAward.visible = true;
  8413. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8414. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8415. }
  8416. else {
  8417. this.ui.isGetAward.visible = false;
  8418. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8419. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8420. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8421. }
  8422. else {
  8423. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8424. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8425. }
  8426. }
  8427. }
  8428. show(success) {
  8429. super.show();
  8430. xGame.eventMgr.event(RESET_GAME);
  8431. this.success = success;
  8432. Laya.timer.clearAll(this);
  8433. this.playSecretaryAni();
  8434. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8435. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8436. offsetTime = Math.floor(offsetTime / 1000);
  8437. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8438. this.updateType();
  8439. Laya.timer.once(200, this, () => {
  8440. this.addAward(() => {
  8441. this.updateType();
  8442. Laya.timer.once(500, this, () => {
  8443. this.showChallengeLevel();
  8444. });
  8445. });
  8446. });
  8447. if (this.success) {
  8448. JSBridgeUtils.instance.showInternAd('gameend_success');
  8449. console.log('zh:game end 成功');
  8450. xGame.soundMgr.playSound('slots_roll01');
  8451. xGame.soundMgr.playSound("s_win");
  8452. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8453. this.diyGameDataUtilForGameWin();
  8454. this.updateGamePlaceBallData2Server();
  8455. }
  8456. else {
  8457. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8458. console.log('zh:game end失败');
  8459. xGame.soundMgr.playSound('matchwin01');
  8460. xGame.soundMgr.playSound("s_lose");
  8461. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8462. }
  8463. let challengeNum = DataMgr.getChallengeTimes();
  8464. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8465. DataMgr.setChallengeTimes(1);
  8466. }
  8467. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8468. DataMgr.setClassicTimes();
  8469. }
  8470. this.setGlobalFont(this.ui);
  8471. }
  8472. diyGameDataUtilForGameWin() {
  8473. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8474. switch (xGame.common.gameMode) {
  8475. case GameMode.classic:
  8476. console.log('zh:DiyGameDataUtilForGameWin 111');
  8477. case GameMode.bigMove:
  8478. console.log('zh:DiyGameDataUtilForGameWin 222');
  8479. this.restartGame();
  8480. break;
  8481. case GameMode.placeBall:
  8482. console.log('zh:DiyGameDataUtilForGameWin 333');
  8483. var level = xGame.common.placeBallCurLevel;
  8484. console.log('zh:练习模式 联系了多少LEV=' + level);
  8485. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8486. if (level > db_over_lev) {
  8487. DataMgr.setChallengeMode_overLev(level);
  8488. }
  8489. break;
  8490. default:
  8491. console.log('zh:DiyGameDataUtilForGameWin 444');
  8492. break;
  8493. }
  8494. }
  8495. updateGamePlaceBallData2Server() {
  8496. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8497. if (userInfo == null) {
  8498. return;
  8499. }
  8500. let pbdObj = DataMgr.getPlaceBallLevelList();
  8501. let reqData = xGame.httpMgr.getReqData();
  8502. let pd = JSON.parse(reqData);
  8503. pd.placeBallData = JSON.stringify(pbdObj);
  8504. reqData = JSON.stringify(pd);
  8505. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8506. try {
  8507. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8508. let code = res.code;
  8509. let msg = res.msg;
  8510. if (code == 401) {
  8511. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8512. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8513. return;
  8514. }
  8515. if (code == 200) {
  8516. let data = res.data;
  8517. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8518. }
  8519. else {
  8520. xGame.uiMgr.Show(UIMsg, msg);
  8521. }
  8522. }
  8523. catch (error) {
  8524. console.log('error=' + error);
  8525. alert(error);
  8526. }
  8527. finally {
  8528. }
  8529. });
  8530. }
  8531. showChallengeLevel() {
  8532. if (DataMgr.getChallengeTimes() != 0)
  8533. return;
  8534. let skill = DataMgr.getSkillAccTimes();
  8535. let put = DataMgr.getPlaceBallLevelList().length;
  8536. if (skill >= 3 || put >= 5) {
  8537. xGame.uiMgr.Show(UIInvitation);
  8538. this.hide();
  8539. }
  8540. }
  8541. addAward(callback) {
  8542. if (!this.success) {
  8543. callback && callback();
  8544. return;
  8545. }
  8546. switch (xGame.common.gameMode) {
  8547. case GameMode.classic:
  8548. this.awardCoinNum = xGame.common.passAwardCoin;
  8549. this.awardDiamondNum = 0;
  8550. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8551. break;
  8552. case GameMode.bigMove:
  8553. this.awardCoinNum = xGame.common.passAwardCoin;
  8554. this.awardDiamondNum = 0;
  8555. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8556. callback && callback();
  8557. break;
  8558. case GameMode.placeBall:
  8559. let level = xGame.common.placeBallCurLevel;
  8560. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8561. if (xGame.common.placeBallStarNum != 3) {
  8562. callback && callback();
  8563. return;
  8564. }
  8565. else {
  8566. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8567. if (getAward) {
  8568. callback && callback();
  8569. return;
  8570. }
  8571. }
  8572. let cfg = cfgTable.placeballData[level];
  8573. let data = cfgTable.placeballData[level].award;
  8574. this.awardCoinNum = data[0];
  8575. this.awardDiamondNum = data[1];
  8576. if (cfg.type == PlaceBallType.challenge) {
  8577. this.awardDiamondNum = 0;
  8578. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8579. }
  8580. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8581. let diamondAward;
  8582. if (this.awardDiamondNum > 0) {
  8583. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8584. xGame.common.getAward([diamondAward, coinAward], callback);
  8585. }
  8586. else {
  8587. xGame.common.getAward([coinAward], callback);
  8588. }
  8589. if (cfg.type == PlaceBallType.normal) {
  8590. DataMgr.setPlaceBallAward(level);
  8591. }
  8592. break;
  8593. default:
  8594. break;
  8595. }
  8596. }
  8597. playSecretaryAni_old() {
  8598. let parent = this.ui.secretary.displayObject;
  8599. parent.destroyChildren();
  8600. let xx = this.ui.secretary.width / 2;
  8601. let yy = this.ui.secretary.height;
  8602. let scale = xGame.common.getSecretaryScale();
  8603. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8604. if (this.success) {
  8605. let rand = Math.random() <= 0.5 ? 2 : 3;
  8606. xGame.common.secretary.play(data, rand, false, parent, () => {
  8607. xGame.common.secretary.play(data, 1, true, parent);
  8608. });
  8609. }
  8610. else {
  8611. xGame.common.secretary.play(data, 0, true, parent);
  8612. }
  8613. }
  8614. playSecretaryAni() {
  8615. let parent = this.ui.secretary.displayObject;
  8616. parent.destroyChildren();
  8617. let xx = this.ui.secretary.width / 2;
  8618. let yy = this.ui.secretary.height;
  8619. let scale = xGame.common.getSecretaryScale();
  8620. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8621. if (this.success) {
  8622. let rand = 0;
  8623. xGame.common.secretary.play(data, 0, true, parent);
  8624. }
  8625. else {
  8626. xGame.common.secretary.play(data, 0, true, parent);
  8627. }
  8628. }
  8629. restartGame() {
  8630. switch (xGame.common.gameMode) {
  8631. case GameMode.classic:
  8632. xGame.eventMgr.event(RESTART_GAME);
  8633. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8634. break;
  8635. case GameMode.bigMove:
  8636. this.hide();
  8637. xGame.eventMgr.event(RESTART_GAME);
  8638. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8639. break;
  8640. default:
  8641. break;
  8642. }
  8643. }
  8644. hide() {
  8645. super.hide();
  8646. xGame.common.stopGirlPop(this.ui.talkNode);
  8647. PlatMgr.showBanner(false);
  8648. }
  8649. returnHome() {
  8650. this.hide();
  8651. let showFailWords = !this.success;
  8652. xGame.uiMgr.Show(UIMain, showFailWords);
  8653. }
  8654. clickLeftBtn() {
  8655. switch (xGame.common.gameMode) {
  8656. case GameMode.classic:
  8657. case GameMode.bigMove:
  8658. this.returnHome();
  8659. break;
  8660. case GameMode.placeBall:
  8661. let level = xGame.common.placeBallCurLevel;
  8662. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8663. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8664. break;
  8665. default:
  8666. break;
  8667. }
  8668. }
  8669. powerStartPlaceBallLevel(level, btn) {
  8670. if (DataMgr.powerEnough()) {
  8671. btn.touchable = false;
  8672. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8673. btn.touchable = true;
  8674. DataMgr.setPower(-1);
  8675. xGame.eventMgr.event(POWER_TIME);
  8676. this.startPlaceBallLevel(level);
  8677. this.logEventForChallenge_level_start(level);
  8678. }));
  8679. }
  8680. else {
  8681. xGame.uiMgr.Show(UIPower, 0);
  8682. }
  8683. }
  8684. clickRightBtn() {
  8685. switch (xGame.common.gameMode) {
  8686. case GameMode.classic:
  8687. console.log('zh:clickRightBtn 111');
  8688. case GameMode.bigMove:
  8689. console.log('zh:clickRightBtn 222');
  8690. this.restartGame();
  8691. break;
  8692. case GameMode.placeBall:
  8693. console.log('zh:clickRightBtn 333');
  8694. let level = xGame.common.placeBallCurLevel;
  8695. let data = DataMgr.getPlaceBallLevel(level);
  8696. let curPss = data.play && !data.isCur;
  8697. if (curPss) {
  8698. console.log('zh:clickRightBtn 333-111');
  8699. console.log('zh:当前LV=' + level);
  8700. if (level == 60) {
  8701. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8702. Laya.timer.once(3000, this, () => {
  8703. this.returnHome();
  8704. });
  8705. }
  8706. else {
  8707. let lev = level + 1;
  8708. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8709. }
  8710. }
  8711. else {
  8712. console.log('zh:clickRightBtn 333-000');
  8713. Moyu.sendDataEvent("placeBallNextLevel");
  8714. console.log('zh:qjff_AD_for_uiGameEnd');
  8715. if (Laya.Browser.onAndroid) {
  8716. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8717. if (!boo) {
  8718. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8719. return;
  8720. }
  8721. }
  8722. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8723. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8724. }
  8725. else {
  8726. console.log('zh:AD 失败,直接发放奖励');
  8727. this.qjff_AD_for_uiGameEnd(level);
  8728. }
  8729. }
  8730. break;
  8731. default:
  8732. console.log('zh:clickRightBtn 444');
  8733. break;
  8734. }
  8735. }
  8736. logEventForChallenge_level_start(level) {
  8737. let keyStr = 'sjmd_challenge_level_start';
  8738. let jsonStr = {
  8739. "count": 0,
  8740. "gold_balance ": DataMgr.getCoin(),
  8741. "level": level,
  8742. "diamond_balance ": DataMgr.getDiamond()
  8743. };
  8744. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8745. const d = LocalStorageManager.getItem(keyStr);
  8746. if (level > d.level) {
  8747. jsonStr.count = d.count + 1;
  8748. LocalStorageManager.setItem(keyStr, jsonStr);
  8749. }
  8750. else {
  8751. }
  8752. }
  8753. else {
  8754. LocalStorageManager.setItem(keyStr, jsonStr);
  8755. }
  8756. const reqStr = JSON.stringify(jsonStr);
  8757. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8758. }
  8759. qjff_AD_for_uiGameEnd(level) {
  8760. DataMgr.setPlaceBallLevel(level, 1);
  8761. this.startPlaceBallLevel(level + 1);
  8762. }
  8763. startPlaceBallLevel(level) {
  8764. xGame.common.gameMode = GameMode.placeBall;
  8765. xGame.common.placeBallCurLevel = level;
  8766. xGame.uiMgr.Show(UIGame);
  8767. this.hide();
  8768. }
  8769. logEventForChallenge_level_complete(level) {
  8770. let keyStr = 'sjmd_challenge_level_complete';
  8771. let jsonStr = {
  8772. "count": 1,
  8773. "gold_balance ": DataMgr.getCoin(),
  8774. "level": level,
  8775. "diamond_balance ": DataMgr.getDiamond()
  8776. };
  8777. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8778. const d = LocalStorageManager.getItem(keyStr);
  8779. jsonStr.count = d.count + 1;
  8780. LocalStorageManager.setItem(keyStr, jsonStr);
  8781. }
  8782. else {
  8783. LocalStorageManager.setItem(keyStr, jsonStr);
  8784. }
  8785. const reqStr = JSON.stringify(jsonStr);
  8786. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8787. }
  8788. logEventForChallenge_level_N(level) {
  8789. console.log('zh:logEventForChallenge_level_N ' + level);
  8790. let keyStr = 'sjmd_challenge_level_N';
  8791. if (LocalStorageManager.hasKey(keyStr)) {
  8792. let lev = LocalStorageManager.getItem(keyStr);
  8793. if (level > lev) {
  8794. LocalStorageManager.setItem(keyStr, level);
  8795. }
  8796. if ((level) % 5 == 0) {
  8797. console.log('zh:每5关上报1次');
  8798. let sjmc = 'challenge_level_' + level;
  8799. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8800. let sjmcForFirebase = 'challenge_level_' + level;
  8801. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8802. }
  8803. else {
  8804. console.log('zh:5 no 上报');
  8805. }
  8806. }
  8807. else {
  8808. LocalStorageManager.setItem(keyStr, level);
  8809. }
  8810. }
  8811. }
  8812. UIGameEnd.uiName = "UIGameEnd";
  8813. class ui_UIVideoShare extends fgui.GComponent {
  8814. static createInstance() {
  8815. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8816. }
  8817. onConstruct() {
  8818. this.n10 = (this.getChild("n10"));
  8819. this.myNode = (this.getChild("myNode"));
  8820. this.t0 = this.getTransition("t0");
  8821. }
  8822. }
  8823. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8824. class UIVideoShare extends UIBase {
  8825. constructor() {
  8826. super();
  8827. this.success = false;
  8828. this.awardNum = 0;
  8829. this.isShared = true;
  8830. }
  8831. onConstructor() {
  8832. this.ui = ui_UIVideoShare.createInstance();
  8833. this.contentPane = this.ui;
  8834. this.isEject = false;
  8835. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8836. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8837. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8838. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8839. }
  8840. show(success) {
  8841. super.show();
  8842. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8843. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8844. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8845. this.success = success;
  8846. let time = xGame.common.randomNum(600, 1500);
  8847. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8848. if (success)
  8849. xGame.soundMgr.playSound("applause");
  8850. this.ui.t0.play();
  8851. this.checkShareState();
  8852. let times = DataMgr.getDailyVideoShareTimes();
  8853. this.awardNum = times == 0 ? 2000 : 200;
  8854. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8855. this.setGlobalFont(this.ui);
  8856. }
  8857. checkShareState() {
  8858. if (PlatMgr.forceShare == 0) {
  8859. this.ui.myNode.closeBtn.visible = true;
  8860. this.ui.myNode.tipsNode.visible = false;
  8861. this.ui.myNode.closeBtn.x = 90;
  8862. this.ui.myNode.shareBtn.x = 342;
  8863. }
  8864. else if (PlatMgr.forceShare == 1) {
  8865. this.ui.myNode.closeBtn.visible = false;
  8866. this.ui.myNode.tipsNode.visible = true;
  8867. this.ui.myNode.shareBtn.x = 218;
  8868. this.isShared = true;
  8869. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8870. }
  8871. }
  8872. checkForceShare() {
  8873. this.isShared = !this.isShared;
  8874. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8875. }
  8876. videoShare() {
  8877. if (PlatMgr.forceShare == 1) {
  8878. if (this.isShared) {
  8879. this.shareGame();
  8880. }
  8881. else {
  8882. this.hideSelf();
  8883. }
  8884. }
  8885. else {
  8886. this.shareGame();
  8887. }
  8888. }
  8889. shareGame() {
  8890. Moyu.sendDataEvent("VideoShare");
  8891. if (Moyu.canShare() > 100) {
  8892. Moyu.shareGame((success) => {
  8893. if (success) {
  8894. DataMgr.setDailyVideoShareTimes(1);
  8895. DataMgr.setCoin(this.awardNum);
  8896. }
  8897. this.hideSelf();
  8898. }, this);
  8899. }
  8900. else {
  8901. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8902. this.hideSelf();
  8903. }
  8904. }
  8905. hideSelf() {
  8906. this.hide();
  8907. xGame.uiMgr.Show(UIGameEnd, this.success);
  8908. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8909. xGame.common.screenImg.destroy();
  8910. xGame.common.screenImg = null;
  8911. }
  8912. }
  8913. }
  8914. UIVideoShare.uiName = "UIVideoShare";
  8915. class ui_UITips extends fgui.GComponent {
  8916. static createInstance() {
  8917. return (fgui.UIPackage.createObject("game", "UITips"));
  8918. }
  8919. onConstruct() {
  8920. this.n0 = (this.getChild("n0"));
  8921. this.myNode = (this.getChild("myNode"));
  8922. this.t0 = this.getTransition("t0");
  8923. }
  8924. }
  8925. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  8926. class UITips extends UIBase {
  8927. constructor() {
  8928. super();
  8929. this.type = 0;
  8930. }
  8931. onConstructor() {
  8932. this.ui = ui_UITips.createInstance();
  8933. this.contentPane = this.ui;
  8934. this.isEject = false;
  8935. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  8936. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  8937. }
  8938. show(tipsTxt, womanTxt, type) {
  8939. super.show();
  8940. this.ui.t0.play();
  8941. this.ui.myNode.tipsTxt.text = tipsTxt;
  8942. this.ui.myNode.womanTxt.text = womanTxt;
  8943. PlatMgr.showInsert(true);
  8944. this.ui.myNode.c1.selectedIndex = type;
  8945. this.type = type;
  8946. switch (this.type) {
  8947. case TipsType.exitGame:
  8948. xGame.common.gameMgr.gamePause = true;
  8949. break;
  8950. case TipsType.foul:
  8951. Laya.timer.once(200, this, () => {
  8952. xGame.common.gameMgr.gamePause = true;
  8953. });
  8954. break;
  8955. default:
  8956. break;
  8957. }
  8958. this.setGlobalFont(this.ui);
  8959. }
  8960. clickLeftBtn() {
  8961. this.hide();
  8962. xGame.common.gameMgr.gamePause = false;
  8963. switch (this.type) {
  8964. case TipsType.exitGame:
  8965. break;
  8966. case TipsType.foul:
  8967. break;
  8968. default:
  8969. break;
  8970. }
  8971. }
  8972. clickRightBtn() {
  8973. this.hide();
  8974. switch (this.type) {
  8975. case TipsType.exitGame:
  8976. xGame.eventMgr.event(RESET_GAME);
  8977. xGame.uiMgr.Show(UIMain);
  8978. Moyu.recordEnd(this, null);
  8979. xGame.common.longHelpLine = false;
  8980. break;
  8981. case TipsType.foul:
  8982. xGame.common.gameMgr.gamePause = false;
  8983. Laya.timer.clearAll(this);
  8984. break;
  8985. default:
  8986. break;
  8987. }
  8988. }
  8989. }
  8990. UITips.uiName = "UITips";
  8991. class GameMgr {
  8992. constructor() {
  8993. this.selfCamp = "";
  8994. this.selfFoulNum = 0;
  8995. this.selfBallArr = [];
  8996. this.selfTimer = 0;
  8997. this.selfScore = 0;
  8998. this.aiCamp = "";
  8999. this.aiFoulNum = 0;
  9000. this.aiBallArr = [];
  9001. this.aiTimer = 0;
  9002. this.aiScore = 0;
  9003. this.aiSkillLevelNum = 1;
  9004. this.targertScore = 0;
  9005. this.setTime = 30;
  9006. this.selfTurnRate = 0.5;
  9007. this.accTime = 0;
  9008. this.curFoul = "";
  9009. this.maxFoulTimes = 3;
  9010. this.isFirstInGame = true;
  9011. this.firstColliObj = null;
  9012. this.inHoleBalls = [];
  9013. this.blackNum = 8;
  9014. this.success = false;
  9015. this.holePosList = [];
  9016. this.posObj = {};
  9017. this._selfTurn = false;
  9018. this.lastRootBallPos = new Laya.Vector2(311, 430);
  9019. this.ensureBallType = false;
  9020. this.isOpenBall = true;
  9021. this.finishOneShoot = true;
  9022. this.isEnd = false;
  9023. this.isChangeTurn = false;
  9024. this.isInterrupt = false;
  9025. this.aiPlayedBreakArmy = false;
  9026. this.isTouchedBall = false;
  9027. this.finishBalls = 0;
  9028. this.needBalls = 0;
  9029. this.allBallNum = 0;
  9030. this.placeBallPosData = {};
  9031. this.curHP = 0;
  9032. this.showLongView = false;
  9033. this.firstShoot = true;
  9034. this._gamePause = false;
  9035. this.trunCount = 0;
  9036. this.isBlackInHole = false;
  9037. this.isEnter = true;
  9038. xGame.eventMgr.offAll(ALL_BALL_STOP);
  9039. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  9040. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  9041. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  9042. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  9043. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  9044. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  9045. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  9046. }
  9047. get gamePause() {
  9048. return this._gamePause;
  9049. }
  9050. set gamePause(v) {
  9051. if (v) {
  9052. Laya.physicsTimer.pause();
  9053. }
  9054. else {
  9055. Laya.physicsTimer.resume();
  9056. }
  9057. this._gamePause = v;
  9058. }
  9059. get selfTurn() {
  9060. return this._selfTurn;
  9061. }
  9062. set selfTurn(val) {
  9063. this.trunCount++;
  9064. this._selfTurn = val;
  9065. if (val) {
  9066. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9067. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9068. }
  9069. else {
  9070. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9071. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9072. if (this.trunCount > 1)
  9073. PlatMgr.openBox();
  9074. }
  9075. }
  9076. resetGame() {
  9077. this.inHoleBalls = [];
  9078. this.isFirstInGame = true;
  9079. this.firstColliObj = null;
  9080. this.aiCamp = "";
  9081. this.selfCamp = "";
  9082. this.aiFoulNum = 0;
  9083. this.selfFoulNum = 0;
  9084. this.selfBallArr = [];
  9085. this.aiBallArr = [];
  9086. this.gamePause = false;
  9087. this.ensureBallType = false;
  9088. this.isInterrupt = false;
  9089. this.updateLeftBall();
  9090. this.clearTime();
  9091. this.aiPlayedBreakArmy = false;
  9092. this.isBlackInHole = false;
  9093. this.placeBallPosData = {};
  9094. if (xGame.common.d3World.knifeRoot) {
  9095. xGame.common.d3World.knifeRoot.destroyChildren();
  9096. }
  9097. }
  9098. gameReady() {
  9099. this.trunCount = 0;
  9100. this.firstColliObj = null;
  9101. this.isFirstInGame = true;
  9102. this.selfTurn = Math.random() <= this.selfTurnRate;
  9103. let challengeNum = DataMgr.getChallengeTimes();
  9104. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9105. this.selfTurn = true;
  9106. }
  9107. if (xGame.common.gameMode == GameMode.placeBall)
  9108. this.selfTurn = true;
  9109. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9110. this.selfTurn = true;
  9111. }
  9112. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9113. this.checkGuide();
  9114. if (xGame.common.uiRodMethod)
  9115. xGame.common.uiRodMethod.resetRod();
  9116. xGame.common.d2World.getHelpLine();
  9117. this.isOpenBall = true;
  9118. this.isTouchedBall = false;
  9119. xGame.common.aiPlayer.stopRun();
  9120. this.setTime = 30;
  9121. let ui = xGame.common.gameUI.ui;
  9122. switch (xGame.common.gameMode) {
  9123. case GameMode.classic:
  9124. xGame.common.aiPlayer.init();
  9125. this.blackNum = 8;
  9126. this.placeRootBall();
  9127. this.peoplePlay(9, 10);
  9128. ui.wordsBtn.visible = true;
  9129. ui.aiWordsBtn.visible = true;
  9130. xGame.common.talkMgr.changeAIState(true);
  9131. DataMgr.gameData.gameCount++;
  9132. DataMgr.saveGameData();
  9133. break;
  9134. case GameMode.bigMove:
  9135. this.blackNum = -1;
  9136. this.selfScore = 0;
  9137. this.aiScore = 0;
  9138. xGame.common.aiPlayer.init();
  9139. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9140. this.updateSelfScore();
  9141. this.updateAIScore();
  9142. this.updateTargetSroce();
  9143. this.placeRootBall();
  9144. this.peoplePlay(9, 10);
  9145. ui.wordsBtn.visible = true;
  9146. ui.aiWordsBtn.visible = true;
  9147. xGame.common.talkMgr.changeAIState(true);
  9148. if (DataMgr.getSkillGuide() < 1)
  9149. DataMgr.gameData.gameCount = 0;
  9150. else {
  9151. DataMgr.gameData.gameCount++;
  9152. DataMgr.saveGameData();
  9153. PlatMgr.openTry();
  9154. }
  9155. if (xGame.common.d3World.knifeRoot) {
  9156. xGame.common.d3World.knifeRoot.destroyChildren();
  9157. }
  9158. break;
  9159. case GameMode.placeBall:
  9160. this.blackNum = -1;
  9161. this.selfTurn = true;
  9162. this.setTime = 10000;
  9163. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9164. this.curHP = this.placeBallData.hp;
  9165. if (this.placeBallData.ball == -1)
  9166. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9167. else
  9168. this.needBalls = this.placeBallData.ball;
  9169. console.log("需要的进球数目", this.needBalls);
  9170. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9171. this.finishBalls = 0;
  9172. this.placeBallPosData = {};
  9173. this.updatePlaceBallPos();
  9174. this.updatePlaceBallState();
  9175. this.finishOneShoot = true;
  9176. xGame.common.gameUI.ui.moveNode.visible = false;
  9177. this.isOpenBall = false;
  9178. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9179. ui.wordsBtn.visible = false;
  9180. ui.aiWordsBtn.visible = false;
  9181. xGame.common.talkMgr.changeAIState(false);
  9182. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9183. PlatMgr.openBox();
  9184. });
  9185. break;
  9186. default:
  9187. break;
  9188. }
  9189. this.showLongView = false;
  9190. xGame.common.wordsMgr.comboTimes = 1;
  9191. let guide = DataMgr.getSkillGuide();
  9192. if (guide)
  9193. xGame.eventMgr.event(WAIT_SHOOT);
  9194. xGame.common.upSkillLevel = false;
  9195. xGame.common.gameStartTime = new Date().getTime();
  9196. this.firstShoot = true;
  9197. }
  9198. checkGuide() {
  9199. let guide = DataMgr.getSkillGuide();
  9200. let gameUI = xGame.common.gameUI.ui;
  9201. gameUI.guide1.visible = false;
  9202. gameUI.guide2.visible = false;
  9203. gameUI.guide3.visible = false;
  9204. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9205. this.selfTurn = true;
  9206. }
  9207. else {
  9208. return;
  9209. }
  9210. let oneBall = this.getOneBall();
  9211. gameUI.guide1.visible = true;
  9212. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9213. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9214. }
  9215. getOneBall() {
  9216. let arr = xGame.common.d2World.ballArr;
  9217. for (let index = 0; index < arr.length; index++) {
  9218. if (arr[index].number == 0)
  9219. continue;
  9220. return arr[index];
  9221. }
  9222. }
  9223. updateSelfScore() {
  9224. let ui = xGame.common.gameUI.ui.topNode;
  9225. ui.selfScoreTxt.text = this.selfScore + "";
  9226. }
  9227. updateAIScore() {
  9228. let ui = xGame.common.gameUI.ui.topNode;
  9229. ui.aiScoreTxt.text = this.aiScore + "";
  9230. }
  9231. updateTargetSroce() {
  9232. let ui = xGame.common.gameUI.ui.topNode;
  9233. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9234. }
  9235. updateLeftBall() {
  9236. let topUI = xGame.common.gameUI.ui.topNode;
  9237. topUI.selfBallList.numItems = this.selfBallArr.length;
  9238. topUI.aiBallList.numItems = this.aiBallArr.length;
  9239. }
  9240. ballShoot() {
  9241. this.clearTime();
  9242. this.finishOneShoot = false;
  9243. xGame.common.gameUI.ui.moveNode.visible = false;
  9244. if (xGame.common.gameUI.ui.guideNode.visible) {
  9245. xGame.common.gameUI.ui.guideNode.visible = false;
  9246. }
  9247. if (this.firstShoot) {
  9248. this.firstShoot = false;
  9249. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9250. }
  9251. }
  9252. ensureCamp(number) {
  9253. this.ensureBallType = true;
  9254. this.isOpenBall = false;
  9255. if (xGame.common.gameMode != GameMode.classic)
  9256. return;
  9257. let full = [1, 2, 3, 4, 5, 6, 7];
  9258. let flower = [9, 10, 11, 12, 13, 14, 15];
  9259. let sayWords = "";
  9260. if (this.selfTurn) {
  9261. if (number <= 7) {
  9262. this.selfCamp = ballCamp.full;
  9263. this.selfBallArr = full;
  9264. this.aiCamp = ballCamp.flower;
  9265. this.aiBallArr = flower;
  9266. sayWords = cfgTable.wordsData[3].msg;
  9267. }
  9268. else {
  9269. this.selfCamp = ballCamp.flower;
  9270. this.selfBallArr = flower;
  9271. this.aiCamp = ballCamp.full;
  9272. this.aiBallArr = full;
  9273. sayWords = cfgTable.wordsData[4].msg;
  9274. }
  9275. }
  9276. else {
  9277. if (number <= 7) {
  9278. this.selfCamp = ballCamp.flower;
  9279. this.selfBallArr = flower;
  9280. this.aiCamp = ballCamp.full;
  9281. this.aiBallArr = full;
  9282. sayWords = cfgTable.wordsData[2].msg;
  9283. }
  9284. else {
  9285. this.selfCamp = ballCamp.full;
  9286. this.selfBallArr = full;
  9287. this.aiCamp = ballCamp.flower;
  9288. this.aiBallArr = flower;
  9289. sayWords = cfgTable.wordsData[1].msg;
  9290. }
  9291. }
  9292. this.updateLeftBall();
  9293. xGame.uiMgr.Show(UIMsg, sayWords);
  9294. }
  9295. updatePlaceBallState() {
  9296. let ui = xGame.common.gameUI.ui;
  9297. switch (this.placeBallData.type) {
  9298. case PlaceBallType.normal:
  9299. let normal = ui.placeNormalNode;
  9300. normal.hpTxt.text = this.curHP + "";
  9301. this.updatePlaceBallStar(normal);
  9302. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9303. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9304. break;
  9305. case PlaceBallType.challenge:
  9306. let challenge = ui.placeChallengeNode;
  9307. challenge.hpTxt.text = "Shots:" + this.curHP;
  9308. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9309. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9310. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9311. break;
  9312. default:
  9313. break;
  9314. }
  9315. }
  9316. playSubHpAni() {
  9317. let ui = xGame.common.gameUI.ui;
  9318. switch (this.placeBallData.type) {
  9319. case PlaceBallType.normal:
  9320. let normal = ui.placeNormalNode;
  9321. normal.hpTxt.visible = false;
  9322. normal.starAni.c1.selectedIndex = 1;
  9323. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9324. normal.hpTxt.visible = true;
  9325. normal.starAni.c1.selectedIndex = 0;
  9326. }));
  9327. break;
  9328. default:
  9329. break;
  9330. }
  9331. }
  9332. getEndStarNum() {
  9333. let num;
  9334. let level = xGame.common.placeBallCurLevel;
  9335. if (this.curHP == this.placeBallData.hp) {
  9336. num = 3;
  9337. }
  9338. else if (this.curHP <= 1) {
  9339. num = 1;
  9340. }
  9341. else {
  9342. num = 2;
  9343. }
  9344. if (!this.success) {
  9345. num = 0;
  9346. }
  9347. else {
  9348. DataMgr.setPlaceBallLevel(level, num);
  9349. }
  9350. let myType = cfgTable.placeballData[level].type;
  9351. if (this.success && myType == 1) {
  9352. num = 3;
  9353. }
  9354. xGame.common.placeBallStarNum = num;
  9355. }
  9356. updatePlaceBallStar(node) {
  9357. let star = 0;
  9358. if (this.curHP == this.placeBallData.hp) {
  9359. star = 3;
  9360. }
  9361. else if (this.curHP >= 2) {
  9362. star = 2;
  9363. }
  9364. else if (this.curHP == 1) {
  9365. star = 1;
  9366. }
  9367. else {
  9368. star = 0;
  9369. }
  9370. let temp;
  9371. for (let index = 1; index <= 3; index++) {
  9372. temp = node["star" + index];
  9373. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9374. }
  9375. node.myProgress.value = (star / 3) * 100;
  9376. }
  9377. openRegretView(isFoul, GoalNum, challenge = false) {
  9378. let regretType = -1;
  9379. if (isFoul) {
  9380. regretType = 1;
  9381. }
  9382. else {
  9383. if (GoalNum <= 0) {
  9384. regretType = 0;
  9385. }
  9386. }
  9387. if (challenge) {
  9388. regretType = 1;
  9389. }
  9390. if (regretType != -1) {
  9391. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9392. if (success) {
  9393. this.curHP++;
  9394. this.updatePlaceBallState();
  9395. this.setPlaceBallAllPos();
  9396. xGame.common.gameUI.ui.moveNode.visible = false;
  9397. }
  9398. else {
  9399. if (this.curHP <= 0) {
  9400. this.success = false;
  9401. this.gameEnd();
  9402. }
  9403. this.playSubHpAni();
  9404. }
  9405. this.updatePlaceBallState();
  9406. this.updatePlaceBallPos();
  9407. });
  9408. }
  9409. }
  9410. setPlaceBallAllPos() {
  9411. let allBall = xGame.common.d2World.ballArr;
  9412. let cfgArr = this.placeBallPosData;
  9413. let temp;
  9414. let obj;
  9415. for (let index = 0; index < allBall.length; index++) {
  9416. temp = allBall[index];
  9417. if (temp.destroyed)
  9418. continue;
  9419. obj = cfgArr[temp.myUNID];
  9420. if (obj && obj.src && !obj.src.destroyed) {
  9421. temp.gameObj.x = obj.posX;
  9422. temp.gameObj.y = obj.posY;
  9423. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9424. }
  9425. }
  9426. xGame.common.d2World.getHelpLine();
  9427. }
  9428. updatePlaceBallPos() {
  9429. let arr = xGame.common.d2World.ballArr;
  9430. let temp;
  9431. for (let index = 0; index < arr.length; index++) {
  9432. temp = arr[index];
  9433. if (!this.placeBallPosData[temp.myUNID]) {
  9434. this.placeBallPosData[temp.myUNID] = {
  9435. src: temp,
  9436. posX: temp.gameObj.x,
  9437. posY: temp.gameObj.y
  9438. };
  9439. }
  9440. else {
  9441. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9442. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9443. }
  9444. }
  9445. let check;
  9446. for (const key in this.placeBallPosData) {
  9447. check = this.placeBallPosData[key];
  9448. if (check.src.destroyed) {
  9449. delete this.placeBallPosData[key];
  9450. }
  9451. }
  9452. }
  9453. gameRun(type) {
  9454. if (this.gamePause)
  9455. return;
  9456. this.curFoul = this.getFoulType();
  9457. if (type) {
  9458. xGame.common.d2World.d2Gan.shoot();
  9459. xGame.common.gameUI.forceCancel();
  9460. this.curFoul = type;
  9461. }
  9462. this.isEnd = false;
  9463. this.isChangeTurn = true;
  9464. if (xGame.common.gameMode == GameMode.classic) {
  9465. this.judgeClassic(this.curFoul);
  9466. this.checkClassicWords(() => {
  9467. xGame.common.destroyClassicEmotion();
  9468. if (this.isEnd) {
  9469. if (this.isBlackInHole) {
  9470. xGame.common.gameUI.ui.blackAni.visible = true;
  9471. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9472. xGame.common.gameUI.ui.blackAni.visible = false;
  9473. this.gameEnd();
  9474. }));
  9475. }
  9476. else {
  9477. this.gameEnd();
  9478. }
  9479. }
  9480. else {
  9481. this.waitShoot();
  9482. xGame.eventMgr.event(WAIT_SHOOT);
  9483. }
  9484. });
  9485. }
  9486. else if (xGame.common.gameMode == GameMode.bigMove) {
  9487. xGame.common.aiPlayer.stopRun();
  9488. let scoreArr = this.getScore(this.curFoul);
  9489. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9490. this.isEnd = true;
  9491. }
  9492. this.checkBigSkillWords(() => {
  9493. if (this.isEnd) {
  9494. this.gameEnd();
  9495. }
  9496. else {
  9497. this.waitShoot();
  9498. xGame.eventMgr.event(WAIT_SHOOT);
  9499. }
  9500. });
  9501. }
  9502. else if (xGame.common.gameMode == GameMode.placeBall) {
  9503. xGame.common.destroyAwardSpine();
  9504. let isFoul = this.curFoul == FoulType.rootHole;
  9505. let GoalNum = this.inHoleBalls.length;
  9506. if (this.inHoleBalls.indexOf(0) > -1)
  9507. GoalNum -= 1;
  9508. if (isFoul) {
  9509. this.placeRootBall();
  9510. }
  9511. console.log("neeballs", this.needBalls);
  9512. console.log("当前完成的goalNum", GoalNum);
  9513. this.finishBalls += GoalNum;
  9514. console.log("当前完成的finishballs", this.finishBalls);
  9515. let need = this.needBalls;
  9516. if (this.placeBallData.type == PlaceBallType.challenge) {
  9517. need += 100;
  9518. }
  9519. if (this.finishBalls >= need) {
  9520. this.success = true;
  9521. this.gameEnd();
  9522. }
  9523. else {
  9524. switch (this.placeBallData.type) {
  9525. case PlaceBallType.normal:
  9526. if (!isFoul && GoalNum > 0) {
  9527. this.updatePlaceBallPos();
  9528. this.updatePlaceBallState();
  9529. }
  9530. else {
  9531. this.curHP--;
  9532. this.openRegretView(isFoul, GoalNum);
  9533. }
  9534. this.waitShoot();
  9535. xGame.eventMgr.event(WAIT_SHOOT);
  9536. break;
  9537. case PlaceBallType.challenge:
  9538. this.curHP--;
  9539. this.updatePlaceBallState();
  9540. if (isFoul) {
  9541. this.openRegretView(isFoul, GoalNum, true);
  9542. }
  9543. else {
  9544. this.updatePlaceBallPos();
  9545. if (this.curHP <= 0) {
  9546. this.success = true;
  9547. this.gameEnd();
  9548. }
  9549. }
  9550. this.waitShoot();
  9551. xGame.eventMgr.event(WAIT_SHOOT);
  9552. break;
  9553. default:
  9554. break;
  9555. }
  9556. }
  9557. }
  9558. }
  9559. checkClassicWords(callback) {
  9560. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9561. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9562. let type = this.getClassicWordsType();
  9563. if (condition && type != -1) {
  9564. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9565. xGame.soundMgr.playSound(str);
  9566. xGame.common.wordsMgr.playClassicWords(type, callback);
  9567. }
  9568. else {
  9569. Laya.timer.once(300, this, () => {
  9570. callback && callback();
  9571. });
  9572. }
  9573. }
  9574. getClassicWordsType() {
  9575. let d2world = xGame.common.d2World;
  9576. let type = -1;
  9577. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9578. type = ClassicWordsType.perfectShow;
  9579. return type;
  9580. }
  9581. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9582. type = ClassicWordsType.directShoot;
  9583. return type;
  9584. }
  9585. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9586. type = ClassicWordsType.anotherShoot;
  9587. return type;
  9588. }
  9589. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9590. type = ClassicWordsType.bigPower;
  9591. return type;
  9592. }
  9593. let minSpeed = 1;
  9594. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9595. type = ClassicWordsType.hardShoot;
  9596. return type;
  9597. }
  9598. if (this.inHoleBalls.length > 0) {
  9599. type = ClassicWordsType.directShoot;
  9600. return type;
  9601. }
  9602. return type;
  9603. }
  9604. checkBigSkillWords(callback) {
  9605. if (this.curFoul == FoulType.timeOut) {
  9606. callback && callback();
  9607. }
  9608. else {
  9609. let playSkill = false;
  9610. if (this.selfTurn) {
  9611. playSkill = true;
  9612. }
  9613. else {
  9614. if (!this.aiPlayedBreakArmy) {
  9615. this.aiPlayedBreakArmy = true;
  9616. playSkill = true;
  9617. }
  9618. if (this.aiCurSkill != SkillType.breakArmy) {
  9619. playSkill = true;
  9620. }
  9621. }
  9622. if (xGame.common.skillMgr.playedLastSkill) {
  9623. xGame.common.skillMgr.playedLastSkill = false;
  9624. playSkill = false;
  9625. }
  9626. if (playSkill) {
  9627. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9628. let selfExtra = 0;
  9629. let aiExtra = 0;
  9630. if (this.selfTurn)
  9631. selfExtra += extraScore;
  9632. else
  9633. aiExtra += extraScore;
  9634. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9635. this.isEnd = true;
  9636. }
  9637. this.playBigSkillTimes(callback);
  9638. });
  9639. }
  9640. else {
  9641. this.playBigSkillTimes(callback);
  9642. }
  9643. }
  9644. }
  9645. playBigSkillTimes(callback) {
  9646. let length = this.inHoleBalls.length;
  9647. if (this.inHoleBalls.indexOf(0) > -1) {
  9648. length = this.inHoleBalls.length - 1;
  9649. }
  9650. if (length <= 0) {
  9651. callback && callback();
  9652. return;
  9653. }
  9654. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9655. callback && callback();
  9656. });
  9657. }
  9658. playSkillTips() {
  9659. let levelNum = 0;
  9660. let curType;
  9661. if (this.selfTurn) {
  9662. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9663. curType = this.selfCurSkill;
  9664. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9665. levelNum += 5;
  9666. }
  9667. }
  9668. else {
  9669. levelNum = this.aiSkillLevelNum;
  9670. curType = this.aiCurSkill;
  9671. }
  9672. let str = ``;
  9673. switch (curType) {
  9674. case SkillType.highSpace:
  9675. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9676. break;
  9677. case SkillType.breakArmy:
  9678. str = `You pocketed ${levelNum} extra balls`;
  9679. break;
  9680. case SkillType.ice:
  9681. str = `${levelNum * 2} extra balls were frozen`;
  9682. break;
  9683. case SkillType.fireworks:
  9684. str = `${levelNum} extra balls exploded `;
  9685. break;
  9686. case SkillType.GuanYu:
  9687. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9688. break;
  9689. default:
  9690. break;
  9691. }
  9692. xGame.uiMgr.Show(UIMsg, str);
  9693. }
  9694. getFoulType() {
  9695. let foulType = "";
  9696. if (this.firstColliObj == null) {
  9697. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9698. return FoulType.rootHole;
  9699. }
  9700. return FoulType.notTouch;
  9701. }
  9702. else {
  9703. if (this.selfTurn) {
  9704. if (this.selfBallArr.length > 0) {
  9705. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9706. foulType = FoulType.wrongTouch;
  9707. }
  9708. }
  9709. else {
  9710. if (this.ensureBallType) {
  9711. }
  9712. else {
  9713. if (this.firstColliObj == this.blackNum) {
  9714. foulType = FoulType.wrongTouch;
  9715. }
  9716. }
  9717. }
  9718. }
  9719. else {
  9720. if (this.aiBallArr.length > 0) {
  9721. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9722. foulType = FoulType.wrongTouch;
  9723. }
  9724. }
  9725. else {
  9726. if (this.ensureBallType) {
  9727. }
  9728. else {
  9729. if (this.firstColliObj == this.blackNum) {
  9730. foulType = FoulType.wrongTouch;
  9731. }
  9732. }
  9733. }
  9734. }
  9735. if (this.inHoleBalls.length <= 0) {
  9736. return foulType;
  9737. }
  9738. let temp;
  9739. if (this.inHoleBalls.indexOf(0) > -1) {
  9740. foulType = FoulType.rootHole;
  9741. }
  9742. else {
  9743. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9744. temp = this.inHoleBalls[index];
  9745. if (this.selfTurn) {
  9746. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9747. foulType = FoulType.wrongHole;
  9748. break;
  9749. }
  9750. }
  9751. else {
  9752. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9753. foulType = FoulType.wrongHole;
  9754. break;
  9755. }
  9756. }
  9757. }
  9758. }
  9759. let foo;
  9760. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9761. temp = this.inHoleBalls[index];
  9762. foo = this.selfBallArr.indexOf(temp);
  9763. if (foo > -1) {
  9764. this.selfBallArr.splice(foo, 1);
  9765. }
  9766. foo = this.aiBallArr.indexOf(temp);
  9767. if (foo > -1) {
  9768. this.aiBallArr.splice(foo, 1);
  9769. }
  9770. }
  9771. this.updateLeftBall();
  9772. }
  9773. return foulType;
  9774. }
  9775. judgeGameEndByBlack(arr) {
  9776. if (this.selfTurn) {
  9777. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9778. this.selfFoulNum = this.maxFoulTimes;
  9779. return true;
  9780. }
  9781. }
  9782. else {
  9783. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9784. this.aiFoulNum = this.maxFoulTimes;
  9785. return true;
  9786. }
  9787. }
  9788. }
  9789. judgeClassic(type) {
  9790. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9791. xGame.common.aiPlayer.stopRun();
  9792. if (this.judgeNormalSuccess()) {
  9793. this.isEnd = true;
  9794. return;
  9795. }
  9796. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9797. if (this.selfTurn) {
  9798. if (isFoul) {
  9799. this.selfFoulNum++;
  9800. }
  9801. if (this.selfFoulNum >= this.maxFoulTimes) {
  9802. this.success = false;
  9803. this.isEnd = true;
  9804. return;
  9805. }
  9806. }
  9807. else {
  9808. if (isFoul)
  9809. this.aiFoulNum++;
  9810. if (this.aiFoulNum >= this.maxFoulTimes) {
  9811. this.success = true;
  9812. this.isEnd = true;
  9813. return;
  9814. }
  9815. }
  9816. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9817. this.isChangeTurn = false;
  9818. }
  9819. else {
  9820. this.isInterrupt = true;
  9821. }
  9822. }
  9823. waitShoot() {
  9824. if (xGame.common.gameMode == GameMode.classic) {
  9825. switch (this.curFoul) {
  9826. case FoulType.timeOut:
  9827. case FoulType.rootHole:
  9828. this.selfTurn = !this.selfTurn;
  9829. this.peoplePlay(5, 6, true);
  9830. break;
  9831. case FoulType.notTouch:
  9832. this.selfTurn = !this.selfTurn;
  9833. this.peoplePlay(7, 7);
  9834. break;
  9835. case FoulType.wrongHole:
  9836. this.selfTurn = !this.selfTurn;
  9837. this.peoplePlay(11, 11);
  9838. break;
  9839. default:
  9840. if (this.inHoleBalls.length > 0) {
  9841. this.peoplePlay(0, 0, false, false);
  9842. }
  9843. else {
  9844. this.selfTurn = !this.selfTurn;
  9845. this.peoplePlay(7, 7);
  9846. }
  9847. break;
  9848. }
  9849. }
  9850. else if (xGame.common.gameMode == GameMode.bigMove) {
  9851. if (this.curFoul == FoulType.timeOut) {
  9852. this.selfTurn = !this.selfTurn;
  9853. this.peoplePlay(14, 15);
  9854. this.placeRootBall();
  9855. }
  9856. else {
  9857. this.selfTurn = !this.selfTurn;
  9858. if (this.curFoul == FoulType.rootHole) {
  9859. this.peoplePlay(12, 13);
  9860. this.placeRootBall();
  9861. }
  9862. else {
  9863. this.peoplePlay(0, 0, false, false);
  9864. }
  9865. }
  9866. }
  9867. else if (xGame.common.gameMode == GameMode.placeBall) {
  9868. this.finishOneShoot = true;
  9869. }
  9870. this.gameResult();
  9871. }
  9872. gameResult() {
  9873. this.firstColliObj = null;
  9874. this.inHoleBalls = [];
  9875. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9876. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9877. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9878. if (xGame.common.uiRodMethod)
  9879. xGame.common.uiRodMethod.resetRod();
  9880. xGame.common.d2World.rootBall.showSelf();
  9881. this.clearIceSkill();
  9882. if (this.selfTurn) {
  9883. PlatMgr.gameInsert();
  9884. }
  9885. xGame.common.d3World.knifeRoot.destroyChildren();
  9886. if (this.selfTurn) {
  9887. xGame.common.gameUI.showHelpLineGuide();
  9888. xGame.common.gameUI.setTurnAlpha(true);
  9889. }
  9890. else {
  9891. xGame.common.gameUI.setTurnAlpha(false);
  9892. }
  9893. }
  9894. getScore(type) {
  9895. let selfAdd = 0;
  9896. let aiAdd = 0;
  9897. if (type == FoulType.timeOut) {
  9898. if (this.selfTurn)
  9899. aiAdd += 3;
  9900. else
  9901. selfAdd += 3;
  9902. }
  9903. else {
  9904. if (this.inHoleBalls.length > 0) {
  9905. if (this.selfTurn) {
  9906. if (type == FoulType.rootHole) {
  9907. aiAdd += 3;
  9908. if (this.inHoleBalls.length - 1 > 0) {
  9909. selfAdd += this.inHoleBalls.length - 1;
  9910. }
  9911. }
  9912. else {
  9913. selfAdd += this.inHoleBalls.length;
  9914. }
  9915. }
  9916. else {
  9917. if (type == FoulType.rootHole) {
  9918. selfAdd += 3;
  9919. if (this.inHoleBalls.length - 1 > 0) {
  9920. aiAdd += this.inHoleBalls.length - 1;
  9921. }
  9922. }
  9923. else {
  9924. aiAdd += this.inHoleBalls.length;
  9925. }
  9926. }
  9927. }
  9928. }
  9929. return [selfAdd, aiAdd];
  9930. }
  9931. judgeScoreEnd(selfAdd, aiAdd) {
  9932. this.selfScore += selfAdd;
  9933. this.aiScore += aiAdd;
  9934. this.updateAIScore();
  9935. this.updateSelfScore();
  9936. if (this.selfScore >= this.targertScore) {
  9937. this.success = true;
  9938. return true;
  9939. }
  9940. if (this.aiScore >= this.targertScore) {
  9941. this.success = false;
  9942. return true;
  9943. }
  9944. let ballArr = xGame.common.d2World.ballArr;
  9945. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9946. if (this.selfScore > this.aiScore) {
  9947. this.success = true;
  9948. return true;
  9949. }
  9950. else if (this.selfScore < this.aiScore) {
  9951. this.success = false;
  9952. return true;
  9953. }
  9954. else {
  9955. if (this.selfTurn) {
  9956. this.success = false;
  9957. }
  9958. else {
  9959. this.success = true;
  9960. }
  9961. return true;
  9962. }
  9963. }
  9964. }
  9965. clearIceSkill() {
  9966. let arr = xGame.common.d2World.ballArr;
  9967. let temp;
  9968. if (this.selfTurn) {
  9969. if (this.selfCurSkill == SkillType.ice) {
  9970. for (let index = 0; index < arr.length; index++) {
  9971. temp = arr[index];
  9972. if (temp.ballFunc == "ice") {
  9973. temp.setBallFunc("normal", "self");
  9974. }
  9975. }
  9976. }
  9977. }
  9978. else {
  9979. if (this.aiCurSkill == SkillType.ice) {
  9980. for (let index = 0; index < arr.length; index++) {
  9981. temp = arr[index];
  9982. if (temp.ballFunc == "ice") {
  9983. temp.setBallFunc("normal", "ai");
  9984. }
  9985. }
  9986. }
  9987. }
  9988. }
  9989. judgeNormalSuccess() {
  9990. if (this.selfTurn) {
  9991. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9992. this.success = true;
  9993. return true;
  9994. }
  9995. }
  9996. else {
  9997. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9998. this.success = false;
  9999. return true;
  10000. }
  10001. }
  10002. }
  10003. gameEnd() {
  10004. if (Moyu.isTT) {
  10005. xGame.common.screenImg = getScreenImg();
  10006. }
  10007. console.log("游戏结束", this.success);
  10008. xGame.common.aiPlayer.stopRun();
  10009. if (xGame.common.gameMode == GameMode.placeBall) {
  10010. this.getEndStarNum();
  10011. this.updatePlaceBallState();
  10012. }
  10013. this.isEnter = false;
  10014. Moyu.recordEnd(this, () => {
  10015. if (this.isEnter)
  10016. return;
  10017. this.isEnter = true;
  10018. console.log("进入录结束回调");
  10019. this.enterNext();
  10020. });
  10021. Laya.timer.once(1000, this, () => {
  10022. if (this.isEnter)
  10023. return;
  10024. this.isEnter = true;
  10025. this.enterNext();
  10026. });
  10027. xGame.common.longHelpLine = false;
  10028. }
  10029. enterNext() {
  10030. Laya.timer.clearAll(this);
  10031. if (Moyu.canShare() > 100 || Moyu.isKs) {
  10032. xGame.uiMgr.Show(UIVideoShare, this.success);
  10033. }
  10034. else {
  10035. xGame.uiMgr.Show(UIGameEnd, this.success);
  10036. }
  10037. }
  10038. aiLeave() {
  10039. let ui = xGame.common.gameUI.ui;
  10040. ui.topNode.aiNameTxt.text = "offline";
  10041. }
  10042. aiGameEnd(suc) {
  10043. this.success = suc;
  10044. xGame.common.aiPlayer.stopRun();
  10045. if (this.success) {
  10046. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  10047. Laya.timer.once(1000, this, () => {
  10048. this.clearTime();
  10049. this.gameEnd();
  10050. });
  10051. }
  10052. }
  10053. openTimer() {
  10054. let src = xGame.common.gameUI;
  10055. if (this.selfTurn) {
  10056. src.ui.topNode.selfProgress.visible = true;
  10057. src.ui.topNode.aiProgress.visible = false;
  10058. this.curTimer = src.ui.topNode.selfProgress;
  10059. }
  10060. else {
  10061. src.ui.topNode.selfProgress.visible = false;
  10062. src.ui.topNode.aiProgress.visible = true;
  10063. this.curTimer = src.ui.topNode.aiProgress;
  10064. }
  10065. this.accTime = 0;
  10066. Laya.timer.clearAll(this);
  10067. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10068. this.curTimer.value = 100;
  10069. }
  10070. updateTime(dt) {
  10071. if (this.gamePause)
  10072. return;
  10073. this.accTime += dt;
  10074. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10075. if (this.accTime >= this.setTime) {
  10076. this.clearTime();
  10077. console.log("时钟进入了gameRun");
  10078. this.gameRun(FoulType.timeOut);
  10079. }
  10080. }
  10081. clearTime() {
  10082. let src = xGame.common.gameUI;
  10083. src.ui.topNode.selfProgress.visible = false;
  10084. src.ui.topNode.aiProgress.visible = false;
  10085. Laya.timer.clearAll(this);
  10086. }
  10087. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10088. let ui = xGame.common.gameUI.ui;
  10089. let selfMsg, aiMsg;
  10090. if (sayWords) {
  10091. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10092. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10093. if (Foul) {
  10094. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10095. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10096. this.placeRootBall();
  10097. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10098. if (this.curFoul == FoulType.rootHole) {
  10099. if (!DataMgr.getRootBallFoul()) {
  10100. DataMgr.setRootBallFoul();
  10101. aiMsg = "";
  10102. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10103. let woman = "Boss, pay attention next time~";
  10104. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10105. }
  10106. }
  10107. else if (this.curFoul == FoulType.timeOut) {
  10108. if (!DataMgr.getTimeoutFoul()) {
  10109. DataMgr.setTimeoutFoul();
  10110. aiMsg = "";
  10111. let tips = "Game timeout, 3 fouls, this game failed.";
  10112. let woman = "Boss, pay attention to the timeline~";
  10113. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10114. }
  10115. }
  10116. }
  10117. }
  10118. }
  10119. if (this.selfTurn) {
  10120. if (sayWords) {
  10121. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10122. ui.selfTurn.visible = true;
  10123. ui.aiTurn.visible = false;
  10124. ui.selfTurn.t0.play();
  10125. Moyu.vibration();
  10126. });
  10127. }
  10128. }
  10129. else {
  10130. let aiNum = xGame.tools.random(1, 11);
  10131. let challengeNum = DataMgr.getChallengeTimes();
  10132. let delay = false;
  10133. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10134. aiNum = 9;
  10135. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10136. aiNum = 3;
  10137. if (challengeNum == 3) {
  10138. if (!this.showLongView) {
  10139. this.showLongView = true;
  10140. delay = true;
  10141. }
  10142. }
  10143. }
  10144. }
  10145. if (delay) {
  10146. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10147. if (success) {
  10148. xGame.common.longHelpLine = true;
  10149. xGame.common.d2World.getHelpLine();
  10150. }
  10151. else {
  10152. aiNum = 10;
  10153. }
  10154. xGame.common.aiPlayer.setAiLevel(aiNum);
  10155. if (sayWords) {
  10156. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10157. xGame.common.aiPlayer.runAI();
  10158. ui.selfTurn.visible = false;
  10159. ui.aiTurn.visible = true;
  10160. ui.aiTurn.t0.play();
  10161. });
  10162. }
  10163. else {
  10164. xGame.common.aiPlayer.runAI();
  10165. }
  10166. this.openTimer();
  10167. this.finishOneShoot = true;
  10168. if (this.selfTurn) {
  10169. ui.topNode.selfKuang.visible = true;
  10170. ui.topNode.aiKuang.visible = false;
  10171. ui.topNode.selfTips.visible = true;
  10172. ui.topNode.aiTips.visible = false;
  10173. }
  10174. else {
  10175. ui.topNode.selfKuang.visible = false;
  10176. ui.topNode.aiKuang.visible = true;
  10177. ui.topNode.selfTips.visible = false;
  10178. ui.topNode.aiTips.visible = true;
  10179. }
  10180. });
  10181. return;
  10182. }
  10183. if (xGame.common.gameMode == GameMode.classic) {
  10184. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10185. if (cfg) {
  10186. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10187. aiNum = aiLevel;
  10188. }
  10189. }
  10190. xGame.common.aiPlayer.setAiLevel(aiNum);
  10191. if (sayWords) {
  10192. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10193. xGame.common.aiPlayer.runAI();
  10194. ui.selfTurn.visible = false;
  10195. ui.aiTurn.visible = true;
  10196. ui.aiTurn.t0.play();
  10197. });
  10198. }
  10199. else {
  10200. xGame.common.aiPlayer.runAI();
  10201. }
  10202. }
  10203. this.openTimer();
  10204. this.finishOneShoot = true;
  10205. if (this.selfTurn) {
  10206. ui.topNode.selfKuang.visible = true;
  10207. ui.topNode.aiKuang.visible = false;
  10208. ui.topNode.selfTips.visible = true;
  10209. ui.topNode.aiTips.visible = false;
  10210. }
  10211. else {
  10212. ui.topNode.selfKuang.visible = false;
  10213. ui.topNode.aiKuang.visible = true;
  10214. ui.topNode.selfTips.visible = false;
  10215. ui.topNode.aiTips.visible = true;
  10216. }
  10217. }
  10218. placeRootBall() {
  10219. let rootBall = xGame.common.d2World.rootBall;
  10220. if (!rootBall)
  10221. return;
  10222. rootBall.gameObj.x = this.lastRootBallPos.x;
  10223. rootBall.gameObj.y = this.lastRootBallPos.y;
  10224. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10225. let moveNode = xGame.common.gameUI.ui.moveNode;
  10226. moveNode.visible = true;
  10227. moveNode.x = this.lastRootBallPos.x;
  10228. moveNode.y = this.lastRootBallPos.y;
  10229. if (!this.selfTurn) {
  10230. xGame.common.aiPlayer.resetRoot();
  10231. }
  10232. }
  10233. }
  10234. class ui_guanyuAni extends fgui.GComponent {
  10235. static createInstance() {
  10236. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10237. }
  10238. onConstruct() {
  10239. this.n0 = (this.getChild("n0"));
  10240. }
  10241. }
  10242. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10243. class UIFireworks extends UIBase {
  10244. constructor() {
  10245. super();
  10246. }
  10247. onConstructor() {
  10248. this.isEject = false;
  10249. }
  10250. show(callback) {
  10251. super.show();
  10252. }
  10253. }
  10254. UIFireworks.uiName = "UIFireworks";
  10255. class ui_UIGuanYu extends fgui.GComponent {
  10256. static createInstance() {
  10257. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10258. }
  10259. onConstruct() {
  10260. this.n2 = (this.getChild("n2"));
  10261. this.n1 = (this.getChild("n1"));
  10262. this.n3 = (this.getChild("n3"));
  10263. this.n4 = (this.getChild("n4"));
  10264. this.n5 = (this.getChild("n5"));
  10265. this.n6 = (this.getChild("n6"));
  10266. this.n8 = (this.getChild("n8"));
  10267. this.n7 = (this.getChild("n7"));
  10268. this.t0 = this.getTransition("t0");
  10269. }
  10270. }
  10271. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10272. class UIGuanYu extends UIBase {
  10273. constructor() {
  10274. super();
  10275. }
  10276. onConstructor() {
  10277. this.ui = ui_UIGuanYu.createInstance();
  10278. this.contentPane = this.ui;
  10279. this.isEject = false;
  10280. }
  10281. show(callback) {
  10282. super.show();
  10283. this.ui.t0.play(Laya.Handler.create(this, () => {
  10284. callback && callback();
  10285. this.hide();
  10286. }));
  10287. this.setGlobalFont(this.ui);
  10288. }
  10289. }
  10290. UIGuanYu.uiName = "UIGuanYu";
  10291. class SkillMgr {
  10292. constructor() {
  10293. this.leveNum = 0;
  10294. this.extraScore = 0;
  10295. this.selfTurn = false;
  10296. this.playedLastSkill = false;
  10297. this.tweenArr = [];
  10298. this._finishNum = 0;
  10299. this._curFinish = 0;
  10300. this._rootX = 0;
  10301. this._rootY = 0;
  10302. this.knifeTimes = 0;
  10303. this.knifeV2 = new Laya.Vector2();
  10304. this.knifeV3 = new Laya.Vector3();
  10305. this.rtStarX = 0;
  10306. this.rtStarY = 0;
  10307. this.addBigSkillSpine();
  10308. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10309. }
  10310. addBigSkillSpine() {
  10311. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10312. console.log("extra2 success");
  10313. });
  10314. }
  10315. runBigSkill(callback) {
  10316. this.tweenArr = [];
  10317. this.callback = callback;
  10318. this.judgeSkill();
  10319. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10320. let guide = DataMgr.getSkillGuide();
  10321. if (!xGame.common.gameMgr.selfTurn) {
  10322. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10323. }
  10324. else {
  10325. if (xGame.common.temSelfLevel != 0) {
  10326. this.leveNum = xGame.common.temSelfLevel;
  10327. }
  10328. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10329. this.leveNum += 5;
  10330. }
  10331. }
  10332. if (guide == 0) {
  10333. DataMgr.setSkillGuide(1);
  10334. if (DataMgr.getNewUser()) {
  10335. Moyu.sendDataEvent("gameFirstPlay");
  10336. DataMgr.setNewUser();
  10337. }
  10338. }
  10339. this.playSpineAni(() => {
  10340. switch (this.curSkill) {
  10341. case SkillType.highSpace:
  10342. this.runHighSpace();
  10343. break;
  10344. case SkillType.breakArmy:
  10345. this.runBreakArmy();
  10346. break;
  10347. case SkillType.ice:
  10348. this.runIce();
  10349. break;
  10350. case SkillType.fireworks:
  10351. this.runFireworks();
  10352. break;
  10353. case SkillType.GuanYu:
  10354. this.runGuanYu();
  10355. break;
  10356. default:
  10357. break;
  10358. }
  10359. });
  10360. }
  10361. judgeSkill() {
  10362. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10363. let gameMgr = xGame.common.gameMgr;
  10364. let type;
  10365. for (let index = 0; index < typeArr.length; index++) {
  10366. type = typeArr[index];
  10367. if (gameMgr.selfTurn) {
  10368. if (gameMgr.selfCurSkill == type) {
  10369. this.selfTurn = true;
  10370. this.curSkill = type;
  10371. return;
  10372. }
  10373. }
  10374. else {
  10375. if (gameMgr.aiCurSkill == type) {
  10376. this.selfTurn = false;
  10377. this.curSkill = type;
  10378. return;
  10379. }
  10380. }
  10381. }
  10382. }
  10383. playSpineAni(callback) {
  10384. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10385. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10386. parent.destroyChildren();
  10387. let aniIndex = 0;
  10388. let skillSpine;
  10389. switch (this.curSkill) {
  10390. case SkillType.highSpace:
  10391. aniIndex = 1;
  10392. xGame.soundMgr.playSound("skill01");
  10393. skillSpine = this.skillSpine2;
  10394. data.scaleX = 0.5;
  10395. data.scaleY = 0.5;
  10396. skillSpine.play(data, 1, false, parent, () => {
  10397. callback && callback();
  10398. });
  10399. break;
  10400. case SkillType.breakArmy:
  10401. aniIndex = 2;
  10402. xGame.soundMgr.playSound("skill02");
  10403. skillSpine = this.skillSpine2;
  10404. data.scaleX = 0.5;
  10405. data.scaleY = 0.5;
  10406. skillSpine.play(data, 2, false, parent, () => {
  10407. callback && callback();
  10408. });
  10409. break;
  10410. case SkillType.ice:
  10411. aniIndex = 0;
  10412. xGame.soundMgr.playSound("skill03");
  10413. skillSpine = this.skillSpine2;
  10414. data.scaleX = 0.5;
  10415. data.scaleY = 0.5;
  10416. skillSpine.play(data, 0, false, parent, () => {
  10417. callback && callback();
  10418. });
  10419. break;
  10420. case SkillType.fireworks:
  10421. xGame.soundMgr.playSound("skill_04_01");
  10422. xGame.soundMgr.playSound("skill04");
  10423. xGame.uiMgr.Show(UIFireworks, callback);
  10424. break;
  10425. case SkillType.GuanYu:
  10426. xGame.soundMgr.playSound("skill05_1");
  10427. xGame.soundMgr.playSound("skill05");
  10428. xGame.uiMgr.Show(UIGuanYu, callback);
  10429. break;
  10430. default:
  10431. break;
  10432. }
  10433. }
  10434. getAllBallArr() {
  10435. let arr = xGame.common.d2World.ballArr;
  10436. let outArr = [];
  10437. for (let index = 0; index < arr.length; index++) {
  10438. if (arr[index] instanceof D2RootBallSrc)
  10439. continue;
  10440. if (arr[index].ballFunc == "ice")
  10441. continue;
  10442. if (arr[index].destroyed)
  10443. continue;
  10444. outArr.push(arr[index]);
  10445. }
  10446. return outArr;
  10447. }
  10448. getOneArr(deletObj) {
  10449. let allArr = this.getAllBallArr();
  10450. let temp;
  10451. for (let index = 0; index < allArr.length; index++) {
  10452. temp = allArr[index];
  10453. if (temp.id == deletObj.id) {
  10454. allArr.splice(index, 1);
  10455. break;
  10456. }
  10457. }
  10458. return allArr;
  10459. }
  10460. getNearBallBag(ball) {
  10461. let ui = xGame.common.gameUI.ui;
  10462. let circleArr = [];
  10463. for (let index = 1; index <= 6; index++) {
  10464. circleArr.push(ui.border["circle" + index]);
  10465. }
  10466. let outIndex = 0;
  10467. let temp;
  10468. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10469. ;
  10470. let dis = 0;
  10471. for (let index = 1; index < circleArr.length; index++) {
  10472. temp = circleArr[index];
  10473. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10474. if (dis < min) {
  10475. min = dis;
  10476. outIndex = index;
  10477. }
  10478. }
  10479. return [circleArr[outIndex], outIndex];
  10480. }
  10481. ballFlyToBag(ballArr, time = 300) {
  10482. let temp;
  10483. let hole;
  10484. this._finishNum = ballArr.length;
  10485. this._curFinish = 0;
  10486. let holeObj = {};
  10487. let holeCfg = {
  10488. "1": 0,
  10489. "2": 0,
  10490. "3": 0,
  10491. "4": 0,
  10492. "5": 0,
  10493. "6": 0
  10494. };
  10495. for (let index = 0; index < ballArr.length; index++) {
  10496. temp = ballArr[index];
  10497. temp.outColli.isSensor = true;
  10498. temp.innerColli.isSensor = true;
  10499. temp.isRunSkillAni = true;
  10500. let holeArr = this.getNearBallBag(temp);
  10501. hole = holeArr[0];
  10502. holeObj[index] = holeArr[1];
  10503. temp.d3BallSrc.scaleXYZ = 0.5;
  10504. this.tweenArr.push(temp.d3BallSrc, temp);
  10505. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10506. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10507. }));
  10508. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10509. let mIndex = holeObj[this._curFinish];
  10510. let isDone = holeCfg[mIndex];
  10511. if (isDone) {
  10512. ballArr[this._curFinish].checkWrongBall(false);
  10513. }
  10514. else {
  10515. holeCfg[mIndex] = 1;
  10516. ballArr[this._curFinish].checkWrongBall();
  10517. }
  10518. this._curFinish++;
  10519. if (this._curFinish >= this._finishNum) {
  10520. if (this.curSkill == SkillType.highSpace) {
  10521. }
  10522. else if (this.curSkill == SkillType.breakArmy) {
  10523. let rootBall = xGame.common.d2World.rootBall;
  10524. rootBall.gameObj.x = this._rootX;
  10525. rootBall.gameObj.y = this._rootY;
  10526. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10527. xGame.common.d2World.d2Gan.ui.visible = true;
  10528. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10529. xGame.common.d2World.getHelpLine();
  10530. this.callback && this.callback(this.extraScore);
  10531. }
  10532. }
  10533. }));
  10534. }
  10535. }
  10536. runHighSpace() {
  10537. let rootBall = xGame.common.d2World.rootBall;
  10538. rootBall.showSelf();
  10539. let d3Src = rootBall.d3BallSrc;
  10540. let allArr = this.getAllBallArr();
  10541. if (allArr.length <= 0) {
  10542. this.callback && this.callback(0);
  10543. return;
  10544. }
  10545. let selectBall = xGame.common.d2World.targetBall;
  10546. let wrong = selectBall && selectBall.destroyed;
  10547. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10548. selectBall = xGame.common.getRandArrEle(allArr);
  10549. }
  10550. let targetD3Src = selectBall.d3BallSrc;
  10551. xGame.common.d2World.d2Gan.ui.visible = false;
  10552. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10553. d3Src.scaleXYZ = 0.5;
  10554. this.tweenArr.push(d3Src);
  10555. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10556. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10557. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10558. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10559. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10560. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10561. let outArr = [selectBall];
  10562. let other = this.leveNum - 1;
  10563. if (other > 0) {
  10564. let nearArr = this.getOneArr(selectBall);
  10565. if (nearArr.length > 0) {
  10566. xGame.common.botherArr(nearArr);
  10567. if (other >= nearArr.length)
  10568. other = nearArr.length;
  10569. for (let index = 0; index < other; index++) {
  10570. outArr.push(nearArr[index]);
  10571. }
  10572. }
  10573. }
  10574. xGame.common.extraMoveNum = other + 1;
  10575. this.extraScore = other + 1;
  10576. this._rootX = selectBall.gameObj.x;
  10577. this._rootY = selectBall.gameObj.y;
  10578. rootBall.gameObj.x = this._rootX;
  10579. rootBall.gameObj.y = this._rootY;
  10580. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10581. Laya.Tween.clearAll(d3Src);
  10582. this.addRandomForce(outArr);
  10583. }));
  10584. }));
  10585. }
  10586. addRandomForce(outArr) {
  10587. if (outArr.length > 0) {
  10588. xGame.common.d2World.openCheckStill = true;
  10589. this.playedLastSkill = true;
  10590. }
  10591. let temp;
  10592. for (let index = 0; index < outArr.length; index++) {
  10593. let angle = xGame.common.randomNum(0, 360);
  10594. let linearPercent = xGame.common.randomNum(65, 100);
  10595. temp = outArr[index];
  10596. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10597. }
  10598. }
  10599. setLinearSpeed(angle, rigy, linearPercent) {
  10600. let sin = Math.sin(angle * Math.PI / 180);
  10601. let cos = Math.cos(angle * Math.PI / 180);
  10602. let maxSpeed = 4;
  10603. let speed = new Laya.Vector2();
  10604. speed.x = maxSpeed * linearPercent * sin;
  10605. speed.y = -maxSpeed * linearPercent * cos;
  10606. rigy.applyLinearImpulseToCenter(speed);
  10607. }
  10608. runBreakArmy() {
  10609. xGame.common.d2World.d2Gan.ui.visible = false;
  10610. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10611. let gameUI = xGame.common.gameUI.ui;
  10612. gameUI.skillRod.visible = true;
  10613. gameUI.skillRod.rotation = 110;
  10614. let outArr = this.getAllBallArr();
  10615. if (outArr.length <= 0) {
  10616. gameUI.skillRod.visible = false;
  10617. this.callback && this.callback(0);
  10618. return;
  10619. }
  10620. xGame.common.botherArr(outArr);
  10621. if (this.leveNum >= outArr.length)
  10622. this.leveNum = outArr.length;
  10623. let deleteNum = outArr.length - this.leveNum;
  10624. outArr.splice(0, deleteNum);
  10625. this.extraScore = this.leveNum;
  10626. let potX = gameUI.skillRod.x;
  10627. let potY = gameUI.skillRod.y;
  10628. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10629. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10630. let disArr = [];
  10631. for (let index = 0; index < outArr.length; index++) {
  10632. let obj = outArr[index];
  10633. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10634. dis = Math.pow(dis, 0.5);
  10635. disArr.push(dis);
  10636. }
  10637. this.tweenArr.push(gameUI.skillRod);
  10638. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10639. })).update = Laya.Handler.create(this, (e, t, c) => {
  10640. let angle = gameUI.skillRod.rotation;
  10641. let xx;
  10642. let yy;
  10643. let temp;
  10644. for (let index = 0; index < outArr.length; index++) {
  10645. temp = outArr[index];
  10646. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10647. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10648. yy -= 20;
  10649. temp.gameObj.x = xx;
  10650. temp.gameObj.y = yy;
  10651. temp.d3BallSrc.setTransPos(xx, yy);
  10652. }
  10653. if (angle <= 60) {
  10654. Laya.Tween.clearAll(gameUI.skillRod);
  10655. this.ballFlyToBag(outArr, 150);
  10656. gameUI.skillRod.visible = false;
  10657. }
  10658. }, null, false);
  10659. }
  10660. runIce() {
  10661. let ballArr = xGame.common.d2World.ballArr;
  10662. this.leveNum *= 2;
  10663. if (this.leveNum >= ballArr.length - 1)
  10664. this.leveNum = ballArr.length - 1;
  10665. let tempArr = [];
  10666. let outArr = [];
  10667. for (let index = 0; index < ballArr.length; index++) {
  10668. if (ballArr[index] instanceof D2RootBallSrc)
  10669. continue;
  10670. tempArr.push(ballArr[index]);
  10671. }
  10672. if (tempArr.length <= 0) {
  10673. this.callback && this.callback(0);
  10674. return;
  10675. }
  10676. xGame.common.botherArr(tempArr);
  10677. for (let index = 0; index < this.leveNum; index++) {
  10678. outArr.push(tempArr[index]);
  10679. }
  10680. this.extraScore = this.leveNum;
  10681. let temp;
  10682. for (let index = 0; index < outArr.length; index++) {
  10683. temp = outArr[index];
  10684. temp.d3BallSrc.playIceEft();
  10685. }
  10686. Laya.timer.once(2000, this, () => {
  10687. for (let index = 0; index < outArr.length; index++) {
  10688. temp = outArr[index];
  10689. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10690. temp.setBallFunc("ice", str);
  10691. }
  10692. this.callback && this.callback(0);
  10693. });
  10694. }
  10695. runFireworks() {
  10696. let allArr = this.getAllBallArr();
  10697. if (allArr.length <= 0) {
  10698. this.callback && this.callback(0);
  10699. return;
  10700. }
  10701. xGame.common.d2World.d2Gan.ui.visible = false;
  10702. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10703. let outArr = [];
  10704. let other = this.leveNum;
  10705. if (other > 0) {
  10706. if (allArr.length > 0) {
  10707. xGame.common.botherArr(allArr);
  10708. if (other >= allArr.length)
  10709. other = allArr.length;
  10710. for (let index = 0; index < other; index++) {
  10711. outArr.push(allArr[index]);
  10712. }
  10713. }
  10714. }
  10715. xGame.common.extraMoveNum = other;
  10716. this.extraScore = other;
  10717. this.addRandmomFireworks(outArr);
  10718. }
  10719. addRandmomFireworks(outArr) {
  10720. Laya.timer.once(1100, this, () => {
  10721. if (outArr.length > 0) {
  10722. xGame.common.d2World.openCheckStill = true;
  10723. this.playedLastSkill = true;
  10724. }
  10725. });
  10726. xGame.soundMgr.playSound("skill_04_02");
  10727. let temp;
  10728. let delay = -200;
  10729. for (let index = 0; index < outArr.length; index++) {
  10730. temp = outArr[index];
  10731. delay += 200;
  10732. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10733. let angle = xGame.common.randomNum(0, 360);
  10734. angle = this.getFireworksAngle(obj);
  10735. let linearPercent = xGame.common.randomNum(45, 80);
  10736. if (!obj.destroyed)
  10737. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10738. });
  10739. }
  10740. }
  10741. getFireworksAngle(obj) {
  10742. let rootBall = xGame.common.d2World.rootBall;
  10743. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10744. }
  10745. resetGame() {
  10746. Laya.timer.clearAll(this);
  10747. if (this.tweenArr) {
  10748. for (let index = 0; index < this.tweenArr.length; index++) {
  10749. Laya.Tween.clearAll(this.tweenArr[index]);
  10750. }
  10751. }
  10752. this.tweenArr = null;
  10753. }
  10754. runGuanYu() {
  10755. xGame.common.d2World.d2Gan.ui.visible = false;
  10756. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10757. let rootBall = xGame.common.d2World.rootBall;
  10758. if (rootBall.isInHole) {
  10759. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10760. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10761. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10762. rootBall.showSelf();
  10763. }
  10764. this.rtStarX = rootBall.gameObj.x;
  10765. this.rtStarY = rootBall.gameObj.y;
  10766. this.knifeTimes = 0;
  10767. this.playedLastSkill = true;
  10768. rootBall.forceRun = true;
  10769. rootBall.rigy.type = "static";
  10770. xGame.common.d2World.openCheckStill = true;
  10771. this.guanyuRandomKnife();
  10772. }
  10773. guanyuRandomKnife() {
  10774. let rootBall = xGame.common.d2World.rootBall;
  10775. let dir = this.getRandDir();
  10776. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10777. console.log("当前angle", angle);
  10778. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10779. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10780. let dis = 324;
  10781. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10782. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10783. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10784. this.rtStarX = rootBall.gameObj.x;
  10785. this.rtStarY = rootBall.gameObj.y;
  10786. this.knifeTimes++;
  10787. let skillLevel;
  10788. if (xGame.common.gameMgr.selfTurn) {
  10789. skillLevel = DataMgr.getBigSkillByIndex(4);
  10790. }
  10791. else {
  10792. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10793. }
  10794. if (!skillLevel)
  10795. skillLevel = 1;
  10796. skillLevel += 2;
  10797. if (this.knifeTimes < skillLevel) {
  10798. Laya.timer.once(400, this, () => {
  10799. this.guanyuRandomKnife();
  10800. });
  10801. }
  10802. else {
  10803. rootBall.forceRun = false;
  10804. rootBall.rigy.type = "dynamic";
  10805. xGame.common.extraMoveNum = skillLevel;
  10806. }
  10807. }));
  10808. }
  10809. getRandDir() {
  10810. let rootBall = xGame.common.d2World.rootBall;
  10811. let allBall = this.getAllBallArr();
  10812. let target = xGame.common.getRandArrEle(allBall);
  10813. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10814. return this.knifeV2;
  10815. }
  10816. cloneKnife(x, y, rotation) {
  10817. let parent = xGame.common.d3World.knifeRoot;
  10818. let prefab = xGame.common.d3World.knife;
  10819. let clone = prefab.clone();
  10820. parent.addChild(clone);
  10821. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10822. clone.transform.localPositionX = this.knifeV3.x;
  10823. clone.transform.localPositionY = 0;
  10824. clone.transform.localPositionZ = this.knifeV3.z;
  10825. clone.transform.localRotationEulerX = 0;
  10826. clone.transform.localRotationEulerY = rotation;
  10827. clone.transform.localRotationEulerZ = 0;
  10828. clone.active = true;
  10829. return clone;
  10830. }
  10831. cloneGuanYuEft(x, y, angle) {
  10832. return;
  10833. let parent = xGame.common.gameUI.ui.guanyuNode;
  10834. let eft = new ui_guanyuAni();
  10835. eft.parent = parent;
  10836. eft.x = x;
  10837. eft.y = y;
  10838. eft.rotation = angle;
  10839. }
  10840. }
  10841. class ui_UIWordsList extends fgui.GComponent {
  10842. static createInstance() {
  10843. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10844. }
  10845. onConstruct() {
  10846. this.c1 = this.getController("c1");
  10847. this.n74 = (this.getChild("n74"));
  10848. this.clickNode = (this.getChild("clickNode"));
  10849. this.myNode = (this.getChild("myNode"));
  10850. this.n68 = (this.getChild("n68"));
  10851. this.n66 = (this.getChild("n66"));
  10852. this.n55 = (this.getChild("n55"));
  10853. this.wordsBtn = (this.getChild("wordsBtn"));
  10854. this.emotionBtn = (this.getChild("emotionBtn"));
  10855. this.mybggg = (this.getChild("mybggg"));
  10856. this.wordsList = (this.getChild("wordsList"));
  10857. this.emotionList = (this.getChild("emotionList"));
  10858. this.myRoot = (this.getChild("myRoot"));
  10859. }
  10860. }
  10861. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10862. class EmotionDisplay {
  10863. constructor(index, ui) {
  10864. this.ui = ui;
  10865. this.index = index;
  10866. this.ui.onClick(this, this.clickSelf);
  10867. this.updateSelf();
  10868. }
  10869. updateSelf() {
  10870. let data = cfgTable.emotionData[this.index + 1];
  10871. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10872. }
  10873. clickSelf() {
  10874. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10875. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10876. xGame.common.talkMgr.closeTalkView();
  10877. }
  10878. }
  10879. class WordsDisplay {
  10880. constructor(index, ui) {
  10881. this.ui = ui;
  10882. this.index = index;
  10883. this.ui.onClick(this, this.clickSelf);
  10884. this.updateSelf();
  10885. }
  10886. updateSelf() {
  10887. let data = cfgTable.talkwordsData[this.index + 1];
  10888. this.ui.txt.text = data.msg;
  10889. }
  10890. clickSelf() {
  10891. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10892. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10893. xGame.common.talkMgr.closeTalkView();
  10894. }
  10895. }
  10896. class UIWordsList extends UIBase {
  10897. constructor() {
  10898. super();
  10899. }
  10900. onConstructor() {
  10901. this.ui = ui_UIWordsList.createInstance();
  10902. this.contentPane = this.ui;
  10903. this.isEject = false;
  10904. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10905. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10906. this.addUIClick(this.ui.clickNode, this.hide);
  10907. this.initTalkList();
  10908. this.initEmotionList();
  10909. }
  10910. show() {
  10911. super.show();
  10912. this.setGlobalFont(this.ui);
  10913. }
  10914. initTalkList() {
  10915. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10916. let data = cfgTable.talkwordsData;
  10917. let length = Object.keys(data).length;
  10918. this.ui.wordsList.numItems = length;
  10919. }
  10920. initEmotionList() {
  10921. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10922. let data = cfgTable.emotionData;
  10923. let length = Object.keys(data).length;
  10924. this.ui.emotionList.numItems = length;
  10925. }
  10926. renderTalkItem(index, obj) {
  10927. let temp = new WordsDisplay(index, obj);
  10928. }
  10929. renderEmotionItem(index, obj) {
  10930. let temp = new EmotionDisplay(index, obj);
  10931. }
  10932. openTalkList() {
  10933. this.ui.c1.selectedIndex = 0;
  10934. }
  10935. openEmotionList() {
  10936. this.ui.c1.selectedIndex = 1;
  10937. }
  10938. }
  10939. UIWordsList.uiName = "UIWordsList";
  10940. class TalkMgr {
  10941. constructor() {
  10942. this.aiSpeak = true;
  10943. this.emotionList = [];
  10944. this.talkList = [];
  10945. this.addEvent();
  10946. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10947. this.emotionList = [];
  10948. this.talkList = [];
  10949. for (let k in cfgTable.emotionData) {
  10950. this.emotionList.push(cfgTable.emotionData[k].id);
  10951. }
  10952. for (let k in cfgTable.talkwordsData) {
  10953. this.talkList.push(cfgTable.talkwordsData[k].id);
  10954. }
  10955. }
  10956. addEvent() {
  10957. let ui = xGame.common.gameUI.ui;
  10958. ui.wordsBtn.visible = true;
  10959. ui.wordsBtn.onClick(this, this.openTalkView);
  10960. ui.aiWordsBtn.visible = true;
  10961. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10962. }
  10963. openTalkView() {
  10964. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10965. xGame.uiMgr.Show(UIWordsList);
  10966. }
  10967. closeTalkView() {
  10968. xGame.uiMgr.Hide(UIWordsList);
  10969. }
  10970. clickAIState() {
  10971. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10972. this.aiSpeak = !this.aiSpeak;
  10973. this.changeAIState(this.aiSpeak);
  10974. }
  10975. changeAIState(speak) {
  10976. this.aiSpeak = speak;
  10977. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10978. if (speak) {
  10979. btn.c1.selectedIndex = 0;
  10980. }
  10981. else {
  10982. btn.c1.selectedIndex = 1;
  10983. }
  10984. }
  10985. showSelfTalk(wordsId) {
  10986. let ui = xGame.common.gameUI.ui;
  10987. ui.selfTalk.visible = true;
  10988. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10989. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10990. ui.selfTalk.t0.play();
  10991. }
  10992. showSelfEmotion(emotionId) {
  10993. let ui = xGame.common.gameUI.ui;
  10994. ui.selfTalk.visible = true;
  10995. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10996. this.selfSpine && this.selfSpine.dispose();
  10997. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10998. let spineData = cfgTable.emotionData[emotionId].spine;
  10999. this.selfSpine = new SpineMgr(spineData, () => {
  11000. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  11001. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  11002. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11003. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  11004. });
  11005. ui.selfTalk.t0.play();
  11006. }
  11007. showAITalk(wordsId) {
  11008. if (!this.aiSpeak)
  11009. return;
  11010. if (DataMgr.gameData.gameCount < 2)
  11011. return;
  11012. if (wordsId < 1)
  11013. wordsId = this.getRandTalk();
  11014. let ui = xGame.common.gameUI.ui;
  11015. ui.aiTalk.visible = true;
  11016. ui.aiTalk.myNode.c1.selectedIndex = 1;
  11017. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  11018. ui.aiTalk.t0.play();
  11019. }
  11020. getRandTalk() {
  11021. let rand = xGame.tools.random(0, this.talkList.length);
  11022. return this.emotionList[rand];
  11023. }
  11024. getRandEmotion() {
  11025. let rand = xGame.tools.random(0, this.emotionList.length);
  11026. return this.emotionList[rand];
  11027. }
  11028. showAIEmotion(emotionId) {
  11029. if (!this.aiSpeak)
  11030. return;
  11031. if (DataMgr.gameData.gameCount < 2)
  11032. return;
  11033. if (emotionId < 1)
  11034. emotionId = this.getRandEmotion();
  11035. let ui = xGame.common.gameUI.ui;
  11036. ui.aiTalk.visible = true;
  11037. ui.aiTalk.myNode.c1.selectedIndex = 0;
  11038. this.aiSpine && this.aiSpine.dispose();
  11039. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11040. let spineData = cfgTable.emotionData[emotionId].spine;
  11041. this.aiSpine = new SpineMgr(spineData, () => {
  11042. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  11043. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  11044. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11045. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  11046. });
  11047. ui.aiTalk.t0.play();
  11048. }
  11049. resetGame() {
  11050. let ui = xGame.common.gameUI.ui;
  11051. ui.aiTalk.visible = false;
  11052. ui.selfTalk.visible = false;
  11053. this.aiSpine && this.aiSpine.dispose();
  11054. this.selfSpine && this.selfSpine.dispose();
  11055. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11056. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11057. this.closeTalkView();
  11058. }
  11059. }
  11060. class WordsMgr {
  11061. constructor() {
  11062. this.comboTimes = 1;
  11063. this.skillTimes = 0;
  11064. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11065. this.comboSpine = new SpineMgr("yxz_liangan");
  11066. this.skillSpine = new SpineMgr("yiganxqiu");
  11067. this.scoreSpine = new SpineMgr("defen");
  11068. }
  11069. setClassicCombo(isInterrupt) {
  11070. if (isInterrupt) {
  11071. this.comboTimes = 0;
  11072. }
  11073. }
  11074. playClassicWords(type, callback) {
  11075. this.callback = callback;
  11076. let aniIndex = type;
  11077. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11078. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11079. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11080. mySpine.destroy(true);
  11081. this.playClassicTimes();
  11082. });
  11083. }
  11084. playClassicTimes() {
  11085. this.comboTimes++;
  11086. if (this.comboTimes <= 1) {
  11087. this.callback && this.callback();
  11088. }
  11089. else {
  11090. let aniIndex = this.comboTimes - 1;
  11091. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11092. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11093. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11094. mySpine.destroy(true);
  11095. this.callback && this.callback();
  11096. });
  11097. }
  11098. }
  11099. playBigSkillTimes(times, callback) {
  11100. if (times <= 0) {
  11101. callback && callback();
  11102. return;
  11103. }
  11104. this.callback = callback;
  11105. let pre = "sz_0";
  11106. let aniIndex = 0;
  11107. this.getWordsImg(times, pre, () => {
  11108. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11109. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11110. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11111. let r1 = ``;
  11112. let r2 = ``;
  11113. if (times <= 9) {
  11114. r1 = `res/d2Res/${pre}${times}.png`;
  11115. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11116. aniIndex = 0;
  11117. }
  11118. else {
  11119. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11120. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11121. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11122. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11123. aniIndex = 1;
  11124. }
  11125. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11126. mySpine.destroy(true);
  11127. xGame.common.gameMgr.playSkillTips();
  11128. this.playScore(times);
  11129. xGame.common.playRandomMutiBallBigSkillSound();
  11130. }, mySpine);
  11131. });
  11132. }
  11133. playScore(score) {
  11134. let pre = "sz_";
  11135. let aniIndex = 0;
  11136. this.getWordsImg(score, pre, () => {
  11137. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11138. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11139. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11140. let r1 = ``;
  11141. let r2 = ``;
  11142. if (score <= 9) {
  11143. r1 = `res/d2Res/${pre}${score}.png`;
  11144. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11145. aniIndex = 0;
  11146. }
  11147. else {
  11148. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11149. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11150. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11151. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11152. aniIndex = 1;
  11153. }
  11154. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11155. mySpine.destroy(true);
  11156. this.callback && this.callback();
  11157. }, mySpine);
  11158. });
  11159. }
  11160. getWordsImg(number, pre = "", callback) {
  11161. let arr = [];
  11162. if (number <= 9) {
  11163. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11164. }
  11165. else {
  11166. 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 });
  11167. }
  11168. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11169. callback && callback();
  11170. }));
  11171. }
  11172. }
  11173. class ui_UIRodMethod extends fgui.GComponent {
  11174. static createInstance() {
  11175. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11176. }
  11177. onConstruct() {
  11178. this.n24 = (this.getChild("n24"));
  11179. this.white = (this.getChild("white"));
  11180. this.dot = (this.getChild("dot"));
  11181. this.sureBtn = (this.getChild("sureBtn"));
  11182. this.n20 = (this.getChild("n20"));
  11183. this.n21 = (this.getChild("n21"));
  11184. this.n22 = (this.getChild("n22"));
  11185. this.n23 = (this.getChild("n23"));
  11186. this.n5 = (this.getChild("n5"));
  11187. this.n14 = (this.getChild("n14"));
  11188. this.t0 = this.getTransition("t0");
  11189. }
  11190. }
  11191. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11192. class UIRodMethod extends UIBase {
  11193. constructor() {
  11194. super();
  11195. this.isPressd = false;
  11196. }
  11197. onConstructor() {
  11198. this.ui = ui_UIRodMethod.createInstance();
  11199. this.contentPane = this.ui;
  11200. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11201. this.moveDir = new Laya.Vector2();
  11202. this.moveDest = new Laya.Vector2();
  11203. this.centerPos = new Laya.Vector2();
  11204. xGame.common.uiRodMethod = this;
  11205. }
  11206. show() {
  11207. super.show();
  11208. xGame.common.gameMgr.gamePause = true;
  11209. this.openPressDotEvent();
  11210. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11211. this.centerPos.x = this.ui.white.x;
  11212. this.centerPos.y = this.ui.white.y;
  11213. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11214. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11215. this.setDot();
  11216. this.setGlobalFont(this.ui);
  11217. }
  11218. setDot() {
  11219. this.ui.dot.x = this.moveDest.x;
  11220. this.ui.dot.y = this.moveDest.y;
  11221. }
  11222. closeSelf() {
  11223. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11224. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11225. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11226. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11227. xGame.common.gameMgr.gamePause = false;
  11228. this.hide();
  11229. }
  11230. openPressDotEvent() {
  11231. this.closePressDotEvent();
  11232. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11233. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11234. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11235. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11236. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11237. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11238. }
  11239. closePressDotEvent() {
  11240. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11241. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11242. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11243. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11244. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11245. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11246. }
  11247. onDown(e) {
  11248. if (e.type == Laya.Event.MOUSE_DOWN)
  11249. this.isPressd = true;
  11250. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11251. this.isPressd = false;
  11252. if (!this.isPressd)
  11253. return;
  11254. this.moveDest.x = e.stageX;
  11255. this.moveDest.y = e.stageY;
  11256. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11257. if (dis > 6724) {
  11258. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11259. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11260. }
  11261. this.setDot();
  11262. }
  11263. resetRod() {
  11264. this.ui.dot.x = this.ui.white.x;
  11265. this.ui.dot.y = this.ui.white.y;
  11266. this.gameRod.dot.x = this.gameRod.bg.x;
  11267. this.gameRod.dot.y = this.gameRod.bg.y;
  11268. xGame.common.rodOffest.x = 0;
  11269. xGame.common.rodOffest.y = 0;
  11270. }
  11271. }
  11272. UIRodMethod.uiName = "UIRodMethod";
  11273. class UIGame extends UIBase {
  11274. constructor() {
  11275. super();
  11276. this.powerNum = 0;
  11277. this.isD3Inited = false;
  11278. this.isPrePlay = false;
  11279. this.isMoveRod = false;
  11280. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11281. this.rulerDis = 20;
  11282. this.rulerOffset = 0;
  11283. }
  11284. onConstructor() {
  11285. this.ui = ui_UIGame.createInstance();
  11286. this.contentPane = this.ui;
  11287. this.ui.x += xGame.common.sysOffestNum;
  11288. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11289. this.isEject = false;
  11290. xGame.common.gameUI = this;
  11291. this.initSelf();
  11292. }
  11293. isTurnSelf() {
  11294. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11295. return true;
  11296. }
  11297. }
  11298. initSelf() {
  11299. let topUI = this.ui.topNode;
  11300. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11301. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11302. this.barInfo = {};
  11303. this.barInfo.curY = 0;
  11304. this.barInfo.height = this.ui.powerNode.height;
  11305. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11306. this.barInfo.powerStartY = this.ui.powerNode.y;
  11307. xGame.common.aiPlayer = new AIPlayer();
  11308. xGame.common.gameMgr = new GameMgr();
  11309. xGame.common.skillMgr = new SkillMgr();
  11310. xGame.common.wordsMgr = new WordsMgr();
  11311. xGame.common.talkMgr = new TalkMgr();
  11312. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11313. });
  11314. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11315. });
  11316. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11317. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11318. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11319. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11320. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11321. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11322. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11323. }
  11324. getGanZiImg() {
  11325. let index = DataMgr.getCurBallRod();
  11326. let data = cfgTable.ballrodData[index + 1];
  11327. let gan_url = xGame.common.getGameIconUrl(data.img);
  11328. this.ui.powerNode.showImg.url = gan_url;
  11329. }
  11330. returnHome() {
  11331. let tips = "Are you sure to exit the game?";
  11332. let woman = "Boss, why don't you play for a while longer?";
  11333. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11334. }
  11335. addRodMethodClick() {
  11336. if (this.isTurnSelf()) {
  11337. xGame.uiMgr.Show(UIRodMethod);
  11338. }
  11339. }
  11340. clickHelpLineBtn(force = false) {
  11341. if (!this.isTurnSelf())
  11342. return;
  11343. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11344. if (success) {
  11345. xGame.common.longHelpLine = true;
  11346. xGame.common.d2World.getHelpLine();
  11347. Moyu.sendDataEvent("guideNum");
  11348. }
  11349. else {
  11350. }
  11351. });
  11352. }
  11353. renderSelfDisplayBalls(index, target) {
  11354. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11355. target.myImg.url = xGame.common.getGameIconUrl(str);
  11356. }
  11357. renderAIDisplayBalls(index, target) {
  11358. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11359. target.myImg.url = xGame.common.getGameIconUrl(str);
  11360. ;
  11361. }
  11362. updateMode() {
  11363. if (xGame.common.gameMode == GameMode.classic) {
  11364. this.ui.topNode.scoreNode.visible = false;
  11365. }
  11366. else if (xGame.common.gameMode == GameMode.bigMove) {
  11367. this.ui.topNode.scoreNode.visible = true;
  11368. }
  11369. }
  11370. show() {
  11371. super.show();
  11372. this.ui.alpha = 0;
  11373. this.updateSelf();
  11374. xGame.common.gameMgr.gamePause = false;
  11375. xGame.common.gameUI.ui.blackAni.visible = false;
  11376. xGame.common.gameUI.ui.whiteAni.visible = false;
  11377. this.ui.powerEft.visible = false;
  11378. this.ui.colorNode.visible = false;
  11379. this.updateHead();
  11380. let curUse = DataMgr.getCurBallRod();
  11381. this.getGanZiImg();
  11382. this.setGlobalFont(this.ui);
  11383. }
  11384. updateSelf() {
  11385. if (xGame.common.gameMode == GameMode.classic) {
  11386. this.ui.c1.selectedIndex = 0;
  11387. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11388. this.ui.topNode.middleNode.visible = true;
  11389. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11390. }
  11391. else if (xGame.common.gameMode == GameMode.bigMove) {
  11392. this.ui.c1.selectedIndex = 0;
  11393. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11394. this.ui.topNode.middleNode.visible = false;
  11395. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11396. let rand = xGame.common.randomNum(1, max);
  11397. let guide = DataMgr.getSkillGuide();
  11398. if (guide == 0)
  11399. rand = 1;
  11400. xGame.common.bigMoveLevelIndex = rand;
  11401. }
  11402. else if (xGame.common.gameMode == GameMode.placeBall) {
  11403. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11404. this.ui.c1.selectedIndex = 1 + data.type;
  11405. this.ui.alpha = 1;
  11406. this.startGame();
  11407. }
  11408. this.updateMode();
  11409. this.initD3world();
  11410. this.initD2world();
  11411. }
  11412. startGame() {
  11413. this.ui.snowNode.visible = Math.random() <= 0.1;
  11414. this.ui.d2Node.visible = false;
  11415. xGame.common.d3World.d3Hand.gameObj.active = false;
  11416. xGame.common.d3World.tableSrc.init();
  11417. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11418. this.cameraViewChange(() => {
  11419. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11420. switch (xGame.common.gameMode) {
  11421. case GameMode.classic:
  11422. xGame.common.d3World.d3Hand.gameObj.active = true;
  11423. this.playPutBallD3Ani();
  11424. break;
  11425. case GameMode.bigMove:
  11426. this.enterGame();
  11427. Laya.timer.once(500, this, () => {
  11428. this.ui.topNode.middleNode.visible = true;
  11429. this.ui.topNode.middleNode.t0.play();
  11430. });
  11431. break;
  11432. case GameMode.placeBall:
  11433. this.enterGame();
  11434. break;
  11435. default:
  11436. break;
  11437. }
  11438. });
  11439. PlatMgr.showBanner(false);
  11440. }
  11441. enterGame() {
  11442. this.ui.d2Node.visible = true;
  11443. xGame.common.d3World.d3Hand.gameObj.active = false;
  11444. xGame.common.showOneCamera("mainCamera");
  11445. Moyu.recordGame(30, true);
  11446. if (!this.isPrePlay) {
  11447. this.isPrePlay = true;
  11448. xGame.common.d3World.prePlayEft();
  11449. }
  11450. xGame.common.gameMgr.gameReady();
  11451. this.openAllEvent();
  11452. this.ui.snowNode.visible = false;
  11453. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11454. this.ui.helpBtn.visible = condition;
  11455. }
  11456. showHelpLineGuide() {
  11457. let longGuide = DataMgr.getGuideHelpLine();
  11458. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11459. this.ui.helpBtn.visible = true;
  11460. this.ui.guideNode.visible = true;
  11461. }
  11462. }
  11463. setTurnAlpha(alpha) {
  11464. this.ui.keduNode.alpha = alpha;
  11465. this.ui.ganNode.alpha = alpha;
  11466. this.ui.rodMethodNode.alpha = alpha;
  11467. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11468. }
  11469. cameraViewChange(callback) {
  11470. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11471. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11472. xGame.common.showOneCamera("visitAngle");
  11473. cameraSrc.localRotationEulerY = 180;
  11474. cameraSrc.localRotationEulerZ = 0;
  11475. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11476. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11477. callback && callback();
  11478. }));
  11479. }));
  11480. }
  11481. playPutBallD3Ani() {
  11482. xGame.common.showOneCamera("mainCamera");
  11483. let handSrc = xGame.common.d3World.d3Hand;
  11484. handSrc.gameObj.active = true;
  11485. handSrc.transform.localPositionZ = 3;
  11486. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11487. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11488. handSrc.gameObj.active = false;
  11489. this.enterGame();
  11490. }), 400);
  11491. }));
  11492. }
  11493. updateHead() {
  11494. let user = Moyu.getUserInfo();
  11495. this.ui.topNode.selfNameTxt.text = user.nickName;
  11496. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11497. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11498. if (DataMgr.getSkillGuide() < 1) {
  11499. this.ui.topNode.aiNameTxt.text = 'billiards';
  11500. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11501. }
  11502. else {
  11503. this.ui.topNode.aiNameTxt.text = aiData.name;
  11504. let randNo = Math.floor(Math.random() * 10) + 1;
  11505. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11506. }
  11507. }
  11508. initD2world() {
  11509. let node = this.ui.d2Root.displayObject;
  11510. let src = node.getComponent(D2World);
  11511. if (!src) {
  11512. xGame.common.d2World = node.addComponent(D2World);
  11513. }
  11514. xGame.common.d2World.initSelf();
  11515. }
  11516. initD3world() {
  11517. if (this.isD3Inited)
  11518. return;
  11519. this.isD3Inited = true;
  11520. let scene3D = xGame.common.d3Scene;
  11521. this.ui.d3Root.displayObject.addChild(scene3D);
  11522. scene3D.active = true;
  11523. xGame.common.d3World.tableSrc.setBorderPos();
  11524. }
  11525. onRootMove(e) {
  11526. let rootBall = xGame.common.d2World.rootBall;
  11527. this.ui.moveNode.x = e.x;
  11528. this.ui.moveNode.y = e.y;
  11529. rootBall.gameObj.x = e.x;
  11530. rootBall.gameObj.y = e.y;
  11531. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11532. }
  11533. aiRootMove(move) {
  11534. if (move)
  11535. this.hideBallUI();
  11536. else {
  11537. this.showBallUI();
  11538. xGame.common.d2World.getHelpLine();
  11539. }
  11540. }
  11541. aiForce(type, force = 0) {
  11542. this.pressTarget = PressType.powerNode;
  11543. if (type == 1)
  11544. this.onEventUp({ force: true });
  11545. else if (type == 2)
  11546. this.onEventMove({ stageY: force, force: true });
  11547. }
  11548. onEventPress(e) {
  11549. if (e.stopPropagation)
  11550. e.stopPropagation();
  11551. if (!this.isTurnSelf())
  11552. return;
  11553. let target = e.target;
  11554. switch (target) {
  11555. case this.ui.myPowerNode.displayObject:
  11556. this.pressTarget = PressType.powerNode;
  11557. this.barInfo.curY = e.stageY;
  11558. this.updateBarInfo();
  11559. break;
  11560. case this.ui.moveNode.displayObject:
  11561. this.pressTarget = PressType.moveNode;
  11562. this.hideBallUI();
  11563. this.eventObj.curX = this.ui.moveNode.x;
  11564. this.eventObj.curY = this.ui.moveNode.y;
  11565. this.ui.moveNode.finger.visible = false;
  11566. this.eventObj.lastX = e.stageX;
  11567. this.eventObj.lastY = e.stageY;
  11568. break;
  11569. case this.ui.rulerClickNode.displayObject:
  11570. this.pressTarget = PressType.rulerNode;
  11571. this.eventObj.lastY = e.stageY;
  11572. break;
  11573. case this.ui.d2Root.displayObject:
  11574. this.pressTarget = PressType.d2Root;
  11575. this.eventObj.lastX = e.stageX;
  11576. this.eventObj.lastY = e.stageY;
  11577. this.eventObj.starX = e.stageX;
  11578. this.eventObj.starY = e.stageY;
  11579. this.eventObj.curX = 0;
  11580. this.eventObj.curY = 0;
  11581. xGame.common.d2World.d2Gan.setGanLastInfo();
  11582. this.rulerOffset = 0;
  11583. break;
  11584. default:
  11585. break;
  11586. }
  11587. }
  11588. onEventMove(e) {
  11589. if (e.stopPropagation)
  11590. e.stopPropagation();
  11591. if (e && e.force) {
  11592. }
  11593. else {
  11594. if (!this.isTurnSelf())
  11595. return;
  11596. }
  11597. switch (this.pressTarget) {
  11598. case PressType.powerNode:
  11599. this.barInfo.curY = e.stageY;
  11600. this.updateBarInfo();
  11601. this.isMoveRod = true;
  11602. break;
  11603. case PressType.moveNode:
  11604. let rootBall = xGame.common.d2World.rootBall;
  11605. let radius = rootBall.gameObj.width / 2;
  11606. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11607. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11608. let border = xGame.common.d2World.borderRect;
  11609. if (curX <= border.x + radius)
  11610. curX = border.x + radius;
  11611. else if (curX >= border.x + border.width - radius)
  11612. curX = border.x + border.width - radius;
  11613. if (curY <= border.y + radius)
  11614. curY = border.y + radius;
  11615. else if (curY >= border.y + border.height - radius)
  11616. curY = border.y + border.height - radius;
  11617. if (xGame.common.gameMgr.isOpenBall) {
  11618. if (curX >= border.x + border.openBallW - radius)
  11619. curX = border.x + border.openBallW - radius;
  11620. }
  11621. this.ui.moveNode.x = curX;
  11622. this.ui.moveNode.y = curY;
  11623. rootBall.gameObj.x = curX;
  11624. rootBall.gameObj.y = curY;
  11625. rootBall.d3BallSrc.setTransPos(curX, curY);
  11626. this.isMoveRod = true;
  11627. break;
  11628. case PressType.rulerNode:
  11629. let yy = e.stageY - this.eventObj.lastY;
  11630. this.eventObj.lastY = e.stageY;
  11631. let ruler1 = this.ui.rulerNode.img1;
  11632. let ruler2 = this.ui.rulerNode.img2;
  11633. ruler1.y += yy;
  11634. ruler2.y += yy;
  11635. this.rulerOffset += yy;
  11636. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11637. this.rulerOffset = 0;
  11638. xGame.soundMgr.playSound("inch", 1, 10);
  11639. }
  11640. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11641. let h = ruler1.height;
  11642. this.checkGuide();
  11643. this.isMoveRod = true;
  11644. if (ruler1.y >= h) {
  11645. ruler1.y = -h;
  11646. ruler2.y = 0;
  11647. return;
  11648. }
  11649. else if (ruler1.y <= -h) {
  11650. ruler1.y = h;
  11651. ruler2.y = 0;
  11652. return;
  11653. }
  11654. if (ruler2.y >= h) {
  11655. ruler2.y = -h;
  11656. ruler1.y = 0;
  11657. return;
  11658. }
  11659. else if (ruler2.y <= -h) {
  11660. ruler2.y = h;
  11661. ruler1.y = 0;
  11662. return;
  11663. }
  11664. break;
  11665. case PressType.d2Root:
  11666. this.eventObj.curX = e.stageX;
  11667. this.eventObj.curY = e.stageY;
  11668. let offset = this.checkRodMoveDir();
  11669. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11670. this.eventObj.lastX = e.stageX;
  11671. this.eventObj.lastY = e.stageY;
  11672. break;
  11673. default:
  11674. break;
  11675. }
  11676. }
  11677. onEventUp(e) {
  11678. if (e.stopPropagation)
  11679. e.stopPropagation();
  11680. if (e && e.force) {
  11681. }
  11682. else {
  11683. if (!this.isTurnSelf())
  11684. return;
  11685. }
  11686. switch (this.pressTarget) {
  11687. case PressType.powerNode:
  11688. this.ui.powerNode.value = 0;
  11689. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11690. this.ui.powerTxt.text = "";
  11691. if (this.powerNum > 0) {
  11692. xGame.eventMgr.event(BALL_SHOOT);
  11693. xGame.common.d2World.shoot(this.powerNum);
  11694. xGame.common.d2World.d2Gan.shoot();
  11695. xGame.common.d2World.d2HelpLine.shoot();
  11696. this.finishGuide();
  11697. this.ui.powerEft.visible = false;
  11698. this.ui.colorNode.visible = false;
  11699. let ganStr = "";
  11700. if (this.powerNum <= 30) {
  11701. ganStr = "gan_30";
  11702. }
  11703. else if (this.powerNum <= 60) {
  11704. ganStr = "gan_50";
  11705. }
  11706. else {
  11707. ganStr = "gan_80";
  11708. }
  11709. xGame.soundMgr.playSound(ganStr);
  11710. }
  11711. break;
  11712. case PressType.moveNode:
  11713. let rootBall = xGame.common.d2World.rootBall;
  11714. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11715. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11716. let isIntersect = this.judgeBallIntersect();
  11717. if (isIntersect) {
  11718. this.ui.moveNode.x = lastX;
  11719. this.ui.moveNode.y = lastY;
  11720. rootBall.gameObj.x = lastX;
  11721. rootBall.gameObj.y = lastY;
  11722. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11723. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11724. }
  11725. else {
  11726. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11727. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11728. }
  11729. this.showBallUI();
  11730. this.ui.moveNode.finger.visible = true;
  11731. xGame.common.d2World.getHelpLine();
  11732. break;
  11733. case PressType.rulerNode:
  11734. break;
  11735. case PressType.d2Root:
  11736. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11737. if (dis <= 25) {
  11738. this.moveToClickDot(e);
  11739. }
  11740. break;
  11741. default:
  11742. break;
  11743. }
  11744. this.pressTarget = -1;
  11745. }
  11746. checkGuide() {
  11747. let guide = DataMgr.getSkillGuide();
  11748. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11749. xGame.common.guideStep++;
  11750. xGame.common.gameUI.ui.guide2.visible = false;
  11751. xGame.common.gameUI.ui.guide3.visible = true;
  11752. }
  11753. }
  11754. finishGuide() {
  11755. let guide = DataMgr.getSkillGuide();
  11756. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11757. xGame.common.guideStep = 10;
  11758. this.closeAllGuide();
  11759. console.log('zh: 新手引导完毕');
  11760. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11761. }
  11762. }
  11763. closeAllGuide() {
  11764. xGame.common.gameUI.ui.guide1.visible = false;
  11765. xGame.common.gameUI.ui.guide2.visible = false;
  11766. xGame.common.gameUI.ui.guide3.visible = false;
  11767. }
  11768. updateBarInfo() {
  11769. let star = this.ui.powerNode.y;
  11770. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11771. if (rate >= 1)
  11772. rate = 1;
  11773. if (rate <= 0)
  11774. rate = 0;
  11775. this.powerNum = Math.ceil(rate * 100);
  11776. this.ui.powerNode.value = this.powerNum;
  11777. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11778. this.ui.colorNode.value = this.powerNum;
  11779. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11780. this.ui.powerEft.visible = this.powerNum != 0;
  11781. this.ui.colorNode.visible = this.powerNum != 0;
  11782. this.ui.powerTxt.text = this.powerNum + "";
  11783. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11784. }
  11785. forceCancel() {
  11786. this.ui.powerNode.value = 0;
  11787. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11788. this.ui.powerTxt.text = "";
  11789. }
  11790. checkRodMoveDir() {
  11791. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11792. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11793. if (tempX >= 0 && tempY <= 0) {
  11794. return this.checkDir();
  11795. }
  11796. else if (tempX < 0 && tempY < 0) {
  11797. return this.checkDir(1, -1);
  11798. }
  11799. else if (tempX < 0 && tempY > 0) {
  11800. return this.checkDir(-1, -1);
  11801. }
  11802. else {
  11803. return this.checkDir(-1, 1);
  11804. }
  11805. }
  11806. checkDir(flagX = 1, flagY = 1) {
  11807. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11808. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11809. if (offsetY == 0) {
  11810. return offsetX * flagX;
  11811. }
  11812. if (offsetX == 0) {
  11813. return offsetY * flagY;
  11814. }
  11815. let angle = offsetY / offsetX;
  11816. if (Math.abs(angle) >= 1) {
  11817. return offsetY * flagY;
  11818. }
  11819. else {
  11820. return offsetX * flagX;
  11821. }
  11822. }
  11823. judgeBallIntersect() {
  11824. let rootBall = xGame.common.d2World.rootBall;
  11825. let ballArr = xGame.common.d2World.ballArr;
  11826. let radius = rootBall.gameObj.width / 2;
  11827. let temp;
  11828. let isIntersect = false;
  11829. for (let index = 0; index < ballArr.length; index++) {
  11830. temp = ballArr[index];
  11831. if (temp.number == rootBall.number)
  11832. continue;
  11833. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11834. if (isIntersect) {
  11835. break;
  11836. }
  11837. }
  11838. return isIntersect;
  11839. }
  11840. hideBallUI() {
  11841. let d2Gan = xGame.common.d2World.d2Gan;
  11842. if (!d2Gan.ui.isDisposed)
  11843. d2Gan.ui.visible = false;
  11844. let d2Help = xGame.common.d2World.d2HelpLine;
  11845. if (!d2Help.ui.isDisposed)
  11846. d2Help.ui.visible = false;
  11847. let rootBall = xGame.common.d2World.rootBall;
  11848. if (!rootBall.destroyed) {
  11849. rootBall.gameObj.active = false;
  11850. }
  11851. }
  11852. showBallUI() {
  11853. let d2Gan = xGame.common.d2World.d2Gan;
  11854. if (!d2Gan.ui.isDisposed)
  11855. d2Gan.ui.visible = true;
  11856. let d2Help = xGame.common.d2World.d2HelpLine;
  11857. if (!d2Help.ui.isDisposed)
  11858. d2Help.ui.visible = true;
  11859. let rootBall = xGame.common.d2World.rootBall;
  11860. if (!rootBall.destroyed) {
  11861. rootBall.gameObj.active = true;
  11862. }
  11863. }
  11864. moveToClickDot(e) {
  11865. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11866. let root = xGame.common.d2World.rootBall.gameObj;
  11867. let xx = e.stageX - xGame.common.sysOffestNum;
  11868. let yy = e.stageY;
  11869. let x = xx - root.x;
  11870. let y = yy - root.y;
  11871. let angle = xGame.common.getfguiRotation(x, y);
  11872. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11873. xGame.common.d2World.getHelpLine();
  11874. }
  11875. this.isMoveRod = false;
  11876. xGame.common.clickedBall = false;
  11877. }
  11878. openAllEvent() {
  11879. this.closeAllEvent();
  11880. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11881. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11882. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11883. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11884. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11885. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11886. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11887. }
  11888. closeAllEvent() {
  11889. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11890. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11891. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11892. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11893. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11894. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11895. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11896. }
  11897. resetGame() {
  11898. this.closeAllEvent();
  11899. this.hideBallUI();
  11900. xGame.common.gameMgr.gamePause = true;
  11901. }
  11902. }
  11903. UIGame.uiName = "UIGame";
  11904. class UIAddProp extends UIBase {
  11905. constructor() {
  11906. super();
  11907. this.curType = "";
  11908. }
  11909. onConstructor() {
  11910. this.ui = ui_UIAddProp.createInstance();
  11911. this.contentPane = this.ui;
  11912. this.isEject = false;
  11913. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11914. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11915. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11916. this.updateUI();
  11917. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11918. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11919. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11920. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11921. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11922. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11923. }
  11924. show(type) {
  11925. super.show();
  11926. this.curType = type == 0 ? "coin" : "diamond";
  11927. this.switchBtn("");
  11928. this.ui.t0.play();
  11929. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11930. PlatMgr.showInsert(true);
  11931. this.setGlobalFont(this.ui);
  11932. }
  11933. closeSelf() {
  11934. this.hide();
  11935. }
  11936. updateUI() {
  11937. let data = cfgTable.moneyData;
  11938. let temp;
  11939. let obj;
  11940. for (const key in data) {
  11941. temp = data[key];
  11942. obj = this.ui.myNode["node" + key];
  11943. if (parseInt(key) <= 2) {
  11944. obj.diamondTxt.text = "+" + temp.num;
  11945. }
  11946. else {
  11947. obj.coinTxt.text = temp.num;
  11948. obj.diamondTxt.text = temp.get.split('_')[1];
  11949. }
  11950. }
  11951. this.updateDiamondShare();
  11952. }
  11953. updateDiamondShare() {
  11954. let data = DataMgr.getShareDiamondTimes();
  11955. if (data >= xGame.common.maxShareDiamondTimes) {
  11956. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11957. this.ui.myNode.node1.touchable = false;
  11958. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11959. }
  11960. else {
  11961. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11962. this.ui.myNode.node1.touchable = true;
  11963. }
  11964. }
  11965. switchBtn(type) {
  11966. if (type == "")
  11967. type = this.curType;
  11968. else {
  11969. if (this.curType == type) {
  11970. return;
  11971. }
  11972. else {
  11973. this.curType = type;
  11974. }
  11975. }
  11976. if (type == "coin") {
  11977. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11978. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11979. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11980. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11981. this.ui.myNode.c1.selectedIndex = 0;
  11982. }
  11983. else {
  11984. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11985. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11986. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11987. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11988. this.ui.myNode.c1.selectedIndex = 1;
  11989. }
  11990. }
  11991. convertCoin(index) {
  11992. let data = cfgTable.moneyData[index];
  11993. let coinNum = data.num;
  11994. let str = data.get.split('_')[1];
  11995. let needDiamond = parseInt(str);
  11996. if (DataMgr.diamondEnough(needDiamond)) {
  11997. DataMgr.setDiamond(-needDiamond);
  11998. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11999. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  12000. }
  12001. else {
  12002. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  12003. this.switchBtn("diamond");
  12004. }
  12005. }
  12006. videoGetDiamond() {
  12007. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  12008. if (Laya.Browser.onAndroid) {
  12009. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12010. if (!boo) {
  12011. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12012. return;
  12013. }
  12014. }
  12015. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  12016. }
  12017. else {
  12018. console.log('zh:AD 失败,直接发放奖励');
  12019. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  12020. }
  12021. }
  12022. qjff_AD_for_uiAddProp_videoGetDiamond() {
  12023. let num = cfgTable.moneyData[2].num;
  12024. xGame.common.playObjFlyAnim(num, Prop.diamond);
  12025. this.closeSelf();
  12026. }
  12027. videoGetCoin() {
  12028. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  12029. if (Laya.Browser.onAndroid) {
  12030. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12031. if (!boo) {
  12032. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12033. return;
  12034. }
  12035. }
  12036. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  12037. }
  12038. else {
  12039. console.log('zh:AD 失败,直接发放奖励');
  12040. this.qjff_AD_for_uiAddProp_videoGetCoin();
  12041. }
  12042. }
  12043. qjff_AD_for_uiAddProp_videoGetCoin() {
  12044. xGame.common.playObjFlyAnim(2000, Prop.coin);
  12045. this.closeSelf();
  12046. }
  12047. shareGetDiamond() {
  12048. let times = DataMgr.getShareDiamondTimes();
  12049. if (times >= xGame.common.maxShareDiamondTimes) {
  12050. console.log('zh: 233333333333 maxShareDiamondTimes');
  12051. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12052. }
  12053. else {
  12054. console.log('zh:33333333333333ad');
  12055. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  12056. if (Laya.Browser.onAndroid) {
  12057. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12058. if (!boo) {
  12059. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12060. return;
  12061. }
  12062. }
  12063. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12064. }
  12065. else {
  12066. console.log('zh:AD 失败,直接发放奖励');
  12067. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12068. }
  12069. }
  12070. }
  12071. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12072. let diamond = xGame.common.randomNum(50, 100);
  12073. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12074. DataMgr.setShareDiamondTimes(1);
  12075. this.updateDiamondShare();
  12076. }
  12077. openPutBallView() {
  12078. let end = xGame.uiMgr.getUI(UIGameEnd);
  12079. let skill = xGame.uiMgr.getUI(UISkill);
  12080. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12081. let uigame = xGame.uiMgr.getUI(UIGame);
  12082. if (end && !end.isHide) {
  12083. xGame.uiMgr.Hide(UIGameEnd);
  12084. xGame.uiMgr.Show(UIMain);
  12085. }
  12086. if (skill && !skill.isHide)
  12087. xGame.uiMgr.Hide(UISkill);
  12088. if (uigame && !uigame.isHide)
  12089. xGame.uiMgr.Hide(UIGame);
  12090. if (level && !level.isHide) {
  12091. }
  12092. else {
  12093. xGame.uiMgr.Show(UILevelDisplay);
  12094. }
  12095. this.closeSelf();
  12096. }
  12097. }
  12098. UIAddProp.uiName = "UIAddProp";
  12099. class MoneyNode {
  12100. constructor(ui) {
  12101. this.leftTime = 0;
  12102. this.ui = ui;
  12103. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12104. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12105. this.ui.addPowerBtn.onClick(this, this.addPower);
  12106. this.ui.c1.selectedIndex = 1;
  12107. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12108. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12109. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12110. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12111. this.coinChange();
  12112. this.diamondChange();
  12113. this.powerChange();
  12114. }
  12115. addPower() {
  12116. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12117. xGame.uiMgr.Show(UIPower);
  12118. }
  12119. powerChange() {
  12120. let powerNum = DataMgr.getPower();
  12121. this.ui.powerTxt.text = powerNum + "";
  12122. }
  12123. checkPowerTime() {
  12124. let cur = new Date().getTime();
  12125. let last = DataMgr.getPowerTime();
  12126. if (last == 0) {
  12127. last = cur;
  12128. DataMgr.setPowerTime(cur);
  12129. }
  12130. let power = DataMgr.getPower();
  12131. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12132. Laya.timer.clearAll(this);
  12133. if (power >= xGame.common.natureMaxPower) {
  12134. this.ui.powerTimeTxt.text = "";
  12135. DataMgr.setPowerTime(cur);
  12136. return;
  12137. }
  12138. if (power + offset >= xGame.common.natureMaxPower) {
  12139. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12140. this.ui.powerTimeTxt.text = "";
  12141. DataMgr.setPowerTime(cur);
  12142. }
  12143. else {
  12144. if (offset > 0) {
  12145. DataMgr.setPower(offset);
  12146. DataMgr.setPowerTime(cur);
  12147. }
  12148. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12149. this.leftTime = xGame.common.powerRecoverNum - time;
  12150. if (this.leftTime <= 0)
  12151. this.leftTime = 0;
  12152. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12153. Laya.timer.loop(1000, this, this.updatePowerTime);
  12154. }
  12155. }
  12156. updatePowerTime() {
  12157. this.leftTime -= 1;
  12158. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12159. if (this.leftTime <= 0) {
  12160. this.checkPowerTime();
  12161. }
  12162. }
  12163. coinChange() {
  12164. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12165. }
  12166. diamondChange() {
  12167. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12168. }
  12169. addCoin() {
  12170. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12171. Moyu.sendDataEvent("AddCoinBtn");
  12172. xGame.uiMgr.Show(UIAddProp, 0);
  12173. }
  12174. addDiamond() {
  12175. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12176. Moyu.sendDataEvent("AddDiamondBtn");
  12177. xGame.uiMgr.Show(UIAddProp, 1);
  12178. }
  12179. }
  12180. class UIDraw extends UIBase {
  12181. constructor() {
  12182. super();
  12183. this.curKey = 0;
  12184. }
  12185. onConstructor() {
  12186. this.ui = ui_UIDraw.createInstance();
  12187. this.contentPane = this.ui;
  12188. this.isEject = false;
  12189. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12190. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12191. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12192. this.initDraw();
  12193. this.initUI();
  12194. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12195. }
  12196. show() {
  12197. super.show();
  12198. this.ui.t0.play();
  12199. this.playSecretaryIdle();
  12200. this.updateDraw();
  12201. this.checkFree();
  12202. if (PlatMgr.bannerDelay > 0) {
  12203. this.ui.closeNode.closeBtn.visible = false;
  12204. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12205. this.ui.closeNode.closeBtn.visible = true;
  12206. });
  12207. }
  12208. PlatMgr.showRateBanner();
  12209. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12210. this.setGlobalFont(this.ui);
  12211. }
  12212. hide() {
  12213. Laya.timer.clearAll(this);
  12214. super.hide();
  12215. }
  12216. checkFree() {
  12217. let isFree = DataMgr.getDailyfreeDrawTimes();
  12218. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12219. }
  12220. initDraw() {
  12221. this.drawObj = [];
  12222. let data = cfgTable.drawData;
  12223. let temp;
  12224. let weight = 0;
  12225. for (const key in data) {
  12226. temp = data[key];
  12227. weight += temp.weight;
  12228. this.drawObj.push(weight);
  12229. }
  12230. this.allWeight = weight;
  12231. }
  12232. initUI() {
  12233. let data = cfgTable.drawData;
  12234. let temp;
  12235. let img;
  12236. let txt;
  12237. for (const key in data) {
  12238. temp = data[key];
  12239. img = this.ui.myNode.rotNode["img" + key];
  12240. txt = this.ui.myNode.rotNode["txt" + key];
  12241. img.url = xGame.common.getGameIconUrl(temp.icon);
  12242. txt.visible = true;
  12243. if (temp.award > 2) {
  12244. img.rotation = 0;
  12245. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12246. }
  12247. else {
  12248. img.rotation = temp.rotation;
  12249. txt.text = temp.num;
  12250. }
  12251. }
  12252. }
  12253. getCurkey() {
  12254. let rand = Math.random() * this.allWeight;
  12255. let temp;
  12256. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12257. temp = this.drawObj[index];
  12258. if (index == 0) {
  12259. if (rand < temp) {
  12260. return index + 1;
  12261. }
  12262. }
  12263. else {
  12264. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12265. return index + 1;
  12266. }
  12267. }
  12268. }
  12269. return 2;
  12270. }
  12271. startDraw() {
  12272. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12273. if (freeTimes > 0) {
  12274. this.beginDraw();
  12275. DataMgr.setDailyfreeDrawTimes(0);
  12276. this.checkFree();
  12277. }
  12278. else {
  12279. if (Laya.Browser.onAndroid) {
  12280. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12281. if (!boo) {
  12282. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12283. return;
  12284. }
  12285. }
  12286. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12287. }
  12288. else {
  12289. console.log('zh:AD 失败,直接发放奖励');
  12290. this.qjff_chouJiang();
  12291. }
  12292. }
  12293. }
  12294. qjff_chouJiang() {
  12295. this.beginDraw();
  12296. }
  12297. beginDraw() {
  12298. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12299. this.ui.drawBtn.touchable = false;
  12300. this.curKey = this.getCurkey();
  12301. console.log("当前key", this.curKey);
  12302. let cell = 60;
  12303. let lap = 3;
  12304. let angle = cell * (this.curKey - 1) + lap * 360;
  12305. let target = this.ui.myNode.rotNode;
  12306. target.rotation = 0;
  12307. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12308. console.log("旋转完成");
  12309. this.ui.drawBtn.touchable = true;
  12310. this.getAward();
  12311. }));
  12312. }
  12313. getAward() {
  12314. let data = cfgTable.drawData[this.curKey];
  12315. let temp = new AwardType();
  12316. temp.type = data.award;
  12317. temp.num = data.num;
  12318. xGame.common.getAward([temp], () => {
  12319. DataMgr.setDrawTimes(1);
  12320. this.updateDraw();
  12321. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12322. });
  12323. }
  12324. updateDraw() {
  12325. let drawTimes = DataMgr.getDrawTimes();
  12326. let awardTimes = DataMgr.getDrawAwardTimes();
  12327. if (Math.floor(drawTimes / 3) > awardTimes) {
  12328. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12329. this.ui.extraNode.boxBtn.touchable = true;
  12330. this.ui.extraNode.tipsTxt.text = "3/3";
  12331. this.ui.extraNode.barNode.width = 265;
  12332. this.getExtraAward();
  12333. }
  12334. else {
  12335. this.ui.extraNode.boxBtn.t0.stop();
  12336. this.ui.extraNode.boxBtn.touchable = false;
  12337. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12338. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12339. }
  12340. let data = cfgTable.drawData[1];
  12341. if (awardTimes == 0) {
  12342. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12343. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12344. this.ui.myNode.rotNode.img1.rotation = 0;
  12345. }
  12346. else {
  12347. let award = data.nextid;
  12348. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12349. this.ui.myNode.rotNode.txt1.text = award[1];
  12350. this.ui.myNode.rotNode.img1.rotation = 0;
  12351. }
  12352. }
  12353. getExtraAward() {
  12354. let drawTimes = DataMgr.getDrawTimes();
  12355. let awardTimes = DataMgr.getDrawAwardTimes();
  12356. let data = cfgTable.drawData[1];
  12357. let award = new AwardType();
  12358. if (awardTimes == 0) {
  12359. award.num = data.num;
  12360. award.type = data.award;
  12361. xGame.common.getAward([award], () => {
  12362. let all = Math.floor(drawTimes / 3);
  12363. DataMgr.setDrawAwardTimes(all);
  12364. this.updateDraw();
  12365. });
  12366. }
  12367. else {
  12368. award.num = parseInt(data.nextid[1]);
  12369. award.type = parseInt(data.nextid[0]);
  12370. xGame.common.getAward([award], () => {
  12371. let all = Math.floor(drawTimes / 3);
  12372. DataMgr.setDrawAwardTimes(all);
  12373. this.updateDraw();
  12374. });
  12375. }
  12376. }
  12377. closeSelf() {
  12378. this.hide();
  12379. }
  12380. playSecretaryIdle() {
  12381. let parent = this.ui.secretary.displayObject;
  12382. parent.destroyChildren();
  12383. let xx = this.ui.secretary.width / 2;
  12384. let yy = this.ui.secretary.height;
  12385. let scale = xGame.common.getSecretaryScale();
  12386. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12387. xGame.common.secretary.play(data, 0, true, parent);
  12388. }
  12389. }
  12390. UIDraw.uiName = "UIDraw";
  12391. class ui_UIFlyEft extends fgui.GComponent {
  12392. static createInstance() {
  12393. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12394. }
  12395. onConstruct() {
  12396. this.n0 = (this.getChild("n0"));
  12397. this.n1 = (this.getChild("n1"));
  12398. this.n2 = (this.getChild("n2"));
  12399. this.n3 = (this.getChild("n3"));
  12400. this.n4 = (this.getChild("n4"));
  12401. this.n5 = (this.getChild("n5"));
  12402. this.n6 = (this.getChild("n6"));
  12403. this.n7 = (this.getChild("n7"));
  12404. this.iconNode = (this.getChild("iconNode"));
  12405. this.txt = (this.getChild("txt"));
  12406. this.txtNode = (this.getChild("txtNode"));
  12407. }
  12408. }
  12409. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12410. class UIFlyEft extends UIBase {
  12411. constructor() {
  12412. super();
  12413. this.max = 8;
  12414. this.delay = 0;
  12415. }
  12416. onConstructor() {
  12417. this.ui = ui_UIFlyEft.createInstance();
  12418. this.contentPane = this.ui;
  12419. this.isEject = false;
  12420. this.isMuti = true;
  12421. this.ui.x += xGame.common.sysOffestNum;
  12422. }
  12423. getArrPos() {
  12424. if (this.iconPos && this.iconPos.length > 0)
  12425. return;
  12426. this.iconPos = [];
  12427. let temp;
  12428. for (let index = 0; index < this.max; index++) {
  12429. temp = this.ui["n" + index];
  12430. this.iconPos.push([temp.x, temp.y]);
  12431. }
  12432. }
  12433. show(stPos, edPos, num, type, callback) {
  12434. super.show();
  12435. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12436. this.getArrPos();
  12437. this.updateUI(type);
  12438. this.updatePos();
  12439. this.runFly(edPos, callback);
  12440. this.runWorlds(stPos, num);
  12441. this.setGlobalFont(this.ui);
  12442. }
  12443. updateUI(type) {
  12444. let temp;
  12445. let str;
  12446. for (let index = 0; index < this.max; index++) {
  12447. temp = this.ui["n" + index];
  12448. str = this.getIconStr(type);
  12449. temp.url = xGame.common.getGameIconUrl(str);
  12450. }
  12451. }
  12452. getIconStr(type) {
  12453. switch (type) {
  12454. case Prop.diamond:
  12455. return "ty_zs";
  12456. case Prop.coin:
  12457. return "ty_jb";
  12458. default:
  12459. break;
  12460. }
  12461. }
  12462. updatePos() {
  12463. let temp;
  12464. for (let index = 0; index < this.max; index++) {
  12465. temp = this.ui["n" + index];
  12466. temp.x = this.iconPos[index][0];
  12467. temp.y = this.iconPos[index][1];
  12468. }
  12469. }
  12470. runFly(endPos, callback) {
  12471. let all = 0;
  12472. let temp;
  12473. for (let index = 0; index < this.max; index++) {
  12474. temp = this.ui["n" + index];
  12475. temp.visible = true;
  12476. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12477. temp.visible = false;
  12478. all++;
  12479. if (all >= this.max) {
  12480. callback && callback();
  12481. }
  12482. }), 20 * index);
  12483. }
  12484. }
  12485. runWorlds(stPos, num) {
  12486. let str = "+" + num;
  12487. this.ui.txt.text = str;
  12488. let starX = stPos.x;
  12489. let starY = stPos.y + 50;
  12490. this.ui.txt.x = starX;
  12491. this.ui.txt.y = starY;
  12492. this.ui.txt.visible = true;
  12493. this.ui.txt.alpha = 1;
  12494. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12495. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12496. this.ui.txt.visible = false;
  12497. this.hide();
  12498. }));
  12499. }));
  12500. }
  12501. }
  12502. UIFlyEft.uiName = "UIFlyEft";
  12503. class Common {
  12504. constructor() {
  12505. this.convertNum = 0.025;
  12506. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12507. this.scaleV3One = new Laya.Vector3();
  12508. this.scaleV3Two = new Laya.Vector3();
  12509. this.posV4 = new Laya.Vector4();
  12510. this.showDebug = false;
  12511. this.openGuide = true;
  12512. this.rodOffest = new Laya.Vector2(0, 0);
  12513. this.rodAngle = 0;
  12514. this.gameMode = GameMode.classic;
  12515. this.bigMoveLevelIndex = 1;
  12516. this.bigMoveNeedCoin = 1000;
  12517. this.classicNiceNeddCoin = 1000;
  12518. this.passAwardCoin = 2000;
  12519. this.classicRoomType = 1;
  12520. this.maxPower = 20;
  12521. this.natureMaxPower = 5;
  12522. this.videoPower = 2;
  12523. this.powerRecoverNum = 900;
  12524. this.curPlayerSkillType = 0;
  12525. this.isNewDay = false;
  12526. this.clickedBall = false;
  12527. this.placeBallCurLevel = 0;
  12528. this.placeBallStarNum = 0;
  12529. this.longHelpLine = false;
  12530. this.maxShareDiamondTimes = 3;
  12531. this.guideStep = 0;
  12532. this.temSelfLevel = 0;
  12533. this.extraMoveNum = 0;
  12534. this.curRankID = 0;
  12535. this.rankID = {
  12536. normalStar: 12000,
  12537. wxStar: 12001
  12538. };
  12539. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12540. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12541. this.btnClickStr = "buttonclick";
  12542. this.maxSkillLevel = 10;
  12543. this.upSkillLevel = false;
  12544. this.gameStartTime = 0;
  12545. this._sysOffestNum = 0;
  12546. this.angleV2 = new Laya.Vector2();
  12547. this.rootV = new Laya.Vector2(0, 1);
  12548. this.tempDir1 = new Laya.Vector2();
  12549. this.tempDir2 = new Laya.Vector2();
  12550. this.ballSize = 33;
  12551. this.stPos = new Laya.Point();
  12552. this.edPos = new Laya.Point();
  12553. Common._instance = this;
  12554. window["common"] = this;
  12555. }
  12556. static getInstance() {
  12557. if (!this._instance) {
  12558. this._instance = new Common();
  12559. }
  12560. return this._instance;
  12561. }
  12562. get sysOffestNum() {
  12563. if (this._sysOffestNum == 0) {
  12564. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12565. }
  12566. return this._sysOffestNum;
  12567. }
  12568. testShader() {
  12569. let test = new LightShader();
  12570. test.texture = "res/d3Res/ballTexture/ball1.png";
  12571. Laya.stage.addChild(test);
  12572. }
  12573. playScale(node) {
  12574. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12575. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12576. }));
  12577. }));
  12578. }
  12579. setGroup(colli, ...group) {
  12580. let out = 0;
  12581. for (let index = 0; index < group.length; index++) {
  12582. if (index == 0) {
  12583. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12584. }
  12585. else {
  12586. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12587. }
  12588. }
  12589. colli.collisionGroup = out;
  12590. }
  12591. setCanGroupWith(colli, ...group) {
  12592. let out = 0;
  12593. for (let index = 0; index < group.length; index++) {
  12594. if (index == 0) {
  12595. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12596. }
  12597. else {
  12598. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12599. }
  12600. }
  12601. colli.canCollideWith = out;
  12602. }
  12603. loadPrefab(name, callback) {
  12604. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12605. let prefab = new Laya.Prefab();
  12606. prefab.json = obj;
  12607. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12608. callback && callback(img);
  12609. }));
  12610. }
  12611. pos2to3Convert(x, y, d3Pos) {
  12612. x = x + this.sysOffestNum;
  12613. d3Pos.setValue(x, y, 0);
  12614. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12615. if (success) {
  12616. }
  12617. else {
  12618. console.error("转换出错了。。。。。。。。");
  12619. }
  12620. }
  12621. scale2to3Convert(num) {
  12622. this.scaleV3One.setValue(0, 0, 0);
  12623. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12624. this.scaleV3Two.setValue(0, num, 0);
  12625. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12626. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12627. return outNum;
  12628. }
  12629. pos3to2Convert(d3Pos) {
  12630. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12631. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12632. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12633. d3Pos.x -= this.sysOffestNum;
  12634. }
  12635. scale3to2Convert(num) {
  12636. let scale = this.scale2to3Convert(1);
  12637. let d2Out = num / scale;
  12638. return d2Out;
  12639. }
  12640. getCollider(type, restitution = 0.9, density = 10) {
  12641. let colli;
  12642. if (type == "box")
  12643. colli = new Laya.BoxCollider();
  12644. else
  12645. colli = new Laya.CircleCollider();
  12646. colli.friction = 0;
  12647. colli.restitution = restitution;
  12648. colli.density = density;
  12649. return colli;
  12650. }
  12651. getRigbody() {
  12652. let rigy = new Laya.RigidBody();
  12653. rigy.bullet = true;
  12654. rigy.allowRotation = false;
  12655. rigy.allowSleep = false;
  12656. rigy.gravityScale = 0;
  12657. return rigy;
  12658. }
  12659. getfguiRotation(x, y) {
  12660. this.angleV2.setValue(x, y);
  12661. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12662. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12663. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12664. angle = -angle;
  12665. }
  12666. return 180 + angle;
  12667. }
  12668. getAngle(x, y) {
  12669. this.angleV2.setValue(x, y);
  12670. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12671. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12672. return angle;
  12673. }
  12674. randomNum(a, b) {
  12675. return a + Math.floor((b - a + 1) * Math.random());
  12676. }
  12677. getRandArrEle(arr) {
  12678. return arr[Math.floor(arr.length * Math.random())];
  12679. }
  12680. getSign(val) {
  12681. return val >= 0 ? 1 : -1;
  12682. }
  12683. botherArr(arr) {
  12684. let times = arr.length + 2;
  12685. let length = arr.length;
  12686. let a;
  12687. let b;
  12688. let temp;
  12689. for (let index = 0; index < times; index++) {
  12690. a = Math.floor(Math.random() * length);
  12691. b = Math.floor(Math.random() * length);
  12692. temp = arr[a];
  12693. arr[a] = arr[b];
  12694. arr[b] = temp;
  12695. }
  12696. }
  12697. getGameIconUrl(id) {
  12698. return "ui://game/" + id;
  12699. }
  12700. getComponentUrl(id) {
  12701. return "ui://game/" + id;
  12702. }
  12703. getAnimation() {
  12704. }
  12705. judgeSkillType(type = SkillType.highSpace) {
  12706. if (this.gameMode == GameMode.classic)
  12707. return;
  12708. let gameMgr = this.gameMgr;
  12709. if (gameMgr.selfTurn) {
  12710. if (gameMgr.selfCurSkill == type) {
  12711. return true;
  12712. }
  12713. }
  12714. else {
  12715. if (gameMgr.aiCurSkill == type) {
  12716. return true;
  12717. }
  12718. }
  12719. }
  12720. ballColliHole(collider) {
  12721. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12722. xGame.common.gameMgr.isFirstInGame = false;
  12723. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12724. }
  12725. collider.owner.mySrc.checkWrongBall();
  12726. }
  12727. getArrMaxEle(arr) {
  12728. let max = -Infinity;
  12729. for (let index = 0; index < arr.length; index++) {
  12730. max = Math.max(arr[index], max);
  12731. }
  12732. return max;
  12733. }
  12734. getArrMinEle(arr) {
  12735. let min = Infinity;
  12736. for (let index = 0; index < arr.length; index++) {
  12737. min = Math.min(arr[index], min);
  12738. }
  12739. return min;
  12740. }
  12741. playRandomMutiBallBigSkillSound() {
  12742. if (Math.random() <= 0.5)
  12743. return;
  12744. let rand = this.randomNum(1, 6);
  12745. let str = "ganfa0" + rand;
  12746. xGame.soundMgr.playSound(str);
  12747. }
  12748. showOneCamera(type) {
  12749. let object = xGame.common.d3World.cameraObj;
  12750. for (const key in object) {
  12751. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12752. object[key].init();
  12753. object[key].owner.active = key == type;
  12754. }
  12755. }
  12756. }
  12757. checkBallOverBorder(x, y) {
  12758. let radius = 17;
  12759. let condition = this._checkBorder(x + radius, y) ||
  12760. this._checkBorder(x - radius, y) ||
  12761. this._checkBorder(x, y + radius) ||
  12762. this._checkBorder(x, y - radius);
  12763. if (condition) {
  12764. return true;
  12765. }
  12766. }
  12767. _checkBorder(x, y) {
  12768. let borderRect = this.d2World.borderRect;
  12769. let xOffest = 20;
  12770. let yOffest = 20;
  12771. if (y <= borderRect.y - yOffest) {
  12772. return true;
  12773. }
  12774. if (y >= borderRect.y + borderRect.height + yOffest) {
  12775. return true;
  12776. }
  12777. if (x <= borderRect.x - xOffest) {
  12778. return true;
  12779. }
  12780. if (x >= borderRect.x + borderRect.width + xOffest) {
  12781. return true;
  12782. }
  12783. }
  12784. initWeight(cfg) {
  12785. let allCfgData = { data: {}, allWeightNum: 0 };
  12786. let weightCfg = allCfgData.data;
  12787. let weight = 0;
  12788. for (const key in cfg) {
  12789. weightCfg[key] = {};
  12790. weightCfg[key].id = cfg[key].id;
  12791. weightCfg[key].minWeight = weight;
  12792. weight += cfg[key].weight;
  12793. weightCfg[key].maxWeight = weight;
  12794. }
  12795. allCfgData.allWeightNum = weight;
  12796. return allCfgData;
  12797. }
  12798. getRandomWeightData(cfg) {
  12799. let weightCfg = cfg.data;
  12800. let allWeightNum = cfg.allWeightNum;
  12801. let rand = Math.floor(Math.random() * allWeightNum);
  12802. for (const key in weightCfg) {
  12803. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12804. return weightCfg[key];
  12805. }
  12806. }
  12807. return weightCfg[1];
  12808. }
  12809. showGirlTalkPop(wordsIndex, node, msgNode) {
  12810. node.visible = true;
  12811. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12812. node.t0.play(Laya.Handler.create(this, () => {
  12813. node.visible = false;
  12814. }));
  12815. }
  12816. stopGirlPop(node) {
  12817. node.t0.stop();
  12818. node.visible = false;
  12819. }
  12820. createHead(loader, url, size = 107) {
  12821. if (Laya.Browser.name == "Browser") {
  12822. loader.url = url;
  12823. return;
  12824. }
  12825. else {
  12826. console.log('zh:url=', url);
  12827. loader.url = url;
  12828. }
  12829. }
  12830. addTestCoin(num) {
  12831. DataMgr.setCoin(num);
  12832. }
  12833. addTestDiamond(num) {
  12834. DataMgr.setDiamond(num);
  12835. }
  12836. addTestSkill() {
  12837. DataMgr.setBigSkill(0, 99);
  12838. DataMgr.setBigSkill(1, 99);
  12839. DataMgr.setBigSkill(2, 99);
  12840. }
  12841. playClassicEmotion(number, x, y) {
  12842. if (this.gameMode == GameMode.bigMove)
  12843. return;
  12844. let randIndex = this.randomNum(0, 2);
  12845. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12846. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12847. if (this.gameMgr.selfTurn) {
  12848. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12849. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12850. }
  12851. else {
  12852. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12853. }
  12854. else {
  12855. if (number == this.gameMgr.blackNum) {
  12856. if (this.gameMgr.selfBallArr.length == 0) {
  12857. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12858. }
  12859. else {
  12860. }
  12861. }
  12862. else {
  12863. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12864. }
  12865. }
  12866. }
  12867. }
  12868. else {
  12869. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12870. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12871. }
  12872. else {
  12873. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12874. }
  12875. else {
  12876. if (number == this.gameMgr.blackNum) {
  12877. if (this.gameMgr.aiBallArr.length == 0) {
  12878. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12879. }
  12880. else {
  12881. }
  12882. }
  12883. else {
  12884. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12885. }
  12886. }
  12887. }
  12888. }
  12889. }
  12890. playHappySound(number) {
  12891. if (this.gameMode != GameMode.classic)
  12892. return;
  12893. if (number == 8)
  12894. return;
  12895. let play = false;
  12896. if (this.gameMgr.selfTurn) {
  12897. if (this.gameMgr.ensureBallType) {
  12898. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12899. play = true;
  12900. }
  12901. }
  12902. else {
  12903. play = true;
  12904. }
  12905. }
  12906. else {
  12907. if (this.gameMgr.ensureBallType) {
  12908. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12909. play = true;
  12910. }
  12911. }
  12912. else {
  12913. play = true;
  12914. }
  12915. }
  12916. if (play)
  12917. xGame.soundMgr.playSound("applause");
  12918. }
  12919. destroyClassicEmotion() {
  12920. if (this.gameMode == GameMode.bigMove)
  12921. return;
  12922. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12923. parent.destroyChildren();
  12924. }
  12925. playAwardSpine(x, y) {
  12926. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12927. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12928. this.awardSpine.play(data, 0, false, parent);
  12929. }
  12930. destroyAwardSpine() {
  12931. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12932. parent.destroyChildren();
  12933. }
  12934. isBlock(bx, by, hx, hy, except = null) {
  12935. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12936. let balls = xGame.common.d2World.ballArr;
  12937. let outArr = [];
  12938. for (let index = 0; index < balls.length; index++) {
  12939. let obj = balls[index];
  12940. if (obj.number == 0)
  12941. continue;
  12942. if (obj == except)
  12943. continue;
  12944. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12945. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12946. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12947. if (num >= 1)
  12948. num = 1;
  12949. if (num < 0)
  12950. continue;
  12951. let gap = Math.sin(Math.acos(num)) * dis;
  12952. if (gap < this.ballSize) {
  12953. outArr.push({
  12954. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12955. disHon: Math.cos(Math.acos(num)) * dis,
  12956. disVer: Math.sin(Math.acos(num)) * dis,
  12957. src: balls[index],
  12958. dir: this.tempDir1
  12959. });
  12960. }
  12961. }
  12962. if (outArr.length > 0) {
  12963. outArr.sort((a, b) => { return a.dis - b.dis; });
  12964. return outArr[0];
  12965. }
  12966. }
  12967. AngleBetween(vector1, vector2) {
  12968. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12969. return rad * (180 / Math.PI);
  12970. }
  12971. getSecretaryScale() {
  12972. if (this.secretary.spineName == "mishu") {
  12973. return 1.28;
  12974. }
  12975. else {
  12976. return 1.024;
  12977. }
  12978. }
  12979. signAwardContainsRod(arr) {
  12980. let temp;
  12981. for (let index = 0; index < arr.length; index++) {
  12982. temp = arr[index].split('-')[0];
  12983. if (parseInt(temp) > 2) {
  12984. return true;
  12985. }
  12986. }
  12987. }
  12988. judgeSameDay() {
  12989. let lastTime = DataMgr.getSignTime();
  12990. let curTime = new Date().getTime();
  12991. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12992. return true;
  12993. }
  12994. return false;
  12995. }
  12996. getAward(arr, callback) {
  12997. let showTriple = arr[0].type <= 2;
  12998. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12999. let temp;
  13000. for (let index = 0; index < arr.length; index++) {
  13001. temp = arr[index];
  13002. switch (temp.type) {
  13003. case 1:
  13004. this.playObjFlyAnim(temp.num, temp.type);
  13005. break;
  13006. case 2:
  13007. this.playObjFlyAnim(temp.num, temp.type);
  13008. break;
  13009. case 3:
  13010. case 4:
  13011. case 5:
  13012. case 6:
  13013. DataMgr.setBallRod(temp.type - 2, 1);
  13014. DataMgr.setCurBallRod(temp.type - 2);
  13015. break;
  13016. default:
  13017. break;
  13018. }
  13019. }
  13020. callback && callback(watchVideo);
  13021. });
  13022. }
  13023. getMoneyNode() {
  13024. let moneyNode;
  13025. let sign = xGame.uiMgr.getUI(UISign);
  13026. let draw = xGame.uiMgr.getUI(UIDraw);
  13027. let end = xGame.uiMgr.getUI(UIGameEnd);
  13028. let skill = xGame.uiMgr.getUI(UISkill);
  13029. if (sign && !sign.isHide)
  13030. moneyNode = sign.ui.moneyNode;
  13031. if (draw && !draw.isHide)
  13032. moneyNode = draw.ui.moneyNode;
  13033. if (end && !end.isHide)
  13034. moneyNode = end.ui.moneyNode;
  13035. if (skill && !skill.isHide)
  13036. moneyNode = skill.ui.moneyNode;
  13037. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  13038. let main = xGame.uiMgr.getUI(UIMain);
  13039. if (condition1 && main && !main.isHide) {
  13040. moneyNode = main.ui.moneyNode;
  13041. }
  13042. return moneyNode;
  13043. }
  13044. playObjFlyAnim(num, type, callback = null) {
  13045. this.stPos.x = Laya.stage.width / 2;
  13046. this.stPos.y = Laya.stage.height / 2;
  13047. let moneyNode = this.getMoneyNode();
  13048. switch (type) {
  13049. case Prop.diamond:
  13050. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  13051. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  13052. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  13053. this.edPos.x /= 2;
  13054. this.edPos.y /= 2;
  13055. break;
  13056. case Prop.coin:
  13057. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  13058. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13059. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13060. this.edPos.x /= 2;
  13061. this.edPos.y /= 2;
  13062. break;
  13063. default:
  13064. break;
  13065. }
  13066. xGame.soundMgr.playSound("coinbag");
  13067. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13068. switch (type) {
  13069. case Prop.diamond:
  13070. DataMgr.setDiamond(num);
  13071. break;
  13072. case Prop.coin:
  13073. DataMgr.setCoin(num);
  13074. break;
  13075. default:
  13076. break;
  13077. }
  13078. callback && callback();
  13079. });
  13080. }
  13081. autoPopUIView() {
  13082. let arr = [];
  13083. let sign = this.judgeSameDay() ? false : true;
  13084. if (sign)
  13085. arr.push("sign");
  13086. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13087. if (draw)
  13088. arr.push("draw");
  13089. if (arr.length <= 0)
  13090. return;
  13091. let str = this.getRandArrEle(arr);
  13092. switch (str) {
  13093. case "sign":
  13094. xGame.uiMgr.Show(UISign);
  13095. break;
  13096. case "draw":
  13097. xGame.uiMgr.Show(UIDraw);
  13098. break;
  13099. default:
  13100. break;
  13101. }
  13102. }
  13103. getMSTime(time) {
  13104. let min = Math.floor(time / 60);
  13105. let sec = Math.floor((time - min * 60));
  13106. if (sec < 10)
  13107. sec = "0" + sec;
  13108. if (min < 10)
  13109. min = "0" + min;
  13110. return `${min}:${sec}`;
  13111. }
  13112. testPower() {
  13113. DataMgr.setPower(0, false);
  13114. }
  13115. getAllStarNum() {
  13116. let data = DataMgr.getPlaceBallLevelList();
  13117. let out = 0;
  13118. for (let index = 0; index < data.length; index++) {
  13119. out += data[index].star;
  13120. }
  13121. return out;
  13122. }
  13123. recoverCameraView() {
  13124. Laya.timer.once(900, this, () => {
  13125. xGame.common.showOneCamera("mainCamera");
  13126. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13127. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13128. xGame.common.gameUI.ui.border.alpha = 0;
  13129. if (Laya.physicsTimer.scale < 1) {
  13130. Laya.physicsTimer.scale = 1;
  13131. }
  13132. }
  13133. });
  13134. }
  13135. getClassicLevel() {
  13136. let successTimes = DataMgr.getClassicTimes();
  13137. let needKey = "";
  13138. let lastKey = "";
  13139. let cfg = cfgTable.classictimesData;
  13140. let data;
  13141. for (const key in cfg) {
  13142. data = cfg[key];
  13143. if (successTimes <= data.times) {
  13144. needKey = key;
  13145. }
  13146. lastKey = key;
  13147. }
  13148. if (needKey == "")
  13149. needKey = lastKey;
  13150. return cfg[needKey];
  13151. }
  13152. }
  13153. Common._instance = null;
  13154. class ui_Component92 extends fgui.GComponent {
  13155. static createInstance() {
  13156. return (fgui.UIPackage.createObject("game", "Component92"));
  13157. }
  13158. onConstruct() {
  13159. this.n0 = (this.getChild("n0"));
  13160. }
  13161. }
  13162. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13163. class ui_Component129 extends fgui.GProgressBar {
  13164. static createInstance() {
  13165. return (fgui.UIPackage.createObject("game", "Component129"));
  13166. }
  13167. onConstruct() {
  13168. this.bar_v = (this.getChild("bar_v"));
  13169. this.n84 = (this.getChild("n84"));
  13170. }
  13171. }
  13172. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13173. class ui_Component130 extends fgui.GComponent {
  13174. static createInstance() {
  13175. return (fgui.UIPackage.createObject("game", "Component130"));
  13176. }
  13177. onConstruct() {
  13178. this.ani = (this.getChild("ani"));
  13179. this.t0 = this.getTransition("t0");
  13180. }
  13181. }
  13182. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13183. class ui_powerEft extends fgui.GComponent {
  13184. static createInstance() {
  13185. return (fgui.UIPackage.createObject("game", "powerEft"));
  13186. }
  13187. onConstruct() {
  13188. this.ani = (this.getChild("ani"));
  13189. this.n88 = (this.getChild("n88"));
  13190. this.n89 = (this.getChild("n89"));
  13191. }
  13192. }
  13193. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13194. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13195. static createInstance() {
  13196. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13197. }
  13198. onConstruct() {
  13199. this.c1 = this.getController("c1");
  13200. this.n2 = (this.getChild("n2"));
  13201. this.n22 = (this.getChild("n22"));
  13202. this.n23 = (this.getChild("n23"));
  13203. this.n15 = (this.getChild("n15"));
  13204. this.challenge = (this.getChild("challenge"));
  13205. this.n17 = (this.getChild("n17"));
  13206. this.n3 = (this.getChild("n3"));
  13207. this.starNode = (this.getChild("starNode"));
  13208. this.levelTxt = (this.getChild("levelTxt"));
  13209. this.n14 = (this.getChild("n14"));
  13210. this.n19 = (this.getChild("n19"));
  13211. this.n20 = (this.getChild("n20"));
  13212. this.n21 = (this.getChild("n21"));
  13213. this.special = (this.getChild("special"));
  13214. }
  13215. }
  13216. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13217. class ui_Component79 extends fgui.GComponent {
  13218. static createInstance() {
  13219. return (fgui.UIPackage.createObject("game", "Component79"));
  13220. }
  13221. onConstruct() {
  13222. this.c1 = this.getController("c1");
  13223. this.n7 = (this.getChild("n7"));
  13224. this.n8 = (this.getChild("n8"));
  13225. this.n9 = (this.getChild("n9"));
  13226. this.n10 = (this.getChild("n10"));
  13227. this.n11 = (this.getChild("n11"));
  13228. this.n12 = (this.getChild("n12"));
  13229. }
  13230. }
  13231. ui_Component79.URL = "ui://isxx5ak7avag477";
  13232. class ui_Component80 extends fgui.GComponent {
  13233. static createInstance() {
  13234. return (fgui.UIPackage.createObject("game", "Component80"));
  13235. }
  13236. onConstruct() {
  13237. this.n0 = (this.getChild("n0"));
  13238. this.n1 = (this.getChild("n1"));
  13239. this.myList = (this.getChild("myList"));
  13240. this.t0 = this.getTransition("t0");
  13241. }
  13242. }
  13243. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13244. class ui_SignNormal extends fgui.GComponent {
  13245. static createInstance() {
  13246. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13247. }
  13248. onConstruct() {
  13249. this.c1 = this.getController("c1");
  13250. this.n7 = (this.getChild("n7"));
  13251. this.n15 = (this.getChild("n15"));
  13252. this.titleTxt = (this.getChild("titleTxt"));
  13253. this.n8 = (this.getChild("n8"));
  13254. this.myIcon = (this.getChild("myIcon"));
  13255. this.numTxt = (this.getChild("numTxt"));
  13256. this.n12 = (this.getChild("n12"));
  13257. this.n13 = (this.getChild("n13"));
  13258. this.n17 = (this.getChild("n17"));
  13259. this.n14 = (this.getChild("n14"));
  13260. }
  13261. }
  13262. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13263. class ui_Button_reg extends fgui.GButton {
  13264. static createInstance() {
  13265. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13266. }
  13267. onConstruct() {
  13268. this.button = this.getController("button");
  13269. this.n6 = (this.getChild("n6"));
  13270. this.n4 = (this.getChild("n4"));
  13271. }
  13272. }
  13273. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13274. class ui_screenNode extends fgui.GComponent {
  13275. static createInstance() {
  13276. return (fgui.UIPackage.createObject("game", "screenNode"));
  13277. }
  13278. onConstruct() {
  13279. this.n9 = (this.getChild("n9"));
  13280. this.screenImg = (this.getChild("screenImg"));
  13281. }
  13282. }
  13283. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13284. class ui_GetAwrad_com1 extends fgui.GComponent {
  13285. static createInstance() {
  13286. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13287. }
  13288. onConstruct() {
  13289. this.n38 = (this.getChild("n38"));
  13290. this.n39 = (this.getChild("n39"));
  13291. this.n40 = (this.getChild("n40"));
  13292. this.t0 = this.getTransition("t0");
  13293. this.t1 = this.getTransition("t1");
  13294. }
  13295. }
  13296. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13297. class ui_GetAwrad_com2 extends fgui.GComponent {
  13298. static createInstance() {
  13299. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13300. }
  13301. onConstruct() {
  13302. this.n39 = (this.getChild("n39"));
  13303. this.n40 = (this.getChild("n40"));
  13304. this.t0 = this.getTransition("t0");
  13305. }
  13306. }
  13307. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13308. class ui_Component128 extends fgui.GComponent {
  13309. static createInstance() {
  13310. return (fgui.UIPackage.createObject("game", "Component128"));
  13311. }
  13312. onConstruct() {
  13313. this.n38 = (this.getChild("n38"));
  13314. this.n40 = (this.getChild("n40"));
  13315. }
  13316. }
  13317. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13318. class ui_Component100_1 extends fgui.GComponent {
  13319. static createInstance() {
  13320. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13321. }
  13322. onConstruct() {
  13323. this.myNode = (this.getChild("myNode"));
  13324. this.t0 = this.getTransition("t0");
  13325. }
  13326. }
  13327. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13328. class ui_Component142 extends fgui.GComponent {
  13329. static createInstance() {
  13330. return (fgui.UIPackage.createObject("game", "Component142"));
  13331. }
  13332. onConstruct() {
  13333. this.n41 = (this.getChild("n41"));
  13334. this.n42 = (this.getChild("n42"));
  13335. }
  13336. }
  13337. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13338. class ui_main_guang extends fgui.GComponent {
  13339. static createInstance() {
  13340. return (fgui.UIPackage.createObject("game", "main_guang"));
  13341. }
  13342. onConstruct() {
  13343. this.n1 = (this.getChild("n1"));
  13344. this.n2 = (this.getChild("n2"));
  13345. this.n3 = (this.getChild("n3"));
  13346. this.n4 = (this.getChild("n4"));
  13347. this.n5 = (this.getChild("n5"));
  13348. this.n6 = (this.getChild("n6"));
  13349. this.n8 = (this.getChild("n8"));
  13350. this.t0 = this.getTransition("t0");
  13351. }
  13352. }
  13353. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13354. class ui_try_com1 extends fgui.GComponent {
  13355. static createInstance() {
  13356. return (fgui.UIPackage.createObject("game", "try_com1"));
  13357. }
  13358. onConstruct() {
  13359. this.c1 = this.getController("c1");
  13360. this.n0 = (this.getChild("n0"));
  13361. this.n2 = (this.getChild("n2"));
  13362. this.cancelBtn = (this.getChild("cancelBtn"));
  13363. this.videoBtn = (this.getChild("videoBtn"));
  13364. this.n9 = (this.getChild("n9"));
  13365. this.n24 = (this.getChild("n24"));
  13366. this.titleTxt = (this.getChild("titleTxt"));
  13367. this.n32 = (this.getChild("n32"));
  13368. this.n29 = (this.getChild("n29"));
  13369. this.n36 = (this.getChild("n36"));
  13370. this.txtTime = (this.getChild("txtTime"));
  13371. this.t0 = this.getTransition("t0");
  13372. }
  13373. }
  13374. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13375. class ui_try_com2 extends fgui.GComponent {
  13376. static createInstance() {
  13377. return (fgui.UIPackage.createObject("game", "try_com2"));
  13378. }
  13379. onConstruct() {
  13380. this.skillicon = (this.getChild("skillicon"));
  13381. this.n35 = (this.getChild("n35"));
  13382. this.n31 = (this.getChild("n31"));
  13383. this.n32 = (this.getChild("n32"));
  13384. this.n33 = (this.getChild("n33"));
  13385. this.n34 = (this.getChild("n34"));
  13386. }
  13387. }
  13388. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13389. class ui_try_com3 extends fgui.GComponent {
  13390. static createInstance() {
  13391. return (fgui.UIPackage.createObject("game", "try_com3"));
  13392. }
  13393. onConstruct() {
  13394. this.n33 = (this.getChild("n33"));
  13395. this.n34 = (this.getChild("n34"));
  13396. this.n35 = (this.getChild("n35"));
  13397. this.t0 = this.getTransition("t0");
  13398. }
  13399. }
  13400. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13401. class ui_huihe1 extends fgui.GComponent {
  13402. static createInstance() {
  13403. return (fgui.UIPackage.createObject("game", "huihe1"));
  13404. }
  13405. onConstruct() {
  13406. this.n0 = (this.getChild("n0"));
  13407. this.n1 = (this.getChild("n1"));
  13408. this.t0 = this.getTransition("t0");
  13409. }
  13410. }
  13411. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13412. class ui_huihe2 extends fgui.GComponent {
  13413. static createInstance() {
  13414. return (fgui.UIPackage.createObject("game", "huihe2"));
  13415. }
  13416. onConstruct() {
  13417. this.n0 = (this.getChild("n0"));
  13418. this.n1 = (this.getChild("n1"));
  13419. this.t0 = this.getTransition("t0");
  13420. }
  13421. }
  13422. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13423. class ui_Component143 extends fgui.GComponent {
  13424. static createInstance() {
  13425. return (fgui.UIPackage.createObject("game", "Component143"));
  13426. }
  13427. onConstruct() {
  13428. this.n3 = (this.getChild("n3"));
  13429. this.n4 = (this.getChild("n4"));
  13430. this.n5 = (this.getChild("n5"));
  13431. this.n6 = (this.getChild("n6"));
  13432. this.n7 = (this.getChild("n7"));
  13433. this.n8 = (this.getChild("n8"));
  13434. this.n9 = (this.getChild("n9"));
  13435. this.n10 = (this.getChild("n10"));
  13436. this.t0 = this.getTransition("t0");
  13437. }
  13438. }
  13439. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13440. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13441. static createInstance() {
  13442. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13443. }
  13444. onConstruct() {
  13445. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13446. }
  13447. }
  13448. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13449. class ui_dh_jingbi2 extends fgui.GComponent {
  13450. static createInstance() {
  13451. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13452. }
  13453. onConstruct() {
  13454. this.n0 = (this.getChild("n0"));
  13455. this.n1 = (this.getChild("n1"));
  13456. this.n2 = (this.getChild("n2"));
  13457. this.n3 = (this.getChild("n3"));
  13458. this.n4 = (this.getChild("n4"));
  13459. this.n5 = (this.getChild("n5"));
  13460. this.n6 = (this.getChild("n6"));
  13461. this.n8 = (this.getChild("n8"));
  13462. this.n10 = (this.getChild("n10"));
  13463. this.t0 = this.getTransition("t0");
  13464. }
  13465. }
  13466. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13467. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13468. static createInstance() {
  13469. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13470. }
  13471. onConstruct() {
  13472. this.n1 = (this.getChild("n1"));
  13473. this.n4 = (this.getChild("n4"));
  13474. this.t0 = this.getTransition("t0");
  13475. }
  13476. }
  13477. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13478. class ui_dh_jingbi3 extends fgui.GComponent {
  13479. static createInstance() {
  13480. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13481. }
  13482. onConstruct() {
  13483. this.n0 = (this.getChild("n0"));
  13484. this.n1 = (this.getChild("n1"));
  13485. this.n2 = (this.getChild("n2"));
  13486. this.n3 = (this.getChild("n3"));
  13487. this.n4 = (this.getChild("n4"));
  13488. this.n5 = (this.getChild("n5"));
  13489. this.n6 = (this.getChild("n6"));
  13490. this.n8 = (this.getChild("n8"));
  13491. this.n10 = (this.getChild("n10"));
  13492. this.t0 = this.getTransition("t0");
  13493. }
  13494. }
  13495. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13496. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13497. static createInstance() {
  13498. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13499. }
  13500. onConstruct() {
  13501. this.n3 = (this.getChild("n3"));
  13502. this.n1 = (this.getChild("n1"));
  13503. this.t0 = this.getTransition("t0");
  13504. }
  13505. }
  13506. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13507. class ui_hb_jinbi1 extends fgui.GButton {
  13508. static createInstance() {
  13509. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13510. }
  13511. onConstruct() {
  13512. this.n20 = (this.getChild("n20"));
  13513. this.n25 = (this.getChild("n25"));
  13514. this.coinTxt = (this.getChild("coinTxt"));
  13515. this.n28 = (this.getChild("n28"));
  13516. this.n32 = (this.getChild("n32"));
  13517. this.n38 = (this.getChild("n38"));
  13518. this.n45 = (this.getChild("n45"));
  13519. this.getTips = (this.getChild("getTips"));
  13520. this.n39 = (this.getChild("n39"));
  13521. this.diamondTxt = (this.getChild("diamondTxt"));
  13522. this.n41 = (this.getChild("n41"));
  13523. this.n42 = (this.getChild("n42"));
  13524. this.n46 = (this.getChild("n46"));
  13525. this.n47 = (this.getChild("n47"));
  13526. this.n48 = (this.getChild("n48"));
  13527. this.t0 = this.getTransition("t0");
  13528. }
  13529. }
  13530. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13531. class ui_hb_jinbi2 extends fgui.GButton {
  13532. static createInstance() {
  13533. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13534. }
  13535. onConstruct() {
  13536. this.n20 = (this.getChild("n20"));
  13537. this.n25 = (this.getChild("n25"));
  13538. this.coinTxt = (this.getChild("coinTxt"));
  13539. this.n28 = (this.getChild("n28"));
  13540. this.n32 = (this.getChild("n32"));
  13541. this.n38 = (this.getChild("n38"));
  13542. this.n39 = (this.getChild("n39"));
  13543. this.diamondTxt = (this.getChild("diamondTxt"));
  13544. this.n41 = (this.getChild("n41"));
  13545. this.n42 = (this.getChild("n42"));
  13546. this.n43 = (this.getChild("n43"));
  13547. this.n44 = (this.getChild("n44"));
  13548. this.n45 = (this.getChild("n45"));
  13549. this.t0 = this.getTransition("t0");
  13550. }
  13551. }
  13552. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13553. class ui_hb_jinbi3 extends fgui.GButton {
  13554. static createInstance() {
  13555. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13556. }
  13557. onConstruct() {
  13558. this.n20 = (this.getChild("n20"));
  13559. this.n25 = (this.getChild("n25"));
  13560. this.coinTxt = (this.getChild("coinTxt"));
  13561. this.n28 = (this.getChild("n28"));
  13562. this.n32 = (this.getChild("n32"));
  13563. this.n38 = (this.getChild("n38"));
  13564. this.n39 = (this.getChild("n39"));
  13565. this.diamondTxt = (this.getChild("diamondTxt"));
  13566. this.n41 = (this.getChild("n41"));
  13567. this.n42 = (this.getChild("n42"));
  13568. this.n43 = (this.getChild("n43"));
  13569. this.n44 = (this.getChild("n44"));
  13570. this.n45 = (this.getChild("n45"));
  13571. this.t0 = this.getTransition("t0");
  13572. }
  13573. }
  13574. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13575. class ui_Component104 extends fgui.GComponent {
  13576. static createInstance() {
  13577. return (fgui.UIPackage.createObject("game", "Component104"));
  13578. }
  13579. onConstruct() {
  13580. this.c1 = this.getController("c1");
  13581. this.n12 = (this.getChild("n12"));
  13582. this.coinBtn = (this.getChild("coinBtn"));
  13583. this.diamondBtn = (this.getChild("diamondBtn"));
  13584. this.node3 = (this.getChild("node3"));
  13585. this.node4 = (this.getChild("node4"));
  13586. this.node5 = (this.getChild("node5"));
  13587. this.node1 = (this.getChild("node1"));
  13588. this.node2 = (this.getChild("node2"));
  13589. this.node6 = (this.getChild("node6"));
  13590. this.t0 = this.getTransition("t0");
  13591. }
  13592. }
  13593. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13594. class ui_Component105 extends fgui.GButton {
  13595. static createInstance() {
  13596. return (fgui.UIPackage.createObject("game", "Component105"));
  13597. }
  13598. onConstruct() {
  13599. this.c1 = this.getController("c1");
  13600. this.n49 = (this.getChild("n49"));
  13601. this.n18 = (this.getChild("n18"));
  13602. this.n46 = (this.getChild("n46"));
  13603. this.n48 = (this.getChild("n48"));
  13604. }
  13605. }
  13606. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13607. class ui_Component106 extends fgui.GButton {
  13608. static createInstance() {
  13609. return (fgui.UIPackage.createObject("game", "Component106"));
  13610. }
  13611. onConstruct() {
  13612. this.c1 = this.getController("c1");
  13613. this.n49 = (this.getChild("n49"));
  13614. this.n18 = (this.getChild("n18"));
  13615. this.n46 = (this.getChild("n46"));
  13616. this.n48 = (this.getChild("n48"));
  13617. }
  13618. }
  13619. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13620. class ui_hb_zs1 extends fgui.GButton {
  13621. static createInstance() {
  13622. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13623. }
  13624. onConstruct() {
  13625. this.c1 = this.getController("c1");
  13626. this.n20 = (this.getChild("n20"));
  13627. this.n21 = (this.getChild("n21"));
  13628. this.n26 = (this.getChild("n26"));
  13629. this.n27 = (this.getChild("n27"));
  13630. this.shareTxt = (this.getChild("shareTxt"));
  13631. this.n32 = (this.getChild("n32"));
  13632. this.n38 = (this.getChild("n38"));
  13633. this.n39 = (this.getChild("n39"));
  13634. this.n44 = (this.getChild("n44"));
  13635. this.diamondTxt = (this.getChild("diamondTxt"));
  13636. this.n41 = (this.getChild("n41"));
  13637. this.n45 = (this.getChild("n45"));
  13638. this.n47 = (this.getChild("n47"));
  13639. this.n48 = (this.getChild("n48"));
  13640. this.randTxt = (this.getChild("randTxt"));
  13641. this.n50 = (this.getChild("n50"));
  13642. this.t0 = this.getTransition("t0");
  13643. }
  13644. }
  13645. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13646. class ui_dh_zs1 extends fgui.GComponent {
  13647. static createInstance() {
  13648. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13649. }
  13650. onConstruct() {
  13651. this.n10 = (this.getChild("n10"));
  13652. this.n9 = (this.getChild("n9"));
  13653. this.n1 = (this.getChild("n1"));
  13654. this.n2 = (this.getChild("n2"));
  13655. this.n3 = (this.getChild("n3"));
  13656. this.n4 = (this.getChild("n4"));
  13657. this.n5 = (this.getChild("n5"));
  13658. this.n6 = (this.getChild("n6"));
  13659. this.n8 = (this.getChild("n8"));
  13660. this.n11 = (this.getChild("n11"));
  13661. this.t0 = this.getTransition("t0");
  13662. }
  13663. }
  13664. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13665. class ui_dh_zs1_1 extends fgui.GComponent {
  13666. static createInstance() {
  13667. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13668. }
  13669. onConstruct() {
  13670. this.n3 = (this.getChild("n3"));
  13671. this.n1 = (this.getChild("n1"));
  13672. this.t0 = this.getTransition("t0");
  13673. }
  13674. }
  13675. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13676. class ui_hb_zs2 extends fgui.GButton {
  13677. static createInstance() {
  13678. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13679. }
  13680. onConstruct() {
  13681. this.n20 = (this.getChild("n20"));
  13682. this.n21 = (this.getChild("n21"));
  13683. this.n26 = (this.getChild("n26"));
  13684. this.n27 = (this.getChild("n27"));
  13685. this.n32 = (this.getChild("n32"));
  13686. this.n38 = (this.getChild("n38"));
  13687. this.n39 = (this.getChild("n39"));
  13688. this.n44 = (this.getChild("n44"));
  13689. this.diamondTxt = (this.getChild("diamondTxt"));
  13690. this.n41 = (this.getChild("n41"));
  13691. this.n45 = (this.getChild("n45"));
  13692. this.t0 = this.getTransition("t0");
  13693. }
  13694. }
  13695. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13696. class ui_hb_zs3 extends fgui.GButton {
  13697. static createInstance() {
  13698. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13699. }
  13700. onConstruct() {
  13701. this.n20 = (this.getChild("n20"));
  13702. this.n21 = (this.getChild("n21"));
  13703. this.n26 = (this.getChild("n26"));
  13704. this.n27 = (this.getChild("n27"));
  13705. this.n32 = (this.getChild("n32"));
  13706. this.n38 = (this.getChild("n38"));
  13707. this.n47 = (this.getChild("n47"));
  13708. this.t0 = this.getTransition("t0");
  13709. }
  13710. }
  13711. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13712. class ui_dh_zs2 extends fgui.GComponent {
  13713. static createInstance() {
  13714. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13715. }
  13716. onConstruct() {
  13717. this.n10 = (this.getChild("n10"));
  13718. this.n9 = (this.getChild("n9"));
  13719. this.n1 = (this.getChild("n1"));
  13720. this.n2 = (this.getChild("n2"));
  13721. this.n3 = (this.getChild("n3"));
  13722. this.n4 = (this.getChild("n4"));
  13723. this.n5 = (this.getChild("n5"));
  13724. this.n6 = (this.getChild("n6"));
  13725. this.n8 = (this.getChild("n8"));
  13726. this.n11 = (this.getChild("n11"));
  13727. this.t0 = this.getTransition("t0");
  13728. }
  13729. }
  13730. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13731. class ui_dh_zs2_1 extends fgui.GComponent {
  13732. static createInstance() {
  13733. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13734. }
  13735. onConstruct() {
  13736. this.n3 = (this.getChild("n3"));
  13737. this.n1 = (this.getChild("n1"));
  13738. this.t0 = this.getTransition("t0");
  13739. }
  13740. }
  13741. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13742. class ui_dh_zs3 extends fgui.GComponent {
  13743. static createInstance() {
  13744. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13745. }
  13746. onConstruct() {
  13747. this.n10 = (this.getChild("n10"));
  13748. this.n9 = (this.getChild("n9"));
  13749. this.n1 = (this.getChild("n1"));
  13750. this.n2 = (this.getChild("n2"));
  13751. this.n3 = (this.getChild("n3"));
  13752. this.n4 = (this.getChild("n4"));
  13753. this.n5 = (this.getChild("n5"));
  13754. this.n6 = (this.getChild("n6"));
  13755. this.n8 = (this.getChild("n8"));
  13756. this.n11 = (this.getChild("n11"));
  13757. this.t0 = this.getTransition("t0");
  13758. }
  13759. }
  13760. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13761. class ui_dh_zs3_1 extends fgui.GComponent {
  13762. static createInstance() {
  13763. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13764. }
  13765. onConstruct() {
  13766. this.n3 = (this.getChild("n3"));
  13767. this.n1 = (this.getChild("n1"));
  13768. this.t0 = this.getTransition("t0");
  13769. }
  13770. }
  13771. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13772. class ui_Component107 extends fgui.GComponent {
  13773. static createInstance() {
  13774. return (fgui.UIPackage.createObject("game", "Component107"));
  13775. }
  13776. onConstruct() {
  13777. this.n18 = (this.getChild("n18"));
  13778. this.n19 = (this.getChild("n19"));
  13779. this.n20 = (this.getChild("n20"));
  13780. this.n21 = (this.getChild("n21"));
  13781. this.n22 = (this.getChild("n22"));
  13782. this.levelTxt = (this.getChild("levelTxt"));
  13783. this.t0 = this.getTransition("t0");
  13784. }
  13785. }
  13786. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13787. class ui_box_com1 extends fgui.GComponent {
  13788. static createInstance() {
  13789. return (fgui.UIPackage.createObject("game", "box_com1"));
  13790. }
  13791. onConstruct() {
  13792. this.n14 = (this.getChild("n14"));
  13793. this.n6 = (this.getChild("n6"));
  13794. this.t0 = this.getTransition("t0");
  13795. }
  13796. }
  13797. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13798. class ui_box_com2 extends fgui.GProgressBar {
  13799. static createInstance() {
  13800. return (fgui.UIPackage.createObject("game", "box_com2"));
  13801. }
  13802. onConstruct() {
  13803. this.bg0 = (this.getChild("bg0"));
  13804. this.bg = (this.getChild("bg"));
  13805. this.bar = (this.getChild("bar"));
  13806. this.n7 = (this.getChild("n7"));
  13807. this.n8 = (this.getChild("n8"));
  13808. this.n10 = (this.getChild("n10"));
  13809. this.n11 = (this.getChild("n11"));
  13810. this.n12 = (this.getChild("n12"));
  13811. }
  13812. }
  13813. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13814. class ui_box_com4 extends fgui.GComponent {
  13815. static createInstance() {
  13816. return (fgui.UIPackage.createObject("game", "box_com4"));
  13817. }
  13818. onConstruct() {
  13819. this.n8 = (this.getChild("n8"));
  13820. this.t0 = this.getTransition("t0");
  13821. }
  13822. }
  13823. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13824. class ui_box_com3 extends fgui.GComponent {
  13825. static createInstance() {
  13826. return (fgui.UIPackage.createObject("game", "box_com3"));
  13827. }
  13828. onConstruct() {
  13829. this.n2 = (this.getChild("n2"));
  13830. this.n3 = (this.getChild("n3"));
  13831. this.n4 = (this.getChild("n4"));
  13832. this.n5 = (this.getChild("n5"));
  13833. this.t0 = this.getTransition("t0");
  13834. this.t1 = this.getTransition("t1");
  13835. }
  13836. }
  13837. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13838. class ui_Component97 extends fgui.GComponent {
  13839. static createInstance() {
  13840. return (fgui.UIPackage.createObject("game", "Component97"));
  13841. }
  13842. onConstruct() {
  13843. this.c1 = this.getController("c1");
  13844. this.n46 = (this.getChild("n46"));
  13845. this.diamondNode = (this.getChild("diamondNode"));
  13846. this.coinNode = (this.getChild("coinNode"));
  13847. this.t0 = this.getTransition("t0");
  13848. }
  13849. }
  13850. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13851. class ui_Component98 extends fgui.GButton {
  13852. static createInstance() {
  13853. return (fgui.UIPackage.createObject("game", "Component98"));
  13854. }
  13855. onConstruct() {
  13856. this.n8 = (this.getChild("n8"));
  13857. this.n40 = (this.getChild("n40"));
  13858. }
  13859. }
  13860. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13861. class ui_Component28_11 extends fgui.GButton {
  13862. static createInstance() {
  13863. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13864. }
  13865. onConstruct() {
  13866. this.c1 = this.getController("c1");
  13867. this.n12 = (this.getChild("n12"));
  13868. this.n17 = (this.getChild("n17"));
  13869. this.n13 = (this.getChild("n13"));
  13870. this.diamondTxt = (this.getChild("diamondTxt"));
  13871. this.n15 = (this.getChild("n15"));
  13872. this.n16 = (this.getChild("n16"));
  13873. }
  13874. }
  13875. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13876. class ui_Component58_11 extends fgui.GComponent {
  13877. static createInstance() {
  13878. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13879. }
  13880. onConstruct() {
  13881. this.c1 = this.getController("c1");
  13882. this.n23 = (this.getChild("n23"));
  13883. this.n41 = (this.getChild("n41"));
  13884. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13885. this.n_daoju = (this.getChild("n_daoju"));
  13886. this.myList = (this.getChild("myList"));
  13887. this.djList = (this.getChild("djList"));
  13888. this.t0 = this.getTransition("t0");
  13889. }
  13890. }
  13891. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13892. class ui_Component100 extends fgui.GComponent {
  13893. static createInstance() {
  13894. return (fgui.UIPackage.createObject("game", "Component100"));
  13895. }
  13896. onConstruct() {
  13897. this.c1 = this.getController("c1");
  13898. this.n75 = (this.getChild("n75"));
  13899. this.n76 = (this.getChild("n76"));
  13900. this.n80 = (this.getChild("n80"));
  13901. this.txt = (this.getChild("txt"));
  13902. this.spineRoot = (this.getChild("spineRoot"));
  13903. }
  13904. }
  13905. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13906. class ui_Component101 extends fgui.GComponent {
  13907. static createInstance() {
  13908. return (fgui.UIPackage.createObject("game", "Component101"));
  13909. }
  13910. onConstruct() {
  13911. this.c1 = this.getController("c1");
  13912. this.n36 = (this.getChild("n36"));
  13913. this.n35 = (this.getChild("n35"));
  13914. this.n33 = (this.getChild("n33"));
  13915. this.n34 = (this.getChild("n34"));
  13916. }
  13917. }
  13918. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13919. class ui_Component53 extends fgui.GComponent {
  13920. static createInstance() {
  13921. return (fgui.UIPackage.createObject("game", "Component53"));
  13922. }
  13923. onConstruct() {
  13924. this.n0 = (this.getChild("n0"));
  13925. this.n1 = (this.getChild("n1"));
  13926. this.n2 = (this.getChild("n2"));
  13927. this.n3 = (this.getChild("n3"));
  13928. this.n4 = (this.getChild("n4"));
  13929. this.n5 = (this.getChild("n5"));
  13930. this.n6 = (this.getChild("n6"));
  13931. this.n7 = (this.getChild("n7"));
  13932. this.n8 = (this.getChild("n8"));
  13933. this.n9 = (this.getChild("n9"));
  13934. this.n10 = (this.getChild("n10"));
  13935. this.n11 = (this.getChild("n11"));
  13936. this.n12 = (this.getChild("n12"));
  13937. this.n13 = (this.getChild("n13"));
  13938. this.n14 = (this.getChild("n14"));
  13939. this.n15 = (this.getChild("n15"));
  13940. this.n16 = (this.getChild("n16"));
  13941. this.n19 = (this.getChild("n19"));
  13942. this.n20 = (this.getChild("n20"));
  13943. this.n21 = (this.getChild("n21"));
  13944. this.n22 = (this.getChild("n22"));
  13945. this.n23 = (this.getChild("n23"));
  13946. this.n24 = (this.getChild("n24"));
  13947. this.n25 = (this.getChild("n25"));
  13948. this.n26 = (this.getChild("n26"));
  13949. this.n27 = (this.getChild("n27"));
  13950. this.n28 = (this.getChild("n28"));
  13951. this.n29 = (this.getChild("n29"));
  13952. this.n30 = (this.getChild("n30"));
  13953. this.n31 = (this.getChild("n31"));
  13954. this.n32 = (this.getChild("n32"));
  13955. this.n33 = (this.getChild("n33"));
  13956. this.n34 = (this.getChild("n34"));
  13957. this.n35 = (this.getChild("n35"));
  13958. this.t0 = this.getTransition("t0");
  13959. }
  13960. }
  13961. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13962. class ui_Component58 extends fgui.GComponent {
  13963. static createInstance() {
  13964. return (fgui.UIPackage.createObject("game", "Component58"));
  13965. }
  13966. onConstruct() {
  13967. this.n23 = (this.getChild("n23"));
  13968. this.n41 = (this.getChild("n41"));
  13969. this.n8 = (this.getChild("n8"));
  13970. this.skillList = (this.getChild("skillList"));
  13971. this.t0 = this.getTransition("t0");
  13972. }
  13973. }
  13974. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13975. class ui_Component59 extends fgui.GComponent {
  13976. static createInstance() {
  13977. return (fgui.UIPackage.createObject("game", "Component59"));
  13978. }
  13979. onConstruct() {
  13980. this.n3 = (this.getChild("n3"));
  13981. this.msgTxt = (this.getChild("msgTxt"));
  13982. this.t0 = this.getTransition("t0");
  13983. }
  13984. }
  13985. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13986. class ui_RulerNode extends fgui.GComponent {
  13987. static createInstance() {
  13988. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13989. }
  13990. onConstruct() {
  13991. this.n6 = (this.getChild("n6"));
  13992. this.n4 = (this.getChild("n4"));
  13993. this.img1 = (this.getChild("img1"));
  13994. this.img2 = (this.getChild("img2"));
  13995. }
  13996. }
  13997. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13998. class ui_Component108 extends fgui.GComponent {
  13999. static createInstance() {
  14000. return (fgui.UIPackage.createObject("game", "Component108"));
  14001. }
  14002. onConstruct() {
  14003. this.n19 = (this.getChild("n19"));
  14004. this.t0 = this.getTransition("t0");
  14005. }
  14006. }
  14007. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  14008. class ui_Component63 extends fgui.GComponent {
  14009. static createInstance() {
  14010. return (fgui.UIPackage.createObject("game", "Component63"));
  14011. }
  14012. onConstruct() {
  14013. this.n66 = (this.getChild("n66"));
  14014. this.n56 = (this.getChild("n56"));
  14015. this.n63 = (this.getChild("n63"));
  14016. this.n65 = (this.getChild("n65"));
  14017. this.t0 = this.getTransition("t0");
  14018. }
  14019. }
  14020. ui_Component63.URL = "ui://isxx5ak7h657452";
  14021. class ui_topNode extends fgui.GComponent {
  14022. static createInstance() {
  14023. return (fgui.UIPackage.createObject("game", "topNode"));
  14024. }
  14025. onConstruct() {
  14026. this.selfProgress = (this.getChild("selfProgress"));
  14027. this.aiProgress = (this.getChild("aiProgress"));
  14028. this.selfKuang = (this.getChild("selfKuang"));
  14029. this.aiKuang = (this.getChild("aiKuang"));
  14030. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  14031. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  14032. this.n33 = (this.getChild("n33"));
  14033. this.n34 = (this.getChild("n34"));
  14034. this.selfNameTxt = (this.getChild("selfNameTxt"));
  14035. this.aiNameTxt = (this.getChild("aiNameTxt"));
  14036. this.selfBallList = (this.getChild("selfBallList"));
  14037. this.aiBallList = (this.getChild("aiBallList"));
  14038. this.middleNode = (this.getChild("middleNode"));
  14039. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  14040. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  14041. this.scoreNode = (this.getChild("scoreNode"));
  14042. this.selfTips = (this.getChild("selfTips"));
  14043. this.aiTips = (this.getChild("aiTips"));
  14044. }
  14045. }
  14046. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  14047. class ui_selfProgress extends fgui.GProgressBar {
  14048. static createInstance() {
  14049. return (fgui.UIPackage.createObject("game", "selfProgress"));
  14050. }
  14051. onConstruct() {
  14052. this.n3 = (this.getChild("n3"));
  14053. this.bar = (this.getChild("bar"));
  14054. }
  14055. }
  14056. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14057. class ui_aiProgress extends fgui.GProgressBar {
  14058. static createInstance() {
  14059. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14060. }
  14061. onConstruct() {
  14062. this.n3 = (this.getChild("n3"));
  14063. this.bar = (this.getChild("bar"));
  14064. }
  14065. }
  14066. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14067. class ui_ballDisplay extends fgui.GComponent {
  14068. static createInstance() {
  14069. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14070. }
  14071. onConstruct() {
  14072. this.myImg = (this.getChild("myImg"));
  14073. }
  14074. }
  14075. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14076. class ui_moveNode extends fgui.GComponent {
  14077. static createInstance() {
  14078. return (fgui.UIPackage.createObject("game", "moveNode"));
  14079. }
  14080. onConstruct() {
  14081. this.n8 = (this.getChild("n8"));
  14082. this.finger = (this.getChild("finger"));
  14083. }
  14084. }
  14085. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14086. class ui_cancelBtn extends fgui.GButton {
  14087. static createInstance() {
  14088. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14089. }
  14090. onConstruct() {
  14091. this.c1 = this.getController("c1");
  14092. this.n0 = (this.getChild("n0"));
  14093. this.n1 = (this.getChild("n1"));
  14094. }
  14095. }
  14096. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14097. class ui_shareBtn extends fgui.GButton {
  14098. static createInstance() {
  14099. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14100. }
  14101. onConstruct() {
  14102. this.c1 = this.getController("c1");
  14103. this.n2 = (this.getChild("n2"));
  14104. this.n1 = (this.getChild("n1"));
  14105. this.n3 = (this.getChild("n3"));
  14106. this.n4 = (this.getChild("n4"));
  14107. this.n5 = (this.getChild("n5"));
  14108. this.n6 = (this.getChild("n6"));
  14109. }
  14110. }
  14111. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14112. class ui_share2Btn extends fgui.GButton {
  14113. static createInstance() {
  14114. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14115. }
  14116. onConstruct() {
  14117. this.n3 = (this.getChild("n3"));
  14118. }
  14119. }
  14120. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14121. class ui_rodMethodNode extends fgui.GComponent {
  14122. static createInstance() {
  14123. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14124. }
  14125. onConstruct() {
  14126. this.bg = (this.getChild("bg"));
  14127. this.dot = (this.getChild("dot"));
  14128. }
  14129. }
  14130. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14131. class ui_sureBtn extends fgui.GButton {
  14132. static createInstance() {
  14133. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14134. }
  14135. onConstruct() {
  14136. this.n2 = (this.getChild("n2"));
  14137. this.n1 = (this.getChild("n1"));
  14138. }
  14139. }
  14140. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14141. class ui_Component18 extends fgui.GComponent {
  14142. static createInstance() {
  14143. return (fgui.UIPackage.createObject("game", "Component18"));
  14144. }
  14145. onConstruct() {
  14146. this.c1 = this.getController("c1");
  14147. this.nameTxt = (this.getChild("nameTxt"));
  14148. this.headImg = (this.getChild("headImg"));
  14149. this.n24 = (this.getChild("n24"));
  14150. this.skillImg = (this.getChild("skillImg"));
  14151. this.skillTxt = (this.getChild("skillTxt"));
  14152. }
  14153. }
  14154. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14155. class ui_Component45 extends fgui.GComponent {
  14156. static createInstance() {
  14157. return (fgui.UIPackage.createObject("game", "Component45"));
  14158. }
  14159. onConstruct() {
  14160. this.c1 = this.getController("c1");
  14161. this.n40 = (this.getChild("n40"));
  14162. this.n41 = (this.getChild("n41"));
  14163. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14164. this.n42 = (this.getChild("n42"));
  14165. this.awardTxt = (this.getChild("awardTxt"));
  14166. this.n44 = (this.getChild("n44"));
  14167. this.t0 = this.getTransition("t0");
  14168. }
  14169. }
  14170. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14171. class ui_emotionDisplay extends fgui.GButton {
  14172. static createInstance() {
  14173. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14174. }
  14175. onConstruct() {
  14176. this.myIcon = (this.getChild("myIcon"));
  14177. }
  14178. }
  14179. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14180. class ui_Component49 extends fgui.GButton {
  14181. static createInstance() {
  14182. return (fgui.UIPackage.createObject("game", "Component49"));
  14183. }
  14184. onConstruct() {
  14185. this.n69 = (this.getChild("n69"));
  14186. this.n56 = (this.getChild("n56"));
  14187. }
  14188. }
  14189. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14190. class ui_Component50 extends fgui.GButton {
  14191. static createInstance() {
  14192. return (fgui.UIPackage.createObject("game", "Component50"));
  14193. }
  14194. onConstruct() {
  14195. this.n54 = (this.getChild("n54"));
  14196. this.n65 = (this.getChild("n65"));
  14197. }
  14198. }
  14199. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14200. class ui_Component51 extends fgui.GButton {
  14201. static createInstance() {
  14202. return (fgui.UIPackage.createObject("game", "Component51"));
  14203. }
  14204. onConstruct() {
  14205. this.c1 = this.getController("c1");
  14206. this.n51 = (this.getChild("n51"));
  14207. this.n54 = (this.getChild("n54"));
  14208. }
  14209. }
  14210. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14211. class ui_Button5 extends fgui.GButton {
  14212. static createInstance() {
  14213. return (fgui.UIPackage.createObject("game", "Button5"));
  14214. }
  14215. onConstruct() {
  14216. this.c1 = this.getController("c1");
  14217. this.n0 = (this.getChild("n0"));
  14218. this.n2 = (this.getChild("n2"));
  14219. }
  14220. }
  14221. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14222. class ui_Component124 extends fgui.GComponent {
  14223. static createInstance() {
  14224. return (fgui.UIPackage.createObject("game", "Component124"));
  14225. }
  14226. onConstruct() {
  14227. this.n22 = (this.getChild("n22"));
  14228. this.shareNode = (this.getChild("shareNode"));
  14229. }
  14230. }
  14231. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14232. class ui_Component125 extends fgui.GComponent {
  14233. static createInstance() {
  14234. return (fgui.UIPackage.createObject("game", "Component125"));
  14235. }
  14236. onConstruct() {
  14237. this.n29 = (this.getChild("n29"));
  14238. this.coinTxt = (this.getChild("coinTxt"));
  14239. }
  14240. }
  14241. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14242. class ui_Component52 extends fgui.GButton {
  14243. static createInstance() {
  14244. return (fgui.UIPackage.createObject("game", "Component52"));
  14245. }
  14246. onConstruct() {
  14247. this.n35 = (this.getChild("n35"));
  14248. this.n36 = (this.getChild("n36"));
  14249. }
  14250. }
  14251. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14252. class ui_Component_denglu extends fgui.GComponent {
  14253. static createInstance() {
  14254. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14255. }
  14256. onConstruct() {
  14257. this.c1 = this.getController("c1");
  14258. this.n102 = (this.getChild("n102"));
  14259. this.n103 = (this.getChild("n103"));
  14260. }
  14261. }
  14262. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14263. class ui_Component_fl_1 extends fgui.GComponent {
  14264. static createInstance() {
  14265. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14266. }
  14267. onConstruct() {
  14268. this.n0 = (this.getChild("n0"));
  14269. this.n6 = (this.getChild("n6"));
  14270. this.n7 = (this.getChild("n7"));
  14271. this.n8 = (this.getChild("n8"));
  14272. this.n5 = (this.getChild("n5"));
  14273. this.n9 = (this.getChild("n9"));
  14274. this.n10 = (this.getChild("n10"));
  14275. this.txt_price = (this.getChild("txt_price"));
  14276. this.n_no = (this.getChild("n_no"));
  14277. this.n_buy = (this.getChild("n_buy"));
  14278. }
  14279. }
  14280. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14281. class ui_Component_fl_2 extends fgui.GComponent {
  14282. static createInstance() {
  14283. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14284. }
  14285. onConstruct() {
  14286. this.n0 = (this.getChild("n0"));
  14287. this.txt_price = (this.getChild("txt_price"));
  14288. this.n4 = (this.getChild("n4"));
  14289. this.n6 = (this.getChild("n6"));
  14290. this.n7 = (this.getChild("n7"));
  14291. this.n5 = (this.getChild("n5"));
  14292. this.n8 = (this.getChild("n8"));
  14293. this.n9 = (this.getChild("n9"));
  14294. this.n_no = (this.getChild("n_no"));
  14295. this.n_buy = (this.getChild("n_buy"));
  14296. }
  14297. }
  14298. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14299. class ui_drawBtn extends fgui.GButton {
  14300. static createInstance() {
  14301. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14302. }
  14303. onConstruct() {
  14304. this.c1 = this.getController("c1");
  14305. this.n2 = (this.getChild("n2"));
  14306. this.n1 = (this.getChild("n1"));
  14307. this.n5 = (this.getChild("n5"));
  14308. }
  14309. }
  14310. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14311. class ui_Component43 extends fgui.GButton {
  14312. static createInstance() {
  14313. return (fgui.UIPackage.createObject("game", "Component43"));
  14314. }
  14315. onConstruct() {
  14316. this.n49 = (this.getChild("n49"));
  14317. }
  14318. }
  14319. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14320. class ui_wordsDisplay extends fgui.GComponent {
  14321. static createInstance() {
  14322. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14323. }
  14324. onConstruct() {
  14325. this.txt = (this.getChild("txt"));
  14326. this.n63 = (this.getChild("n63"));
  14327. }
  14328. }
  14329. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14330. class ui_Component_phb extends fgui.GComponent {
  14331. static createInstance() {
  14332. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14333. }
  14334. onConstruct() {
  14335. this.n3 = (this.getChild("n3"));
  14336. this.n4 = (this.getChild("n4"));
  14337. }
  14338. }
  14339. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14340. class ui_Component3 extends fgui.GComponent {
  14341. static createInstance() {
  14342. return (fgui.UIPackage.createObject("game", "Component3"));
  14343. }
  14344. onConstruct() {
  14345. this.n26 = (this.getChild("n26"));
  14346. this.n24 = (this.getChild("n24"));
  14347. this.nameTxt = (this.getChild("nameTxt"));
  14348. this.headRoot = (this.getChild("headRoot"));
  14349. }
  14350. }
  14351. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14352. class ui_Component4 extends fgui.GComponent {
  14353. static createInstance() {
  14354. return (fgui.UIPackage.createObject("game", "Component4"));
  14355. }
  14356. onConstruct() {
  14357. this.headImg = (this.getChild("headImg"));
  14358. }
  14359. }
  14360. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14361. class ui_Component7 extends fgui.GButton {
  14362. static createInstance() {
  14363. return (fgui.UIPackage.createObject("game", "Component7"));
  14364. }
  14365. onConstruct() {
  14366. this.n17 = (this.getChild("n17"));
  14367. }
  14368. }
  14369. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14370. class ui_Component8 extends fgui.GButton {
  14371. static createInstance() {
  14372. return (fgui.UIPackage.createObject("game", "Component8"));
  14373. }
  14374. onConstruct() {
  14375. this.n19 = (this.getChild("n19"));
  14376. }
  14377. }
  14378. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14379. class ui_Component10 extends fgui.GButton {
  14380. static createInstance() {
  14381. return (fgui.UIPackage.createObject("game", "Component10"));
  14382. }
  14383. onConstruct() {
  14384. this.c1 = this.getController("c1");
  14385. this.n40 = (this.getChild("n40"));
  14386. }
  14387. }
  14388. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14389. class ui_Component11 extends fgui.GButton {
  14390. static createInstance() {
  14391. return (fgui.UIPackage.createObject("game", "Component11"));
  14392. }
  14393. onConstruct() {
  14394. this.n34 = (this.getChild("n34"));
  14395. }
  14396. }
  14397. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14398. class ui_Component12 extends fgui.GButton {
  14399. static createInstance() {
  14400. return (fgui.UIPackage.createObject("game", "Component12"));
  14401. }
  14402. onConstruct() {
  14403. this.n35 = (this.getChild("n35"));
  14404. }
  14405. }
  14406. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14407. class ui_Component13 extends fgui.GButton {
  14408. static createInstance() {
  14409. return (fgui.UIPackage.createObject("game", "Component13"));
  14410. }
  14411. onConstruct() {
  14412. this.n27 = (this.getChild("n27"));
  14413. this.n36 = (this.getChild("n36"));
  14414. }
  14415. }
  14416. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14417. class ui_dh_js_tuowei extends fgui.GComponent {
  14418. static createInstance() {
  14419. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14420. }
  14421. onConstruct() {
  14422. this.n19 = (this.getChild("n19"));
  14423. this.n18 = (this.getChild("n18"));
  14424. this.n0 = (this.getChild("n0"));
  14425. this.n3 = (this.getChild("n3"));
  14426. this.n4 = (this.getChild("n4"));
  14427. this.n5 = (this.getChild("n5"));
  14428. this.n6 = (this.getChild("n6"));
  14429. this.n8 = (this.getChild("n8"));
  14430. this.n9 = (this.getChild("n9"));
  14431. this.n10 = (this.getChild("n10"));
  14432. this.n11 = (this.getChild("n11"));
  14433. this.n12 = (this.getChild("n12"));
  14434. this.n13 = (this.getChild("n13"));
  14435. this.n14 = (this.getChild("n14"));
  14436. this.n15 = (this.getChild("n15"));
  14437. this.n20 = (this.getChild("n20"));
  14438. this.t0 = this.getTransition("t0");
  14439. this.t1 = this.getTransition("t1");
  14440. }
  14441. }
  14442. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14443. class ui_dh_js_tw_g extends fgui.GComponent {
  14444. static createInstance() {
  14445. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14446. }
  14447. onConstruct() {
  14448. this.n0 = (this.getChild("n0"));
  14449. this.n1 = (this.getChild("n1"));
  14450. this.t0 = this.getTransition("t0");
  14451. }
  14452. }
  14453. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14454. class ui_dh_js_xingxing extends fgui.GComponent {
  14455. static createInstance() {
  14456. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14457. }
  14458. onConstruct() {
  14459. this.n1 = (this.getChild("n1"));
  14460. this.n2 = (this.getChild("n2"));
  14461. this.n3 = (this.getChild("n3"));
  14462. this.n4 = (this.getChild("n4"));
  14463. this.n0 = (this.getChild("n0"));
  14464. this.t2 = this.getTransition("t2");
  14465. this.t1 = this.getTransition("t1");
  14466. }
  14467. }
  14468. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14469. class ui_dh_zy_jiazai extends fgui.GComponent {
  14470. static createInstance() {
  14471. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14472. }
  14473. onConstruct() {
  14474. this.c1 = this.getController("c1");
  14475. this.n0 = (this.getChild("n0"));
  14476. this.n1 = (this.getChild("n1"));
  14477. this.n2 = (this.getChild("n2"));
  14478. this.n4 = (this.getChild("n4"));
  14479. this.n5 = (this.getChild("n5"));
  14480. this.n6 = (this.getChild("n6"));
  14481. this.n8 = (this.getChild("n8"));
  14482. this.n7 = (this.getChild("n7"));
  14483. this.t0 = this.getTransition("t0");
  14484. }
  14485. }
  14486. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14487. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14488. static createInstance() {
  14489. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14490. }
  14491. onConstruct() {
  14492. this.c1 = this.getController("c1");
  14493. this.n3 = (this.getChild("n3"));
  14494. this.n5 = (this.getChild("n5"));
  14495. this.n4 = (this.getChild("n4"));
  14496. this.n0 = (this.getChild("n0"));
  14497. this.n1 = (this.getChild("n1"));
  14498. this.n2 = (this.getChild("n2"));
  14499. }
  14500. }
  14501. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14502. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14503. static createInstance() {
  14504. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14505. }
  14506. onConstruct() {
  14507. this.n19 = (this.getChild("n19"));
  14508. this.n21 = (this.getChild("n21"));
  14509. this.n0 = (this.getChild("n0"));
  14510. this.n3 = (this.getChild("n3"));
  14511. this.n4 = (this.getChild("n4"));
  14512. this.n5 = (this.getChild("n5"));
  14513. this.n6 = (this.getChild("n6"));
  14514. this.n8 = (this.getChild("n8"));
  14515. this.n9 = (this.getChild("n9"));
  14516. this.n10 = (this.getChild("n10"));
  14517. this.n11 = (this.getChild("n11"));
  14518. this.n12 = (this.getChild("n12"));
  14519. this.n13 = (this.getChild("n13"));
  14520. this.n14 = (this.getChild("n14"));
  14521. this.n15 = (this.getChild("n15"));
  14522. this.n23 = (this.getChild("n23"));
  14523. this.t0 = this.getTransition("t0");
  14524. this.t1 = this.getTransition("t1");
  14525. }
  14526. }
  14527. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14528. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14529. static createInstance() {
  14530. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14531. }
  14532. onConstruct() {
  14533. this.n1 = (this.getChild("n1"));
  14534. this.n2 = (this.getChild("n2"));
  14535. this.t0 = this.getTransition("t0");
  14536. }
  14537. }
  14538. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14539. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14540. static createInstance() {
  14541. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14542. }
  14543. onConstruct() {
  14544. this.n4 = (this.getChild("n4"));
  14545. this.n2 = (this.getChild("n2"));
  14546. this.n3 = (this.getChild("n3"));
  14547. this.idle = this.getTransition("idle");
  14548. this.attack = this.getTransition("attack");
  14549. }
  14550. }
  14551. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14552. class ui_special extends fgui.GComponent {
  14553. static createInstance() {
  14554. return (fgui.UIPackage.createObject("game", "special"));
  14555. }
  14556. onConstruct() {
  14557. this.n18 = (this.getChild("n18"));
  14558. this.n19 = (this.getChild("n19"));
  14559. this.n20 = (this.getChild("n20"));
  14560. this.n21 = (this.getChild("n21"));
  14561. this.n22 = (this.getChild("n22"));
  14562. this.levelTxt = (this.getChild("levelTxt"));
  14563. this.n24 = (this.getChild("n24"));
  14564. this.n25 = (this.getChild("n25"));
  14565. this.t0 = this.getTransition("t0");
  14566. }
  14567. }
  14568. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14569. class ui_Component145 extends fgui.GComponent {
  14570. static createInstance() {
  14571. return (fgui.UIPackage.createObject("game", "Component145"));
  14572. }
  14573. onConstruct() {
  14574. this.guanyuNode = (this.getChild("guanyuNode"));
  14575. }
  14576. }
  14577. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14578. class ui_longBtn extends fgui.GButton {
  14579. static createInstance() {
  14580. return (fgui.UIPackage.createObject("game", "longBtn"));
  14581. }
  14582. onConstruct() {
  14583. this.c1 = this.getController("c1");
  14584. this.n2 = (this.getChild("n2"));
  14585. this.n1 = (this.getChild("n1"));
  14586. this.n4 = (this.getChild("n4"));
  14587. }
  14588. }
  14589. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14590. class ui_Component146 extends fgui.GComponent {
  14591. static createInstance() {
  14592. return (fgui.UIPackage.createObject("game", "Component146"));
  14593. }
  14594. onConstruct() {
  14595. this.n89 = (this.getChild("n89"));
  14596. this.n90 = (this.getChild("n90"));
  14597. this.guideBtn = (this.getChild("guideBtn"));
  14598. }
  14599. }
  14600. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14601. class ui_Component146_11 extends fgui.GComponent {
  14602. static createInstance() {
  14603. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14604. }
  14605. onConstruct() {
  14606. this.n89 = (this.getChild("n89"));
  14607. this.n90 = (this.getChild("n90"));
  14608. this.guideBtn = (this.getChild("guideBtn"));
  14609. }
  14610. }
  14611. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14612. class ui_Component111_1 extends fgui.GComponent {
  14613. static createInstance() {
  14614. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14615. }
  14616. onConstruct() {
  14617. this.n68 = (this.getChild("n68"));
  14618. this.myMask = (this.getChild("myMask"));
  14619. }
  14620. }
  14621. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14622. class ui_Component64_1 extends fgui.GComponent {
  14623. static createInstance() {
  14624. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14625. }
  14626. onConstruct() {
  14627. this.n57 = (this.getChild("n57"));
  14628. this.n54 = (this.getChild("n54"));
  14629. this.n55 = (this.getChild("n55"));
  14630. this.n56 = (this.getChild("n56"));
  14631. this.t1 = this.getTransition("t1");
  14632. }
  14633. }
  14634. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14635. class ui_ModeSelection_com123 extends fgui.GComponent {
  14636. static createInstance() {
  14637. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14638. }
  14639. onConstruct() {
  14640. this.type1 = (this.getChild("type1"));
  14641. this.type2 = (this.getChild("type2"));
  14642. this.type3 = (this.getChild("type3"));
  14643. this.n38 = (this.getChild("n38"));
  14644. this.t0 = this.getTransition("t0");
  14645. }
  14646. }
  14647. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14648. class ui_Component132_2 extends fgui.GComponent {
  14649. static createInstance() {
  14650. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14651. }
  14652. onConstruct() {
  14653. this.n25 = (this.getChild("n25"));
  14654. this.n26 = (this.getChild("n26"));
  14655. this.n27 = (this.getChild("n27"));
  14656. this.t0 = this.getTransition("t0");
  14657. }
  14658. }
  14659. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14660. class ui_UIPower$1 extends fgui.GComponent {
  14661. static createInstance() {
  14662. return (fgui.UIPackage.createObject("game", "UIPower"));
  14663. }
  14664. onConstruct() {
  14665. this.n11 = (this.getChild("n11"));
  14666. this.myNode = (this.getChild("myNode"));
  14667. this.t0 = this.getTransition("t0");
  14668. }
  14669. }
  14670. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14671. class ui_Component133 extends fgui.GComponent {
  14672. static createInstance() {
  14673. return (fgui.UIPackage.createObject("game", "Component133"));
  14674. }
  14675. onConstruct() {
  14676. this.n29 = (this.getChild("n29"));
  14677. this.n30 = (this.getChild("n30"));
  14678. }
  14679. }
  14680. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14681. class ui_Component134 extends fgui.GComponent {
  14682. static createInstance() {
  14683. return (fgui.UIPackage.createObject("game", "Component134"));
  14684. }
  14685. onConstruct() {
  14686. this.n30 = (this.getChild("n30"));
  14687. this.n31 = (this.getChild("n31"));
  14688. this.t0 = this.getTransition("t0");
  14689. }
  14690. }
  14691. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14692. class ui_Component135 extends fgui.GComponent {
  14693. static createInstance() {
  14694. return (fgui.UIPackage.createObject("game", "Component135"));
  14695. }
  14696. onConstruct() {
  14697. this.n30 = (this.getChild("n30"));
  14698. this.t0 = this.getTransition("t0");
  14699. }
  14700. }
  14701. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14702. class ui_Component137 extends fgui.GComponent {
  14703. static createInstance() {
  14704. return (fgui.UIPackage.createObject("game", "Component137"));
  14705. }
  14706. onConstruct() {
  14707. this.n28 = (this.getChild("n28"));
  14708. this.n29 = (this.getChild("n29"));
  14709. this.n30 = (this.getChild("n30"));
  14710. this.n32 = (this.getChild("n32"));
  14711. }
  14712. }
  14713. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14714. class ui_dh_zuanshi extends fgui.GButton {
  14715. static createInstance() {
  14716. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14717. }
  14718. onConstruct() {
  14719. this.n1 = (this.getChild("n1"));
  14720. this.n2 = (this.getChild("n2"));
  14721. this.n0 = (this.getChild("n0"));
  14722. this.n3 = (this.getChild("n3"));
  14723. this.n4 = (this.getChild("n4"));
  14724. }
  14725. }
  14726. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14727. class ui_Component138 extends fgui.GComponent {
  14728. static createInstance() {
  14729. return (fgui.UIPackage.createObject("game", "Component138"));
  14730. }
  14731. onConstruct() {
  14732. this.n1 = (this.getChild("n1"));
  14733. this.n2 = (this.getChild("n2"));
  14734. this.t0 = this.getTransition("t0");
  14735. }
  14736. }
  14737. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14738. class ui_Component139 extends fgui.GComponent {
  14739. static createInstance() {
  14740. return (fgui.UIPackage.createObject("game", "Component139"));
  14741. }
  14742. onConstruct() {
  14743. this.n0 = (this.getChild("n0"));
  14744. this.t0 = this.getTransition("t0");
  14745. }
  14746. }
  14747. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14748. class ui_Component140 extends fgui.GComponent {
  14749. static createInstance() {
  14750. return (fgui.UIPackage.createObject("game", "Component140"));
  14751. }
  14752. onConstruct() {
  14753. this.n2 = (this.getChild("n2"));
  14754. this.n3 = (this.getChild("n3"));
  14755. this.t0 = this.getTransition("t0");
  14756. }
  14757. }
  14758. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14759. class ui_Component141 extends fgui.GComponent {
  14760. static createInstance() {
  14761. return (fgui.UIPackage.createObject("game", "Component141"));
  14762. }
  14763. onConstruct() {
  14764. this.n0 = (this.getChild("n0"));
  14765. this.t0 = this.getTransition("t0");
  14766. }
  14767. }
  14768. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14769. class ui_powerNode extends fgui.GProgressBar {
  14770. static createInstance() {
  14771. return (fgui.UIPackage.createObject("game", "powerNode"));
  14772. }
  14773. onConstruct() {
  14774. this.n2 = (this.getChild("n2"));
  14775. this.bar_v = (this.getChild("bar_v"));
  14776. this.showImg = (this.getChild("showImg"));
  14777. this.n12 = (this.getChild("n12"));
  14778. }
  14779. }
  14780. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14781. class ui_dh_jingbi1 extends fgui.GComponent {
  14782. static createInstance() {
  14783. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14784. }
  14785. onConstruct() {
  14786. this.n0 = (this.getChild("n0"));
  14787. this.n1 = (this.getChild("n1"));
  14788. this.n2 = (this.getChild("n2"));
  14789. this.n3 = (this.getChild("n3"));
  14790. this.n4 = (this.getChild("n4"));
  14791. this.n5 = (this.getChild("n5"));
  14792. this.n6 = (this.getChild("n6"));
  14793. this.n8 = (this.getChild("n8"));
  14794. this.t0 = this.getTransition("t0");
  14795. }
  14796. }
  14797. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14798. class ui_Component94 extends fgui.GButton {
  14799. static createInstance() {
  14800. return (fgui.UIPackage.createObject("game", "Component94"));
  14801. }
  14802. onConstruct() {
  14803. this.n77 = (this.getChild("n77"));
  14804. }
  14805. }
  14806. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14807. class ui_Component95 extends fgui.GButton {
  14808. static createInstance() {
  14809. return (fgui.UIPackage.createObject("game", "Component95"));
  14810. }
  14811. onConstruct() {
  14812. this.n77 = (this.getChild("n77"));
  14813. }
  14814. }
  14815. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14816. class ui_Component126 extends fgui.GComponent {
  14817. static createInstance() {
  14818. return (fgui.UIPackage.createObject("game", "Component126"));
  14819. }
  14820. onConstruct() {
  14821. this.c1 = this.getController("c1");
  14822. this.normalBtn = (this.getChild("normalBtn"));
  14823. this.tripleBtn = (this.getChild("tripleBtn"));
  14824. }
  14825. }
  14826. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14827. class ui_Component60 extends fgui.GComponent {
  14828. static createInstance() {
  14829. return (fgui.UIPackage.createObject("game", "Component60"));
  14830. }
  14831. onConstruct() {
  14832. this.c1 = this.getController("c1");
  14833. this.n48 = (this.getChild("n48"));
  14834. this.womanTxt = (this.getChild("womanTxt"));
  14835. this.t0 = this.getTransition("t0");
  14836. }
  14837. }
  14838. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14839. class ui_Button_h extends fgui.GButton {
  14840. static createInstance() {
  14841. return (fgui.UIPackage.createObject("game", "Button_h"));
  14842. }
  14843. onConstruct() {
  14844. this.button = this.getController("button");
  14845. this.n0 = (this.getChild("n0"));
  14846. this.n1 = (this.getChild("n1"));
  14847. }
  14848. }
  14849. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14850. class ui_Button_lv extends fgui.GButton {
  14851. static createInstance() {
  14852. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14853. }
  14854. onConstruct() {
  14855. this.button = this.getController("button");
  14856. this.n0 = (this.getChild("n0"));
  14857. this.n1 = (this.getChild("n1"));
  14858. }
  14859. }
  14860. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14861. class ui_Component98_3 extends fgui.GButton {
  14862. static createInstance() {
  14863. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14864. }
  14865. onConstruct() {
  14866. this.c1 = this.getController("c1");
  14867. this.n8 = (this.getChild("n8"));
  14868. this.n41 = (this.getChild("n41"));
  14869. this.n40 = (this.getChild("n40"));
  14870. }
  14871. }
  14872. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14873. class ui_ModeSelection_com1 extends fgui.GButton {
  14874. static createInstance() {
  14875. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14876. }
  14877. onConstruct() {
  14878. this.n34 = (this.getChild("n34"));
  14879. this.n36 = (this.getChild("n36"));
  14880. this.n22 = (this.getChild("n22"));
  14881. this.n20 = (this.getChild("n20"));
  14882. this.n23 = (this.getChild("n23"));
  14883. this.n24 = (this.getChild("n24"));
  14884. this.n26 = (this.getChild("n26"));
  14885. this.n33 = (this.getChild("n33"));
  14886. this.coinImg = (this.getChild("coinImg"));
  14887. this.need = (this.getChild("need"));
  14888. this.n35 = (this.getChild("n35"));
  14889. this.n29 = (this.getChild("n29"));
  14890. this.tipsTxt = (this.getChild("tipsTxt"));
  14891. this.n30 = (this.getChild("n30"));
  14892. this.peopleTxt = (this.getChild("peopleTxt"));
  14893. this.t0 = this.getTransition("t0");
  14894. }
  14895. }
  14896. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14897. class ui_ModeSelection_com2 extends fgui.GButton {
  14898. static createInstance() {
  14899. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14900. }
  14901. onConstruct() {
  14902. this.n36 = (this.getChild("n36"));
  14903. this.n34 = (this.getChild("n34"));
  14904. this.n22 = (this.getChild("n22"));
  14905. this.n20 = (this.getChild("n20"));
  14906. this.n23 = (this.getChild("n23"));
  14907. this.n24 = (this.getChild("n24"));
  14908. this.n26 = (this.getChild("n26"));
  14909. this.n33 = (this.getChild("n33"));
  14910. this.coinImg = (this.getChild("coinImg"));
  14911. this.need = (this.getChild("need"));
  14912. this.n35 = (this.getChild("n35"));
  14913. this.n29 = (this.getChild("n29"));
  14914. this.tipsTxt = (this.getChild("tipsTxt"));
  14915. this.n30 = (this.getChild("n30"));
  14916. this.peopleTxt = (this.getChild("peopleTxt"));
  14917. this.t0 = this.getTransition("t0");
  14918. }
  14919. }
  14920. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14921. class ui_ModeSelection_com3 extends fgui.GButton {
  14922. static createInstance() {
  14923. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14924. }
  14925. onConstruct() {
  14926. this.n34 = (this.getChild("n34"));
  14927. this.n36 = (this.getChild("n36"));
  14928. this.n22 = (this.getChild("n22"));
  14929. this.n20 = (this.getChild("n20"));
  14930. this.n23 = (this.getChild("n23"));
  14931. this.n24 = (this.getChild("n24"));
  14932. this.n26 = (this.getChild("n26"));
  14933. this.n33 = (this.getChild("n33"));
  14934. this.coinImg = (this.getChild("coinImg"));
  14935. this.need = (this.getChild("need"));
  14936. this.n35 = (this.getChild("n35"));
  14937. this.n29 = (this.getChild("n29"));
  14938. this.tipsTxt = (this.getChild("tipsTxt"));
  14939. this.n30 = (this.getChild("n30"));
  14940. this.peopleTxt = (this.getChild("peopleTxt"));
  14941. this.t0 = this.getTransition("t0");
  14942. }
  14943. }
  14944. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14945. class ui_Invitation_com1 extends fgui.GComponent {
  14946. static createInstance() {
  14947. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14948. }
  14949. onConstruct() {
  14950. this.n14 = (this.getChild("n14"));
  14951. this.n13 = (this.getChild("n13"));
  14952. this.n3 = (this.getChild("n3"));
  14953. this.n1 = (this.getChild("n1"));
  14954. this.n6 = (this.getChild("n6"));
  14955. this.n7 = (this.getChild("n7"));
  14956. this.enterBtn = (this.getChild("enterBtn"));
  14957. this.n11 = (this.getChild("n11"));
  14958. this.n12 = (this.getChild("n12"));
  14959. this.n15 = (this.getChild("n15"));
  14960. this.t0 = this.getTransition("t0");
  14961. this.t1 = this.getTransition("t1");
  14962. }
  14963. }
  14964. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14965. class ui_Component87_1 extends fgui.GComponent {
  14966. static createInstance() {
  14967. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14968. }
  14969. onConstruct() {
  14970. this.n74 = (this.getChild("n74"));
  14971. this.n73 = (this.getChild("n73"));
  14972. this.ballTxt = (this.getChild("ballTxt"));
  14973. this.n76 = (this.getChild("n76"));
  14974. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14975. this.levelTxt = (this.getChild("levelTxt"));
  14976. this.n87 = (this.getChild("n87"));
  14977. this.n84 = (this.getChild("n84"));
  14978. this.hpTxt = (this.getChild("hpTxt"));
  14979. this.n89 = (this.getChild("n89"));
  14980. this.tipsTxt = (this.getChild("tipsTxt"));
  14981. }
  14982. }
  14983. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14984. class ui_sqg1 extends fgui.GComponent {
  14985. static createInstance() {
  14986. return (fgui.UIPackage.createObject("game", "sqg1"));
  14987. }
  14988. onConstruct() {
  14989. this.n1 = (this.getChild("n1"));
  14990. this.n0 = (this.getChild("n0"));
  14991. }
  14992. }
  14993. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14994. class ui_sqg2 extends fgui.GComponent {
  14995. static createInstance() {
  14996. return (fgui.UIPackage.createObject("game", "sqg2"));
  14997. }
  14998. onConstruct() {
  14999. this.n1 = (this.getChild("n1"));
  15000. this.n0 = (this.getChild("n0"));
  15001. }
  15002. }
  15003. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  15004. class ui_sqg3 extends fgui.GComponent {
  15005. static createInstance() {
  15006. return (fgui.UIPackage.createObject("game", "sqg3"));
  15007. }
  15008. onConstruct() {
  15009. this.n1 = (this.getChild("n1"));
  15010. this.n0 = (this.getChild("n0"));
  15011. }
  15012. }
  15013. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  15014. class ui_sqg4 extends fgui.GComponent {
  15015. static createInstance() {
  15016. return (fgui.UIPackage.createObject("game", "sqg4"));
  15017. }
  15018. onConstruct() {
  15019. this.n1 = (this.getChild("n1"));
  15020. this.n0 = (this.getChild("n0"));
  15021. }
  15022. }
  15023. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  15024. class ui_Component36 extends fgui.GButton {
  15025. static createInstance() {
  15026. return (fgui.UIPackage.createObject("game", "Component36"));
  15027. }
  15028. onConstruct() {
  15029. this.c1 = this.getController("c1");
  15030. this.n53 = (this.getChild("n53"));
  15031. this.n56 = (this.getChild("n56"));
  15032. }
  15033. }
  15034. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  15035. class ui_Component37 extends fgui.GButton {
  15036. static createInstance() {
  15037. return (fgui.UIPackage.createObject("game", "Component37"));
  15038. }
  15039. onConstruct() {
  15040. this.c1 = this.getController("c1");
  15041. this.n52 = (this.getChild("n52"));
  15042. this.n54 = (this.getChild("n54"));
  15043. }
  15044. }
  15045. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  15046. class ui_UISetting extends fgui.GComponent {
  15047. static createInstance() {
  15048. return (fgui.UIPackage.createObject("game", "UISetting"));
  15049. }
  15050. onConstruct() {
  15051. this.c1 = this.getController("c1");
  15052. this.n4 = (this.getChild("n4"));
  15053. this.soundBtn = (this.getChild("soundBtn"));
  15054. this.shakeBtn = (this.getChild("shakeBtn"));
  15055. this.clickNode = (this.getChild("clickNode"));
  15056. this.xyBtn = (this.getChild("xyBtn"));
  15057. }
  15058. }
  15059. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15060. class ui_Component39 extends fgui.GComponent {
  15061. static createInstance() {
  15062. return (fgui.UIPackage.createObject("game", "Component39"));
  15063. }
  15064. onConstruct() {
  15065. this.n5 = (this.getChild("n5"));
  15066. this.n6 = (this.getChild("n6"));
  15067. this.n7 = (this.getChild("n7"));
  15068. this.t0 = this.getTransition("t0");
  15069. }
  15070. }
  15071. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15072. class ui_Component40 extends fgui.GButton {
  15073. static createInstance() {
  15074. return (fgui.UIPackage.createObject("game", "Component40"));
  15075. }
  15076. onConstruct() {
  15077. this.n46 = (this.getChild("n46"));
  15078. this.n47 = (this.getChild("n47"));
  15079. }
  15080. }
  15081. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15082. class ui_Component41 extends fgui.GComponent {
  15083. static createInstance() {
  15084. return (fgui.UIPackage.createObject("game", "Component41"));
  15085. }
  15086. onConstruct() {
  15087. this.c1 = this.getController("c1");
  15088. this.n0 = (this.getChild("n0"));
  15089. this.titleTxt = (this.getChild("titleTxt"));
  15090. this.n2 = (this.getChild("n2"));
  15091. this.msgTips = (this.getChild("msgTips"));
  15092. this.numTxt = (this.getChild("numTxt"));
  15093. this.n18 = (this.getChild("n18"));
  15094. this.cancelBtn = (this.getChild("cancelBtn"));
  15095. this.videoBtn = (this.getChild("videoBtn"));
  15096. this.n10 = (this.getChild("n10"));
  15097. }
  15098. }
  15099. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15100. class ui_Component42 extends fgui.GComponent {
  15101. static createInstance() {
  15102. return (fgui.UIPackage.createObject("game", "Component42"));
  15103. }
  15104. onConstruct() {
  15105. this.c1 = this.getController("c1");
  15106. this.n1 = (this.getChild("n1"));
  15107. this.n2 = (this.getChild("n2"));
  15108. this.n3 = (this.getChild("n3"));
  15109. this.tipsTxt = (this.getChild("tipsTxt"));
  15110. this.cancelBtn = (this.getChild("cancelBtn"));
  15111. this.sureBtn = (this.getChild("sureBtn"));
  15112. this.n11 = (this.getChild("n11"));
  15113. this.n13 = (this.getChild("n13"));
  15114. this.n14 = (this.getChild("n14"));
  15115. this.womanTxt = (this.getChild("womanTxt"));
  15116. this.t0 = this.getTransition("t0");
  15117. }
  15118. }
  15119. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15120. class ui_dh_js_shengli extends fgui.GComponent {
  15121. static createInstance() {
  15122. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15123. }
  15124. onConstruct() {
  15125. this.n3 = (this.getChild("n3"));
  15126. this.n4 = (this.getChild("n4"));
  15127. this.n1 = (this.getChild("n1"));
  15128. this.n2 = (this.getChild("n2"));
  15129. this.n5 = (this.getChild("n5"));
  15130. this.n6 = (this.getChild("n6"));
  15131. this.n7 = (this.getChild("n7"));
  15132. this.n8 = (this.getChild("n8"));
  15133. this.attack = this.getTransition("attack");
  15134. this.idle = this.getTransition("idle");
  15135. }
  15136. }
  15137. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15138. class ui_dh_js_shengli_g extends fgui.GComponent {
  15139. static createInstance() {
  15140. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15141. }
  15142. onConstruct() {
  15143. this.n3 = (this.getChild("n3"));
  15144. this.n1 = (this.getChild("n1"));
  15145. this.t0 = this.getTransition("t0");
  15146. }
  15147. }
  15148. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15149. class ui_dh_js_shibai extends fgui.GComponent {
  15150. static createInstance() {
  15151. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15152. }
  15153. onConstruct() {
  15154. this.n0 = (this.getChild("n0"));
  15155. this.n1 = (this.getChild("n1"));
  15156. this.n2 = (this.getChild("n2"));
  15157. this.n3 = (this.getChild("n3"));
  15158. this.idle = this.getTransition("idle");
  15159. this.attack = this.getTransition("attack");
  15160. }
  15161. }
  15162. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15163. class ui_dh_zy_ganfa extends fgui.GButton {
  15164. static createInstance() {
  15165. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15166. }
  15167. onConstruct() {
  15168. this.n0 = (this.getChild("n0"));
  15169. }
  15170. }
  15171. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15172. class ui_dh_zy_sc_guang extends fgui.GButton {
  15173. static createInstance() {
  15174. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15175. }
  15176. onConstruct() {
  15177. this.n0 = (this.getChild("n0"));
  15178. this.n2 = (this.getChild("n2"));
  15179. }
  15180. }
  15181. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15182. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15183. static createInstance() {
  15184. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15185. }
  15186. onConstruct() {
  15187. this.n0 = (this.getChild("n0"));
  15188. this.n3 = (this.getChild("n3"));
  15189. }
  15190. }
  15191. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15192. class ui_dh_zy_wanfa extends fgui.GButton {
  15193. static createInstance() {
  15194. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15195. }
  15196. onConstruct() {
  15197. this.n0 = (this.getChild("n0"));
  15198. }
  15199. }
  15200. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15201. class ui_Button_login extends fgui.GButton {
  15202. static createInstance() {
  15203. return (fgui.UIPackage.createObject("game", "Button_login"));
  15204. }
  15205. onConstruct() {
  15206. this.button = this.getController("button");
  15207. this.n5 = (this.getChild("n5"));
  15208. this.n3 = (this.getChild("n3"));
  15209. }
  15210. }
  15211. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15212. class ui_Component53_1 extends fgui.GComponent {
  15213. static createInstance() {
  15214. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15215. }
  15216. onConstruct() {
  15217. this.n0 = (this.getChild("n0"));
  15218. this.n1 = (this.getChild("n1"));
  15219. this.n2 = (this.getChild("n2"));
  15220. this.n3 = (this.getChild("n3"));
  15221. this.n4 = (this.getChild("n4"));
  15222. this.n5 = (this.getChild("n5"));
  15223. this.n6 = (this.getChild("n6"));
  15224. this.n7 = (this.getChild("n7"));
  15225. this.n8 = (this.getChild("n8"));
  15226. this.n9 = (this.getChild("n9"));
  15227. this.n10 = (this.getChild("n10"));
  15228. this.n11 = (this.getChild("n11"));
  15229. this.n12 = (this.getChild("n12"));
  15230. this.n13 = (this.getChild("n13"));
  15231. this.n14 = (this.getChild("n14"));
  15232. this.n15 = (this.getChild("n15"));
  15233. this.n16 = (this.getChild("n16"));
  15234. this.n19 = (this.getChild("n19"));
  15235. this.n20 = (this.getChild("n20"));
  15236. this.n21 = (this.getChild("n21"));
  15237. this.n22 = (this.getChild("n22"));
  15238. this.n23 = (this.getChild("n23"));
  15239. this.n24 = (this.getChild("n24"));
  15240. this.n25 = (this.getChild("n25"));
  15241. this.n26 = (this.getChild("n26"));
  15242. this.n27 = (this.getChild("n27"));
  15243. this.n28 = (this.getChild("n28"));
  15244. this.n29 = (this.getChild("n29"));
  15245. this.n30 = (this.getChild("n30"));
  15246. this.n31 = (this.getChild("n31"));
  15247. this.n32 = (this.getChild("n32"));
  15248. this.n33 = (this.getChild("n33"));
  15249. this.n34 = (this.getChild("n34"));
  15250. this.n35 = (this.getChild("n35"));
  15251. this.t0 = this.getTransition("t0");
  15252. }
  15253. }
  15254. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15255. class ui_Component30 extends fgui.GComponent {
  15256. static createInstance() {
  15257. return (fgui.UIPackage.createObject("game", "Component30"));
  15258. }
  15259. onConstruct() {
  15260. this.c1 = this.getController("c1");
  15261. this.n46 = (this.getChild("n46"));
  15262. this.n47 = (this.getChild("n47"));
  15263. this.numTxt = (this.getChild("numTxt"));
  15264. this.n50 = (this.getChild("n50"));
  15265. this.n53 = (this.getChild("n53"));
  15266. this.n54 = (this.getChild("n54"));
  15267. this.n55 = (this.getChild("n55"));
  15268. this.n56 = (this.getChild("n56"));
  15269. }
  15270. }
  15271. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15272. class ui_Component30_1 extends fgui.GComponent {
  15273. static createInstance() {
  15274. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15275. }
  15276. onConstruct() {
  15277. this.c1 = this.getController("c1");
  15278. this.n46 = (this.getChild("n46"));
  15279. this.n47 = (this.getChild("n47"));
  15280. this.numTxt = (this.getChild("numTxt"));
  15281. this.n50 = (this.getChild("n50"));
  15282. this.n51 = (this.getChild("n51"));
  15283. this.n52 = (this.getChild("n52"));
  15284. this.n53 = (this.getChild("n53"));
  15285. this.n54 = (this.getChild("n54"));
  15286. }
  15287. }
  15288. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15289. class ui_Component31 extends fgui.GComponent {
  15290. static createInstance() {
  15291. return (fgui.UIPackage.createObject("game", "Component31"));
  15292. }
  15293. onConstruct() {
  15294. this.n55 = (this.getChild("n55"));
  15295. this.n54 = (this.getChild("n54"));
  15296. this.conditionTxt = (this.getChild("conditionTxt"));
  15297. this.n57 = (this.getChild("n57"));
  15298. this.t0 = this.getTransition("t0");
  15299. }
  15300. }
  15301. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15302. class ui_Component32 extends fgui.GComponent {
  15303. static createInstance() {
  15304. return (fgui.UIPackage.createObject("game", "Component32"));
  15305. }
  15306. onConstruct() {
  15307. this.n5 = (this.getChild("n5"));
  15308. this.n6 = (this.getChild("n6"));
  15309. this.n7 = (this.getChild("n7"));
  15310. this.t0 = this.getTransition("t0");
  15311. }
  15312. }
  15313. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15314. class ui_AwardItem extends fgui.GComponent {
  15315. static createInstance() {
  15316. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15317. }
  15318. onConstruct() {
  15319. this.n9 = (this.getChild("n9"));
  15320. this.myIcon = (this.getChild("myIcon"));
  15321. this.numTxt = (this.getChild("numTxt"));
  15322. this.nameTxt = (this.getChild("nameTxt"));
  15323. this.n16 = (this.getChild("n16"));
  15324. this.n17 = (this.getChild("n17"));
  15325. }
  15326. }
  15327. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15328. class ui_ranking_com1 extends fgui.GButton {
  15329. static createInstance() {
  15330. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15331. }
  15332. onConstruct() {
  15333. this.c1 = this.getController("c1");
  15334. this.n49 = (this.getChild("n49"));
  15335. this.n18 = (this.getChild("n18"));
  15336. this.n46 = (this.getChild("n46"));
  15337. this.n48 = (this.getChild("n48"));
  15338. this.n50 = (this.getChild("n50"));
  15339. }
  15340. }
  15341. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15342. class ui_ranking_com2 extends fgui.GButton {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15345. }
  15346. onConstruct() {
  15347. this.c1 = this.getController("c1");
  15348. this.n49 = (this.getChild("n49"));
  15349. this.n18 = (this.getChild("n18"));
  15350. this.n46 = (this.getChild("n46"));
  15351. this.n48 = (this.getChild("n48"));
  15352. this.n50 = (this.getChild("n50"));
  15353. }
  15354. }
  15355. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15356. class ui_ranking_com3 extends fgui.GComponent {
  15357. static createInstance() {
  15358. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15359. }
  15360. onConstruct() {
  15361. this.n17 = (this.getChild("n17"));
  15362. this.myIcon = (this.getChild("myIcon"));
  15363. }
  15364. }
  15365. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15366. class ui_ranking_com4 extends fgui.GComponent {
  15367. static createInstance() {
  15368. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15369. }
  15370. onConstruct() {
  15371. this.n16 = (this.getChild("n16"));
  15372. this.head = (this.getChild("head"));
  15373. }
  15374. }
  15375. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15376. class ui_ranking_com5 extends fgui.GComponent {
  15377. static createInstance() {
  15378. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15379. }
  15380. onConstruct() {
  15381. this.c1 = this.getController("c1");
  15382. this.c2 = this.getController("c2");
  15383. this.n2 = (this.getChild("n2"));
  15384. this.n3 = (this.getChild("n3"));
  15385. this.levelBtn = (this.getChild("levelBtn"));
  15386. this.starBtn = (this.getChild("starBtn"));
  15387. this.n23 = (this.getChild("n23"));
  15388. this.n24 = (this.getChild("n24"));
  15389. this.n25 = (this.getChild("n25"));
  15390. this.myList = (this.getChild("myList"));
  15391. this.selfNode = (this.getChild("selfNode"));
  15392. this.n9 = (this.getChild("n9"));
  15393. this.n12 = (this.getChild("n12"));
  15394. this.n13 = (this.getChild("n13"));
  15395. this.n14 = (this.getChild("n14"));
  15396. this.n39 = (this.getChild("n39"));
  15397. this.n41 = (this.getChild("n41"));
  15398. this.n42 = (this.getChild("n42"));
  15399. this.n45 = (this.getChild("n45"));
  15400. this.changeBtn = (this.getChild("changeBtn"));
  15401. this.closeBtn = (this.getChild("closeBtn"));
  15402. this.t0 = this.getTransition("t0");
  15403. }
  15404. }
  15405. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15406. class ui_RankItem extends fgui.GComponent {
  15407. static createInstance() {
  15408. return (fgui.UIPackage.createObject("game", "RankItem"));
  15409. }
  15410. onConstruct() {
  15411. this.n10 = (this.getChild("n10"));
  15412. this.n11 = (this.getChild("n11"));
  15413. this.rankTxt = (this.getChild("rankTxt"));
  15414. this.headNode = (this.getChild("headNode"));
  15415. this.nameTxt = (this.getChild("nameTxt"));
  15416. this.n19 = (this.getChild("n19"));
  15417. this.valueTxt = (this.getChild("valueTxt"));
  15418. this.img1 = (this.getChild("img1"));
  15419. this.img2 = (this.getChild("img2"));
  15420. this.img3 = (this.getChild("img3"));
  15421. }
  15422. }
  15423. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15424. class ui_ranking_com9 extends fgui.GComponent {
  15425. static createInstance() {
  15426. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15427. }
  15428. onConstruct() {
  15429. this.c1 = this.getController("c1");
  15430. this.n27 = (this.getChild("n27"));
  15431. this.n28 = (this.getChild("n28"));
  15432. this.headNode = (this.getChild("headNode"));
  15433. this.rankTxt = (this.getChild("rankTxt"));
  15434. this.nameTxt = (this.getChild("nameTxt"));
  15435. this.n34 = (this.getChild("n34"));
  15436. this.valueTxt = (this.getChild("valueTxt"));
  15437. this.n36 = (this.getChild("n36"));
  15438. this.n37 = (this.getChild("n37"));
  15439. this.n38 = (this.getChild("n38"));
  15440. this.n39 = (this.getChild("n39"));
  15441. this.n40 = (this.getChild("n40"));
  15442. }
  15443. }
  15444. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15445. class ui_ranking_com10 extends fgui.GComponent {
  15446. static createInstance() {
  15447. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15448. }
  15449. onConstruct() {
  15450. this.n23 = (this.getChild("n23"));
  15451. this.n24 = (this.getChild("n24"));
  15452. }
  15453. }
  15454. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15455. class ui_ranking_com11 extends fgui.GComponent {
  15456. static createInstance() {
  15457. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15458. }
  15459. onConstruct() {
  15460. this.n24 = (this.getChild("n24"));
  15461. this.n25 = (this.getChild("n25"));
  15462. this.t0 = this.getTransition("t0");
  15463. }
  15464. }
  15465. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15466. class ui_ranking_com13 extends fgui.GButton {
  15467. static createInstance() {
  15468. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15469. }
  15470. onConstruct() {
  15471. this.c1 = this.getController("c1");
  15472. this.n44 = (this.getChild("n44"));
  15473. this.n45 = (this.getChild("n45"));
  15474. this.n46 = (this.getChild("n46"));
  15475. }
  15476. }
  15477. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15478. class ui_Component122 extends fgui.GComponent {
  15479. static createInstance() {
  15480. return (fgui.UIPackage.createObject("game", "Component122"));
  15481. }
  15482. onConstruct() {
  15483. this.gameNode3 = (this.getChild("gameNode3"));
  15484. }
  15485. }
  15486. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15487. class ui_skillItem extends fgui.GComponent {
  15488. static createInstance() {
  15489. return (fgui.UIPackage.createObject("game", "skillItem"));
  15490. }
  15491. onConstruct() {
  15492. this.c1 = this.getController("c1");
  15493. this.n31 = (this.getChild("n31"));
  15494. this.n6 = (this.getChild("n6"));
  15495. this.skillImg = (this.getChild("skillImg"));
  15496. this.nameTxt = (this.getChild("nameTxt"));
  15497. this.levelTxt = (this.getChild("levelTxt"));
  15498. this.n28 = (this.getChild("n28"));
  15499. this.describeTxt = (this.getChild("describeTxt"));
  15500. this.n32 = (this.getChild("n32"));
  15501. this.mutiBtn = (this.getChild("mutiBtn"));
  15502. this.tryNode = (this.getChild("tryNode"));
  15503. this.normalBtn = (this.getChild("normalBtn"));
  15504. this.startBtn = (this.getChild("startBtn"));
  15505. this.n42 = (this.getChild("n42"));
  15506. this.n43 = (this.getChild("n43"));
  15507. this.n44 = (this.getChild("n44"));
  15508. }
  15509. }
  15510. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15511. class ui_Component26 extends fgui.GButton {
  15512. static createInstance() {
  15513. return (fgui.UIPackage.createObject("game", "Component26"));
  15514. }
  15515. onConstruct() {
  15516. this.n11 = (this.getChild("n11"));
  15517. this.n30 = (this.getChild("n30"));
  15518. this.n34 = (this.getChild("n34"));
  15519. }
  15520. }
  15521. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15522. class ui_Component28 extends fgui.GButton {
  15523. static createInstance() {
  15524. return (fgui.UIPackage.createObject("game", "Component28"));
  15525. }
  15526. onConstruct() {
  15527. this.n12 = (this.getChild("n12"));
  15528. this.n31 = (this.getChild("n31"));
  15529. this.curTxt = (this.getChild("curTxt"));
  15530. this.n33 = (this.getChild("n33"));
  15531. }
  15532. }
  15533. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15534. class ui_Component1302 extends fgui.GComponent {
  15535. static createInstance() {
  15536. return (fgui.UIPackage.createObject("game", "Component1302"));
  15537. }
  15538. onConstruct() {
  15539. this.n2 = (this.getChild("n2"));
  15540. this.n3 = (this.getChild("n3"));
  15541. }
  15542. }
  15543. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15544. class ui_Component113 extends fgui.GComponent {
  15545. static createInstance() {
  15546. return (fgui.UIPackage.createObject("game", "Component113"));
  15547. }
  15548. onConstruct() {
  15549. this.n85 = (this.getChild("n85"));
  15550. this.n86 = (this.getChild("n86"));
  15551. this.n77 = (this.getChild("n77"));
  15552. this.n79 = (this.getChild("n79"));
  15553. this.n80 = (this.getChild("n80"));
  15554. this.n81 = (this.getChild("n81"));
  15555. this.n82 = (this.getChild("n82"));
  15556. this.n84 = (this.getChild("n84"));
  15557. this.n87 = (this.getChild("n87"));
  15558. this.t0 = this.getTransition("t0");
  15559. }
  15560. }
  15561. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15562. class ui_Component114 extends fgui.GComponent {
  15563. static createInstance() {
  15564. return (fgui.UIPackage.createObject("game", "Component114"));
  15565. }
  15566. onConstruct() {
  15567. this.n77 = (this.getChild("n77"));
  15568. this.t0 = this.getTransition("t0");
  15569. }
  15570. }
  15571. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15572. class ui_Component115 extends fgui.GComponent {
  15573. static createInstance() {
  15574. return (fgui.UIPackage.createObject("game", "Component115"));
  15575. }
  15576. onConstruct() {
  15577. this.n83 = (this.getChild("n83"));
  15578. this.fingerNode = (this.getChild("fingerNode"));
  15579. this.n84 = (this.getChild("n84"));
  15580. }
  15581. }
  15582. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15583. class ui_Component117 extends fgui.GComponent {
  15584. static createInstance() {
  15585. return (fgui.UIPackage.createObject("game", "Component117"));
  15586. }
  15587. onConstruct() {
  15588. this.n87 = (this.getChild("n87"));
  15589. this.n88 = (this.getChild("n88"));
  15590. this.n84 = (this.getChild("n84"));
  15591. this.n85 = (this.getChild("n85"));
  15592. this.n86 = (this.getChild("n86"));
  15593. this.t0 = this.getTransition("t0");
  15594. }
  15595. }
  15596. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15597. class ui_Component98_1 extends fgui.GButton {
  15598. static createInstance() {
  15599. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15600. }
  15601. onConstruct() {
  15602. this.c1 = this.getController("c1");
  15603. this.n8 = (this.getChild("n8"));
  15604. this.n41 = (this.getChild("n41"));
  15605. this.n40 = (this.getChild("n40"));
  15606. }
  15607. }
  15608. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15609. class ui_Component61 extends fgui.GComponent {
  15610. static createInstance() {
  15611. return (fgui.UIPackage.createObject("game", "Component61"));
  15612. }
  15613. onConstruct() {
  15614. this.n14 = (this.getChild("n14"));
  15615. this.n6 = (this.getChild("n6"));
  15616. this.t0 = this.getTransition("t0");
  15617. }
  15618. }
  15619. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15620. class ui_Component62 extends fgui.GComponent {
  15621. static createInstance() {
  15622. return (fgui.UIPackage.createObject("game", "Component62"));
  15623. }
  15624. onConstruct() {
  15625. this.n66 = (this.getChild("n66"));
  15626. this.n56 = (this.getChild("n56"));
  15627. this.n63 = (this.getChild("n63"));
  15628. this.n65 = (this.getChild("n65"));
  15629. this.t0 = this.getTransition("t0");
  15630. }
  15631. }
  15632. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15633. class ui_d3Root extends fgui.GComponent {
  15634. static createInstance() {
  15635. return (fgui.UIPackage.createObject("game", "d3Root"));
  15636. }
  15637. onConstruct() {
  15638. }
  15639. }
  15640. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15641. class ui_d2Root extends fgui.GComponent {
  15642. static createInstance() {
  15643. return (fgui.UIPackage.createObject("game", "d2Root"));
  15644. }
  15645. onConstruct() {
  15646. }
  15647. }
  15648. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15649. class ui_ballNode extends fgui.GComponent {
  15650. static createInstance() {
  15651. return (fgui.UIPackage.createObject("game", "ballNode"));
  15652. }
  15653. onConstruct() {
  15654. }
  15655. }
  15656. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15657. class ui_border extends fgui.GComponent {
  15658. static createInstance() {
  15659. return (fgui.UIPackage.createObject("game", "border"));
  15660. }
  15661. onConstruct() {
  15662. this.bar1 = (this.getChild("bar1"));
  15663. this.bar2 = (this.getChild("bar2"));
  15664. this.bar3 = (this.getChild("bar3"));
  15665. this.bar4 = (this.getChild("bar4"));
  15666. this.bar5 = (this.getChild("bar5"));
  15667. this.bar6 = (this.getChild("bar6"));
  15668. this.circle1 = (this.getChild("circle1"));
  15669. this.circle2 = (this.getChild("circle2"));
  15670. this.circle3 = (this.getChild("circle3"));
  15671. this.circle4 = (this.getChild("circle4"));
  15672. this.circle5 = (this.getChild("circle5"));
  15673. this.circle6 = (this.getChild("circle6"));
  15674. this.n28 = (this.getChild("n28"));
  15675. }
  15676. }
  15677. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15678. class ui_btn_buy extends fgui.GButton {
  15679. static createInstance() {
  15680. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15681. }
  15682. onConstruct() {
  15683. this.button = this.getController("button");
  15684. this.n0 = (this.getChild("n0"));
  15685. this.n1 = (this.getChild("n1"));
  15686. this.n2 = (this.getChild("n2"));
  15687. }
  15688. }
  15689. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15690. class ui_Component41_2 extends fgui.GComponent {
  15691. static createInstance() {
  15692. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15693. }
  15694. onConstruct() {
  15695. this.c1 = this.getController("c1");
  15696. this.n0 = (this.getChild("n0"));
  15697. this.n2 = (this.getChild("n2"));
  15698. this.n19 = (this.getChild("n19"));
  15699. this.cancelBtn = (this.getChild("cancelBtn"));
  15700. this.videoBtn = (this.getChild("videoBtn"));
  15701. this.n9 = (this.getChild("n9"));
  15702. this.n22 = (this.getChild("n22"));
  15703. this.tipsTxt = (this.getChild("tipsTxt"));
  15704. this.n23 = (this.getChild("n23"));
  15705. this.n24 = (this.getChild("n24"));
  15706. this.n26 = (this.getChild("n26"));
  15707. this.n27 = (this.getChild("n27"));
  15708. this.titleTxt = (this.getChild("titleTxt"));
  15709. }
  15710. }
  15711. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15712. class ui_Component41_1 extends fgui.GComponent {
  15713. static createInstance() {
  15714. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15715. }
  15716. onConstruct() {
  15717. this.c1 = this.getController("c1");
  15718. this.n0 = (this.getChild("n0"));
  15719. this.n2 = (this.getChild("n2"));
  15720. this.cancelBtn = (this.getChild("cancelBtn"));
  15721. this.videoBtn = (this.getChild("videoBtn"));
  15722. this.n27 = (this.getChild("n27"));
  15723. this.n30 = (this.getChild("n30"));
  15724. this.n31 = (this.getChild("n31"));
  15725. this.n32 = (this.getChild("n32"));
  15726. this.n33 = (this.getChild("n33"));
  15727. this.n34 = (this.getChild("n34"));
  15728. this.n35 = (this.getChild("n35"));
  15729. this.n36 = (this.getChild("n36"));
  15730. this.n1 = (this.getChild("n1"));
  15731. this.n37 = (this.getChild("n37"));
  15732. this.t0 = this.getTransition("t0");
  15733. this.t1 = this.getTransition("t1");
  15734. this.t2 = this.getTransition("t2");
  15735. this.t3 = this.getTransition("t3");
  15736. }
  15737. }
  15738. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15739. class ui_againBtn extends fgui.GButton {
  15740. static createInstance() {
  15741. return (fgui.UIPackage.createObject("game", "againBtn"));
  15742. }
  15743. onConstruct() {
  15744. this.n2 = (this.getChild("n2"));
  15745. this.n1 = (this.getChild("n1"));
  15746. this.n5 = (this.getChild("n5"));
  15747. }
  15748. }
  15749. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15750. class ui_Component118 extends fgui.GButton {
  15751. static createInstance() {
  15752. return (fgui.UIPackage.createObject("game", "Component118"));
  15753. }
  15754. onConstruct() {
  15755. this.c1 = this.getController("c1");
  15756. this.n14 = (this.getChild("n14"));
  15757. this.n9 = (this.getChild("n9"));
  15758. this.n10 = (this.getChild("n10"));
  15759. this.diamondTxt = (this.getChild("diamondTxt"));
  15760. this.n13 = (this.getChild("n13"));
  15761. this.n15 = (this.getChild("n15"));
  15762. }
  15763. }
  15764. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15765. class ui_Component119 extends fgui.GComponent {
  15766. static createInstance() {
  15767. return (fgui.UIPackage.createObject("game", "Component119"));
  15768. }
  15769. onConstruct() {
  15770. this.n1 = (this.getChild("n1"));
  15771. this.n2 = (this.getChild("n2"));
  15772. this.n13 = (this.getChild("n13"));
  15773. this.n6 = (this.getChild("n6"));
  15774. this.screenNode = (this.getChild("screenNode"));
  15775. this.n15 = (this.getChild("n15"));
  15776. this.closeBtn = (this.getChild("closeBtn"));
  15777. this.share2Btn = (this.getChild("share2Btn"));
  15778. this.shareBtn = (this.getChild("shareBtn"));
  15779. this.tipsNode = (this.getChild("tipsNode"));
  15780. this.awardNode = (this.getChild("awardNode"));
  15781. }
  15782. }
  15783. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15784. class ui_daoJuDisplay extends fgui.GComponent {
  15785. static createInstance() {
  15786. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15787. }
  15788. onConstruct() {
  15789. this.n6 = (this.getChild("n6"));
  15790. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15791. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15792. this.btn_buy = (this.getChild("btn_buy"));
  15793. this.nameTxt = (this.getChild("nameTxt"));
  15794. this.zsImg = (this.getChild("zsImg"));
  15795. }
  15796. }
  15797. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15798. class ui_Component132_1 extends fgui.GComponent {
  15799. static createInstance() {
  15800. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15801. }
  15802. onConstruct() {
  15803. this.n25 = (this.getChild("n25"));
  15804. this.n26 = (this.getChild("n26"));
  15805. this.n27 = (this.getChild("n27"));
  15806. this.t0 = this.getTransition("t0");
  15807. }
  15808. }
  15809. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15810. class ui_SecretaryDisplay extends fgui.GComponent {
  15811. static createInstance() {
  15812. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15813. }
  15814. onConstruct() {
  15815. this.n2 = (this.getChild("n2"));
  15816. this.levelTxt = (this.getChild("levelTxt"));
  15817. this.n4 = (this.getChild("n4"));
  15818. this.secretary = (this.getChild("secretary"));
  15819. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15820. this.n16 = (this.getChild("n16"));
  15821. this.n37 = (this.getChild("n37"));
  15822. this.n41 = (this.getChild("n41"));
  15823. this.n14 = (this.getChild("n14"));
  15824. this.n17 = (this.getChild("n17"));
  15825. this.heightTxt = (this.getChild("heightTxt"));
  15826. this.n46 = (this.getChild("n46"));
  15827. this.n36 = (this.getChild("n36"));
  15828. this.n38 = (this.getChild("n38"));
  15829. this.foodTxt = (this.getChild("foodTxt"));
  15830. this.n47 = (this.getChild("n47"));
  15831. this.n40 = (this.getChild("n40"));
  15832. this.n42 = (this.getChild("n42"));
  15833. this.historyTxt = (this.getChild("historyTxt"));
  15834. this.n48 = (this.getChild("n48"));
  15835. this.nameImg = (this.getChild("nameImg"));
  15836. this.n12 = (this.getChild("n12"));
  15837. this.n49 = (this.getChild("n49"));
  15838. this.t0 = this.getTransition("t0");
  15839. }
  15840. }
  15841. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15842. class ui_BallRodDisplay extends fgui.GComponent {
  15843. static createInstance() {
  15844. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15845. }
  15846. onConstruct() {
  15847. this.c1 = this.getController("c1");
  15848. this.n31 = (this.getChild("n31"));
  15849. this.n6 = (this.getChild("n6"));
  15850. this.nameTxt = (this.getChild("nameTxt"));
  15851. this.rodImg = (this.getChild("rodImg"));
  15852. this.eftRod = (this.getChild("eftRod"));
  15853. this.levelNode = (this.getChild("levelNode"));
  15854. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15855. }
  15856. }
  15857. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15858. class ui_Component111_11 extends fgui.GComponent {
  15859. static createInstance() {
  15860. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15861. }
  15862. onConstruct() {
  15863. this.n68 = (this.getChild("n68"));
  15864. this.n69 = (this.getChild("n69"));
  15865. }
  15866. }
  15867. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15868. class ui_Component112 extends fgui.GComponent {
  15869. static createInstance() {
  15870. return (fgui.UIPackage.createObject("game", "Component112"));
  15871. }
  15872. onConstruct() {
  15873. this.n68 = (this.getChild("n68"));
  15874. this.n70 = (this.getChild("n70"));
  15875. this.myMask = (this.getChild("myMask"));
  15876. }
  15877. }
  15878. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15879. class ui_Component111 extends fgui.GComponent {
  15880. static createInstance() {
  15881. return (fgui.UIPackage.createObject("game", "Component111"));
  15882. }
  15883. onConstruct() {
  15884. this.n68 = (this.getChild("n68"));
  15885. this.myMask = (this.getChild("myMask"));
  15886. }
  15887. }
  15888. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15889. class ui_Component144 extends fgui.GButton {
  15890. static createInstance() {
  15891. return (fgui.UIPackage.createObject("game", "Component144"));
  15892. }
  15893. onConstruct() {
  15894. this.n8 = (this.getChild("n8"));
  15895. }
  15896. }
  15897. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15898. class ui_Sign_com2 extends fgui.GComponent {
  15899. static createInstance() {
  15900. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15901. }
  15902. onConstruct() {
  15903. this.n0 = (this.getChild("n0"));
  15904. this.n1 = (this.getChild("n1"));
  15905. this.t0 = this.getTransition("t0");
  15906. }
  15907. }
  15908. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15909. class ui_Sign_guang extends fgui.GComponent {
  15910. static createInstance() {
  15911. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15912. }
  15913. onConstruct() {
  15914. this.n1 = (this.getChild("n1"));
  15915. this.n2 = (this.getChild("n2"));
  15916. this.n3 = (this.getChild("n3"));
  15917. this.n4 = (this.getChild("n4"));
  15918. this.n5 = (this.getChild("n5"));
  15919. this.n6 = (this.getChild("n6"));
  15920. this.n8 = (this.getChild("n8"));
  15921. }
  15922. }
  15923. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15924. class ui_SignMax extends fgui.GComponent {
  15925. static createInstance() {
  15926. return (fgui.UIPackage.createObject("game", "SignMax"));
  15927. }
  15928. onConstruct() {
  15929. this.c1 = this.getController("c1");
  15930. this.n7 = (this.getChild("n7"));
  15931. this.n15 = (this.getChild("n15"));
  15932. this.n8 = (this.getChild("n8"));
  15933. this.titleTxt = (this.getChild("titleTxt"));
  15934. this.myIcon1 = (this.getChild("myIcon1"));
  15935. this.numTxt1 = (this.getChild("numTxt1"));
  15936. this.myIcon2 = (this.getChild("myIcon2"));
  15937. this.n20 = (this.getChild("n20"));
  15938. this.n17 = (this.getChild("n17"));
  15939. this.numTxt2 = (this.getChild("numTxt2"));
  15940. this.n12 = (this.getChild("n12"));
  15941. this.n13 = (this.getChild("n13"));
  15942. this.n21 = (this.getChild("n21"));
  15943. this.n14 = (this.getChild("n14"));
  15944. }
  15945. }
  15946. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15947. class ui_Sign_com2_1 extends fgui.GComponent {
  15948. static createInstance() {
  15949. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15950. }
  15951. onConstruct() {
  15952. this.n0 = (this.getChild("n0"));
  15953. this.n1 = (this.getChild("n1"));
  15954. this.t0 = this.getTransition("t0");
  15955. }
  15956. }
  15957. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15958. class ui_Sign_com5 extends fgui.GComponent {
  15959. static createInstance() {
  15960. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15961. }
  15962. onConstruct() {
  15963. this.n3 = (this.getChild("n3"));
  15964. this.n29 = (this.getChild("n29"));
  15965. this.n4 = (this.getChild("n4"));
  15966. this.day1 = (this.getChild("day1"));
  15967. this.day2 = (this.getChild("day2"));
  15968. this.day3 = (this.getChild("day3"));
  15969. this.day4 = (this.getChild("day4"));
  15970. this.day5 = (this.getChild("day5"));
  15971. this.day6 = (this.getChild("day6"));
  15972. this.day7 = (this.getChild("day7"));
  15973. this.t0 = this.getTransition("t0");
  15974. }
  15975. }
  15976. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15977. class ui_Sign_com8 extends fgui.GComponent {
  15978. static createInstance() {
  15979. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15980. }
  15981. onConstruct() {
  15982. this.n48 = (this.getChild("n48"));
  15983. this.womanTxt = (this.getChild("womanTxt"));
  15984. this.t0 = this.getTransition("t0");
  15985. }
  15986. }
  15987. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15988. class ui_Sign_com6 extends fgui.GComponent {
  15989. static createInstance() {
  15990. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15991. }
  15992. onConstruct() {
  15993. this.n2 = (this.getChild("n2"));
  15994. this.n3 = (this.getChild("n3"));
  15995. this.t0 = this.getTransition("t0");
  15996. }
  15997. }
  15998. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15999. class ui_Sign_com7 extends fgui.GComponent {
  16000. static createInstance() {
  16001. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  16002. }
  16003. onConstruct() {
  16004. this.n29 = (this.getChild("n29"));
  16005. this.n2 = (this.getChild("n2"));
  16006. }
  16007. }
  16008. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  16009. class ui_UITurntable_com1_2 extends fgui.GComponent {
  16010. static createInstance() {
  16011. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  16012. }
  16013. onConstruct() {
  16014. this.n5 = (this.getChild("n5"));
  16015. this.n4 = (this.getChild("n4"));
  16016. this.t0 = this.getTransition("t0");
  16017. }
  16018. }
  16019. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  16020. class ui_UITurntable_com2 extends fgui.GComponent {
  16021. static createInstance() {
  16022. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  16023. }
  16024. onConstruct() {
  16025. this.c1 = this.getController("c1");
  16026. this.n4 = (this.getChild("n4"));
  16027. this.n6 = (this.getChild("n6"));
  16028. this.n10 = (this.getChild("n10"));
  16029. this.n11 = (this.getChild("n11"));
  16030. this.n12 = (this.getChild("n12"));
  16031. this.n13 = (this.getChild("n13"));
  16032. this.n14 = (this.getChild("n14"));
  16033. this.n15 = (this.getChild("n15"));
  16034. this.n16 = (this.getChild("n16"));
  16035. this.n17 = (this.getChild("n17"));
  16036. this.n18 = (this.getChild("n18"));
  16037. this.n19 = (this.getChild("n19"));
  16038. this.n20 = (this.getChild("n20"));
  16039. this.n21 = (this.getChild("n21"));
  16040. this.n22 = (this.getChild("n22"));
  16041. this.n23 = (this.getChild("n23"));
  16042. this.n24 = (this.getChild("n24"));
  16043. this.n25 = (this.getChild("n25"));
  16044. this.n26 = (this.getChild("n26"));
  16045. this.n27 = (this.getChild("n27"));
  16046. this.n28 = (this.getChild("n28"));
  16047. this.n29 = (this.getChild("n29"));
  16048. this.n30 = (this.getChild("n30"));
  16049. this.n31 = (this.getChild("n31"));
  16050. this.n32 = (this.getChild("n32"));
  16051. this.n33 = (this.getChild("n33"));
  16052. }
  16053. }
  16054. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16055. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16056. static createInstance() {
  16057. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16058. }
  16059. onConstruct() {
  16060. this.n5 = (this.getChild("n5"));
  16061. this.n4 = (this.getChild("n4"));
  16062. this.t0 = this.getTransition("t0");
  16063. }
  16064. }
  16065. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16066. class ui_UITurntable_com5 extends fgui.GComponent {
  16067. static createInstance() {
  16068. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16069. }
  16070. onConstruct() {
  16071. this.flashNode = (this.getChild("flashNode"));
  16072. this.rotNode = (this.getChild("rotNode"));
  16073. this.n3 = (this.getChild("n3"));
  16074. this.n21 = (this.getChild("n21"));
  16075. this.t0 = this.getTransition("t0");
  16076. }
  16077. }
  16078. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16079. class ui_UITurntable_com7 extends fgui.GComponent {
  16080. static createInstance() {
  16081. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16082. }
  16083. onConstruct() {
  16084. this.n2 = (this.getChild("n2"));
  16085. this.n35 = (this.getChild("n35"));
  16086. this.img1 = (this.getChild("img1"));
  16087. this.img2 = (this.getChild("img2"));
  16088. this.img3 = (this.getChild("img3"));
  16089. this.img4 = (this.getChild("img4"));
  16090. this.img6 = (this.getChild("img6"));
  16091. this.img5 = (this.getChild("img5"));
  16092. this.txt1 = (this.getChild("txt1"));
  16093. this.txt2 = (this.getChild("txt2"));
  16094. this.txt3 = (this.getChild("txt3"));
  16095. this.txt4 = (this.getChild("txt4"));
  16096. this.txt5 = (this.getChild("txt5"));
  16097. this.txt6 = (this.getChild("txt6"));
  16098. }
  16099. }
  16100. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16101. class ui_UITurntable_com9 extends fgui.GComponent {
  16102. static createInstance() {
  16103. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16104. }
  16105. onConstruct() {
  16106. this.n38 = (this.getChild("n38"));
  16107. this.n39 = (this.getChild("n39"));
  16108. }
  16109. }
  16110. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16111. class ui_UITurntable_com10 extends fgui.GComponent {
  16112. static createInstance() {
  16113. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16114. }
  16115. onConstruct() {
  16116. this.n39 = (this.getChild("n39"));
  16117. this.n40 = (this.getChild("n40"));
  16118. this.t0 = this.getTransition("t0");
  16119. }
  16120. }
  16121. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16122. class ui_UITurntable_com11 extends fgui.GComponent {
  16123. static createInstance() {
  16124. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16125. }
  16126. onConstruct() {
  16127. this.n38 = (this.getChild("n38"));
  16128. this.n39 = (this.getChild("n39"));
  16129. this.n40 = (this.getChild("n40"));
  16130. this.t0 = this.getTransition("t0");
  16131. }
  16132. }
  16133. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16134. class ui_UITurntable_com12 extends fgui.GComponent {
  16135. static createInstance() {
  16136. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16137. }
  16138. onConstruct() {
  16139. this.n43 = (this.getChild("n43"));
  16140. this.barNode = (this.getChild("barNode"));
  16141. this.tipsTxt = (this.getChild("tipsTxt"));
  16142. this.n45 = (this.getChild("n45"));
  16143. this.boxBtn = (this.getChild("boxBtn"));
  16144. }
  16145. }
  16146. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16147. class ui_UITurntable_com1 extends fgui.GButton {
  16148. static createInstance() {
  16149. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16150. }
  16151. onConstruct() {
  16152. this.n41 = (this.getChild("n41"));
  16153. this.n42 = (this.getChild("n42"));
  16154. this.t0 = this.getTransition("t0");
  16155. }
  16156. }
  16157. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16158. class ui_UITurntable_com3 extends fgui.GComponent {
  16159. static createInstance() {
  16160. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16161. }
  16162. onConstruct() {
  16163. this.n48 = (this.getChild("n48"));
  16164. this.womanTxt = (this.getChild("womanTxt"));
  16165. this.t0 = this.getTransition("t0");
  16166. }
  16167. }
  16168. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16169. class ui_cancelBtn2 extends fgui.GButton {
  16170. static createInstance() {
  16171. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16172. }
  16173. onConstruct() {
  16174. this.c1 = this.getController("c1");
  16175. this.n0 = (this.getChild("n0"));
  16176. this.n1 = (this.getChild("n1"));
  16177. this.n2 = (this.getChild("n2"));
  16178. this.n3 = (this.getChild("n3"));
  16179. this.n4 = (this.getChild("n4"));
  16180. this.n5 = (this.getChild("n5"));
  16181. this.n6 = (this.getChild("n6"));
  16182. this.n7 = (this.getChild("n7"));
  16183. this.n8 = (this.getChild("n8"));
  16184. this.powerEft = (this.getChild("powerEft"));
  16185. }
  16186. }
  16187. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16188. class ui_shareBtn2 extends fgui.GButton {
  16189. static createInstance() {
  16190. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16191. }
  16192. onConstruct() {
  16193. this.c1 = this.getController("c1");
  16194. this.n2 = (this.getChild("n2"));
  16195. this.n24 = (this.getChild("n24"));
  16196. this.n1 = (this.getChild("n1"));
  16197. this.n3 = (this.getChild("n3"));
  16198. this.n23 = (this.getChild("n23"));
  16199. this.n4 = (this.getChild("n4"));
  16200. this.n5 = (this.getChild("n5"));
  16201. this.n6 = (this.getChild("n6"));
  16202. this.n20 = (this.getChild("n20"));
  16203. this.n21 = (this.getChild("n21"));
  16204. this.n22 = (this.getChild("n22"));
  16205. this.powerEft = (this.getChild("powerEft"));
  16206. }
  16207. }
  16208. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16209. class ui_UIMoney extends fgui.GComponent {
  16210. static createInstance() {
  16211. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16212. }
  16213. onConstruct() {
  16214. this.c1 = this.getController("c1");
  16215. this.n4 = (this.getChild("n4"));
  16216. this.coinImg = (this.getChild("coinImg"));
  16217. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16218. this.coinTxt = (this.getChild("coinTxt"));
  16219. this.n7 = (this.getChild("n7"));
  16220. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16221. this.diamondTxt = (this.getChild("diamondTxt"));
  16222. this.diamondImg = (this.getChild("diamondImg"));
  16223. this.n12 = (this.getChild("n12"));
  16224. this.powerImg = (this.getChild("powerImg"));
  16225. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16226. this.powerTxt = (this.getChild("powerTxt"));
  16227. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16228. }
  16229. }
  16230. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16231. class ui_backBtn extends fgui.GButton {
  16232. static createInstance() {
  16233. return (fgui.UIPackage.createObject("game", "backBtn"));
  16234. }
  16235. onConstruct() {
  16236. this.n0 = (this.getChild("n0"));
  16237. this.t0 = this.getTransition("t0");
  16238. this.t1 = this.getTransition("t1");
  16239. }
  16240. }
  16241. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16242. class ui_MoneyBtn extends fgui.GButton {
  16243. static createInstance() {
  16244. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16245. }
  16246. onConstruct() {
  16247. this.button = this.getController("button");
  16248. this.n0 = (this.getChild("n0"));
  16249. }
  16250. }
  16251. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16252. class ui_UIMoneyBtn extends fgui.GComponent {
  16253. static createInstance() {
  16254. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16255. }
  16256. onConstruct() {
  16257. this.n1 = (this.getChild("n1"));
  16258. this.closeBtn = (this.getChild("closeBtn"));
  16259. }
  16260. }
  16261. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16262. class ui_Component64 extends fgui.GComponent {
  16263. static createInstance() {
  16264. return (fgui.UIPackage.createObject("game", "Component64"));
  16265. }
  16266. onConstruct() {
  16267. this.n57 = (this.getChild("n57"));
  16268. this.n54 = (this.getChild("n54"));
  16269. this.n55 = (this.getChild("n55"));
  16270. this.n56 = (this.getChild("n56"));
  16271. this.t1 = this.getTransition("t1");
  16272. }
  16273. }
  16274. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16275. class ui_Component41_3 extends fgui.GComponent {
  16276. static createInstance() {
  16277. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16278. }
  16279. onConstruct() {
  16280. this.c1 = this.getController("c1");
  16281. this.n0 = (this.getChild("n0"));
  16282. this.n2 = (this.getChild("n2"));
  16283. this.cancelBtn = (this.getChild("cancelBtn"));
  16284. this.videoBtn = (this.getChild("videoBtn"));
  16285. this.n9 = (this.getChild("n9"));
  16286. this.n24 = (this.getChild("n24"));
  16287. this.n27 = (this.getChild("n27"));
  16288. this.titleTxt = (this.getChild("titleTxt"));
  16289. this.n28 = (this.getChild("n28"));
  16290. this.t0 = this.getTransition("t0");
  16291. }
  16292. }
  16293. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16294. class ui_dh_zs_4 extends fgui.GComponent {
  16295. static createInstance() {
  16296. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16297. }
  16298. onConstruct() {
  16299. this.n1 = (this.getChild("n1"));
  16300. this.n2 = (this.getChild("n2"));
  16301. this.n3 = (this.getChild("n3"));
  16302. this.n4 = (this.getChild("n4"));
  16303. this.n5 = (this.getChild("n5"));
  16304. this.n6 = (this.getChild("n6"));
  16305. this.n8 = (this.getChild("n8"));
  16306. this.t0 = this.getTransition("t0");
  16307. }
  16308. }
  16309. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16310. class ui_Component71_1 extends fgui.GButton {
  16311. static createInstance() {
  16312. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16313. }
  16314. onConstruct() {
  16315. this.n17 = (this.getChild("n17"));
  16316. this.t0 = this.getTransition("t0");
  16317. }
  16318. }
  16319. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16320. class ui_Component83 extends fgui.GComponent {
  16321. static createInstance() {
  16322. return (fgui.UIPackage.createObject("game", "Component83"));
  16323. }
  16324. onConstruct() {
  16325. this.c1 = this.getController("c1");
  16326. this.n17 = (this.getChild("n17"));
  16327. this.n19 = (this.getChild("n19"));
  16328. this.n20 = (this.getChild("n20"));
  16329. }
  16330. }
  16331. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16332. class ui_Component84 extends fgui.GComponent {
  16333. static createInstance() {
  16334. return (fgui.UIPackage.createObject("game", "Component84"));
  16335. }
  16336. onConstruct() {
  16337. this.c1 = this.getController("c1");
  16338. this.n4 = (this.getChild("n4"));
  16339. this.n22 = (this.getChild("n22"));
  16340. this.n23 = (this.getChild("n23"));
  16341. this.numTxt = (this.getChild("numTxt"));
  16342. this.n25 = (this.getChild("n25"));
  16343. this.n26 = (this.getChild("n26"));
  16344. }
  16345. }
  16346. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16347. class ui_Component84_1 extends fgui.GComponent {
  16348. static createInstance() {
  16349. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16350. }
  16351. onConstruct() {
  16352. this.c1 = this.getController("c1");
  16353. this.n4 = (this.getChild("n4"));
  16354. this.n22 = (this.getChild("n22"));
  16355. this.n23 = (this.getChild("n23"));
  16356. this.numTxt = (this.getChild("numTxt"));
  16357. this.n25 = (this.getChild("n25"));
  16358. this.n26 = (this.getChild("n26"));
  16359. }
  16360. }
  16361. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16362. class ui_Component85 extends fgui.GComponent {
  16363. static createInstance() {
  16364. return (fgui.UIPackage.createObject("game", "Component85"));
  16365. }
  16366. onConstruct() {
  16367. this.n1 = (this.getChild("n1"));
  16368. this.n6 = (this.getChild("n6"));
  16369. this.n2 = (this.getChild("n2"));
  16370. this.n3 = (this.getChild("n3"));
  16371. this.levelTxt = (this.getChild("levelTxt"));
  16372. this.n10 = (this.getChild("n10"));
  16373. this.n11 = (this.getChild("n11"));
  16374. this.n12 = (this.getChild("n12"));
  16375. this.n13 = (this.getChild("n13"));
  16376. this.n14 = (this.getChild("n14"));
  16377. this.modeNode = (this.getChild("modeNode"));
  16378. this.n18 = (this.getChild("n18"));
  16379. this.conditionTxt = (this.getChild("conditionTxt"));
  16380. this.diamondNode = (this.getChild("diamondNode"));
  16381. this.coinNode = (this.getChild("coinNode"));
  16382. this.startBtn = (this.getChild("startBtn"));
  16383. this.n28 = (this.getChild("n28"));
  16384. this.displayRoot = (this.getChild("displayRoot"));
  16385. this.t0 = this.getTransition("t0");
  16386. }
  16387. }
  16388. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16389. class ui_Component86 extends fgui.GButton {
  16390. static createInstance() {
  16391. return (fgui.UIPackage.createObject("game", "Component86"));
  16392. }
  16393. onConstruct() {
  16394. this.n15 = (this.getChild("n15"));
  16395. this.t0 = this.getTransition("t0");
  16396. }
  16397. }
  16398. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16399. class ui_Component87 extends fgui.GComponent {
  16400. static createInstance() {
  16401. return (fgui.UIPackage.createObject("game", "Component87"));
  16402. }
  16403. onConstruct() {
  16404. this.n66 = (this.getChild("n66"));
  16405. this.myProgress = (this.getChild("myProgress"));
  16406. this.starAni = (this.getChild("starAni"));
  16407. this.hpTxt = (this.getChild("hpTxt"));
  16408. this.n74 = (this.getChild("n74"));
  16409. this.n73 = (this.getChild("n73"));
  16410. this.ballTxt = (this.getChild("ballTxt"));
  16411. this.n76 = (this.getChild("n76"));
  16412. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16413. this.levelTxt = (this.getChild("levelTxt"));
  16414. this.star1 = (this.getChild("star1"));
  16415. this.star2 = (this.getChild("star2"));
  16416. this.star3 = (this.getChild("star3"));
  16417. }
  16418. }
  16419. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16420. class ui_Component88 extends fgui.GProgressBar {
  16421. static createInstance() {
  16422. return (fgui.UIPackage.createObject("game", "Component88"));
  16423. }
  16424. onConstruct() {
  16425. this.n68 = (this.getChild("n68"));
  16426. this.bar = (this.getChild("bar"));
  16427. }
  16428. }
  16429. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16430. class ui_Component89 extends fgui.GComponent {
  16431. static createInstance() {
  16432. return (fgui.UIPackage.createObject("game", "Component89"));
  16433. }
  16434. onConstruct() {
  16435. this.c1 = this.getController("c1");
  16436. this.n71 = (this.getChild("n71"));
  16437. this.n72 = (this.getChild("n72"));
  16438. }
  16439. }
  16440. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16441. class ui_Component90 extends fgui.GComponent {
  16442. static createInstance() {
  16443. return (fgui.UIPackage.createObject("game", "Component90"));
  16444. }
  16445. onConstruct() {
  16446. this.c1 = this.getController("c1");
  16447. this.n64 = (this.getChild("n64"));
  16448. this.n65 = (this.getChild("n65"));
  16449. this.n66 = (this.getChild("n66"));
  16450. this.t0 = this.getTransition("t0");
  16451. }
  16452. }
  16453. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16454. class ui_Component127 extends fgui.GButton {
  16455. static createInstance() {
  16456. return (fgui.UIPackage.createObject("game", "Component127"));
  16457. }
  16458. onConstruct() {
  16459. this.n5 = (this.getChild("n5"));
  16460. }
  16461. }
  16462. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16463. class gameBinder {
  16464. static bindAll() {
  16465. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16466. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16467. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16468. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16469. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16470. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16471. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16472. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16473. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16474. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16475. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16476. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16477. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16478. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16479. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16480. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16481. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16482. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16483. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16484. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16485. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16486. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16487. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16488. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16489. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16490. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16491. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16492. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16493. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16494. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16495. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16496. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16497. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16498. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16499. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16500. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16501. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16502. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16503. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16504. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16505. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16506. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16507. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16508. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16509. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16510. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16511. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16512. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16513. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16514. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16515. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16516. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16517. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16518. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16519. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16520. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16521. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16522. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16523. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16524. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16525. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16526. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16527. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16528. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16529. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16530. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16531. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16532. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16533. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16534. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16535. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16536. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16537. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16538. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16539. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16540. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16541. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16542. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16543. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16544. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16545. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16546. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16547. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16548. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16549. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16550. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16551. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16552. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16553. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16554. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16555. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16556. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16557. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16558. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16559. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16560. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16561. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16562. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16563. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16564. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16565. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16566. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16567. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16568. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16569. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16570. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16571. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16572. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16573. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16574. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16575. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16576. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16577. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16578. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16579. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16580. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16581. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16582. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16583. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16584. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16585. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16586. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16587. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16588. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16589. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16590. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16591. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16592. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16593. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16594. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16595. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16596. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16597. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16598. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16599. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16600. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16601. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16602. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16603. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16604. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16605. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16606. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16607. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16608. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16609. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16610. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16611. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16612. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16613. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16614. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16615. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16616. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16617. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16618. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16619. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16620. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16621. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16622. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16623. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16624. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16625. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16626. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16627. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16628. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16629. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16630. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16631. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16632. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16633. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16634. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16635. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16636. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16637. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16638. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16639. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16640. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16641. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16642. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16643. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16644. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16645. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16646. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16647. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16648. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16649. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16650. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16651. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16652. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16653. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16654. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16655. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16656. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16657. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16658. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16659. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16660. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16661. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16662. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16663. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16664. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16665. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16666. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16667. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16668. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16669. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16670. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16671. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16672. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16673. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16674. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16675. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16676. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16677. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16678. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16679. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16680. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16681. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16682. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16683. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16684. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16685. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16686. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16687. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16688. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16689. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16690. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16691. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16692. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16693. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16694. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16695. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16696. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16697. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16698. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16699. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16700. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16701. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16702. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16703. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16704. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16705. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16706. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16707. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16708. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16709. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16710. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16711. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16712. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16713. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16714. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16715. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16716. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16717. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16718. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16719. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16720. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16721. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16722. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16723. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16724. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16725. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16726. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16727. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16728. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16729. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16730. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16731. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16732. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16733. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16734. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16735. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16736. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16737. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16738. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16739. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16740. }
  16741. }
  16742. class ui_btn6 extends fgui.GButton {
  16743. static createInstance() {
  16744. return (fgui.UIPackage.createObject("loading", "btn6"));
  16745. }
  16746. onConstruct() {
  16747. this.n6 = (this.getChild("n6"));
  16748. this.n1 = (this.getChild("n1"));
  16749. }
  16750. }
  16751. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16752. class ui_xyItem extends fgui.GComponent {
  16753. static createInstance() {
  16754. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16755. }
  16756. onConstruct() {
  16757. this.xyItem = (this.getChild("xyItem"));
  16758. }
  16759. }
  16760. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16761. class ui_loadinfo extends fgui.GProgressBar {
  16762. static createInstance() {
  16763. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16764. }
  16765. onConstruct() {
  16766. this.bg = (this.getChild("bg"));
  16767. this.bar = (this.getChild("bar"));
  16768. this.title = (this.getChild("title"));
  16769. this.ani = (this.getChild("ani"));
  16770. }
  16771. }
  16772. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16773. class ui_xyNode extends fgui.GComponent {
  16774. static createInstance() {
  16775. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16776. }
  16777. onConstruct() {
  16778. this.n0 = (this.getChild("n0"));
  16779. this.btnYes = (this.getChild("btnYes"));
  16780. this.btnNo = (this.getChild("btnNo"));
  16781. this.btnKnown = (this.getChild("btnKnown"));
  16782. this.btnSure = (this.getChild("btnSure"));
  16783. this.txtWelcom = (this.getChild("txtWelcom"));
  16784. this.txtXy = (this.getChild("txtXy"));
  16785. this.n75 = (this.getChild("n75"));
  16786. this.btnXy1 = (this.getChild("btnXy1"));
  16787. this.btnXy3 = (this.getChild("btnXy3"));
  16788. this.btnXy2 = (this.getChild("btnXy2"));
  16789. this.n74 = (this.getChild("n74"));
  16790. this.xy1 = (this.getChild("xy1"));
  16791. this.txtTitle = (this.getChild("txtTitle"));
  16792. this.btnBack = (this.getChild("btnBack"));
  16793. this.xyList = (this.getChild("xyList"));
  16794. this.xy2 = (this.getChild("xy2"));
  16795. this.xyNode = (this.getChild("xyNode"));
  16796. }
  16797. }
  16798. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16799. class ui_ageNode extends fgui.GComponent {
  16800. static createInstance() {
  16801. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16802. }
  16803. onConstruct() {
  16804. this.n3 = (this.getChild("n3"));
  16805. this.n7 = (this.getChild("n7"));
  16806. this.n4 = (this.getChild("n4"));
  16807. this.btnAge = (this.getChild("btnAge"));
  16808. this.ageNode = (this.getChild("ageNode"));
  16809. }
  16810. }
  16811. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16812. class ui_rnNode extends fgui.GComponent {
  16813. static createInstance() {
  16814. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16815. }
  16816. onConstruct() {
  16817. this.n28 = (this.getChild("n28"));
  16818. this.n30 = (this.getChild("n30"));
  16819. this.n33 = (this.getChild("n33"));
  16820. this.rn1 = (this.getChild("rn1"));
  16821. this.n40 = (this.getChild("n40"));
  16822. this.n41 = (this.getChild("n41"));
  16823. this.rn3 = (this.getChild("rn3"));
  16824. this.n37 = (this.getChild("n37"));
  16825. this.n39 = (this.getChild("n39"));
  16826. this.rn2 = (this.getChild("rn2"));
  16827. this.n47 = (this.getChild("n47"));
  16828. this.n49 = (this.getChild("n49"));
  16829. this.n44 = (this.getChild("n44"));
  16830. this.inputCode = (this.getChild("inputCode"));
  16831. this.inputName = (this.getChild("inputName"));
  16832. this.n48 = (this.getChild("n48"));
  16833. this.n50 = (this.getChild("n50"));
  16834. this.rn4 = (this.getChild("rn4"));
  16835. this.btnCheck = (this.getChild("btnCheck"));
  16836. this.btnExit = (this.getChild("btnExit"));
  16837. this.btnDone = (this.getChild("btnDone"));
  16838. this.rnNode = (this.getChild("rnNode"));
  16839. }
  16840. }
  16841. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16842. class ui_tipNode extends fgui.GComponent {
  16843. static createInstance() {
  16844. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16845. }
  16846. onConstruct() {
  16847. this.bg = (this.getChild("bg"));
  16848. this.n55 = (this.getChild("n55"));
  16849. this.n56 = (this.getChild("n56"));
  16850. this.tipNode = (this.getChild("tipNode"));
  16851. }
  16852. }
  16853. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16854. class ui_fcmNode extends fgui.GComponent {
  16855. static createInstance() {
  16856. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16857. }
  16858. onConstruct() {
  16859. this.n63 = (this.getChild("n63"));
  16860. this.n62 = (this.getChild("n62"));
  16861. this.btnRn = (this.getChild("btnRn"));
  16862. this.n61 = (this.getChild("n61"));
  16863. this.n58 = (this.getChild("n58"));
  16864. this.fcmNode = (this.getChild("fcmNode"));
  16865. }
  16866. }
  16867. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16868. class ui_msgNode extends fgui.GComponent {
  16869. static createInstance() {
  16870. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16871. }
  16872. onConstruct() {
  16873. this.n69 = (this.getChild("n69"));
  16874. this.txtMsg = (this.getChild("txtMsg"));
  16875. this.msgNode = (this.getChild("msgNode"));
  16876. }
  16877. }
  16878. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16879. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16880. static createInstance() {
  16881. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16882. }
  16883. onConstruct() {
  16884. this.n1 = (this.getChild("n1"));
  16885. this.n13 = (this.getChild("n13"));
  16886. this.n14 = (this.getChild("n14"));
  16887. this.n15 = (this.getChild("n15"));
  16888. this.n3 = (this.getChild("n3"));
  16889. this.n4 = (this.getChild("n4"));
  16890. this.n5 = (this.getChild("n5"));
  16891. this.n6 = (this.getChild("n6"));
  16892. this.n7 = (this.getChild("n7"));
  16893. this.n8 = (this.getChild("n8"));
  16894. this.n9 = (this.getChild("n9"));
  16895. this.n10 = (this.getChild("n10"));
  16896. this.n12 = (this.getChild("n12"));
  16897. this.n11 = (this.getChild("n11"));
  16898. this.n16 = (this.getChild("n16"));
  16899. this.n17 = (this.getChild("n17"));
  16900. this.n18 = (this.getChild("n18"));
  16901. this.n20 = (this.getChild("n20"));
  16902. this.n21 = (this.getChild("n21"));
  16903. this.t0 = this.getTransition("t0");
  16904. }
  16905. }
  16906. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16907. class ui_btn5 extends fgui.GButton {
  16908. static createInstance() {
  16909. return (fgui.UIPackage.createObject("loading", "btn5"));
  16910. }
  16911. onConstruct() {
  16912. this.n9 = (this.getChild("n9"));
  16913. this.n1 = (this.getChild("n1"));
  16914. }
  16915. }
  16916. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16917. class ui_UILoading extends fgui.GComponent {
  16918. static createInstance() {
  16919. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16920. }
  16921. onConstruct() {
  16922. this.n12 = (this.getChild("n12"));
  16923. this.loadinfo = (this.getChild("loadinfo"));
  16924. this.n13 = (this.getChild("n13"));
  16925. this.txtLoad = (this.getChild("txtLoad"));
  16926. this.n18 = (this.getChild("n18"));
  16927. }
  16928. }
  16929. ui_UILoading.URL = "ui://37nctnhwphc33";
  16930. class ui_AgeItem extends fgui.GComponent {
  16931. static createInstance() {
  16932. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16933. }
  16934. onConstruct() {
  16935. this.txtAge = (this.getChild("txtAge"));
  16936. }
  16937. }
  16938. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16939. class ui_btn1 extends fgui.GButton {
  16940. static createInstance() {
  16941. return (fgui.UIPackage.createObject("loading", "btn1"));
  16942. }
  16943. onConstruct() {
  16944. this.n6 = (this.getChild("n6"));
  16945. this.n1 = (this.getChild("n1"));
  16946. }
  16947. }
  16948. ui_btn1.URL = "ui://37nctnhwxe622p";
  16949. class ui_btn3 extends fgui.GButton {
  16950. static createInstance() {
  16951. return (fgui.UIPackage.createObject("loading", "btn3"));
  16952. }
  16953. onConstruct() {
  16954. this.n9 = (this.getChild("n9"));
  16955. this.n1 = (this.getChild("n1"));
  16956. }
  16957. }
  16958. ui_btn3.URL = "ui://37nctnhwxe622s";
  16959. class ui_btn2 extends fgui.GButton {
  16960. static createInstance() {
  16961. return (fgui.UIPackage.createObject("loading", "btn2"));
  16962. }
  16963. onConstruct() {
  16964. this.n6 = (this.getChild("n6"));
  16965. this.n1 = (this.getChild("n1"));
  16966. }
  16967. }
  16968. ui_btn2.URL = "ui://37nctnhwxe622t";
  16969. class ui_btnBack extends fgui.GButton {
  16970. static createInstance() {
  16971. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16972. }
  16973. onConstruct() {
  16974. this.n6 = (this.getChild("n6"));
  16975. this.n7 = (this.getChild("n7"));
  16976. }
  16977. }
  16978. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16979. class ui_btnXy1 extends fgui.GButton {
  16980. static createInstance() {
  16981. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16982. }
  16983. onConstruct() {
  16984. this.n1 = (this.getChild("n1"));
  16985. }
  16986. }
  16987. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16988. class ui_btnXy2 extends fgui.GButton {
  16989. static createInstance() {
  16990. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16991. }
  16992. onConstruct() {
  16993. this.n1 = (this.getChild("n1"));
  16994. }
  16995. }
  16996. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16997. class ui_btnXy3 extends fgui.GButton {
  16998. static createInstance() {
  16999. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  17000. }
  17001. onConstruct() {
  17002. this.n1 = (this.getChild("n1"));
  17003. }
  17004. }
  17005. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  17006. class ui_btn4 extends fgui.GButton {
  17007. static createInstance() {
  17008. return (fgui.UIPackage.createObject("loading", "btn4"));
  17009. }
  17010. onConstruct() {
  17011. this.n9 = (this.getChild("n9"));
  17012. this.n1 = (this.getChild("n1"));
  17013. }
  17014. }
  17015. ui_btn4.URL = "ui://37nctnhwxe622z";
  17016. class loadingBinder {
  17017. static bindAll() {
  17018. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  17019. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  17020. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  17021. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  17022. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  17023. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  17024. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  17025. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  17026. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  17027. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  17028. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  17029. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  17030. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  17031. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  17032. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  17033. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  17034. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  17035. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  17036. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  17037. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  17038. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  17039. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  17040. }
  17041. }
  17042. class UIMgr {
  17043. constructor() {
  17044. this._stage = null;
  17045. this._uiList = [];
  17046. this._showList = [];
  17047. this._bindPkgList = [];
  17048. this.uiIndex = 0;
  17049. }
  17050. static get inst() {
  17051. if (UIMgr._inst == null) {
  17052. UIMgr._inst = new UIMgr();
  17053. }
  17054. return UIMgr._inst;
  17055. }
  17056. setStage(s) {
  17057. if (this._stage) {
  17058. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17059. return;
  17060. }
  17061. this._stage = s;
  17062. }
  17063. clearTempData() {
  17064. console.log('zh:clearTempData start');
  17065. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17066. console.log('zh:clearTempData end');
  17067. }
  17068. init() {
  17069. this.setStage(Laya.stage);
  17070. fairygui.UIConfig.defaultFont = "arial";
  17071. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17072. fairygui.UIConfig.packageFileExtension = "obj";
  17073. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17074. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17075. fairygui.GRoot.inst.width = Laya.stage.width;
  17076. fairygui.GRoot.inst.height = Laya.stage.height;
  17077. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17078. }
  17079. addAllUpdate() {
  17080. this.uiIndex = 0;
  17081. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17082. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17083. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17084. }
  17085. }
  17086. }
  17087. bindFUI(pkgname) {
  17088. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17089. return;
  17090. }
  17091. switch (pkgname) {
  17092. case fguiRes.loading:
  17093. fairygui.UIPackage.addPackage(pkgname);
  17094. loadingBinder.bindAll();
  17095. this._bindPkgList.push(pkgname);
  17096. break;
  17097. case fguiRes.game:
  17098. fairygui.UIPackage.addPackage(pkgname);
  17099. gameBinder.bindAll();
  17100. this._bindPkgList.push(pkgname);
  17101. break;
  17102. default:
  17103. break;
  17104. }
  17105. }
  17106. Show(cls, ...param) {
  17107. let nameStr = cls.uiName;
  17108. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17109. let temp = this._uiList[i];
  17110. let str = temp.className;
  17111. if (str == nameStr) {
  17112. if (temp.isMuti) {
  17113. if (temp.isHide) {
  17114. temp.show(...param);
  17115. this._uiList.splice(i, 1);
  17116. this._uiList.push(temp);
  17117. return temp;
  17118. }
  17119. }
  17120. else {
  17121. temp.show(...param);
  17122. this._uiList.splice(i, 1);
  17123. this._uiList.push(temp);
  17124. return temp;
  17125. }
  17126. }
  17127. }
  17128. let ui = new cls();
  17129. ui.className = nameStr;
  17130. this._showUI(ui, param);
  17131. return ui;
  17132. }
  17133. destroyUI(ui) {
  17134. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17135. let temp = this._uiList[i].className;
  17136. if (temp == ui.className) {
  17137. this._uiList.splice(i, 1);
  17138. break;
  17139. }
  17140. }
  17141. this.checkUIState();
  17142. }
  17143. _showUI(ui, param) {
  17144. this._uiList.push(ui);
  17145. ui.show(...param);
  17146. }
  17147. Hide(uiClass) {
  17148. let ui = this.getUI(uiClass);
  17149. if (ui && !ui.isHide) {
  17150. ui.hide();
  17151. }
  17152. }
  17153. getUI(ui) {
  17154. let nameStr = ui.uiName;
  17155. for (let index = 0; index < this._uiList.length; index++) {
  17156. let temp = this._uiList[index];
  17157. if (temp.className == nameStr) {
  17158. return temp;
  17159. }
  17160. }
  17161. return null;
  17162. }
  17163. isShow(cls) {
  17164. for (var i of this._uiList) {
  17165. if (i instanceof cls) {
  17166. return i.isShowing;
  17167. }
  17168. }
  17169. return false;
  17170. }
  17171. showUINum() {
  17172. let num = 0;
  17173. for (var i of this._uiList) {
  17174. if (i.isShowing) {
  17175. num++;
  17176. }
  17177. }
  17178. return num;
  17179. }
  17180. checkUIState() {
  17181. Laya.timer.clear(this, this._uiCheck);
  17182. Laya.timer.once(400, this, this._uiCheck);
  17183. }
  17184. _uiCheck() {
  17185. let showList = [];
  17186. for (var i of this._uiList) {
  17187. if (!i.isHide) {
  17188. showList.push(i);
  17189. }
  17190. }
  17191. for (let index = 0; index < showList.length; index++) {
  17192. if (index == showList.length - 1) {
  17193. showList[index].checkActive(true);
  17194. }
  17195. else {
  17196. showList[index].checkActive(false);
  17197. }
  17198. }
  17199. }
  17200. showTip(msg, time = 600, size = 30) {
  17201. }
  17202. }
  17203. class UIShowList {
  17204. }
  17205. class SoundMgr {
  17206. constructor() {
  17207. this.soundMax = 4;
  17208. this.isLoad = false;
  17209. this.soundMap = {};
  17210. this.isSound = true;
  17211. this.openShake = true;
  17212. SoundMgr._instance = this;
  17213. }
  17214. static getInstance() {
  17215. if (!this._instance) {
  17216. this._instance = new SoundMgr();
  17217. }
  17218. return this._instance;
  17219. }
  17220. init() {
  17221. console.log('zh:sm init 1');
  17222. Laya.SoundManager.autoReleaseSound = true;
  17223. Laya.SoundManager.autoStopMusic = true;
  17224. Laya.SoundManager.musicVolume = 0.3;
  17225. Laya.SoundManager.soundVolume = 0.5;
  17226. this.musicPlayed = false;
  17227. this.audioUrl = "asset/sound/ogg/";
  17228. console.log('zh:sm init 2');
  17229. console.log('zh:dev type ');
  17230. if (Laya.Browser.onAndroid) {
  17231. console.log('zh:dev type android');
  17232. this.audioUrl = "asset/sound/ogg/";
  17233. this.isLoad = true;
  17234. }
  17235. else {
  17236. console.log('zh:dev type not android');
  17237. this.audioUrl = "asset/sound/mp3/";
  17238. this.isLoad = true;
  17239. }
  17240. }
  17241. onSetting(isS) {
  17242. this.isSound = isS;
  17243. this.mute(!this.isSound);
  17244. }
  17245. clearCount() {
  17246. for (var key in this.soundMap) {
  17247. delete this.soundMap[key];
  17248. }
  17249. }
  17250. playMusic(path, loop = 0) {
  17251. console.log('zh:playMusic 1 PATH=' + path);
  17252. this.musicPath = path;
  17253. if (!this.isLoad) {
  17254. return;
  17255. }
  17256. if (!path || path == "") {
  17257. return;
  17258. }
  17259. if (!this.isSound) {
  17260. return;
  17261. }
  17262. this.musicPlayed = true;
  17263. let url = this.getUrl(path);
  17264. if (!Laya.Browser.onAndroid) {
  17265. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17266. this.play(url, loop);
  17267. }));
  17268. }
  17269. else {
  17270. this.play(url, loop);
  17271. }
  17272. }
  17273. play(url, loop) {
  17274. Laya.SoundManager.playMusic(url, loop);
  17275. }
  17276. getUrl(path) {
  17277. let url = this.audioUrl + path;
  17278. if (Laya.Browser.onAndroid) {
  17279. url += ".ogg";
  17280. }
  17281. else {
  17282. url += ".mp3";
  17283. }
  17284. return url;
  17285. }
  17286. pauseMusic(pause) {
  17287. if (pause) {
  17288. this.mute(true);
  17289. }
  17290. else if (this.isSound)
  17291. this.mute(false);
  17292. }
  17293. stopMusic() {
  17294. Laya.SoundManager.stopMusic();
  17295. if (Moyu.isNeedPlatAudio) {
  17296. Moyu.stopMusic();
  17297. }
  17298. }
  17299. mute(mute) {
  17300. if (Moyu.isNeedPlatAudio) {
  17301. Moyu.pauseMusic(mute);
  17302. }
  17303. else {
  17304. Laya.SoundManager.musicMuted = mute;
  17305. if (!mute && !this.musicPlayed && this.musicPath) {
  17306. this.playMusic(this.musicPath);
  17307. }
  17308. }
  17309. }
  17310. stopSound(path) {
  17311. let url = this.getUrl(path);
  17312. Laya.SoundManager.stopSound(url);
  17313. }
  17314. playSound(path, loop = 1, soundMax = this.soundMax) {
  17315. if (!this.isLoad)
  17316. return;
  17317. if (!this.isSound)
  17318. return;
  17319. if (!path || path == "")
  17320. return;
  17321. let url = this.getUrl(path);
  17322. if (Moyu.isNeedPlatAudio) {
  17323. Moyu.playSound(path, loop == 0);
  17324. }
  17325. else {
  17326. let count = 1;
  17327. if (this.soundMap[path])
  17328. count = this.soundMap[path] + 1;
  17329. if (count > soundMax)
  17330. return;
  17331. this.soundMap[path] = count;
  17332. Laya.SoundManager.playSound(url, loop);
  17333. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17334. }
  17335. }
  17336. removePath(path) {
  17337. if (this.soundMap[path]) {
  17338. let count = this.soundMap[path];
  17339. count--;
  17340. if (count < 1)
  17341. delete this.soundMap[path];
  17342. else
  17343. this.soundMap[path] = count;
  17344. }
  17345. }
  17346. playBtnSound() {
  17347. this.playSound("btn");
  17348. }
  17349. playGetSound() {
  17350. }
  17351. playCloseUISound() {
  17352. }
  17353. }
  17354. SoundMgr._instance = null;
  17355. var Handler$1 = Laya.Handler;
  17356. var EResType;
  17357. (function (EResType) {
  17358. EResType[EResType["none"] = 0] = "none";
  17359. EResType[EResType["nromal"] = 1] = "nromal";
  17360. EResType[EResType["td"] = 2] = "td";
  17361. EResType[EResType["sk"] = 3] = "sk";
  17362. })(EResType || (EResType = {}));
  17363. class CResLoader {
  17364. constructor(doneCall, proCall) {
  17365. this.completrCall = doneCall;
  17366. this.progressCall = proCall;
  17367. this.progressHander = new Handler$1(this, this.onProgress);
  17368. this.tdResMap = {};
  17369. }
  17370. load(resList) {
  17371. this.resCount = 0;
  17372. this.loadCount = 0;
  17373. for (let i = 0; i < resList.length; i++) {
  17374. let path = resList[i];
  17375. if (!path)
  17376. continue;
  17377. this.resCount++;
  17378. let type = this.getResType(path);
  17379. if (type == EResType.nromal)
  17380. this.loadNromal(path);
  17381. else if (type == EResType.td)
  17382. this.loadTd(path);
  17383. }
  17384. }
  17385. getRes(path) {
  17386. let type = this.getResType(path);
  17387. if (type == EResType.nromal)
  17388. return Laya.loader.getRes(path);
  17389. else if (type == EResType.td) {
  17390. let res = this.tdResMap[path];
  17391. if (res)
  17392. return res.clone();
  17393. return null;
  17394. }
  17395. }
  17396. destroy() {
  17397. this.progressHander.clear();
  17398. this.progressHander = null;
  17399. }
  17400. clearRes(path) {
  17401. let type = this.getResType(path);
  17402. if (type == EResType.nromal)
  17403. Laya.loader.clearRes(path);
  17404. else if (type == EResType.td) {
  17405. let obj = this.tdResMap[path];
  17406. if (obj)
  17407. obj.destroy();
  17408. delete this.tdResMap[path];
  17409. }
  17410. }
  17411. getResType(path) {
  17412. let exs = this.getExtension(path);
  17413. if (exs == "sk")
  17414. return EResType.sk;
  17415. if (exs == "ls" || exs == "lh" || exs == "lm")
  17416. return EResType.td;
  17417. else
  17418. return EResType.nromal;
  17419. }
  17420. getExtension(res) {
  17421. var index = res.lastIndexOf(".");
  17422. return res.substr(index + 1);
  17423. }
  17424. loadNromal(path) {
  17425. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17426. if (res) {
  17427. this.onLoad();
  17428. }
  17429. else
  17430. console.log("load res fail:" + path);
  17431. }), this.progressHander);
  17432. }
  17433. loadSk() {
  17434. }
  17435. loadTd(path) {
  17436. if (this.tdResMap[path]) {
  17437. this.onLoad();
  17438. return;
  17439. }
  17440. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17441. if (res) {
  17442. this.tdResMap[path] = res;
  17443. this.onLoad();
  17444. }
  17445. else
  17446. console.log("load res fail:" + path);
  17447. }));
  17448. }
  17449. onLoad() {
  17450. this.loadCount++;
  17451. this.onProgress(1);
  17452. if (this.loadCount >= this.resCount) {
  17453. this.completrCall.run();
  17454. }
  17455. }
  17456. onProgress(pro) {
  17457. let progress = (this.loadCount + pro) / this.resCount;
  17458. this.progressCall.runWith(progress);
  17459. }
  17460. }
  17461. var Handler$2 = Laya.Handler;
  17462. class ResInfo {
  17463. constructor() {
  17464. this.index = 0;
  17465. }
  17466. }
  17467. class ResMgr {
  17468. constructor() {
  17469. this.resList = [];
  17470. this.doneList = [];
  17471. this.resMap = {};
  17472. this.currentLoad = null;
  17473. this.completeHandler = new Handler$2(this, this.onComplete);
  17474. this.progressHandler = new Handler$2(this, this.onProgress);
  17475. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17476. }
  17477. static getInstance() {
  17478. if (ResMgr._instance == null) {
  17479. ResMgr._instance = new ResMgr();
  17480. }
  17481. return ResMgr._instance;
  17482. }
  17483. loadList(list, completeHandler, progressHandler) {
  17484. if (list.length < 1) {
  17485. completeHandler.run();
  17486. return;
  17487. }
  17488. let info = this.getResInfo();
  17489. info.resList = list;
  17490. info.completeHandler = completeHandler;
  17491. info.progressHandler = progressHandler;
  17492. this.resList.push(info);
  17493. this.startLoad();
  17494. }
  17495. loadFguiRes(list, completeHandler, progressHandler) {
  17496. Laya.loader.load(list, completeHandler, progressHandler);
  17497. }
  17498. loadAny(list, completeHandler, progressHandler) {
  17499. Laya.loader.load(list, completeHandler, progressHandler);
  17500. }
  17501. load(path, completeHandler, progressHandler) {
  17502. let count = this.resMap[path];
  17503. if (count && count > 0) {
  17504. if (completeHandler)
  17505. completeHandler.run();
  17506. }
  17507. else
  17508. this.loadList([path], completeHandler, progressHandler);
  17509. }
  17510. getRes(path) {
  17511. let res = this.resMap[path];
  17512. if (!res)
  17513. this.showLog("资源不存在:" + path);
  17514. else
  17515. return this.loader.getRes(path);
  17516. }
  17517. clearList(list, force = false) {
  17518. if (!list || list.length < 1)
  17519. return;
  17520. let cr = () => {
  17521. for (const k in list) {
  17522. let v = list[k];
  17523. if (!v)
  17524. continue;
  17525. if (force) {
  17526. this.loader.clearRes(v);
  17527. delete this.resMap[v];
  17528. }
  17529. else {
  17530. let count = this.resMap[v];
  17531. if (count && count > 1) {
  17532. count--;
  17533. this.resMap[v] = count;
  17534. }
  17535. else {
  17536. this.loader.clearRes(v);
  17537. delete this.resMap[v];
  17538. }
  17539. }
  17540. }
  17541. if (!window.hasOwnProperty("ks"))
  17542. Laya.Resource.destroyUnusedResources();
  17543. };
  17544. Laya.timer.clearAll(this);
  17545. Laya.timer.once(2000, this, cr);
  17546. }
  17547. clear3D() {
  17548. for (const k in this.loader.tdResMap) {
  17549. this.loader.clearRes(k);
  17550. if (this.resMap[k])
  17551. delete this.resMap[k];
  17552. }
  17553. if (!window.hasOwnProperty("ks"))
  17554. Laya.Resource.destroyUnusedResources();
  17555. }
  17556. clear(path, force = false) {
  17557. this.clearList([path], force);
  17558. }
  17559. getResInfo() {
  17560. if (this.doneList.length > 0)
  17561. return this.doneList.pop();
  17562. else
  17563. return new ResInfo();
  17564. }
  17565. startLoad() {
  17566. if (this.currentLoad)
  17567. return;
  17568. this.currentLoad = this.resList.pop();
  17569. if (this.currentLoad) {
  17570. this.loader.load(this.currentLoad.resList);
  17571. }
  17572. }
  17573. onComplete() {
  17574. if (!this.currentLoad)
  17575. return;
  17576. for (const k in this.currentLoad.resList) {
  17577. let v = this.currentLoad.resList[k];
  17578. let count = this.resMap[v];
  17579. if (count)
  17580. count++;
  17581. else
  17582. count = 1;
  17583. this.resMap[v] = count;
  17584. }
  17585. if (this.currentLoad.completeHandler)
  17586. this.currentLoad.completeHandler.run();
  17587. this.doneList.push(this.currentLoad);
  17588. this.currentLoad = null;
  17589. this.startLoad();
  17590. }
  17591. onProgress(pro) {
  17592. if (!this.currentLoad)
  17593. return;
  17594. if (this.currentLoad.progressHandler)
  17595. this.currentLoad.progressHandler.runWith(pro);
  17596. }
  17597. showLog(str, ...args) {
  17598. console.log("[ResLoader] " + str);
  17599. }
  17600. }
  17601. ResMgr._instance = null;
  17602. class EventMgr extends Laya.EventDispatcher {
  17603. }
  17604. let eventMgr = new EventMgr();
  17605. /*! *****************************************************************************
  17606. Copyright (c) Microsoft Corporation. All rights reserved.
  17607. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17608. this file except in compliance with the License. You may obtain a copy of the
  17609. License at http://www.apache.org/licenses/LICENSE-2.0
  17610. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17611. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17612. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17613. MERCHANTABLITY OR NON-INFRINGEMENT.
  17614. See the Apache Version 2.0 License for specific language governing permissions
  17615. and limitations under the License.
  17616. ***************************************************************************** */
  17617. /* global Reflect, Promise */
  17618. var extendStatics = function(d, b) {
  17619. extendStatics = Object.setPrototypeOf ||
  17620. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17621. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17622. return extendStatics(d, b);
  17623. };
  17624. function __extends(d, b) {
  17625. extendStatics(d, b);
  17626. function __() { this.constructor = d; }
  17627. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17628. }
  17629. var __assign = function() {
  17630. __assign = Object.assign || function __assign(t) {
  17631. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17632. s = arguments[i];
  17633. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17634. }
  17635. return t;
  17636. };
  17637. return __assign.apply(this, arguments);
  17638. };
  17639. function __rest(s, e) {
  17640. var t = {};
  17641. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17642. t[p] = s[p];
  17643. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17644. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17645. t[p[i]] = s[p[i]];
  17646. return t;
  17647. }
  17648. function __decorate(decorators, target, key, desc) {
  17649. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17650. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17651. 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;
  17652. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17653. }
  17654. function __param(paramIndex, decorator) {
  17655. return function (target, key) { decorator(target, key, paramIndex); }
  17656. }
  17657. function __metadata(metadataKey, metadataValue) {
  17658. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17659. }
  17660. function __awaiter(thisArg, _arguments, P, generator) {
  17661. return new (P || (P = Promise))(function (resolve, reject) {
  17662. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17663. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17664. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17665. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17666. });
  17667. }
  17668. function __generator(thisArg, body) {
  17669. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17670. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17671. function verb(n) { return function (v) { return step([n, v]); }; }
  17672. function step(op) {
  17673. if (f) throw new TypeError("Generator is already executing.");
  17674. while (_) try {
  17675. 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;
  17676. if (y = 0, t) op = [op[0] & 2, t.value];
  17677. switch (op[0]) {
  17678. case 0: case 1: t = op; break;
  17679. case 4: _.label++; return { value: op[1], done: false };
  17680. case 5: _.label++; y = op[1]; op = [0]; continue;
  17681. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17682. default:
  17683. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17684. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17685. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17686. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17687. if (t[2]) _.ops.pop();
  17688. _.trys.pop(); continue;
  17689. }
  17690. op = body.call(thisArg, _);
  17691. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17692. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17693. }
  17694. }
  17695. function __exportStar(m, exports) {
  17696. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17697. }
  17698. function __values(o) {
  17699. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17700. if (m) return m.call(o);
  17701. return {
  17702. next: function () {
  17703. if (o && i >= o.length) o = void 0;
  17704. return { value: o && o[i++], done: !o };
  17705. }
  17706. };
  17707. }
  17708. function __read(o, n) {
  17709. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17710. if (!m) return o;
  17711. var i = m.call(o), r, ar = [], e;
  17712. try {
  17713. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17714. }
  17715. catch (error) { e = { error: error }; }
  17716. finally {
  17717. try {
  17718. if (r && !r.done && (m = i["return"])) m.call(i);
  17719. }
  17720. finally { if (e) throw e.error; }
  17721. }
  17722. return ar;
  17723. }
  17724. function __spread() {
  17725. for (var ar = [], i = 0; i < arguments.length; i++)
  17726. ar = ar.concat(__read(arguments[i]));
  17727. return ar;
  17728. }
  17729. function __await(v) {
  17730. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17731. }
  17732. function __asyncGenerator(thisArg, _arguments, generator) {
  17733. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17734. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17735. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17736. 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); }); }; }
  17737. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17738. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17739. function fulfill(value) { resume("next", value); }
  17740. function reject(value) { resume("throw", value); }
  17741. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17742. }
  17743. function __asyncDelegator(o) {
  17744. var i, p;
  17745. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17746. 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; }
  17747. }
  17748. function __asyncValues(o) {
  17749. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17750. var m = o[Symbol.asyncIterator], i;
  17751. 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);
  17752. 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); }); }; }
  17753. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17754. }
  17755. function __makeTemplateObject(cooked, raw) {
  17756. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17757. return cooked;
  17758. };
  17759. function __importStar(mod) {
  17760. if (mod && mod.__esModule) return mod;
  17761. var result = {};
  17762. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17763. result.default = mod;
  17764. return result;
  17765. }
  17766. function __importDefault(mod) {
  17767. return (mod && mod.__esModule) ? mod : { default: mod };
  17768. }
  17769. class CustomAlert {
  17770. static show(title, content, buttons) {
  17771. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17772. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17773. return;
  17774. }
  17775. const bg = new Laya.Box();
  17776. bg.alpha = 0;
  17777. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17778. Laya.stage.addChild(bg);
  17779. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17780. const panel = new Laya.Box();
  17781. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17782. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17783. bg.addChild(panel);
  17784. const titleText = new Laya.Text();
  17785. titleText.text = title;
  17786. titleText.fontSize = 32;
  17787. titleText.color = "#333333";
  17788. titleText.bold = true;
  17789. titleText.pos(20, 20);
  17790. titleText.width = 360;
  17791. titleText.align = "center";
  17792. panel.addChild(titleText);
  17793. const contentText = new Laya.Text();
  17794. contentText.text = content;
  17795. contentText.fontSize = 21;
  17796. contentText.color = "#555555";
  17797. contentText.pos(20, 70);
  17798. contentText.width = 360;
  17799. contentText.wordWrap = true;
  17800. contentText.align = "center";
  17801. panel.addChild(contentText);
  17802. const buttonContainer = new Laya.Box();
  17803. buttonContainer.pos(20, 160);
  17804. panel.addChild(buttonContainer);
  17805. const btnWidth = 120;
  17806. const spacing = 30;
  17807. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17808. buttons.forEach((btn, index) => {
  17809. const button = new Laya.Button();
  17810. button.label = btn.label;
  17811. button.size(btnWidth, 40);
  17812. button.labelSize = 22;
  17813. button.pos(index * (btnWidth + spacing), 0);
  17814. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17815. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17816. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17817. button.alpha = 0.9;
  17818. });
  17819. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17820. button.alpha = 1;
  17821. });
  17822. button.on(Laya.Event.CLICK, this, () => {
  17823. btn.handler();
  17824. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17825. bg.removeSelf();
  17826. }));
  17827. });
  17828. buttonContainer.addChild(button);
  17829. });
  17830. buttonContainer.x = (panel.width - totalWidth) / 2;
  17831. }
  17832. }
  17833. class ConfigMgr {
  17834. constructor() {
  17835. this.httpReqCount = 4;
  17836. this.httpReqOkCount = 0;
  17837. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17838. try {
  17839. this.httpReqOkCount = 0;
  17840. let reqData = xGame.httpMgr.getReqData();
  17841. console.log('zh:第1个请求getClassicCfg');
  17842. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17843. this.classicCfg = classicCfg;
  17844. this.httpReqOkCount++;
  17845. console.log('zh:第2个请求getLevelCfg');
  17846. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17847. this.levelCfg = levelCfg;
  17848. this.httpReqOkCount++;
  17849. console.log('zh:第3个请求 getPlaceBallCfg');
  17850. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17851. this.placeBallCfg = placeBallCfg;
  17852. this.httpReqOkCount++;
  17853. console.log('zh:第4个请求 npc');
  17854. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17855. this.npcJson = npc.Data;
  17856. this.httpReqOkCount++;
  17857. console.log('zh:所有配置加载完成');
  17858. }
  17859. catch (error) {
  17860. console.error('zh:❌请求失败:', error);
  17861. Laya.timer.once(5000, this, () => {
  17862. let retryCount = 0;
  17863. const maxRetries = 3;
  17864. const tryFetchConfig = () => {
  17865. try {
  17866. xGame.cfgMgr.getConfigFromServer();
  17867. }
  17868. catch (error) {
  17869. if (retryCount < maxRetries) {
  17870. retryCount++;
  17871. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  17872. Laya.timer.once(5000, this, tryFetchConfig);
  17873. }
  17874. else {
  17875. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  17876. }
  17877. }
  17878. };
  17879. tryFetchConfig();
  17880. });
  17881. }
  17882. finally {
  17883. if (this.httpReqCount > this.httpReqOkCount) {
  17884. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  17885. label: "Okay", handler: () => {
  17886. JSBridgeUtils.instance.exitAndCloseGame();
  17887. }
  17888. }]);
  17889. }
  17890. }
  17891. });
  17892. this.sendPostAsync = (action, reqData) => {
  17893. return new Promise((resolve, reject) => {
  17894. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17895. try {
  17896. let code = res.code;
  17897. if (code == 200) {
  17898. const parsedData = JSON.parse(res.msg);
  17899. resolve(parsedData);
  17900. }
  17901. else {
  17902. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17903. reject(new Error(`Request failed with code: ${code}`));
  17904. }
  17905. }
  17906. catch (error) {
  17907. console.error(`ERROR=${error}`);
  17908. alert("Please check your network connection.");
  17909. reject(error);
  17910. }
  17911. finally {
  17912. console.log(`zh:${action}的请求处理完毕`);
  17913. }
  17914. });
  17915. });
  17916. };
  17917. }
  17918. static getInstance() {
  17919. if (!this._instance) {
  17920. this._instance = new ConfigMgr();
  17921. }
  17922. return this._instance;
  17923. }
  17924. init() {
  17925. this.getConfigFromServer();
  17926. }
  17927. test() {
  17928. let reqData = xGame.httpMgr.getReqData();
  17929. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17930. console.log('zh:1s');
  17931. try {
  17932. let code = res.code;
  17933. let data = res.data;
  17934. if (code == 200) {
  17935. const parsedData = JSON.parse(data);
  17936. this.classicCfg = parsedData;
  17937. }
  17938. else {
  17939. console.log('zh:res = ' + JSON.stringify(res));
  17940. }
  17941. }
  17942. catch (error) {
  17943. console.log('error=' + error);
  17944. alert("Please check your network connection.");
  17945. }
  17946. finally {
  17947. console.log('zh:1');
  17948. }
  17949. });
  17950. }
  17951. getUserInfoByIndex(index) {
  17952. return this.npcJson[index];
  17953. }
  17954. getRandomUserInfo() {
  17955. let index = xGame.tools.random(0, this.npcJson.length);
  17956. let rs = this.npcJson[index];
  17957. return rs;
  17958. }
  17959. getMaxBigMoveLength() {
  17960. return Object.keys(this.levelCfg).length;
  17961. }
  17962. getBigMoveLevelByIndex(index) {
  17963. let cfg = this.levelCfg;
  17964. cfg = cfg[index];
  17965. return cfg;
  17966. }
  17967. getRandomClassicLevel() {
  17968. let cfg = this.classicCfg;
  17969. let num = Object.keys(cfg).length;
  17970. let rand = xGame.common.randomNum(1, num);
  17971. return cfg[rand];
  17972. }
  17973. getPlaceBallByLevel(level) {
  17974. return this.placeBallCfg[level];
  17975. }
  17976. getMaxPlaceBall() {
  17977. return Object.keys(this.placeBallCfg).length;
  17978. }
  17979. }
  17980. class PoolD3Mgr {
  17981. constructor() {
  17982. this.pool = {};
  17983. }
  17984. static get ins() {
  17985. return this._ins || (this._ins = new PoolD3Mgr);
  17986. }
  17987. createList(key, prefab, parent) {
  17988. if (!this.pool[key]) {
  17989. this.pool[key] = {};
  17990. this.pool[key].prefab = prefab;
  17991. this.pool[key].list = [];
  17992. this.pool[key].parent = parent;
  17993. }
  17994. }
  17995. getItem(key) {
  17996. if (!this.pool[key]) {
  17997. return;
  17998. }
  17999. let temp;
  18000. if (this.pool[key].list.length > 0) {
  18001. temp = this.pool[key].list.pop();
  18002. }
  18003. else {
  18004. temp = this.pool[key].prefab.clone();
  18005. if (this.pool[key].parent) {
  18006. this.pool[key].parent.addChild(temp);
  18007. }
  18008. }
  18009. temp.active = true;
  18010. return temp;
  18011. }
  18012. putItem(key, obj) {
  18013. if (!this.pool[key]) {
  18014. return;
  18015. }
  18016. obj.active = false;
  18017. this.pool[key].list.push(obj);
  18018. }
  18019. }
  18020. let context$1 = context;
  18021. let uiMgr = UIMgr.inst;
  18022. let soundMgr = SoundMgr.getInstance();
  18023. let resMgr = ResMgr.getInstance();
  18024. let httpMgr = HttpMgr.getInstance();
  18025. let common = Common.getInstance();
  18026. let cfgMgr = ConfigMgr.getInstance();
  18027. let poolD3Mgr = PoolD3Mgr.ins;
  18028. let d3TexUrl = "res/d3Res/";
  18029. let d3ModeUrl = "res/unityRes/";
  18030. function setStageSize(view) {
  18031. if (view.width) {
  18032. view.width = Laya.stage.width;
  18033. view.height = Laya.stage.height;
  18034. }
  18035. }
  18036. function filledBg(view) {
  18037. let wh = Laya.stage.height / Laya.stage.width;
  18038. if (wh > 16 / 9) {
  18039. view.height = Laya.stage.height;
  18040. view.width = Laya.stage.height / 1334 * 750;
  18041. }
  18042. else {
  18043. view.width = Laya.stage.width;
  18044. view.height = Laya.stage.width / 750 * 1334;
  18045. }
  18046. }
  18047. function setNotch(view) {
  18048. if (view.height) {
  18049. view.y += context$1.notchHeight;
  18050. }
  18051. }
  18052. function showTip(str) {
  18053. uiMgr.Show(UIMsg, str);
  18054. }
  18055. function log(...args) {
  18056. console.log(args);
  18057. }
  18058. let xGame = {
  18059. context: context$1,
  18060. eventMgr,
  18061. resMgr,
  18062. uiMgr,
  18063. soundMgr,
  18064. define,
  18065. tools,
  18066. httpMgr,
  18067. d3TexUrl,
  18068. d3ModeUrl,
  18069. common,
  18070. cfgMgr,
  18071. poolD3Mgr,
  18072. setStageSize,
  18073. filledBg,
  18074. setNotch,
  18075. showTip,
  18076. log,
  18077. };
  18078. window["xGame"] = xGame;
  18079. let dataName = 'tBall_';
  18080. class UserData {
  18081. constructor() {
  18082. this.userId = "";
  18083. this.isAgree = false;
  18084. this.coinNum = 0;
  18085. this.gemNum = 0;
  18086. this.sound = true;
  18087. this.vibration = true;
  18088. this.currentDate = 0;
  18089. this.createTime = 0;
  18090. this.awardTime = 0;
  18091. this.roleId = 1;
  18092. this.roleList = [];
  18093. this.roleAds = [];
  18094. this.dressId = 101;
  18095. this.itemId = 201;
  18096. this.bigSkills = [1, 1, 1, 1, 1];
  18097. this.coin = 4000;
  18098. this.diamond = 0;
  18099. this.skillSuccessTimes = 0;
  18100. this.skillGuide = 0;
  18101. this.skillAccTimes = 0;
  18102. this.placeBallData = [];
  18103. this.shareDiamondTimes = 0;
  18104. this.dailyVideoShareTimes = 0;
  18105. this.secretary = [1, 0];
  18106. this.curSecretary = 0;
  18107. this.ballRod = [1, 0, 0, 0, 0, 1];
  18108. this.curBallRod = 5;
  18109. this.signData = 0;
  18110. this.signTime = 0;
  18111. this.drawTimes = 0;
  18112. this.drawAwardTimes = 0;
  18113. this.dailyfreeDrawTimes = 1;
  18114. this.power = 5;
  18115. this.powerTime = 0;
  18116. this.challengeTimes = 0;
  18117. this.extraSign = 0;
  18118. this.classicTimes = 0;
  18119. this.guideHelpLine = 0;
  18120. this.newUser = true;
  18121. this.rootBallFoul = 0;
  18122. this.timeoutFoul = 0;
  18123. this.roleList = [1];
  18124. }
  18125. saveData() {
  18126. let data = {};
  18127. for (let k in this) {
  18128. data[k.toString()] = this[k];
  18129. }
  18130. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18131. }
  18132. getData() {
  18133. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18134. if (ld) {
  18135. let localData = JSON.parse(ld);
  18136. if (localData) {
  18137. for (let k in this) {
  18138. let key = k.toString();
  18139. let data = localData[key];
  18140. if (data != undefined) {
  18141. this[k] = data;
  18142. }
  18143. }
  18144. }
  18145. }
  18146. }
  18147. }
  18148. class ItemData {
  18149. constructor() {
  18150. this.itemList = {};
  18151. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18152. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18153. }
  18154. saveData() {
  18155. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18156. }
  18157. getData() {
  18158. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18159. if (ld) {
  18160. let localData = JSON.parse(ld);
  18161. if (localData) {
  18162. this.itemList = localData;
  18163. }
  18164. }
  18165. }
  18166. }
  18167. class GameData {
  18168. constructor() {
  18169. this.curLevel = 0;
  18170. this.gameType = 1;
  18171. this.signIdx = 0;
  18172. this.signMax = 0;
  18173. this.rotaryTime = 0;
  18174. this.rotaryCount = 0;
  18175. this.rotaryList = [];
  18176. this.diyCount = 3;
  18177. this.awardIdx = 0;
  18178. this.shareNum = 2;
  18179. this.rankWeek = 0;
  18180. this.rankScore = 0;
  18181. this.gameCount = 0;
  18182. this.trySkill = -1;
  18183. this.tryTime = 0;
  18184. }
  18185. saveData() {
  18186. let data = {};
  18187. for (let k in this) {
  18188. data[k.toString()] = this[k];
  18189. }
  18190. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18191. }
  18192. getData() {
  18193. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18194. if (ld) {
  18195. let localData = JSON.parse(ld);
  18196. if (localData) {
  18197. for (let k in this) {
  18198. let key = k.toString();
  18199. let data = localData[key];
  18200. if (data != undefined) {
  18201. this[k] = data;
  18202. }
  18203. }
  18204. }
  18205. }
  18206. }
  18207. }
  18208. class Diy2025GameData {
  18209. constructor() {
  18210. this.challengeMode_overLev = 0;
  18211. this.xszyForClassic = false;
  18212. this.xszyForChallenge = false;
  18213. }
  18214. saveData() {
  18215. let data = {};
  18216. for (let k in this) {
  18217. data[k.toString()] = this[k];
  18218. }
  18219. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18220. }
  18221. getData() {
  18222. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18223. if (ld) {
  18224. let localData = JSON.parse(ld);
  18225. if (localData) {
  18226. for (let k in this) {
  18227. let key = k.toString();
  18228. let data = localData[key];
  18229. if (data != undefined) {
  18230. this[k] = data;
  18231. }
  18232. }
  18233. }
  18234. }
  18235. }
  18236. }
  18237. class DataMgr {
  18238. static Init() {
  18239. this.userData = new UserData();
  18240. this.gameData = new GameData();
  18241. this.itemData = new ItemData();
  18242. this.diyGameData = new Diy2025GameData();
  18243. this.userData.getData();
  18244. this.gameData.getData();
  18245. this.itemData.getData();
  18246. this.diyGameData.getData();
  18247. this.roleId = this.userData.roleId;
  18248. this.resetUse();
  18249. }
  18250. static isNewDay() {
  18251. Moyu.isNewDay(this, (isnew) => {
  18252. xGame.common.isNewDay = isnew;
  18253. if (!isnew)
  18254. return;
  18255. DataMgr.setShareDiamondTimes(0, false);
  18256. DataMgr.setDailyVideoShareTimes(0, false);
  18257. DataMgr.setDailyfreeDrawTimes(1);
  18258. DataMgr.setExtraSign(0);
  18259. });
  18260. }
  18261. static deletData() {
  18262. Laya.LocalStorage.clear();
  18263. }
  18264. static upRankData() {
  18265. let num = xGame.common.getAllStarNum();
  18266. if (num > 0)
  18267. Moyu.upRankData(xGame.common.curRankID, num);
  18268. }
  18269. static addItem(id, count = 1) {
  18270. let v = this.itemData.itemList[id];
  18271. if (!v)
  18272. v = { id: id, count: count, adnum: 0, active: true };
  18273. else {
  18274. if (v.active) {
  18275. v.count += count;
  18276. }
  18277. else {
  18278. v.count = count;
  18279. v.active = true;
  18280. }
  18281. }
  18282. this.itemData.itemList[id] = v;
  18283. xGame.soundMgr.playGetSound();
  18284. this.saveItemData();
  18285. }
  18286. static hasItem(id) {
  18287. let v = this.itemData.itemList[id];
  18288. if (v && v.active)
  18289. return true;
  18290. return false;
  18291. }
  18292. static getItem(id) {
  18293. let v = this.itemData.itemList[id];
  18294. return v;
  18295. }
  18296. static getItemCount(id) {
  18297. let v = this.itemData.itemList[id];
  18298. if (v && v.active)
  18299. return v.count;
  18300. return 0;
  18301. }
  18302. static getItemAd(id) {
  18303. let v = this.itemData.itemList[id];
  18304. if (v) {
  18305. return v.adnum;
  18306. }
  18307. return 0;
  18308. }
  18309. static onItemAd(id, num = 1) {
  18310. let v = this.itemData.itemList[id];
  18311. if (!v)
  18312. v = { id: id, count: 1, adnum: num, active: false };
  18313. else
  18314. v.adnum += num;
  18315. this.itemData.itemList[id] = v;
  18316. this.saveItemData();
  18317. }
  18318. static costItem(id, count) {
  18319. let v = this.itemData.itemList[id];
  18320. if (v && v.active) {
  18321. if (v.count < count)
  18322. return false;
  18323. else {
  18324. v.count -= count;
  18325. this.itemData.itemList[id] = v;
  18326. return true;
  18327. }
  18328. }
  18329. return false;
  18330. }
  18331. static resetUse() {
  18332. this.dressId = this.userData.dressId;
  18333. this.itemId = this.userData.itemId;
  18334. }
  18335. static passLevel() {
  18336. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18337. this.gameData.curLevel++;
  18338. this.curLevel = this.gameData.curLevel;
  18339. this.saveGameData();
  18340. }
  18341. static useRole(id) {
  18342. this.roleId = id;
  18343. if (this.hasRole(id)) {
  18344. this.userData.roleId = id;
  18345. this.saveUserData();
  18346. }
  18347. }
  18348. static addRole(id) {
  18349. if (this.hasRole(id))
  18350. return;
  18351. this.userData.roleList.push(id);
  18352. this.saveUserData();
  18353. }
  18354. static hasRole(id) {
  18355. return this.userData.roleList.indexOf(id) >= 0;
  18356. }
  18357. static gemEnough(num) {
  18358. return this.userData.gemNum >= num;
  18359. }
  18360. static roleHasAd(id) {
  18361. let count = this.userData.roleAds[id];
  18362. if (count != undefined && count >= 0)
  18363. return true;
  18364. else
  18365. return false;
  18366. }
  18367. static saveUserData(time = 500, event, arg) {
  18368. if (this.userSaving)
  18369. return;
  18370. this.userSaving = true;
  18371. Laya.timer.once(time, this, () => {
  18372. this.userSaving = false;
  18373. this.userData.saveData();
  18374. if (event)
  18375. xGame.eventMgr.event(event, arg);
  18376. });
  18377. }
  18378. static updateUserNickName(loginUserName) {
  18379. let kyeStr = 'moyudata_180';
  18380. console.log('zh:################### kyeStr=' + kyeStr);
  18381. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18382. if (moyudata) {
  18383. const obj = JSON.parse(moyudata);
  18384. obj.nickName = loginUserName;
  18385. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18386. console.log('zh:################### updateUserNickName');
  18387. }
  18388. }
  18389. static saveGameData() {
  18390. if (this.gameSaving)
  18391. return;
  18392. this.gameSaving = true;
  18393. Laya.timer.once(1000, this, () => {
  18394. this.gameSaving = false;
  18395. this.gameData.saveData();
  18396. });
  18397. }
  18398. static saveItemData() {
  18399. let fun = () => {
  18400. this.itemData.saveData();
  18401. };
  18402. Laya.timer.clear(this, fun);
  18403. Laya.timer.once(500, this, fun);
  18404. }
  18405. static saveData() {
  18406. this.saveUserData();
  18407. this.saveGameData();
  18408. }
  18409. static getBigSkillList() {
  18410. return this.userData.bigSkills;
  18411. }
  18412. static getBigSkillByIndex(index) {
  18413. return this.userData.bigSkills[index];
  18414. }
  18415. static setBigSkill(index, val, addUp = true) {
  18416. if (addUp) {
  18417. this.userData.bigSkills[index] += val;
  18418. }
  18419. else {
  18420. this.userData.bigSkills[index] = val;
  18421. }
  18422. this.saveUserData();
  18423. }
  18424. static coinEnough(need) {
  18425. if (typeof need != "number") {
  18426. console.error("金币格式错误");
  18427. return;
  18428. }
  18429. return this.userData.coin >= need;
  18430. }
  18431. static setCoin(val) {
  18432. if (typeof val != "number") {
  18433. return;
  18434. }
  18435. this.userData.coin += val;
  18436. this.saveUserData();
  18437. xGame.eventMgr.event(COIN_CHANGE);
  18438. this.updateUserInfo2Server("jb");
  18439. }
  18440. static setCoin2(val) {
  18441. if (typeof val != "number") {
  18442. return;
  18443. }
  18444. this.userData.coin = val;
  18445. this.saveUserData();
  18446. xGame.eventMgr.event(COIN_CHANGE);
  18447. }
  18448. static setCoinFormServer(val) {
  18449. if (typeof val != "number") {
  18450. return;
  18451. }
  18452. this.userData.coin = val;
  18453. this.saveUserData();
  18454. console.log('zh:通知更新金币变化' + val);
  18455. xGame.eventMgr.event(COIN_CHANGE);
  18456. }
  18457. static getCoin() {
  18458. return this.userData.coin;
  18459. }
  18460. static diamondEnough(need) {
  18461. if (typeof need != "number") {
  18462. console.error("金币格式错误");
  18463. return;
  18464. }
  18465. return this.userData.diamond >= need;
  18466. }
  18467. static setDiamond(val) {
  18468. if (typeof val != "number") {
  18469. return;
  18470. }
  18471. this.userData.diamond += val;
  18472. this.saveUserData();
  18473. xGame.eventMgr.event(DIAMOND_CHANGE);
  18474. this.updateUserInfo2Server("zs");
  18475. }
  18476. static setDiamond2(val) {
  18477. if (typeof val != "number") {
  18478. return;
  18479. }
  18480. this.userData.diamond = val;
  18481. this.saveUserData();
  18482. xGame.eventMgr.event(DIAMOND_CHANGE);
  18483. }
  18484. static setDiamondFormServer(val) {
  18485. if (typeof val != "number") {
  18486. return;
  18487. }
  18488. this.userData.diamond = val;
  18489. this.saveUserData();
  18490. console.log('zh:通知更新钻石变化' + val);
  18491. xGame.eventMgr.event(DIAMOND_CHANGE);
  18492. }
  18493. static getDiamond() {
  18494. return this.userData.diamond;
  18495. }
  18496. static getSkillSuccessTimes() {
  18497. return this.userData.skillSuccessTimes;
  18498. }
  18499. static setSkillSuccessTimes(val, addUp = true) {
  18500. if (addUp)
  18501. this.userData.skillSuccessTimes += val;
  18502. else
  18503. this.userData.skillSuccessTimes = val;
  18504. this.saveUserData();
  18505. }
  18506. static getSkillAccTimes() {
  18507. return this.userData.skillAccTimes;
  18508. }
  18509. static setSkillAccTimes(val) {
  18510. this.userData.skillAccTimes += val;
  18511. this.saveUserData();
  18512. }
  18513. static getSkillGuide() {
  18514. if (!xGame.common.openGuide) {
  18515. return 1;
  18516. }
  18517. return this.userData.skillGuide;
  18518. }
  18519. static setSkillGuide(val) {
  18520. this.userData.skillGuide = val;
  18521. this.saveUserData();
  18522. }
  18523. static getPlaceBallLevelList() {
  18524. return this.userData.placeBallData;
  18525. }
  18526. static setPlaceBallLevelList(objStr) {
  18527. if (objStr) {
  18528. let obj = JSON.parse(objStr);
  18529. this.userData.placeBallData = obj;
  18530. let cd = obj.length;
  18531. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18532. xGame.common.placeBallCurLevel = cd;
  18533. DataMgr.setChallengeMode_overLev(cd);
  18534. this.saveUserData();
  18535. }
  18536. else {
  18537. this.userData.placeBallData = [];
  18538. this.saveUserData();
  18539. }
  18540. }
  18541. static getPlaceBallLevel(level) {
  18542. let arr = this.userData.placeBallData;
  18543. let index = level - 1;
  18544. let out;
  18545. if (arr[index]) {
  18546. out = arr[index];
  18547. }
  18548. else {
  18549. let max = arr.length;
  18550. if (max == index) {
  18551. out = {
  18552. star: 0,
  18553. play: true,
  18554. isCur: true,
  18555. getAward: false
  18556. };
  18557. }
  18558. else {
  18559. out = {
  18560. star: 0,
  18561. play: false,
  18562. getAward: false
  18563. };
  18564. }
  18565. }
  18566. return out;
  18567. }
  18568. static setPlaceBallLevel(level, star) {
  18569. let arr = this.userData.placeBallData;
  18570. let index = level - 1;
  18571. if (arr[index]) {
  18572. arr[index].star = Math.max(arr[index].star, star);
  18573. }
  18574. else {
  18575. let max = arr.length;
  18576. if (max == index) {
  18577. arr.push({
  18578. star: star,
  18579. play: true,
  18580. getAward: false
  18581. });
  18582. }
  18583. else {
  18584. console.error("关卡存储出错");
  18585. }
  18586. }
  18587. this.saveUserData();
  18588. }
  18589. static setPlaceBallAward(level) {
  18590. let arr = this.userData.placeBallData;
  18591. let index = level - 1;
  18592. if (arr[index]) {
  18593. arr[index].getAward = true;
  18594. }
  18595. this.saveUserData();
  18596. }
  18597. static getShareDiamondTimes() {
  18598. return this.userData.shareDiamondTimes;
  18599. }
  18600. static setShareDiamondTimes(val, addUp = true) {
  18601. if (addUp) {
  18602. this.userData.shareDiamondTimes += val;
  18603. }
  18604. else {
  18605. this.userData.shareDiamondTimes = val;
  18606. }
  18607. this.saveUserData();
  18608. }
  18609. static getDailyVideoShareTimes() {
  18610. return this.userData.dailyVideoShareTimes;
  18611. }
  18612. static setDailyVideoShareTimes(val, addUp = true) {
  18613. if (addUp) {
  18614. this.userData.dailyVideoShareTimes += val;
  18615. }
  18616. else {
  18617. this.userData.dailyVideoShareTimes = val;
  18618. }
  18619. this.saveUserData();
  18620. }
  18621. static getSecretary(index) {
  18622. return this.userData.secretary[index];
  18623. }
  18624. static setSecretary(index, val) {
  18625. this.userData.secretary[index] = val;
  18626. this.saveUserData();
  18627. }
  18628. static getCurSecretary() {
  18629. return this.userData.curSecretary;
  18630. }
  18631. static setCurSecretary(index) {
  18632. this.userData.curSecretary = index;
  18633. this.saveUserData();
  18634. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18635. }
  18636. static getBallRod(index) {
  18637. return this.userData.ballRod[index];
  18638. }
  18639. static setBallRod(index, val) {
  18640. this.userData.ballRod[index] = val;
  18641. this.saveUserData();
  18642. }
  18643. static setBallRodFormServer(haveQiuGanJsonStr) {
  18644. if (!haveQiuGanJsonStr) {
  18645. console.log("setBallRodFormServer数据为空或未定义");
  18646. return;
  18647. }
  18648. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18649. const keys = Object.keys(haveQiuGanJsonObj);
  18650. keys.forEach(key => {
  18651. let v = haveQiuGanJsonObj[key];
  18652. let k = parseInt(key);
  18653. let idx = k - 1;
  18654. this.userData.ballRod[idx] = v;
  18655. });
  18656. }
  18657. static getCurBallRod() {
  18658. return this.userData.curBallRod;
  18659. }
  18660. static setCurBallRod(index) {
  18661. this.userData.curBallRod = index;
  18662. this.saveUserData();
  18663. }
  18664. static setSignData(val) {
  18665. this.userData.signData = val;
  18666. this.saveUserData();
  18667. }
  18668. static getSignData() {
  18669. return this.userData.signData;
  18670. }
  18671. static setSignTime(val) {
  18672. this.userData.signTime = val;
  18673. this.saveUserData();
  18674. }
  18675. static getSignTime() {
  18676. return this.userData.signTime;
  18677. }
  18678. static getDrawTimes() {
  18679. return this.userData.drawTimes;
  18680. }
  18681. static setDrawTimes(val, addUp = true) {
  18682. if (addUp) {
  18683. this.userData.drawTimes += val;
  18684. }
  18685. else {
  18686. this.userData.drawTimes = val;
  18687. }
  18688. this.saveUserData();
  18689. }
  18690. static getDrawAwardTimes() {
  18691. return this.userData.drawAwardTimes;
  18692. }
  18693. static setDrawAwardTimes(val) {
  18694. this.userData.drawAwardTimes = val;
  18695. this.saveUserData();
  18696. }
  18697. static getDailyfreeDrawTimes() {
  18698. return this.userData.dailyfreeDrawTimes;
  18699. }
  18700. static setDailyfreeDrawTimes(val) {
  18701. this.userData.dailyfreeDrawTimes = val;
  18702. this.saveUserData();
  18703. }
  18704. static setPower(val, addUp = true) {
  18705. if (addUp)
  18706. this.userData.power += val;
  18707. else
  18708. this.userData.power = val;
  18709. if (this.userData.power >= xGame.common.maxPower) {
  18710. this.userData.power = xGame.common.maxPower;
  18711. }
  18712. xGame.eventMgr.event(POWER_CHANGE, val);
  18713. this.saveUserData();
  18714. }
  18715. static getPower() {
  18716. return this.userData.power;
  18717. }
  18718. static setPowerTime(val) {
  18719. this.userData.powerTime = val;
  18720. this.saveUserData();
  18721. }
  18722. static getPowerTime() {
  18723. return this.userData.powerTime;
  18724. }
  18725. static powerEnough() {
  18726. return this.getPower() > 0;
  18727. }
  18728. static getChallengeTimes() {
  18729. return this.userData.challengeTimes;
  18730. }
  18731. static setChallengeTimes(val) {
  18732. this.userData.challengeTimes += val;
  18733. this.saveUserData();
  18734. }
  18735. static getExtraSign() {
  18736. return this.userData.extraSign;
  18737. }
  18738. static setExtraSign(val) {
  18739. this.userData.extraSign = val;
  18740. this.saveUserData();
  18741. }
  18742. static getClassicTimes() {
  18743. return this.userData.classicTimes;
  18744. }
  18745. static setClassicTimes() {
  18746. this.userData.classicTimes += 1;
  18747. this.saveUserData();
  18748. }
  18749. static getGuideHelpLine() {
  18750. return this.userData.guideHelpLine;
  18751. }
  18752. static setGuideHelpLine() {
  18753. this.userData.guideHelpLine = 1;
  18754. this.saveUserData();
  18755. }
  18756. static getNewUser() {
  18757. return this.userData.newUser;
  18758. }
  18759. static setNewUser() {
  18760. this.userData.newUser = false;
  18761. this.saveUserData();
  18762. }
  18763. static getRootBallFoul() {
  18764. return this.userData.rootBallFoul;
  18765. }
  18766. static setRootBallFoul() {
  18767. this.userData.rootBallFoul = 1;
  18768. this.saveUserData();
  18769. }
  18770. static getTimeoutFoul() {
  18771. return this.userData.timeoutFoul;
  18772. }
  18773. static setTimeoutFoul() {
  18774. this.userData.timeoutFoul = 1;
  18775. this.saveUserData();
  18776. }
  18777. static saveDiyGameData() {
  18778. if (this.diyGameSaving)
  18779. return;
  18780. this.diyGameSaving = true;
  18781. Laya.timer.once(500, this, () => {
  18782. this.diyGameSaving = false;
  18783. this.diyGameData.saveData();
  18784. });
  18785. }
  18786. static getChallengeMode_overLev() {
  18787. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18788. return this.challengeMode_overLev;
  18789. }
  18790. static setChallengeMode_overLev(levNum) {
  18791. this.diyGameData.challengeMode_overLev = levNum;
  18792. this.saveDiyGameData();
  18793. }
  18794. static updateUserInfo2Server(type, count = 0) {
  18795. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18796. if (userInfoData == null) {
  18797. return;
  18798. }
  18799. let reqData = xGame.httpMgr.getReqData();
  18800. let rd = JSON.parse(reqData);
  18801. rd.dataType = type;
  18802. let dataValue = 0;
  18803. if (type == "zs") {
  18804. dataValue = this.getDiamond();
  18805. }
  18806. if (type == "jb") {
  18807. dataValue = this.getCoin();
  18808. }
  18809. rd.dataValue = dataValue;
  18810. reqData = JSON.stringify(rd);
  18811. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18812. try {
  18813. let code = res.code;
  18814. let data = res.data;
  18815. if (code == 401) {
  18816. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18817. console.log('zh:保存资产信息失败,请重新登录 ');
  18818. return;
  18819. }
  18820. if (code == 200) {
  18821. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18822. }
  18823. else {
  18824. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18825. }
  18826. }
  18827. catch (error) {
  18828. console.log('error=' + error);
  18829. alert("Please check your network connection.");
  18830. }
  18831. finally {
  18832. }
  18833. });
  18834. }
  18835. static getUserZiChanInfo(winTip = false) {
  18836. console.log('zh:getUserZCI');
  18837. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18838. console.log('zh:userInfoData=' + userInfoData);
  18839. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  18840. if (winTip) {
  18841. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18842. }
  18843. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18844. return;
  18845. }
  18846. let reqData = xGame.httpMgr.getReqData();
  18847. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18848. try {
  18849. let code = res.code;
  18850. let msg = res.msg;
  18851. if (code == 401) {
  18852. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18853. if (winTip) {
  18854. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18855. }
  18856. return;
  18857. }
  18858. if (code == 200) {
  18859. let d = res.data;
  18860. let zuanShi = d.zuanShi;
  18861. let jinBi = d.jinBi;
  18862. let haveQiuGanJson = d.haveQiuGanJson;
  18863. let signData = d.signData;
  18864. let placeBallData = d.placeBallData;
  18865. DataMgr.setDiamondFormServer(zuanShi);
  18866. DataMgr.setCoinFormServer(jinBi);
  18867. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18868. DataMgr.setPlaceBallLevelList(placeBallData);
  18869. if (signData && signData > 0) {
  18870. DataMgr.setSignData(signData);
  18871. }
  18872. }
  18873. else {
  18874. console.log("zh:更新用户资产信息error" + msg);
  18875. if (winTip) {
  18876. xGame.uiMgr.Show(UIMsg, msg);
  18877. }
  18878. }
  18879. }
  18880. catch (error) {
  18881. console.log('error=' + error);
  18882. if (winTip) {
  18883. alert(error);
  18884. }
  18885. }
  18886. finally {
  18887. console.log("zh:更新用户资产信息结束");
  18888. }
  18889. });
  18890. }
  18891. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18892. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18893. console.log('zh:updateLocalUserData=' + userInfo);
  18894. if (userInfo != null) {
  18895. if (!userInfo.buySpids) {
  18896. userInfo.buySpids = { 1: false, 7: false };
  18897. }
  18898. else {
  18899. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18900. }
  18901. userInfo.buySpids[spid] = isBuyOk;
  18902. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18903. }
  18904. else {
  18905. }
  18906. }
  18907. static loadUserSpOrderForAd() {
  18908. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18909. if (userInfo == null) {
  18910. return;
  18911. }
  18912. console.log('zh:重新加载更新广告权利');
  18913. let reqData = xGame.httpMgr.getReqData();
  18914. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  18915. try {
  18916. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  18917. let code = res.code;
  18918. let msg = res.msg;
  18919. if (code == 401) {
  18920. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18921. return;
  18922. }
  18923. if (code == 200) {
  18924. let data = res.data;
  18925. let buy_spid1 = false;
  18926. let buy_spid7 = false;
  18927. for (let index = 0; index < data.length; index++) {
  18928. let element = data[index];
  18929. console.log('zh:list element.spid = ' + element.spid);
  18930. if (element.spid == 1) {
  18931. buy_spid1 = true;
  18932. }
  18933. if (element.spid == 7) {
  18934. buy_spid7 = true;
  18935. }
  18936. }
  18937. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  18938. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  18939. }
  18940. else {
  18941. }
  18942. }
  18943. catch (error) {
  18944. console.log('error=' + error);
  18945. alert(error);
  18946. }
  18947. finally {
  18948. }
  18949. });
  18950. }
  18951. }
  18952. DataMgr.isNewUser = false;
  18953. DataMgr.fristEnter = true;
  18954. DataMgr.levelType = 0;
  18955. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  18956. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  18957. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  18958. DataMgr.challengeMode_overLev = 0;
  18959. DataMgr.xszyForClassic = false;
  18960. DataMgr.xszyForChallenge = false;
  18961. DataMgr.awardId = 0;
  18962. DataMgr.awardCoin = 0;
  18963. DataMgr.sceneId = -1;
  18964. DataMgr.tryId = 0;
  18965. DataMgr.curLevel = 1;
  18966. DataMgr.vipLevel = 0;
  18967. DataMgr.maxLevel = 0;
  18968. DataMgr.awardRatio = 1;
  18969. DataMgr.gameList = [];
  18970. DataMgr.rankList = [];
  18971. DataMgr.recoverTime = 480000;
  18972. DataMgr.minScore = 0;
  18973. DataMgr.rankDis = 0;
  18974. DataMgr.userSaving = false;
  18975. DataMgr.gameSaving = false;
  18976. DataMgr.diyGameSaving = false;
  18977. class D3Tween extends Laya.Script3D {
  18978. constructor() {
  18979. super();
  18980. this.isInited = false;
  18981. }
  18982. ;
  18983. init() {
  18984. if (this.isInited)
  18985. return;
  18986. this.isInited = true;
  18987. this.gameObj = this.owner;
  18988. this.transform = this.gameObj.transform;
  18989. }
  18990. get rotX() {
  18991. return this.transform.localRotationEulerX;
  18992. }
  18993. set rotX(v) {
  18994. this.transform.localRotationEulerX = v;
  18995. }
  18996. get rotY() {
  18997. return this.transform.localRotationEulerY;
  18998. }
  18999. set rotY(v) {
  19000. this.transform.localRotationEulerY = v;
  19001. }
  19002. get rotZ() {
  19003. return this.transform.localRotationEulerZ;
  19004. }
  19005. set rotZ(v) {
  19006. this.transform.localRotationEulerZ = v;
  19007. }
  19008. get posX() {
  19009. return this.transform.localPositionX;
  19010. }
  19011. set posX(v) {
  19012. this.transform.localPositionX = v;
  19013. }
  19014. get posY() {
  19015. return this.transform.localPositionY;
  19016. }
  19017. set posY(v) {
  19018. this.transform.localPositionY = v;
  19019. }
  19020. get posZ() {
  19021. return this.transform.localPositionZ;
  19022. }
  19023. set posZ(v) {
  19024. this.transform.localPositionZ = v;
  19025. }
  19026. get rotation() {
  19027. return this.transform.localRotation;
  19028. }
  19029. set rotation(v) {
  19030. this.transform.localRotation = v;
  19031. }
  19032. }
  19033. class D2Hole extends Laya.Script {
  19034. constructor() { super(); }
  19035. onTriggerEnter(collider) {
  19036. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19037. return;
  19038. }
  19039. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19040. if (collider.owner["mySrc"].isRunSkillAni) {
  19041. return;
  19042. }
  19043. if (collider.owner["mySrc"].number != 0) {
  19044. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19045. }
  19046. xGame.common.ballColliHole(collider);
  19047. xGame.common.recoverCameraView();
  19048. }
  19049. }
  19050. }
  19051. class Table extends Laya.Script3D {
  19052. constructor() {
  19053. super();
  19054. this.isSetBorder = false;
  19055. this.inited = false;
  19056. }
  19057. ;
  19058. onAwake() {
  19059. this.init();
  19060. }
  19061. init() {
  19062. if (this.inited)
  19063. return;
  19064. this.inited = true;
  19065. this.gameObj = this.owner;
  19066. this.border = this.gameObj.getChildByName("border");
  19067. }
  19068. setBorderPos() {
  19069. if (this.isSetBorder)
  19070. return;
  19071. this.isSetBorder = true;
  19072. let ui = xGame.common.gameUI.ui;
  19073. let bar1 = this.border.getChildByName("bar1");
  19074. let bar2 = this.border.getChildByName("bar2");
  19075. let bar3 = this.border.getChildByName("bar3");
  19076. let bar4 = this.border.getChildByName("bar4");
  19077. let bar5 = this.border.getChildByName("bar5");
  19078. let bar6 = this.border.getChildByName("bar6");
  19079. this.setInfo(bar1, ui.border.bar1, "box");
  19080. this.setInfo(bar2, ui.border.bar2, "box");
  19081. this.setInfo(bar3, ui.border.bar3, "box");
  19082. this.setInfo(bar4, ui.border.bar4, "box");
  19083. this.setInfo(bar5, ui.border.bar5, "box");
  19084. this.setInfo(bar6, ui.border.bar6, "box");
  19085. let circle1 = this.border.getChildByName("circle1");
  19086. let circle2 = this.border.getChildByName("circle2");
  19087. let circle3 = this.border.getChildByName("circle3");
  19088. let circle4 = this.border.getChildByName("circle4");
  19089. let circle5 = this.border.getChildByName("circle5");
  19090. let circle6 = this.border.getChildByName("circle6");
  19091. this.setInfo(circle1, ui.border.circle1, "circle");
  19092. this.setInfo(circle2, ui.border.circle2, "circle");
  19093. this.setInfo(circle3, ui.border.circle3, "circle");
  19094. this.setInfo(circle4, ui.border.circle4, "circle");
  19095. this.setInfo(circle5, ui.border.circle5, "circle");
  19096. this.setInfo(circle6, ui.border.circle6, "circle");
  19097. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19098. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19099. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19100. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19101. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19102. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19103. let arr = xGame.common.gameMgr.holePosList;
  19104. xGame.common.gameMgr.posObj = {
  19105. "1": arr[0],
  19106. "3": arr[2],
  19107. "4": arr[3],
  19108. "6": arr[5]
  19109. };
  19110. }
  19111. initHolePos(x, y) {
  19112. if (x < 300)
  19113. x += 25;
  19114. else if (x > 1000)
  19115. x -= 25;
  19116. else if (y > 200)
  19117. y -= 10;
  19118. else
  19119. y += 10;
  19120. if (y < 200)
  19121. y += 30;
  19122. else if (y > 500)
  19123. y -= 30;
  19124. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19125. }
  19126. setInfo(d3Obj, d2Obj, type) {
  19127. let ui = xGame.common.gameUI.ui;
  19128. let sprite = new Laya.Sprite();
  19129. ui.border.displayObject.addChild(sprite);
  19130. let colli = xGame.common.getCollider(type);
  19131. sprite.addComponentIntance(colli);
  19132. let rigy = xGame.common.getRigbody();
  19133. rigy.type = "static";
  19134. sprite.addComponentIntance(rigy);
  19135. let d3Pos = d3Obj.transform.position;
  19136. xGame.common.pos3to2Convert(d3Pos);
  19137. let scaleX = d3Obj.transform.localScaleX;
  19138. let scaleZ = d3Obj.transform.localScaleZ;
  19139. let width = xGame.common.scale3to2Convert(scaleZ);
  19140. let height = xGame.common.scale3to2Convert(scaleX);
  19141. sprite.pivotX = width / 2;
  19142. sprite.pivotY = height / 2;
  19143. sprite.x = d3Pos.x;
  19144. sprite.y = d3Pos.y;
  19145. sprite.width = width;
  19146. sprite.height = height;
  19147. d2Obj.x = d3Pos.x;
  19148. d2Obj.y = d3Pos.y;
  19149. d2Obj.width = width;
  19150. d2Obj.height = height;
  19151. if (type == "box") {
  19152. colli.width = width;
  19153. colli.height = height;
  19154. colli.isSensor = false;
  19155. colli.label = "border";
  19156. }
  19157. else {
  19158. colli.radius = width / 2;
  19159. colli.isSensor = true;
  19160. colli.label = "hole";
  19161. sprite.addComponent(D2Hole);
  19162. }
  19163. }
  19164. }
  19165. class D3World extends Laya.Script3D {
  19166. constructor() {
  19167. super();
  19168. this.loadNum = 0;
  19169. this.setLoadNum = 7;
  19170. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19171. }
  19172. onAwake() {
  19173. }
  19174. loadScene() {
  19175. this.scene = this.owner;
  19176. let url = `res/unityRes/root.lh`;
  19177. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19178. this.scene.addChild(prefab);
  19179. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19180. this.putCameraInfo();
  19181. this.camera.enableHDR = false;
  19182. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19183. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19184. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19185. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19186. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19187. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19188. this.knife.active = false;
  19189. this.loadD3Obj();
  19190. }));
  19191. }
  19192. putCameraInfo() {
  19193. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19194. this.cameraObj = new cameraType();
  19195. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19196. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19197. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19198. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19199. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19200. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19201. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19202. this.visitAngleChild.init();
  19203. this.visitRootObj.posX = this.visitAngleChild.posX;
  19204. this.visitRootObj.posY = this.visitAngleChild.posY;
  19205. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19206. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19207. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19208. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19209. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19210. xGame.common.showOneCamera("mainCamera");
  19211. }
  19212. loadD3Obj() {
  19213. this.loadTable();
  19214. this.loadRoom();
  19215. this.loadInHoleParticial();
  19216. this.loadIceParticial();
  19217. this.loadHitParticial();
  19218. this.loadFireworksParticial();
  19219. this.loadBall();
  19220. }
  19221. loadInHoleParticial() {
  19222. this.loadD3Res("inHoleEft", "", (prefab) => {
  19223. prefab.addComponent(Partical);
  19224. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19225. });
  19226. }
  19227. loadIceParticial() {
  19228. this.loadD3Res("iceEft", "", (prefab) => {
  19229. prefab.addComponent(Partical);
  19230. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19231. });
  19232. }
  19233. loadHitParticial() {
  19234. this.loadD3Res("hitEft", "", (prefab) => {
  19235. prefab.addComponent(Partical);
  19236. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19237. });
  19238. }
  19239. loadFireworksParticial() {
  19240. this.loadD3Res("fireworksEft", "", (prefab) => {
  19241. prefab.addComponent(Partical);
  19242. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19243. });
  19244. }
  19245. loadBall(index = 1) {
  19246. this.loadD3Res("ball", index, (prefab) => {
  19247. this.ballPrefab = prefab;
  19248. this.ballPrefab.addComponent(Ball);
  19249. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19250. });
  19251. }
  19252. loadTable(index = 1) {
  19253. this.loadD3Res("table", index, (prefab) => {
  19254. this.tableSrc = prefab.addComponent(Table);
  19255. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19256. this.d3Hand.init();
  19257. this.tableRoot.addChild(prefab);
  19258. });
  19259. }
  19260. loadRoom(index = 1) {
  19261. this.loadD3Res("room", index, (prefab) => {
  19262. this.roomRoot.addChild(prefab);
  19263. });
  19264. }
  19265. loadD3Res(type, index, callback) {
  19266. let url = `res/unityRes/${type}${index}.lh`;
  19267. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19268. callback && callback(prefab);
  19269. this.checkResLoad();
  19270. }));
  19271. }
  19272. checkResLoad() {
  19273. this.loadNum++;
  19274. if (this.loadNum >= this.setLoadNum) {
  19275. xGame.eventMgr.event(D3RES_LOADED);
  19276. }
  19277. }
  19278. prePlayEft() {
  19279. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19280. eft.transform.localPositionX = 0;
  19281. eft.transform.localPositionY = -5;
  19282. eft.transform.localPositionZ = 0;
  19283. eft.active = true;
  19284. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19285. ice.transform.localPositionX = 0;
  19286. ice.transform.localPositionY = -5;
  19287. ice.transform.localPositionZ = 0;
  19288. ice.active = true;
  19289. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19290. hit.transform.localPositionX = 0;
  19291. hit.transform.localPositionY = -5;
  19292. hit.transform.localPositionZ = 0;
  19293. hit.active = true;
  19294. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19295. fireworks.transform.localPositionX = 0;
  19296. fireworks.transform.localPositionY = -5;
  19297. fireworks.transform.localPositionZ = 0;
  19298. fireworks.active = true;
  19299. }
  19300. }
  19301. class cameraType {
  19302. }
  19303. class MoyuMgr$1 {
  19304. static initMoyu() {
  19305. this.moyuView = new MoyuView$1();
  19306. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19307. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19308. this.moyuView.ui.displayObject.zOrder = 1000;
  19309. this.moyuView.init();
  19310. this.moyuView.showTip(true);
  19311. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19312. window['XApk'] = this;
  19313. }
  19314. static showAge(show) {
  19315. if (this.moyuView)
  19316. this.moyuView.showAge(show);
  19317. }
  19318. static onPlatMsg(idx) {
  19319. if (!MoyuMgr$1.moyuView)
  19320. return;
  19321. if (idx == '0') {
  19322. MoyuMgr$1.moyuView.showTip(false);
  19323. }
  19324. }
  19325. static showAgree(call) {
  19326. if (this.moyuView)
  19327. this.moyuView.showAgree(call);
  19328. else
  19329. call && call();
  19330. }
  19331. static showXy(type = 1) {
  19332. if (this.moyuView)
  19333. this.moyuView.showXy(type);
  19334. }
  19335. }
  19336. MoyuMgr$1.isAdvise = false;
  19337. class MoyuView$1 {
  19338. constructor() {
  19339. this.ysxyNum = 1;
  19340. this.ysJson = null;
  19341. this.ui = ui_UIMoyu.createInstance();
  19342. }
  19343. init() {
  19344. this.ui.mainBg.visible = false;
  19345. this.ui.xyNode.visible = false;
  19346. this.ui.ageNode.visible = false;
  19347. this.ui.tipNode.visible = false;
  19348. this.ui.rnNode.visible = false;
  19349. this.ui.fcmNode.visible = false;
  19350. this.ui.ageTip.visible = false;
  19351. this.ui.msgNode.visible = false;
  19352. this.ui.visible = false;
  19353. this.ui.xyNode.xyList.setVirtual();
  19354. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19355. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19356. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19357. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19358. this.ui.xyNode.btnKnown.visible = false;
  19359. this.ui.xyNode.xy1.visible = false;
  19360. this.ui.xyNode.xy2.visible = false;
  19361. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19362. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19363. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19364. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19365. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19366. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19367. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19368. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19369. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19370. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19371. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19372. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19373. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19374. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19375. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19376. this.ysxyNum = 2;
  19377. }
  19378. }
  19379. onClick(obj) {
  19380. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19381. switch (obj) {
  19382. case this.ui.ageTip:
  19383. if (Moyu.isTTApk) {
  19384. this.ui.ageNode.visible = true;
  19385. this.ui.mainBg.visible = true;
  19386. }
  19387. break;
  19388. case this.ui.tipNode:
  19389. this.showTip(false);
  19390. break;
  19391. case this.ui.ageNode.btnAge:
  19392. this.ui.ageNode.visible = false;
  19393. this.ui.mainBg.visible = false;
  19394. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19395. this.ui.visible = false;
  19396. break;
  19397. case this.ui.xyNode.btnXy3:
  19398. case this.ui.xyNode.btnXy1:
  19399. this.loadXy(1);
  19400. break;
  19401. case this.ui.xyNode.btnXy2:
  19402. this.loadXy(2);
  19403. break;
  19404. case this.ui.xyNode.btnBack:
  19405. this.ui.xyNode.xy1.visible = true;
  19406. this.ui.xyNode.xy2.visible = false;
  19407. break;
  19408. case this.ui.xyNode.btnKnown:
  19409. this.ui.xyNode.visible = false;
  19410. this.ui.mainBg.visible = false;
  19411. this.ui.visible = false;
  19412. break;
  19413. case this.ui.rnNode.btnCheck:
  19414. this.check();
  19415. break;
  19416. case this.ui.rnNode.btnExit:
  19417. case this.ui.xyNode.btnNo:
  19418. this.ysxyNum--;
  19419. if (this.ysxyNum > 0)
  19420. this.showMsg("Refuse to quit the game once again");
  19421. else {
  19422. Moyu.userAgree(false);
  19423. Moyu.exit();
  19424. }
  19425. break;
  19426. case this.ui.xyNode.btnSure:
  19427. case this.ui.xyNode.btnYes:
  19428. DataMgr.userData.isAgree = true;
  19429. DataMgr.saveUserData();
  19430. this.onAgree();
  19431. break;
  19432. case this.ui.rnNode.btnDone:
  19433. this.ui.rnNode.visible = false;
  19434. this.ui.visible = false;
  19435. break;
  19436. case this.ui.fcmNode.btnRn:
  19437. this.showRn();
  19438. break;
  19439. }
  19440. }
  19441. showTip(show) {
  19442. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19443. return;
  19444. if (show) {
  19445. MoyuMgr$1.isAdvise = true;
  19446. this.ui.visible = true;
  19447. this.ui.tipNode.visible = true;
  19448. this.ui.tipNode.alpha = 1;
  19449. Laya.timer.once(1000, this, this.showTip, [false]);
  19450. }
  19451. else {
  19452. this.ui.tipNode.alpha = 1;
  19453. this.ui.tipNode.visible = true;
  19454. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19455. this.ui.tipNode.visible = false;
  19456. MoyuMgr$1.isAdvise = false;
  19457. }), 1000);
  19458. }
  19459. }
  19460. showAge(show, px = 0, py = 0) {
  19461. if (Moyu.platType > 10 && !Moyu.isIos) {
  19462. this.ui.ageTip.x = px;
  19463. this.ui.ageTip.y = py;
  19464. this.ui.ageTip.visible = show;
  19465. if (show)
  19466. this.ui.visible = true;
  19467. }
  19468. }
  19469. showAgree(call) {
  19470. this.agreeCall = call;
  19471. this.onAgree();
  19472. return;
  19473. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19474. this.showXy(0);
  19475. }
  19476. else
  19477. this.onAgree();
  19478. }
  19479. onAgree() {
  19480. if (!this.ui.ageNode.visible)
  19481. this.ui.visible = false;
  19482. this.ui.xyNode.visible = false;
  19483. Moyu.userAgree(true);
  19484. this.showAge(false);
  19485. this.agreeCall && this.agreeCall();
  19486. this.showRn();
  19487. }
  19488. showMsg(txt) {
  19489. this.ui.msgNode.txtMsg.text = txt;
  19490. this.ui.msgNode.visible = true;
  19491. this.ui.msgNode.alpha = 1;
  19492. this.ui.visible = true;
  19493. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19494. this.ui.msgNode.visible = false;
  19495. }), 2500, true);
  19496. }
  19497. showRn() {
  19498. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19499. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19500. this.ui.rnNode.rn1.visible = true;
  19501. this.ui.rnNode.rn2.visible = false;
  19502. this.ui.rnNode.rn3.visible = false;
  19503. this.ui.rnNode.rn4.visible = false;
  19504. this.ui.rnNode.visible = true;
  19505. this.ui.mainBg.visible = true;
  19506. this.ui.rnNode.btnDone.visible = false;
  19507. this.ui.rnNode.btnExit.visible = true;
  19508. this.ui.rnNode.btnCheck.visible = true;
  19509. this.ui.fcmNode.visible = false;
  19510. this.ui.visible = true;
  19511. return;
  19512. }
  19513. }
  19514. this.showFcm();
  19515. }
  19516. showFcm() {
  19517. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19518. Moyu.initFCM(true);
  19519. if (Moyu.gameTime < 1)
  19520. this.fcmLoop();
  19521. else if (Moyu.gameTime < 999)
  19522. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19523. }
  19524. }
  19525. fcmLoop() {
  19526. if (Moyu.gameTime < 1) {
  19527. this.ui.rnNode.visible = false;
  19528. this.ui.fcmNode.visible = true;
  19529. this.ui.mainBg.visible = true;
  19530. this.ui.visible = true;
  19531. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19532. Laya.timer.clear(this.ui, this.fcmLoop);
  19533. }
  19534. }
  19535. check() {
  19536. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19537. this.ui.rnNode.rn1.visible = false;
  19538. this.ui.rnNode.rn2.visible = false;
  19539. this.ui.rnNode.rn4.visible = true;
  19540. }
  19541. else if (this.ui.rnNode.rn4.visible) {
  19542. let name = this.ui.rnNode.inputName.text;
  19543. let code = this.ui.rnNode.inputCode.text;
  19544. if (code && code.length == 18) {
  19545. this.ui.rnNode.rn1.visible = false;
  19546. this.ui.rnNode.rn4.visible = false;
  19547. Moyu.authenticate(name, code, (res) => {
  19548. this.ui.rnNode.rn2.visible = !res;
  19549. this.ui.rnNode.rn3.visible = res;
  19550. this.ui.rnNode.btnDone.visible = res;
  19551. this.ui.rnNode.btnExit.visible = !res;
  19552. this.ui.rnNode.btnCheck.visible = !res;
  19553. if (res)
  19554. this.showFcm();
  19555. });
  19556. }
  19557. else
  19558. this.showMsg("信息填写不完整");
  19559. }
  19560. }
  19561. loadXy(type = 0) {
  19562. this.ui.xyNode.xy1.visible = false;
  19563. this.ui.xyNode.xy2.visible = true;
  19564. this.ui.xyNode.xyList.scrollToView(0);
  19565. if (type == 1) {
  19566. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19567. }
  19568. else if (type == 2) {
  19569. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19570. }
  19571. }
  19572. showXy(type = 0) {
  19573. this.xyBtn();
  19574. if (type == 0) {
  19575. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19576. this.ui.xyNode.btnSure.visible = true;
  19577. }
  19578. else {
  19579. this.ui.xyNode.btnYes.visible = true;
  19580. this.ui.xyNode.btnNo.visible = true;
  19581. }
  19582. }
  19583. else {
  19584. this.ui.xyNode.btnKnown.visible = true;
  19585. this.ui.mainBg.visible = true;
  19586. }
  19587. this.ui.xyNode.xy1.visible = true;
  19588. this.ui.xyNode.xy2.visible = false;
  19589. this.ui.xyNode.visible = true;
  19590. this.ui.visible = true;
  19591. }
  19592. xyBtn() {
  19593. this.ui.xyNode.btnSure.visible = false;
  19594. this.ui.xyNode.btnYes.visible = false;
  19595. this.ui.xyNode.btnNo.visible = false;
  19596. this.ui.xyNode.btnKnown.visible = false;
  19597. {
  19598. this.ui.xyNode.btnXy3.visible = false;
  19599. this.ui.xyNode.btnXy2.visible = true;
  19600. this.ui.xyNode.btnXy1.visible = true;
  19601. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19602. }
  19603. }
  19604. createXY(json) {
  19605. this.ysJson = json.content;
  19606. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19607. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19608. this.ui.xyNode.xy2.visible = true;
  19609. }
  19610. renderListItem(idx, cell) {
  19611. let xy = this.ysJson[idx];
  19612. cell.height = xy.line * 30;
  19613. cell.xyItem.text = xy.text;
  19614. }
  19615. onDestroy() {
  19616. this.agreeCall = null;
  19617. }
  19618. }
  19619. class UILoading extends UIBase {
  19620. constructor() {
  19621. super();
  19622. this.accTime = 0;
  19623. this.curNum = 0;
  19624. this.rate = 1;
  19625. this.loadSubOk = false;
  19626. this.loadResOK = false;
  19627. this.openLoading = true;
  19628. this.beginLoadRes = false;
  19629. this.finishD2 = false;
  19630. this.finishD3 = false;
  19631. }
  19632. onConstructor() {
  19633. this.ui = ui_UILoading.createInstance();
  19634. this.contentPane = this.ui;
  19635. this.isEject = false;
  19636. this._initUI();
  19637. this._addEvent();
  19638. }
  19639. _initUI() {
  19640. MoyuMgr$1.initMoyu();
  19641. }
  19642. _addEvent() {
  19643. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19644. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19645. }
  19646. show() {
  19647. super.show();
  19648. console.log('zh:加载分包资源');
  19649. loadSubRes(this.subResProgress.bind(this));
  19650. this.ui.txtLoad.text = "Loading...";
  19651. this.setGlobalFont(this.ui);
  19652. }
  19653. subResProgress(pro, finish) {
  19654. this.curNum = pro;
  19655. if (finish) {
  19656. this.curNum = 1;
  19657. this.loadSubOk = true;
  19658. }
  19659. }
  19660. laodD3Res() {
  19661. let scene3D = new Laya.Scene3D();
  19662. xGame.common.d3Scene = scene3D;
  19663. xGame.common.d3World = scene3D.addComponent(D3World);
  19664. xGame.common.d3World.loadScene();
  19665. }
  19666. loadD2Res() {
  19667. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19668. this.finishD2 = true;
  19669. this.checkLoadAll();
  19670. this.curNum = 1;
  19671. }), Laya.Handler.create(this, (pro) => {
  19672. this.curNum = pro;
  19673. }, null, false));
  19674. }
  19675. d3ResFinish() {
  19676. this.finishD3 = true;
  19677. this.checkLoadAll();
  19678. }
  19679. checkLoadAll() {
  19680. if (this.finishD2 && this.finishD3) {
  19681. this.loadResOK = true;
  19682. }
  19683. }
  19684. loadRes() {
  19685. this.laodD3Res();
  19686. this.loadD2Res();
  19687. }
  19688. myUpdate(dt) {
  19689. if (!this.openLoading)
  19690. return;
  19691. this.accTime += dt * this.rate;
  19692. if (this.accTime >= this.curNum)
  19693. this.accTime = this.curNum;
  19694. this.ui.loadinfo.value = this.accTime * 100;
  19695. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19696. if (!this.beginLoadRes) {
  19697. this.beginLoadRes = true;
  19698. this.ui.txtLoad.text = "Loading...";
  19699. this.curNum = 0;
  19700. this.accTime = 0;
  19701. this.loadRes();
  19702. }
  19703. if (this.loadResOK) {
  19704. this.openLoading = false;
  19705. Laya.timer.once(300, this, () => {
  19706. xGame.common.d3Scene.active = false;
  19707. MoyuMgr$1.showAgree(enterGame);
  19708. });
  19709. }
  19710. }
  19711. }
  19712. release() {
  19713. }
  19714. hide() {
  19715. super.hide();
  19716. this.release();
  19717. }
  19718. onClose() {
  19719. this.hide();
  19720. }
  19721. }
  19722. UILoading.uiName = "UILoading";
  19723. class UIRepentProp$1 extends UIBase {
  19724. constructor() {
  19725. super();
  19726. this.viewType = 0;
  19727. this.regretType = 0;
  19728. }
  19729. onConstructor() {
  19730. this.ui = ui_UIRepentProp.createInstance();
  19731. this.contentPane = this.ui;
  19732. this.isEject = false;
  19733. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19734. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19735. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19736. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19737. }
  19738. show(viewType, regretType, callback) {
  19739. PlatMgr.showInsert(true);
  19740. this.viewType = viewType;
  19741. this.regretType = regretType;
  19742. this.callback = callback;
  19743. super.show();
  19744. this.ui.t0.play();
  19745. this.ui.c1.selectedIndex = this.viewType;
  19746. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19747. if (this.viewType == 0) {
  19748. let guide = DataMgr.getGuideHelpLine();
  19749. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19750. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19751. }
  19752. xGame.common.gameMgr.gamePause = true;
  19753. this.setGlobalFont(this.ui);
  19754. }
  19755. hideSelf() {
  19756. xGame.common.gameMgr.gamePause = false;
  19757. this.callback && this.callback(false);
  19758. this.hide();
  19759. }
  19760. videoRegret() {
  19761. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19762. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19763. }
  19764. else {
  19765. console.log('zh:AD 失败,直接发放奖励');
  19766. this.qjff_AD_for_UIrepentProp_videoRegret();
  19767. }
  19768. }
  19769. qjff_AD_for_UIrepentProp_videoRegret() {
  19770. this.callback && this.callback(true);
  19771. this.hideSelf();
  19772. }
  19773. videoAddHelpLine() {
  19774. let guide = DataMgr.getGuideHelpLine();
  19775. if (guide == 0) {
  19776. this.callback && this.callback(true);
  19777. this.hideSelf();
  19778. DataMgr.setGuideHelpLine();
  19779. xGame.common.gameUI.ui.guideNode.visible = false;
  19780. }
  19781. else {
  19782. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19783. if (Laya.Browser.onAndroid) {
  19784. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19785. if (!boo) {
  19786. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19787. return;
  19788. }
  19789. }
  19790. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19791. }
  19792. else {
  19793. console.log('zh:AD 失败,直接发放奖励');
  19794. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19795. }
  19796. }
  19797. }
  19798. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19799. this.callback && this.callback(true);
  19800. this.hideSelf();
  19801. }
  19802. }
  19803. UIRepentProp$1.uiName = "UIRepentProp";
  19804. class UIRodMethod$1 extends UIBase {
  19805. constructor() {
  19806. super();
  19807. this.isPressd = false;
  19808. }
  19809. onConstructor() {
  19810. this.ui = ui_UIRodMethod.createInstance();
  19811. this.contentPane = this.ui;
  19812. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19813. this.moveDir = new Laya.Vector2();
  19814. this.moveDest = new Laya.Vector2();
  19815. this.centerPos = new Laya.Vector2();
  19816. xGame.common.uiRodMethod = this;
  19817. }
  19818. show() {
  19819. super.show();
  19820. xGame.common.gameMgr.gamePause = true;
  19821. this.openPressDotEvent();
  19822. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19823. this.centerPos.x = this.ui.white.x;
  19824. this.centerPos.y = this.ui.white.y;
  19825. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19826. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19827. this.setDot();
  19828. this.setGlobalFont(this.ui);
  19829. }
  19830. setDot() {
  19831. this.ui.dot.x = this.moveDest.x;
  19832. this.ui.dot.y = this.moveDest.y;
  19833. }
  19834. closeSelf() {
  19835. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19836. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19837. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19838. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19839. xGame.common.gameMgr.gamePause = false;
  19840. this.hide();
  19841. }
  19842. openPressDotEvent() {
  19843. this.closePressDotEvent();
  19844. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19845. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19846. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19847. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19848. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19849. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19850. }
  19851. closePressDotEvent() {
  19852. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19853. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19854. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19855. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19856. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19857. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19858. }
  19859. onDown(e) {
  19860. if (e.type == Laya.Event.MOUSE_DOWN)
  19861. this.isPressd = true;
  19862. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19863. this.isPressd = false;
  19864. if (!this.isPressd)
  19865. return;
  19866. this.moveDest.x = e.stageX;
  19867. this.moveDest.y = e.stageY;
  19868. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19869. if (dis > 6724) {
  19870. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19871. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19872. }
  19873. this.setDot();
  19874. }
  19875. resetRod() {
  19876. this.ui.dot.x = this.ui.white.x;
  19877. this.ui.dot.y = this.ui.white.y;
  19878. this.gameRod.dot.x = this.gameRod.bg.x;
  19879. this.gameRod.dot.y = this.gameRod.bg.y;
  19880. xGame.common.rodOffest.x = 0;
  19881. xGame.common.rodOffest.y = 0;
  19882. }
  19883. }
  19884. UIRodMethod$1.uiName = "UIRodMethod";
  19885. class UIMsg$1 extends UIBase {
  19886. constructor() {
  19887. super();
  19888. }
  19889. onConstructor() {
  19890. this.ui = ui_UIMsg.createInstance();
  19891. this.contentPane = this.ui;
  19892. this.isEject = false;
  19893. this.isMuti = true;
  19894. }
  19895. show(msg, callback) {
  19896. super.show();
  19897. this.ui.tipsNode.msgTxt.text = msg;
  19898. this.ui.alpha = 1;
  19899. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19900. this.hide();
  19901. callback && callback();
  19902. }), 1000);
  19903. this.setGlobalFont(this.ui);
  19904. }
  19905. }
  19906. UIMsg$1.uiName = "UIMsg";
  19907. class UITips$1 extends UIBase {
  19908. constructor() {
  19909. super();
  19910. this.type = 0;
  19911. }
  19912. onConstructor() {
  19913. this.ui = ui_UITips.createInstance();
  19914. this.contentPane = this.ui;
  19915. this.isEject = false;
  19916. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  19917. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  19918. }
  19919. show(tipsTxt, womanTxt, type) {
  19920. super.show();
  19921. this.ui.t0.play();
  19922. this.ui.myNode.tipsTxt.text = tipsTxt;
  19923. this.ui.myNode.womanTxt.text = womanTxt;
  19924. PlatMgr.showInsert(true);
  19925. this.ui.myNode.c1.selectedIndex = type;
  19926. this.type = type;
  19927. switch (this.type) {
  19928. case TipsType.exitGame:
  19929. xGame.common.gameMgr.gamePause = true;
  19930. break;
  19931. case TipsType.foul:
  19932. Laya.timer.once(200, this, () => {
  19933. xGame.common.gameMgr.gamePause = true;
  19934. });
  19935. break;
  19936. default:
  19937. break;
  19938. }
  19939. this.setGlobalFont(this.ui);
  19940. }
  19941. clickLeftBtn() {
  19942. this.hide();
  19943. xGame.common.gameMgr.gamePause = false;
  19944. switch (this.type) {
  19945. case TipsType.exitGame:
  19946. break;
  19947. case TipsType.foul:
  19948. break;
  19949. default:
  19950. break;
  19951. }
  19952. }
  19953. clickRightBtn() {
  19954. this.hide();
  19955. switch (this.type) {
  19956. case TipsType.exitGame:
  19957. xGame.eventMgr.event(RESET_GAME);
  19958. xGame.uiMgr.Show(UIMain$1);
  19959. Moyu.recordEnd(this, null);
  19960. xGame.common.longHelpLine = false;
  19961. break;
  19962. case TipsType.foul:
  19963. xGame.common.gameMgr.gamePause = false;
  19964. Laya.timer.clearAll(this);
  19965. break;
  19966. default:
  19967. break;
  19968. }
  19969. }
  19970. }
  19971. UITips$1.uiName = "UITips";
  19972. class UIGame$1 extends UIBase {
  19973. constructor() {
  19974. super();
  19975. this.powerNum = 0;
  19976. this.isD3Inited = false;
  19977. this.isPrePlay = false;
  19978. this.isMoveRod = false;
  19979. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  19980. this.rulerDis = 20;
  19981. this.rulerOffset = 0;
  19982. }
  19983. onConstructor() {
  19984. this.ui = ui_UIGame.createInstance();
  19985. this.contentPane = this.ui;
  19986. this.ui.x += xGame.common.sysOffestNum;
  19987. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  19988. this.isEject = false;
  19989. xGame.common.gameUI = this;
  19990. this.initSelf();
  19991. }
  19992. isTurnSelf() {
  19993. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  19994. return true;
  19995. }
  19996. }
  19997. initSelf() {
  19998. let topUI = this.ui.topNode;
  19999. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20000. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20001. this.barInfo = {};
  20002. this.barInfo.curY = 0;
  20003. this.barInfo.height = this.ui.powerNode.height;
  20004. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20005. this.barInfo.powerStartY = this.ui.powerNode.y;
  20006. xGame.common.aiPlayer = new AIPlayer();
  20007. xGame.common.gameMgr = new GameMgr();
  20008. xGame.common.skillMgr = new SkillMgr();
  20009. xGame.common.wordsMgr = new WordsMgr();
  20010. xGame.common.talkMgr = new TalkMgr();
  20011. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20012. });
  20013. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20014. });
  20015. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20016. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20017. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20018. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20019. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20020. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20021. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20022. }
  20023. getGanZiImg() {
  20024. let index = DataMgr.getCurBallRod();
  20025. let data = cfgTable.ballrodData[index + 1];
  20026. let gan_url = xGame.common.getGameIconUrl(data.img);
  20027. this.ui.powerNode.showImg.url = gan_url;
  20028. }
  20029. returnHome() {
  20030. let tips = "Are you sure to exit the game?";
  20031. let woman = "Boss, why don't you play for a while longer?";
  20032. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20033. }
  20034. addRodMethodClick() {
  20035. if (this.isTurnSelf()) {
  20036. xGame.uiMgr.Show(UIRodMethod$1);
  20037. }
  20038. }
  20039. clickHelpLineBtn(force = false) {
  20040. if (!this.isTurnSelf())
  20041. return;
  20042. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20043. if (success) {
  20044. xGame.common.longHelpLine = true;
  20045. xGame.common.d2World.getHelpLine();
  20046. Moyu.sendDataEvent("guideNum");
  20047. }
  20048. else {
  20049. }
  20050. });
  20051. }
  20052. renderSelfDisplayBalls(index, target) {
  20053. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20054. target.myImg.url = xGame.common.getGameIconUrl(str);
  20055. }
  20056. renderAIDisplayBalls(index, target) {
  20057. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20058. target.myImg.url = xGame.common.getGameIconUrl(str);
  20059. ;
  20060. }
  20061. updateMode() {
  20062. if (xGame.common.gameMode == GameMode.classic) {
  20063. this.ui.topNode.scoreNode.visible = false;
  20064. }
  20065. else if (xGame.common.gameMode == GameMode.bigMove) {
  20066. this.ui.topNode.scoreNode.visible = true;
  20067. }
  20068. }
  20069. show() {
  20070. super.show();
  20071. this.ui.alpha = 0;
  20072. this.updateSelf();
  20073. xGame.common.gameMgr.gamePause = false;
  20074. xGame.common.gameUI.ui.blackAni.visible = false;
  20075. xGame.common.gameUI.ui.whiteAni.visible = false;
  20076. this.ui.powerEft.visible = false;
  20077. this.ui.colorNode.visible = false;
  20078. this.updateHead();
  20079. let curUse = DataMgr.getCurBallRod();
  20080. this.getGanZiImg();
  20081. this.setGlobalFont(this.ui);
  20082. }
  20083. updateSelf() {
  20084. if (xGame.common.gameMode == GameMode.classic) {
  20085. this.ui.c1.selectedIndex = 0;
  20086. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20087. this.ui.topNode.middleNode.visible = true;
  20088. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20089. }
  20090. else if (xGame.common.gameMode == GameMode.bigMove) {
  20091. this.ui.c1.selectedIndex = 0;
  20092. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20093. this.ui.topNode.middleNode.visible = false;
  20094. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20095. let rand = xGame.common.randomNum(1, max);
  20096. let guide = DataMgr.getSkillGuide();
  20097. if (guide == 0)
  20098. rand = 1;
  20099. xGame.common.bigMoveLevelIndex = rand;
  20100. }
  20101. else if (xGame.common.gameMode == GameMode.placeBall) {
  20102. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20103. this.ui.c1.selectedIndex = 1 + data.type;
  20104. this.ui.alpha = 1;
  20105. this.startGame();
  20106. }
  20107. this.updateMode();
  20108. this.initD3world();
  20109. this.initD2world();
  20110. }
  20111. startGame() {
  20112. this.ui.snowNode.visible = Math.random() <= 0.1;
  20113. this.ui.d2Node.visible = false;
  20114. xGame.common.d3World.d3Hand.gameObj.active = false;
  20115. xGame.common.d3World.tableSrc.init();
  20116. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20117. this.cameraViewChange(() => {
  20118. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20119. switch (xGame.common.gameMode) {
  20120. case GameMode.classic:
  20121. xGame.common.d3World.d3Hand.gameObj.active = true;
  20122. this.playPutBallD3Ani();
  20123. break;
  20124. case GameMode.bigMove:
  20125. this.enterGame();
  20126. Laya.timer.once(500, this, () => {
  20127. this.ui.topNode.middleNode.visible = true;
  20128. this.ui.topNode.middleNode.t0.play();
  20129. });
  20130. break;
  20131. case GameMode.placeBall:
  20132. this.enterGame();
  20133. break;
  20134. default:
  20135. break;
  20136. }
  20137. });
  20138. PlatMgr.showBanner(false);
  20139. }
  20140. enterGame() {
  20141. this.ui.d2Node.visible = true;
  20142. xGame.common.d3World.d3Hand.gameObj.active = false;
  20143. xGame.common.showOneCamera("mainCamera");
  20144. Moyu.recordGame(30, true);
  20145. if (!this.isPrePlay) {
  20146. this.isPrePlay = true;
  20147. xGame.common.d3World.prePlayEft();
  20148. }
  20149. xGame.common.gameMgr.gameReady();
  20150. this.openAllEvent();
  20151. this.ui.snowNode.visible = false;
  20152. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20153. this.ui.helpBtn.visible = condition;
  20154. }
  20155. showHelpLineGuide() {
  20156. let longGuide = DataMgr.getGuideHelpLine();
  20157. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20158. this.ui.helpBtn.visible = true;
  20159. this.ui.guideNode.visible = true;
  20160. }
  20161. }
  20162. setTurnAlpha(alpha) {
  20163. this.ui.keduNode.alpha = alpha;
  20164. this.ui.ganNode.alpha = alpha;
  20165. this.ui.rodMethodNode.alpha = alpha;
  20166. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20167. }
  20168. cameraViewChange(callback) {
  20169. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20170. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20171. xGame.common.showOneCamera("visitAngle");
  20172. cameraSrc.localRotationEulerY = 180;
  20173. cameraSrc.localRotationEulerZ = 0;
  20174. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20175. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20176. callback && callback();
  20177. }));
  20178. }));
  20179. }
  20180. playPutBallD3Ani() {
  20181. xGame.common.showOneCamera("mainCamera");
  20182. let handSrc = xGame.common.d3World.d3Hand;
  20183. handSrc.gameObj.active = true;
  20184. handSrc.transform.localPositionZ = 3;
  20185. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20186. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20187. handSrc.gameObj.active = false;
  20188. this.enterGame();
  20189. }), 400);
  20190. }));
  20191. }
  20192. updateHead() {
  20193. let user = Moyu.getUserInfo();
  20194. this.ui.topNode.selfNameTxt.text = user.nickName;
  20195. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20196. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20197. if (DataMgr.getSkillGuide() < 1) {
  20198. this.ui.topNode.aiNameTxt.text = 'billiards';
  20199. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20200. }
  20201. else {
  20202. this.ui.topNode.aiNameTxt.text = aiData.name;
  20203. let randNo = Math.floor(Math.random() * 10) + 1;
  20204. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20205. }
  20206. }
  20207. initD2world() {
  20208. let node = this.ui.d2Root.displayObject;
  20209. let src = node.getComponent(D2World);
  20210. if (!src) {
  20211. xGame.common.d2World = node.addComponent(D2World);
  20212. }
  20213. xGame.common.d2World.initSelf();
  20214. }
  20215. initD3world() {
  20216. if (this.isD3Inited)
  20217. return;
  20218. this.isD3Inited = true;
  20219. let scene3D = xGame.common.d3Scene;
  20220. this.ui.d3Root.displayObject.addChild(scene3D);
  20221. scene3D.active = true;
  20222. xGame.common.d3World.tableSrc.setBorderPos();
  20223. }
  20224. onRootMove(e) {
  20225. let rootBall = xGame.common.d2World.rootBall;
  20226. this.ui.moveNode.x = e.x;
  20227. this.ui.moveNode.y = e.y;
  20228. rootBall.gameObj.x = e.x;
  20229. rootBall.gameObj.y = e.y;
  20230. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20231. }
  20232. aiRootMove(move) {
  20233. if (move)
  20234. this.hideBallUI();
  20235. else {
  20236. this.showBallUI();
  20237. xGame.common.d2World.getHelpLine();
  20238. }
  20239. }
  20240. aiForce(type, force = 0) {
  20241. this.pressTarget = PressType.powerNode;
  20242. if (type == 1)
  20243. this.onEventUp({ force: true });
  20244. else if (type == 2)
  20245. this.onEventMove({ stageY: force, force: true });
  20246. }
  20247. onEventPress(e) {
  20248. if (e.stopPropagation)
  20249. e.stopPropagation();
  20250. if (!this.isTurnSelf())
  20251. return;
  20252. let target = e.target;
  20253. switch (target) {
  20254. case this.ui.myPowerNode.displayObject:
  20255. this.pressTarget = PressType.powerNode;
  20256. this.barInfo.curY = e.stageY;
  20257. this.updateBarInfo();
  20258. break;
  20259. case this.ui.moveNode.displayObject:
  20260. this.pressTarget = PressType.moveNode;
  20261. this.hideBallUI();
  20262. this.eventObj.curX = this.ui.moveNode.x;
  20263. this.eventObj.curY = this.ui.moveNode.y;
  20264. this.ui.moveNode.finger.visible = false;
  20265. this.eventObj.lastX = e.stageX;
  20266. this.eventObj.lastY = e.stageY;
  20267. break;
  20268. case this.ui.rulerClickNode.displayObject:
  20269. this.pressTarget = PressType.rulerNode;
  20270. this.eventObj.lastY = e.stageY;
  20271. break;
  20272. case this.ui.d2Root.displayObject:
  20273. this.pressTarget = PressType.d2Root;
  20274. this.eventObj.lastX = e.stageX;
  20275. this.eventObj.lastY = e.stageY;
  20276. this.eventObj.starX = e.stageX;
  20277. this.eventObj.starY = e.stageY;
  20278. this.eventObj.curX = 0;
  20279. this.eventObj.curY = 0;
  20280. xGame.common.d2World.d2Gan.setGanLastInfo();
  20281. this.rulerOffset = 0;
  20282. break;
  20283. default:
  20284. break;
  20285. }
  20286. }
  20287. onEventMove(e) {
  20288. if (e.stopPropagation)
  20289. e.stopPropagation();
  20290. if (e && e.force) {
  20291. }
  20292. else {
  20293. if (!this.isTurnSelf())
  20294. return;
  20295. }
  20296. switch (this.pressTarget) {
  20297. case PressType.powerNode:
  20298. this.barInfo.curY = e.stageY;
  20299. this.updateBarInfo();
  20300. this.isMoveRod = true;
  20301. break;
  20302. case PressType.moveNode:
  20303. let rootBall = xGame.common.d2World.rootBall;
  20304. let radius = rootBall.gameObj.width / 2;
  20305. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20306. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20307. let border = xGame.common.d2World.borderRect;
  20308. if (curX <= border.x + radius)
  20309. curX = border.x + radius;
  20310. else if (curX >= border.x + border.width - radius)
  20311. curX = border.x + border.width - radius;
  20312. if (curY <= border.y + radius)
  20313. curY = border.y + radius;
  20314. else if (curY >= border.y + border.height - radius)
  20315. curY = border.y + border.height - radius;
  20316. if (xGame.common.gameMgr.isOpenBall) {
  20317. if (curX >= border.x + border.openBallW - radius)
  20318. curX = border.x + border.openBallW - radius;
  20319. }
  20320. this.ui.moveNode.x = curX;
  20321. this.ui.moveNode.y = curY;
  20322. rootBall.gameObj.x = curX;
  20323. rootBall.gameObj.y = curY;
  20324. rootBall.d3BallSrc.setTransPos(curX, curY);
  20325. this.isMoveRod = true;
  20326. break;
  20327. case PressType.rulerNode:
  20328. let yy = e.stageY - this.eventObj.lastY;
  20329. this.eventObj.lastY = e.stageY;
  20330. let ruler1 = this.ui.rulerNode.img1;
  20331. let ruler2 = this.ui.rulerNode.img2;
  20332. ruler1.y += yy;
  20333. ruler2.y += yy;
  20334. this.rulerOffset += yy;
  20335. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20336. this.rulerOffset = 0;
  20337. xGame.soundMgr.playSound("inch", 1, 10);
  20338. }
  20339. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20340. let h = ruler1.height;
  20341. this.checkGuide();
  20342. this.isMoveRod = true;
  20343. if (ruler1.y >= h) {
  20344. ruler1.y = -h;
  20345. ruler2.y = 0;
  20346. return;
  20347. }
  20348. else if (ruler1.y <= -h) {
  20349. ruler1.y = h;
  20350. ruler2.y = 0;
  20351. return;
  20352. }
  20353. if (ruler2.y >= h) {
  20354. ruler2.y = -h;
  20355. ruler1.y = 0;
  20356. return;
  20357. }
  20358. else if (ruler2.y <= -h) {
  20359. ruler2.y = h;
  20360. ruler1.y = 0;
  20361. return;
  20362. }
  20363. break;
  20364. case PressType.d2Root:
  20365. this.eventObj.curX = e.stageX;
  20366. this.eventObj.curY = e.stageY;
  20367. let offset = this.checkRodMoveDir();
  20368. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20369. this.eventObj.lastX = e.stageX;
  20370. this.eventObj.lastY = e.stageY;
  20371. break;
  20372. default:
  20373. break;
  20374. }
  20375. }
  20376. onEventUp(e) {
  20377. if (e.stopPropagation)
  20378. e.stopPropagation();
  20379. if (e && e.force) {
  20380. }
  20381. else {
  20382. if (!this.isTurnSelf())
  20383. return;
  20384. }
  20385. switch (this.pressTarget) {
  20386. case PressType.powerNode:
  20387. this.ui.powerNode.value = 0;
  20388. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20389. this.ui.powerTxt.text = "";
  20390. if (this.powerNum > 0) {
  20391. xGame.eventMgr.event(BALL_SHOOT);
  20392. xGame.common.d2World.shoot(this.powerNum);
  20393. xGame.common.d2World.d2Gan.shoot();
  20394. xGame.common.d2World.d2HelpLine.shoot();
  20395. this.finishGuide();
  20396. this.ui.powerEft.visible = false;
  20397. this.ui.colorNode.visible = false;
  20398. let ganStr = "";
  20399. if (this.powerNum <= 30) {
  20400. ganStr = "gan_30";
  20401. }
  20402. else if (this.powerNum <= 60) {
  20403. ganStr = "gan_50";
  20404. }
  20405. else {
  20406. ganStr = "gan_80";
  20407. }
  20408. xGame.soundMgr.playSound(ganStr);
  20409. }
  20410. break;
  20411. case PressType.moveNode:
  20412. let rootBall = xGame.common.d2World.rootBall;
  20413. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20414. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20415. let isIntersect = this.judgeBallIntersect();
  20416. if (isIntersect) {
  20417. this.ui.moveNode.x = lastX;
  20418. this.ui.moveNode.y = lastY;
  20419. rootBall.gameObj.x = lastX;
  20420. rootBall.gameObj.y = lastY;
  20421. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20422. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20423. }
  20424. else {
  20425. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20426. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20427. }
  20428. this.showBallUI();
  20429. this.ui.moveNode.finger.visible = true;
  20430. xGame.common.d2World.getHelpLine();
  20431. break;
  20432. case PressType.rulerNode:
  20433. break;
  20434. case PressType.d2Root:
  20435. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20436. if (dis <= 25) {
  20437. this.moveToClickDot(e);
  20438. }
  20439. break;
  20440. default:
  20441. break;
  20442. }
  20443. this.pressTarget = -1;
  20444. }
  20445. checkGuide() {
  20446. let guide = DataMgr.getSkillGuide();
  20447. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20448. xGame.common.guideStep++;
  20449. xGame.common.gameUI.ui.guide2.visible = false;
  20450. xGame.common.gameUI.ui.guide3.visible = true;
  20451. }
  20452. }
  20453. finishGuide() {
  20454. let guide = DataMgr.getSkillGuide();
  20455. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20456. xGame.common.guideStep = 10;
  20457. this.closeAllGuide();
  20458. console.log('zh: 新手引导完毕');
  20459. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20460. }
  20461. }
  20462. closeAllGuide() {
  20463. xGame.common.gameUI.ui.guide1.visible = false;
  20464. xGame.common.gameUI.ui.guide2.visible = false;
  20465. xGame.common.gameUI.ui.guide3.visible = false;
  20466. }
  20467. updateBarInfo() {
  20468. let star = this.ui.powerNode.y;
  20469. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20470. if (rate >= 1)
  20471. rate = 1;
  20472. if (rate <= 0)
  20473. rate = 0;
  20474. this.powerNum = Math.ceil(rate * 100);
  20475. this.ui.powerNode.value = this.powerNum;
  20476. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20477. this.ui.colorNode.value = this.powerNum;
  20478. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20479. this.ui.powerEft.visible = this.powerNum != 0;
  20480. this.ui.colorNode.visible = this.powerNum != 0;
  20481. this.ui.powerTxt.text = this.powerNum + "";
  20482. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20483. }
  20484. forceCancel() {
  20485. this.ui.powerNode.value = 0;
  20486. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20487. this.ui.powerTxt.text = "";
  20488. }
  20489. checkRodMoveDir() {
  20490. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20491. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20492. if (tempX >= 0 && tempY <= 0) {
  20493. return this.checkDir();
  20494. }
  20495. else if (tempX < 0 && tempY < 0) {
  20496. return this.checkDir(1, -1);
  20497. }
  20498. else if (tempX < 0 && tempY > 0) {
  20499. return this.checkDir(-1, -1);
  20500. }
  20501. else {
  20502. return this.checkDir(-1, 1);
  20503. }
  20504. }
  20505. checkDir(flagX = 1, flagY = 1) {
  20506. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20507. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20508. if (offsetY == 0) {
  20509. return offsetX * flagX;
  20510. }
  20511. if (offsetX == 0) {
  20512. return offsetY * flagY;
  20513. }
  20514. let angle = offsetY / offsetX;
  20515. if (Math.abs(angle) >= 1) {
  20516. return offsetY * flagY;
  20517. }
  20518. else {
  20519. return offsetX * flagX;
  20520. }
  20521. }
  20522. judgeBallIntersect() {
  20523. let rootBall = xGame.common.d2World.rootBall;
  20524. let ballArr = xGame.common.d2World.ballArr;
  20525. let radius = rootBall.gameObj.width / 2;
  20526. let temp;
  20527. let isIntersect = false;
  20528. for (let index = 0; index < ballArr.length; index++) {
  20529. temp = ballArr[index];
  20530. if (temp.number == rootBall.number)
  20531. continue;
  20532. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20533. if (isIntersect) {
  20534. break;
  20535. }
  20536. }
  20537. return isIntersect;
  20538. }
  20539. hideBallUI() {
  20540. let d2Gan = xGame.common.d2World.d2Gan;
  20541. if (!d2Gan.ui.isDisposed)
  20542. d2Gan.ui.visible = false;
  20543. let d2Help = xGame.common.d2World.d2HelpLine;
  20544. if (!d2Help.ui.isDisposed)
  20545. d2Help.ui.visible = false;
  20546. let rootBall = xGame.common.d2World.rootBall;
  20547. if (!rootBall.destroyed) {
  20548. rootBall.gameObj.active = false;
  20549. }
  20550. }
  20551. showBallUI() {
  20552. let d2Gan = xGame.common.d2World.d2Gan;
  20553. if (!d2Gan.ui.isDisposed)
  20554. d2Gan.ui.visible = true;
  20555. let d2Help = xGame.common.d2World.d2HelpLine;
  20556. if (!d2Help.ui.isDisposed)
  20557. d2Help.ui.visible = true;
  20558. let rootBall = xGame.common.d2World.rootBall;
  20559. if (!rootBall.destroyed) {
  20560. rootBall.gameObj.active = true;
  20561. }
  20562. }
  20563. moveToClickDot(e) {
  20564. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20565. let root = xGame.common.d2World.rootBall.gameObj;
  20566. let xx = e.stageX - xGame.common.sysOffestNum;
  20567. let yy = e.stageY;
  20568. let x = xx - root.x;
  20569. let y = yy - root.y;
  20570. let angle = xGame.common.getfguiRotation(x, y);
  20571. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20572. xGame.common.d2World.getHelpLine();
  20573. }
  20574. this.isMoveRod = false;
  20575. xGame.common.clickedBall = false;
  20576. }
  20577. openAllEvent() {
  20578. this.closeAllEvent();
  20579. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20580. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20581. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20582. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20583. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20584. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20585. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20586. }
  20587. closeAllEvent() {
  20588. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20589. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20590. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20591. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20592. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20593. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20594. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20595. }
  20596. resetGame() {
  20597. this.closeAllEvent();
  20598. this.hideBallUI();
  20599. xGame.common.gameMgr.gamePause = true;
  20600. }
  20601. }
  20602. UIGame$1.uiName = "UIGame";
  20603. class UIAddCoin$1 extends UIBase {
  20604. constructor() {
  20605. super();
  20606. this.coinNum = 2000;
  20607. }
  20608. onConstructor() {
  20609. this.ui = ui_UIAddCoin.createInstance();
  20610. this.contentPane = this.ui;
  20611. this.isEject = false;
  20612. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20613. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20614. }
  20615. show() {
  20616. super.show();
  20617. this.ui.t0.play();
  20618. this.setGlobalFont(this.ui);
  20619. }
  20620. videoAddCoin() {
  20621. console.log('zh:qjff_AD_for_UIAddCoin');
  20622. if (Laya.Browser.onAndroid) {
  20623. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20624. if (!boo) {
  20625. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20626. return;
  20627. }
  20628. }
  20629. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20630. }
  20631. else {
  20632. console.log('zh:AD 失败,直接发放奖励');
  20633. this.qjff_AD_for_UIAddCoin();
  20634. }
  20635. }
  20636. qjff_AD_for_UIAddCoin() {
  20637. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20638. this.hide();
  20639. }
  20640. }
  20641. UIAddCoin$1.uiName = "UIAddCoin";
  20642. class UIInvitation$1 extends UIBase {
  20643. constructor() {
  20644. super();
  20645. }
  20646. onConstructor() {
  20647. this.ui = ui_UIInvitation.createInstance();
  20648. this.contentPane = this.ui;
  20649. this.isEject = false;
  20650. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20651. }
  20652. show() {
  20653. super.show();
  20654. this.setGlobalFont(this.ui);
  20655. }
  20656. enterGame() {
  20657. xGame.common.gameMode = GameMode.classic;
  20658. DataMgr.setChallengeTimes(1);
  20659. xGame.common.passAwardCoin = 2000;
  20660. let need = xGame.common.classicNiceNeddCoin;
  20661. if (DataMgr.coinEnough(need)) {
  20662. DataMgr.setCoin(-need);
  20663. xGame.eventMgr.event(RESTART_GAME, true);
  20664. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20665. }
  20666. else {
  20667. xGame.eventMgr.event(RESTART_GAME, true);
  20668. }
  20669. this.hide();
  20670. }
  20671. hide() {
  20672. super.hide();
  20673. }
  20674. }
  20675. UIInvitation$1.uiName = "UIInvitation";
  20676. class UIPower$1 extends UIBase {
  20677. constructor() {
  20678. super();
  20679. }
  20680. onConstructor() {
  20681. this.ui = ui_UIPower.createInstance();
  20682. this.contentPane = this.ui;
  20683. this.isEject = false;
  20684. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20685. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20686. }
  20687. show() {
  20688. super.show();
  20689. this.ui.t0.play();
  20690. this.setGlobalFont(this.ui);
  20691. }
  20692. videoGetPower() {
  20693. console.log('zh:qjff_AD_for_uipower');
  20694. if (Laya.Browser.onAndroid) {
  20695. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20696. if (!boo) {
  20697. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20698. return;
  20699. }
  20700. }
  20701. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20702. }
  20703. else {
  20704. console.log('zh:AD 失败,直接发放奖励');
  20705. this.qjff_AD_for_uipower();
  20706. }
  20707. }
  20708. qjff_AD_for_uipower() {
  20709. DataMgr.setPower(xGame.common.videoPower, true);
  20710. xGame.eventMgr.event(POWER_TIME);
  20711. this.hide();
  20712. }
  20713. }
  20714. UIPower$1.uiName = "UIPower";
  20715. class UIGameEnd$1 extends UIBase {
  20716. constructor() {
  20717. super();
  20718. this.success = false;
  20719. this.awardCoinNum = 1000;
  20720. this.awardDiamondNum = 10;
  20721. }
  20722. onConstructor() {
  20723. this.ui = ui_UIGameEnd.createInstance();
  20724. this.contentPane = this.ui;
  20725. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20726. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20727. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20728. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20729. this.ui.talkNode.visible = false;
  20730. if (Moyu.isKs)
  20731. this.ui.closeNode.closeBtn.x += 100;
  20732. }
  20733. updateType() {
  20734. switch (xGame.common.gameMode) {
  20735. case GameMode.classic:
  20736. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20737. this.ui.coinNode.visible = this.success;
  20738. if (!this.success) {
  20739. Laya.timer.once(500, this, () => {
  20740. xGame.uiMgr.Show(UIAddCoin$1);
  20741. });
  20742. }
  20743. else {
  20744. this.logEventForClassic_win();
  20745. }
  20746. this.logEventForClassic_complete();
  20747. this.ui.isGetAward.visible = false;
  20748. this.ui.leftBtn.c1.selectedIndex = 3;
  20749. this.ui.rightBtn.c1.selectedIndex = 0;
  20750. this.moneyNode.ui.c1.selectedIndex = 1;
  20751. break;
  20752. case GameMode.bigMove:
  20753. console.log('zh:招法模式 aaaaaa bigMove');
  20754. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20755. this.ui.coinNode.visible = this.success;
  20756. if (xGame.common.gameMode == GameMode.bigMove) {
  20757. if (this.success) {
  20758. DataMgr.setSkillSuccessTimes(1, true);
  20759. DataMgr.setSkillAccTimes(1);
  20760. }
  20761. else {
  20762. DataMgr.setSkillSuccessTimes(0, false);
  20763. }
  20764. }
  20765. this.logEventForRod_complete_N();
  20766. if (!this.success) {
  20767. Laya.timer.once(500, this, () => {
  20768. xGame.uiMgr.Show(UIAddCoin$1);
  20769. });
  20770. }
  20771. else {
  20772. this.logEventForRod_win();
  20773. }
  20774. this.ui.isGetAward.visible = false;
  20775. this.ui.leftBtn.c1.selectedIndex = 3;
  20776. this.ui.rightBtn.c1.selectedIndex = 0;
  20777. this.moneyNode.ui.c1.selectedIndex = 1;
  20778. break;
  20779. case GameMode.placeBall:
  20780. this.ui.coinNode.visible = false;
  20781. if (this.success) {
  20782. if (xGame.common.placeBallStarNum == 3) {
  20783. this.ui.c1.selectedIndex = 2;
  20784. }
  20785. else {
  20786. this.ui.c1.selectedIndex = 3;
  20787. }
  20788. let level = xGame.common.placeBallCurLevel;
  20789. if (level > 59) {
  20790. this.logEventForChallenge_level_complete(level);
  20791. }
  20792. else {
  20793. this.logEventForChallenge_level_N(level);
  20794. }
  20795. }
  20796. else {
  20797. this.ui.c1.selectedIndex = 4;
  20798. }
  20799. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20800. if (cfg.type == PlaceBallType.challenge) {
  20801. this.ui.c1.selectedIndex = 2;
  20802. }
  20803. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20804. this.updatePlaceBallBtn();
  20805. this.updatePlaceBallStarNum();
  20806. this.updatePlaceBallAwardState();
  20807. this.moneyNode.ui.c1.selectedIndex = 2;
  20808. this.moneyNode.checkPowerTime();
  20809. this.moneyNode.powerChange();
  20810. DataMgr.upRankData();
  20811. break;
  20812. default:
  20813. break;
  20814. }
  20815. }
  20816. logEventForRod_complete_N() {
  20817. let gfmsIdx = xGame.common.curPlayerSkillType;
  20818. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20819. let gfmc = 'Skyfall Shot';
  20820. if (gfmsIdx == 0) {
  20821. gfmc = 'Skyfall Shot';
  20822. }
  20823. if (gfmsIdx == 1) {
  20824. gfmc = 'Surging break';
  20825. }
  20826. if (gfmsIdx == 2) {
  20827. gfmc = 'Frost Lock';
  20828. }
  20829. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20830. console.log('zh:logEventForRod_complete_N level = ' + level);
  20831. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20832. let jsonStr = {
  20833. "count": 0,
  20834. "name": gfmc
  20835. };
  20836. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20837. const d = LocalStorageManager.getItem(keyStr);
  20838. jsonStr.count = d.count + 1;
  20839. LocalStorageManager.setItem(keyStr, jsonStr);
  20840. }
  20841. else {
  20842. LocalStorageManager.setItem(keyStr, jsonStr);
  20843. }
  20844. const d2 = LocalStorageManager.getItem(keyStr);
  20845. let count = d2.count;
  20846. console.log('zh:logEventForRod_complete_N count = ' + count);
  20847. if (count % 5 == 0) {
  20848. const reqStr = JSON.stringify(jsonStr);
  20849. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20850. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20851. }
  20852. }
  20853. logEventForRod_win() {
  20854. console.log('zh:logEventForRod_win,胜利');
  20855. let gfmsIdx = xGame.common.curPlayerSkillType;
  20856. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20857. let gfmc = 'Skyfall Shot';
  20858. if (gfmsIdx == 0) {
  20859. gfmc = 'Skyfall Shot';
  20860. }
  20861. if (gfmsIdx == 1) {
  20862. gfmc = 'Surging break';
  20863. }
  20864. if (gfmsIdx == 2) {
  20865. gfmc = 'Frost Lock';
  20866. }
  20867. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20868. console.log('zh:logEventForRod_win level = ' + level);
  20869. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20870. let jsonStr = {
  20871. "count": 1,
  20872. "name": gfmc + ' Lev' + level
  20873. };
  20874. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20875. const d = LocalStorageManager.getItem(keyStr);
  20876. jsonStr.count = d.count + 1;
  20877. LocalStorageManager.setItem(keyStr, jsonStr);
  20878. }
  20879. else {
  20880. LocalStorageManager.setItem(keyStr, jsonStr);
  20881. }
  20882. const reqStr = JSON.stringify(jsonStr);
  20883. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20884. }
  20885. logEventForClassic_win() {
  20886. console.log('zh:logEventForClassic_win,胜利');
  20887. let rtype = xGame.common.classicRoomType;
  20888. let msmc = '';
  20889. if (rtype == 1) {
  20890. msmc = 'beginner';
  20891. }
  20892. if (rtype == 2) {
  20893. msmc = 'expert';
  20894. }
  20895. if (rtype == 3) {
  20896. msmc = 'master';
  20897. }
  20898. let keyStr = 'sjmd_classic_win_' + rtype;
  20899. let jsonStr = {
  20900. "difficulty": msmc,
  20901. "classic_count": 1,
  20902. "difficulty_count": 1
  20903. };
  20904. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20905. const d = LocalStorageManager.getItem(keyStr);
  20906. jsonStr.classic_count = d.classic_count + 1;
  20907. jsonStr.difficulty_count = d.difficulty_count + 1;
  20908. LocalStorageManager.setItem(keyStr, jsonStr);
  20909. }
  20910. else {
  20911. LocalStorageManager.setItem(keyStr, jsonStr);
  20912. }
  20913. const reqStr = JSON.stringify(jsonStr);
  20914. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  20915. }
  20916. logEventForClassic_complete() {
  20917. console.log('zh:logEventForClassic_complete,胜利');
  20918. let rtype = xGame.common.classicRoomType;
  20919. let msmc = '';
  20920. if (rtype == 1) {
  20921. msmc = 'beginner';
  20922. }
  20923. if (rtype == 2) {
  20924. msmc = 'expert';
  20925. }
  20926. if (rtype == 3) {
  20927. msmc = 'master';
  20928. }
  20929. let keyStr = 'sjmd_classic_complete_' + rtype;
  20930. let jsonStr = {
  20931. "msmc": msmc,
  20932. "count": 0
  20933. };
  20934. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20935. const d = LocalStorageManager.getItem(keyStr);
  20936. jsonStr.count = d.count + 1;
  20937. LocalStorageManager.setItem(keyStr, jsonStr);
  20938. }
  20939. else {
  20940. LocalStorageManager.setItem(keyStr, jsonStr);
  20941. }
  20942. if (jsonStr.count % 5 == 0) {
  20943. const reqStr = JSON.stringify(jsonStr);
  20944. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  20945. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  20946. }
  20947. }
  20948. updatePlaceBallBtn() {
  20949. this.ui.leftBtn.c1.selectedIndex = 5;
  20950. if (this.success) {
  20951. this.ui.rightBtn.c1.selectedIndex = 14;
  20952. }
  20953. else {
  20954. if (xGame.common.placeBallStarNum == 3) {
  20955. this.ui.rightBtn.c1.selectedIndex = 14;
  20956. }
  20957. else {
  20958. this.ui.rightBtn.c1.selectedIndex = 1;
  20959. }
  20960. }
  20961. }
  20962. updatePlaceBallStarNum() {
  20963. let starNum = xGame.common.placeBallStarNum;
  20964. if (starNum == 0)
  20965. this.ui.starNumNode.c1.selectedIndex = 3;
  20966. else {
  20967. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  20968. }
  20969. }
  20970. updatePlaceBallAwardState() {
  20971. let level = xGame.common.placeBallCurLevel;
  20972. let starNum = xGame.common.placeBallStarNum;
  20973. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  20974. let data = cfgTable.placeballData[level].award;
  20975. let cfg = cfgTable.placeballData[level];
  20976. this.awardDiamondNum = data[1];
  20977. this.awardCoinNum = data[0];
  20978. if (cfg.type == PlaceBallType.challenge) {
  20979. this.awardDiamondNum = 0;
  20980. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  20981. }
  20982. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  20983. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  20984. if (cfg.type == PlaceBallType.challenge) {
  20985. this.ui.awardNode.coinNode.visible = true;
  20986. }
  20987. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  20988. this.ui.awardNode.diamondNode.x = 265;
  20989. this.ui.awardNode.coinNode.x = 354;
  20990. }
  20991. else {
  20992. this.ui.awardNode.diamondNode.x = 291;
  20993. this.ui.awardNode.coinNode.x = 291;
  20994. }
  20995. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  20996. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  20997. if (this.awardCoinNum == 0) {
  20998. this.ui.awardNode.coinNode.numTxt.text = "";
  20999. }
  21000. if (getAward) {
  21001. this.ui.isGetAward.visible = true;
  21002. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21003. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21004. }
  21005. else {
  21006. this.ui.isGetAward.visible = false;
  21007. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21008. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21009. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21010. }
  21011. else {
  21012. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21013. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21014. }
  21015. }
  21016. }
  21017. show(success) {
  21018. super.show();
  21019. xGame.eventMgr.event(RESET_GAME);
  21020. this.success = success;
  21021. Laya.timer.clearAll(this);
  21022. this.playSecretaryAni();
  21023. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21024. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21025. offsetTime = Math.floor(offsetTime / 1000);
  21026. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21027. this.updateType();
  21028. Laya.timer.once(200, this, () => {
  21029. this.addAward(() => {
  21030. this.updateType();
  21031. Laya.timer.once(500, this, () => {
  21032. this.showChallengeLevel();
  21033. });
  21034. });
  21035. });
  21036. if (this.success) {
  21037. JSBridgeUtils.instance.showInternAd('gameend_success');
  21038. console.log('zh:game end 成功');
  21039. xGame.soundMgr.playSound('slots_roll01');
  21040. xGame.soundMgr.playSound("s_win");
  21041. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21042. this.diyGameDataUtilForGameWin();
  21043. this.updateGamePlaceBallData2Server();
  21044. }
  21045. else {
  21046. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21047. console.log('zh:game end失败');
  21048. xGame.soundMgr.playSound('matchwin01');
  21049. xGame.soundMgr.playSound("s_lose");
  21050. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21051. }
  21052. let challengeNum = DataMgr.getChallengeTimes();
  21053. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21054. DataMgr.setChallengeTimes(1);
  21055. }
  21056. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21057. DataMgr.setClassicTimes();
  21058. }
  21059. this.setGlobalFont(this.ui);
  21060. }
  21061. diyGameDataUtilForGameWin() {
  21062. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21063. switch (xGame.common.gameMode) {
  21064. case GameMode.classic:
  21065. console.log('zh:DiyGameDataUtilForGameWin 111');
  21066. case GameMode.bigMove:
  21067. console.log('zh:DiyGameDataUtilForGameWin 222');
  21068. this.restartGame();
  21069. break;
  21070. case GameMode.placeBall:
  21071. console.log('zh:DiyGameDataUtilForGameWin 333');
  21072. var level = xGame.common.placeBallCurLevel;
  21073. console.log('zh:练习模式 联系了多少LEV=' + level);
  21074. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21075. if (level > db_over_lev) {
  21076. DataMgr.setChallengeMode_overLev(level);
  21077. }
  21078. break;
  21079. default:
  21080. console.log('zh:DiyGameDataUtilForGameWin 444');
  21081. break;
  21082. }
  21083. }
  21084. updateGamePlaceBallData2Server() {
  21085. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21086. if (userInfo == null) {
  21087. return;
  21088. }
  21089. let pbdObj = DataMgr.getPlaceBallLevelList();
  21090. let reqData = xGame.httpMgr.getReqData();
  21091. let pd = JSON.parse(reqData);
  21092. pd.placeBallData = JSON.stringify(pbdObj);
  21093. reqData = JSON.stringify(pd);
  21094. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21095. try {
  21096. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21097. let code = res.code;
  21098. let msg = res.msg;
  21099. if (code == 401) {
  21100. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21101. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21102. return;
  21103. }
  21104. if (code == 200) {
  21105. let data = res.data;
  21106. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21107. }
  21108. else {
  21109. xGame.uiMgr.Show(UIMsg$1, msg);
  21110. }
  21111. }
  21112. catch (error) {
  21113. console.log('error=' + error);
  21114. alert(error);
  21115. }
  21116. finally {
  21117. }
  21118. });
  21119. }
  21120. showChallengeLevel() {
  21121. if (DataMgr.getChallengeTimes() != 0)
  21122. return;
  21123. let skill = DataMgr.getSkillAccTimes();
  21124. let put = DataMgr.getPlaceBallLevelList().length;
  21125. if (skill >= 3 || put >= 5) {
  21126. xGame.uiMgr.Show(UIInvitation$1);
  21127. this.hide();
  21128. }
  21129. }
  21130. addAward(callback) {
  21131. if (!this.success) {
  21132. callback && callback();
  21133. return;
  21134. }
  21135. switch (xGame.common.gameMode) {
  21136. case GameMode.classic:
  21137. this.awardCoinNum = xGame.common.passAwardCoin;
  21138. this.awardDiamondNum = 0;
  21139. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21140. break;
  21141. case GameMode.bigMove:
  21142. this.awardCoinNum = xGame.common.passAwardCoin;
  21143. this.awardDiamondNum = 0;
  21144. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21145. callback && callback();
  21146. break;
  21147. case GameMode.placeBall:
  21148. let level = xGame.common.placeBallCurLevel;
  21149. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21150. if (xGame.common.placeBallStarNum != 3) {
  21151. callback && callback();
  21152. return;
  21153. }
  21154. else {
  21155. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21156. if (getAward) {
  21157. callback && callback();
  21158. return;
  21159. }
  21160. }
  21161. let cfg = cfgTable.placeballData[level];
  21162. let data = cfgTable.placeballData[level].award;
  21163. this.awardCoinNum = data[0];
  21164. this.awardDiamondNum = data[1];
  21165. if (cfg.type == PlaceBallType.challenge) {
  21166. this.awardDiamondNum = 0;
  21167. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21168. }
  21169. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21170. let diamondAward;
  21171. if (this.awardDiamondNum > 0) {
  21172. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21173. xGame.common.getAward([diamondAward, coinAward], callback);
  21174. }
  21175. else {
  21176. xGame.common.getAward([coinAward], callback);
  21177. }
  21178. if (cfg.type == PlaceBallType.normal) {
  21179. DataMgr.setPlaceBallAward(level);
  21180. }
  21181. break;
  21182. default:
  21183. break;
  21184. }
  21185. }
  21186. playSecretaryAni_old() {
  21187. let parent = this.ui.secretary.displayObject;
  21188. parent.destroyChildren();
  21189. let xx = this.ui.secretary.width / 2;
  21190. let yy = this.ui.secretary.height;
  21191. let scale = xGame.common.getSecretaryScale();
  21192. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21193. if (this.success) {
  21194. let rand = Math.random() <= 0.5 ? 2 : 3;
  21195. xGame.common.secretary.play(data, rand, false, parent, () => {
  21196. xGame.common.secretary.play(data, 1, true, parent);
  21197. });
  21198. }
  21199. else {
  21200. xGame.common.secretary.play(data, 0, true, parent);
  21201. }
  21202. }
  21203. playSecretaryAni() {
  21204. let parent = this.ui.secretary.displayObject;
  21205. parent.destroyChildren();
  21206. let xx = this.ui.secretary.width / 2;
  21207. let yy = this.ui.secretary.height;
  21208. let scale = xGame.common.getSecretaryScale();
  21209. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21210. if (this.success) {
  21211. let rand = 0;
  21212. xGame.common.secretary.play(data, 0, true, parent);
  21213. }
  21214. else {
  21215. xGame.common.secretary.play(data, 0, true, parent);
  21216. }
  21217. }
  21218. restartGame() {
  21219. switch (xGame.common.gameMode) {
  21220. case GameMode.classic:
  21221. xGame.eventMgr.event(RESTART_GAME);
  21222. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21223. break;
  21224. case GameMode.bigMove:
  21225. this.hide();
  21226. xGame.eventMgr.event(RESTART_GAME);
  21227. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21228. break;
  21229. default:
  21230. break;
  21231. }
  21232. }
  21233. hide() {
  21234. super.hide();
  21235. xGame.common.stopGirlPop(this.ui.talkNode);
  21236. PlatMgr.showBanner(false);
  21237. }
  21238. returnHome() {
  21239. this.hide();
  21240. let showFailWords = !this.success;
  21241. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21242. }
  21243. clickLeftBtn() {
  21244. switch (xGame.common.gameMode) {
  21245. case GameMode.classic:
  21246. case GameMode.bigMove:
  21247. this.returnHome();
  21248. break;
  21249. case GameMode.placeBall:
  21250. let level = xGame.common.placeBallCurLevel;
  21251. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21252. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21253. break;
  21254. default:
  21255. break;
  21256. }
  21257. }
  21258. powerStartPlaceBallLevel(level, btn) {
  21259. if (DataMgr.powerEnough()) {
  21260. btn.touchable = false;
  21261. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21262. btn.touchable = true;
  21263. DataMgr.setPower(-1);
  21264. xGame.eventMgr.event(POWER_TIME);
  21265. this.startPlaceBallLevel(level);
  21266. this.logEventForChallenge_level_start(level);
  21267. }));
  21268. }
  21269. else {
  21270. xGame.uiMgr.Show(UIPower$1, 0);
  21271. }
  21272. }
  21273. clickRightBtn() {
  21274. switch (xGame.common.gameMode) {
  21275. case GameMode.classic:
  21276. console.log('zh:clickRightBtn 111');
  21277. case GameMode.bigMove:
  21278. console.log('zh:clickRightBtn 222');
  21279. this.restartGame();
  21280. break;
  21281. case GameMode.placeBall:
  21282. console.log('zh:clickRightBtn 333');
  21283. let level = xGame.common.placeBallCurLevel;
  21284. let data = DataMgr.getPlaceBallLevel(level);
  21285. let curPss = data.play && !data.isCur;
  21286. if (curPss) {
  21287. console.log('zh:clickRightBtn 333-111');
  21288. console.log('zh:当前LV=' + level);
  21289. if (level == 60) {
  21290. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21291. Laya.timer.once(3000, this, () => {
  21292. this.returnHome();
  21293. });
  21294. }
  21295. else {
  21296. let lev = level + 1;
  21297. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21298. }
  21299. }
  21300. else {
  21301. console.log('zh:clickRightBtn 333-000');
  21302. Moyu.sendDataEvent("placeBallNextLevel");
  21303. console.log('zh:qjff_AD_for_uiGameEnd');
  21304. if (Laya.Browser.onAndroid) {
  21305. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21306. if (!boo) {
  21307. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21308. return;
  21309. }
  21310. }
  21311. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21312. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21313. }
  21314. else {
  21315. console.log('zh:AD 失败,直接发放奖励');
  21316. this.qjff_AD_for_uiGameEnd(level);
  21317. }
  21318. }
  21319. break;
  21320. default:
  21321. console.log('zh:clickRightBtn 444');
  21322. break;
  21323. }
  21324. }
  21325. logEventForChallenge_level_start(level) {
  21326. let keyStr = 'sjmd_challenge_level_start';
  21327. let jsonStr = {
  21328. "count": 0,
  21329. "gold_balance ": DataMgr.getCoin(),
  21330. "level": level,
  21331. "diamond_balance ": DataMgr.getDiamond()
  21332. };
  21333. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21334. const d = LocalStorageManager.getItem(keyStr);
  21335. if (level > d.level) {
  21336. jsonStr.count = d.count + 1;
  21337. LocalStorageManager.setItem(keyStr, jsonStr);
  21338. }
  21339. else {
  21340. }
  21341. }
  21342. else {
  21343. LocalStorageManager.setItem(keyStr, jsonStr);
  21344. }
  21345. const reqStr = JSON.stringify(jsonStr);
  21346. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21347. }
  21348. qjff_AD_for_uiGameEnd(level) {
  21349. DataMgr.setPlaceBallLevel(level, 1);
  21350. this.startPlaceBallLevel(level + 1);
  21351. }
  21352. startPlaceBallLevel(level) {
  21353. xGame.common.gameMode = GameMode.placeBall;
  21354. xGame.common.placeBallCurLevel = level;
  21355. xGame.uiMgr.Show(UIGame$1);
  21356. this.hide();
  21357. }
  21358. logEventForChallenge_level_complete(level) {
  21359. let keyStr = 'sjmd_challenge_level_complete';
  21360. let jsonStr = {
  21361. "count": 1,
  21362. "gold_balance ": DataMgr.getCoin(),
  21363. "level": level,
  21364. "diamond_balance ": DataMgr.getDiamond()
  21365. };
  21366. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21367. const d = LocalStorageManager.getItem(keyStr);
  21368. jsonStr.count = d.count + 1;
  21369. LocalStorageManager.setItem(keyStr, jsonStr);
  21370. }
  21371. else {
  21372. LocalStorageManager.setItem(keyStr, jsonStr);
  21373. }
  21374. const reqStr = JSON.stringify(jsonStr);
  21375. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21376. }
  21377. logEventForChallenge_level_N(level) {
  21378. console.log('zh:logEventForChallenge_level_N ' + level);
  21379. let keyStr = 'sjmd_challenge_level_N';
  21380. if (LocalStorageManager.hasKey(keyStr)) {
  21381. let lev = LocalStorageManager.getItem(keyStr);
  21382. if (level > lev) {
  21383. LocalStorageManager.setItem(keyStr, level);
  21384. }
  21385. if ((level) % 5 == 0) {
  21386. console.log('zh:每5关上报1次');
  21387. let sjmc = 'challenge_level_' + level;
  21388. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21389. let sjmcForFirebase = 'challenge_level_' + level;
  21390. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21391. }
  21392. else {
  21393. console.log('zh:5 no 上报');
  21394. }
  21395. }
  21396. else {
  21397. LocalStorageManager.setItem(keyStr, level);
  21398. }
  21399. }
  21400. }
  21401. UIGameEnd$1.uiName = "UIGameEnd";
  21402. class ShowItem$1 {
  21403. constructor() {
  21404. this.ui = ui_ShowItem.createInstance();
  21405. }
  21406. destroySelf() {
  21407. if (!this.ui.isDisposed) {
  21408. this.ui.removeFromParent();
  21409. this.ui.dispose();
  21410. }
  21411. }
  21412. setParent(parent) {
  21413. parent.addChild(this.ui);
  21414. }
  21415. setPos(x, y) {
  21416. this.ui.x = x;
  21417. this.ui.y = y;
  21418. }
  21419. setUrl(index) {
  21420. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21421. }
  21422. }
  21423. class UILevelProp$1 extends UIBase {
  21424. constructor() {
  21425. super();
  21426. this.firstPos = 385;
  21427. this.secondPos = 467;
  21428. this.showItemArr = [];
  21429. }
  21430. onConstructor() {
  21431. this.ui = ui_UILevelProp.createInstance();
  21432. this.contentPane = this.ui;
  21433. this.isEject = false;
  21434. this.addUIClick(this.ui.closeBtn, this.hide);
  21435. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21436. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21437. }
  21438. show(level) {
  21439. super.show();
  21440. this.ui.t1.play();
  21441. this.level = level;
  21442. this.data = cfgTable.placeballData[this.level];
  21443. this.updateSelf();
  21444. this.showPreView();
  21445. this.moneyNode.ui.c1.selectedIndex = 2;
  21446. this.moneyNode.checkPowerTime();
  21447. this.moneyNode.powerChange();
  21448. this.setGlobalFont(this.ui);
  21449. }
  21450. showPreView() {
  21451. let item;
  21452. let data;
  21453. for (let index = 0; index < this.showItemArr.length; index++) {
  21454. item = this.showItemArr[index];
  21455. item.destroySelf();
  21456. }
  21457. this.showItemArr = [];
  21458. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21459. for (const key in cfgData) {
  21460. data = cfgData[key];
  21461. item = new ShowItem$1();
  21462. item.setParent(this.ui.myNode.displayRoot);
  21463. item.setPos(data.x, data.y);
  21464. item.setUrl(data.value);
  21465. this.showItemArr.push(item);
  21466. }
  21467. }
  21468. updateSelf() {
  21469. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21470. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21471. if (this.data.ball == -1) {
  21472. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21473. }
  21474. else {
  21475. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21476. }
  21477. let localData = DataMgr.getPlaceBallLevel(this.level);
  21478. let getAward = localData.getAward;
  21479. let cfg = cfgTable.placeballData[this.level];
  21480. let coin = this.data.award[0];
  21481. let diamond = this.data.award[1];
  21482. if (cfg.type == PlaceBallType.challenge) {
  21483. diamond = 0;
  21484. coin = 100;
  21485. }
  21486. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21487. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21488. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21489. if (cfg.type == PlaceBallType.challenge) {
  21490. this.ui.myNode.coinNode.numTxt.text = "";
  21491. }
  21492. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21493. if (coin > 0 && diamond > 0) {
  21494. this.ui.myNode.diamondNode.x = 385;
  21495. this.ui.myNode.coinNode.x = 467;
  21496. }
  21497. else {
  21498. this.ui.myNode.diamondNode.x = 385;
  21499. this.ui.myNode.coinNode.x = 385;
  21500. }
  21501. if (!getAward) {
  21502. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21503. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21504. }
  21505. else {
  21506. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21507. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21508. }
  21509. }
  21510. startGame() {
  21511. if (DataMgr.powerEnough()) {
  21512. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21513. this.ui.myNode.startBtn.touchable = false;
  21514. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21515. console.log('zh:startGame ');
  21516. this.ui.myNode.startBtn.touchable = true;
  21517. DataMgr.setPower(-1);
  21518. xGame.eventMgr.event(POWER_TIME);
  21519. xGame.common.gameMode = GameMode.placeBall;
  21520. xGame.common.placeBallCurLevel = this.level;
  21521. xGame.uiMgr.Show(UIGame$1);
  21522. this.logEventForChallenge_level_start(this.level);
  21523. xGame.uiMgr.Hide(UILevelDisplay$1);
  21524. xGame.uiMgr.Hide(UIMain$1);
  21525. this.hide();
  21526. }));
  21527. }
  21528. else {
  21529. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21530. xGame.uiMgr.Show(UIPower$1);
  21531. }
  21532. }
  21533. logEventForChallenge_level_start(level) {
  21534. let keyStr = 'sjmd_challenge_level_start';
  21535. let jsonStr = {
  21536. "count": 1,
  21537. "gold_balance ": DataMgr.getCoin(),
  21538. "level": level,
  21539. "diamond_balance ": DataMgr.getDiamond()
  21540. };
  21541. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21542. const d = LocalStorageManager.getItem(keyStr);
  21543. if (level > d.level) {
  21544. jsonStr.count = d.count + 1;
  21545. LocalStorageManager.setItem(keyStr, jsonStr);
  21546. }
  21547. else {
  21548. }
  21549. }
  21550. else {
  21551. LocalStorageManager.setItem(keyStr, jsonStr);
  21552. }
  21553. const reqStr = JSON.stringify(jsonStr);
  21554. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21555. }
  21556. hide() {
  21557. super.hide();
  21558. }
  21559. }
  21560. UILevelProp$1.uiName = "UILevelProp";
  21561. class PutBallLevelDisplay$1 {
  21562. constructor(ui, index) {
  21563. this.index = 0;
  21564. this.ui = ui;
  21565. this.index = index;
  21566. this.ui.onClick(this, this.clickSelf);
  21567. this.updateSelf();
  21568. this.ui.levelTxt.text = (this.index + 1) + "";
  21569. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21570. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21571. }
  21572. updateSelf() {
  21573. let level = this.index + 1;
  21574. this.data = DataMgr.getPlaceBallLevel(level);
  21575. this.ui.starNode.c1.selectedIndex = this.data.star;
  21576. let isChallenge = cfgTable.placeballData[level].type;
  21577. if (this.data.isCur) {
  21578. if (isChallenge) {
  21579. this.ui.c1.selectedIndex = 5;
  21580. }
  21581. else {
  21582. this.ui.c1.selectedIndex = 2;
  21583. }
  21584. }
  21585. else {
  21586. if (this.data.play) {
  21587. if (this.data.star == 3) {
  21588. this.ui.c1.selectedIndex = 0;
  21589. }
  21590. else {
  21591. this.ui.c1.selectedIndex = 1;
  21592. }
  21593. }
  21594. else {
  21595. if (isChallenge) {
  21596. this.ui.c1.selectedIndex = 4;
  21597. }
  21598. else {
  21599. this.ui.c1.selectedIndex = 3;
  21600. }
  21601. }
  21602. }
  21603. }
  21604. clickSelf() {
  21605. if (!this.data.play)
  21606. return;
  21607. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21608. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21609. }
  21610. }
  21611. class UILevelDisplay$1 extends UIBase {
  21612. constructor() {
  21613. super();
  21614. }
  21615. onConstructor() {
  21616. this.ui = ui_UILevelDisplay.createInstance();
  21617. this.contentPane = this.ui;
  21618. this.isEject = false;
  21619. this.myList = this.ui.myNode.myList;
  21620. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21621. this.levelItemArr = [];
  21622. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21623. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21624. this.myList.numItems = levelNum;
  21625. }
  21626. levelItemRender(index, target) {
  21627. let item = new PutBallLevelDisplay$1(target, index);
  21628. this.levelItemArr.push(item);
  21629. }
  21630. show() {
  21631. super.show();
  21632. this.updateLevel();
  21633. this.scrollToPlace();
  21634. this.setGlobalFont(this.ui);
  21635. }
  21636. updateLevel() {
  21637. let temp;
  21638. for (let index = 0; index < this.levelItemArr.length; index++) {
  21639. temp = this.levelItemArr[index];
  21640. temp.updateSelf();
  21641. }
  21642. }
  21643. scrollToPlace() {
  21644. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21645. let passArr = DataMgr.getPlaceBallLevelList();
  21646. let offest = passArr.length;
  21647. if (offest >= maxNum - 1)
  21648. offest = maxNum - 1;
  21649. this.myList.scrollToView(offest, true, true);
  21650. }
  21651. hide() {
  21652. super.hide();
  21653. }
  21654. }
  21655. UILevelDisplay$1.uiName = "UILevelDisplay";
  21656. class UIMatching$1 extends UIBase {
  21657. constructor() {
  21658. super();
  21659. }
  21660. onConstructor() {
  21661. this.ui = ui_UIMatching.createInstance();
  21662. this.contentPane = this.ui;
  21663. this.isEject = false;
  21664. }
  21665. show(callback) {
  21666. super.show();
  21667. PlatMgr.showBanner(true);
  21668. this.callback = callback;
  21669. let user = Moyu.getUserInfo();
  21670. if (!this.selfPot) {
  21671. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21672. }
  21673. if (!this.aiPot) {
  21674. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21675. }
  21676. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21677. this.ui.selfHead.nameTxt.text = user.nickName;
  21678. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21679. this.ui.aiHead.nameTxt.text = "???";
  21680. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21681. this.ui.selfHead.c1.selectedIndex = 0;
  21682. this.ui.aiHead.c1.selectedIndex = 0;
  21683. this.ui.selfHead.x = this.selfPot.x;
  21684. this.ui.selfHead.y = this.selfPot.y;
  21685. this.ui.aiHead.x = this.aiPot.x;
  21686. this.ui.aiHead.y = this.aiPot.y;
  21687. switch (xGame.common.gameMode) {
  21688. case GameMode.classic:
  21689. break;
  21690. case GameMode.bigMove:
  21691. this.initSkillData();
  21692. break;
  21693. default:
  21694. break;
  21695. }
  21696. this.ui.t1.play(Laya.Handler.create(this, () => {
  21697. this.ui.t2.play(Laya.Handler.create(this, () => {
  21698. switch (xGame.common.gameMode) {
  21699. case GameMode.classic:
  21700. this.waitingPeople();
  21701. break;
  21702. case GameMode.bigMove:
  21703. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21704. break;
  21705. default:
  21706. break;
  21707. }
  21708. }));
  21709. }));
  21710. this.setGlobalFont(this.ui);
  21711. }
  21712. initSkillData() {
  21713. this.skillSelectData = [];
  21714. let skillUrl = xGame.common.skillIconList;
  21715. let skillName = xGame.common.skillNameList;
  21716. let skillLevel = DataMgr.getBigSkillList();
  21717. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21718. for (let index = 0; index < 5; index++) {
  21719. let obj = {};
  21720. obj.skillImg = skillUrl[index];
  21721. obj.skillName = skillName[index];
  21722. obj.skillType = skillType[index];
  21723. obj.skillLevel = skillLevel[index];
  21724. this.skillSelectData.push(obj);
  21725. }
  21726. }
  21727. getAISkillLevel(myLevel) {
  21728. let video = xGame.common.upSkillLevel;
  21729. let aiLevel;
  21730. let temp;
  21731. if (video) {
  21732. temp = xGame.common.randomNum(-2, -1);
  21733. }
  21734. else {
  21735. if (myLevel <= 5) {
  21736. temp = xGame.common.randomNum(1, 3);
  21737. }
  21738. else if (myLevel <= 9) {
  21739. temp = xGame.common.randomNum(-2, 1);
  21740. }
  21741. else {
  21742. temp = xGame.common.randomNum(-4, 0);
  21743. }
  21744. }
  21745. aiLevel = temp + myLevel;
  21746. if (aiLevel <= 1)
  21747. aiLevel = 1;
  21748. if (aiLevel >= 10)
  21749. aiLevel = 10;
  21750. return aiLevel;
  21751. }
  21752. getAISkillType() {
  21753. return xGame.common.randomNum(1, 4);
  21754. let successTimes = DataMgr.getSkillSuccessTimes();
  21755. let info = cfgTable.aiskillData[successTimes];
  21756. if (!info) {
  21757. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21758. info = cfgTable.aiskillData[max];
  21759. }
  21760. let dataArr = info.skillselect;
  21761. let myCfg = {};
  21762. for (let index = 0; index < dataArr.length; index++) {
  21763. let temp = dataArr[index].split('-');
  21764. myCfg[temp[0]] = {};
  21765. myCfg[temp[0]].id = parseInt(temp[0]);
  21766. myCfg[temp[0]].weight = parseInt(temp[1]);
  21767. }
  21768. let aiCfg = xGame.common.initWeight(myCfg);
  21769. let curData = xGame.common.getRandomWeightData(aiCfg);
  21770. return parseInt(curData.id);
  21771. }
  21772. getAISkillData(index) {
  21773. let myLevel = this.skillSelectData[index].skillLevel;
  21774. let aiLevel = this.getAISkillLevel(myLevel);
  21775. let aiType = this.getAISkillType() - 1;
  21776. return { aiLevel, aiType } = { aiLevel, aiType };
  21777. }
  21778. skillSelectFinish(index) {
  21779. let aiInfo = this.getAISkillData(index);
  21780. xGame.common.gameMgr.selfCurSkill = index;
  21781. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21782. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21783. this.ui.selfHead.c1.selectedIndex = 1;
  21784. this.ui.aiHead.c1.selectedIndex = 1;
  21785. let myData = this.skillSelectData[index];
  21786. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21787. let guide = DataMgr.getSkillGuide();
  21788. if (guide == 0) {
  21789. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21790. }
  21791. else {
  21792. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21793. }
  21794. let aiData = this.skillSelectData[aiInfo.aiType];
  21795. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21796. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21797. this.waitingPeople();
  21798. }
  21799. waitingPeople() {
  21800. let time = xGame.common.randomNum(1000, 3000);
  21801. time += 1000;
  21802. Laya.timer.once(time, this, () => {
  21803. this.matchingSuccess();
  21804. });
  21805. }
  21806. matchingSuccess() {
  21807. let gameUI = xGame.common.gameUI;
  21808. let name = gameUI.ui.topNode.aiNameTxt.text;
  21809. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21810. this.ui.aiHead.nameTxt.text = name;
  21811. this.ui.aiHead.headImg.url = url;
  21812. name = gameUI.ui.topNode.selfNameTxt.text;
  21813. url = gameUI.ui.topNode.selfHeadLoader.url;
  21814. this.ui.selfHead.nameTxt.text = name;
  21815. this.ui.selfHead.headImg.url = url;
  21816. this.ui.t3.play(Laya.Handler.create(this, () => {
  21817. this.callback && this.callback();
  21818. this.ui.t4.play(Laya.Handler.create(this, () => {
  21819. this.destroySelf();
  21820. }));
  21821. }));
  21822. }
  21823. destroySelf() {
  21824. this.callback = null;
  21825. this.skillSelectData = null;
  21826. this.selfPot = null;
  21827. this.aiPot = null;
  21828. if (!this.ui.isDisposed) {
  21829. this.ui.removeFromParent();
  21830. this.ui.dispose();
  21831. }
  21832. xGame.uiMgr.destroyUI(this);
  21833. }
  21834. }
  21835. UIMatching$1.uiName = "UIMatching";
  21836. class SkillDisplay$1 {
  21837. constructor(ui, data, uiIndex) {
  21838. this.starX = 0;
  21839. this.starY = 0;
  21840. this.index = 0;
  21841. this.ui = ui;
  21842. this.data = data;
  21843. this.index = uiIndex;
  21844. this.initSelf();
  21845. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21846. }
  21847. initSelf() {
  21848. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21849. this.ui.nameTxt.text = this.data.name;
  21850. this.ui.describeTxt.text = this.data.describe;
  21851. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21852. this.ui.startBtn.onClick(this, this.startGame);
  21853. this.updateSelf();
  21854. }
  21855. updateSelf() {
  21856. this.checkTry();
  21857. let level = DataMgr.getBigSkillByIndex(this.index);
  21858. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21859. }
  21860. checkTry() {
  21861. let index = this.index;
  21862. let level = DataMgr.getBigSkillByIndex(index);
  21863. if (level == null) {
  21864. DataMgr.setBigSkill(index, 1, false);
  21865. level = 1;
  21866. }
  21867. this.ui.levelTxt.text = "LV." + level;
  21868. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21869. this.ui.tryNode.visible = true;
  21870. else
  21871. this.ui.tryNode.visible = false;
  21872. }
  21873. clickAddLevel() {
  21874. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21875. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21876. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21877. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21878. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21879. }
  21880. else {
  21881. console.log('zh:AD 失败,直接发放奖励');
  21882. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21883. }
  21884. }
  21885. qjff_AD_for_skilldisplay_clickAddLevel() {
  21886. DataMgr.setBigSkill(this.data.index, 1);
  21887. this.updateSelf();
  21888. xGame.common.upSkillLevel = true;
  21889. }
  21890. startGame() {
  21891. console.log('zh:rod skill startgame');
  21892. if (this.data.index == 3) {
  21893. alert('Coming soon!');
  21894. return;
  21895. }
  21896. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21897. let needCoin = xGame.common.bigMoveNeedCoin;
  21898. xGame.common.passAwardCoin = 2000;
  21899. let guide = DataMgr.getSkillGuide();
  21900. console.log('zh:startGame guide=' + guide);
  21901. xGame.common.temSelfLevel = 0;
  21902. if (guide == 0) {
  21903. needCoin = 0;
  21904. xGame.common.temSelfLevel = 100;
  21905. }
  21906. if (DataMgr.coinEnough(needCoin)) {
  21907. DataMgr.setCoin(-needCoin);
  21908. xGame.common.curPlayerSkillType = this.index;
  21909. if (guide == 0)
  21910. xGame.common.curPlayerSkillType = 0;
  21911. console.log('zh: skilldisplay 1');
  21912. xGame.uiMgr.Show(UIGame$1);
  21913. xGame.uiMgr.Hide(UIMain$1);
  21914. xGame.uiMgr.Show(UIMatching$1, () => {
  21915. xGame.common.gameUI.ui.alpha = 1;
  21916. xGame.common.gameUI.startGame();
  21917. xGame.uiMgr.Hide(UISkill$1);
  21918. });
  21919. this.logEventForRod_start();
  21920. }
  21921. else {
  21922. console.log('zh: skilldisplay 2');
  21923. xGame.uiMgr.Show(UIAddProp$1, 0);
  21924. Moyu.sendDataEvent("AddCoinVideo");
  21925. }
  21926. }
  21927. logEventForRod_start() {
  21928. let gfmsIdx = xGame.common.curPlayerSkillType;
  21929. console.log('zh:选择的技能=' + gfmsIdx);
  21930. let gfmc = 'Skyfall Shot';
  21931. if (gfmsIdx == 0) {
  21932. gfmc = 'Skyfall Shot';
  21933. }
  21934. if (gfmsIdx == 1) {
  21935. gfmc = 'Surging break';
  21936. }
  21937. if (gfmsIdx == 2) {
  21938. gfmc = 'Frost Lock';
  21939. }
  21940. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21941. let jsonStr = {
  21942. "count": 0,
  21943. "name": gfmc
  21944. };
  21945. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21946. const d = LocalStorageManager.getItem(keyStr);
  21947. jsonStr.count = d.count + 1;
  21948. LocalStorageManager.setItem(keyStr, jsonStr);
  21949. }
  21950. else {
  21951. LocalStorageManager.setItem(keyStr, jsonStr);
  21952. }
  21953. const reqStr = JSON.stringify(jsonStr);
  21954. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  21955. }
  21956. }
  21957. class UISkill$1 extends UIBase {
  21958. constructor() {
  21959. super();
  21960. this.skillData = [];
  21961. }
  21962. onConstructor() {
  21963. this.ui = ui_UISkill.createInstance();
  21964. this.contentPane = this.ui;
  21965. this.isEject = false;
  21966. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21967. this.initSkillData();
  21968. console.log('zh:aaaaaa1111111111');
  21969. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  21970. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  21971. console.log('zh:aaaaaa22222222');
  21972. this.displayList = [];
  21973. this.ui.skillNode.skillList.numItems = 3;
  21974. this.addUIClick(this.ui, this.interuptSecretary);
  21975. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  21976. this.ui.talkNode.visible = false;
  21977. if (Moyu.isKs)
  21978. this.ui.closeNode.closeBtn.x += 100;
  21979. }
  21980. show() {
  21981. super.show();
  21982. this.playSecretaryIdle();
  21983. this.moneyNode.ui.c1.selectedIndex = 1;
  21984. Laya.timer.clearAll(this);
  21985. xGame.soundMgr.playSound("s_start");
  21986. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21987. let guide = DataMgr.getSkillGuide();
  21988. this.ui.guideNode.visible = guide == 0;
  21989. let item = this.getSkillItemByUIIndex(0);
  21990. if (guide == 0) {
  21991. item.ui.c1.selectedIndex = 1;
  21992. }
  21993. else {
  21994. item.ui.c1.selectedIndex = 0;
  21995. }
  21996. this.ui.guideNode.guideBtn.visible = guide == 0;
  21997. for (let index = 0; index < this.displayList.length; index++) {
  21998. this.displayList[index].checkTry();
  21999. }
  22000. this.setGlobalFont(this.ui);
  22001. }
  22002. getSkillItemByUIIndex(cur) {
  22003. for (let index = 0; index < this.displayList.length; index++) {
  22004. if (this.displayList[index].index == cur) {
  22005. return this.displayList[index];
  22006. }
  22007. }
  22008. }
  22009. enterGuideLevel() {
  22010. let item = this.getSkillItemByUIIndex(0);
  22011. item.startGame();
  22012. if (DataMgr.getNewUser())
  22013. Moyu.sendDataEvent("gameStart1");
  22014. }
  22015. initSkillData() {
  22016. this.skillData = [];
  22017. let nameList = xGame.common.skillNameList;
  22018. let iconList = xGame.common.skillIconList;
  22019. let describeList = [
  22020. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22021. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22022. "The power of frost descends—freezing the flow and taking full control of the game!"
  22023. ];
  22024. console.log('zh:initSkillData 111111111');
  22025. let data;
  22026. for (let index = 0; index < nameList.length; index++) {
  22027. data = {};
  22028. data.name = nameList[index];
  22029. data.icon = iconList[index];
  22030. data.describe = describeList[index];
  22031. data.index = index;
  22032. this.skillData.push(data);
  22033. }
  22034. }
  22035. updateSkillItem(index, target) {
  22036. if (this.displayList[index] == null) {
  22037. let uiIndex;
  22038. switch (index) {
  22039. case 0:
  22040. uiIndex = 1;
  22041. break;
  22042. case 1:
  22043. uiIndex = 0;
  22044. break;
  22045. case 2:
  22046. uiIndex = 2;
  22047. break;
  22048. case 3:
  22049. uiIndex = 3;
  22050. break;
  22051. default:
  22052. break;
  22053. }
  22054. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22055. this.displayList.push(temp);
  22056. }
  22057. }
  22058. playSecretaryIdle() {
  22059. let parent = this.ui.secretary.displayObject;
  22060. parent.destroyChildren();
  22061. let xx = this.ui.secretary.width / 2;
  22062. let yy = this.ui.secretary.height;
  22063. let scale = xGame.common.getSecretaryScale();
  22064. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22065. xGame.common.secretary.play(data, 0, true, parent);
  22066. }
  22067. returnUIMain() {
  22068. this.hide();
  22069. xGame.common.stopGirlPop(this.ui.talkNode);
  22070. xGame.uiMgr.Show(UIMain$1);
  22071. }
  22072. interuptSecretary() {
  22073. Laya.timer.clearAll(this);
  22074. this.playSecretaryRandomSound();
  22075. }
  22076. playSecretaryRandomSound() {
  22077. if (this.isHide)
  22078. return;
  22079. let time = xGame.common.randomNum(45000, 60000);
  22080. Laya.timer.once(time, this, () => {
  22081. if (this.isHide)
  22082. return;
  22083. let index = xGame.common.randomNum(4, 7);
  22084. xGame.soundMgr.playSound("s_main0" + index);
  22085. let words = 1;
  22086. switch (index) {
  22087. case 4:
  22088. words = 5;
  22089. break;
  22090. case 5:
  22091. words = 3;
  22092. break;
  22093. case 6:
  22094. words = 6;
  22095. break;
  22096. case 7:
  22097. words = 7;
  22098. break;
  22099. default:
  22100. break;
  22101. }
  22102. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22103. this.playSecretaryRandomSound();
  22104. });
  22105. }
  22106. }
  22107. UISkill$1.uiName = "UISkill";
  22108. class UIAddProp$1 extends UIBase {
  22109. constructor() {
  22110. super();
  22111. this.curType = "";
  22112. }
  22113. onConstructor() {
  22114. this.ui = ui_UIAddProp.createInstance();
  22115. this.contentPane = this.ui;
  22116. this.isEject = false;
  22117. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22118. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22119. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22120. this.updateUI();
  22121. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22122. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22123. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22124. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22125. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22126. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22127. }
  22128. show(type) {
  22129. super.show();
  22130. this.curType = type == 0 ? "coin" : "diamond";
  22131. this.switchBtn("");
  22132. this.ui.t0.play();
  22133. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22134. PlatMgr.showInsert(true);
  22135. this.setGlobalFont(this.ui);
  22136. }
  22137. closeSelf() {
  22138. this.hide();
  22139. }
  22140. updateUI() {
  22141. let data = cfgTable.moneyData;
  22142. let temp;
  22143. let obj;
  22144. for (const key in data) {
  22145. temp = data[key];
  22146. obj = this.ui.myNode["node" + key];
  22147. if (parseInt(key) <= 2) {
  22148. obj.diamondTxt.text = "+" + temp.num;
  22149. }
  22150. else {
  22151. obj.coinTxt.text = temp.num;
  22152. obj.diamondTxt.text = temp.get.split('_')[1];
  22153. }
  22154. }
  22155. this.updateDiamondShare();
  22156. }
  22157. updateDiamondShare() {
  22158. let data = DataMgr.getShareDiamondTimes();
  22159. if (data >= xGame.common.maxShareDiamondTimes) {
  22160. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22161. this.ui.myNode.node1.touchable = false;
  22162. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22163. }
  22164. else {
  22165. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22166. this.ui.myNode.node1.touchable = true;
  22167. }
  22168. }
  22169. switchBtn(type) {
  22170. if (type == "")
  22171. type = this.curType;
  22172. else {
  22173. if (this.curType == type) {
  22174. return;
  22175. }
  22176. else {
  22177. this.curType = type;
  22178. }
  22179. }
  22180. if (type == "coin") {
  22181. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22182. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22183. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22184. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22185. this.ui.myNode.c1.selectedIndex = 0;
  22186. }
  22187. else {
  22188. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22189. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22190. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22191. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22192. this.ui.myNode.c1.selectedIndex = 1;
  22193. }
  22194. }
  22195. convertCoin(index) {
  22196. let data = cfgTable.moneyData[index];
  22197. let coinNum = data.num;
  22198. let str = data.get.split('_')[1];
  22199. let needDiamond = parseInt(str);
  22200. if (DataMgr.diamondEnough(needDiamond)) {
  22201. DataMgr.setDiamond(-needDiamond);
  22202. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22203. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22204. }
  22205. else {
  22206. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22207. this.switchBtn("diamond");
  22208. }
  22209. }
  22210. videoGetDiamond() {
  22211. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22212. if (Laya.Browser.onAndroid) {
  22213. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22214. if (!boo) {
  22215. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22216. return;
  22217. }
  22218. }
  22219. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22220. }
  22221. else {
  22222. console.log('zh:AD 失败,直接发放奖励');
  22223. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22224. }
  22225. }
  22226. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22227. let num = cfgTable.moneyData[2].num;
  22228. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22229. this.closeSelf();
  22230. }
  22231. videoGetCoin() {
  22232. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22233. if (Laya.Browser.onAndroid) {
  22234. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22235. if (!boo) {
  22236. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22237. return;
  22238. }
  22239. }
  22240. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22241. }
  22242. else {
  22243. console.log('zh:AD 失败,直接发放奖励');
  22244. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22245. }
  22246. }
  22247. qjff_AD_for_uiAddProp_videoGetCoin() {
  22248. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22249. this.closeSelf();
  22250. }
  22251. shareGetDiamond() {
  22252. let times = DataMgr.getShareDiamondTimes();
  22253. if (times >= xGame.common.maxShareDiamondTimes) {
  22254. console.log('zh: 233333333333 maxShareDiamondTimes');
  22255. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22256. }
  22257. else {
  22258. console.log('zh:33333333333333ad');
  22259. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22260. if (Laya.Browser.onAndroid) {
  22261. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22262. if (!boo) {
  22263. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22264. return;
  22265. }
  22266. }
  22267. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22268. }
  22269. else {
  22270. console.log('zh:AD 失败,直接发放奖励');
  22271. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22272. }
  22273. }
  22274. }
  22275. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22276. let diamond = xGame.common.randomNum(50, 100);
  22277. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22278. DataMgr.setShareDiamondTimes(1);
  22279. this.updateDiamondShare();
  22280. }
  22281. openPutBallView() {
  22282. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22283. let skill = xGame.uiMgr.getUI(UISkill$1);
  22284. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22285. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22286. if (end && !end.isHide) {
  22287. xGame.uiMgr.Hide(UIGameEnd$1);
  22288. xGame.uiMgr.Show(UIMain$1);
  22289. }
  22290. if (skill && !skill.isHide)
  22291. xGame.uiMgr.Hide(UISkill$1);
  22292. if (uigame && !uigame.isHide)
  22293. xGame.uiMgr.Hide(UIGame$1);
  22294. if (level && !level.isHide) {
  22295. }
  22296. else {
  22297. xGame.uiMgr.Show(UILevelDisplay$1);
  22298. }
  22299. this.closeSelf();
  22300. }
  22301. }
  22302. UIAddProp$1.uiName = "UIAddProp";
  22303. class MoneyNode$1 {
  22304. constructor(ui) {
  22305. this.leftTime = 0;
  22306. this.ui = ui;
  22307. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22308. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22309. this.ui.addPowerBtn.onClick(this, this.addPower);
  22310. this.ui.c1.selectedIndex = 1;
  22311. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22312. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22313. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22314. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22315. this.coinChange();
  22316. this.diamondChange();
  22317. this.powerChange();
  22318. }
  22319. addPower() {
  22320. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22321. xGame.uiMgr.Show(UIPower$1);
  22322. }
  22323. powerChange() {
  22324. let powerNum = DataMgr.getPower();
  22325. this.ui.powerTxt.text = powerNum + "";
  22326. }
  22327. checkPowerTime() {
  22328. let cur = new Date().getTime();
  22329. let last = DataMgr.getPowerTime();
  22330. if (last == 0) {
  22331. last = cur;
  22332. DataMgr.setPowerTime(cur);
  22333. }
  22334. let power = DataMgr.getPower();
  22335. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22336. Laya.timer.clearAll(this);
  22337. if (power >= xGame.common.natureMaxPower) {
  22338. this.ui.powerTimeTxt.text = "";
  22339. DataMgr.setPowerTime(cur);
  22340. return;
  22341. }
  22342. if (power + offset >= xGame.common.natureMaxPower) {
  22343. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22344. this.ui.powerTimeTxt.text = "";
  22345. DataMgr.setPowerTime(cur);
  22346. }
  22347. else {
  22348. if (offset > 0) {
  22349. DataMgr.setPower(offset);
  22350. DataMgr.setPowerTime(cur);
  22351. }
  22352. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22353. this.leftTime = xGame.common.powerRecoverNum - time;
  22354. if (this.leftTime <= 0)
  22355. this.leftTime = 0;
  22356. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22357. Laya.timer.loop(1000, this, this.updatePowerTime);
  22358. }
  22359. }
  22360. updatePowerTime() {
  22361. this.leftTime -= 1;
  22362. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22363. if (this.leftTime <= 0) {
  22364. this.checkPowerTime();
  22365. }
  22366. }
  22367. coinChange() {
  22368. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22369. }
  22370. diamondChange() {
  22371. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22372. }
  22373. addCoin() {
  22374. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22375. Moyu.sendDataEvent("AddCoinBtn");
  22376. xGame.uiMgr.Show(UIAddProp$1, 0);
  22377. }
  22378. addDiamond() {
  22379. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22380. Moyu.sendDataEvent("AddDiamondBtn");
  22381. xGame.uiMgr.Show(UIAddProp$1, 1);
  22382. }
  22383. }
  22384. class SettingNode$1 {
  22385. constructor(ui) {
  22386. this.showSetting = false;
  22387. this.openSound = true;
  22388. this.openShake = true;
  22389. this.ui = ui;
  22390. this.ui.soundBtn.onClick(this, this.switchSound);
  22391. this.ui.shakeBtn.onClick(this, this.switchShake);
  22392. this.ui.xyBtn.onClick(this, this.onXy);
  22393. this.ui.clickNode.onClick(this, this.changeSetting);
  22394. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22395. this.ui.xyBtn.visible = false;
  22396. this.ui.shakeBtn.visible = false;
  22397. }
  22398. changeSetting() {
  22399. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22400. this.showSetting = !this.showSetting;
  22401. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22402. }
  22403. switchSound() {
  22404. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22405. this.openSound = !this.openSound;
  22406. Moyu.onSetting(this.openSound, this.openShake);
  22407. xGame.soundMgr.onSetting(this.openSound);
  22408. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22409. }
  22410. switchShake() {
  22411. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22412. this.openShake = !this.openShake;
  22413. Moyu.onSetting(this.openSound, this.openShake);
  22414. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22415. }
  22416. onXy() {
  22417. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22418. MoyuMgr$1.showXy(1);
  22419. }
  22420. }
  22421. class UIDraw$1 extends UIBase {
  22422. constructor() {
  22423. super();
  22424. this.curKey = 0;
  22425. }
  22426. onConstructor() {
  22427. this.ui = ui_UIDraw.createInstance();
  22428. this.contentPane = this.ui;
  22429. this.isEject = false;
  22430. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22431. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22432. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22433. this.initDraw();
  22434. this.initUI();
  22435. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22436. }
  22437. show() {
  22438. super.show();
  22439. this.ui.t0.play();
  22440. this.playSecretaryIdle();
  22441. this.updateDraw();
  22442. this.checkFree();
  22443. if (PlatMgr.bannerDelay > 0) {
  22444. this.ui.closeNode.closeBtn.visible = false;
  22445. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22446. this.ui.closeNode.closeBtn.visible = true;
  22447. });
  22448. }
  22449. PlatMgr.showRateBanner();
  22450. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22451. this.setGlobalFont(this.ui);
  22452. }
  22453. hide() {
  22454. Laya.timer.clearAll(this);
  22455. super.hide();
  22456. }
  22457. checkFree() {
  22458. let isFree = DataMgr.getDailyfreeDrawTimes();
  22459. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22460. }
  22461. initDraw() {
  22462. this.drawObj = [];
  22463. let data = cfgTable.drawData;
  22464. let temp;
  22465. let weight = 0;
  22466. for (const key in data) {
  22467. temp = data[key];
  22468. weight += temp.weight;
  22469. this.drawObj.push(weight);
  22470. }
  22471. this.allWeight = weight;
  22472. }
  22473. initUI() {
  22474. let data = cfgTable.drawData;
  22475. let temp;
  22476. let img;
  22477. let txt;
  22478. for (const key in data) {
  22479. temp = data[key];
  22480. img = this.ui.myNode.rotNode["img" + key];
  22481. txt = this.ui.myNode.rotNode["txt" + key];
  22482. img.url = xGame.common.getGameIconUrl(temp.icon);
  22483. txt.visible = true;
  22484. if (temp.award > 2) {
  22485. img.rotation = 0;
  22486. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22487. }
  22488. else {
  22489. img.rotation = temp.rotation;
  22490. txt.text = temp.num;
  22491. }
  22492. }
  22493. }
  22494. getCurkey() {
  22495. let rand = Math.random() * this.allWeight;
  22496. let temp;
  22497. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22498. temp = this.drawObj[index];
  22499. if (index == 0) {
  22500. if (rand < temp) {
  22501. return index + 1;
  22502. }
  22503. }
  22504. else {
  22505. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22506. return index + 1;
  22507. }
  22508. }
  22509. }
  22510. return 2;
  22511. }
  22512. startDraw() {
  22513. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22514. if (freeTimes > 0) {
  22515. this.beginDraw();
  22516. DataMgr.setDailyfreeDrawTimes(0);
  22517. this.checkFree();
  22518. }
  22519. else {
  22520. if (Laya.Browser.onAndroid) {
  22521. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22522. if (!boo) {
  22523. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22524. return;
  22525. }
  22526. }
  22527. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22528. }
  22529. else {
  22530. console.log('zh:AD 失败,直接发放奖励');
  22531. this.qjff_chouJiang();
  22532. }
  22533. }
  22534. }
  22535. qjff_chouJiang() {
  22536. this.beginDraw();
  22537. }
  22538. beginDraw() {
  22539. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22540. this.ui.drawBtn.touchable = false;
  22541. this.curKey = this.getCurkey();
  22542. console.log("当前key", this.curKey);
  22543. let cell = 60;
  22544. let lap = 3;
  22545. let angle = cell * (this.curKey - 1) + lap * 360;
  22546. let target = this.ui.myNode.rotNode;
  22547. target.rotation = 0;
  22548. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22549. console.log("旋转完成");
  22550. this.ui.drawBtn.touchable = true;
  22551. this.getAward();
  22552. }));
  22553. }
  22554. getAward() {
  22555. let data = cfgTable.drawData[this.curKey];
  22556. let temp = new AwardType();
  22557. temp.type = data.award;
  22558. temp.num = data.num;
  22559. xGame.common.getAward([temp], () => {
  22560. DataMgr.setDrawTimes(1);
  22561. this.updateDraw();
  22562. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22563. });
  22564. }
  22565. updateDraw() {
  22566. let drawTimes = DataMgr.getDrawTimes();
  22567. let awardTimes = DataMgr.getDrawAwardTimes();
  22568. if (Math.floor(drawTimes / 3) > awardTimes) {
  22569. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22570. this.ui.extraNode.boxBtn.touchable = true;
  22571. this.ui.extraNode.tipsTxt.text = "3/3";
  22572. this.ui.extraNode.barNode.width = 265;
  22573. this.getExtraAward();
  22574. }
  22575. else {
  22576. this.ui.extraNode.boxBtn.t0.stop();
  22577. this.ui.extraNode.boxBtn.touchable = false;
  22578. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22579. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22580. }
  22581. let data = cfgTable.drawData[1];
  22582. if (awardTimes == 0) {
  22583. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22584. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22585. this.ui.myNode.rotNode.img1.rotation = 0;
  22586. }
  22587. else {
  22588. let award = data.nextid;
  22589. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22590. this.ui.myNode.rotNode.txt1.text = award[1];
  22591. this.ui.myNode.rotNode.img1.rotation = 0;
  22592. }
  22593. }
  22594. getExtraAward() {
  22595. let drawTimes = DataMgr.getDrawTimes();
  22596. let awardTimes = DataMgr.getDrawAwardTimes();
  22597. let data = cfgTable.drawData[1];
  22598. let award = new AwardType();
  22599. if (awardTimes == 0) {
  22600. award.num = data.num;
  22601. award.type = data.award;
  22602. xGame.common.getAward([award], () => {
  22603. let all = Math.floor(drawTimes / 3);
  22604. DataMgr.setDrawAwardTimes(all);
  22605. this.updateDraw();
  22606. });
  22607. }
  22608. else {
  22609. award.num = parseInt(data.nextid[1]);
  22610. award.type = parseInt(data.nextid[0]);
  22611. xGame.common.getAward([award], () => {
  22612. let all = Math.floor(drawTimes / 3);
  22613. DataMgr.setDrawAwardTimes(all);
  22614. this.updateDraw();
  22615. });
  22616. }
  22617. }
  22618. closeSelf() {
  22619. this.hide();
  22620. }
  22621. playSecretaryIdle() {
  22622. let parent = this.ui.secretary.displayObject;
  22623. parent.destroyChildren();
  22624. let xx = this.ui.secretary.width / 2;
  22625. let yy = this.ui.secretary.height;
  22626. let scale = xGame.common.getSecretaryScale();
  22627. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22628. xGame.common.secretary.play(data, 0, true, parent);
  22629. }
  22630. }
  22631. UIDraw$1.uiName = "UIDraw";
  22632. class UIRanking$1 extends UIBase {
  22633. constructor() {
  22634. super();
  22635. this.showSelf = true;
  22636. this.rankType = 1;
  22637. this.rankList = [];
  22638. this.topX = 10;
  22639. this.myIndex = this.topX + 1;
  22640. this.myStar = 0;
  22641. }
  22642. onConstructor() {
  22643. this.ui = ui_UIRanking.createInstance();
  22644. this.contentPane = this.ui;
  22645. this.isEject = false;
  22646. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22647. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22648. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22649. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22650. this.ui.myNode.myList.setVirtual();
  22651. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22652. }
  22653. show() {
  22654. super.show();
  22655. this.getPaiHangBangDataFormJosnFile();
  22656. this.updateSelf();
  22657. let self = Moyu.getUserInfo();
  22658. if (!self.isAuth) {
  22659. Moyu.initUser(this, () => {
  22660. DataMgr.upRankData();
  22661. });
  22662. }
  22663. this.setGlobalFont(this.ui);
  22664. }
  22665. getPaiHangBangDataFormJosnFile() {
  22666. const rankingList = cfgTable.paiHangBangData.list;
  22667. this.updateItemData(rankingList);
  22668. }
  22669. updateSelfItem() {
  22670. console.log('zh:Moyu.platType =' + Moyu.platType);
  22671. let self = Moyu.getUserInfo();
  22672. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22673. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22674. if (this.myIndex > this.topX) {
  22675. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22676. }
  22677. else {
  22678. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22679. }
  22680. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22681. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22682. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22683. }
  22684. updateItemData(data) {
  22685. this.myStar = xGame.common.getAllStarNum();
  22686. if (this.rankList.length < 2) {
  22687. this.rankList = data;
  22688. let self = Moyu.getUserInfo();
  22689. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22690. self.headIcon = self.headIcon;
  22691. for (let i = 0; i < data.length; i++) {
  22692. let data = this.rankList[i];
  22693. if (data.userId == self.userId) {
  22694. this.rankList.splice(i, 1);
  22695. break;
  22696. }
  22697. }
  22698. for (let i = 0; i < data.length; i++) {
  22699. let data = this.rankList[i];
  22700. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22701. this.myIndex = i + 1;
  22702. let user = { headIcon: self.headIcon, nickName: "myself" };
  22703. let ud = { user: user, data: {} };
  22704. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22705. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22706. if (Moyu.platType < 11) {
  22707. user.headIcon = self.headIcon;
  22708. user.nickName = self.nickName;
  22709. }
  22710. this.rankList.splice(i, 0, md);
  22711. break;
  22712. }
  22713. }
  22714. }
  22715. this.updateSelfItem();
  22716. this.ui.myNode.myList.numItems = this.rankList.length;
  22717. }
  22718. updateItemUI(index, obj) {
  22719. let data = this.rankList[index];
  22720. let userData = JSON.parse(data.userData).user;
  22721. obj.nameTxt.text = userData.nickName.toString();
  22722. obj.valueTxt.text = data.rankScore;
  22723. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22724. obj.rankTxt.text = index + 1;
  22725. switch (index) {
  22726. case 0:
  22727. this.setImg(obj, 1, 0, 0);
  22728. obj.rankTxt.color = "#FFC047";
  22729. break;
  22730. case 1:
  22731. this.setImg(obj, 0, 1, 0);
  22732. obj.rankTxt.color = "#ACACAC";
  22733. break;
  22734. case 2:
  22735. this.setImg(obj, 0, 0, 1);
  22736. obj.rankTxt.color = "#D09672";
  22737. break;
  22738. default:
  22739. this.setImg(obj, 0, 0, 0);
  22740. obj.rankTxt.color = "#496FAB";
  22741. break;
  22742. }
  22743. }
  22744. setImg(obj, a, b, c) {
  22745. obj.img1.visible = a ? true : false;
  22746. obj.img2.visible = b ? true : false;
  22747. obj.img3.visible = c ? true : false;
  22748. }
  22749. changeList(type) {
  22750. this.rankType = type;
  22751. this.updateSelf();
  22752. }
  22753. changeSelfNode() {
  22754. this.showSelf = !this.showSelf;
  22755. this.updateSelf();
  22756. }
  22757. updateSelf() {
  22758. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22759. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22760. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22761. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22762. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22763. }
  22764. }
  22765. UIRanking$1.uiName = "UIRanking";
  22766. class UISecretary$1 extends UIBase {
  22767. constructor() {
  22768. super();
  22769. this.curIndex = 1;
  22770. }
  22771. onConstructor() {
  22772. this.ui = ui_UISecretary.createInstance();
  22773. this.contentPane = this.ui;
  22774. this.isEject = false;
  22775. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22776. this.nodeObj = { left: null, right: null, cur: null };
  22777. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22778. }
  22779. show() {
  22780. super.show();
  22781. this.ui.t0.play();
  22782. this.updateData();
  22783. this.setGlobalFont(this.ui);
  22784. }
  22785. addSecretarySpine(node, spineName) {
  22786. if (spineName == "mishu") {
  22787. if (this.secretarySpine1) {
  22788. node.displayObject.destroyChildren();
  22789. this.playWoman(this.secretarySpine1, node.displayObject);
  22790. }
  22791. else {
  22792. let spine1 = new SpineMgr("mishu", () => {
  22793. this.secretarySpine1 = spine1;
  22794. this.playWoman(this.secretarySpine1, node.displayObject);
  22795. });
  22796. }
  22797. }
  22798. else {
  22799. if (this.secretarySpine2) {
  22800. node.displayObject.destroyChildren();
  22801. this.playWoman(this.secretarySpine2, node.displayObject);
  22802. }
  22803. else {
  22804. let spine2 = new SpineMgr("xiaomishu2", () => {
  22805. this.secretarySpine2 = spine2;
  22806. this.playWoman(this.secretarySpine2, node.displayObject);
  22807. });
  22808. }
  22809. }
  22810. }
  22811. playWoman(node, parent) {
  22812. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22813. let yy = this.ui.myNode.gameNode3.secretary.height;
  22814. let scale = 1.5;
  22815. if (node == this.secretarySpine2) {
  22816. scale = 1.2;
  22817. }
  22818. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22819. node.play(data, 0, true, parent);
  22820. }
  22821. turnLeft() {
  22822. this.curIndex--;
  22823. if (this.curIndex < 1) {
  22824. this.curIndex = 2;
  22825. }
  22826. let left = this.nodeObj.left;
  22827. let right = this.nodeObj.right;
  22828. let cur = this.nodeObj.cur;
  22829. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22830. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22831. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22832. this.updateData();
  22833. }));
  22834. this.ui.myNode.setChildIndex(right, 2);
  22835. this.nodeObj.left = cur;
  22836. this.nodeObj.right = left;
  22837. this.nodeObj.cur = right;
  22838. }
  22839. turnRight() {
  22840. this.curIndex++;
  22841. if (this.curIndex > 2) {
  22842. this.curIndex = 1;
  22843. }
  22844. let left = this.nodeObj.left;
  22845. let right = this.nodeObj.right;
  22846. let cur = this.nodeObj.cur;
  22847. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22848. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22849. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22850. this.updateData();
  22851. }));
  22852. this.ui.myNode.setChildIndex(left, 2);
  22853. this.nodeObj.left = right;
  22854. this.nodeObj.right = cur;
  22855. this.nodeObj.cur = left;
  22856. }
  22857. updateData() {
  22858. console.log('zh: updateData FFFFFFFFFF');
  22859. let data = cfgTable.secretaryshopData;
  22860. let children = this.ui.myNode._children;
  22861. let temp;
  22862. let curData;
  22863. for (let index = 0; index < children.length; index++) {
  22864. temp = children[index];
  22865. curData = data[1];
  22866. temp.heightTxt.text = curData.height;
  22867. temp.foodTxt.text = curData.food;
  22868. temp.historyTxt.text = curData.history;
  22869. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22870. this.addSecretarySpine(temp.secretary, curData.spine);
  22871. let womanIndex = curData.id - 1;
  22872. let getWoman = DataMgr.getSecretary(womanIndex);
  22873. let curUse = DataMgr.getCurSecretary();
  22874. if (getWoman) {
  22875. if (curUse == womanIndex) {
  22876. temp.purchaseBtn.c1.selectedIndex = 1;
  22877. }
  22878. else {
  22879. temp.purchaseBtn.c1.selectedIndex = 2;
  22880. }
  22881. }
  22882. else {
  22883. temp.purchaseBtn.c1.selectedIndex = 0;
  22884. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  22885. }
  22886. temp.purchaseBtn.visible = false;
  22887. }
  22888. }
  22889. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  22890. console.log('zh: 点击了clickSecretary ');
  22891. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22892. if (getWoman) {
  22893. if (curUse != womanIndex) {
  22894. console.log();
  22895. DataMgr.setCurSecretary(womanIndex);
  22896. this.updateData();
  22897. }
  22898. }
  22899. else {
  22900. console.log('zh:点击购买了');
  22901. let need = needDiamond;
  22902. if (DataMgr.diamondEnough(need)) {
  22903. DataMgr.setDiamond(-need);
  22904. DataMgr.setSecretary(womanIndex, 1);
  22905. DataMgr.setCurSecretary(womanIndex);
  22906. this.updateData();
  22907. }
  22908. else {
  22909. xGame.uiMgr.Show(UIAddProp$1, 1);
  22910. }
  22911. }
  22912. }
  22913. closeSelf() {
  22914. this.hide();
  22915. }
  22916. }
  22917. UISecretary$1.uiName = "UISecretary";
  22918. class BallRodDisplay$1 {
  22919. constructor(ui, index) {
  22920. this.index = 0;
  22921. this.uiIndex = 0;
  22922. this.ui = ui;
  22923. this.index = index;
  22924. this.initData();
  22925. }
  22926. initData() {
  22927. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  22928. let data = cfgTable.ballrodData[this.index + 1];
  22929. this.ui.nameTxt.text = data.name;
  22930. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  22931. this.ui.levelNode.c1.selectedIndex = data.quality;
  22932. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  22933. if (data.spine) {
  22934. this.mySpine = new SpineMgr(data.spine, () => {
  22935. let xx = 150;
  22936. let yy = 70;
  22937. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  22938. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  22939. });
  22940. }
  22941. }
  22942. updateSelf() {
  22943. let get = DataMgr.getBallRod(this.index);
  22944. if (get == null)
  22945. get = 1;
  22946. let curUse = DataMgr.getCurBallRod();
  22947. if (get) {
  22948. if (curUse == this.index) {
  22949. this.ui.purchaseBtn.c1.selectedIndex = 0;
  22950. }
  22951. else {
  22952. this.ui.purchaseBtn.c1.selectedIndex = 1;
  22953. }
  22954. }
  22955. else {
  22956. this.ui.purchaseBtn.c1.selectedIndex = 2;
  22957. }
  22958. }
  22959. buyBallRod() {
  22960. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22961. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  22962. switch (selectedIndex) {
  22963. case 0:
  22964. break;
  22965. case 1:
  22966. console.log('zh:点击了 USE THIS');
  22967. DataMgr.setCurBallRod(this.index);
  22968. let curUse = DataMgr.getCurBallRod();
  22969. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  22970. let ui = xGame.uiMgr.getUI(UIShop$1);
  22971. ui.updateBallRod();
  22972. break;
  22973. case 2:
  22974. let data = cfgTable.ballrodData[this.index + 1];
  22975. let need = data.price;
  22976. if (DataMgr.diamondEnough(need)) {
  22977. this.buyQiuGan(data);
  22978. DataMgr.setDiamond(-need);
  22979. DataMgr.setBallRod(this.index, 1);
  22980. DataMgr.setCurBallRod(this.index);
  22981. let ui = xGame.uiMgr.getUI(UIShop$1);
  22982. ui.updateBallRod();
  22983. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  22984. }
  22985. else {
  22986. xGame.uiMgr.Show(UIAddProp$1, 1);
  22987. }
  22988. break;
  22989. default:
  22990. break;
  22991. }
  22992. }
  22993. buyQiuGan(qgItem) {
  22994. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  22995. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  22996. if (userInfo == null) {
  22997. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  22998. return;
  22999. }
  23000. let reqData = xGame.httpMgr.getReqData();
  23001. let pd = JSON.parse(reqData);
  23002. pd.qiuGanData = qgItem;
  23003. reqData = JSON.stringify(pd);
  23004. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23005. try {
  23006. console.log('zh:buySp res = ' + JSON.stringify(res));
  23007. let code = res.code;
  23008. let msg = res.msg;
  23009. if (code == 401) {
  23010. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23011. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23012. return;
  23013. }
  23014. if (code == 200) {
  23015. xGame.uiMgr.Show(UIMsg$1, msg);
  23016. DataMgr.getUserZiChanInfo(false);
  23017. }
  23018. else {
  23019. xGame.uiMgr.Show(UIMsg$1, msg);
  23020. }
  23021. }
  23022. catch (error) {
  23023. console.log('error=' + error);
  23024. alert(error);
  23025. }
  23026. finally {
  23027. }
  23028. });
  23029. }
  23030. logEventForGouMaiGan(qiuGanName) {
  23031. const ev = {
  23032. value: qiuGanName
  23033. };
  23034. const jsonStr = JSON.stringify(ev);
  23035. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23036. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23037. }
  23038. }
  23039. class DaoJuDisplay$1 {
  23040. constructor(ui, index) {
  23041. this.index = 0;
  23042. this.uiIndex = 0;
  23043. this.ggSpid = "";
  23044. this.spid = 0;
  23045. this.ui = ui;
  23046. this.index = index;
  23047. this.initData();
  23048. }
  23049. initData() {
  23050. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23051. let data = cfgTable.daoJuData[this.index + 1];
  23052. this.ui.nameTxt.text = data.spbt;
  23053. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23054. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23055. this.ggSpid = data.ggSpid;
  23056. this.spid = data.spid;
  23057. let baseUrl = "asset/sound/ogg/";
  23058. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23059. }
  23060. gotoBuy() {
  23061. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23062. if (userInfo != null) {
  23063. let token = userInfo.token;
  23064. let ggSpid = this.ggSpid;
  23065. let spid = this.spid;
  23066. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23067. console.log('zh:gotoBuy1 spid =' + spid);
  23068. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23069. return;
  23070. }
  23071. else {
  23072. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23073. }
  23074. }
  23075. gotoBuy1() {
  23076. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23077. let djItem = cfgTable.daoJuData[this.index + 1];
  23078. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23079. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23080. if (userInfo == null) {
  23081. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23082. return;
  23083. }
  23084. let reqData = xGame.httpMgr.getReqData();
  23085. let pd = JSON.parse(reqData);
  23086. pd.spItem = djItem;
  23087. reqData = JSON.stringify(pd);
  23088. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23089. try {
  23090. console.log('zh:buySp res = ' + JSON.stringify(res));
  23091. let code = res.code;
  23092. let msg = res.msg;
  23093. if (code == 401) {
  23094. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23095. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23096. return;
  23097. }
  23098. if (code == 200) {
  23099. xGame.uiMgr.Show(UIMsg$1, msg);
  23100. DataMgr.getUserZiChanInfo(false);
  23101. }
  23102. else {
  23103. xGame.uiMgr.Show(UIMsg$1, msg);
  23104. }
  23105. }
  23106. catch (error) {
  23107. console.log('error=' + error);
  23108. alert(error);
  23109. }
  23110. finally {
  23111. }
  23112. });
  23113. }
  23114. }
  23115. class UIShop$1 extends UIBase {
  23116. constructor() {
  23117. super();
  23118. this.itemNums = 0;
  23119. this.itemNumsForDj = 0;
  23120. this.curType = "";
  23121. }
  23122. onConstructor() {
  23123. this.ui = ui_UIShop.createInstance();
  23124. this.contentPane = this.ui;
  23125. this.isEject = false;
  23126. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23127. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23128. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23129. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23130. this.addUIClick(this.ui, this.interuptSecretary);
  23131. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23132. this.ballRodArr = [];
  23133. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23134. this.ui.myNode.myList.numItems = this.itemNums;
  23135. this.loadDjdata_old();
  23136. }
  23137. loadDjdata_old() {
  23138. let fff = cfgTable.daoJuData;
  23139. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23140. this.daoJuArr = [];
  23141. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23142. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23143. }
  23144. getProductList() {
  23145. let reqData = xGame.httpMgr.getReqData();
  23146. let pd = JSON.parse(reqData);
  23147. pd.splx = "Consumable";
  23148. reqData = JSON.stringify(pd);
  23149. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23150. try {
  23151. let code = res.code;
  23152. let msg = res.msg;
  23153. if (code == 401) {
  23154. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23155. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23156. return;
  23157. }
  23158. if (code == 200) {
  23159. let data = res.data;
  23160. for (let index = 0; index < data.length; index++) {
  23161. let element = data[index];
  23162. cfgTable.daoJuData[element.spid] = element;
  23163. }
  23164. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23165. }
  23166. else {
  23167. xGame.uiMgr.Show(UIMsg, msg);
  23168. }
  23169. }
  23170. catch (error) {
  23171. console.log('error=' + error);
  23172. alert(error);
  23173. }
  23174. finally {
  23175. }
  23176. });
  23177. }
  23178. show(type) {
  23179. super.show();
  23180. this.curType = type == 0 ? "qiugan" : "daoju";
  23181. this.switchBtn("");
  23182. this.playSecretaryIdle();
  23183. this.updateBallRod();
  23184. this.setGlobalFont(this.ui);
  23185. }
  23186. test123() {
  23187. console.log('zh:test123 ');
  23188. }
  23189. switchBtn(type) {
  23190. console.log('zh:1111切換 sel type=' + type);
  23191. if (type == "") {
  23192. type = this.curType;
  23193. }
  23194. else {
  23195. if (this.curType == type) {
  23196. return;
  23197. }
  23198. else {
  23199. this.curType = type;
  23200. }
  23201. }
  23202. if (type == "qiugan") {
  23203. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23204. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23205. this.ui.myNode.c1.selectedIndex = 0;
  23206. this.ui.myNode.myList.visible = true;
  23207. this.ui.myNode.djList.visible = false;
  23208. }
  23209. else {
  23210. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23211. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23212. this.ui.myNode.c1.selectedIndex = 1;
  23213. this.ui.myNode.myList.visible = false;
  23214. this.ui.myNode.djList.visible = true;
  23215. }
  23216. }
  23217. updateBallRod() {
  23218. for (let index = 0; index < this.ballRodArr.length; index++) {
  23219. this.ballRodArr[index].updateSelf();
  23220. }
  23221. }
  23222. renderBallRod(sort, obj) {
  23223. let index = this.getIndexBySort(sort + 1) - 1;
  23224. let ballRod = new BallRodDisplay$1(obj, index);
  23225. this.ballRodArr.push(ballRod);
  23226. }
  23227. renderDaoJu(idx, obj) {
  23228. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23229. let b = new DaoJuDisplay$1(obj, index);
  23230. this.daoJuArr.push(b);
  23231. }
  23232. getIndexBySort(sort) {
  23233. let object = cfgTable.ballrodData;
  23234. for (const key in object) {
  23235. if (object[key].sort == sort) {
  23236. return parseInt(key);
  23237. }
  23238. }
  23239. }
  23240. getIndexBySortForDj(idx) {
  23241. let object = cfgTable.daoJuData;
  23242. for (const key in object) {
  23243. if (object[key].idx == idx) {
  23244. return parseInt(key);
  23245. }
  23246. }
  23247. }
  23248. playSecretaryIdle() {
  23249. let parent = this.ui.secretary.displayObject;
  23250. parent.destroyChildren();
  23251. let xx = this.ui.secretary.width / 2;
  23252. let yy = this.ui.secretary.height;
  23253. let scale = xGame.common.getSecretaryScale();
  23254. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23255. xGame.common.secretary.play(data, 0, true, parent);
  23256. }
  23257. interuptSecretary() {
  23258. Laya.timer.clearAll(this);
  23259. this.playSecretaryRandomSound();
  23260. }
  23261. playSecretaryRandomSound() {
  23262. if (this.isHide)
  23263. return;
  23264. let time = xGame.common.randomNum(45000, 60000);
  23265. Laya.timer.once(time, this, () => {
  23266. if (this.isHide)
  23267. return;
  23268. let index = xGame.common.randomNum(4, 7);
  23269. xGame.soundMgr.playSound("s_main0" + index);
  23270. let words = 1;
  23271. switch (index) {
  23272. case 4:
  23273. words = 5;
  23274. break;
  23275. case 5:
  23276. words = 3;
  23277. break;
  23278. case 6:
  23279. words = 6;
  23280. break;
  23281. case 7:
  23282. words = 7;
  23283. break;
  23284. default:
  23285. break;
  23286. }
  23287. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23288. this.playSecretaryRandomSound();
  23289. });
  23290. }
  23291. closeSelf() {
  23292. this.hide();
  23293. }
  23294. }
  23295. UIShop$1.uiName = "UIShop";
  23296. class SignMax$1 {
  23297. constructor(ui) {
  23298. this.ui = ui;
  23299. }
  23300. updateSelf(index, sameDay, curDayIndex) {
  23301. let data = cfgTable.signData[index + 1];
  23302. this.ui.titleTxt.text = data.title;
  23303. let arr1 = data.award[0].split('-');
  23304. let arr2 = data.award[1].split('-');
  23305. let num1 = parseInt(arr1[1]);
  23306. let num2 = parseInt(arr2[1]);
  23307. this.ui.numTxt1.text = num1 + "";
  23308. this.ui.numTxt2.text = num2 + "";
  23309. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23310. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23311. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23312. this.ui.numTxt1.visible = false;
  23313. }
  23314. else {
  23315. this.ui.numTxt1.visible = true;
  23316. }
  23317. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23318. this.ui.numTxt2.visible = false;
  23319. }
  23320. else {
  23321. this.ui.numTxt2.visible = true;
  23322. }
  23323. if (index < curDayIndex) {
  23324. this.ui.c1.selectedIndex = 1;
  23325. }
  23326. else if (index == curDayIndex) {
  23327. if (sameDay) {
  23328. this.ui.c1.selectedIndex = 2;
  23329. }
  23330. else {
  23331. this.ui.c1.selectedIndex = 2;
  23332. }
  23333. }
  23334. else {
  23335. this.ui.c1.selectedIndex = 0;
  23336. }
  23337. }
  23338. }
  23339. class SignNormal$1 {
  23340. constructor(ui) {
  23341. this.ui = ui;
  23342. }
  23343. updateSelf(index, sameDay, curDayIndex) {
  23344. let data = cfgTable.signData[index + 1];
  23345. this.ui.titleTxt.text = data.title;
  23346. let arr = data.award[0].split('-');
  23347. let type = parseInt(arr[0]);
  23348. let num = parseInt(arr[1]);
  23349. this.ui.numTxt.text = num + "";
  23350. if (type > 2) {
  23351. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23352. this.ui.myIcon.rotation = 0;
  23353. }
  23354. else {
  23355. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23356. this.ui.myIcon.rotation = 0;
  23357. }
  23358. if (xGame.common.signAwardContainsRod(data.award)) {
  23359. this.ui.numTxt.visible = false;
  23360. }
  23361. else {
  23362. this.ui.numTxt.visible = true;
  23363. }
  23364. if (index < curDayIndex) {
  23365. this.ui.c1.selectedIndex = 1;
  23366. }
  23367. else if (index == curDayIndex) {
  23368. if (sameDay) {
  23369. this.ui.c1.selectedIndex = 2;
  23370. }
  23371. else {
  23372. this.ui.c1.selectedIndex = 2;
  23373. }
  23374. }
  23375. else {
  23376. this.ui.c1.selectedIndex = 0;
  23377. }
  23378. }
  23379. }
  23380. class UISign$1 extends UIBase {
  23381. constructor() {
  23382. super();
  23383. this.curDayIndex = 0;
  23384. this.starX = 0;
  23385. }
  23386. onConstructor() {
  23387. this.ui = ui_UISign.createInstance();
  23388. this.contentPane = this.ui;
  23389. this.isEject = false;
  23390. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23391. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23392. this.initSignItem();
  23393. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23394. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23395. }
  23396. show() {
  23397. super.show();
  23398. this.ui.t0.play();
  23399. this.playSecretaryIdle();
  23400. this.updateSign();
  23401. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23402. this.setGlobalFont(this.ui);
  23403. }
  23404. initSignItem() {
  23405. this.signArr = [];
  23406. for (let index = 0; index < 6; index++) {
  23407. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23408. this.signArr.push(temp);
  23409. }
  23410. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23411. if (Moyu.isKs)
  23412. this.ui.closeNode.closeBtn.x += 100;
  23413. }
  23414. updateSign() {
  23415. let sameDay = xGame.common.judgeSameDay();
  23416. let max = 7;
  23417. this.curDayIndex = DataMgr.getSignData();
  23418. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23419. this.curDayIndex = 0;
  23420. if (!sameDay) {
  23421. this.ui.normalBtn.visible = true;
  23422. this.ui.tipsNode.visible = false;
  23423. this.ui.againBtn.visible = false;
  23424. }
  23425. else {
  23426. this.ui.normalBtn.visible = false;
  23427. let again = DataMgr.getExtraSign();
  23428. let isCurrency = false;
  23429. let index = this.curDayIndex;
  23430. if (index == 0)
  23431. index = 7;
  23432. let award = cfgTable.signData[index].award;
  23433. let num = award[0].split("-")[0];
  23434. if (num == "1" || num == "2")
  23435. isCurrency = true;
  23436. let showAgain = again == 0 && isCurrency;
  23437. this.ui.againBtn.visible = showAgain;
  23438. this.ui.tipsNode.visible = !showAgain;
  23439. }
  23440. for (let index = 0; index < this.signArr.length; index++) {
  23441. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23442. }
  23443. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23444. }
  23445. playSecretaryIdle() {
  23446. let parent = this.ui.secretary.displayObject;
  23447. parent.destroyChildren();
  23448. let xx = this.ui.secretary.width / 2;
  23449. let yy = this.ui.secretary.height;
  23450. let scale = xGame.common.getSecretaryScale();
  23451. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23452. xGame.common.secretary.play(data, 0, true, parent);
  23453. }
  23454. closeSelf() {
  23455. this.hide();
  23456. }
  23457. normalGetAward() {
  23458. let sameDay = xGame.common.judgeSameDay();
  23459. if (!sameDay) {
  23460. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23461. let temp;
  23462. let type;
  23463. let num;
  23464. let arr = [];
  23465. for (let index = 0; index < award.length; index++) {
  23466. temp = award[index].split("-");
  23467. type = parseInt(temp[0]);
  23468. num = parseInt(temp[1]);
  23469. let awardType = new AwardType();
  23470. awardType.num = num;
  23471. awardType.type = type;
  23472. arr.push(awardType);
  23473. }
  23474. xGame.common.getAward(arr, (watchVideo) => {
  23475. this.curDayIndex++;
  23476. if (this.curDayIndex > 7)
  23477. this.curDayIndex = 0;
  23478. DataMgr.setSignData(this.curDayIndex);
  23479. this.updateSignData2Server(this.curDayIndex);
  23480. DataMgr.setSignTime(new Date().getTime());
  23481. if (watchVideo) {
  23482. DataMgr.setExtraSign(1);
  23483. Moyu.sendDataEvent("signIn1");
  23484. }
  23485. this.updateSign();
  23486. });
  23487. }
  23488. }
  23489. againGetAward() {
  23490. Moyu.sendDataEvent("signIn2");
  23491. console.log('zh:qjff_AD_for_uisign');
  23492. if (Laya.Browser.onAndroid) {
  23493. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23494. if (!boo) {
  23495. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23496. return;
  23497. }
  23498. }
  23499. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23500. }
  23501. else {
  23502. console.log('zh:AD 失败,直接发放奖励');
  23503. this.qjff_AD_for_uisign();
  23504. }
  23505. }
  23506. qjff_AD_for_uisign() {
  23507. let index = this.curDayIndex;
  23508. if (index == 0)
  23509. index = 7;
  23510. let award = cfgTable.signData[index].award;
  23511. let temp;
  23512. let type;
  23513. let num;
  23514. for (let index = 0; index < award.length; index++) {
  23515. temp = award[index].split("-");
  23516. type = parseInt(temp[0]);
  23517. num = parseInt(temp[1]) * 3;
  23518. xGame.common.playObjFlyAnim(num, type);
  23519. }
  23520. DataMgr.setExtraSign(1);
  23521. this.updateSign();
  23522. }
  23523. updateSignData2Server(day) {
  23524. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23525. if (userInfo == null) {
  23526. return;
  23527. }
  23528. let reqData = xGame.httpMgr.getReqData();
  23529. let pd = JSON.parse(reqData);
  23530. pd.signData = day;
  23531. reqData = JSON.stringify(pd);
  23532. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  23533. try {
  23534. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  23535. let code = res.code;
  23536. let msg = res.msg;
  23537. if (code == 401) {
  23538. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23539. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23540. return;
  23541. }
  23542. if (code == 200) {
  23543. let data = res.data;
  23544. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  23545. }
  23546. else {
  23547. xGame.uiMgr.Show(UIMsg$1, msg);
  23548. }
  23549. }
  23550. catch (error) {
  23551. console.log('error=' + error);
  23552. alert(error);
  23553. }
  23554. finally {
  23555. }
  23556. });
  23557. }
  23558. }
  23559. UISign$1.uiName = "UISign";
  23560. class UIModeSelection$1 extends UIBase {
  23561. constructor() {
  23562. super();
  23563. }
  23564. onConstructor() {
  23565. this.ui = ui_UIModeSelection.createInstance();
  23566. this.contentPane = this.ui;
  23567. this.isEject = false;
  23568. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23569. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23570. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23571. this.addUIClick(this.ui.closeBtn, this.hide);
  23572. this.peopleArr = [65, 990, 580];
  23573. this.peopleOffest = [5, 10, 10];
  23574. }
  23575. show(callback) {
  23576. this.updateSelf();
  23577. super.show();
  23578. this.ui.t0.play();
  23579. this.callback = callback;
  23580. this.setGlobalFont(this.ui);
  23581. }
  23582. updateSelf() {
  23583. let cfg = cfgTable.modeselectData;
  23584. for (let index = 1; index <= 3; index++) {
  23585. let node = this.ui.myNode["type" + index];
  23586. node.need.text = cfg[index].need;
  23587. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23588. node.peopleTxt.text = this.getRandPeople(index - 1);
  23589. }
  23590. }
  23591. enterGame(type) {
  23592. console.log('zh: 进入经典模式 type: ' + type);
  23593. xGame.common.classicRoomType = type;
  23594. let cfg = cfgTable.modeselectData[type];
  23595. let need = cfg.need;
  23596. xGame.common.passAwardCoin = cfg.award;
  23597. if (DataMgr.coinEnough(need)) {
  23598. DataMgr.setCoin(-need);
  23599. this.ui.myNode["type" + type].t0.play();
  23600. Laya.timer.once(200, this, () => {
  23601. this.callback && this.callback();
  23602. });
  23603. this.logEventForClassic_start();
  23604. }
  23605. else {
  23606. Moyu.sendDataEvent("AddCoinVideo");
  23607. xGame.uiMgr.Show(UIAddProp$1, 0);
  23608. }
  23609. }
  23610. getRandPeople(index) {
  23611. let rand = this.peopleOffest[index];
  23612. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23613. }
  23614. logEventForClassic_start() {
  23615. let rtype = xGame.common.classicRoomType;
  23616. let msmc = '';
  23617. if (rtype == 1) {
  23618. msmc = 'beginner';
  23619. }
  23620. if (rtype == 2) {
  23621. msmc = 'expert';
  23622. }
  23623. if (rtype == 3) {
  23624. msmc = 'master';
  23625. }
  23626. let keyStr = 'sjmd_classic_start_' + rtype;
  23627. let jsonStr = {
  23628. "difficulty": msmc,
  23629. "classic_count": 1,
  23630. "difficulty_count": 1
  23631. };
  23632. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23633. const d = LocalStorageManager.getItem(keyStr);
  23634. jsonStr.classic_count = d.classic_count + 1;
  23635. jsonStr.difficulty_count = d.difficulty_count + 1;
  23636. LocalStorageManager.setItem(keyStr, jsonStr);
  23637. }
  23638. else {
  23639. LocalStorageManager.setItem(keyStr, jsonStr);
  23640. }
  23641. const reqStr = JSON.stringify(jsonStr);
  23642. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23643. }
  23644. }
  23645. UIModeSelection$1.uiName = "UIModeSelection";
  23646. class UILogin$1 extends UIBase {
  23647. constructor() {
  23648. super();
  23649. }
  23650. onConstructor() {
  23651. this.ui = ui_UILogin.createInstance();
  23652. this.contentPane = this.ui;
  23653. this.isEject = false;
  23654. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23655. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23656. this.addUIClick(this.ui.btn_login, this.userLogin);
  23657. }
  23658. show() {
  23659. super.show();
  23660. this.x = (Laya.stage.width - this.width) / 2;
  23661. this.y = (Laya.stage.height - this.height) / 2;
  23662. this.setGlobalFont(this.ui);
  23663. }
  23664. closeSelf() {
  23665. this.hide();
  23666. }
  23667. userLogin() {
  23668. let ua = this.ui.txt_ua.text;
  23669. let up = this.ui.txt_up.text;
  23670. if (ua && up) {
  23671. let reqData = JSON.stringify({
  23672. username: ua.trim(),
  23673. password: up.trim(),
  23674. fromMark: 'app_game'
  23675. });
  23676. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23677. try {
  23678. console.log('zh:res = ' + JSON.stringify(res));
  23679. let code = res.code;
  23680. let msg = res.msg;
  23681. if (code == 200) {
  23682. let keyStr = keyForLoginInfo;
  23683. let jsonStr = {
  23684. "username": res.username,
  23685. "token": res.token,
  23686. "buySpids": { 1: false, 7: false }
  23687. };
  23688. LocalStorageManager.setItem(keyStr, jsonStr);
  23689. let myu = Moyu.getUserInfo();
  23690. console.log('zh:myu = ' + JSON.stringify(myu));
  23691. DataMgr.updateUserNickName(res.username);
  23692. Moyu.updateUserInfo(res.username);
  23693. xGame.uiMgr.Show(UIMsg$1, msg);
  23694. DataMgr.loadUserSpOrderForAd();
  23695. DataMgr.getUserZiChanInfo(false);
  23696. xGame.eventMgr.event(LOGIN_IN);
  23697. this.closeSelf();
  23698. }
  23699. else {
  23700. xGame.uiMgr.Show(UIMsg$1, msg);
  23701. }
  23702. }
  23703. catch (error) {
  23704. console.log('error=' + error);
  23705. alert(error);
  23706. }
  23707. finally {
  23708. }
  23709. });
  23710. }
  23711. else {
  23712. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23713. }
  23714. }
  23715. gotoRegPage() {
  23716. this.closeSelf();
  23717. xGame.uiMgr.Show(UIReg$1);
  23718. }
  23719. }
  23720. UILogin$1.uiName = "UILogin";
  23721. class UIReg$1 extends UIBase {
  23722. constructor() {
  23723. super();
  23724. }
  23725. onConstructor() {
  23726. this.ui = ui_UIReg.createInstance();
  23727. this.contentPane = this.ui;
  23728. this.isEject = false;
  23729. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23730. this.addUIClick(this.ui.btn_reg, this.regUser);
  23731. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23732. }
  23733. show() {
  23734. super.show();
  23735. this.x = (Laya.stage.width - this.width) / 2;
  23736. this.y = (Laya.stage.height - this.height) / 2;
  23737. this.setGlobalFont(this.ui);
  23738. }
  23739. closeSelf() {
  23740. this.hide();
  23741. }
  23742. regUser() {
  23743. this.ui.lab_tip.visible = false;
  23744. let ua = this.ui.txt_ua.text;
  23745. let up1 = this.ui.txt_up1.text;
  23746. let up2 = this.ui.txt_up2.text;
  23747. if (ua && up1 && up2 && up1 == up2) {
  23748. let reqData = JSON.stringify({
  23749. username: ua.trim(),
  23750. password: up1.trim(),
  23751. fromMark: 'app_game'
  23752. });
  23753. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23754. try {
  23755. console.log('zh:res = ' + JSON.stringify(res));
  23756. let code = res.code;
  23757. let msg = res.msg;
  23758. xGame.uiMgr.Show(UIMsg$1, msg);
  23759. if (code == 200) {
  23760. this.ui.lab_tip.color = "#FFFFFF";
  23761. xGame.uiMgr.Show(UIMsg$1, msg);
  23762. this.closeSelf();
  23763. }
  23764. else {
  23765. this.ui.lab_tip.color = "#FF0000";
  23766. xGame.uiMgr.Show(UIMsg$1, msg);
  23767. }
  23768. }
  23769. catch (error) {
  23770. console.log('error=' + error);
  23771. alert(error);
  23772. }
  23773. finally {
  23774. }
  23775. });
  23776. }
  23777. else {
  23778. if (up1 != up2) {
  23779. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23780. }
  23781. else {
  23782. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23783. }
  23784. }
  23785. }
  23786. gotoLogin() {
  23787. this.closeSelf();
  23788. xGame.uiMgr.Show(UILogin$1);
  23789. }
  23790. }
  23791. UIReg$1.uiName = "UIReg";
  23792. class UIFuli1$1 extends UIBase {
  23793. constructor() {
  23794. super();
  23795. this.jiage = 4.99;
  23796. }
  23797. onConstructor() {
  23798. this.ui = ui_UIFuli1.createInstance();
  23799. this.contentPane = this.ui;
  23800. this.isEject = false;
  23801. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23802. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23803. }
  23804. show() {
  23805. super.show();
  23806. this.x = (Laya.stage.width - this.width) / 2;
  23807. this.y = (Laya.stage.height - this.height) / 2;
  23808. this.ui.n2.txt_price.text = "$" + this.jiage;
  23809. this.setGlobalFont(this.ui);
  23810. }
  23811. closeSelf() {
  23812. DataMgr.loadUserSpOrderForAd();
  23813. this.hide();
  23814. }
  23815. gotoBuy() {
  23816. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23817. if (userInfo != null) {
  23818. let token = userInfo.token;
  23819. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  23820. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  23821. DataMgr.loadUserSpOrderForAd();
  23822. return;
  23823. }
  23824. else {
  23825. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23826. }
  23827. }
  23828. gotoBuy2() {
  23829. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23830. if (userInfo == null) {
  23831. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23832. return;
  23833. }
  23834. let reqData = xGame.httpMgr.getReqData();
  23835. let pd = JSON.parse(reqData);
  23836. pd.productId = 1;
  23837. reqData = JSON.stringify(pd);
  23838. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23839. try {
  23840. console.log('zh:buySp res = ' + JSON.stringify(res));
  23841. let code = res.code;
  23842. let msg = res.msg;
  23843. if (code == 401) {
  23844. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23845. alert(TIP_MSG_key.loginTimeOut);
  23846. xGame.uiMgr.Show(UIMsg$1, msg);
  23847. return;
  23848. }
  23849. if (code == 200) {
  23850. xGame.uiMgr.Show(UIMsg$1, msg);
  23851. DataMgr.loadUserSpOrderForAd();
  23852. DataMgr.getUserZiChanInfo(false);
  23853. this.closeSelf();
  23854. }
  23855. else {
  23856. xGame.uiMgr.Show(UIMsg$1, msg);
  23857. }
  23858. }
  23859. catch (error) {
  23860. console.log('error=' + error);
  23861. alert(error);
  23862. }
  23863. finally {
  23864. }
  23865. });
  23866. }
  23867. }
  23868. UIFuli1$1.uiName = "UIFuli1";
  23869. class UIFuli2$1 extends UIBase {
  23870. constructor() {
  23871. super();
  23872. this.jiage = 14.99;
  23873. }
  23874. onConstructor() {
  23875. this.ui = ui_UIFuli2.createInstance();
  23876. this.contentPane = this.ui;
  23877. this.isEject = false;
  23878. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  23879. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  23880. }
  23881. show() {
  23882. super.show();
  23883. this.x = (Laya.stage.width - this.width) / 2;
  23884. this.y = (Laya.stage.height - this.height) / 2;
  23885. this.ui.n2.txt_price.text = "$" + this.jiage;
  23886. this.setGlobalFont(this.ui);
  23887. }
  23888. closeSelf() {
  23889. DataMgr.loadUserSpOrderForAd();
  23890. this.hide();
  23891. }
  23892. gotoBuy() {
  23893. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23894. if (userInfo != null) {
  23895. let token = userInfo.token;
  23896. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  23897. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  23898. DataMgr.loadUserSpOrderForAd();
  23899. return;
  23900. }
  23901. else {
  23902. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23903. }
  23904. }
  23905. gotoBuy1() {
  23906. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23907. if (userInfo == null) {
  23908. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23909. return;
  23910. }
  23911. let reqData = xGame.httpMgr.getReqData();
  23912. let pd = JSON.parse(reqData);
  23913. pd.productId = 2;
  23914. reqData = JSON.stringify(pd);
  23915. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  23916. try {
  23917. console.log('zh:buySp res = ' + JSON.stringify(res));
  23918. let code = res.code;
  23919. let msg = res.msg;
  23920. if (code == 401) {
  23921. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23922. alert(TIP_MSG_key.loginTimeOut);
  23923. xGame.uiMgr.Show(UIMsg$1, msg);
  23924. return;
  23925. }
  23926. if (code == 200) {
  23927. xGame.uiMgr.Show(UIMsg$1, msg);
  23928. DataMgr.loadUserSpOrderForAd();
  23929. DataMgr.getUserZiChanInfo(false);
  23930. this.closeSelf();
  23931. }
  23932. else {
  23933. xGame.uiMgr.Show(UIMsg$1, msg);
  23934. }
  23935. }
  23936. catch (error) {
  23937. console.log('error=' + error);
  23938. alert(error);
  23939. }
  23940. finally {
  23941. }
  23942. });
  23943. }
  23944. }
  23945. UIFuli2$1.uiName = "UIFuli2";
  23946. class UITry$1 extends UIBase {
  23947. constructor() {
  23948. super();
  23949. this.closeTime = 0;
  23950. this.closeNum = 0;
  23951. this.skillUrl = xGame.common.skillIconList;
  23952. }
  23953. onConstructor() {
  23954. this.ui = ui_UITry.createInstance();
  23955. this.contentPane = this.ui;
  23956. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23957. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23958. }
  23959. show() {
  23960. super.show();
  23961. this.closeNum = 0;
  23962. this.closeTime = 15;
  23963. this.ui.t0.play();
  23964. PlatMgr.showRateBanner();
  23965. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23966. Laya.timer.loop(1000, this, this.updateTime);
  23967. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23968. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23969. xGame.common.gameMgr.gamePause = true;
  23970. this.setGlobalFont(this.ui);
  23971. }
  23972. updateTime() {
  23973. if (this.closeTime > 1) {
  23974. this.closeTime--;
  23975. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23976. }
  23977. else
  23978. this.hide();
  23979. }
  23980. hide() {
  23981. Laya.timer.clearAll(this);
  23982. Moyu.showBannerAd(false);
  23983. super.hide();
  23984. xGame.common.gameMgr.gamePause = false;
  23985. }
  23986. onTry() {
  23987. console.log('zh:qjff_AD_for_uitry');
  23988. if (Laya.Browser.onAndroid) {
  23989. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23990. if (!boo) {
  23991. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23992. return;
  23993. }
  23994. }
  23995. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  23996. }
  23997. else {
  23998. console.log('zh:AD 失败,直接发放奖励');
  23999. this.qjff_AD_for_uitry();
  24000. }
  24001. }
  24002. qjff_AD_for_uitry() {
  24003. let select = xGame.common.curPlayerSkillType;
  24004. DataMgr.gameData.trySkill = select;
  24005. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24006. DataMgr.saveGameData();
  24007. DataMgr.setBigSkill(select, 1);
  24008. xGame.showTip("Trial Successful");
  24009. this.hide();
  24010. }
  24011. onCancel() {
  24012. if (this.closeNum > 0) {
  24013. this.closeNum--;
  24014. if (this.closeNum < 2)
  24015. this.hide();
  24016. return;
  24017. }
  24018. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24019. this.onTry();
  24020. }
  24021. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24022. this.closeNum = 3;
  24023. }
  24024. else
  24025. this.hide();
  24026. }
  24027. }
  24028. UITry$1.uiName = "UITry";
  24029. class UIGetAward$1 extends UIBase {
  24030. constructor() {
  24031. super();
  24032. this.showTriple = true;
  24033. }
  24034. onConstructor() {
  24035. this.ui = ui_UIGetAward.createInstance();
  24036. this.contentPane = this.ui;
  24037. this.isEject = false;
  24038. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24039. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24040. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24041. }
  24042. show(arr, showTriple, callback) {
  24043. super.show();
  24044. this.ui.t0.play();
  24045. this.ui.eftNode.visible = true;
  24046. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24047. this.ui.eftNode.visible = false;
  24048. }), 1, 0, 0, 0.9);
  24049. this.awardArr = arr;
  24050. this.showTriple = showTriple;
  24051. this.callback = callback;
  24052. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24053. this.ui.myList.numItems = arr.length;
  24054. xGame.soundMgr.playSound("getaward");
  24055. this.setGlobalFont(this.ui);
  24056. }
  24057. updateSelf(index, obj) {
  24058. let temp = this.awardArr[index];
  24059. let icon = this.getIcon(temp.type);
  24060. let str = icon;
  24061. if (temp.type > 2) {
  24062. str = "s" + icon;
  24063. }
  24064. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24065. obj.myIcon.rotation = 0;
  24066. obj.numTxt.text = temp.num + "";
  24067. obj.numTxt.visible = temp.type > 2 ? false : true;
  24068. obj.nameTxt.text = this.getNameStr(temp.type);
  24069. }
  24070. renderItem(index, obj) {
  24071. this.updateSelf(index, obj);
  24072. }
  24073. tripleGetAward() {
  24074. console.log('zh:qjff_AD_for_uigetAward');
  24075. if (Laya.Browser.onAndroid) {
  24076. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24077. if (!boo) {
  24078. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24079. return;
  24080. }
  24081. }
  24082. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24083. }
  24084. else {
  24085. console.log('zh:AD 失败,直接发放奖励');
  24086. this.qjff_AD_for_uigetAward();
  24087. }
  24088. }
  24089. qjff_AD_for_uigetAward() {
  24090. this.getAward(3);
  24091. }
  24092. normalGetAward() {
  24093. if (PlatMgr.isMisVideo())
  24094. this.tripleGetAward();
  24095. else
  24096. this.getAward();
  24097. }
  24098. getAward(times = 1) {
  24099. this.hide();
  24100. for (let index = 0; index < this.awardArr.length; index++) {
  24101. this.awardArr[index].num *= times;
  24102. }
  24103. this.callback && this.callback(times != 1);
  24104. }
  24105. getIcon(type) {
  24106. switch (type) {
  24107. case Prop.diamond:
  24108. return "ty_zs";
  24109. case Prop.coin:
  24110. return "ty_jb";
  24111. case Prop.gan1:
  24112. return "qg1";
  24113. case Prop.gan2:
  24114. return "qg2";
  24115. case Prop.gan3:
  24116. return "qg3";
  24117. case Prop.gan4:
  24118. return "qg4";
  24119. default:
  24120. break;
  24121. }
  24122. }
  24123. getNameStr(type) {
  24124. switch (type) {
  24125. case Prop.diamond:
  24126. return "Diamond";
  24127. case Prop.coin:
  24128. return "Coins";
  24129. case Prop.gan1:
  24130. case Prop.gan2:
  24131. case Prop.gan3:
  24132. case Prop.gan4:
  24133. return cfgTable.ballrodData[type - 1].name;
  24134. default:
  24135. break;
  24136. }
  24137. }
  24138. }
  24139. UIGetAward$1.uiName = "UIGetAward";
  24140. class UIBox$1 extends UIBase {
  24141. constructor() {
  24142. super();
  24143. this.boxNum = 0;
  24144. this.boxMax = 10;
  24145. this.inAd = false;
  24146. this.isClose = false;
  24147. }
  24148. onConstructor() {
  24149. this.ui = ui_UIBox.createInstance();
  24150. this.contentPane = this.ui;
  24151. this.isEject = false;
  24152. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24153. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24154. Laya.timer.loop(1000, this, this.update);
  24155. }
  24156. update() {
  24157. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24158. this.boxNum -= 1;
  24159. this.upBar();
  24160. }
  24161. }
  24162. upBar() {
  24163. if (this.boxNum > this.boxMax)
  24164. this.boxNum = this.boxMax;
  24165. this.ui.bar.value = this.boxNum * 10;
  24166. }
  24167. show() {
  24168. super.show();
  24169. this.isClose = false;
  24170. this.boxNum = 0;
  24171. this.inAd = false;
  24172. this.upBar();
  24173. this.ui.t0.play();
  24174. this.ui.closeBtn.visible = false;
  24175. Laya.timer.once(3000, this, () => {
  24176. this.ui.closeBtn.visible = true;
  24177. this.ui.bar.alpha = 1;
  24178. });
  24179. Laya.timer.once(500, this, () => {
  24180. this.ui.t1.play();
  24181. });
  24182. this.setGlobalFont(this.ui);
  24183. }
  24184. hide() {
  24185. Laya.timer.clearAll(this);
  24186. Moyu.showBannerAd(false);
  24187. super.hide();
  24188. }
  24189. onOpenBox() {
  24190. this.boxNum++;
  24191. if (this.boxNum < this.boxMax) {
  24192. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24193. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24194. }
  24195. }
  24196. else if (this.boxNum == this.boxMax) {
  24197. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24198. this.ui.openBtn.c1.selectedIndex = 13;
  24199. this.inAd = true;
  24200. }
  24201. else
  24202. this.getAward();
  24203. }
  24204. else if (this.inAd) {
  24205. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24206. if (Laya.Browser.onAndroid) {
  24207. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24208. if (!boo) {
  24209. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24210. return;
  24211. }
  24212. }
  24213. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24214. }
  24215. else {
  24216. console.log('zh:AD 失败,直接发放奖励');
  24217. this.qjff_AD_for_UIBOX_onOpenBox();
  24218. }
  24219. }
  24220. this.upBar();
  24221. }
  24222. qjff_AD_for_UIBOX_onOpenBox() {
  24223. this.getAward();
  24224. }
  24225. onCloseBox() {
  24226. if (this.isClose)
  24227. this.hide();
  24228. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24229. this.isClose = true;
  24230. PlatMgr.showBanner(true, 0, 3000);
  24231. }
  24232. else
  24233. this.hide();
  24234. }
  24235. getAward() {
  24236. let str = "";
  24237. if (Math.random() < 0.5) {
  24238. let max = Moyu.isLegal ? 500 : 2500;
  24239. let num = xGame.tools.random(max, 500 + max);
  24240. DataMgr.setCoin(num);
  24241. str = "金币x" + num;
  24242. }
  24243. else {
  24244. let max = Moyu.isLegal ? 10 : 30;
  24245. let num = xGame.tools.random(max, 30 + max);
  24246. DataMgr.setDiamond(num);
  24247. str = "钻石x" + num;
  24248. }
  24249. xGame.showTip("恭喜获得-" + str);
  24250. this.hide();
  24251. }
  24252. }
  24253. UIBox$1.uiName = "UIBox";
  24254. class UIMain$1 extends UIBase {
  24255. constructor() {
  24256. super();
  24257. this.firstEnter = true;
  24258. }
  24259. nativeCallJs(msg) {
  24260. let t = msg;
  24261. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24262. switch (t) {
  24263. case 'qjff_chouJiang':
  24264. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24265. dui.qjff_chouJiang();
  24266. break;
  24267. case 'qjff_AD_for_uisign':
  24268. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24269. dui2.qjff_AD_for_uisign();
  24270. break;
  24271. case 'qjff_AD_for_uitry':
  24272. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24273. dui3.qjff_AD_for_uitry();
  24274. break;
  24275. case 'qjff_AD_for_uipower':
  24276. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24277. dui4.qjff_AD_for_uipower();
  24278. break;
  24279. case 'qjff_AD_for_uigetAward':
  24280. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24281. dui5.qjff_AD_for_uigetAward();
  24282. break;
  24283. case 'qjff_AD_for_uiGameEnd':
  24284. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24285. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24286. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24287. break;
  24288. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24289. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24290. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24291. break;
  24292. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24293. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24294. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24295. break;
  24296. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24297. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24298. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24299. break;
  24300. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24301. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24302. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24303. break;
  24304. case 'qjff_AD_for_UIBOX_onOpenBox':
  24305. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24306. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24307. break;
  24308. case 'qjff_AD_for_UIAddCoin':
  24309. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24310. dui12.qjff_AD_for_UIAddCoin();
  24311. break;
  24312. case 'app_sign_for_buyProduct_onSuccess':
  24313. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24314. DataMgr.getUserZiChanInfo(false);
  24315. break;
  24316. case '222axxxxxx':
  24317. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24318. dui15.qjff_AD_for_uisign();
  24319. break;
  24320. case '333axsxxxxxx':
  24321. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24322. dui16.qjff_AD_for_uisign();
  24323. break;
  24324. default:
  24325. console.log('zh:未知的方法名字' + t);
  24326. break;
  24327. }
  24328. }
  24329. onConstructor() {
  24330. console.log('zh: UIMain onConstructor');
  24331. this.ui = ui_UIMain.createInstance();
  24332. this.contentPane = this.ui;
  24333. this.isEject = false;
  24334. this.addEvent();
  24335. this.addClickSpine();
  24336. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24337. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24338. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24339. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24340. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24341. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24342. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24343. let curUse = DataMgr.getCurSecretary();
  24344. this.changeSecretary(curUse);
  24345. this.ui.talkNode.visible = false;
  24346. let guide = DataMgr.getSkillGuide();
  24347. if (xGame.common.isNewDay && guide == 1) {
  24348. xGame.common.isNewDay = false;
  24349. xGame.soundMgr.playSound("s_main01");
  24350. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24351. console.log("zh:播放小秘书每天语音");
  24352. }
  24353. this.onGetUserInfo();
  24354. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24355. DataMgr.getUserZiChanInfo(false);
  24356. }
  24357. this.ui.n83.visible = false;
  24358. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24359. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24360. let ua = d.username;
  24361. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24362. }
  24363. this.c_btn_for_user();
  24364. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24365. }
  24366. Logout() {
  24367. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24368. LocalStorageManager.removeItem(keyForLoginInfo);
  24369. this.freshUser();
  24370. }
  24371. JSBridgeUtils.instance.loginOutForApp();
  24372. this.setUserDefaultNickname();
  24373. DataMgr.setCoin2(4000);
  24374. DataMgr.setDiamond2(0);
  24375. this.setDefaultQiuGanInfo();
  24376. DataMgr.setPlaceBallLevelList("");
  24377. DataMgr.setChallengeMode_overLev(1);
  24378. this.setDefaultSignData();
  24379. }
  24380. setDefaultSignData() {
  24381. DataMgr.setSignData(1);
  24382. DataMgr.setSignTime(new Date().getTime());
  24383. }
  24384. setDefaultQiuGanInfo() {
  24385. DataMgr.setBallRod(0, 1);
  24386. DataMgr.setBallRod(1, 0);
  24387. DataMgr.setBallRod(2, 0);
  24388. DataMgr.setBallRod(3, 0);
  24389. DataMgr.setBallRod(4, 0);
  24390. DataMgr.setBallRod(5, 1);
  24391. }
  24392. setUserDefaultNickname() {
  24393. let defUsername = "player";
  24394. this.ui.headNode.nameTxt.text = defUsername;
  24395. DataMgr.updateUserNickName(defUsername);
  24396. Moyu.updateUserInfo(defUsername);
  24397. }
  24398. gotoLogin() {
  24399. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24400. xGame.uiMgr.Show(UILogin$1);
  24401. }
  24402. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24403. this.Logout();
  24404. }
  24405. }
  24406. gotoRegUser() {
  24407. xGame.uiMgr.Show(UIReg$1);
  24408. }
  24409. showFuLiSp1() {
  24410. console.log('zh:福利1');
  24411. this.checkForShowFuLi17(1);
  24412. }
  24413. showFuLiSp7() {
  24414. console.log('zh:福利7');
  24415. this.checkForShowFuLi17(7);
  24416. }
  24417. checkForShowFuLi17(spid) {
  24418. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24419. if (userInfo == null) {
  24420. if (spid === 1) {
  24421. xGame.uiMgr.Show(UIFuli1$1);
  24422. }
  24423. if (spid === 7) {
  24424. xGame.uiMgr.Show(UIFuli2$1);
  24425. }
  24426. return;
  24427. }
  24428. console.log('zh:是否需要展示福利 ' + spid + ' 的弹窗');
  24429. let reqData = xGame.httpMgr.getReqData();
  24430. let pd = JSON.parse(reqData);
  24431. pd.productId = spid;
  24432. reqData = JSON.stringify(pd);
  24433. xGame.httpMgr.sendPost2025('order/checkBuyFuLi', reqData, (res) => {
  24434. try {
  24435. console.log('zh:checkForShowFuLi17 res = ' + JSON.stringify(res));
  24436. let code = res.code;
  24437. let msg = res.msg;
  24438. if (code == 401) {
  24439. Laya.LocalStorage.removeItem(keyForLoginInfo);
  24440. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24441. return;
  24442. }
  24443. if (code == 200) {
  24444. let isBuyOk = res.data;
  24445. DataMgr.updateLocalUserDataForSpid17(spid, isBuyOk);
  24446. if (isBuyOk === false) {
  24447. if (spid === 1) {
  24448. xGame.uiMgr.Show(UIFuli1$1);
  24449. }
  24450. if (spid === 7) {
  24451. xGame.uiMgr.Show(UIFuli2$1);
  24452. }
  24453. }
  24454. else {
  24455. console.log('zh:已经购买了SPID=' + spid + ',不需要再提示用户了');
  24456. }
  24457. }
  24458. else {
  24459. xGame.uiMgr.Show(UIMsg$1, msg);
  24460. }
  24461. }
  24462. catch (error) {
  24463. console.log('error=' + error);
  24464. alert(error);
  24465. }
  24466. finally {
  24467. }
  24468. });
  24469. }
  24470. c_btn_for_user() {
  24471. this.ui.n_dengLu.c1.selectedIndex = 0;
  24472. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24473. this.ui.n_dengLu.c1.selectedIndex = 1;
  24474. }
  24475. else {
  24476. this.ui.n_dengLu.c1.selectedIndex = 0;
  24477. }
  24478. }
  24479. changeSecretary(curUse) {
  24480. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24481. xGame.common.secretary && xGame.common.secretary.dispose();
  24482. this.addSecretarySpine(name);
  24483. }
  24484. addSecretarySpine(name) {
  24485. let spine = new SpineMgr(name, () => {
  24486. this.playSecretaryIdle();
  24487. });
  24488. xGame.common.secretary = spine;
  24489. }
  24490. addClickSpine() {
  24491. let clickSpine = new SpineMgr("dianji", () => {
  24492. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24493. let parent = Laya.stage;
  24494. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24495. clickSpine.play(data, 0, false, parent, (spine) => {
  24496. spine.destroy(true);
  24497. });
  24498. });
  24499. });
  24500. }
  24501. addEvent() {
  24502. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24503. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24504. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24505. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24506. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24507. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24508. this.addUIClick(this.ui, this.interuptSecretary);
  24509. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24510. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24511. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24512. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24513. this.addUIClick(this.ui.signBtn, this.openSignView);
  24514. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24515. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24516. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24517. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24518. }
  24519. show(showFailWords) {
  24520. super.show();
  24521. DataMgr.loadUserSpOrderForAd();
  24522. this.moneyNode.ui.c1.selectedIndex = 1;
  24523. this.playSecretaryIdle();
  24524. xGame.soundMgr.playMusic("caromhall01", 0);
  24525. Laya.timer.clearAll(this);
  24526. this.playSecretaryRandomSound();
  24527. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24528. if (showFailWords) {
  24529. console.log('zh:uimain.ts ');
  24530. setTimeout(() => {
  24531. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24532. let words = -1;
  24533. if (str == "s_main02") {
  24534. words = 2;
  24535. }
  24536. else {
  24537. words = 3;
  24538. }
  24539. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24540. xGame.soundMgr.playSound(str);
  24541. }, 300);
  24542. }
  24543. this.showGuide();
  24544. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24545. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24546. let guide = DataMgr.getSkillGuide();
  24547. if (guide == 1) {
  24548. let randTime = xGame.common.randomNum(300, 800);
  24549. if (this.firstEnter) {
  24550. console.log("zh: firstEnter");
  24551. this.firstEnter = false;
  24552. randTime += 900;
  24553. }
  24554. else {
  24555. console.log("zh: no firstEnter");
  24556. }
  24557. Laya.timer.once(randTime, this, () => {
  24558. });
  24559. Laya.timer.once(1000, this, () => {
  24560. console.log('zh: 1秒后 showFuLiSp1');
  24561. this.showFuLiSp1();
  24562. });
  24563. Laya.timer.once(10000, this, () => {
  24564. console.log('zh: 10秒后 showFuLiSp1');
  24565. this.showFuLiSp7();
  24566. });
  24567. }
  24568. this.setGlobalFont(this.ui);
  24569. }
  24570. checkActive(show) {
  24571. }
  24572. showGuide() {
  24573. let guide = DataMgr.getSkillGuide();
  24574. this.ui.guideBtn.visible = guide == 0;
  24575. this.ui.enterGuide.visible = false;
  24576. this.ui.secretaryGuide.visible = guide == 0;
  24577. if (guide == 0) {
  24578. console.log("zh:显示引导");
  24579. xGame.soundMgr.playSound("s_guide");
  24580. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24581. }
  24582. else {
  24583. console.log("zh:不需要显示引导");
  24584. }
  24585. }
  24586. ensureSecretary() {
  24587. console.log('zh: ensureSecretary ');
  24588. this.ui.secretaryGuide.visible = false;
  24589. this.ui.enterGuide.visible = true;
  24590. this.ui.wordsNode.t0.play();
  24591. if (DataMgr.getNewUser())
  24592. Moyu.sendDataEvent("gameReady");
  24593. }
  24594. playSecretaryIdle() {
  24595. let parent = this.ui.secretary.displayObject;
  24596. parent.destroyChildren();
  24597. let xx = this.ui.secretary.width / 2;
  24598. let yy = this.ui.secretary.height;
  24599. let scale = xGame.common.getSecretaryScale();
  24600. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24601. xGame.common.secretary.play(data, 0, true, parent);
  24602. }
  24603. startGame(type) {
  24604. if (!this.isReadyForLoadNetSource()) {
  24605. return;
  24606. }
  24607. xGame.common.gameMode = type;
  24608. Moyu.sendDataEvent("PlayGame", { type: type });
  24609. let gm = xGame.common.gameMode;
  24610. console.log('zh:进入游戏gameMode =' + gm);
  24611. switch (gm) {
  24612. case GameMode.classic:
  24613. console.log('zh:进入经典模式111111111');
  24614. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24615. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24616. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  24617. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24618. console.log('zh:判断是否可以玩该模式classic =NO');
  24619. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24620. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24621. return;
  24622. }
  24623. else {
  24624. console.log('zh:可以玩该模式classic');
  24625. this.beginGame();
  24626. }
  24627. }
  24628. else {
  24629. console.log('zh:不需要判断是否可以玩该classic');
  24630. let challengeTimes = DataMgr.getChallengeTimes();
  24631. if (challengeTimes == 0) {
  24632. xGame.uiMgr.Show(UIInvitation$1);
  24633. }
  24634. else {
  24635. this.beginGame();
  24636. }
  24637. }
  24638. break;
  24639. case GameMode.bigMove:
  24640. console.info('zh:bigMove check 大招');
  24641. let guide = DataMgr.getSkillGuide();
  24642. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24643. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24644. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24645. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24646. console.log('zh:提示不可以玩');
  24647. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24648. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24649. return;
  24650. }
  24651. else {
  24652. console.log('zh:可以玩该模式 bigMove');
  24653. this.beginGame();
  24654. if (DataMgr.getNewUser())
  24655. Moyu.sendDataEvent("gameStart0");
  24656. }
  24657. }
  24658. else {
  24659. this.beginGame();
  24660. if (DataMgr.getNewUser())
  24661. Moyu.sendDataEvent("gameStart0");
  24662. }
  24663. break;
  24664. default:
  24665. console.error('zh:未知错误!!!!');
  24666. break;
  24667. }
  24668. }
  24669. beginGame(isNice = false) {
  24670. console.log('zh:beginGame ');
  24671. let guide = DataMgr.getSkillGuide();
  24672. if (guide == 1) {
  24673. console.log('zh:非新手引导,showInternAd ');
  24674. JSBridgeUtils.instance.showInternAd('beginGame');
  24675. }
  24676. else {
  24677. console.log('zh:新手引导,不显示AD ');
  24678. }
  24679. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  24680. console.log('zh:beginGame 1');
  24681. if (xGame.common.gameMode == GameMode.classic) {
  24682. console.log('zh:beginGame 2');
  24683. if (isNice) {
  24684. console.log('zh:进入巅峰赛');
  24685. this.enterClassic();
  24686. }
  24687. else {
  24688. console.log('zh:beginGame 3-1');
  24689. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24690. console.log('zh:beginGame 3-2');
  24691. this.enterClassic();
  24692. });
  24693. }
  24694. }
  24695. else if (xGame.common.gameMode == GameMode.bigMove) {
  24696. console.log('zh:beginGame 5');
  24697. this.ui.enterGuide.visible = false;
  24698. xGame.uiMgr.Show(UISkill$1);
  24699. }
  24700. }
  24701. enterClassic() {
  24702. console.log('zh:beginGame 7');
  24703. xGame.uiMgr.Show(UIGame$1);
  24704. xGame.uiMgr.Show(UIMatching$1, () => {
  24705. if (!this.isHide)
  24706. this.hide();
  24707. xGame.common.gameUI.ui.alpha = 1;
  24708. console.log('zh:beginGame 8');
  24709. xGame.common.gameUI.startGame();
  24710. xGame.uiMgr.Hide(UIGameEnd$1);
  24711. });
  24712. }
  24713. start_debug_for_moni_payOk() {
  24714. console.log('zh:start_debug_for_moni_payOk');
  24715. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24716. if (userInfo != null) {
  24717. let token = userInfo.token;
  24718. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24719. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24720. alert('模拟支付OK');
  24721. return;
  24722. }
  24723. else {
  24724. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24725. }
  24726. }
  24727. startGlobal() {
  24728. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24729. }
  24730. startWeekly() {
  24731. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24732. }
  24733. zhouSaiMonth() {
  24734. console.log('zh: zhouSaiMonth 被调用');
  24735. }
  24736. isReadyForLoadNetSource() {
  24737. let reqCount = xGame.cfgMgr.httpReqCount;
  24738. let ok = xGame.cfgMgr.httpReqOkCount;
  24739. if (reqCount > ok) {
  24740. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24741. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24742. Laya.timer.once(5000, this, () => {
  24743. let retryCount = 0;
  24744. const maxRetries = 3;
  24745. const tryFetchConfig = () => {
  24746. try {
  24747. xGame.cfgMgr.getConfigFromServer();
  24748. }
  24749. catch (error) {
  24750. if (retryCount < maxRetries) {
  24751. retryCount++;
  24752. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24753. Laya.timer.once(5000, this, tryFetchConfig);
  24754. }
  24755. else {
  24756. console.error("❌ 达到最大重试次数,配置获取失败");
  24757. }
  24758. }
  24759. };
  24760. tryFetchConfig();
  24761. });
  24762. return false;
  24763. }
  24764. return true;
  24765. }
  24766. startPlaceBall() {
  24767. if (!this.isReadyForLoadNetSource()) {
  24768. return;
  24769. }
  24770. xGame.uiMgr.Show(UILevelDisplay$1);
  24771. }
  24772. hide() {
  24773. console.log('zh:uimain hide ...');
  24774. super.hide();
  24775. xGame.common.stopGirlPop(this.ui.talkNode);
  24776. }
  24777. onGetUserInfo(force = false) {
  24778. if (Moyu.isWx) {
  24779. let info = Moyu.getSystemInfo();
  24780. if (info)
  24781. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24782. }
  24783. else {
  24784. Moyu.initUser(this, this.freshUser, force);
  24785. }
  24786. this.freshUser();
  24787. console.log('zh:5秒后更新用户信息');
  24788. setTimeout(() => {
  24789. DataMgr.getUserZiChanInfo(true);
  24790. }, 5000);
  24791. }
  24792. event_login_in() {
  24793. console.log("zh:event_login_in被触发");
  24794. this.freshUser();
  24795. }
  24796. freshUser() {
  24797. let user = Moyu.getUserInfo();
  24798. if (!user.isAuth) {
  24799. user.headIcon = 'res/ty_touxiang.png';
  24800. }
  24801. else {
  24802. DataMgr.upRankData();
  24803. }
  24804. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24805. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24806. let keyStr = keyForLoginInfo;
  24807. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24808. const d = LocalStorageManager.getItem(keyStr);
  24809. let ua = d.username;
  24810. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24811. }
  24812. else {
  24813. }
  24814. this.c_btn_for_user();
  24815. }
  24816. interuptSecretary() {
  24817. Laya.timer.clearAll(this);
  24818. this.playSecretaryRandomSound();
  24819. }
  24820. playSecretaryRandomSound() {
  24821. if (this.isHide)
  24822. return;
  24823. let time = xGame.common.randomNum(45000, 60000);
  24824. Laya.timer.once(time, this, () => {
  24825. if (this.isHide)
  24826. return;
  24827. let index = xGame.common.randomNum(4, 7);
  24828. xGame.soundMgr.playSound("s_main0" + index);
  24829. let words = 1;
  24830. switch (index) {
  24831. case 4:
  24832. words = 5;
  24833. break;
  24834. case 5:
  24835. words = 3;
  24836. break;
  24837. case 6:
  24838. words = 6;
  24839. break;
  24840. case 7:
  24841. words = 7;
  24842. break;
  24843. default:
  24844. break;
  24845. }
  24846. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24847. this.playSecretaryRandomSound();
  24848. });
  24849. }
  24850. openSecretaryView() {
  24851. xGame.uiMgr.Show(UISecretary$1);
  24852. Moyu.sendDataEvent("secretary");
  24853. }
  24854. openShopView() {
  24855. xGame.uiMgr.Show(UIShop$1, 1);
  24856. }
  24857. openShopView0() {
  24858. xGame.uiMgr.Show(UIShop$1, 0);
  24859. }
  24860. openSignView() {
  24861. xGame.uiMgr.Show(UISign$1);
  24862. }
  24863. openDrawView() {
  24864. xGame.uiMgr.Show(UIDraw$1);
  24865. }
  24866. openRanking() {
  24867. console.log('zh:phb openRanking');
  24868. xGame.uiMgr.Show(UIRanking$1);
  24869. Moyu.sendDataEvent("rankingList");
  24870. }
  24871. }
  24872. UIMain$1.uiName = "UIMain";
  24873. function InitShader() {
  24874. }
  24875. function appInit() {
  24876. xGame.context.init(getLoadingResList(), initCallback);
  24877. }
  24878. function getLoadingResList() {
  24879. return [
  24880. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24881. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24882. ];
  24883. }
  24884. function getGameResList() {
  24885. return [
  24886. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24887. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24888. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24889. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24890. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24891. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24892. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24893. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24894. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24895. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24896. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24897. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24898. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24899. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24900. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24901. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24902. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24903. ];
  24904. }
  24905. function initCallback() {
  24906. window["DataMgr"] = DataMgr;
  24907. DataMgr.Init();
  24908. Moyu.init(getPlat(), this, () => {
  24909. DataMgr.isNewDay();
  24910. PlatMgr.initConfig();
  24911. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24912. }, true);
  24913. console.log('zh:开始sm init1 start');
  24914. xGame.soundMgr.init();
  24915. console.log('zh:开始sm init1 end');
  24916. xGame.uiMgr.init();
  24917. xGame.uiMgr.clearTempData();
  24918. xGame.uiMgr.bindFUI(fguiRes.loading);
  24919. xGame.uiMgr.Show(UILoading);
  24920. }
  24921. function onFontLoaded() {
  24922. try {
  24923. Laya.Text.defaultFont = "arial";
  24924. console.log("zh: onFontLoaded 设置arial字体成功");
  24925. }
  24926. catch (error) {
  24927. console.log("zh: constructor onFontLoaded加载arial字体失败");
  24928. }
  24929. }
  24930. function loadSubRes(callback) {
  24931. var tab = ["asset", "res", "spine"];
  24932. let subDone = 0;
  24933. for (var i = 0; i < tab.length; i++) {
  24934. let sub = tab[i];
  24935. Moyu.loadSubRes(sub, (pro) => {
  24936. callback && callback(pro, false);
  24937. }).then(() => {
  24938. subDone++;
  24939. if (subDone >= tab.length)
  24940. callback && callback(1, true);
  24941. });
  24942. }
  24943. }
  24944. function enterGame() {
  24945. xGame.cfgMgr.init();
  24946. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24947. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24948. xGame.uiMgr.Hide(UILoading);
  24949. fgui.UIPackage.removePackage(fguiRes.loading);
  24950. xGame.uiMgr.bindFUI(fguiRes.game);
  24951. xGame.uiMgr.Show(UIMain$1);
  24952. if (DataMgr.getNewUser())
  24953. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24954. }
  24955. function getPlat() {
  24956. let cfg = new MoyuCfg();
  24957. cfg.plat = MoyuPlat.web;
  24958. cfg.myId = 180;
  24959. cfg.myKey = '8848a885774230a4';
  24960. cfg.version = 0;
  24961. if (window.hasOwnProperty("gamebox")) {
  24962. cfg.plat = MoyuPlat.f399;
  24963. cfg.version = 0;
  24964. }
  24965. else if (window.hasOwnProperty("ks")) {
  24966. cfg.plat = MoyuPlat.ks;
  24967. cfg.version = 0;
  24968. cfg.ads.ksVideoId = '2300002254_01';
  24969. cfg.ads.ksInsertId = '2300002254_02';
  24970. }
  24971. else if (Laya.Browser.onTTMiniGame) {
  24972. cfg.plat = MoyuPlat.tt;
  24973. cfg.version = 0;
  24974. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24975. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24976. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24977. }
  24978. else if (Laya.Browser.onMiniGame) {
  24979. cfg.plat = MoyuPlat.wx;
  24980. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24981. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24982. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24983. }
  24984. else if (Laya.Browser.onQQMiniGame) {
  24985. cfg.plat = MoyuPlat.qq;
  24986. }
  24987. else if (Laya.Browser.onQGMiniGame) {
  24988. cfg.plat = MoyuPlat.op;
  24989. cfg.ads.opVideoId = '455502';
  24990. cfg.ads.opBannerId = '455507';
  24991. }
  24992. else if (Laya.Browser.onVVMiniGame) {
  24993. cfg.plat = MoyuPlat.vv;
  24994. cfg.version = 0;
  24995. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24996. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24997. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24998. }
  24999. else if (Laya.Browser.onHWMiniGame) {
  25000. cfg.plat = MoyuPlat.hw;
  25001. }
  25002. else if (window["mz"]) {
  25003. cfg.plat = MoyuPlat.mz;
  25004. }
  25005. else {
  25006. let cfg = window['conchConfig'];
  25007. if (cfg) {
  25008. var os = cfg.getOS();
  25009. if (os == "Conch-ios") {
  25010. cfg.plat = MoyuPlat.ios;
  25011. }
  25012. else if (os == "Conch-android") {
  25013. }
  25014. }
  25015. }
  25016. return cfg;
  25017. }
  25018. class Main {
  25019. constructor() {
  25020. if (window["Laya3D"])
  25021. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25022. else {
  25023. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25024. this.initMain();
  25025. }
  25026. }
  25027. initMain() {
  25028. Laya["Physics"] && Laya["Physics"].enable();
  25029. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25030. Laya.stage.scaleMode = GameConfig.scaleMode;
  25031. Laya.stage.screenMode = GameConfig.screenMode;
  25032. Laya.stage.alignV = GameConfig.alignV;
  25033. Laya.stage.alignH = GameConfig.alignH;
  25034. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25035. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25036. Laya.enableDebugPanel();
  25037. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25038. Laya["PhysicsDebugDraw"].enable();
  25039. if (GameConfig.stat)
  25040. Laya.Stat.show();
  25041. Laya.alertGlobalError(true);
  25042. this.loadFont();
  25043. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25044. }
  25045. loadFont() {
  25046. try {
  25047. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25048. console.log("zh: constructor加载arial字体成功1");
  25049. }
  25050. catch (error) {
  25051. console.log("zh: constructor加载arial字体失败1");
  25052. }
  25053. }
  25054. onFontLoaded() {
  25055. try {
  25056. Laya.Text.defaultFont = "Arial";
  25057. console.log("zh: onFontLoaded 设置arial字体成功1");
  25058. }
  25059. catch (error) {
  25060. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25061. }
  25062. }
  25063. onVersionLoaded() {
  25064. appInit();
  25065. }
  25066. }
  25067. new Main();
  25068. }());
  25069. //# sourceMappingURL=bundle.js.map