bundle.js 979 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500
  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.n_zzq_bj = (this.getChild("n_zzq_bj"));
  1155. this.myNode = (this.getChild("myNode"));
  1156. this.extraNode = (this.getChild("extraNode"));
  1157. this.closeNode = (this.getChild("closeNode"));
  1158. this.moneyNode = (this.getChild("moneyNode"));
  1159. this.n38 = (this.getChild("n38"));
  1160. this.talkNode = (this.getChild("talkNode"));
  1161. this.secretary = (this.getChild("secretary"));
  1162. this.drawBtn = (this.getChild("drawBtn"));
  1163. this.t0 = this.getTransition("t0");
  1164. }
  1165. }
  1166. ui_UIDraw.URL = "ui://isxx5ak7wcn5v4ke";
  1167. class ui_UIBox extends fgui.GComponent {
  1168. static createInstance() {
  1169. return (fgui.UIPackage.createObject("game", "UIBox"));
  1170. }
  1171. onConstruct() {
  1172. this.n0 = (this.getChild("n0"));
  1173. this.n12 = (this.getChild("n12"));
  1174. this.n1 = (this.getChild("n1"));
  1175. this.n2 = (this.getChild("n2"));
  1176. this.bar = (this.getChild("bar"));
  1177. this.closeBtn = (this.getChild("closeBtn"));
  1178. this.openBtn = (this.getChild("openBtn"));
  1179. this.t0 = this.getTransition("t0");
  1180. this.t1 = this.getTransition("t1");
  1181. }
  1182. }
  1183. ui_UIBox.URL = "ui://isxx5ak7erstv4nm";
  1184. class LocalStorageManager {
  1185. test1() {
  1186. LocalStorageManager.setItem("playerName", "Tom");
  1187. LocalStorageManager.setItem("playerLevel", 5);
  1188. LocalStorageManager.setItem("playerData", { score: 100, level: 3 });
  1189. const name = LocalStorageManager.getItem("playerName");
  1190. const level = LocalStorageManager.getItem("playerLevel");
  1191. const data = LocalStorageManager.getItem("playerData");
  1192. console.log(name);
  1193. console.log(level);
  1194. console.log(data);
  1195. LocalStorageManager.removeItem("playerLevel");
  1196. }
  1197. static setItem(key, value) {
  1198. Laya.LocalStorage.setItem(key, JSON.stringify(value));
  1199. }
  1200. static getItem(key) {
  1201. const data = Laya.LocalStorage.getItem(key);
  1202. if (data === null)
  1203. return null;
  1204. try {
  1205. return JSON.parse(data);
  1206. }
  1207. catch (e) {
  1208. return data;
  1209. }
  1210. }
  1211. static removeItem(key) {
  1212. Laya.LocalStorage.removeItem(key);
  1213. }
  1214. static clear() {
  1215. Laya.LocalStorage.clear();
  1216. }
  1217. static hasJosnKey(key) {
  1218. var value = Laya.LocalStorage.getJSON(key);
  1219. if (value != null) {
  1220. return true;
  1221. }
  1222. else {
  1223. return false;
  1224. }
  1225. }
  1226. static hasKey(key) {
  1227. return Laya.LocalStorage.getItem(key) !== null;
  1228. }
  1229. }
  1230. class GlobalManager {
  1231. constructor() {
  1232. }
  1233. registerMethod(name, method) {
  1234. console.log('zh: 注册全局方法', name);
  1235. this[name] = method;
  1236. }
  1237. callMethod(name, ...args) {
  1238. console.log('zh: 调用全局方法', name);
  1239. if (this[name]) {
  1240. return this[name](...args);
  1241. }
  1242. else {
  1243. console.error(`zh: 全局方法 Method ${name} not found`);
  1244. }
  1245. }
  1246. }
  1247. GlobalManager.instance = new GlobalManager();
  1248. class JSBridgeUtils {
  1249. constructor() { }
  1250. static get instance() {
  1251. if (!this._instance) {
  1252. this._instance = new JSBridgeUtils();
  1253. }
  1254. return this._instance;
  1255. }
  1256. initBridge() {
  1257. if (!Laya.Browser.onAndroid) {
  1258. console.log('zh:非android dev');
  1259. return;
  1260. }
  1261. let cfg = window['conchConfig'];
  1262. if (cfg) {
  1263. var os = cfg.getOS();
  1264. if (os == "Conch-android") {
  1265. this.bridge = window['PlatformClass'].createClass("demo.JSBridge");
  1266. if (this.bridge) {
  1267. return true;
  1268. }
  1269. else {
  1270. return false;
  1271. }
  1272. }
  1273. else {
  1274. return false;
  1275. }
  1276. }
  1277. else {
  1278. return false;
  1279. }
  1280. }
  1281. testAd1() {
  1282. if (!Laya.Browser.onAndroid) {
  1283. console.log('zh:非android dev');
  1284. return;
  1285. }
  1286. if (!this.initBridge()) {
  1287. return;
  1288. }
  1289. let rs = this.bridge.call("testString", "hello");
  1290. console.log('zh:testString rs=' + rs);
  1291. }
  1292. testAdCallBack() {
  1293. if (!this.initBridge()) {
  1294. return;
  1295. }
  1296. console.log("zh:testAdCallBack start");
  1297. const defaultObj = { code: 200, msg: "req update Ui" };
  1298. const reqObj = { code: 300, msg: "hello java ui" };
  1299. this.bridge.callWithBack((rsStr) => {
  1300. const rsObj = JSON.parse(rsStr);
  1301. console.log(`zh:testAsyncCallback js收到java返回值=${rsStr}`);
  1302. }, "testAsyncCallback", JSON.stringify(reqObj));
  1303. }
  1304. showInternAd(mark) {
  1305. let boo1 = this.checkAdForUserOrderForSpid17(1);
  1306. if (boo1) {
  1307. console.log('zh: VIP SPID = 1,免除插页AD');
  1308. return false;
  1309. }
  1310. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1311. if (boo7) {
  1312. console.log('zh: VIP SPID = 7,免除任何AD');
  1313. return false;
  1314. }
  1315. console.log('zh:showInternAd start');
  1316. if (!Laya.Browser.onAndroid) {
  1317. console.log('zh:showInternAd 非android dev');
  1318. return false;
  1319. }
  1320. if (!this.initBridge()) {
  1321. return false;
  1322. }
  1323. let rs = this.bridge.call("showInternAd", mark);
  1324. try {
  1325. const result = JSON.parse(rs);
  1326. if (result.code === 200) {
  1327. console.log("zh:showInternAd OK");
  1328. return true;
  1329. }
  1330. else {
  1331. console.warn("zh:showInternAd FAILL:", result.msg);
  1332. return false;
  1333. }
  1334. }
  1335. catch (e) {
  1336. console.error("zh:解析桥接返回值失败:", e);
  1337. return false;
  1338. }
  1339. }
  1340. exitAndCloseGame() {
  1341. if (!Laya.Browser.onAndroid) {
  1342. return;
  1343. }
  1344. if (!this.initBridge()) {
  1345. return;
  1346. }
  1347. console.log('zh:开始关闭游戏-');
  1348. this.bridge.call("exitAndCloseGame");
  1349. }
  1350. checkAdForUserOrderForSpid17(spid) {
  1351. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  1352. if (userInfo != null) {
  1353. if (!userInfo.buySpids) {
  1354. userInfo.buySpids = { 1: false, 7: false };
  1355. }
  1356. else {
  1357. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  1358. }
  1359. let boo = userInfo.buySpids[spid];
  1360. if (!boo) {
  1361. console.log('zh:刷新一下用户的AD权利');
  1362. DataMgr.loadUserSpOrderForAd();
  1363. }
  1364. console.log('zh:检查是否免AD SPID=' + spid + '= 免除AD?=' + boo);
  1365. return boo;
  1366. }
  1367. return false;
  1368. }
  1369. showRewardAd(mark) {
  1370. let boo7 = this.checkAdForUserOrderForSpid17(7);
  1371. if (boo7) {
  1372. console.log('zh: VIP SPID = 7,免除任何AD');
  1373. return false;
  1374. }
  1375. if (!Laya.Browser.onAndroid) {
  1376. return false;
  1377. }
  1378. if (!this.initBridge()) {
  1379. return false;
  1380. }
  1381. let rs = this.bridge.call("showRewardAd", mark);
  1382. console.log('zh:showRewardAd rs= ' + rs + ' ,mark=' + mark);
  1383. try {
  1384. const result = JSON.parse(rs);
  1385. if (result.code === 200) {
  1386. console.log("zh:广告显示成功");
  1387. return true;
  1388. }
  1389. else {
  1390. console.warn("zh:广告显示失败:", result.msg);
  1391. return false;
  1392. }
  1393. }
  1394. catch (e) {
  1395. console.error("zh:解析桥接返回值失败:", e);
  1396. return false;
  1397. }
  1398. }
  1399. logEventForAdNoParams(eventName) {
  1400. console.log("zh:logEventForAdNoParams eventName1=" + eventName);
  1401. if (!Laya.Browser.onAndroid) {
  1402. return;
  1403. }
  1404. if (!this.initBridge()) {
  1405. return;
  1406. }
  1407. console.log("zh:call logEventForAdNoParams eventName2=" + eventName);
  1408. this.bridge.call("logEventForAdNoParams", eventName);
  1409. }
  1410. logEventForAdHaveParams(eventName, jsonStr) {
  1411. console.log("zh:ts logEventForAdHaveParams eventName1=" + eventName);
  1412. if (!Laya.Browser.onAndroid) {
  1413. return;
  1414. }
  1415. if (!this.initBridge()) {
  1416. return;
  1417. }
  1418. console.log("zh:call logEventForAdHaveParams eventName2=" + eventName);
  1419. console.log("zh:logEventForAdHaveParams req = json=" + jsonStr);
  1420. this.bridge.call("logEventForAdHaveParams", eventName, jsonStr);
  1421. }
  1422. logEventForFirebase(eventName, jsonStr) {
  1423. console.log("zh:ts logEventForFirebase eventName1=" + eventName);
  1424. if (!Laya.Browser.onAndroid) {
  1425. return;
  1426. }
  1427. if (!this.initBridge()) {
  1428. return;
  1429. }
  1430. console.log("zh:call logEventForFirebase eventName2=" + eventName);
  1431. console.log("zh:logEventForFirebase req = json=" + jsonStr);
  1432. this.bridge.call("logEventForFirebase", eventName, jsonStr);
  1433. }
  1434. testNetTip() {
  1435. if (Laya.Browser.onAndroid) {
  1436. let boo = this.getNetworkAvailable();
  1437. this.showToast2("Network error, reward unavailable");
  1438. return;
  1439. }
  1440. }
  1441. getNetworkAvailable() {
  1442. if (!Laya.Browser.onAndroid) {
  1443. return;
  1444. }
  1445. if (!this.initBridge()) {
  1446. return;
  1447. }
  1448. let boo = this.bridge.call("getNetworkAvailable");
  1449. console.log("zh:getNetworkAvailable boo=" + boo);
  1450. return boo;
  1451. }
  1452. showToast2(msg) {
  1453. if (!Laya.Browser.onAndroid) {
  1454. return;
  1455. }
  1456. if (!this.initBridge()) {
  1457. return;
  1458. }
  1459. this.bridge.call("showToast2", msg);
  1460. }
  1461. showConfirmationDialogForExit(title, msg) {
  1462. if (!Laya.Browser.onAndroid) {
  1463. return;
  1464. }
  1465. if (!this.initBridge()) {
  1466. return;
  1467. }
  1468. this.bridge.call("showConfirmationDialogForExit", title, msg);
  1469. }
  1470. loginOutForApp() {
  1471. if (!Laya.Browser.onAndroid) {
  1472. return;
  1473. }
  1474. if (!this.initBridge()) {
  1475. return;
  1476. }
  1477. this.bridge.call("loginOutForApp");
  1478. }
  1479. startGgPay(token, ggSpid, spid) {
  1480. if (!Laya.Browser.onAndroid) {
  1481. return;
  1482. }
  1483. if (!this.initBridge()) {
  1484. return;
  1485. }
  1486. let jsonObj = {
  1487. token: token,
  1488. ggSpid: ggSpid,
  1489. spid: spid,
  1490. spsl: 1
  1491. };
  1492. let reqData = JSON.stringify(jsonObj);
  1493. console.log("zh:startGgPay ts reqData=" + reqData);
  1494. this.bridge.call("startGgPay", reqData);
  1495. }
  1496. testPay1ForMoNiPayOver(token, ggSpid, spid) {
  1497. if (!Laya.Browser.onAndroid) {
  1498. return;
  1499. }
  1500. if (!this.initBridge()) {
  1501. return;
  1502. }
  1503. let jsonObj = {
  1504. token: token,
  1505. ggSpid: ggSpid,
  1506. spid: spid,
  1507. spsl: 1
  1508. };
  1509. let reqData = JSON.stringify(jsonObj);
  1510. console.log("zh:testPay1ForMoNiPayOver ts reqData=" + reqData);
  1511. this.bridge.call("testPay1ForMoNiPayOver", reqData);
  1512. }
  1513. nativeCallJs(msg) {
  1514. console.log("zh:nativeCallJs received data: 1111", msg);
  1515. if (msg === 'Ad1') {
  1516. GlobalManager.instance.callMethod('Ad1');
  1517. console.log("zh: Ad1 奖励发送成功");
  1518. }
  1519. else if (msg === 'Ad2') {
  1520. GlobalManager.instance.callMethod('Ad2');
  1521. console.log("zh: Ad2 奖励发送成功");
  1522. }
  1523. else if (msg === 'Ad3') {
  1524. GlobalManager.instance.callMethod('Ad3');
  1525. console.log("zh: Ad3 奖励发送成功");
  1526. }
  1527. else if (msg === 'Ad4') {
  1528. GlobalManager.instance.callMethod('Ad4');
  1529. console.log("zh: Ad4 奖励发送成功");
  1530. }
  1531. else if (msg === 'Ad5') {
  1532. console.log("zh: Ad5 奖励发送成功");
  1533. GlobalManager.instance.callMethod('Ad5');
  1534. }
  1535. }
  1536. }
  1537. class UIBox extends UIBase {
  1538. constructor() {
  1539. super();
  1540. this.boxNum = 0;
  1541. this.boxMax = 10;
  1542. this.inAd = false;
  1543. this.isClose = false;
  1544. }
  1545. onConstructor() {
  1546. this.ui = ui_UIBox.createInstance();
  1547. this.contentPane = this.ui;
  1548. this.isEject = false;
  1549. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  1550. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  1551. Laya.timer.loop(1000, this, this.update);
  1552. }
  1553. update() {
  1554. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  1555. this.boxNum -= 1;
  1556. this.upBar();
  1557. }
  1558. }
  1559. upBar() {
  1560. if (this.boxNum > this.boxMax)
  1561. this.boxNum = this.boxMax;
  1562. this.ui.bar.value = this.boxNum * 10;
  1563. }
  1564. show() {
  1565. super.show();
  1566. this.isClose = false;
  1567. this.boxNum = 0;
  1568. this.inAd = false;
  1569. this.upBar();
  1570. this.ui.t0.play();
  1571. this.ui.closeBtn.visible = false;
  1572. Laya.timer.once(3000, this, () => {
  1573. this.ui.closeBtn.visible = true;
  1574. this.ui.bar.alpha = 1;
  1575. });
  1576. Laya.timer.once(500, this, () => {
  1577. this.ui.t1.play();
  1578. });
  1579. this.setGlobalFont(this.ui);
  1580. }
  1581. hide() {
  1582. Laya.timer.clearAll(this);
  1583. Moyu.showBannerAd(false);
  1584. super.hide();
  1585. }
  1586. onOpenBox() {
  1587. this.boxNum++;
  1588. if (this.boxNum < this.boxMax) {
  1589. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  1590. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  1591. }
  1592. }
  1593. else if (this.boxNum == this.boxMax) {
  1594. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  1595. this.ui.openBtn.c1.selectedIndex = 13;
  1596. this.inAd = true;
  1597. }
  1598. else
  1599. this.getAward();
  1600. }
  1601. else if (this.inAd) {
  1602. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  1603. if (Laya.Browser.onAndroid) {
  1604. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1605. if (!boo) {
  1606. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1607. return;
  1608. }
  1609. }
  1610. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  1611. }
  1612. else {
  1613. console.log('zh:AD 失败,直接发放奖励');
  1614. this.qjff_AD_for_UIBOX_onOpenBox();
  1615. }
  1616. }
  1617. this.upBar();
  1618. }
  1619. qjff_AD_for_UIBOX_onOpenBox() {
  1620. this.getAward();
  1621. }
  1622. onCloseBox() {
  1623. if (this.isClose)
  1624. this.hide();
  1625. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  1626. this.isClose = true;
  1627. PlatMgr.showBanner(true, 0, 3000);
  1628. }
  1629. else
  1630. this.hide();
  1631. }
  1632. getAward() {
  1633. let str = "";
  1634. if (Math.random() < 0.5) {
  1635. let max = Moyu.isLegal ? 500 : 2500;
  1636. let num = xGame.tools.random(max, 500 + max);
  1637. DataMgr.setCoin(num);
  1638. str = "金币x" + num;
  1639. }
  1640. else {
  1641. let max = Moyu.isLegal ? 10 : 30;
  1642. let num = xGame.tools.random(max, 30 + max);
  1643. DataMgr.setDiamond(num);
  1644. str = "钻石x" + num;
  1645. }
  1646. xGame.showTip("恭喜获得-" + str);
  1647. this.hide();
  1648. }
  1649. }
  1650. UIBox.uiName = "UIBox";
  1651. class ui_UITry extends fgui.GComponent {
  1652. static createInstance() {
  1653. return (fgui.UIPackage.createObject("game", "UITry"));
  1654. }
  1655. onConstruct() {
  1656. this.n11 = (this.getChild("n11"));
  1657. this.myNode = (this.getChild("myNode"));
  1658. this.t0 = this.getTransition("t0");
  1659. }
  1660. }
  1661. ui_UITry.URL = "ui://isxx5ak7cj92v4o4";
  1662. class UITry extends UIBase {
  1663. constructor() {
  1664. super();
  1665. this.closeTime = 0;
  1666. this.closeNum = 0;
  1667. this.skillUrl = xGame.common.skillIconList;
  1668. }
  1669. onConstructor() {
  1670. this.ui = ui_UITry.createInstance();
  1671. this.contentPane = this.ui;
  1672. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  1673. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  1674. }
  1675. show() {
  1676. super.show();
  1677. this.closeNum = 0;
  1678. this.closeTime = 15;
  1679. this.ui.t0.play();
  1680. PlatMgr.showRateBanner();
  1681. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1682. Laya.timer.loop(1000, this, this.updateTime);
  1683. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  1684. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  1685. xGame.common.gameMgr.gamePause = true;
  1686. this.setGlobalFont(this.ui);
  1687. }
  1688. updateTime() {
  1689. if (this.closeTime > 1) {
  1690. this.closeTime--;
  1691. this.ui.myNode.txtTime.text = this.closeTime.toString();
  1692. }
  1693. else
  1694. this.hide();
  1695. }
  1696. hide() {
  1697. Laya.timer.clearAll(this);
  1698. Moyu.showBannerAd(false);
  1699. super.hide();
  1700. xGame.common.gameMgr.gamePause = false;
  1701. }
  1702. onTry() {
  1703. console.log('zh:qjff_AD_for_uitry');
  1704. if (Laya.Browser.onAndroid) {
  1705. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  1706. if (!boo) {
  1707. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  1708. return;
  1709. }
  1710. }
  1711. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  1712. }
  1713. else {
  1714. console.log('zh:AD 失败,直接发放奖励');
  1715. this.qjff_AD_for_uitry();
  1716. }
  1717. }
  1718. qjff_AD_for_uitry() {
  1719. let select = xGame.common.curPlayerSkillType;
  1720. DataMgr.gameData.trySkill = select;
  1721. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  1722. DataMgr.saveGameData();
  1723. DataMgr.setBigSkill(select, 1);
  1724. xGame.showTip("Trial Successful");
  1725. this.hide();
  1726. }
  1727. onCancel() {
  1728. if (this.closeNum > 0) {
  1729. this.closeNum--;
  1730. if (this.closeNum < 2)
  1731. this.hide();
  1732. return;
  1733. }
  1734. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  1735. this.onTry();
  1736. }
  1737. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  1738. this.closeNum = 3;
  1739. }
  1740. else
  1741. this.hide();
  1742. }
  1743. }
  1744. UITry.uiName = "UITry";
  1745. class PlatMgr {
  1746. static initConfig() {
  1747. this.lastVt = 0;
  1748. if (!Moyu.platConfig)
  1749. return;
  1750. for (let k in Moyu.platConfig) {
  1751. let pd = this[k];
  1752. let pc = Moyu.platConfig[k];
  1753. if (pd != undefined && pc != undefined)
  1754. this[k] = pc;
  1755. }
  1756. Moyu.setBannerPos(0.5, 1);
  1757. }
  1758. static rand100(num) {
  1759. return xGame.tools.random(0, 100) < num;
  1760. }
  1761. static isMisVideo() {
  1762. let dt = Laya.timer.currTimer - this.lastVt;
  1763. if (dt > this.forceVideoGap && this.rand100(this.forceVideoRate)) {
  1764. this.lastVt = Laya.timer.currTimer;
  1765. return true;
  1766. }
  1767. else {
  1768. if (this.rand100(this.fullVideoRate)) {
  1769. console.log('zh:插屏 ad start');
  1770. JSBridgeUtils.instance.showInternAd('platMgr');
  1771. }
  1772. return false;
  1773. }
  1774. }
  1775. static showVideo(call, type) {
  1776. Moyu.showVideoAd(() => {
  1777. this.lastVt = Laya.timer.currTimer;
  1778. call && call();
  1779. }, type);
  1780. }
  1781. static showInsert(delay = false) {
  1782. if (this.getRand() < this.insertRate) {
  1783. let dt = delay ? this.insertDelay : 0;
  1784. console.log('zh:插屏 ad start');
  1785. JSBridgeUtils.instance.showInternAd('gameInsert');
  1786. }
  1787. }
  1788. static gameInsert() {
  1789. let t = this.getRand();
  1790. let r = this.gameInsertRate;
  1791. if (t < r) {
  1792. console.log('zh:插屏 ad start 游戏中每回合开始插屏 t: %d, r: %d', t, r);
  1793. }
  1794. }
  1795. static showRateBanner() {
  1796. if (this.getRand() < this.bannerRate)
  1797. this.showBanner(true, this.bannerDelay, 3000);
  1798. }
  1799. static showBanner(show, delay = 0, hide = 0) {
  1800. if (2 > 1) {
  1801. console.log('zh:显示showBanner广告 直接返回');
  1802. return;
  1803. }
  1804. if (!show)
  1805. Moyu.showBannerAd(false);
  1806. else {
  1807. Laya.timer.clear(this, this.bannerShow);
  1808. if (delay > 0)
  1809. Laya.timer.once(delay, this, this.bannerShow, [true]);
  1810. else
  1811. this.bannerShow(true);
  1812. if (hide > 0)
  1813. Laya.timer.once(hide, this, this.bannerShow, [false]);
  1814. }
  1815. }
  1816. static bannerShow(show) {
  1817. if (2 > 1) {
  1818. console.log('zh:显示showBanner广告 直接返回');
  1819. return;
  1820. }
  1821. Moyu.showBannerAd(show);
  1822. console.log("showBanner" + show);
  1823. }
  1824. static getRand() {
  1825. return xGame.tools.random(0, 100);
  1826. }
  1827. static openBox() {
  1828. if (this.getRand() < this.boxRate)
  1829. xGame.uiMgr.Show(UIBox);
  1830. }
  1831. static openTry() {
  1832. if (Laya.timer.currTimer < DataMgr.gameData.tryTime)
  1833. return;
  1834. if (this.getRand() < this.tryRate)
  1835. xGame.uiMgr.Show(UITry);
  1836. else if (DataMgr.gameData.gameCount == 1)
  1837. xGame.uiMgr.Show(UITry);
  1838. }
  1839. }
  1840. PlatMgr.forceShare = 0;
  1841. PlatMgr.signAdRate = 0;
  1842. PlatMgr.forceVideoRate = 0;
  1843. PlatMgr.forceVideoGap = 0;
  1844. PlatMgr.fullVideoRate = 0;
  1845. PlatMgr.gameInsertRate = 0;
  1846. PlatMgr.insertGap = 0;
  1847. PlatMgr.insertDelay = 0;
  1848. PlatMgr.insertRate = 0;
  1849. PlatMgr.boxRate = 0;
  1850. PlatMgr.boxVideoRate = 0;
  1851. PlatMgr.boxInsertRate = 0;
  1852. PlatMgr.boxBannerRate = 0;
  1853. PlatMgr.tryRate = 0;
  1854. PlatMgr.tryClose3Rate = 0;
  1855. PlatMgr.tryVideoRate = 0;
  1856. PlatMgr.bannerRate = 0;
  1857. PlatMgr.lastVt = 0;
  1858. class ui_UIAddProp extends fgui.GComponent {
  1859. static createInstance() {
  1860. return (fgui.UIPackage.createObject("game", "UIAddProp"));
  1861. }
  1862. onConstruct() {
  1863. this.n11 = (this.getChild("n11"));
  1864. this.myNode = (this.getChild("myNode"));
  1865. this.closeBtn = (this.getChild("closeBtn"));
  1866. this.t0 = this.getTransition("t0");
  1867. }
  1868. }
  1869. ui_UIAddProp.URL = "ui://isxx5ak7p4tr42k";
  1870. class SpineMgr {
  1871. constructor(name, loadCb = null) {
  1872. this.loaded = false;
  1873. this.spineName = '';
  1874. this.loadedCallback = loadCb;
  1875. this.templet = new Laya.Templet();
  1876. this.templet.on(Laya.Event.COMPLETE, this, this.parseComplete);
  1877. this.templet.on(Laya.Event.ERROR, this, this.onError);
  1878. if (name === 'mishu') {
  1879. this.templet.loadAni('spine/nvmishu.sk');
  1880. }
  1881. else {
  1882. this.templet.loadAni(`spine/${name}.sk`);
  1883. }
  1884. this.templet.lock = true;
  1885. this.spineName = name;
  1886. }
  1887. onError() {
  1888. console.log("zh:spine加载出错");
  1889. }
  1890. parseComplete() {
  1891. this.loaded = true;
  1892. this.loadedCallback && this.loadedCallback();
  1893. }
  1894. dispose() {
  1895. if (this.templet && !this.templet.destroyed) {
  1896. this.templet.destroy();
  1897. }
  1898. this.templet = null;
  1899. }
  1900. play(data, aniIndex, isLoop = true, parent, callback, mySpine = null) {
  1901. if (!this.loaded) {
  1902. return;
  1903. }
  1904. let spine;
  1905. if (mySpine) {
  1906. spine = mySpine;
  1907. }
  1908. else {
  1909. spine = this.createSpine(data, parent);
  1910. }
  1911. spine.play(aniIndex, isLoop, true, 0, 0, true);
  1912. if (!isLoop) {
  1913. spine.on(Laya.Event.STOPPED, this, () => {
  1914. spine.offAll(Laya.Event.STOPPED);
  1915. callback && callback(spine);
  1916. });
  1917. }
  1918. return spine;
  1919. }
  1920. createSpine(data, parent, type = 1) {
  1921. let spine;
  1922. spine = this.templet.buildArmature(type);
  1923. spine.showSkinByIndex(0);
  1924. parent.addChild(spine);
  1925. spine.pos(data.x, data.y);
  1926. spine.scale(data.scaleX, data.scaleY, true);
  1927. return spine;
  1928. }
  1929. }
  1930. var AIState;
  1931. (function (AIState) {
  1932. AIState[AIState["none"] = 0] = "none";
  1933. AIState[AIState["idle"] = 1] = "idle";
  1934. AIState[AIState["reset"] = 2] = "reset";
  1935. AIState[AIState["move"] = 3] = "move";
  1936. AIState[AIState["wait"] = 4] = "wait";
  1937. AIState[AIState["select"] = 5] = "select";
  1938. AIState[AIState["turn"] = 6] = "turn";
  1939. AIState[AIState["shoot"] = 7] = "shoot";
  1940. AIState[AIState["leave"] = 8] = "leave";
  1941. })(AIState || (AIState = {}));
  1942. class AIPlayer {
  1943. constructor() {
  1944. this.dtime = 30;
  1945. this.awayTime = 0;
  1946. this.awayNum = 0;
  1947. this.hideTime = 0;
  1948. this.rootMoveTime = 0;
  1949. this.isGuide = false;
  1950. this.state = AIState.none;
  1951. this.waitTime = 0;
  1952. this.forceNum = 0;
  1953. this.forceMax = 0;
  1954. this.ballSize = 33;
  1955. this.selectNum = 0;
  1956. this.destRot = 0;
  1957. this.aiLv = 10;
  1958. this.kickBall = [];
  1959. this.lineBall = [];
  1960. this.scoreBall = [];
  1961. this.holeBall = [];
  1962. this.turnNum = 0;
  1963. this.setNum = 0;
  1964. this.setMax = 0;
  1965. this.setRate = 0;
  1966. this.rectL = 0;
  1967. this.rectR = 0;
  1968. this.rectT = 0;
  1969. this.rectB = 0;
  1970. this.rootPos = { x: 0, y: 0 };
  1971. this.bestForce = 0;
  1972. this.bestAngle = 180;
  1973. this.bestPos = { x: 0, y: 0 };
  1974. this.bestKick = { x: 0, y: 0 };
  1975. this.posList = [];
  1976. this.posIdx = 0;
  1977. this.chatTime = 3000;
  1978. this.tempDir1 = new Laya.Vector2();
  1979. this.tempDir2 = new Laya.Vector2();
  1980. this.tempDir3 = new Laya.Vector2();
  1981. Laya.timer.loop(this.dtime, this, this.onUpdate);
  1982. xGame.eventMgr.off(RESET_GAME, this, this.resetAI);
  1983. xGame.eventMgr.on(RESET_GAME, this, this.resetAI);
  1984. this.gameSrc = xGame.common.gameUI;
  1985. this.hideTime = Laya.timer.currTimer;
  1986. Moyu.setOnTipCall((id) => {
  1987. if (id == 20012)
  1988. this.hideTime = Laya.timer.currTimer;
  1989. else
  1990. (id == 20011);
  1991. {
  1992. let dt = Laya.timer.currTimer - this.hideTime;
  1993. console.log("onshow" + dt);
  1994. if (dt > 30000 && this.state > AIState.none)
  1995. xGame.common.gameMgr.aiGameEnd(false);
  1996. }
  1997. }, this);
  1998. }
  1999. init() {
  2000. this.isGuide = DataMgr.getSkillGuide() < 1 || DataMgr.gameData.gameCount < 1;
  2001. this.awayTime = xGame.tools.random(5000, 10000);
  2002. this.awayNum = 0;
  2003. this.hideTime = Laya.timer.currTimer;
  2004. let rect = xGame.common.d2World.borderRect;
  2005. this.rectL = Math.ceil(rect.x) + 17;
  2006. this.rectT = Math.ceil(rect.y) + 17;
  2007. this.rectR = Math.floor(rect.x + rect.width) - 17;
  2008. this.rectB = Math.floor(rect.y + rect.height) - 17;
  2009. this.wBall = xGame.common.d2World.rootBall;
  2010. this.ballSize = this.wBall.gameObj.width - 1;
  2011. if (this.posList.length < 1) {
  2012. let dp = 40;
  2013. for (let i = this.rectL; i < this.rectR + dp; i = i + dp) {
  2014. for (let j = this.rectT; j < this.rectB + dp; j = j + dp) {
  2015. let dx = i < this.rectR ? i : this.rectR;
  2016. let dy = j < this.rectB ? j : this.rectB;
  2017. let order = xGame.tools.random(0, 1000);
  2018. this.posList.push({ x: dx, y: dy, order: order });
  2019. }
  2020. }
  2021. this.posList.sort(function (a, b) {
  2022. return a.order - b.order;
  2023. });
  2024. this.setMax = this.posList.length;
  2025. }
  2026. this.state = AIState.idle;
  2027. }
  2028. setAiLevel(num) {
  2029. this.aiLv = num;
  2030. }
  2031. initBall() {
  2032. this.rootPos.x = this.wBall.gameObj.x;
  2033. this.rootPos.y = this.wBall.gameObj.y;
  2034. this.initHoleBall();
  2035. }
  2036. initHoleBall() {
  2037. this.kickBall = [];
  2038. this.lineBall = [];
  2039. this.scoreBall = [];
  2040. this.holeBall = [];
  2041. this.selectNum = 0;
  2042. this.forceNum = 0;
  2043. this.forceMax = 0;
  2044. this.turnNum = 0;
  2045. let list = xGame.common.d2World.ballArr;
  2046. if (list.length < 20 && !this.isGuide) {
  2047. let holes = xGame.common.gameMgr.holePosList;
  2048. for (let i = 0; i < list.length; i++) {
  2049. let obj = list[i];
  2050. if (!obj)
  2051. continue;
  2052. obj.kickPos.x = 0;
  2053. obj.kickPos.y = 0;
  2054. obj.poleAngle = 0;
  2055. obj.hard = 0;
  2056. obj.borderDis = 0;
  2057. obj.kickAngle = 180;
  2058. if (obj.number == 0)
  2059. continue;
  2060. if (obj.ballType == xGame.common.gameMgr.selfCamp)
  2061. continue;
  2062. if (obj.number == 8 && xGame.common.gameMode == 0) {
  2063. if (xGame.common.gameMgr.aiBallArr.length > 0 || !xGame.common.gameMgr.ensureBallType)
  2064. continue;
  2065. }
  2066. let b = obj.gameObj;
  2067. let wbp = this.rootPos;
  2068. let bx = wbp.x - b.x;
  2069. let by = wbp.y - b.y;
  2070. obj.borderDis = xGame.tools.random(0, 100);
  2071. this.kickBall.push(obj);
  2072. if (!this.isLine(wbp, obj))
  2073. continue;
  2074. obj.kickAngle = xGame.tools.random(90, 180);
  2075. obj.kickPos.x = b.x;
  2076. obj.kickPos.y = b.y;
  2077. this.lineBall.push(obj);
  2078. let minDis = 999999;
  2079. let hole = false;
  2080. for (let j = 0; j < holes.length; j++) {
  2081. let hp = holes[j];
  2082. if (bx >= 0 && hp.x > b.x + 100)
  2083. continue;
  2084. if (bx <= 0 && hp.x < b.x - 100)
  2085. continue;
  2086. if (by < -10 && hp.y < wbp.y)
  2087. continue;
  2088. if (by > 10 && hp.y > wbp.y)
  2089. continue;
  2090. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  2091. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  2092. if (dis < minDis) {
  2093. let dx = b.x - this.tempDir1.x * this.ballSize;
  2094. let dy = b.y - this.tempDir1.y * this.ballSize;
  2095. this.tempDir3.x = this.tempDir1.x;
  2096. this.tempDir3.y = this.tempDir1.y;
  2097. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  2098. obj.kickPos.x = dx;
  2099. obj.kickPos.y = dy;
  2100. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  2101. if (num > 1)
  2102. num = 1;
  2103. obj.kickAngle = Math.acos(num) * 57.3;
  2104. if (b.x < this.rectL + 2 || b.x > this.rectR - 2 || b.y < this.rectT + 2 || b.y > this.rectB - 2)
  2105. dis = dis * 2;
  2106. if (Math.abs(hp.x - 600) < 100)
  2107. dis += 50;
  2108. obj.hard = dis + obj.kickAngle * 3;
  2109. hole = true;
  2110. }
  2111. }
  2112. }
  2113. }
  2114. if (hole) {
  2115. this.scoreBall.push(obj);
  2116. this.holeBall.push(obj);
  2117. }
  2118. }
  2119. this.scoreBall.sort(function (a, b) {
  2120. return a.hard - b.hard;
  2121. });
  2122. this.holeBall.sort(function (a, b) {
  2123. return a.kickAngle - b.kickAngle;
  2124. });
  2125. this.kickBall.sort(function (a, b) {
  2126. return a.borderDis - b.borderDis;
  2127. });
  2128. }
  2129. else {
  2130. let max = list.length - 1;
  2131. let i = xGame.tools.random(0, max);
  2132. for (i; i <= max; i++) {
  2133. let idx = i >= max ? i -= max : i;
  2134. let obj = list[idx];
  2135. if (obj && obj.number != 0) {
  2136. obj.kickAngle = xGame.tools.random(90, 180);
  2137. obj.kickPos.x = obj.gameObj.x + xGame.tools.random(-10, 10);
  2138. obj.kickPos.y = obj.gameObj.y + xGame.tools.random(-10, 10);
  2139. this.lineBall.push(obj);
  2140. break;
  2141. }
  2142. }
  2143. }
  2144. }
  2145. selectBall() {
  2146. let ball = null;
  2147. this.destRot = 0;
  2148. let max = this.isGuide ? 1 : 3 - Math.ceil(this.aiLv / 4) + xGame.tools.random(0, 2);
  2149. let ai = 110 - this.aiLv * 10;
  2150. let mis = xGame.tools.random(-ai, ai) * 0.005;
  2151. let score = false;
  2152. if (this.scoreBall.length < 1) {
  2153. if (this.lineBall.length < 1) {
  2154. for (let i = 0; i < this.kickBall.length; i++) {
  2155. let list = [];
  2156. let bo = this.kickBall[i];
  2157. let bobj = bo.gameObj;
  2158. let rect = xGame.common.d2World.borderRect;
  2159. let mobj = this.wBall.gameObj;
  2160. let minb = bobj.y - rect.y - 20;
  2161. let minw = mobj.y - rect.y - 50;
  2162. if (minb > 0 && minw > 0) {
  2163. let dlenx = 0;
  2164. let dleny = mobj.y - rect.y;
  2165. let spx = mobj.x;
  2166. let spy = rect.y - dleny;
  2167. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2168. }
  2169. minb = rect.y + rect.height - bobj.y - 20;
  2170. minw = rect.y + rect.height - mobj.y - 50;
  2171. if (minb > 0 && minw > 0) {
  2172. let dlenx = 0;
  2173. let dleny = rect.y + rect.height - mobj.y;
  2174. let spx = mobj.x;
  2175. let spy = rect.y + rect.height + dleny;
  2176. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2177. }
  2178. minb = bobj.x - rect.x - 20;
  2179. minw = mobj.x - rect.x - 50;
  2180. if (minb > 0 && minw > 0) {
  2181. let dlenx = mobj.x - rect.x;
  2182. let dleny = 0;
  2183. let spx = rect.x - dlenx;
  2184. let spy = mobj.y;
  2185. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2186. }
  2187. minb = rect.x + rect.width - bobj.x - 20;
  2188. minw = rect.x + rect.width - mobj.x - 50;
  2189. if (minb > 0 && minw > 0) {
  2190. let dlenx = rect.x + rect.width - mobj.x;
  2191. let dleny = 0;
  2192. let spx = rect.x + rect.width + dlenx;
  2193. let spy = mobj.y;
  2194. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  2195. }
  2196. list.sort(function (a, b) {
  2197. return a.order - b.order;
  2198. });
  2199. for (let i = 0; i < list.length; i++) {
  2200. let data = list[i];
  2201. let mx = mobj.x - bobj.x;
  2202. let my = mobj.y - bobj.y;
  2203. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  2204. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  2205. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2206. if (num > 1)
  2207. num = 1;
  2208. let cos = Math.acos(num);
  2209. if (cos > 1.57)
  2210. cos = 1.57;
  2211. else if (cos < 0.01)
  2212. cos = 0.01;
  2213. let tan = Math.tan(cos);
  2214. let dx = tan * data.dleny;
  2215. let dy = tan * data.dlenx;
  2216. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  2217. if (Math.abs(bx - 667) < 40)
  2218. continue;
  2219. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  2220. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  2221. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  2222. this.forceMax = dis * 0.08;
  2223. this.destRot += mis * 0.1;
  2224. this.setKick(bx, by);
  2225. return true;
  2226. }
  2227. }
  2228. }
  2229. }
  2230. else {
  2231. ball = xGame.common.getRandArrEle(this.lineBall);
  2232. }
  2233. }
  2234. else {
  2235. for (let i = 0; i < this.scoreBall.length; i++) {
  2236. if (i < this.scoreBall.length - 1) {
  2237. let rand = 70 + this.aiLv * 10 + i * 10;
  2238. if (xGame.tools.random(0, 100) < rand) {
  2239. ball = this.scoreBall[i];
  2240. break;
  2241. }
  2242. }
  2243. else {
  2244. ball = this.scoreBall[i];
  2245. break;
  2246. }
  2247. }
  2248. score = true;
  2249. this.selectNum++;
  2250. }
  2251. if (!ball)
  2252. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2253. if (this.selectNum >= max) {
  2254. console.log('zh:jian kong bug1');
  2255. if (ball && ball.gameObj) {
  2256. }
  2257. else {
  2258. console.log('zh:jian kong bug2 如果到这里应该能看到一个alert弹框报错');
  2259. }
  2260. let dx = ball.gameObj.x;
  2261. let dy = ball.gameObj.y;
  2262. let kickAngle = 0;
  2263. if (score) {
  2264. dx = ball.kickPos.x;
  2265. dy = ball.kickPos.y;
  2266. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2267. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2268. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  2269. if (adot > 1)
  2270. adot = 1;
  2271. kickAngle = Math.acos(adot) * 57.3;
  2272. if (kickAngle > 45) {
  2273. let kdx = ball.kickPos.x - ball.gameObj.x;
  2274. let kdy = ball.kickPos.y - ball.gameObj.y;
  2275. dx = ball.kickPos.x - kdx * mis * 0.3;
  2276. dy = ball.kickPos.y - kdy * mis * 0.3;
  2277. }
  2278. else
  2279. this.destRot += mis;
  2280. }
  2281. else if (ball.poleAngle != 0) {
  2282. this.destRot += ball.poleAngle;
  2283. }
  2284. if (xGame.common.gameMode == 0) {
  2285. let af = kickAngle * 0.08;
  2286. this.forceMax = ball.hard * 0.1 + af * af;
  2287. }
  2288. this.setKick(dx, dy);
  2289. }
  2290. else {
  2291. let rand = this.aiLv * 5 + 40;
  2292. if (xGame.tools.random(0, 100) < rand && this.scoreBall.length > 0)
  2293. ball = xGame.common.getRandArrEle(this.scoreBall);
  2294. else
  2295. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  2296. rand = this.aiLv * 3 + 40 + this.selectNum * 20;
  2297. if (xGame.tools.random(0, 100) > rand) {
  2298. this.selectNum = max;
  2299. }
  2300. this.setState(AIState.select, xGame.tools.random(500, 1000));
  2301. this.selectNum++;
  2302. }
  2303. ball.onClick(0, true);
  2304. }
  2305. isBlock(bn, bx, by, hx, hy, dn = -1) {
  2306. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  2307. let balls = xGame.common.d2World.ballArr;
  2308. let max = xGame.tools.getDis(hx, hy, bx, by);
  2309. for (let index = 0; index < balls.length; index++) {
  2310. let obj = balls[index];
  2311. if (obj.number == 0)
  2312. continue;
  2313. if (obj.number == bn || obj.number == dn)
  2314. continue;
  2315. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  2316. if (dis * dis > max)
  2317. continue;
  2318. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  2319. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2320. if (num > 1)
  2321. num = 1;
  2322. if (num < 0)
  2323. continue;
  2324. let gap = Math.sin(Math.acos(num)) * dis;
  2325. if (gap < this.ballSize)
  2326. return true;
  2327. }
  2328. return false;
  2329. }
  2330. isLine(xy, ball) {
  2331. let bx = xy.x;
  2332. let by = xy.y;
  2333. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  2334. let dis = ball.getDestDis(xy);
  2335. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  2336. let sin = Math.sin(angle);
  2337. let cos = Math.cos(angle);
  2338. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  2339. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2340. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2341. let dx = bx + this.tempDir2.x * dis;
  2342. let dy = by + this.tempDir2.y * dis;
  2343. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  2344. sin = Math.sin(-angle);
  2345. cos = Math.cos(-angle);
  2346. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  2347. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  2348. dx = bx + this.tempDir2.x * dis;
  2349. dy = by + this.tempDir2.y * dis;
  2350. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  2351. if (isr && isl)
  2352. return false;
  2353. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  2354. }
  2355. return true;
  2356. }
  2357. turnPole() {
  2358. this.turnNum++;
  2359. let rot = xGame.common.d2World.d2Gan.ui.rotation % 360;
  2360. let dr = rot - this.destRot;
  2361. let abs = Math.abs(dr) % 360;
  2362. if (abs > 180) {
  2363. if (rot > 180)
  2364. rot -= 360;
  2365. if (this.destRot > 180)
  2366. this.destRot -= 360;
  2367. }
  2368. let max = this.turnNum * 5 + this.aiLv * 5;
  2369. if (abs < 0.2 && xGame.tools.random(0, 100) < max) {
  2370. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  2371. let at = xGame.tools.random(1000, 2000);
  2372. if (!this.onAway(3))
  2373. at += xGame.tools.random(10000, 15000);
  2374. this.setState(AIState.shoot, at);
  2375. }
  2376. else {
  2377. let mr = 0;
  2378. if (abs > 3)
  2379. mr = 1 + xGame.tools.random(2, 6) * abs * 0.01;
  2380. else if (Math.random() > 0.6)
  2381. mr = xGame.tools.random(1, 10) * 0.1;
  2382. mr = dr > 0 ? -mr : mr;
  2383. xGame.common.d2World.d2Gan.rotDest(rot + mr);
  2384. }
  2385. }
  2386. setKick(dx, dy) {
  2387. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  2388. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  2389. this.tempDir1.x = 0;
  2390. this.tempDir1.y = 1;
  2391. this.tempDir2.y = -this.tempDir2.y;
  2392. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  2393. if (num > 1)
  2394. num = 1;
  2395. let rot = Math.acos(num) * 57.3;
  2396. if (this.tempDir2.x < 0)
  2397. rot = 360 - rot;
  2398. this.destRot += rot;
  2399. if (!xGame.common.gameMgr.finishOneShoot) {
  2400. this.forceMax += xGame.tools.random(10, 50);
  2401. this.forceMax -= this.aiLv * 2;
  2402. if (this.forceMax < 20)
  2403. this.forceMax = 20;
  2404. }
  2405. if (this.forceMax > 100)
  2406. this.forceMax = 101;
  2407. else if (this.forceMax < 10)
  2408. this.forceMax += xGame.tools.random(0, 10);
  2409. if (xGame.common.gameMode == 1)
  2410. this.forceMax = xGame.tools.random(80, 100);
  2411. else
  2412. this.forceMax = xGame.tools.random(this.forceMax * 0.5, this.forceMax);
  2413. let max = 2000 - this.aiLv * 100;
  2414. if (Math.random() > 0.8)
  2415. max += xGame.tools.random(100, 2000);
  2416. this.setState(AIState.turn, xGame.tools.random(500, max));
  2417. }
  2418. shoot() {
  2419. if (this.waitTime < 0 && Math.abs(this.forceNum - this.forceMax) < 4) {
  2420. if (Math.random() > 0.8) {
  2421. this.gameSrc.aiForce(1);
  2422. this.setState(AIState.wait);
  2423. }
  2424. }
  2425. else {
  2426. let df = xGame.tools.random(3, 8);
  2427. if (this.forceNum < this.forceMax)
  2428. this.forceNum += df;
  2429. else
  2430. this.forceNum -= df;
  2431. let startY = this.gameSrc.ui.powerNode.y;
  2432. let height = this.gameSrc.ui.powerNode.height;
  2433. let force = startY + height * this.forceNum * 0.01;
  2434. this.gameSrc.aiForce(2, force);
  2435. }
  2436. }
  2437. reset() {
  2438. for (let i = 0; i < 4; i++) {
  2439. this.setRate--;
  2440. this.setNum++;
  2441. let pos = this.posList[this.posIdx];
  2442. this.rootPos.x = pos.x + xGame.tools.random(-20, 20);
  2443. this.rootPos.y = pos.y + xGame.tools.random(-20, 20);
  2444. if (!xGame.common.gameMgr.isTouchedBall && this.rootPos.x > 387)
  2445. this.rootPos.x = 387;
  2446. if (this.rootPos.x < this.rectL)
  2447. this.rootPos.x = this.rectL;
  2448. else if (this.rootPos.x > this.rectR)
  2449. this.rootPos.x = this.rectR;
  2450. if (this.rootPos.y < this.rectT)
  2451. this.rootPos.y = this.rectT;
  2452. else if (this.rootPos.y > this.rectB)
  2453. this.rootPos.y = this.rectB;
  2454. this.posIdx++;
  2455. let max = this.posList.length;
  2456. if (this.posIdx >= max)
  2457. this.posIdx -= max;
  2458. this.initHoleBall();
  2459. let ball = null;
  2460. if (this.scoreBall.length > 0)
  2461. ball = this.scoreBall[0];
  2462. else if (this.lineBall.length > 0)
  2463. ball = xGame.common.getRandArrEle(this.lineBall);
  2464. if (ball && ball.kickAngle < this.bestAngle) {
  2465. this.bestAngle = ball.kickAngle;
  2466. this.bestKick.x = ball.kickPos.x;
  2467. this.bestKick.y = ball.kickPos.y;
  2468. this.bestPos.x = this.rootPos.x;
  2469. this.bestPos.y = this.rootPos.y;
  2470. this.bestForce = ball.hard * 0.08;
  2471. }
  2472. }
  2473. if (this.setNum >= this.setMax)
  2474. this.setMax = 0;
  2475. if (this.setRate < 1) {
  2476. this.setState(AIState.move, 0);
  2477. this.rootMoveTime = Laya.timer.currTimer;
  2478. this.gameSrc.aiRootMove(true);
  2479. }
  2480. }
  2481. delayLine() {
  2482. this.gameSrc.aiRootMove(false);
  2483. }
  2484. move() {
  2485. if (this.bestPos.x < 1)
  2486. this.bestPos = this.rootPos;
  2487. let wObj = this.wBall.gameObj;
  2488. let destx = wObj.x;
  2489. let desty = wObj.y;
  2490. let dx = Math.abs(destx - this.bestPos.x);
  2491. let dy = Math.abs(desty - this.bestPos.y);
  2492. let mx = 3 + dx * 0.03;
  2493. let my = 3 + dy * 0.03;
  2494. if (dx < 4 && dy < 4) {
  2495. let dt = Laya.timer.currTimer - this.rootMoveTime;
  2496. dt = dt < 1000 ? 1000 - dt : 0;
  2497. if (this.setMax > 0) {
  2498. let min = this.setMax * 0.3 + this.aiLv * 5;
  2499. this.setRate = xGame.tools.random(min, this.setMax);
  2500. this.setState(AIState.reset, 0);
  2501. }
  2502. else {
  2503. this.destRot = 0;
  2504. this.forceMax = this.bestForce;
  2505. this.setKick(this.bestKick.x, this.bestKick.y);
  2506. }
  2507. if (dt > 100) {
  2508. Laya.timer.clear(this, this.delayLine);
  2509. Laya.timer.once(dt, this, this.delayLine);
  2510. }
  2511. else
  2512. this.gameSrc.aiRootMove(false);
  2513. }
  2514. else {
  2515. if (dx > 4)
  2516. destx = wObj.x < this.bestPos.x ? wObj.x + mx : wObj.x - mx;
  2517. if (dy > 4)
  2518. desty = wObj.y < this.bestPos.y ? wObj.y + my : wObj.y - my;
  2519. this.gameSrc.onRootMove({ x: destx, y: desty });
  2520. }
  2521. }
  2522. resetRoot() {
  2523. this.bestAngle = 180;
  2524. this.bestForce = 0;
  2525. this.setMax = this.posList.length;
  2526. this.posIdx = xGame.tools.random(0, this.setMax);
  2527. let min = this.setMax * 0.3 + this.aiLv * 5;
  2528. this.setRate = xGame.tools.random(min, this.setMax);
  2529. let max = 2000 - this.aiLv * 100;
  2530. if (Math.random() > 0.8)
  2531. max += xGame.tools.random(100, 1000);
  2532. if (this.isGuide)
  2533. this.setState(AIState.select, 500);
  2534. else if (this.onAway(2))
  2535. this.setState(AIState.reset, xGame.tools.random(400, max));
  2536. else
  2537. this.setState(AIState.none);
  2538. if (xGame.common.gameMgr.finishOneShoot)
  2539. this.chat();
  2540. }
  2541. runAI() {
  2542. if (this.state > AIState.idle)
  2543. return;
  2544. this.initBall();
  2545. this.onGame(2500);
  2546. if (Math.random() > 0.6)
  2547. this.chat();
  2548. }
  2549. stopRun() {
  2550. this.setState(AIState.idle);
  2551. }
  2552. onGame(base) {
  2553. let max = base - this.aiLv * 100;
  2554. if (Math.random() > 0.8)
  2555. max += xGame.tools.random(100, 1000);
  2556. if (this.onAway(2))
  2557. this.setState(AIState.select, xGame.tools.random(500, max));
  2558. else
  2559. this.setState(AIState.none);
  2560. }
  2561. setState(sta, wt = 0) {
  2562. if (this.state == AIState.none)
  2563. return;
  2564. this.state = sta;
  2565. this.waitTime = wt;
  2566. }
  2567. onUpdate() {
  2568. if (this.state == AIState.none)
  2569. return;
  2570. this.awayTime -= this.dtime;
  2571. if (this.awayTime < 1) {
  2572. this.awayTime = xGame.tools.random(6000, 10000);
  2573. this.awayNum += (11 - this.aiLv);
  2574. this.onAway(1);
  2575. }
  2576. if (this.waitTime >= 0) {
  2577. this.waitTime -= this.dtime;
  2578. return;
  2579. }
  2580. switch (this.state) {
  2581. case AIState.idle:
  2582. this.chat();
  2583. break;
  2584. case AIState.reset:
  2585. this.reset();
  2586. break;
  2587. case AIState.move:
  2588. this.move();
  2589. break;
  2590. case AIState.leave:
  2591. this.state = AIState.none;
  2592. xGame.common.gameMgr.aiGameEnd(true);
  2593. break;
  2594. case AIState.select:
  2595. this.selectBall();
  2596. break;
  2597. case AIState.turn:
  2598. this.turnPole();
  2599. break;
  2600. case AIState.shoot:
  2601. this.shoot();
  2602. break;
  2603. }
  2604. }
  2605. onAway(type) {
  2606. if (type == 1) {
  2607. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2608. let num = this.awayNum + db * 20;
  2609. if (db > 0 && num > 0 && xGame.tools.random(0, 10000) < num && this.state == AIState.idle) {
  2610. xGame.common.gameMgr.aiLeave();
  2611. this.setState(AIState.leave, 6666);
  2612. }
  2613. }
  2614. else if (type == 2) {
  2615. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2616. let num = this.awayNum + db * 30;
  2617. if (xGame.tools.random(0, 10000) < num)
  2618. return false;
  2619. }
  2620. else if (type == 3) {
  2621. let db = xGame.common.gameMgr.aiBallArr.length - xGame.common.gameMgr.selfBallArr.length;
  2622. let num = this.awayNum + db * 10;
  2623. if (xGame.tools.random(0, 4000) < num)
  2624. return false;
  2625. }
  2626. return true;
  2627. }
  2628. chat() {
  2629. if (this.chatTime > 0) {
  2630. this.chatTime -= this.dtime;
  2631. return;
  2632. }
  2633. this.chatTime = xGame.tools.random(2000, 10000);
  2634. let rand = xGame.tools.random(0, 100);
  2635. if (rand < 15)
  2636. this.talk();
  2637. else if (rand < 35)
  2638. this.emotion();
  2639. }
  2640. talk() {
  2641. xGame.common.talkMgr.showAITalk(0);
  2642. }
  2643. emotion() {
  2644. xGame.common.talkMgr.showAIEmotion(0);
  2645. }
  2646. resetAI() {
  2647. this.stopRun();
  2648. this.state = AIState.none;
  2649. }
  2650. }
  2651. class Partical extends Laya.Script3D {
  2652. constructor() {
  2653. super();
  2654. this.duration = 2000;
  2655. }
  2656. ;
  2657. onAwake() {
  2658. this.gameObj = this.owner;
  2659. }
  2660. onEnable() {
  2661. this.openTimer();
  2662. }
  2663. openTimer() {
  2664. Laya.timer.once(this.duration, this, this.disappear);
  2665. }
  2666. setCallback(obj, callback) {
  2667. this.obj = obj;
  2668. this.callback = callback;
  2669. Laya.timer.clearAll(this);
  2670. Laya.timer.once(this.duration, this, this.disappear);
  2671. }
  2672. disappear() {
  2673. xGame.poolD3Mgr.putItem(this.gameObj.name, this.gameObj);
  2674. this.callback && this.callback(this.obj);
  2675. }
  2676. }
  2677. class Ball extends Laya.Script3D {
  2678. constructor() {
  2679. super();
  2680. this.posV3 = new Laya.Vector3();
  2681. this.rotRate = 2.1;
  2682. this.rotSpeed = new Laya.Vector3();
  2683. this.myIndex = 0;
  2684. }
  2685. onAwake() {
  2686. this.gameObj = this.owner;
  2687. this.transform = this.gameObj.transform;
  2688. this.ballNode = this.gameObj.getChildByName("Ball");
  2689. this.shadowNode = this.gameObj.getChildByName("shadow");
  2690. }
  2691. initSelf(index, x, y, owner) {
  2692. this.d2BallSrc = owner;
  2693. this.myIndex = index;
  2694. this.setAlbedoTexture();
  2695. this.setTransPos(x, y);
  2696. this.setScale();
  2697. this.ballNode.transform.localRotationEulerX = 90;
  2698. if (index == 0) {
  2699. }
  2700. }
  2701. setAlbedoTexture(isIce = false) {
  2702. let url;
  2703. if (isIce) {
  2704. url = `res/d3Res/ballTexture/ice.jpg`;
  2705. }
  2706. else {
  2707. url = `res/d3Res/ballTexture/ball${this.myIndex}.png`;
  2708. }
  2709. Laya.Texture2D.load(url, Laya.Handler.create(this, (tex) => {
  2710. this.ballNode.meshRenderer.material["albedoTexture"] = tex;
  2711. }));
  2712. }
  2713. runFireworks(obj, delay, callback) {
  2714. Laya.timer.clearAll(this);
  2715. Laya.timer.once(delay + 1, this, () => {
  2716. let fire = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  2717. fire.transform.localPositionX = this.transform.localPositionX;
  2718. fire.transform.localPositionY = this.transform.localPositionY;
  2719. fire.transform.localPositionZ = this.transform.localPositionZ;
  2720. let src = fire.getComponent(Partical);
  2721. src.duration = 1000;
  2722. src.setCallback(obj, callback);
  2723. let eft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  2724. eft.transform.localPositionX = this.transform.localPositionX;
  2725. eft.transform.localPositionY = this.transform.localPositionY;
  2726. eft.transform.localPositionZ = this.transform.localPositionZ;
  2727. });
  2728. }
  2729. setTransPos(x, y) {
  2730. this.setRotation();
  2731. xGame.common.pos2to3Convert(x, y, this.posV3);
  2732. this.transform.localPositionX = this.posV3.x;
  2733. this.transform.localPositionY = 0;
  2734. this.transform.localPositionZ = this.posV3.z;
  2735. this.transform.localRotationEulerX = 0;
  2736. this.transform.localRotationEulerY = 0;
  2737. this.transform.localRotationEulerZ = 0;
  2738. this.shadowNode.transform.localPositionX = this.posV3.x / 30;
  2739. this.shadowNode.transform.localPositionY = 0.1;
  2740. this.shadowNode.transform.localPositionZ = this.posV3.z / 30;
  2741. }
  2742. setRotation() {
  2743. if (this.d2BallSrc.canRot) {
  2744. let speed = this.d2BallSrc.rigy.linearVelocity;
  2745. this.rotSpeed.x = speed.x * this.rotRate;
  2746. this.rotSpeed.z = speed.y * this.rotRate;
  2747. this.rotSpeed.y = this.d2BallSrc.rotY;
  2748. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2749. }
  2750. else if (Math.abs(this.d2BallSrc.rotY) > 0.1) {
  2751. this.rotSpeed.x = this.rotSpeed.y = 0;
  2752. this.rotSpeed.y = this.d2BallSrc.rotY;
  2753. this.ballNode.transform.rotate(this.rotSpeed, false, false);
  2754. }
  2755. }
  2756. setScale() {
  2757. let radius = xGame.common.d2World.rootBall.ui.width;
  2758. let scale = xGame.common.scale2to3Convert(radius);
  2759. this.transform.localScaleX = scale;
  2760. this.transform.localScaleY = scale;
  2761. this.transform.localScaleZ = scale;
  2762. }
  2763. playInHoleEft() {
  2764. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  2765. eft.transform.position = this.transform.position;
  2766. }
  2767. playIceEft() {
  2768. let eft = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  2769. eft.transform.position = this.transform.position;
  2770. }
  2771. get scaleXYZ() {
  2772. return this.transform.localScaleX;
  2773. }
  2774. set scaleXYZ(val) {
  2775. this.transform.localScaleX = val;
  2776. this.transform.localScaleY = val;
  2777. this.transform.localScaleZ = val;
  2778. }
  2779. get posX() {
  2780. return this.transform.localPositionX;
  2781. }
  2782. set posX(val) {
  2783. this.transform.localPositionX = val;
  2784. }
  2785. get posY() {
  2786. return this.transform.localPositionY;
  2787. }
  2788. set posY(val) {
  2789. this.transform.localPositionY = val;
  2790. }
  2791. get posZ() {
  2792. return this.transform.localPositionZ;
  2793. }
  2794. set posZ(val) {
  2795. this.transform.localPositionZ = val;
  2796. }
  2797. destroySelf() {
  2798. this.posV3 = null;
  2799. this.rotSpeed = null;
  2800. this.d2BallSrc = null;
  2801. this.ballNode = null;
  2802. this.gameObj.destroy(true);
  2803. this.transform = null;
  2804. this.destroy();
  2805. }
  2806. }
  2807. class ui_D2Ball extends fgui.GComponent {
  2808. static createInstance() {
  2809. return (fgui.UIPackage.createObject("game", "D2Ball"));
  2810. }
  2811. onConstruct() {
  2812. this.myIcon = (this.getChild("myIcon"));
  2813. this.inner = (this.getChild("inner"));
  2814. this.n8 = (this.getChild("n8"));
  2815. this.n4 = (this.getChild("n4"));
  2816. this.wrongTips = (this.getChild("wrongTips"));
  2817. this.rightTips = (this.getChild("rightTips"));
  2818. this.breathAni = this.getTransition("breathAni");
  2819. }
  2820. }
  2821. ui_D2Ball.URL = "ui://isxx5ak7kt443qi";
  2822. class D2BallSrc extends Laya.Script {
  2823. constructor() {
  2824. super();
  2825. this.number = 0;
  2826. this.startX = 0;
  2827. this.startY = 0;
  2828. this.angleV2 = new Laya.Vector2();
  2829. this.isRootBall = false;
  2830. this.isBlackBall = false;
  2831. this.ballType = "";
  2832. this.canRot = true;
  2833. this.rotY = 0;
  2834. this.poleAngle = 0;
  2835. this.kickPos = { x: 0, y: 0 };
  2836. this.hard = 0;
  2837. this.kickAngle = 0;
  2838. this.borderDis = 0;
  2839. this.speedP10 = 5.6;
  2840. this.lastSpeed = { x: 0, y: 0 };
  2841. this.stillSpeed = 0.12;
  2842. this.ballFunc = "normal";
  2843. this.isRunSkillAni = false;
  2844. this.isInHole = false;
  2845. this.iceOwner = "";
  2846. this.forceRun = false;
  2847. this.myUNID = "";
  2848. this.rectL = 0;
  2849. this.rectR = 0;
  2850. this.rectT = 0;
  2851. this.rectB = 0;
  2852. this.forceVec = new Laya.Vector2();
  2853. this.lastDis = 0;
  2854. this.helpOut = { type: "", x: 0, y: 0 };
  2855. }
  2856. initSelf(number, x, y, d3Ball) {
  2857. if (!this.gameObj)
  2858. this.gameObj = this.owner;
  2859. this.number = number;
  2860. this.startX = x;
  2861. this.startY = y;
  2862. this.d3Ball = d3Ball;
  2863. this.isRootBall = false;
  2864. this.isBlackBall = false;
  2865. this.ballType = "";
  2866. if (number == 0) {
  2867. this.isRootBall = true;
  2868. }
  2869. else if (number == 8) {
  2870. this.isBlackBall = true;
  2871. }
  2872. else {
  2873. if (number <= 7) {
  2874. this.ballType = ballCamp.full;
  2875. }
  2876. else {
  2877. this.ballType = ballCamp.flower;
  2878. }
  2879. }
  2880. this.setInfo();
  2881. this.setD3Ball();
  2882. this.owner["mySrc"] = this;
  2883. this.rigy.linearDamping = 1;
  2884. D2BallSrc._unid++;
  2885. this.myUNID = "d2ball" + D2BallSrc._unid;
  2886. let rect = xGame.common.d2World.borderRect;
  2887. this.rectL = Math.ceil(rect.x) + 20;
  2888. this.rectT = Math.ceil(rect.y) + 20;
  2889. this.rectR = Math.floor(rect.x + rect.width) - 20;
  2890. this.rectB = Math.floor(rect.y + rect.height) - 20;
  2891. }
  2892. setInfo() {
  2893. this.gameObj.x = this.startX;
  2894. this.gameObj.y = this.startY;
  2895. let radius = this.ui.width / 2;
  2896. this.gameObj.width = radius * 2;
  2897. this.gameObj.height = radius * 2;
  2898. if (xGame.common.showDebug) {
  2899. this.ui.myIcon.alpha = 1;
  2900. this.ui.inner.alpha = 1;
  2901. }
  2902. else {
  2903. this.ui.myIcon.alpha = 0;
  2904. this.ui.inner.alpha = 0;
  2905. }
  2906. }
  2907. setD3Ball() {
  2908. this.d3Ball = this.d3Ball;
  2909. this.d3BallSrc = this.d3Ball.getComponent(Ball);
  2910. this.d3BallSrc.initSelf(this.number, this.startX, this.startY, this);
  2911. }
  2912. onUpdate() {
  2913. if (xGame.common.gameMgr.gamePause)
  2914. return;
  2915. if (this.isInHole)
  2916. return;
  2917. if (!xGame.common.d2World.openCheckStill)
  2918. return;
  2919. this.runBall();
  2920. }
  2921. runBall() {
  2922. this.lastSpeed.x = this.rigy.linearVelocity.x;
  2923. this.lastSpeed.y = this.rigy.linearVelocity.y;
  2924. this.d3BallSrc.setTransPos(this.gameObj.x, this.gameObj.y);
  2925. this.judgeBorder();
  2926. }
  2927. getDestDis(dest) {
  2928. return xGame.tools.getDistance(dest.x, dest.y, this.gameObj.x, this.gameObj.y);
  2929. }
  2930. setmyXY(x, y) {
  2931. this.d3BallSrc.setTransPos(x, y);
  2932. }
  2933. getSpeed() {
  2934. let speed = this.rigy.linearVelocity;
  2935. return speed.x * speed.x + speed.y * speed.y;
  2936. }
  2937. onTriggerEnter(collider) {
  2938. if (!collider || !collider.owner)
  2939. return;
  2940. let coll = "collide";
  2941. let speed = this.getSpeed();
  2942. let sv2 = this.speedP10 * this.speedP10;
  2943. if (collider.label == "ball") {
  2944. if (speed < 9 && this.number != 0)
  2945. coll = "";
  2946. else if (speed < sv2)
  2947. coll = "collide_4";
  2948. else if (speed < sv2 * 6.2)
  2949. coll = "collide_3";
  2950. else if (speed < sv2 * 25)
  2951. coll = "collide_2";
  2952. else if (speed < sv2 * 56)
  2953. coll = "collide_1";
  2954. xGame.soundMgr.playSound(coll);
  2955. if (this.gameObj.x < this.rectL || this.gameObj.x > this.rectR || this.gameObj.y < this.rectT || this.gameObj.y > this.rectB) {
  2956. if (collider.owner) {
  2957. let rig = collider.owner.getComponent(D2BallSrc);
  2958. if (Math.abs(rig.rigy.linearVelocity.x) > 0)
  2959. rig.lastSpeed.x = rig.rigy.linearVelocity.x;
  2960. if (Math.abs(rig.rigy.linearVelocity.y) > 0)
  2961. rig.lastSpeed.y = rig.rigy.linearVelocity.y;
  2962. let vx = Math.abs(rig.lastSpeed.x * 0.4);
  2963. let vy = Math.abs(rig.lastSpeed.y * 0.5);
  2964. let rx = 0;
  2965. let ry = 0;
  2966. if (this.gameObj.x < this.rectL)
  2967. rx = vx;
  2968. else if (this.gameObj.x > this.rectR)
  2969. rx = -vx;
  2970. else if (this.gameObj.y < this.rectT)
  2971. ry = vy;
  2972. else if (this.gameObj.y > this.rectB)
  2973. ry = -vy;
  2974. this.rigy.applyLinearImpulseToCenter({ x: rx, y: ry });
  2975. }
  2976. }
  2977. if (this.number != 0) {
  2978. return;
  2979. }
  2980. else {
  2981. if (this.forceRun) {
  2982. console.log("randon force");
  2983. this.applyForce(collider);
  2984. }
  2985. }
  2986. if (xGame.common.d2World.isOnSameLine) {
  2987. xGame.common.d2World.isOnSameLine = false;
  2988. this.rigy.linearVelocity = { x: 0, y: 0 };
  2989. }
  2990. if (xGame.common.gameMgr.firstColliObj == null) {
  2991. xGame.common.gameMgr.firstColliObj = collider.owner["mySrc"].number;
  2992. xGame.common.gameMgr.isTouchedBall = true;
  2993. }
  2994. }
  2995. else {
  2996. xGame.common.recoverCameraView();
  2997. let wallStr = "";
  2998. if (speed < 9) { }
  2999. else if (speed < sv2) { }
  3000. else if (speed < sv2 * 6.2)
  3001. wallStr = "wall_30";
  3002. else if (speed < sv2 * 25)
  3003. wallStr = "wall_50";
  3004. else if (speed < sv2 * 56)
  3005. wallStr = "wall_80";
  3006. xGame.soundMgr.playSound(wallStr);
  3007. }
  3008. }
  3009. applyForce(collider) {
  3010. let src = collider.owner.mySrc;
  3011. this.forceVec.x = src.gameObj.x - this.gameObj.x;
  3012. this.forceVec.y = src.gameObj.y - this.gameObj.y;
  3013. Laya.Vector2.normalize(this.forceVec, this.forceVec);
  3014. Laya.Vector2.scale(this.forceVec, 50, this.forceVec);
  3015. src.rigy.applyLinearImpulseToCenter({ x: this.forceVec.x, y: this.forceVec.y });
  3016. }
  3017. checkWrongBall(playEft = true) {
  3018. if (this.isInHole)
  3019. return;
  3020. xGame.common.gameMgr.inHoleBalls.push(this.number);
  3021. if (this.number != 0 && playEft)
  3022. this.d3BallSrc.playInHoleEft();
  3023. let coll = "inpocket_1";
  3024. let speed = this.getSpeed();
  3025. let sv2 = this.speedP10 * this.speedP10 * 0.8;
  3026. if (speed < 9 && this.number != 0)
  3027. coll = "";
  3028. else if (speed < sv2 * 6.2)
  3029. coll = "inpocket_4";
  3030. else if (speed < sv2 * 25)
  3031. coll = "collide_3";
  3032. else if (speed < sv2 * 56)
  3033. coll = "collide_2";
  3034. xGame.soundMgr.playSound(coll);
  3035. this.isInHole = true;
  3036. if (this.number == 0) {
  3037. console.log("白球进了。。");
  3038. this.reset();
  3039. this.rigy.linearVelocity = { x: 0, y: 0 };
  3040. this.hideSelf();
  3041. xGame.common.gameUI.ui.whiteAni.visible = true;
  3042. xGame.common.gameUI.ui.whiteAni.t0.play(Laya.Handler.create(this, () => {
  3043. xGame.common.gameUI.ui.whiteAni.visible = false;
  3044. }));
  3045. }
  3046. else {
  3047. xGame.common.playClassicEmotion(this.number, this.gameObj.x, this.gameObj.y);
  3048. xGame.common.d2World.removeOneBall(this);
  3049. this.destroySelf();
  3050. xGame.common.playHappySound(this.number);
  3051. this.runFlyEft();
  3052. }
  3053. }
  3054. runFlyEft() {
  3055. if (xGame.common.gameMode == GameMode.placeBall && xGame.common.gameMgr.placeBallData.type == PlaceBallType.challenge) {
  3056. xGame.common.playAwardSpine(this.gameObj.x + 100, this.gameObj.y - 100);
  3057. }
  3058. }
  3059. hideSelf() {
  3060. if (this.d3Ball)
  3061. this.d3Ball.active = false;
  3062. }
  3063. showSelf() {
  3064. this.isInHole = false;
  3065. if (this.d3Ball && !this.d3Ball.active)
  3066. this.d3Ball.active = true;
  3067. }
  3068. isStill() {
  3069. let speed = this.rigy.linearVelocity;
  3070. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed) {
  3071. this.rigy.linearVelocity = { x: 0, y: 0 };
  3072. return true;
  3073. }
  3074. return false;
  3075. }
  3076. reset() {
  3077. }
  3078. destroySelf() {
  3079. this.d3BallSrc.destroySelf();
  3080. if (!this.ui.isDisposed) {
  3081. this.ui.removeFromParent();
  3082. this.ui.dispose();
  3083. this.ui = null;
  3084. }
  3085. this.outColli = null;
  3086. this.innerColli = null;
  3087. this.rigy = null;
  3088. this.d3Ball = null;
  3089. this.d3BallSrc = null;
  3090. this.angleV2 = null;
  3091. this.gameObj.destroy(true);
  3092. this.destroy();
  3093. }
  3094. judgeBorder() {
  3095. if (this.forceRun && this.owner == xGame.common.d2World.rootBall.owner) {
  3096. return;
  3097. }
  3098. if (this.destroyed)
  3099. return;
  3100. if (xGame.common.gameMode == GameMode.classic)
  3101. return;
  3102. let isOver = xGame.common.checkBallOverBorder(this.gameObj.x, this.gameObj.y);
  3103. if (isOver) {
  3104. this.checkWrongBall();
  3105. }
  3106. }
  3107. onClick(e, force = false) {
  3108. if (this.number == 0)
  3109. return;
  3110. if (force) {
  3111. }
  3112. else {
  3113. if (xGame.common.d2World.openCheckStill)
  3114. return;
  3115. if (!xGame.common.gameMgr.selfTurn) {
  3116. return;
  3117. }
  3118. }
  3119. if (!xGame.common.gameMgr.finishOneShoot)
  3120. return;
  3121. let root = xGame.common.d2World.rootBall.gameObj;
  3122. let x = this.gameObj.x - root.x;
  3123. let y = this.gameObj.y - root.y;
  3124. let angle = xGame.common.getfguiRotation(x, y);
  3125. xGame.common.d2World.d2Gan.ui.rotation = angle;
  3126. xGame.common.d2World.getHelpLine();
  3127. xGame.common.clickedBall = true;
  3128. this.checkGuide();
  3129. }
  3130. checkGuide() {
  3131. let guide = DataMgr.getSkillGuide();
  3132. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3133. xGame.common.guideStep++;
  3134. xGame.common.gameUI.ui.guide1.visible = false;
  3135. xGame.common.gameUI.ui.guide2.visible = true;
  3136. }
  3137. }
  3138. checkDistance(disX, disY, angle) {
  3139. let diameter = this.gameObj.width - 1;
  3140. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3141. if (!this.lastDis)
  3142. this.lastDis = dis;
  3143. else {
  3144. if (dis > this.lastDis) {
  3145. this.helpOut.type = "remove";
  3146. return this.helpOut;
  3147. }
  3148. }
  3149. if (dis <= Math.pow(diameter, 2)) {
  3150. let del = 0.01;
  3151. let offest = 0;
  3152. let realX = disX - this.gameObj.x;
  3153. let realY = disY - this.gameObj.y;
  3154. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3155. offest += del;
  3156. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3157. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3158. }
  3159. this.helpOut.type = "ok";
  3160. this.helpOut.x = realX + this.gameObj.x;
  3161. this.helpOut.y = realY + this.gameObj.y;
  3162. return this.helpOut;
  3163. }
  3164. else {
  3165. this.helpOut.type = "no";
  3166. return this.helpOut;
  3167. }
  3168. }
  3169. clearBallEft() {
  3170. this.clearBallRightEft();
  3171. this.clearBallWrongEft();
  3172. }
  3173. clearBallRightEft() {
  3174. this.ui.breathAni.stop();
  3175. this.ui.rightTips.visible = false;
  3176. }
  3177. clearBallWrongEft() {
  3178. this.ui.wrongTips.visible = false;
  3179. }
  3180. showWrongEft() {
  3181. if (!xGame.common.gameMgr.selfTurn)
  3182. return;
  3183. this.ui.wrongTips.visible = true;
  3184. }
  3185. showRightEft() {
  3186. if (!xGame.common.gameMgr.selfTurn)
  3187. return;
  3188. this.ui.rightTips.visible = true;
  3189. this.ui.rightTips.scaleX = 1;
  3190. this.ui.rightTips.scaleY = 1;
  3191. this.ui.breathAni.play();
  3192. }
  3193. setBallFunc(type, owner) {
  3194. if (type == "ice") {
  3195. this.ballFunc = type;
  3196. this.d3BallSrc.setAlbedoTexture(true);
  3197. this.rigy.type = "static";
  3198. this.iceOwner = owner;
  3199. }
  3200. else {
  3201. if (owner == this.iceOwner) {
  3202. this.ballFunc = type;
  3203. this.d3BallSrc.setAlbedoTexture(false);
  3204. this.rigy.type = "dynamic";
  3205. }
  3206. }
  3207. }
  3208. }
  3209. D2BallSrc._unid = 0;
  3210. class D2RootBallSrc extends D2BallSrc {
  3211. constructor() {
  3212. super();
  3213. this.maxSpeed = 0;
  3214. this.classicMaxSpeed = 2.2;
  3215. this.bigSkillMaxSpeed = 4;
  3216. this.angle = 0;
  3217. this.allPercent = 0;
  3218. this.linearPercent = 0;
  3219. this.anglePercent = 0;
  3220. this.maxAngleRate = 0.6;
  3221. this.baseRot = 7;
  3222. this.angleMax = 0;
  3223. this.speed = new Laya.Vector2();
  3224. this.rotSpeed = new Laya.Vector2();
  3225. }
  3226. isStill() {
  3227. let speed = this.rigy.linearVelocity;
  3228. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3229. if (this.anglePercent <= 0.1) {
  3230. this.rigy.linearVelocity = { x: 0, y: 0 };
  3231. return true;
  3232. }
  3233. }
  3234. return false;
  3235. }
  3236. reset() {
  3237. this.linearPercent = 0;
  3238. this.anglePercent = 0;
  3239. }
  3240. setSpeed(percent, angle) {
  3241. this.allPercent = percent;
  3242. this.angle = angle;
  3243. this.setAngleSpeed();
  3244. this.setLinearSpeed();
  3245. let hit = "hit";
  3246. if (percent < 25)
  3247. hit = "hit03";
  3248. else if (percent < 50)
  3249. hit = "hit02";
  3250. else if (percent < 75)
  3251. hit = "hit01";
  3252. xGame.soundMgr.playSound(hit);
  3253. }
  3254. setAngleSpeed() {
  3255. let offest = xGame.common.rodOffest;
  3256. let radius = 82;
  3257. let rate = Math.abs(offest.y / radius) * 0.5;
  3258. if (offest.y > 0)
  3259. this.angleMax = -this.baseRot * 2;
  3260. else
  3261. this.angleMax = this.baseRot;
  3262. this.rotY = -offest.x / radius * 100;
  3263. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3264. this.linearPercent = this.allPercent - this.anglePercent;
  3265. }
  3266. setLinearSpeed() {
  3267. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3268. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3269. if (!xGame.common.longHelpLine) {
  3270. let offset = -150 + xGame.common.randomNum(0, 300);
  3271. offset /= 100;
  3272. this.angle += offset;
  3273. }
  3274. }
  3275. }
  3276. let sin = Math.sin(this.angle * Math.PI / 180);
  3277. let cos = Math.cos(this.angle * Math.PI / 180);
  3278. switch (xGame.common.gameMode) {
  3279. case GameMode.classic:
  3280. this.maxSpeed = this.classicMaxSpeed;
  3281. break;
  3282. case GameMode.bigMove:
  3283. this.maxSpeed = this.bigSkillMaxSpeed;
  3284. break;
  3285. case GameMode.placeBall:
  3286. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3287. if (data.type == 1) {
  3288. this.maxSpeed = this.bigSkillMaxSpeed;
  3289. }
  3290. else {
  3291. this.maxSpeed = this.classicMaxSpeed;
  3292. }
  3293. break;
  3294. default:
  3295. break;
  3296. }
  3297. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3298. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3299. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3300. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3301. this.rigy.applyLinearImpulseToCenter(this.speed);
  3302. }
  3303. onUpdate() {
  3304. if (this.anglePercent > 0.1) {
  3305. this.anglePercent *= 0.97;
  3306. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3307. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3308. this.rigy.applyForceToCenter(this.rotSpeed);
  3309. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3310. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3311. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3312. if (num > 0.9)
  3313. this.canRot = true;
  3314. }
  3315. else
  3316. this.canRot = true;
  3317. if (Math.abs(this.rotY) > 0.1)
  3318. this.rotY *= 0.98;
  3319. super.onUpdate();
  3320. }
  3321. destroySelf() {
  3322. super.destroySelf();
  3323. this.speed = null;
  3324. }
  3325. }
  3326. class D2Ball extends Laya.Sprite {
  3327. constructor(isRootBall = false) {
  3328. super();
  3329. this.ui = ui_D2Ball.createInstance();
  3330. this.pivotX = this.ui.width / 2;
  3331. this.pivotY = this.ui.width / 2;
  3332. this.x = 0;
  3333. this.y = 0;
  3334. this.addChild(this.ui.displayObject);
  3335. this.ui.displayObject.x += this.ui.width / 2;
  3336. this.ui.displayObject.y += this.ui.width / 2;
  3337. if (isRootBall) {
  3338. this.d2Src = this.addComponent(D2RootBallSrc);
  3339. }
  3340. else {
  3341. this.d2Src = this.addComponent(D2BallSrc);
  3342. }
  3343. this.d2Src.ui = this.ui;
  3344. this.addCircleCollider();
  3345. this.addInnerCircleCollider();
  3346. this.addRigyBody();
  3347. }
  3348. addCircleCollider() {
  3349. let colli = xGame.common.getCollider("circle");
  3350. colli.radius = this.ui.width / 2;
  3351. this.addComponentIntance(colli);
  3352. this.d2Src.outColli = colli;
  3353. colli.label = "ball";
  3354. }
  3355. addInnerCircleCollider() {
  3356. let colli = xGame.common.getCollider("circle");
  3357. colli.radius = this.ui.inner.width / 2;
  3358. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3359. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3360. this.addComponentIntance(colli);
  3361. this.d2Src.innerColli = colli;
  3362. colli.label = "inner";
  3363. }
  3364. addRigyBody() {
  3365. let rigy = xGame.common.getRigbody();
  3366. rigy.type = "dynamic";
  3367. this.addComponentIntance(rigy);
  3368. this.d2Src.rigy = rigy;
  3369. }
  3370. disposeSelf() {
  3371. if (!this.ui.isDisposed) {
  3372. this.ui.dispose();
  3373. this.ui.removeFromParent();
  3374. this.ui = null;
  3375. }
  3376. }
  3377. }
  3378. class ui_D2Gan extends fgui.GComponent {
  3379. static createInstance() {
  3380. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3381. }
  3382. onConstruct() {
  3383. this.myIcon = (this.getChild("myIcon"));
  3384. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3385. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3386. this.self = (this.getChild("self"));
  3387. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3388. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3389. this.ai = (this.getChild("ai"));
  3390. }
  3391. }
  3392. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3393. class D2Gan {
  3394. constructor() {
  3395. this.offset = 0.15;
  3396. this.cell = 1.5;
  3397. this.onBallCell = 0.4;
  3398. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3399. this.moveNum = 70;
  3400. this.rulerRate = 0.1;
  3401. this.ui = ui_D2Gan.createInstance();
  3402. this.changeSelfRod();
  3403. this.changeAIRod();
  3404. }
  3405. changeSelfRod() {
  3406. let index = DataMgr.getCurBallRod();
  3407. let data = cfgTable.ballrodData[index + 1];
  3408. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3409. this.selfMySpine && this.selfMySpine.dispose();
  3410. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3411. if (data.spine) {
  3412. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3413. this.selfMySpine = new SpineMgr(data.spine, () => {
  3414. let xx = this.ui.selfEftRoot.width / 2;
  3415. let yy = this.ui.selfEftRoot.height / 2;
  3416. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3417. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3418. outSpine.rotation = -90;
  3419. });
  3420. }
  3421. }
  3422. changeAIRod() {
  3423. let length = Object.keys(cfgTable.ballrodData).length;
  3424. let rand = Math.floor(length * Math.random()) + 1;
  3425. let data = cfgTable.ballrodData[rand];
  3426. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3427. this.aiMySpine && this.aiMySpine.dispose();
  3428. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3429. if (data.spine) {
  3430. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3431. this.aiMySpine = new SpineMgr(data.spine, () => {
  3432. let xx = this.ui.aiEftRoot.width / 2;
  3433. let yy = this.ui.aiEftRoot.height / 2;
  3434. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3435. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3436. outSpine.rotation = -90;
  3437. });
  3438. }
  3439. }
  3440. setGanLastInfo() {
  3441. this.lastInfo.rotation = this.ui.rotation;
  3442. this.lastInfo.x = this.ui.x;
  3443. this.lastInfo.y = this.ui.y;
  3444. }
  3445. rotateSelf(flag, isRuler = false) {
  3446. let angle;
  3447. flag = flag * this.offset;
  3448. if (xGame.common.d2World.isHelpLineOnBall) {
  3449. angle = flag * this.onBallCell;
  3450. }
  3451. else {
  3452. angle = flag * this.cell;
  3453. }
  3454. if (isRuler) {
  3455. angle *= this.rulerRate;
  3456. }
  3457. this.ui.rotation += angle;
  3458. xGame.common.d2World.getHelpLine();
  3459. }
  3460. checkDistance() {
  3461. let target = xGame.common.d2World.targetBall;
  3462. let root = xGame.common.d2World.rootBall;
  3463. if (target == null) {
  3464. return 1;
  3465. }
  3466. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3467. if (dis <= 2500) {
  3468. return 5;
  3469. }
  3470. return 1;
  3471. }
  3472. rotDest(rot) {
  3473. this.ui.rotation = rot;
  3474. xGame.common.d2World.getHelpLine();
  3475. }
  3476. storagePower(powerNum) {
  3477. let pos = (powerNum / 100) * this.moveNum;
  3478. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3479. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3480. this.ui.x = this.lastInfo.x + xx;
  3481. this.ui.y = this.lastInfo.y + yy;
  3482. }
  3483. shoot() {
  3484. this.storagePower(0);
  3485. this.ui.visible = false;
  3486. }
  3487. destroySelf() {
  3488. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3489. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3490. this.selfMySpine && this.selfMySpine.dispose();
  3491. this.aiMySpine && this.aiMySpine.dispose();
  3492. this.lastInfo = null;
  3493. if (!this.ui.isDisposed) {
  3494. this.ui.removeFromParent();
  3495. this.ui.dispose();
  3496. }
  3497. }
  3498. }
  3499. class ui_HelpLine extends fgui.GComponent {
  3500. static createInstance() {
  3501. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3502. }
  3503. onConstruct() {
  3504. this.n10 = (this.getChild("n10"));
  3505. this.rect = (this.getChild("rect"));
  3506. this.dir11 = (this.getChild("dir11"));
  3507. this.dir = (this.getChild("dir"));
  3508. this.rootDir = (this.getChild("rootDir"));
  3509. this.dirDot = (this.getChild("dirDot"));
  3510. }
  3511. }
  3512. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3513. class D2HelpLine {
  3514. constructor() {
  3515. this.starX = 0;
  3516. this.starY = 0;
  3517. this.ui = ui_HelpLine.createInstance();
  3518. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3519. this.starX = this.ui.rect.x;
  3520. this.starY = this.ui.rect.y;
  3521. }
  3522. shoot() {
  3523. this.ui.visible = false;
  3524. }
  3525. destroySelf() {
  3526. if (this.ui.isDisposed) {
  3527. this.ui.removeFromParent();
  3528. this.ui.dispose();
  3529. }
  3530. }
  3531. }
  3532. class D2World extends Laya.Script {
  3533. constructor() {
  3534. super();
  3535. this.ballArr = [];
  3536. this.openCheckStill = false;
  3537. this.checkArr = [];
  3538. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3539. this.isHelpLineOnBall = false;
  3540. this.isOnSameLine = false;
  3541. this.reflectAngle = 0;
  3542. this.powerPercent = 0;
  3543. this.inHolesSpeed = [];
  3544. this.outDir = new Laya.Vector2();
  3545. this.rootDir = new Laya.Vector2();
  3546. this.aiLv = 0;
  3547. this.rootPos = new Laya.Vector2();
  3548. this.tempDir1 = new Laya.Vector2();
  3549. this.tempDir2 = new Laya.Vector2();
  3550. this.tempDir3 = new Laya.Vector2();
  3551. this.ballSize = 33;
  3552. this.destRot = 0;
  3553. }
  3554. initSelf() {
  3555. this.createBalls();
  3556. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3557. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3558. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3559. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3560. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3561. }
  3562. setBorderRect() {
  3563. let ui = xGame.common.gameUI.ui;
  3564. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3565. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3566. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3567. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3568. this.borderRect.x = starX;
  3569. this.borderRect.y = starY;
  3570. this.borderRect.width = width;
  3571. this.borderRect.height = height;
  3572. }
  3573. resetGame() {
  3574. this.openCheckStill = false;
  3575. let temp;
  3576. for (let index = 0; index < this.ballArr.length; index++) {
  3577. temp = this.ballArr[index];
  3578. temp.destroySelf();
  3579. }
  3580. xGame.common.d3World.ballRoot.destroyChildren();
  3581. xGame.common.gameUI.ui.ballNode.removeChildren();
  3582. console.log("进入摧毁逻辑");
  3583. this.d2Gan.destroySelf();
  3584. this.d2HelpLine.destroySelf();
  3585. this.ballArr = [];
  3586. }
  3587. setD2Gan() {
  3588. let ballNode = this.rootBall.ui;
  3589. let d2Gan = new D2Gan();
  3590. this.d2Gan = d2Gan;
  3591. let ganNode = d2Gan.ui;
  3592. ballNode.addChild(ganNode);
  3593. ganNode.pivotX = ganNode.pivotX;
  3594. ganNode.pivotY = ganNode.pivotY;
  3595. ganNode.x = ganNode.myIcon.width / 2;
  3596. ganNode.y = this.rootBall.gameObj.width;
  3597. d2Gan.setGanLastInfo();
  3598. }
  3599. setHelpLine() {
  3600. let d2Help = new D2HelpLine();
  3601. this.d2HelpLine = d2Help;
  3602. }
  3603. createBalls() {
  3604. let cfg;
  3605. switch (xGame.common.gameMode) {
  3606. case GameMode.classic:
  3607. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3608. break;
  3609. case GameMode.bigMove:
  3610. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3611. break;
  3612. case GameMode.placeBall:
  3613. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3614. break;
  3615. default:
  3616. break;
  3617. }
  3618. cfg = JSON.parse(JSON.stringify(cfg));
  3619. for (const key in cfg) {
  3620. if (cfg[key].value == 0) {
  3621. this.createRootBall(cfg[key]);
  3622. delete cfg[key];
  3623. break;
  3624. }
  3625. }
  3626. this.createOtherBalls(cfg);
  3627. }
  3628. createRootBall(data) {
  3629. let root = new D2Ball(true);
  3630. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3631. this.rootBall = root.d2Src;
  3632. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3633. let d3BallSrc = d3Ball.getComponent(Ball);
  3634. xGame.common.d3World.rootBall = d3Ball;
  3635. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3636. let xx = data.x;
  3637. let yy = data.y;
  3638. let numer = data.value;
  3639. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3640. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3641. this.ballArr.push(this.rootBall);
  3642. this.setD2Gan();
  3643. this.setHelpLine();
  3644. }
  3645. createOtherBalls(cfg) {
  3646. let temp;
  3647. let src;
  3648. let data;
  3649. for (const key in cfg) {
  3650. data = cfg[key];
  3651. temp = new D2Ball();
  3652. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3653. src = temp.d2Src;
  3654. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3655. src.initSelf(data.value, data.x, data.y, d3Ball);
  3656. this.ballArr.push(src);
  3657. }
  3658. }
  3659. shoot(percent) {
  3660. this.powerPercent = percent;
  3661. this.openCheckStill = true;
  3662. let d2Angle = this.d2Gan.ui.rotation;
  3663. this.rootBall.setSpeed(percent, d2Angle);
  3664. this.clearBallAllEft();
  3665. this.changePlayerView();
  3666. }
  3667. onUpdate() {
  3668. if (!this.openCheckStill)
  3669. return;
  3670. this.checkStill();
  3671. }
  3672. checkStill() {
  3673. for (let index = 0; index < this.ballArr.length; index++) {
  3674. if (!this.ballArr[index].isStill()) {
  3675. return;
  3676. }
  3677. }
  3678. xGame.eventMgr.event(ALL_BALL_STOP);
  3679. }
  3680. allBallStop() {
  3681. this.openCheckStill = false;
  3682. xGame.common.recoverCameraView();
  3683. }
  3684. waitShoot() {
  3685. if (!this.d2Gan.ui.isDisposed) {
  3686. this.d2Gan.ui.visible = true;
  3687. }
  3688. if (!this.d2HelpLine.ui.isDisposed) {
  3689. this.d2HelpLine.ui.visible = true;
  3690. }
  3691. this.clearBallAllEft();
  3692. this.showBallRightEft();
  3693. this.getHelpLine();
  3694. this.inHolesSpeed = [];
  3695. this.selectOneBall();
  3696. }
  3697. _getAllBallArr() {
  3698. let arr = this.ballArr;
  3699. let outArr = [];
  3700. for (let index = 0; index < arr.length; index++) {
  3701. if (arr[index] instanceof D2RootBallSrc)
  3702. continue;
  3703. if (arr[index].ballFunc == "ice")
  3704. continue;
  3705. if (arr[index].destroyed)
  3706. continue;
  3707. outArr.push(arr[index]);
  3708. }
  3709. return outArr;
  3710. }
  3711. _getBlackObj() {
  3712. let arr = this.ballArr;
  3713. for (let index = 0; index < arr.length; index++) {
  3714. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3715. return arr[index];
  3716. }
  3717. }
  3718. }
  3719. selectOneBall() {
  3720. let all = this._getAllBallArr();
  3721. let target;
  3722. switch (xGame.common.gameMode) {
  3723. case GameMode.classic:
  3724. if (xGame.common.gameMgr.selfTurn) {
  3725. let self = xGame.common.gameMgr.selfBallArr;
  3726. let black = this._getBlackObj();
  3727. if (xGame.common.gameMgr.ensureBallType) {
  3728. if (self.length > 0) {
  3729. let out = [];
  3730. for (let j = 0; j < all.length; j++) {
  3731. if (self.indexOf(all[j].number) > -1) {
  3732. out.push(all[j]);
  3733. }
  3734. }
  3735. target = this.selectBestEnterOne(out);
  3736. }
  3737. else {
  3738. target = this.selectBestEnterOne([black]);
  3739. }
  3740. }
  3741. else {
  3742. target = this.selectBestEnterOne(all);
  3743. }
  3744. }
  3745. else {
  3746. target = this.selectBestEnterOne(all);
  3747. }
  3748. break;
  3749. case GameMode.bigMove:
  3750. target = this.selectBestEnterOne(all);
  3751. break;
  3752. case GameMode.placeBall:
  3753. if (all.length > 0) {
  3754. target = this.selectBestEnterOne(all);
  3755. }
  3756. break;
  3757. default:
  3758. break;
  3759. }
  3760. if (target && !target.destroyed && target.onClick) {
  3761. target.onClick(0, true);
  3762. let num = -200 + xGame.common.randomNum(0, 400);
  3763. num /= 150;
  3764. if (xGame.common.longHelpLine) {
  3765. num = 0;
  3766. }
  3767. this.destRot += num;
  3768. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3769. }
  3770. }
  3771. removeOneBall(ball) {
  3772. for (let index = 0; index < this.ballArr.length; index++) {
  3773. if (this.ballArr[index].id == ball.id) {
  3774. this.ballArr.splice(index, 1);
  3775. break;
  3776. }
  3777. }
  3778. }
  3779. getHelpLine() {
  3780. this.d2HelpLine.ui.dirDot.visible = false;
  3781. this.isOnSameLine = false;
  3782. let startX = this.rootBall.gameObj.x;
  3783. let startY = this.rootBall.gameObj.y;
  3784. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3785. if (dis == null) {
  3786. this.d2HelpLine.ui.visible = false;
  3787. console.error("辅助线异常");
  3788. return;
  3789. }
  3790. this.d2HelpLine.ui.visible = true;
  3791. let angle = this.d2Gan.ui.rotation;
  3792. let radius = 16.5;
  3793. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3794. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3795. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3796. if (colliObj == null) {
  3797. this.getColliPos(disX, disY, radius, angle);
  3798. xGame.common.d2World.isHelpLineOnBall = false;
  3799. this.targetBall = null;
  3800. this.reflectAngle = 0;
  3801. this.showBallWrongEft();
  3802. }
  3803. else {
  3804. let target = colliObj.src;
  3805. let radius = 16.5;
  3806. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3807. dis1 = Math.sqrt(dis1);
  3808. let realDis = colliObj.disHon - dis1;
  3809. let dir = colliObj.dir;
  3810. let xx = startX + dir.x * realDis;
  3811. let yy = startY + dir.y * realDis;
  3812. this.getColliPos(xx, yy, radius, angle);
  3813. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3814. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3815. let offset = xGame.common.rodOffest;
  3816. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3817. this.isOnSameLine = true;
  3818. }
  3819. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3820. xGame.common.d2World.isHelpLineOnBall = true;
  3821. this.targetBall = target;
  3822. this.reflectAngle = reflectAngle;
  3823. this.showBallWrongEft();
  3824. if (xGame.common.longHelpLine) {
  3825. this.delayReflectLine(target, reflectAngle);
  3826. }
  3827. }
  3828. }
  3829. getBorderDot(startX, startY, angle) {
  3830. let radius = 17;
  3831. let distance;
  3832. let isDone;
  3833. distance = -(this.borderRect.y - 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.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3839. isDone = this.judgeUpDown(distance, angle, startX);
  3840. if (isDone != null) {
  3841. return isDone;
  3842. }
  3843. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3844. isDone = this.judgeLeftRight(distance, angle, startY);
  3845. if (isDone != null) {
  3846. return isDone;
  3847. }
  3848. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3849. isDone = this.judgeLeftRight(distance, angle, startY);
  3850. if (isDone != null) {
  3851. return isDone;
  3852. }
  3853. }
  3854. judgeUpDown(distance, angle, startX) {
  3855. let flag = Math.sin(angle * Math.PI / 180);
  3856. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3857. if (distance >= 0) {
  3858. if (flag > 0) {
  3859. if (temp < this.borderRect.x + this.borderRect.width) {
  3860. return distance;
  3861. }
  3862. }
  3863. else {
  3864. if (temp > this.borderRect.x) {
  3865. return distance;
  3866. }
  3867. }
  3868. }
  3869. }
  3870. judgeLeftRight(distance, angle, starY) {
  3871. let flag = -Math.cos(angle * Math.PI / 180);
  3872. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3873. if (distance >= 0) {
  3874. if (flag > 0) {
  3875. if (temp < this.borderRect.y + this.borderRect.height) {
  3876. return distance;
  3877. }
  3878. }
  3879. else {
  3880. if (temp > this.borderRect.y) {
  3881. return distance;
  3882. }
  3883. }
  3884. }
  3885. }
  3886. clearBallAllEft() {
  3887. let temp;
  3888. for (let index = 0; index < this.ballArr.length; index++) {
  3889. temp = this.ballArr[index];
  3890. temp.clearBallEft();
  3891. }
  3892. }
  3893. showBallRightEft() {
  3894. let gameMgr = xGame.common.gameMgr;
  3895. let temp;
  3896. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3897. if (targetArr.length <= 0)
  3898. return;
  3899. for (let index = 0; index < this.ballArr.length; index++) {
  3900. temp = this.ballArr[index];
  3901. if (targetArr.indexOf(temp.number) > -1) {
  3902. temp.showRightEft();
  3903. }
  3904. }
  3905. }
  3906. showBallWrongEft() {
  3907. let gameMgr = xGame.common.gameMgr;
  3908. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3909. if (targetArr.length <= 0)
  3910. return;
  3911. let temp;
  3912. for (let index = 0; index < this.ballArr.length; index++) {
  3913. temp = this.ballArr[index];
  3914. if (this.targetBall && this.targetBall.number == temp.number) {
  3915. if (targetArr.indexOf(temp.number) <= -1) {
  3916. temp.showWrongEft();
  3917. }
  3918. else {
  3919. temp.clearBallWrongEft();
  3920. }
  3921. }
  3922. else {
  3923. temp.clearBallWrongEft();
  3924. }
  3925. }
  3926. }
  3927. getColliPos(x, y, radius, angle) {
  3928. this.d2HelpLine.ui.x = x;
  3929. this.d2HelpLine.ui.y = y;
  3930. let dirX = x - this.rootBall.gameObj.x;
  3931. let dirY = y - this.rootBall.gameObj.y;
  3932. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3933. if (rectH <= 0)
  3934. rectH = 0;
  3935. this.d2HelpLine.ui.rect.height = 0;
  3936. this.d2HelpLine.ui.rect.height = rectH;
  3937. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3938. if (rectH < this.rootBall.gameObj.width) {
  3939. this.d2HelpLine.ui.rect.visible = false;
  3940. }
  3941. else {
  3942. this.d2HelpLine.ui.rect.visible = true;
  3943. }
  3944. this.d2HelpLine.ui.dir.visible = false;
  3945. this.d2HelpLine.ui.rootDir.visible = false;
  3946. }
  3947. getReflectLine(x, y, radius, target) {
  3948. this.d2HelpLine.ui.dir.visible = true;
  3949. let dirX = target.x - x;
  3950. let dirY = target.y - y;
  3951. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3952. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3953. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3954. this.d2HelpLine.ui.dir.height = 48;
  3955. this.d2HelpLine.ui.dir.rotation = angle;
  3956. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3957. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3958. return angle;
  3959. }
  3960. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3961. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3962. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3963. let targetX = target.gameObj.x;
  3964. let targetY = target.gameObj.y;
  3965. this.outDir.setValue(targetX - xx, targetY - yy);
  3966. this.rootDir.setValue(rtX - xx, rtY - yy);
  3967. let ver = Math.PI / 2;
  3968. let sin = Math.sin(ver);
  3969. let cos = Math.cos(ver);
  3970. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3971. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3972. this.outDir.setValue(outX, outY);
  3973. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3974. Laya.Vector2.normalize(this.outDir, this.outDir);
  3975. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3976. if (Math.abs(result) <= 0.08) {
  3977. this.d2HelpLine.ui.rootDir.visible = false;
  3978. return;
  3979. }
  3980. if (result > 0) {
  3981. angle += 90;
  3982. }
  3983. else if (result < 0) {
  3984. angle -= 90;
  3985. }
  3986. this.d2HelpLine.ui.rootDir.visible = true;
  3987. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  3988. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  3989. this.d2HelpLine.ui.rootDir.rotation = angle;
  3990. }
  3991. delayReflectLine(obj, angle) {
  3992. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  3993. return;
  3994. }
  3995. this.isOnSameLine = false;
  3996. let startX = obj.gameObj.x;
  3997. let startY = obj.gameObj.y;
  3998. let dis = this.getBorderDot(startX, startY, angle);
  3999. if (dis == null) {
  4000. this.d2HelpLine.ui.dirDot.visible = false;
  4001. return;
  4002. }
  4003. this.d2HelpLine.ui.visible = true;
  4004. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4005. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4006. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4007. if (colliObj == null) {
  4008. this.setDelayLine(disX, disY, obj, angle);
  4009. }
  4010. else {
  4011. let radius = 16;
  4012. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4013. dis1 = Math.sqrt(dis1);
  4014. let realDis = colliObj.disHon - dis1;
  4015. let dir = colliObj.dir;
  4016. let xx = startX + dir.x * realDis;
  4017. let yy = startY + dir.y * realDis;
  4018. this.setDelayLine(xx, yy, obj, angle);
  4019. }
  4020. }
  4021. setDelayLine(x, y, obj, angle) {
  4022. let dirX = x - obj.gameObj.x;
  4023. let dirY = y - obj.gameObj.y;
  4024. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4025. if (rectH <= 0)
  4026. rectH = 0;
  4027. this.d2HelpLine.ui.dir.height = rectH;
  4028. this.d2HelpLine.ui.dirDot.visible = true;
  4029. this.d2HelpLine.ui.dirDot.x = 17;
  4030. this.d2HelpLine.ui.dirDot.y = 17;
  4031. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4032. ;
  4033. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4034. }
  4035. changePlayerView() {
  4036. if (Math.random() >= 0.7)
  4037. return;
  4038. if (!this.targetBall) {
  4039. return;
  4040. }
  4041. if (!xGame.common.gameMgr.selfTurn)
  4042. return;
  4043. switch (xGame.common.gameMode) {
  4044. case GameMode.classic:
  4045. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4046. if (this.targetBall.number != 8) {
  4047. return;
  4048. }
  4049. }
  4050. break;
  4051. case GameMode.bigMove:
  4052. return;
  4053. case GameMode.placeBall:
  4054. break;
  4055. default:
  4056. break;
  4057. }
  4058. let startX = this.targetBall.gameObj.x;
  4059. let startY = this.targetBall.gameObj.y;
  4060. let angle = this.reflectAngle;
  4061. let dis = this.getBorderDot(startX, startY, angle);
  4062. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4063. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4064. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4065. if (colliObj) {
  4066. return;
  4067. }
  4068. let offset = 40;
  4069. let posObj = xGame.common.gameMgr.posObj;
  4070. let temp;
  4071. let radius;
  4072. let tarX, tarY;
  4073. for (const key in posObj) {
  4074. temp = posObj[key];
  4075. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4076. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4077. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4078. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4079. xGame.common.showOneCamera("angle" + key);
  4080. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4081. Laya.physicsTimer.scale = 0.7;
  4082. break;
  4083. }
  4084. }
  4085. }
  4086. selectBestEnterOne(arr) {
  4087. this.aiLv = xGame.tools.random(1, 11);
  4088. this.aiLv = 10;
  4089. this.wBall = xGame.common.d2World.rootBall;
  4090. this.rootPos.x = this.wBall.gameObj.x;
  4091. this.rootPos.y = this.wBall.gameObj.y;
  4092. this.initHoleBall(arr);
  4093. return this.selectBall();
  4094. }
  4095. selectBall() {
  4096. let ball = null;
  4097. this.destRot = 0;
  4098. let ai = 110 - this.aiLv * 10;
  4099. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4100. let score = false;
  4101. if (this.scoreBall.length < 1) {
  4102. if (this.lineBall.length < 1) {
  4103. for (let i = 0; i < this.kickBall.length; i++) {
  4104. let list = [];
  4105. let bo = this.kickBall[i];
  4106. let bobj = bo.gameObj;
  4107. let rect = xGame.common.d2World.borderRect;
  4108. let mobj = this.wBall.gameObj;
  4109. let minb = bobj.y - rect.y - 20;
  4110. let minw = mobj.y - rect.y - 50;
  4111. if (minb > 0 && minw > 0) {
  4112. let dlenx = 0;
  4113. let dleny = mobj.y - rect.y;
  4114. let spx = mobj.x;
  4115. let spy = rect.y - dleny;
  4116. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4117. }
  4118. minb = rect.y + rect.height - bobj.y - 20;
  4119. minw = rect.y + rect.height - mobj.y - 50;
  4120. if (minb > 0 && minw > 0) {
  4121. let dlenx = 0;
  4122. let dleny = rect.y + rect.height - mobj.y;
  4123. let spx = mobj.x;
  4124. let spy = rect.y + rect.height + dleny;
  4125. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4126. }
  4127. minb = bobj.x - rect.x - 20;
  4128. minw = mobj.x - rect.x - 50;
  4129. if (minb > 0 && minw > 0) {
  4130. let dlenx = mobj.x - rect.x;
  4131. let dleny = 0;
  4132. let spx = rect.x - dlenx;
  4133. let spy = mobj.y;
  4134. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4135. }
  4136. minb = rect.x + rect.width - bobj.x - 20;
  4137. minw = rect.x + rect.width - mobj.x - 50;
  4138. if (minb > 0 && minw > 0) {
  4139. let dlenx = rect.x + rect.width - mobj.x;
  4140. let dleny = 0;
  4141. let spx = rect.x + rect.width + dlenx;
  4142. let spy = mobj.y;
  4143. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4144. }
  4145. list.sort(function (a, b) {
  4146. return a.order - b.order;
  4147. });
  4148. for (let i = 0; i < list.length; i++) {
  4149. let data = list[i];
  4150. let mx = mobj.x - bobj.x;
  4151. let my = mobj.y - bobj.y;
  4152. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4153. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4154. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4155. if (num > 1)
  4156. num = 1;
  4157. let cos = Math.acos(num);
  4158. if (cos > 1.57)
  4159. cos = 1.57;
  4160. else if (cos < 0.01)
  4161. cos = 0.01;
  4162. let tan = Math.tan(cos);
  4163. let dx = tan * data.dleny;
  4164. let dy = tan * data.dlenx;
  4165. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4166. if (Math.abs(bx - 667) < 40)
  4167. continue;
  4168. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4169. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4170. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4171. this.forceMax = dis * 0.08;
  4172. this.destRot += mis * 0.1;
  4173. this.setKick(bx, by);
  4174. return true;
  4175. }
  4176. }
  4177. }
  4178. }
  4179. else {
  4180. ball = xGame.common.getRandArrEle(this.lineBall);
  4181. }
  4182. }
  4183. else {
  4184. for (let i = 0; i < this.scoreBall.length; i++) {
  4185. if (i < this.scoreBall.length - 1) {
  4186. let rand = 70 + this.aiLv * 10 + i * 10;
  4187. if (xGame.tools.random(0, 100) < rand) {
  4188. ball = this.scoreBall[i];
  4189. break;
  4190. }
  4191. }
  4192. else {
  4193. ball = this.scoreBall[i];
  4194. break;
  4195. }
  4196. }
  4197. score = true;
  4198. this.selectNum++;
  4199. }
  4200. if (!ball)
  4201. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4202. let dx = ball.gameObj.x;
  4203. let dy = ball.gameObj.y;
  4204. let kickAngle = 0;
  4205. if (score) {
  4206. dx = ball.kickPos.x;
  4207. dy = ball.kickPos.y;
  4208. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4209. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4210. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4211. if (adot > 1)
  4212. adot = 1;
  4213. kickAngle = Math.acos(adot) * 57.3;
  4214. if (kickAngle > 45) {
  4215. let kdx = ball.kickPos.x - ball.gameObj.x;
  4216. let kdy = ball.kickPos.y - ball.gameObj.y;
  4217. dx = ball.kickPos.x - kdx * mis * 0.3;
  4218. dy = ball.kickPos.y - kdy * mis * 0.3;
  4219. }
  4220. else
  4221. this.destRot += mis;
  4222. }
  4223. else if (ball.poleAngle != 0) {
  4224. this.destRot += ball.poleAngle;
  4225. }
  4226. if (xGame.common.gameMode == 0) {
  4227. let af = kickAngle * 0.08;
  4228. this.forceMax = ball.hard * 0.1 + af * af;
  4229. }
  4230. this.setKick(dx, dy);
  4231. return ball;
  4232. }
  4233. initHoleBall(arr) {
  4234. this.kickBall = [];
  4235. this.lineBall = [];
  4236. this.scoreBall = [];
  4237. this.holeBall = [];
  4238. this.selectNum = 0;
  4239. this.forceNum = 0;
  4240. this.forceMax = 0;
  4241. this.turnNum = 0;
  4242. let list = arr;
  4243. let holes = xGame.common.gameMgr.holePosList;
  4244. let self = xGame.common.aiPlayer;
  4245. for (let i = 0; i < list.length; i++) {
  4246. let obj = list[i];
  4247. if (!obj)
  4248. continue;
  4249. obj.kickPos.x = 0;
  4250. obj.kickPos.y = 0;
  4251. obj.poleAngle = 0;
  4252. obj.hard = 0;
  4253. obj.borderDis = 0;
  4254. obj.kickAngle = 180;
  4255. let b = obj.gameObj;
  4256. let wbp = this.rootPos;
  4257. let bx = wbp.x - b.x;
  4258. let by = wbp.y - b.y;
  4259. obj.borderDis = xGame.tools.random(0, 100);
  4260. this.kickBall.push(obj);
  4261. if (!this.isLine(wbp, obj))
  4262. continue;
  4263. obj.kickAngle = xGame.tools.random(90, 180);
  4264. obj.kickPos.x = b.x;
  4265. obj.kickPos.y = b.y;
  4266. this.lineBall.push(obj);
  4267. let minDis = 999999;
  4268. let hole = false;
  4269. for (let j = 0; j < holes.length; j++) {
  4270. let hp = holes[j];
  4271. if (bx >= 0 && hp.x > b.x + 100)
  4272. continue;
  4273. if (bx <= 0 && hp.x < b.x - 100)
  4274. continue;
  4275. if (by < -10 && hp.y < wbp.y)
  4276. continue;
  4277. if (by > 10 && hp.y > wbp.y)
  4278. continue;
  4279. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4280. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4281. if (dis < minDis) {
  4282. let dx = b.x - this.tempDir1.x * this.ballSize;
  4283. let dy = b.y - this.tempDir1.y * this.ballSize;
  4284. this.tempDir3.x = this.tempDir1.x;
  4285. this.tempDir3.y = this.tempDir1.y;
  4286. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4287. obj.kickPos.x = dx;
  4288. obj.kickPos.y = dy;
  4289. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4290. if (num > 1)
  4291. num = 1;
  4292. obj.kickAngle = Math.acos(num) * 57.3;
  4293. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4294. dis = dis * 2;
  4295. if (Math.abs(hp.x - 600) < 100)
  4296. dis += 50;
  4297. obj.hard = dis + obj.kickAngle * 3;
  4298. hole = true;
  4299. }
  4300. }
  4301. }
  4302. }
  4303. if (hole) {
  4304. this.scoreBall.push(obj);
  4305. this.holeBall.push(obj);
  4306. }
  4307. }
  4308. this.scoreBall.sort(function (a, b) {
  4309. return a.hard - b.hard;
  4310. });
  4311. this.holeBall.sort(function (a, b) {
  4312. return a.kickAngle - b.kickAngle;
  4313. });
  4314. this.kickBall.sort(function (a, b) {
  4315. return a.borderDis - b.borderDis;
  4316. });
  4317. }
  4318. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4319. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4320. let balls = xGame.common.d2World.ballArr;
  4321. let max = xGame.tools.getDis(hx, hy, bx, by);
  4322. for (let index = 0; index < balls.length; index++) {
  4323. let obj = balls[index];
  4324. if (obj.number == 0)
  4325. continue;
  4326. if (obj.number == bn || obj.number == dn)
  4327. continue;
  4328. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4329. if (dis * dis > max)
  4330. continue;
  4331. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4332. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4333. if (num > 1)
  4334. num = 1;
  4335. if (num < 0)
  4336. continue;
  4337. let gap = Math.sin(Math.acos(num)) * dis;
  4338. if (gap < this.ballSize)
  4339. return true;
  4340. }
  4341. return false;
  4342. }
  4343. isLine(xy, ball) {
  4344. let bx = xy.x;
  4345. let by = xy.y;
  4346. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4347. let dis = ball.getDestDis(xy);
  4348. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4349. let sin = Math.sin(angle);
  4350. let cos = Math.cos(angle);
  4351. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4352. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4353. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4354. let dx = bx + this.tempDir2.x * dis;
  4355. let dy = by + this.tempDir2.y * dis;
  4356. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4357. sin = Math.sin(-angle);
  4358. cos = Math.cos(-angle);
  4359. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4360. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4361. dx = bx + this.tempDir2.x * dis;
  4362. dy = by + this.tempDir2.y * dis;
  4363. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4364. if (isr && isl)
  4365. return false;
  4366. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4367. }
  4368. return true;
  4369. }
  4370. setKick(dx, dy) {
  4371. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4372. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4373. this.tempDir1.x = 0;
  4374. this.tempDir1.y = 1;
  4375. this.tempDir2.y = -this.tempDir2.y;
  4376. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4377. if (num > 1)
  4378. num = 1;
  4379. let rot = Math.acos(num) * 57.3;
  4380. if (this.tempDir2.x < 0)
  4381. rot = 360 - rot;
  4382. this.destRot += rot;
  4383. }
  4384. }
  4385. class ui_UIGame extends fgui.GComponent {
  4386. static createInstance() {
  4387. return (fgui.UIPackage.createObject("game", "UIGame"));
  4388. }
  4389. onConstruct() {
  4390. this.c1 = this.getController("c1");
  4391. this.d3Root = (this.getChild("d3Root"));
  4392. this.clickNode = (this.getChild("clickNode"));
  4393. this.d2Root = (this.getChild("d2Root"));
  4394. this.topNode = (this.getChild("topNode"));
  4395. this.n72 = (this.getChild("n72"));
  4396. this.n40 = (this.getChild("n40"));
  4397. this.rulerNode = (this.getChild("rulerNode"));
  4398. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4399. this.n50 = (this.getChild("n50"));
  4400. this.keduNode = (this.getChild("keduNode"));
  4401. this.powerTxt = (this.getChild("powerTxt"));
  4402. this.powerNode = (this.getChild("powerNode"));
  4403. this.colorNode = (this.getChild("colorNode"));
  4404. this.powerEft = (this.getChild("powerEft"));
  4405. this.myPowerNode = (this.getChild("myPowerNode"));
  4406. this.ganNode = (this.getChild("ganNode"));
  4407. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4408. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4409. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4410. this.skillRod = (this.getChild("skillRod"));
  4411. this.border = (this.getChild("border"));
  4412. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4413. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4414. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4415. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4416. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4417. this.guanyuNode = (this.getChild("guanyuNode"));
  4418. this.helpBtn = (this.getChild("helpBtn"));
  4419. this.wordsBtn = (this.getChild("wordsBtn"));
  4420. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4421. this.returnBtn = (this.getChild("returnBtn"));
  4422. this.ballNode = (this.getChild("ballNode"));
  4423. this.whiteAni = (this.getChild("whiteAni"));
  4424. this.blackAni = (this.getChild("blackAni"));
  4425. this.selfTurn = (this.getChild("selfTurn"));
  4426. this.aiTurn = (this.getChild("aiTurn"));
  4427. this.deskNode = (this.getChild("deskNode"));
  4428. this.moveNode = (this.getChild("moveNode"));
  4429. this.selfTalk = (this.getChild("selfTalk"));
  4430. this.aiTalk = (this.getChild("aiTalk"));
  4431. this.d2Node = (this.getChild("d2Node"));
  4432. this.snowNode = (this.getChild("snowNode"));
  4433. this.guide2 = (this.getChild("guide2"));
  4434. this.guide1 = (this.getChild("guide1"));
  4435. this.guide3 = (this.getChild("guide3"));
  4436. this.guideNode = (this.getChild("guideNode"));
  4437. }
  4438. }
  4439. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4440. class ui_UIGameEnd extends fgui.GComponent {
  4441. static createInstance() {
  4442. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4443. }
  4444. onConstruct() {
  4445. this.c1 = this.getController("c1");
  4446. this.n22 = (this.getChild("n22"));
  4447. this.n2 = (this.getChild("n2"));
  4448. this.n52 = (this.getChild("n52"));
  4449. this.n53 = (this.getChild("n53"));
  4450. this.coinNode = (this.getChild("coinNode"));
  4451. this.closeNode = (this.getChild("closeNode"));
  4452. this.moneyNode = (this.getChild("moneyNode"));
  4453. this.secretary = (this.getChild("secretary"));
  4454. this.n27 = (this.getChild("n27"));
  4455. this.n29 = (this.getChild("n29"));
  4456. this.talkNode = (this.getChild("talkNode"));
  4457. this.n38 = (this.getChild("n38"));
  4458. this.n39 = (this.getChild("n39"));
  4459. this.n40 = (this.getChild("n40"));
  4460. this.awardNode = (this.getChild("awardNode"));
  4461. this.starNumNode = (this.getChild("starNumNode"));
  4462. this.n47 = (this.getChild("n47"));
  4463. this.conditionNode = (this.getChild("conditionNode"));
  4464. this.isGetAward = (this.getChild("isGetAward"));
  4465. this.leftBtn = (this.getChild("leftBtn"));
  4466. this.rightBtn = (this.getChild("rightBtn"));
  4467. this.btnNode = (this.getChild("btnNode"));
  4468. }
  4469. }
  4470. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4471. class ui_UIAddCoin extends fgui.GComponent {
  4472. static createInstance() {
  4473. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4474. }
  4475. onConstruct() {
  4476. this.n11 = (this.getChild("n11"));
  4477. this.myNode = (this.getChild("myNode"));
  4478. this.t0 = this.getTransition("t0");
  4479. }
  4480. }
  4481. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4482. class UIAddCoin extends UIBase {
  4483. constructor() {
  4484. super();
  4485. this.coinNum = 2000;
  4486. }
  4487. onConstructor() {
  4488. this.ui = ui_UIAddCoin.createInstance();
  4489. this.contentPane = this.ui;
  4490. this.isEject = false;
  4491. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4492. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4493. }
  4494. show() {
  4495. super.show();
  4496. this.ui.t0.play();
  4497. this.setGlobalFont(this.ui);
  4498. }
  4499. videoAddCoin() {
  4500. console.log('zh:qjff_AD_for_UIAddCoin');
  4501. if (Laya.Browser.onAndroid) {
  4502. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4503. if (!boo) {
  4504. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4505. return;
  4506. }
  4507. }
  4508. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4509. }
  4510. else {
  4511. console.log('zh:AD 失败,直接发放奖励');
  4512. this.qjff_AD_for_UIAddCoin();
  4513. }
  4514. }
  4515. qjff_AD_for_UIAddCoin() {
  4516. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4517. this.hide();
  4518. }
  4519. }
  4520. UIAddCoin.uiName = "UIAddCoin";
  4521. class ui_UIInvitation extends fgui.GComponent {
  4522. static createInstance() {
  4523. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4524. }
  4525. onConstruct() {
  4526. this.n14 = (this.getChild("n14"));
  4527. this.myNode = (this.getChild("myNode"));
  4528. this.t0 = this.getTransition("t0");
  4529. }
  4530. }
  4531. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4532. class UIInvitation extends UIBase {
  4533. constructor() {
  4534. super();
  4535. }
  4536. onConstructor() {
  4537. this.ui = ui_UIInvitation.createInstance();
  4538. this.contentPane = this.ui;
  4539. this.isEject = false;
  4540. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4541. }
  4542. show() {
  4543. super.show();
  4544. this.setGlobalFont(this.ui);
  4545. }
  4546. enterGame() {
  4547. xGame.common.gameMode = GameMode.classic;
  4548. DataMgr.setChallengeTimes(1);
  4549. xGame.common.passAwardCoin = 2000;
  4550. let need = xGame.common.classicNiceNeddCoin;
  4551. if (DataMgr.coinEnough(need)) {
  4552. DataMgr.setCoin(-need);
  4553. xGame.eventMgr.event(RESTART_GAME, true);
  4554. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4555. }
  4556. else {
  4557. xGame.eventMgr.event(RESTART_GAME, true);
  4558. }
  4559. this.hide();
  4560. }
  4561. hide() {
  4562. super.hide();
  4563. }
  4564. }
  4565. UIInvitation.uiName = "UIInvitation";
  4566. class ui_UIMain extends fgui.GComponent {
  4567. static createInstance() {
  4568. return (fgui.UIPackage.createObject("game", "UIMain"));
  4569. }
  4570. onConstruct() {
  4571. this.n47 = (this.getChild("n47"));
  4572. this.n10 = (this.getChild("n10"));
  4573. this.secretary = (this.getChild("secretary"));
  4574. this.moneyNode = (this.getChild("moneyNode"));
  4575. this.headNode = (this.getChild("headNode"));
  4576. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4577. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4578. this.classicBtn = (this.getChild("classicBtn"));
  4579. this.globalBtn = (this.getChild("globalBtn"));
  4580. this.n44 = (this.getChild("n44"));
  4581. this.n_dengLu = (this.getChild("n_dengLu"));
  4582. this.settingNode = (this.getChild("settingNode"));
  4583. this.drawBtn = (this.getChild("drawBtn"));
  4584. this.signBtn = (this.getChild("signBtn"));
  4585. this.shopBtn = (this.getChild("shopBtn"));
  4586. this.n45 = (this.getChild("n45"));
  4587. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4588. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4589. this.rankBtn = (this.getChild("rankBtn"));
  4590. this.n46 = (this.getChild("n46"));
  4591. this.liucheng1 = (this.getChild("liucheng1"));
  4592. this.rightBtn = (this.getChild("rightBtn"));
  4593. this.n75 = (this.getChild("n75"));
  4594. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4595. this.liucheng2 = (this.getChild("liucheng2"));
  4596. this.guideBtn = (this.getChild("guideBtn"));
  4597. this.n73 = (this.getChild("n73"));
  4598. this.wordsNode = (this.getChild("wordsNode"));
  4599. this.enterGuide = (this.getChild("enterGuide"));
  4600. this.talkNode = (this.getChild("talkNode"));
  4601. this.n83 = (this.getChild("n83"));
  4602. this.n84 = (this.getChild("n84"));
  4603. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4604. }
  4605. }
  4606. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4607. class ui_UIMoyu extends fgui.GComponent {
  4608. static createInstance() {
  4609. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4610. }
  4611. onConstruct() {
  4612. this.ageTip = (this.getChild("ageTip"));
  4613. this.mainBg = (this.getChild("mainBg"));
  4614. this.xyNode = (this.getChild("xyNode"));
  4615. this.rnNode = (this.getChild("rnNode"));
  4616. this.fcmNode = (this.getChild("fcmNode"));
  4617. this.ageNode = (this.getChild("ageNode"));
  4618. this.tipNode = (this.getChild("tipNode"));
  4619. this.msgNode = (this.getChild("msgNode"));
  4620. }
  4621. }
  4622. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4623. class MoyuMgr {
  4624. static initMoyu() {
  4625. this.moyuView = new MoyuView();
  4626. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4627. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4628. this.moyuView.ui.displayObject.zOrder = 1000;
  4629. this.moyuView.init();
  4630. this.moyuView.showTip(true);
  4631. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4632. window['XApk'] = this;
  4633. }
  4634. static showAge(show) {
  4635. if (this.moyuView)
  4636. this.moyuView.showAge(show);
  4637. }
  4638. static onPlatMsg(idx) {
  4639. if (!MoyuMgr.moyuView)
  4640. return;
  4641. if (idx == '0') {
  4642. MoyuMgr.moyuView.showTip(false);
  4643. }
  4644. }
  4645. static showAgree(call) {
  4646. if (this.moyuView)
  4647. this.moyuView.showAgree(call);
  4648. else
  4649. call && call();
  4650. }
  4651. static showXy(type = 1) {
  4652. if (this.moyuView)
  4653. this.moyuView.showXy(type);
  4654. }
  4655. }
  4656. MoyuMgr.isAdvise = false;
  4657. class MoyuView {
  4658. constructor() {
  4659. this.ysxyNum = 1;
  4660. this.ysJson = null;
  4661. this.ui = ui_UIMoyu.createInstance();
  4662. }
  4663. init() {
  4664. this.ui.mainBg.visible = false;
  4665. this.ui.xyNode.visible = false;
  4666. this.ui.ageNode.visible = false;
  4667. this.ui.tipNode.visible = false;
  4668. this.ui.rnNode.visible = false;
  4669. this.ui.fcmNode.visible = false;
  4670. this.ui.ageTip.visible = false;
  4671. this.ui.msgNode.visible = false;
  4672. this.ui.visible = false;
  4673. this.ui.xyNode.xyList.setVirtual();
  4674. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4675. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4676. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4677. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4678. this.ui.xyNode.btnKnown.visible = false;
  4679. this.ui.xyNode.xy1.visible = false;
  4680. this.ui.xyNode.xy2.visible = false;
  4681. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4682. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4683. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4684. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4685. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4686. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4687. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4688. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4689. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4690. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4691. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4692. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4693. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4694. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4695. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4696. this.ysxyNum = 2;
  4697. }
  4698. }
  4699. onClick(obj) {
  4700. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4701. switch (obj) {
  4702. case this.ui.ageTip:
  4703. if (Moyu.isTTApk) {
  4704. this.ui.ageNode.visible = true;
  4705. this.ui.mainBg.visible = true;
  4706. }
  4707. break;
  4708. case this.ui.tipNode:
  4709. this.showTip(false);
  4710. break;
  4711. case this.ui.ageNode.btnAge:
  4712. this.ui.ageNode.visible = false;
  4713. this.ui.mainBg.visible = false;
  4714. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4715. this.ui.visible = false;
  4716. break;
  4717. case this.ui.xyNode.btnXy3:
  4718. case this.ui.xyNode.btnXy1:
  4719. this.loadXy(1);
  4720. break;
  4721. case this.ui.xyNode.btnXy2:
  4722. this.loadXy(2);
  4723. break;
  4724. case this.ui.xyNode.btnBack:
  4725. this.ui.xyNode.xy1.visible = true;
  4726. this.ui.xyNode.xy2.visible = false;
  4727. break;
  4728. case this.ui.xyNode.btnKnown:
  4729. this.ui.xyNode.visible = false;
  4730. this.ui.mainBg.visible = false;
  4731. this.ui.visible = false;
  4732. break;
  4733. case this.ui.rnNode.btnCheck:
  4734. this.check();
  4735. break;
  4736. case this.ui.rnNode.btnExit:
  4737. case this.ui.xyNode.btnNo:
  4738. this.ysxyNum--;
  4739. if (this.ysxyNum > 0)
  4740. this.showMsg("Refuse to quit the game once again");
  4741. else {
  4742. Moyu.userAgree(false);
  4743. Moyu.exit();
  4744. }
  4745. break;
  4746. case this.ui.xyNode.btnSure:
  4747. case this.ui.xyNode.btnYes:
  4748. DataMgr.userData.isAgree = true;
  4749. DataMgr.saveUserData();
  4750. this.onAgree();
  4751. break;
  4752. case this.ui.rnNode.btnDone:
  4753. this.ui.rnNode.visible = false;
  4754. this.ui.visible = false;
  4755. break;
  4756. case this.ui.fcmNode.btnRn:
  4757. this.showRn();
  4758. break;
  4759. }
  4760. }
  4761. showTip(show) {
  4762. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4763. return;
  4764. if (show) {
  4765. MoyuMgr.isAdvise = true;
  4766. this.ui.visible = true;
  4767. this.ui.tipNode.visible = true;
  4768. this.ui.tipNode.alpha = 1;
  4769. Laya.timer.once(1000, this, this.showTip, [false]);
  4770. }
  4771. else {
  4772. this.ui.tipNode.alpha = 1;
  4773. this.ui.tipNode.visible = true;
  4774. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4775. this.ui.tipNode.visible = false;
  4776. MoyuMgr.isAdvise = false;
  4777. }), 1000);
  4778. }
  4779. }
  4780. showAge(show, px = 0, py = 0) {
  4781. if (Moyu.platType > 10 && !Moyu.isIos) {
  4782. this.ui.ageTip.x = px;
  4783. this.ui.ageTip.y = py;
  4784. this.ui.ageTip.visible = show;
  4785. if (show)
  4786. this.ui.visible = true;
  4787. }
  4788. }
  4789. showAgree(call) {
  4790. this.agreeCall = call;
  4791. this.onAgree();
  4792. return;
  4793. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4794. this.showXy(0);
  4795. }
  4796. else
  4797. this.onAgree();
  4798. }
  4799. onAgree() {
  4800. if (!this.ui.ageNode.visible)
  4801. this.ui.visible = false;
  4802. this.ui.xyNode.visible = false;
  4803. Moyu.userAgree(true);
  4804. this.showAge(false);
  4805. this.agreeCall && this.agreeCall();
  4806. this.showRn();
  4807. }
  4808. showMsg(txt) {
  4809. this.ui.msgNode.txtMsg.text = txt;
  4810. this.ui.msgNode.visible = true;
  4811. this.ui.msgNode.alpha = 1;
  4812. this.ui.visible = true;
  4813. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4814. this.ui.msgNode.visible = false;
  4815. }), 2500, true);
  4816. }
  4817. showRn() {
  4818. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4819. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4820. this.ui.rnNode.rn1.visible = true;
  4821. this.ui.rnNode.rn2.visible = false;
  4822. this.ui.rnNode.rn3.visible = false;
  4823. this.ui.rnNode.rn4.visible = false;
  4824. this.ui.rnNode.visible = true;
  4825. this.ui.mainBg.visible = true;
  4826. this.ui.rnNode.btnDone.visible = false;
  4827. this.ui.rnNode.btnExit.visible = true;
  4828. this.ui.rnNode.btnCheck.visible = true;
  4829. this.ui.fcmNode.visible = false;
  4830. this.ui.visible = true;
  4831. return;
  4832. }
  4833. }
  4834. this.showFcm();
  4835. }
  4836. showFcm() {
  4837. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4838. Moyu.initFCM(true);
  4839. if (Moyu.gameTime < 1)
  4840. this.fcmLoop();
  4841. else if (Moyu.gameTime < 999)
  4842. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4843. }
  4844. }
  4845. fcmLoop() {
  4846. if (Moyu.gameTime < 1) {
  4847. this.ui.rnNode.visible = false;
  4848. this.ui.fcmNode.visible = true;
  4849. this.ui.mainBg.visible = true;
  4850. this.ui.visible = true;
  4851. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4852. Laya.timer.clear(this.ui, this.fcmLoop);
  4853. }
  4854. }
  4855. check() {
  4856. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4857. this.ui.rnNode.rn1.visible = false;
  4858. this.ui.rnNode.rn2.visible = false;
  4859. this.ui.rnNode.rn4.visible = true;
  4860. }
  4861. else if (this.ui.rnNode.rn4.visible) {
  4862. let name = this.ui.rnNode.inputName.text;
  4863. let code = this.ui.rnNode.inputCode.text;
  4864. if (code && code.length == 18) {
  4865. this.ui.rnNode.rn1.visible = false;
  4866. this.ui.rnNode.rn4.visible = false;
  4867. Moyu.authenticate(name, code, (res) => {
  4868. this.ui.rnNode.rn2.visible = !res;
  4869. this.ui.rnNode.rn3.visible = res;
  4870. this.ui.rnNode.btnDone.visible = res;
  4871. this.ui.rnNode.btnExit.visible = !res;
  4872. this.ui.rnNode.btnCheck.visible = !res;
  4873. if (res)
  4874. this.showFcm();
  4875. });
  4876. }
  4877. else
  4878. this.showMsg("信息填写不完整");
  4879. }
  4880. }
  4881. loadXy(type = 0) {
  4882. this.ui.xyNode.xy1.visible = false;
  4883. this.ui.xyNode.xy2.visible = true;
  4884. this.ui.xyNode.xyList.scrollToView(0);
  4885. if (type == 1) {
  4886. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4887. }
  4888. else if (type == 2) {
  4889. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4890. }
  4891. }
  4892. showXy(type = 0) {
  4893. this.xyBtn();
  4894. if (type == 0) {
  4895. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4896. this.ui.xyNode.btnSure.visible = true;
  4897. }
  4898. else {
  4899. this.ui.xyNode.btnYes.visible = true;
  4900. this.ui.xyNode.btnNo.visible = true;
  4901. }
  4902. }
  4903. else {
  4904. this.ui.xyNode.btnKnown.visible = true;
  4905. this.ui.mainBg.visible = true;
  4906. }
  4907. this.ui.xyNode.xy1.visible = true;
  4908. this.ui.xyNode.xy2.visible = false;
  4909. this.ui.xyNode.visible = true;
  4910. this.ui.visible = true;
  4911. }
  4912. xyBtn() {
  4913. this.ui.xyNode.btnSure.visible = false;
  4914. this.ui.xyNode.btnYes.visible = false;
  4915. this.ui.xyNode.btnNo.visible = false;
  4916. this.ui.xyNode.btnKnown.visible = false;
  4917. {
  4918. this.ui.xyNode.btnXy3.visible = false;
  4919. this.ui.xyNode.btnXy2.visible = true;
  4920. this.ui.xyNode.btnXy1.visible = true;
  4921. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4922. }
  4923. }
  4924. createXY(json) {
  4925. this.ysJson = json.content;
  4926. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4927. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4928. this.ui.xyNode.xy2.visible = true;
  4929. }
  4930. renderListItem(idx, cell) {
  4931. let xy = this.ysJson[idx];
  4932. cell.height = xy.line * 30;
  4933. cell.xyItem.text = xy.text;
  4934. }
  4935. onDestroy() {
  4936. this.agreeCall = null;
  4937. }
  4938. }
  4939. class SettingNode {
  4940. constructor(ui) {
  4941. this.showSetting = false;
  4942. this.openSound = true;
  4943. this.openShake = true;
  4944. this.ui = ui;
  4945. this.ui.soundBtn.onClick(this, this.switchSound);
  4946. this.ui.shakeBtn.onClick(this, this.switchShake);
  4947. this.ui.xyBtn.onClick(this, this.onXy);
  4948. this.ui.clickNode.onClick(this, this.changeSetting);
  4949. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4950. this.ui.xyBtn.visible = false;
  4951. this.ui.shakeBtn.visible = false;
  4952. }
  4953. changeSetting() {
  4954. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4955. this.showSetting = !this.showSetting;
  4956. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4957. }
  4958. switchSound() {
  4959. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4960. this.openSound = !this.openSound;
  4961. Moyu.onSetting(this.openSound, this.openShake);
  4962. xGame.soundMgr.onSetting(this.openSound);
  4963. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4964. }
  4965. switchShake() {
  4966. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4967. this.openShake = !this.openShake;
  4968. Moyu.onSetting(this.openSound, this.openShake);
  4969. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4970. }
  4971. onXy() {
  4972. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4973. MoyuMgr.showXy(1);
  4974. }
  4975. }
  4976. class ui_UILevelDisplay extends fgui.GComponent {
  4977. static createInstance() {
  4978. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  4979. }
  4980. onConstruct() {
  4981. this.n9 = (this.getChild("n9"));
  4982. this.myNode = (this.getChild("myNode"));
  4983. this.closeNode = (this.getChild("closeNode"));
  4984. }
  4985. }
  4986. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  4987. class ui_UILevelProp extends fgui.GComponent {
  4988. static createInstance() {
  4989. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  4990. }
  4991. onConstruct() {
  4992. this.n16 = (this.getChild("n16"));
  4993. this.myNode = (this.getChild("myNode"));
  4994. this.closeBtn = (this.getChild("closeBtn"));
  4995. this.moneyNode = (this.getChild("moneyNode"));
  4996. this.t1 = this.getTransition("t1");
  4997. }
  4998. }
  4999. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  5000. class ui_ShowItem extends fgui.GComponent {
  5001. static createInstance() {
  5002. return (fgui.UIPackage.createObject("game", "ShowItem"));
  5003. }
  5004. onConstruct() {
  5005. this.myImg = (this.getChild("myImg"));
  5006. }
  5007. }
  5008. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5009. class ShowItem {
  5010. constructor() {
  5011. this.ui = ui_ShowItem.createInstance();
  5012. }
  5013. destroySelf() {
  5014. if (!this.ui.isDisposed) {
  5015. this.ui.removeFromParent();
  5016. this.ui.dispose();
  5017. }
  5018. }
  5019. setParent(parent) {
  5020. parent.addChild(this.ui);
  5021. }
  5022. setPos(x, y) {
  5023. this.ui.x = x;
  5024. this.ui.y = y;
  5025. }
  5026. setUrl(index) {
  5027. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5028. }
  5029. }
  5030. class ui_UIPower extends fgui.GComponent {
  5031. static createInstance() {
  5032. return (fgui.UIPackage.createObject("game", "UIPower"));
  5033. }
  5034. onConstruct() {
  5035. this.n11 = (this.getChild("n11"));
  5036. this.myNode = (this.getChild("myNode"));
  5037. this.t0 = this.getTransition("t0");
  5038. }
  5039. }
  5040. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5041. class UIPower extends UIBase {
  5042. constructor() {
  5043. super();
  5044. }
  5045. onConstructor() {
  5046. this.ui = ui_UIPower.createInstance();
  5047. this.contentPane = this.ui;
  5048. this.isEject = false;
  5049. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5050. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5051. }
  5052. show() {
  5053. super.show();
  5054. this.ui.t0.play();
  5055. this.setGlobalFont(this.ui);
  5056. }
  5057. videoGetPower() {
  5058. console.log('zh:qjff_AD_for_uipower');
  5059. if (Laya.Browser.onAndroid) {
  5060. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5061. if (!boo) {
  5062. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5063. return;
  5064. }
  5065. }
  5066. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5067. }
  5068. else {
  5069. console.log('zh:AD 失败,直接发放奖励');
  5070. this.qjff_AD_for_uipower();
  5071. }
  5072. }
  5073. qjff_AD_for_uipower() {
  5074. DataMgr.setPower(xGame.common.videoPower, true);
  5075. xGame.eventMgr.event(POWER_TIME);
  5076. this.hide();
  5077. }
  5078. }
  5079. UIPower.uiName = "UIPower";
  5080. class UILevelProp extends UIBase {
  5081. constructor() {
  5082. super();
  5083. this.firstPos = 385;
  5084. this.secondPos = 467;
  5085. this.showItemArr = [];
  5086. }
  5087. onConstructor() {
  5088. this.ui = ui_UILevelProp.createInstance();
  5089. this.contentPane = this.ui;
  5090. this.isEject = false;
  5091. this.addUIClick(this.ui.closeBtn, this.hideWin);
  5092. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5093. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5094. }
  5095. show(level) {
  5096. console.log('zh:show.');
  5097. super.show();
  5098. this.ui.t1.play();
  5099. this.level = level;
  5100. this.data = cfgTable.placeballData[this.level];
  5101. this.updateSelf();
  5102. this.showPreView();
  5103. this.moneyNode.ui.c1.selectedIndex = 2;
  5104. this.moneyNode.checkPowerTime();
  5105. this.moneyNode.powerChange();
  5106. this.setGlobalFont(this.ui);
  5107. }
  5108. showPreView() {
  5109. let item;
  5110. let data;
  5111. for (let index = 0; index < this.showItemArr.length; index++) {
  5112. item = this.showItemArr[index];
  5113. item.destroySelf();
  5114. }
  5115. this.showItemArr = [];
  5116. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5117. for (const key in cfgData) {
  5118. data = cfgData[key];
  5119. item = new ShowItem();
  5120. item.setParent(this.ui.myNode.displayRoot);
  5121. item.setPos(data.x, data.y);
  5122. item.setUrl(data.value);
  5123. this.showItemArr.push(item);
  5124. }
  5125. }
  5126. updateSelf() {
  5127. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5128. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5129. if (this.data.ball == -1) {
  5130. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5131. }
  5132. else {
  5133. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5134. }
  5135. let localData = DataMgr.getPlaceBallLevel(this.level);
  5136. let getAward = localData.getAward;
  5137. let cfg = cfgTable.placeballData[this.level];
  5138. let coin = this.data.award[0];
  5139. let diamond = this.data.award[1];
  5140. if (cfg.type == PlaceBallType.challenge) {
  5141. diamond = 0;
  5142. coin = 100;
  5143. }
  5144. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5145. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5146. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5147. if (cfg.type == PlaceBallType.challenge) {
  5148. this.ui.myNode.coinNode.numTxt.text = "";
  5149. }
  5150. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5151. if (coin > 0 && diamond > 0) {
  5152. this.ui.myNode.diamondNode.x = 385;
  5153. this.ui.myNode.coinNode.x = 467;
  5154. }
  5155. else {
  5156. this.ui.myNode.diamondNode.x = 385;
  5157. this.ui.myNode.coinNode.x = 385;
  5158. }
  5159. if (!getAward) {
  5160. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5161. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5162. }
  5163. else {
  5164. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5165. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5166. }
  5167. }
  5168. startGame() {
  5169. console.log("zh:startGame");
  5170. if (DataMgr.powerEnough()) {
  5171. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5172. this.ui.myNode.startBtn.touchable = false;
  5173. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5174. console.log('zh:startGame dh ');
  5175. this.ui.myNode.startBtn.touchable = true;
  5176. DataMgr.setPower(-1);
  5177. xGame.eventMgr.event(POWER_TIME);
  5178. xGame.common.gameMode = GameMode.placeBall;
  5179. xGame.common.placeBallCurLevel = this.level;
  5180. xGame.uiMgr.Show(UIGame);
  5181. xGame.uiMgr.Hide(UILevelDisplay);
  5182. xGame.uiMgr.Hide(UIMain);
  5183. this.logEventForChallenge_level_start(this.level);
  5184. this.hideWin();
  5185. }));
  5186. console.log('zh:eeeee');
  5187. }
  5188. else {
  5189. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  5190. xGame.uiMgr.Show(UIPower);
  5191. }
  5192. }
  5193. logEventForChallenge_level_start(level) {
  5194. let keyStr = 'sjmd_challenge_level_start';
  5195. let jsonStr = {
  5196. "count": 1,
  5197. "gold_balance ": DataMgr.getCoin(),
  5198. "level": level,
  5199. "diamond_balance ": DataMgr.getDiamond()
  5200. };
  5201. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5202. const d = LocalStorageManager.getItem(keyStr);
  5203. if (level > d.level) {
  5204. jsonStr.count = d.count + 1;
  5205. LocalStorageManager.setItem(keyStr, jsonStr);
  5206. }
  5207. else {
  5208. }
  5209. }
  5210. else {
  5211. LocalStorageManager.setItem(keyStr, jsonStr);
  5212. }
  5213. const reqStr = JSON.stringify(jsonStr);
  5214. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5215. }
  5216. hideWin() {
  5217. super.hide();
  5218. if (this.ui.myNode.startBtn) {
  5219. this.ui.myNode.startBtn.touchable = true;
  5220. if (this.ui.myNode.startBtn.powerEft.t0) {
  5221. this.ui.myNode.startBtn.powerEft.t0.stop();
  5222. }
  5223. }
  5224. }
  5225. }
  5226. UILevelProp.uiName = "UILevelProp";
  5227. class PutBallLevelDisplay {
  5228. constructor(ui, index) {
  5229. this.index = 0;
  5230. this.ui = ui;
  5231. this.index = index;
  5232. this.ui.onClick(this, this.clickSelf);
  5233. this.updateSelf();
  5234. this.ui.levelTxt.text = (this.index + 1) + "";
  5235. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5236. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5237. }
  5238. updateSelf() {
  5239. let level = this.index + 1;
  5240. this.data = DataMgr.getPlaceBallLevel(level);
  5241. this.ui.starNode.c1.selectedIndex = this.data.star;
  5242. let isChallenge = cfgTable.placeballData[level].type;
  5243. if (this.data.isCur) {
  5244. if (isChallenge) {
  5245. this.ui.c1.selectedIndex = 5;
  5246. }
  5247. else {
  5248. this.ui.c1.selectedIndex = 2;
  5249. }
  5250. }
  5251. else {
  5252. if (this.data.play) {
  5253. if (this.data.star == 3) {
  5254. this.ui.c1.selectedIndex = 0;
  5255. }
  5256. else {
  5257. this.ui.c1.selectedIndex = 1;
  5258. }
  5259. }
  5260. else {
  5261. if (isChallenge) {
  5262. this.ui.c1.selectedIndex = 4;
  5263. }
  5264. else {
  5265. this.ui.c1.selectedIndex = 3;
  5266. }
  5267. }
  5268. }
  5269. }
  5270. clickSelf() {
  5271. if (!this.data.play)
  5272. return;
  5273. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5274. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5275. }
  5276. }
  5277. class UILevelDisplay extends UIBase {
  5278. constructor() {
  5279. super();
  5280. }
  5281. onConstructor() {
  5282. this.ui = ui_UILevelDisplay.createInstance();
  5283. this.contentPane = this.ui;
  5284. this.isEject = false;
  5285. this.myList = this.ui.myNode.myList;
  5286. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5287. this.levelItemArr = [];
  5288. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5289. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5290. this.myList.numItems = levelNum;
  5291. }
  5292. levelItemRender(index, target) {
  5293. let item = new PutBallLevelDisplay(target, index);
  5294. this.levelItemArr.push(item);
  5295. }
  5296. show() {
  5297. super.show();
  5298. this.updateLevel();
  5299. this.scrollToPlace();
  5300. this.setGlobalFont(this.ui);
  5301. }
  5302. updateLevel() {
  5303. let temp;
  5304. for (let index = 0; index < this.levelItemArr.length; index++) {
  5305. temp = this.levelItemArr[index];
  5306. temp.updateSelf();
  5307. }
  5308. }
  5309. scrollToPlace() {
  5310. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5311. let passArr = DataMgr.getPlaceBallLevelList();
  5312. let offest = passArr.length;
  5313. if (offest >= maxNum - 1)
  5314. offest = maxNum - 1;
  5315. this.myList.scrollToView(offest, true, true);
  5316. }
  5317. hide() {
  5318. super.hide();
  5319. }
  5320. }
  5321. UILevelDisplay.uiName = "UILevelDisplay";
  5322. class ui_UIMatching extends fgui.GComponent {
  5323. static createInstance() {
  5324. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5325. }
  5326. onConstruct() {
  5327. this.n5 = (this.getChild("n5"));
  5328. this.n49 = (this.getChild("n49"));
  5329. this.n51 = (this.getChild("n51"));
  5330. this.n64 = (this.getChild("n64"));
  5331. this.n2 = (this.getChild("n2"));
  5332. this.n53 = (this.getChild("n53"));
  5333. this.n54 = (this.getChild("n54"));
  5334. this.n56 = (this.getChild("n56"));
  5335. this.n58 = (this.getChild("n58"));
  5336. this.n59 = (this.getChild("n59"));
  5337. this.n57 = (this.getChild("n57"));
  5338. this.n60 = (this.getChild("n60"));
  5339. this.n62 = (this.getChild("n62"));
  5340. this.awardTxt = (this.getChild("awardTxt"));
  5341. this.n61 = (this.getChild("n61"));
  5342. this.selfHead = (this.getChild("selfHead"));
  5343. this.aiHead = (this.getChild("aiHead"));
  5344. this.n82 = (this.getChild("n82"));
  5345. this.n84 = (this.getChild("n84"));
  5346. this.n83 = (this.getChild("n83"));
  5347. this.t1 = this.getTransition("t1");
  5348. this.t2 = this.getTransition("t2");
  5349. this.t3 = this.getTransition("t3");
  5350. this.t4 = this.getTransition("t4");
  5351. }
  5352. }
  5353. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5354. class UIMatching extends UIBase {
  5355. constructor() {
  5356. super();
  5357. }
  5358. onConstructor() {
  5359. this.ui = ui_UIMatching.createInstance();
  5360. this.contentPane = this.ui;
  5361. this.isEject = false;
  5362. }
  5363. show(callback) {
  5364. super.show();
  5365. PlatMgr.showBanner(true);
  5366. this.callback = callback;
  5367. let user = Moyu.getUserInfo();
  5368. if (!this.selfPot) {
  5369. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5370. }
  5371. if (!this.aiPot) {
  5372. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5373. }
  5374. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5375. this.ui.selfHead.nameTxt.text = user.nickName;
  5376. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5377. this.ui.aiHead.nameTxt.text = "???";
  5378. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5379. this.ui.selfHead.c1.selectedIndex = 0;
  5380. this.ui.aiHead.c1.selectedIndex = 0;
  5381. this.ui.selfHead.x = this.selfPot.x;
  5382. this.ui.selfHead.y = this.selfPot.y;
  5383. this.ui.aiHead.x = this.aiPot.x;
  5384. this.ui.aiHead.y = this.aiPot.y;
  5385. switch (xGame.common.gameMode) {
  5386. case GameMode.classic:
  5387. break;
  5388. case GameMode.bigMove:
  5389. this.initSkillData();
  5390. break;
  5391. default:
  5392. break;
  5393. }
  5394. this.ui.t1.play(Laya.Handler.create(this, () => {
  5395. this.ui.t2.play(Laya.Handler.create(this, () => {
  5396. switch (xGame.common.gameMode) {
  5397. case GameMode.classic:
  5398. this.waitingPeople();
  5399. break;
  5400. case GameMode.bigMove:
  5401. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5402. break;
  5403. default:
  5404. break;
  5405. }
  5406. }));
  5407. }));
  5408. this.setGlobalFont(this.ui);
  5409. }
  5410. initSkillData() {
  5411. this.skillSelectData = [];
  5412. let skillUrl = xGame.common.skillIconList;
  5413. let skillName = xGame.common.skillNameList;
  5414. let skillLevel = DataMgr.getBigSkillList();
  5415. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5416. for (let index = 0; index < 5; index++) {
  5417. let obj = {};
  5418. obj.skillImg = skillUrl[index];
  5419. obj.skillName = skillName[index];
  5420. obj.skillType = skillType[index];
  5421. obj.skillLevel = skillLevel[index];
  5422. this.skillSelectData.push(obj);
  5423. }
  5424. }
  5425. getAISkillLevel(myLevel) {
  5426. let video = xGame.common.upSkillLevel;
  5427. let aiLevel;
  5428. let temp;
  5429. if (video) {
  5430. temp = xGame.common.randomNum(-2, -1);
  5431. }
  5432. else {
  5433. if (myLevel <= 5) {
  5434. temp = xGame.common.randomNum(1, 3);
  5435. }
  5436. else if (myLevel <= 9) {
  5437. temp = xGame.common.randomNum(-2, 1);
  5438. }
  5439. else {
  5440. temp = xGame.common.randomNum(-4, 0);
  5441. }
  5442. }
  5443. aiLevel = temp + myLevel;
  5444. if (aiLevel <= 1)
  5445. aiLevel = 1;
  5446. if (aiLevel >= 10)
  5447. aiLevel = 10;
  5448. return aiLevel;
  5449. }
  5450. getAISkillType() {
  5451. return xGame.common.randomNum(1, 4);
  5452. let successTimes = DataMgr.getSkillSuccessTimes();
  5453. let info = cfgTable.aiskillData[successTimes];
  5454. if (!info) {
  5455. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5456. info = cfgTable.aiskillData[max];
  5457. }
  5458. let dataArr = info.skillselect;
  5459. let myCfg = {};
  5460. for (let index = 0; index < dataArr.length; index++) {
  5461. let temp = dataArr[index].split('-');
  5462. myCfg[temp[0]] = {};
  5463. myCfg[temp[0]].id = parseInt(temp[0]);
  5464. myCfg[temp[0]].weight = parseInt(temp[1]);
  5465. }
  5466. let aiCfg = xGame.common.initWeight(myCfg);
  5467. let curData = xGame.common.getRandomWeightData(aiCfg);
  5468. return parseInt(curData.id);
  5469. }
  5470. getAISkillData(index) {
  5471. let myLevel = this.skillSelectData[index].skillLevel;
  5472. let aiLevel = this.getAISkillLevel(myLevel);
  5473. let aiType = this.getAISkillType() - 1;
  5474. return { aiLevel, aiType } = { aiLevel, aiType };
  5475. }
  5476. skillSelectFinish(index) {
  5477. let aiInfo = this.getAISkillData(index);
  5478. xGame.common.gameMgr.selfCurSkill = index;
  5479. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5480. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5481. this.ui.selfHead.c1.selectedIndex = 1;
  5482. this.ui.aiHead.c1.selectedIndex = 1;
  5483. let myData = this.skillSelectData[index];
  5484. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5485. let guide = DataMgr.getSkillGuide();
  5486. if (guide == 0) {
  5487. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5488. }
  5489. else {
  5490. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5491. }
  5492. let aiData = this.skillSelectData[aiInfo.aiType];
  5493. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5494. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5495. this.waitingPeople();
  5496. }
  5497. waitingPeople() {
  5498. let time = xGame.common.randomNum(1000, 3000);
  5499. time += 1000;
  5500. Laya.timer.once(time, this, () => {
  5501. this.matchingSuccess();
  5502. });
  5503. }
  5504. matchingSuccess() {
  5505. let gameUI = xGame.common.gameUI;
  5506. let name = gameUI.ui.topNode.aiNameTxt.text;
  5507. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5508. this.ui.aiHead.nameTxt.text = name;
  5509. this.ui.aiHead.headImg.url = url;
  5510. name = gameUI.ui.topNode.selfNameTxt.text;
  5511. url = gameUI.ui.topNode.selfHeadLoader.url;
  5512. this.ui.selfHead.nameTxt.text = name;
  5513. this.ui.selfHead.headImg.url = url;
  5514. this.ui.t3.play(Laya.Handler.create(this, () => {
  5515. this.callback && this.callback();
  5516. this.ui.t4.play(Laya.Handler.create(this, () => {
  5517. this.destroySelf();
  5518. }));
  5519. }));
  5520. }
  5521. destroySelf() {
  5522. this.callback = null;
  5523. this.skillSelectData = null;
  5524. this.selfPot = null;
  5525. this.aiPot = null;
  5526. if (!this.ui.isDisposed) {
  5527. this.ui.removeFromParent();
  5528. this.ui.dispose();
  5529. }
  5530. xGame.uiMgr.destroyUI(this);
  5531. }
  5532. }
  5533. UIMatching.uiName = "UIMatching";
  5534. class ui_UIRanking extends fgui.GComponent {
  5535. static createInstance() {
  5536. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5537. }
  5538. onConstruct() {
  5539. this.n26 = (this.getChild("n26"));
  5540. this.myNode = (this.getChild("myNode"));
  5541. }
  5542. }
  5543. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5544. class UIRanking extends UIBase {
  5545. constructor() {
  5546. super();
  5547. this.showSelf = true;
  5548. this.rankType = 1;
  5549. this.rankList = [];
  5550. this.topX = 10;
  5551. this.myIndex = this.topX + 1;
  5552. this.myStar = 0;
  5553. }
  5554. onConstructor() {
  5555. this.ui = ui_UIRanking.createInstance();
  5556. this.contentPane = this.ui;
  5557. this.isEject = false;
  5558. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5559. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5560. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5561. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5562. this.ui.myNode.myList.setVirtual();
  5563. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5564. }
  5565. show() {
  5566. super.show();
  5567. this.getPaiHangBangDataFormJosnFile();
  5568. this.updateSelf();
  5569. let self = Moyu.getUserInfo();
  5570. if (!self.isAuth) {
  5571. Moyu.initUser(this, () => {
  5572. DataMgr.upRankData();
  5573. });
  5574. }
  5575. this.setGlobalFont(this.ui);
  5576. }
  5577. getPaiHangBangDataFormJosnFile() {
  5578. const rankingList = cfgTable.paiHangBangData.list;
  5579. this.updateItemData(rankingList);
  5580. }
  5581. updateSelfItem() {
  5582. console.log('zh:Moyu.platType =' + Moyu.platType);
  5583. let self = Moyu.getUserInfo();
  5584. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5585. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5586. if (this.myIndex > this.topX) {
  5587. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5588. }
  5589. else {
  5590. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5591. }
  5592. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5593. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5594. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5595. }
  5596. updateItemData(data) {
  5597. this.myStar = xGame.common.getAllStarNum();
  5598. if (this.rankList.length < 2) {
  5599. this.rankList = data;
  5600. let self = Moyu.getUserInfo();
  5601. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5602. self.headIcon = self.headIcon;
  5603. for (let i = 0; i < data.length; i++) {
  5604. let data = this.rankList[i];
  5605. if (data.userId == self.userId) {
  5606. this.rankList.splice(i, 1);
  5607. break;
  5608. }
  5609. }
  5610. for (let i = 0; i < data.length; i++) {
  5611. let data = this.rankList[i];
  5612. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5613. this.myIndex = i + 1;
  5614. let user = { headIcon: self.headIcon, nickName: "myself" };
  5615. let ud = { user: user, data: {} };
  5616. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5617. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5618. if (Moyu.platType < 11) {
  5619. user.headIcon = self.headIcon;
  5620. user.nickName = self.nickName;
  5621. }
  5622. this.rankList.splice(i, 0, md);
  5623. break;
  5624. }
  5625. }
  5626. }
  5627. this.updateSelfItem();
  5628. this.ui.myNode.myList.numItems = this.rankList.length;
  5629. }
  5630. updateItemUI(index, obj) {
  5631. let data = this.rankList[index];
  5632. let userData = JSON.parse(data.userData).user;
  5633. obj.nameTxt.text = userData.nickName.toString();
  5634. obj.valueTxt.text = data.rankScore;
  5635. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5636. obj.rankTxt.text = index + 1;
  5637. switch (index) {
  5638. case 0:
  5639. this.setImg(obj, 1, 0, 0);
  5640. obj.rankTxt.color = "#FFC047";
  5641. break;
  5642. case 1:
  5643. this.setImg(obj, 0, 1, 0);
  5644. obj.rankTxt.color = "#ACACAC";
  5645. break;
  5646. case 2:
  5647. this.setImg(obj, 0, 0, 1);
  5648. obj.rankTxt.color = "#D09672";
  5649. break;
  5650. default:
  5651. this.setImg(obj, 0, 0, 0);
  5652. obj.rankTxt.color = "#496FAB";
  5653. break;
  5654. }
  5655. }
  5656. setImg(obj, a, b, c) {
  5657. obj.img1.visible = a ? true : false;
  5658. obj.img2.visible = b ? true : false;
  5659. obj.img3.visible = c ? true : false;
  5660. }
  5661. changeList(type) {
  5662. this.rankType = type;
  5663. this.updateSelf();
  5664. }
  5665. changeSelfNode() {
  5666. this.showSelf = !this.showSelf;
  5667. this.updateSelf();
  5668. }
  5669. updateSelf() {
  5670. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5671. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5672. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5673. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5674. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5675. }
  5676. }
  5677. UIRanking.uiName = "UIRanking";
  5678. class ui_UISecretary extends fgui.GComponent {
  5679. static createInstance() {
  5680. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5681. }
  5682. onConstruct() {
  5683. this.n0 = (this.getChild("n0"));
  5684. this.myNode = (this.getChild("myNode"));
  5685. this.closeBtn = (this.getChild("closeBtn"));
  5686. this.t0 = this.getTransition("t0");
  5687. }
  5688. }
  5689. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5690. class UISecretary extends UIBase {
  5691. constructor() {
  5692. super();
  5693. this.curIndex = 1;
  5694. }
  5695. onConstructor() {
  5696. this.ui = ui_UISecretary.createInstance();
  5697. this.contentPane = this.ui;
  5698. this.isEject = false;
  5699. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5700. this.nodeObj = { left: null, right: null, cur: null };
  5701. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5702. }
  5703. show() {
  5704. super.show();
  5705. this.ui.t0.play();
  5706. this.updateData();
  5707. this.setGlobalFont(this.ui);
  5708. }
  5709. addSecretarySpine(node, spineName) {
  5710. if (spineName == "mishu") {
  5711. if (this.secretarySpine1) {
  5712. node.displayObject.destroyChildren();
  5713. this.playWoman(this.secretarySpine1, node.displayObject);
  5714. }
  5715. else {
  5716. let spine1 = new SpineMgr("mishu", () => {
  5717. this.secretarySpine1 = spine1;
  5718. this.playWoman(this.secretarySpine1, node.displayObject);
  5719. });
  5720. }
  5721. }
  5722. else {
  5723. if (this.secretarySpine2) {
  5724. node.displayObject.destroyChildren();
  5725. this.playWoman(this.secretarySpine2, node.displayObject);
  5726. }
  5727. else {
  5728. let spine2 = new SpineMgr("xiaomishu2", () => {
  5729. this.secretarySpine2 = spine2;
  5730. this.playWoman(this.secretarySpine2, node.displayObject);
  5731. });
  5732. }
  5733. }
  5734. }
  5735. playWoman(node, parent) {
  5736. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5737. let yy = this.ui.myNode.gameNode3.secretary.height;
  5738. let scale = 1.5;
  5739. if (node == this.secretarySpine2) {
  5740. scale = 1.2;
  5741. }
  5742. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5743. node.play(data, 0, true, parent);
  5744. }
  5745. turnLeft() {
  5746. this.curIndex--;
  5747. if (this.curIndex < 1) {
  5748. this.curIndex = 2;
  5749. }
  5750. let left = this.nodeObj.left;
  5751. let right = this.nodeObj.right;
  5752. let cur = this.nodeObj.cur;
  5753. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5754. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5755. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5756. this.updateData();
  5757. }));
  5758. this.ui.myNode.setChildIndex(right, 2);
  5759. this.nodeObj.left = cur;
  5760. this.nodeObj.right = left;
  5761. this.nodeObj.cur = right;
  5762. }
  5763. turnRight() {
  5764. this.curIndex++;
  5765. if (this.curIndex > 2) {
  5766. this.curIndex = 1;
  5767. }
  5768. let left = this.nodeObj.left;
  5769. let right = this.nodeObj.right;
  5770. let cur = this.nodeObj.cur;
  5771. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5772. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5773. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5774. this.updateData();
  5775. }));
  5776. this.ui.myNode.setChildIndex(left, 2);
  5777. this.nodeObj.left = right;
  5778. this.nodeObj.right = cur;
  5779. this.nodeObj.cur = left;
  5780. }
  5781. updateData() {
  5782. console.log('zh: updateData FFFFFFFFFF');
  5783. let data = cfgTable.secretaryshopData;
  5784. let children = this.ui.myNode._children;
  5785. let temp;
  5786. let curData;
  5787. for (let index = 0; index < children.length; index++) {
  5788. temp = children[index];
  5789. curData = data[1];
  5790. temp.heightTxt.text = curData.height;
  5791. temp.foodTxt.text = curData.food;
  5792. temp.historyTxt.text = curData.history;
  5793. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5794. this.addSecretarySpine(temp.secretary, curData.spine);
  5795. let womanIndex = curData.id - 1;
  5796. let getWoman = DataMgr.getSecretary(womanIndex);
  5797. let curUse = DataMgr.getCurSecretary();
  5798. if (getWoman) {
  5799. if (curUse == womanIndex) {
  5800. temp.purchaseBtn.c1.selectedIndex = 1;
  5801. }
  5802. else {
  5803. temp.purchaseBtn.c1.selectedIndex = 2;
  5804. }
  5805. }
  5806. else {
  5807. temp.purchaseBtn.c1.selectedIndex = 0;
  5808. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5809. }
  5810. temp.purchaseBtn.visible = false;
  5811. }
  5812. }
  5813. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5814. console.log('zh: 点击了clickSecretary ');
  5815. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5816. if (getWoman) {
  5817. if (curUse != womanIndex) {
  5818. console.log();
  5819. DataMgr.setCurSecretary(womanIndex);
  5820. this.updateData();
  5821. }
  5822. }
  5823. else {
  5824. console.log('zh:点击购买了');
  5825. let need = needDiamond;
  5826. if (DataMgr.diamondEnough(need)) {
  5827. DataMgr.setDiamond(-need);
  5828. DataMgr.setSecretary(womanIndex, 1);
  5829. DataMgr.setCurSecretary(womanIndex);
  5830. this.updateData();
  5831. }
  5832. else {
  5833. xGame.uiMgr.Show(UIAddProp, 1);
  5834. }
  5835. }
  5836. }
  5837. closeSelf() {
  5838. this.hide();
  5839. }
  5840. }
  5841. UISecretary.uiName = "UISecretary";
  5842. class ui_UIShop extends fgui.GComponent {
  5843. static createInstance() {
  5844. return (fgui.UIPackage.createObject("game", "UIShop"));
  5845. }
  5846. onConstruct() {
  5847. this.n48 = (this.getChild("n48"));
  5848. this.n0 = (this.getChild("n0"));
  5849. this.secretary = (this.getChild("secretary"));
  5850. this.talkNode = (this.getChild("talkNode"));
  5851. this.closeNode = (this.getChild("closeNode"));
  5852. this.moneyNode = (this.getChild("moneyNode"));
  5853. this.myNode = (this.getChild("myNode"));
  5854. }
  5855. }
  5856. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5857. class ui_UIMsg extends fgui.GComponent {
  5858. static createInstance() {
  5859. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5860. }
  5861. onConstruct() {
  5862. this.tipsNode = (this.getChild("tipsNode"));
  5863. }
  5864. }
  5865. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5866. class UIMsg extends UIBase {
  5867. constructor() {
  5868. super();
  5869. }
  5870. onConstructor() {
  5871. this.ui = ui_UIMsg.createInstance();
  5872. this.contentPane = this.ui;
  5873. this.isEject = false;
  5874. this.isMuti = true;
  5875. }
  5876. show(msg, callback) {
  5877. super.show();
  5878. this.ui.tipsNode.msgTxt.text = msg;
  5879. this.ui.alpha = 1;
  5880. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5881. this.hide();
  5882. callback && callback();
  5883. }), 1000);
  5884. this.setGlobalFont(this.ui);
  5885. }
  5886. }
  5887. UIMsg.uiName = "UIMsg";
  5888. class BallRodDisplay {
  5889. constructor(ui, index) {
  5890. this.index = 0;
  5891. this.uiIndex = 0;
  5892. this.ui = ui;
  5893. this.index = index;
  5894. this.initData();
  5895. }
  5896. initData() {
  5897. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5898. let data = cfgTable.ballrodData[this.index + 1];
  5899. this.ui.nameTxt.text = data.name;
  5900. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5901. this.ui.levelNode.c1.selectedIndex = data.quality;
  5902. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5903. if (data.spine) {
  5904. this.mySpine = new SpineMgr(data.spine, () => {
  5905. let xx = 150;
  5906. let yy = 70;
  5907. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5908. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5909. });
  5910. }
  5911. }
  5912. updateSelf() {
  5913. let get = DataMgr.getBallRod(this.index);
  5914. if (get == null)
  5915. get = 1;
  5916. let curUse = DataMgr.getCurBallRod();
  5917. if (get) {
  5918. if (curUse == this.index) {
  5919. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5920. }
  5921. else {
  5922. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5923. }
  5924. }
  5925. else {
  5926. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5927. }
  5928. }
  5929. buyBallRod() {
  5930. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5931. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  5932. switch (selectedIndex) {
  5933. case 0:
  5934. break;
  5935. case 1:
  5936. console.log('zh:点击了 USE THIS');
  5937. DataMgr.setCurBallRod(this.index);
  5938. let curUse = DataMgr.getCurBallRod();
  5939. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  5940. let ui = xGame.uiMgr.getUI(UIShop);
  5941. ui.updateBallRod();
  5942. break;
  5943. case 2:
  5944. let data = cfgTable.ballrodData[this.index + 1];
  5945. let need = data.price;
  5946. if (DataMgr.diamondEnough(need)) {
  5947. this.buyQiuGan(data);
  5948. DataMgr.setDiamond(-need);
  5949. DataMgr.setBallRod(this.index, 1);
  5950. DataMgr.setCurBallRod(this.index);
  5951. let ui = xGame.uiMgr.getUI(UIShop);
  5952. ui.updateBallRod();
  5953. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  5954. }
  5955. else {
  5956. xGame.uiMgr.Show(UIAddProp, 1);
  5957. }
  5958. break;
  5959. default:
  5960. break;
  5961. }
  5962. }
  5963. buyQiuGan(qgItem) {
  5964. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  5965. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  5966. if (userInfo == null) {
  5967. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  5968. return;
  5969. }
  5970. let reqData = xGame.httpMgr.getReqData();
  5971. let pd = JSON.parse(reqData);
  5972. pd.qiuGanData = qgItem;
  5973. reqData = JSON.stringify(pd);
  5974. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  5975. try {
  5976. console.log('zh:buySp res = ' + JSON.stringify(res));
  5977. let code = res.code;
  5978. let msg = res.msg;
  5979. if (code == 401) {
  5980. Laya.LocalStorage.removeItem(keyForLoginInfo);
  5981. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  5982. return;
  5983. }
  5984. if (code == 200) {
  5985. xGame.uiMgr.Show(UIMsg, msg);
  5986. DataMgr.getUserZiChanInfo(false);
  5987. }
  5988. else {
  5989. xGame.uiMgr.Show(UIMsg, msg);
  5990. }
  5991. }
  5992. catch (error) {
  5993. console.log('error=' + error);
  5994. alert(error);
  5995. }
  5996. finally {
  5997. }
  5998. });
  5999. }
  6000. logEventForGouMaiGan(qiuGanName) {
  6001. const ev = {
  6002. value: qiuGanName
  6003. };
  6004. const jsonStr = JSON.stringify(ev);
  6005. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  6006. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  6007. }
  6008. }
  6009. class DaoJuDisplay {
  6010. constructor(ui, index) {
  6011. this.index = 0;
  6012. this.uiIndex = 0;
  6013. this.ggSpid = "";
  6014. this.spid = 0;
  6015. this.ui = ui;
  6016. this.index = index;
  6017. this.initData();
  6018. }
  6019. initData() {
  6020. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6021. let data = cfgTable.daoJuData[this.index + 1];
  6022. this.ui.nameTxt.text = data.spbt;
  6023. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6024. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6025. this.ggSpid = data.ggSpid;
  6026. this.spid = data.spid;
  6027. let baseUrl = "asset/sound/ogg/";
  6028. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6029. }
  6030. gotoBuy() {
  6031. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6032. if (userInfo != null) {
  6033. let token = userInfo.token;
  6034. let ggSpid = this.ggSpid;
  6035. let spid = this.spid;
  6036. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6037. console.log('zh:gotoBuy1 spid =' + spid);
  6038. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6039. return;
  6040. }
  6041. else {
  6042. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6043. }
  6044. }
  6045. gotoBuy1() {
  6046. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6047. let djItem = cfgTable.daoJuData[this.index + 1];
  6048. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6049. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6050. if (userInfo == null) {
  6051. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6052. return;
  6053. }
  6054. let reqData = xGame.httpMgr.getReqData();
  6055. let pd = JSON.parse(reqData);
  6056. pd.spItem = djItem;
  6057. reqData = JSON.stringify(pd);
  6058. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6059. try {
  6060. console.log('zh:buySp res = ' + JSON.stringify(res));
  6061. let code = res.code;
  6062. let msg = res.msg;
  6063. if (code == 401) {
  6064. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6065. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6066. return;
  6067. }
  6068. if (code == 200) {
  6069. xGame.uiMgr.Show(UIMsg, msg);
  6070. DataMgr.getUserZiChanInfo(false);
  6071. }
  6072. else {
  6073. xGame.uiMgr.Show(UIMsg, msg);
  6074. }
  6075. }
  6076. catch (error) {
  6077. console.log('error=' + error);
  6078. alert(error);
  6079. }
  6080. finally {
  6081. }
  6082. });
  6083. }
  6084. }
  6085. class UIShop extends UIBase {
  6086. constructor() {
  6087. super();
  6088. this.itemNums = 0;
  6089. this.itemNumsForDj = 0;
  6090. this.curType = "";
  6091. }
  6092. onConstructor() {
  6093. this.ui = ui_UIShop.createInstance();
  6094. this.contentPane = this.ui;
  6095. this.isEject = false;
  6096. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6097. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6098. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6099. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6100. this.addUIClick(this.ui, this.interuptSecretary);
  6101. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6102. this.ballRodArr = [];
  6103. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6104. this.ui.myNode.myList.numItems = this.itemNums;
  6105. this.loadDjdata_old();
  6106. }
  6107. loadDjdata_old() {
  6108. let fff = cfgTable.daoJuData;
  6109. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6110. this.daoJuArr = [];
  6111. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6112. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6113. }
  6114. getProductList() {
  6115. let reqData = xGame.httpMgr.getReqData();
  6116. let pd = JSON.parse(reqData);
  6117. pd.splx = "Consumable";
  6118. reqData = JSON.stringify(pd);
  6119. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6120. try {
  6121. let code = res.code;
  6122. let msg = res.msg;
  6123. if (code == 401) {
  6124. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6125. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6126. return;
  6127. }
  6128. if (code == 200) {
  6129. let data = res.data;
  6130. for (let index = 0; index < data.length; index++) {
  6131. let element = data[index];
  6132. cfgTable.daoJuData[element.spid] = element;
  6133. }
  6134. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6135. }
  6136. else {
  6137. xGame.uiMgr.Show(UIMsg, msg);
  6138. }
  6139. }
  6140. catch (error) {
  6141. console.log('error=' + error);
  6142. alert(error);
  6143. }
  6144. finally {
  6145. }
  6146. });
  6147. }
  6148. show(type) {
  6149. super.show();
  6150. this.curType = type == 0 ? "qiugan" : "daoju";
  6151. this.switchBtn("");
  6152. this.playSecretaryIdle();
  6153. this.updateBallRod();
  6154. this.setGlobalFont(this.ui);
  6155. }
  6156. test123() {
  6157. console.log('zh:test123 ');
  6158. }
  6159. switchBtn(type) {
  6160. console.log('zh:1111切換 sel type=' + type);
  6161. if (type == "") {
  6162. type = this.curType;
  6163. }
  6164. else {
  6165. if (this.curType == type) {
  6166. return;
  6167. }
  6168. else {
  6169. this.curType = type;
  6170. }
  6171. }
  6172. if (type == "qiugan") {
  6173. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6174. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6175. this.ui.myNode.c1.selectedIndex = 0;
  6176. this.ui.myNode.myList.visible = true;
  6177. this.ui.myNode.djList.visible = false;
  6178. }
  6179. else {
  6180. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6181. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6182. this.ui.myNode.c1.selectedIndex = 1;
  6183. this.ui.myNode.myList.visible = false;
  6184. this.ui.myNode.djList.visible = true;
  6185. }
  6186. }
  6187. updateBallRod() {
  6188. for (let index = 0; index < this.ballRodArr.length; index++) {
  6189. this.ballRodArr[index].updateSelf();
  6190. }
  6191. }
  6192. renderBallRod(sort, obj) {
  6193. let index = this.getIndexBySort(sort + 1) - 1;
  6194. let ballRod = new BallRodDisplay(obj, index);
  6195. this.ballRodArr.push(ballRod);
  6196. }
  6197. renderDaoJu(idx, obj) {
  6198. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6199. let b = new DaoJuDisplay(obj, index);
  6200. this.daoJuArr.push(b);
  6201. }
  6202. getIndexBySort(sort) {
  6203. let object = cfgTable.ballrodData;
  6204. for (const key in object) {
  6205. if (object[key].sort == sort) {
  6206. return parseInt(key);
  6207. }
  6208. }
  6209. }
  6210. getIndexBySortForDj(idx) {
  6211. let object = cfgTable.daoJuData;
  6212. for (const key in object) {
  6213. if (object[key].idx == idx) {
  6214. return parseInt(key);
  6215. }
  6216. }
  6217. }
  6218. playSecretaryIdle() {
  6219. let parent = this.ui.secretary.displayObject;
  6220. parent.destroyChildren();
  6221. let xx = this.ui.secretary.width / 2;
  6222. let yy = this.ui.secretary.height;
  6223. let scale = xGame.common.getSecretaryScale();
  6224. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6225. xGame.common.secretary.play(data, 0, true, parent);
  6226. }
  6227. interuptSecretary() {
  6228. Laya.timer.clearAll(this);
  6229. this.playSecretaryRandomSound();
  6230. }
  6231. playSecretaryRandomSound() {
  6232. if (this.isHide)
  6233. return;
  6234. let time = xGame.common.randomNum(45000, 60000);
  6235. Laya.timer.once(time, this, () => {
  6236. if (this.isHide)
  6237. return;
  6238. let index = xGame.common.randomNum(4, 7);
  6239. xGame.soundMgr.playSound("s_main0" + index);
  6240. let words = 1;
  6241. switch (index) {
  6242. case 4:
  6243. words = 5;
  6244. break;
  6245. case 5:
  6246. words = 3;
  6247. break;
  6248. case 6:
  6249. words = 6;
  6250. break;
  6251. case 7:
  6252. words = 7;
  6253. break;
  6254. default:
  6255. break;
  6256. }
  6257. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6258. this.playSecretaryRandomSound();
  6259. });
  6260. }
  6261. closeSelf() {
  6262. this.hide();
  6263. }
  6264. }
  6265. UIShop.uiName = "UIShop";
  6266. class ui_UISign extends fgui.GComponent {
  6267. static createInstance() {
  6268. return (fgui.UIPackage.createObject("game", "UISign"));
  6269. }
  6270. onConstruct() {
  6271. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6272. this.n6 = (this.getChild("n6"));
  6273. this.closeNode = (this.getChild("closeNode"));
  6274. this.myNode = (this.getChild("myNode"));
  6275. this.moneyNode = (this.getChild("moneyNode"));
  6276. this.secretary = (this.getChild("secretary"));
  6277. this.talkNode = (this.getChild("talkNode"));
  6278. this.tripleBtn = (this.getChild("tripleBtn"));
  6279. this.normalBtn = (this.getChild("normalBtn"));
  6280. this.tipsNode = (this.getChild("tipsNode"));
  6281. this.againBtn = (this.getChild("againBtn"));
  6282. this.t0 = this.getTransition("t0");
  6283. }
  6284. }
  6285. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6286. class SignMax {
  6287. constructor(ui) {
  6288. this.ui = ui;
  6289. }
  6290. updateSelf(index, sameDay, curDayIndex) {
  6291. let data = cfgTable.signData[index + 1];
  6292. this.ui.titleTxt.text = data.title;
  6293. let arr1 = data.award[0].split('-');
  6294. let arr2 = data.award[1].split('-');
  6295. let num1 = parseInt(arr1[1]);
  6296. let num2 = parseInt(arr2[1]);
  6297. this.ui.numTxt1.text = num1 + "";
  6298. this.ui.numTxt2.text = num2 + "";
  6299. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6300. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6301. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6302. this.ui.numTxt1.visible = false;
  6303. }
  6304. else {
  6305. this.ui.numTxt1.visible = true;
  6306. }
  6307. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6308. this.ui.numTxt2.visible = false;
  6309. }
  6310. else {
  6311. this.ui.numTxt2.visible = true;
  6312. }
  6313. if (index < curDayIndex) {
  6314. this.ui.c1.selectedIndex = 1;
  6315. }
  6316. else if (index == curDayIndex) {
  6317. if (sameDay) {
  6318. this.ui.c1.selectedIndex = 2;
  6319. }
  6320. else {
  6321. this.ui.c1.selectedIndex = 2;
  6322. }
  6323. }
  6324. else {
  6325. this.ui.c1.selectedIndex = 0;
  6326. }
  6327. }
  6328. }
  6329. class SignNormal {
  6330. constructor(ui) {
  6331. this.ui = ui;
  6332. }
  6333. updateSelf(index, sameDay, curDayIndex) {
  6334. let data = cfgTable.signData[index + 1];
  6335. this.ui.titleTxt.text = data.title;
  6336. let arr = data.award[0].split('-');
  6337. let type = parseInt(arr[0]);
  6338. let num = parseInt(arr[1]);
  6339. this.ui.numTxt.text = num + "";
  6340. if (type > 2) {
  6341. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6342. this.ui.myIcon.rotation = 0;
  6343. }
  6344. else {
  6345. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6346. this.ui.myIcon.rotation = 0;
  6347. }
  6348. if (xGame.common.signAwardContainsRod(data.award)) {
  6349. this.ui.numTxt.visible = false;
  6350. }
  6351. else {
  6352. this.ui.numTxt.visible = true;
  6353. }
  6354. if (index < curDayIndex) {
  6355. this.ui.c1.selectedIndex = 1;
  6356. }
  6357. else if (index == curDayIndex) {
  6358. if (sameDay) {
  6359. this.ui.c1.selectedIndex = 2;
  6360. }
  6361. else {
  6362. this.ui.c1.selectedIndex = 2;
  6363. }
  6364. }
  6365. else {
  6366. this.ui.c1.selectedIndex = 0;
  6367. }
  6368. }
  6369. }
  6370. class UISign extends UIBase {
  6371. constructor() {
  6372. super();
  6373. this.curDayIndex = 0;
  6374. this.starX = 0;
  6375. }
  6376. onConstructor() {
  6377. this.ui = ui_UISign.createInstance();
  6378. this.contentPane = this.ui;
  6379. this.isEject = false;
  6380. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6381. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6382. this.initSignItem();
  6383. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6384. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6385. }
  6386. show() {
  6387. super.show();
  6388. this.ui.t0.play();
  6389. this.playSecretaryIdle();
  6390. this.updateSign();
  6391. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6392. this.setGlobalFont(this.ui);
  6393. }
  6394. initSignItem() {
  6395. this.signArr = [];
  6396. for (let index = 0; index < 6; index++) {
  6397. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6398. this.signArr.push(temp);
  6399. }
  6400. this.signMax = new SignMax(this.ui.myNode.day7);
  6401. if (Moyu.isKs)
  6402. this.ui.closeNode.closeBtn.x += 100;
  6403. }
  6404. updateSign() {
  6405. let sameDay = xGame.common.judgeSameDay();
  6406. let max = 7;
  6407. this.curDayIndex = DataMgr.getSignData();
  6408. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6409. this.curDayIndex = 0;
  6410. if (!sameDay) {
  6411. this.ui.normalBtn.visible = true;
  6412. this.ui.tipsNode.visible = false;
  6413. this.ui.againBtn.visible = false;
  6414. }
  6415. else {
  6416. this.ui.normalBtn.visible = false;
  6417. let again = DataMgr.getExtraSign();
  6418. let isCurrency = false;
  6419. let index = this.curDayIndex;
  6420. if (index == 0)
  6421. index = 7;
  6422. let award = cfgTable.signData[index].award;
  6423. let num = award[0].split("-")[0];
  6424. if (num == "1" || num == "2")
  6425. isCurrency = true;
  6426. let showAgain = again == 0 && isCurrency;
  6427. this.ui.againBtn.visible = showAgain;
  6428. this.ui.tipsNode.visible = !showAgain;
  6429. }
  6430. for (let index = 0; index < this.signArr.length; index++) {
  6431. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6432. }
  6433. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6434. }
  6435. playSecretaryIdle() {
  6436. let parent = this.ui.secretary.displayObject;
  6437. parent.destroyChildren();
  6438. let xx = this.ui.secretary.width / 2;
  6439. let yy = this.ui.secretary.height;
  6440. let scale = xGame.common.getSecretaryScale();
  6441. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6442. xGame.common.secretary.play(data, 0, true, parent);
  6443. }
  6444. closeSelf() {
  6445. this.hide();
  6446. }
  6447. normalGetAward() {
  6448. let sameDay = xGame.common.judgeSameDay();
  6449. if (!sameDay) {
  6450. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6451. let temp;
  6452. let type;
  6453. let num;
  6454. let arr = [];
  6455. for (let index = 0; index < award.length; index++) {
  6456. temp = award[index].split("-");
  6457. type = parseInt(temp[0]);
  6458. num = parseInt(temp[1]);
  6459. let awardType = new AwardType();
  6460. awardType.num = num;
  6461. awardType.type = type;
  6462. arr.push(awardType);
  6463. }
  6464. xGame.common.getAward(arr, (watchVideo) => {
  6465. this.curDayIndex++;
  6466. if (this.curDayIndex > 7)
  6467. this.curDayIndex = 0;
  6468. DataMgr.setSignData(this.curDayIndex);
  6469. this.updateSignData2Server(this.curDayIndex);
  6470. DataMgr.setSignTime(new Date().getTime());
  6471. if (watchVideo) {
  6472. DataMgr.setExtraSign(1);
  6473. Moyu.sendDataEvent("signIn1");
  6474. }
  6475. this.updateSign();
  6476. });
  6477. }
  6478. }
  6479. againGetAward() {
  6480. Moyu.sendDataEvent("signIn2");
  6481. console.log('zh:qjff_AD_for_uisign');
  6482. if (Laya.Browser.onAndroid) {
  6483. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6484. if (!boo) {
  6485. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6486. return;
  6487. }
  6488. }
  6489. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6490. }
  6491. else {
  6492. console.log('zh:AD 失败,直接发放奖励');
  6493. this.qjff_AD_for_uisign();
  6494. }
  6495. }
  6496. qjff_AD_for_uisign() {
  6497. let index = this.curDayIndex;
  6498. if (index == 0)
  6499. index = 7;
  6500. let award = cfgTable.signData[index].award;
  6501. let temp;
  6502. let type;
  6503. let num;
  6504. for (let index = 0; index < award.length; index++) {
  6505. temp = award[index].split("-");
  6506. type = parseInt(temp[0]);
  6507. num = parseInt(temp[1]) * 3;
  6508. xGame.common.playObjFlyAnim(num, type);
  6509. }
  6510. DataMgr.setExtraSign(1);
  6511. this.updateSign();
  6512. }
  6513. updateSignData2Server(day) {
  6514. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6515. if (userInfo == null) {
  6516. return;
  6517. }
  6518. let reqData = xGame.httpMgr.getReqData();
  6519. let pd = JSON.parse(reqData);
  6520. pd.signData = day;
  6521. reqData = JSON.stringify(pd);
  6522. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6523. try {
  6524. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6525. let code = res.code;
  6526. let msg = res.msg;
  6527. if (code == 401) {
  6528. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6529. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6530. return;
  6531. }
  6532. if (code == 200) {
  6533. let data = res.data;
  6534. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6535. }
  6536. else {
  6537. xGame.uiMgr.Show(UIMsg, msg);
  6538. }
  6539. }
  6540. catch (error) {
  6541. console.log('error=' + error);
  6542. alert(error);
  6543. }
  6544. finally {
  6545. }
  6546. });
  6547. }
  6548. }
  6549. UISign.uiName = "UISign";
  6550. class ui_UISkill extends fgui.GComponent {
  6551. static createInstance() {
  6552. return (fgui.UIPackage.createObject("game", "UISkill"));
  6553. }
  6554. onConstruct() {
  6555. this.n48 = (this.getChild("n48"));
  6556. this.n0 = (this.getChild("n0"));
  6557. this.secretary = (this.getChild("secretary"));
  6558. this.talkNode = (this.getChild("talkNode"));
  6559. this.closeNode = (this.getChild("closeNode"));
  6560. this.moneyNode = (this.getChild("moneyNode"));
  6561. this.skillNode = (this.getChild("skillNode"));
  6562. this.guideNode = (this.getChild("guideNode"));
  6563. }
  6564. }
  6565. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6566. class SkillDisplay {
  6567. constructor(ui, data, uiIndex) {
  6568. this.starX = 0;
  6569. this.starY = 0;
  6570. this.index = 0;
  6571. this.ui = ui;
  6572. this.data = data;
  6573. this.index = uiIndex;
  6574. this.initSelf();
  6575. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6576. }
  6577. initSelf() {
  6578. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6579. this.ui.nameTxt.text = this.data.name;
  6580. this.ui.describeTxt.text = this.data.describe;
  6581. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6582. this.ui.startBtn.onClick(this, this.startGame);
  6583. this.updateSelf();
  6584. }
  6585. updateSelf() {
  6586. this.checkTry();
  6587. let level = DataMgr.getBigSkillByIndex(this.index);
  6588. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6589. }
  6590. checkTry() {
  6591. let index = this.index;
  6592. let level = DataMgr.getBigSkillByIndex(index);
  6593. if (level == null) {
  6594. DataMgr.setBigSkill(index, 1, false);
  6595. level = 1;
  6596. }
  6597. this.ui.levelTxt.text = "LV." + level;
  6598. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6599. this.ui.tryNode.visible = true;
  6600. else
  6601. this.ui.tryNode.visible = false;
  6602. }
  6603. clickAddLevel() {
  6604. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6605. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6606. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6607. if (Laya.Browser.onAndroid) {
  6608. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6609. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6610. }
  6611. else {
  6612. console.log('zh:AD 失败,直接发放奖励');
  6613. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6614. }
  6615. }
  6616. else {
  6617. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6618. }
  6619. }
  6620. qjff_AD_for_skilldisplay_clickAddLevel() {
  6621. DataMgr.setBigSkill(this.data.index, 1);
  6622. this.updateSelf();
  6623. xGame.common.upSkillLevel = true;
  6624. }
  6625. startGame() {
  6626. console.log('zh:rod skill startgame');
  6627. if (this.data.index == 3) {
  6628. alert('Coming soon!');
  6629. return;
  6630. }
  6631. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6632. let needCoin = xGame.common.bigMoveNeedCoin;
  6633. xGame.common.passAwardCoin = 2000;
  6634. let guide = DataMgr.getSkillGuide();
  6635. console.log('zh:startGame guide=' + guide);
  6636. xGame.common.temSelfLevel = 0;
  6637. if (guide == 0) {
  6638. needCoin = 0;
  6639. xGame.common.temSelfLevel = 100;
  6640. }
  6641. if (DataMgr.coinEnough(needCoin)) {
  6642. DataMgr.setCoin(-needCoin);
  6643. xGame.common.curPlayerSkillType = this.index;
  6644. if (guide == 0)
  6645. xGame.common.curPlayerSkillType = 0;
  6646. console.log('zh: skilldisplay 1');
  6647. xGame.uiMgr.Show(UIGame);
  6648. xGame.uiMgr.Hide(UIMain);
  6649. xGame.uiMgr.Show(UIMatching, () => {
  6650. xGame.common.gameUI.ui.alpha = 1;
  6651. xGame.common.gameUI.startGame();
  6652. xGame.uiMgr.Hide(UISkill);
  6653. });
  6654. this.logEventForRod_start();
  6655. }
  6656. else {
  6657. console.log('zh: skilldisplay 2');
  6658. xGame.uiMgr.Show(UIAddProp, 0);
  6659. Moyu.sendDataEvent("AddCoinVideo");
  6660. }
  6661. }
  6662. logEventForRod_start() {
  6663. let gfmsIdx = xGame.common.curPlayerSkillType;
  6664. console.log('zh:选择的技能=' + gfmsIdx);
  6665. let gfmc = 'Skyfall Shot';
  6666. if (gfmsIdx == 0) {
  6667. gfmc = 'Skyfall Shot';
  6668. }
  6669. if (gfmsIdx == 1) {
  6670. gfmc = 'Surging break';
  6671. }
  6672. if (gfmsIdx == 2) {
  6673. gfmc = 'Frost Lock';
  6674. }
  6675. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6676. let jsonStr = {
  6677. "count": 0,
  6678. "name": gfmc
  6679. };
  6680. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6681. const d = LocalStorageManager.getItem(keyStr);
  6682. jsonStr.count = d.count + 1;
  6683. LocalStorageManager.setItem(keyStr, jsonStr);
  6684. }
  6685. else {
  6686. LocalStorageManager.setItem(keyStr, jsonStr);
  6687. }
  6688. const reqStr = JSON.stringify(jsonStr);
  6689. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6690. }
  6691. }
  6692. class UISkill extends UIBase {
  6693. constructor() {
  6694. super();
  6695. this.skillData = [];
  6696. }
  6697. onConstructor() {
  6698. this.ui = ui_UISkill.createInstance();
  6699. this.contentPane = this.ui;
  6700. this.isEject = false;
  6701. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6702. this.initSkillData();
  6703. console.log('zh:aaaaaa1111111111');
  6704. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6705. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6706. console.log('zh:aaaaaa22222222');
  6707. this.displayList = [];
  6708. this.ui.skillNode.skillList.numItems = 3;
  6709. this.addUIClick(this.ui, this.interuptSecretary);
  6710. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6711. this.ui.talkNode.visible = false;
  6712. if (Moyu.isKs)
  6713. this.ui.closeNode.closeBtn.x += 100;
  6714. }
  6715. show() {
  6716. super.show();
  6717. this.playSecretaryIdle();
  6718. this.moneyNode.ui.c1.selectedIndex = 1;
  6719. Laya.timer.clearAll(this);
  6720. xGame.soundMgr.playSound("s_start");
  6721. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6722. let guide = DataMgr.getSkillGuide();
  6723. this.ui.guideNode.visible = guide == 0;
  6724. let item = this.getSkillItemByUIIndex(0);
  6725. if (guide == 0) {
  6726. item.ui.c1.selectedIndex = 1;
  6727. }
  6728. else {
  6729. item.ui.c1.selectedIndex = 0;
  6730. }
  6731. this.ui.guideNode.guideBtn.visible = guide == 0;
  6732. for (let index = 0; index < this.displayList.length; index++) {
  6733. this.displayList[index].checkTry();
  6734. }
  6735. this.setGlobalFont(this.ui);
  6736. }
  6737. getSkillItemByUIIndex(cur) {
  6738. for (let index = 0; index < this.displayList.length; index++) {
  6739. if (this.displayList[index].index == cur) {
  6740. return this.displayList[index];
  6741. }
  6742. }
  6743. }
  6744. enterGuideLevel() {
  6745. let item = this.getSkillItemByUIIndex(0);
  6746. item.startGame();
  6747. if (DataMgr.getNewUser())
  6748. Moyu.sendDataEvent("gameStart1");
  6749. }
  6750. initSkillData() {
  6751. this.skillData = [];
  6752. let nameList = xGame.common.skillNameList;
  6753. let iconList = xGame.common.skillIconList;
  6754. let describeList = [
  6755. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6756. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6757. "The power of frost descends—freezing the flow and taking full control of the game!"
  6758. ];
  6759. console.log('zh:initSkillData 111111111');
  6760. let data;
  6761. for (let index = 0; index < nameList.length; index++) {
  6762. data = {};
  6763. data.name = nameList[index];
  6764. data.icon = iconList[index];
  6765. data.describe = describeList[index];
  6766. data.index = index;
  6767. this.skillData.push(data);
  6768. }
  6769. }
  6770. updateSkillItem(index, target) {
  6771. if (this.displayList[index] == null) {
  6772. let uiIndex;
  6773. switch (index) {
  6774. case 0:
  6775. uiIndex = 1;
  6776. break;
  6777. case 1:
  6778. uiIndex = 0;
  6779. break;
  6780. case 2:
  6781. uiIndex = 2;
  6782. break;
  6783. case 3:
  6784. uiIndex = 3;
  6785. break;
  6786. default:
  6787. break;
  6788. }
  6789. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6790. this.displayList.push(temp);
  6791. }
  6792. }
  6793. playSecretaryIdle() {
  6794. let parent = this.ui.secretary.displayObject;
  6795. parent.destroyChildren();
  6796. let xx = this.ui.secretary.width / 2;
  6797. let yy = this.ui.secretary.height;
  6798. let scale = xGame.common.getSecretaryScale();
  6799. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6800. xGame.common.secretary.play(data, 0, true, parent);
  6801. }
  6802. returnUIMain() {
  6803. this.hide();
  6804. xGame.common.stopGirlPop(this.ui.talkNode);
  6805. xGame.uiMgr.Show(UIMain);
  6806. }
  6807. interuptSecretary() {
  6808. Laya.timer.clearAll(this);
  6809. this.playSecretaryRandomSound();
  6810. }
  6811. playSecretaryRandomSound() {
  6812. if (this.isHide)
  6813. return;
  6814. let time = xGame.common.randomNum(45000, 60000);
  6815. Laya.timer.once(time, this, () => {
  6816. if (this.isHide)
  6817. return;
  6818. let index = xGame.common.randomNum(4, 7);
  6819. xGame.soundMgr.playSound("s_main0" + index);
  6820. let words = 1;
  6821. switch (index) {
  6822. case 4:
  6823. words = 5;
  6824. break;
  6825. case 5:
  6826. words = 3;
  6827. break;
  6828. case 6:
  6829. words = 6;
  6830. break;
  6831. case 7:
  6832. words = 7;
  6833. break;
  6834. default:
  6835. break;
  6836. }
  6837. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6838. this.playSecretaryRandomSound();
  6839. });
  6840. }
  6841. }
  6842. UISkill.uiName = "UISkill";
  6843. class ui_UIModeSelection extends fgui.GComponent {
  6844. static createInstance() {
  6845. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6846. }
  6847. onConstruct() {
  6848. this.n19 = (this.getChild("n19"));
  6849. this.closeBtn = (this.getChild("closeBtn"));
  6850. this.myNode = (this.getChild("myNode"));
  6851. this.t0 = this.getTransition("t0");
  6852. }
  6853. }
  6854. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6855. class UIModeSelection extends UIBase {
  6856. constructor() {
  6857. super();
  6858. }
  6859. onConstructor() {
  6860. this.ui = ui_UIModeSelection.createInstance();
  6861. this.contentPane = this.ui;
  6862. this.isEject = false;
  6863. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6864. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6865. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6866. this.addUIClick(this.ui.closeBtn, this.hide);
  6867. this.peopleArr = [65, 990, 580];
  6868. this.peopleOffest = [5, 10, 10];
  6869. }
  6870. show(callback) {
  6871. this.updateSelf();
  6872. super.show();
  6873. this.ui.t0.play();
  6874. this.callback = callback;
  6875. this.setGlobalFont(this.ui);
  6876. }
  6877. updateSelf() {
  6878. let cfg = cfgTable.modeselectData;
  6879. for (let index = 1; index <= 3; index++) {
  6880. let node = this.ui.myNode["type" + index];
  6881. node.need.text = cfg[index].need;
  6882. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6883. node.peopleTxt.text = this.getRandPeople(index - 1);
  6884. }
  6885. }
  6886. enterGame(type) {
  6887. console.log('zh: 进入经典模式 type: ' + type);
  6888. xGame.common.classicRoomType = type;
  6889. let cfg = cfgTable.modeselectData[type];
  6890. let need = cfg.need;
  6891. xGame.common.passAwardCoin = cfg.award;
  6892. if (DataMgr.coinEnough(need)) {
  6893. DataMgr.setCoin(-need);
  6894. this.ui.myNode["type" + type].t0.play();
  6895. Laya.timer.once(200, this, () => {
  6896. this.callback && this.callback();
  6897. });
  6898. this.logEventForClassic_start();
  6899. }
  6900. else {
  6901. Moyu.sendDataEvent("AddCoinVideo");
  6902. xGame.uiMgr.Show(UIAddProp, 0);
  6903. }
  6904. }
  6905. getRandPeople(index) {
  6906. let rand = this.peopleOffest[index];
  6907. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6908. }
  6909. logEventForClassic_start() {
  6910. let rtype = xGame.common.classicRoomType;
  6911. let msmc = '';
  6912. if (rtype == 1) {
  6913. msmc = 'beginner';
  6914. }
  6915. if (rtype == 2) {
  6916. msmc = 'expert';
  6917. }
  6918. if (rtype == 3) {
  6919. msmc = 'master';
  6920. }
  6921. let keyStr = 'sjmd_classic_start_' + rtype;
  6922. let jsonStr = {
  6923. "difficulty": msmc,
  6924. "classic_count": 1,
  6925. "difficulty_count": 1
  6926. };
  6927. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6928. const d = LocalStorageManager.getItem(keyStr);
  6929. jsonStr.classic_count = d.classic_count + 1;
  6930. jsonStr.difficulty_count = d.difficulty_count + 1;
  6931. LocalStorageManager.setItem(keyStr, jsonStr);
  6932. }
  6933. else {
  6934. LocalStorageManager.setItem(keyStr, jsonStr);
  6935. }
  6936. const reqStr = JSON.stringify(jsonStr);
  6937. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  6938. }
  6939. }
  6940. UIModeSelection.uiName = "UIModeSelection";
  6941. class ui_UIReg extends fgui.GComponent {
  6942. static createInstance() {
  6943. return (fgui.UIPackage.createObject("game", "UIReg"));
  6944. }
  6945. onConstruct() {
  6946. this.n38 = (this.getChild("n38"));
  6947. this.n51 = (this.getChild("n51"));
  6948. this.closeBtn = (this.getChild("closeBtn"));
  6949. this.lab_tip = (this.getChild("lab_tip"));
  6950. this.txt_ua = (this.getChild("txt_ua"));
  6951. this.txt_up1 = (this.getChild("txt_up1"));
  6952. this.txt_up2 = (this.getChild("txt_up2"));
  6953. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  6954. this.btn_reg = (this.getChild("btn_reg"));
  6955. }
  6956. }
  6957. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  6958. class ui_UILogin extends fgui.GComponent {
  6959. static createInstance() {
  6960. return (fgui.UIPackage.createObject("game", "UILogin"));
  6961. }
  6962. onConstruct() {
  6963. this.c1 = this.getController("c1");
  6964. this.n18 = (this.getChild("n18"));
  6965. this.n21 = (this.getChild("n21"));
  6966. this.closeBtn = (this.getChild("closeBtn"));
  6967. this.txt_ua = (this.getChild("txt_ua"));
  6968. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  6969. this.btn_login = (this.getChild("btn_login"));
  6970. this.txt_up = (this.getChild("txt_up"));
  6971. }
  6972. }
  6973. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  6974. class UILogin extends UIBase {
  6975. constructor() {
  6976. super();
  6977. this.fontStr = 'big-john-woff2-2';
  6978. try {
  6979. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  6980. console.log("zh: constructor加载arial字体成功");
  6981. }
  6982. catch (error) {
  6983. console.log("zh: constructor加载arial字体失败");
  6984. }
  6985. }
  6986. onFontLoaded() {
  6987. try {
  6988. Laya.Text.defaultFont = this.fontStr;
  6989. this.ui.txt_ua.font = this.fontStr;
  6990. this.ui.txt_up.font = this.fontStr;
  6991. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  6992. }
  6993. catch (error) {
  6994. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  6995. }
  6996. }
  6997. onConstructor() {
  6998. this.ui = ui_UILogin.createInstance();
  6999. this.contentPane = this.ui;
  7000. this.isEject = false;
  7001. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7002. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  7003. this.addUIClick(this.ui.btn_login, this.userLogin);
  7004. }
  7005. show() {
  7006. super.show();
  7007. this.x = (Laya.stage.width - this.width) / 2;
  7008. this.y = (Laya.stage.height - this.height) / 2;
  7009. this.onFontLoaded();
  7010. }
  7011. closeSelf() {
  7012. this.hide();
  7013. }
  7014. userLogin() {
  7015. let ua = this.ui.txt_ua.text;
  7016. let up = this.ui.txt_up.text;
  7017. console.log('zh:ua font' + this.ui.txt_ua.font);
  7018. if (ua && up) {
  7019. let reqData = JSON.stringify({
  7020. username: ua.trim(),
  7021. password: up.trim(),
  7022. fromMark: 'app_game'
  7023. });
  7024. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  7025. try {
  7026. console.log('zh:res = ' + JSON.stringify(res));
  7027. let code = res.code;
  7028. let msg = res.msg;
  7029. if (code == 200) {
  7030. let keyStr = keyForLoginInfo;
  7031. let jsonStr = {
  7032. "username": res.username,
  7033. "token": res.token,
  7034. "buySpids": { 1: false, 7: false }
  7035. };
  7036. LocalStorageManager.setItem(keyStr, jsonStr);
  7037. let myu = Moyu.getUserInfo();
  7038. console.log('zh:myu = ' + JSON.stringify(myu));
  7039. DataMgr.updateUserNickName(res.username);
  7040. Moyu.updateUserInfo(res.username);
  7041. xGame.uiMgr.Show(UIMsg, msg);
  7042. DataMgr.loadUserSpOrderForAd();
  7043. DataMgr.getUserZiChanInfo(false);
  7044. xGame.eventMgr.event(LOGIN_IN);
  7045. this.closeSelf();
  7046. }
  7047. else {
  7048. xGame.uiMgr.Show(UIMsg, msg);
  7049. }
  7050. }
  7051. catch (error) {
  7052. console.log('error=' + error);
  7053. alert(error);
  7054. }
  7055. finally {
  7056. }
  7057. });
  7058. }
  7059. else {
  7060. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7061. }
  7062. }
  7063. gotoRegPage() {
  7064. this.closeSelf();
  7065. xGame.uiMgr.Show(UIReg);
  7066. }
  7067. }
  7068. UILogin.uiName = "UILogin";
  7069. class UIReg extends UIBase {
  7070. constructor() {
  7071. super();
  7072. this.fontStr = 'big-john-woff2-2';
  7073. try {
  7074. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7075. console.log("zh: constructor加载arial字体成功");
  7076. }
  7077. catch (error) {
  7078. console.log("zh: constructor加载arial字体失败");
  7079. }
  7080. }
  7081. onFontLoaded() {
  7082. try {
  7083. Laya.Text.defaultFont = this.fontStr;
  7084. this.ui.txt_ua.font = this.fontStr;
  7085. this.ui.txt_up1.font = this.fontStr;
  7086. this.ui.txt_up2.font = this.fontStr;
  7087. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7088. }
  7089. catch (error) {
  7090. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7091. }
  7092. }
  7093. onConstructor() {
  7094. this.ui = ui_UIReg.createInstance();
  7095. this.contentPane = this.ui;
  7096. this.isEject = false;
  7097. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7098. this.addUIClick(this.ui.btn_reg, this.regUser);
  7099. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7100. }
  7101. show() {
  7102. super.show();
  7103. this.x = (Laya.stage.width - this.width) / 2;
  7104. this.y = (Laya.stage.height - this.height) / 2;
  7105. this.onFontLoaded();
  7106. }
  7107. closeSelf() {
  7108. this.hide();
  7109. }
  7110. regUser() {
  7111. this.ui.lab_tip.visible = false;
  7112. let ua = this.ui.txt_ua.text;
  7113. let up1 = this.ui.txt_up1.text;
  7114. let up2 = this.ui.txt_up2.text;
  7115. if (ua && up1 && up2 && up1 == up2) {
  7116. let reqData = JSON.stringify({
  7117. username: ua.trim(),
  7118. password: up1.trim(),
  7119. fromMark: 'app_game'
  7120. });
  7121. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7122. try {
  7123. console.log('zh:res = ' + JSON.stringify(res));
  7124. let code = res.code;
  7125. let msg = res.msg;
  7126. xGame.uiMgr.Show(UIMsg, msg);
  7127. if (code == 200) {
  7128. this.ui.lab_tip.color = "#FFFFFF";
  7129. xGame.uiMgr.Show(UIMsg, msg);
  7130. this.closeSelf();
  7131. }
  7132. else {
  7133. this.ui.lab_tip.color = "#FF0000";
  7134. xGame.uiMgr.Show(UIMsg, msg);
  7135. }
  7136. }
  7137. catch (error) {
  7138. console.log('error=' + error);
  7139. alert(error);
  7140. }
  7141. finally {
  7142. }
  7143. });
  7144. }
  7145. else {
  7146. if (up1 != up2) {
  7147. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7148. }
  7149. else {
  7150. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7151. }
  7152. }
  7153. }
  7154. gotoLogin() {
  7155. this.closeSelf();
  7156. xGame.uiMgr.Show(UILogin);
  7157. }
  7158. }
  7159. UIReg.uiName = "UIReg";
  7160. class ui_UIGetAward extends fgui.GComponent {
  7161. static createInstance() {
  7162. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7163. }
  7164. onConstruct() {
  7165. this.n4 = (this.getChild("n4"));
  7166. this.n0 = (this.getChild("n0"));
  7167. this.myList = (this.getChild("myList"));
  7168. this.n1 = (this.getChild("n1"));
  7169. this.eftNode = (this.getChild("eftNode"));
  7170. this.btnNode = (this.getChild("btnNode"));
  7171. this.t0 = this.getTransition("t0");
  7172. }
  7173. }
  7174. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7175. class UIGetAward extends UIBase {
  7176. constructor() {
  7177. super();
  7178. this.showTriple = true;
  7179. }
  7180. onConstructor() {
  7181. this.ui = ui_UIGetAward.createInstance();
  7182. this.contentPane = this.ui;
  7183. this.isEject = false;
  7184. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7185. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7186. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7187. }
  7188. show(arr, showTriple, callback) {
  7189. super.show();
  7190. this.ui.t0.play();
  7191. this.ui.eftNode.visible = true;
  7192. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7193. this.ui.eftNode.visible = false;
  7194. }), 1, 0, 0, 0.9);
  7195. this.awardArr = arr;
  7196. this.showTriple = showTriple;
  7197. this.callback = callback;
  7198. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7199. this.ui.myList.numItems = arr.length;
  7200. xGame.soundMgr.playSound("getaward");
  7201. this.setGlobalFont(this.ui);
  7202. }
  7203. updateSelf(index, obj) {
  7204. let temp = this.awardArr[index];
  7205. let icon = this.getIcon(temp.type);
  7206. let str = icon;
  7207. if (temp.type > 2) {
  7208. str = "s" + icon;
  7209. }
  7210. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7211. obj.myIcon.rotation = 0;
  7212. obj.numTxt.text = temp.num + "";
  7213. obj.numTxt.visible = temp.type > 2 ? false : true;
  7214. obj.nameTxt.text = this.getNameStr(temp.type);
  7215. }
  7216. renderItem(index, obj) {
  7217. this.updateSelf(index, obj);
  7218. }
  7219. tripleGetAward() {
  7220. console.log('zh:qjff_AD_for_uigetAward');
  7221. if (Laya.Browser.onAndroid) {
  7222. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7223. if (!boo) {
  7224. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7225. return;
  7226. }
  7227. }
  7228. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7229. }
  7230. else {
  7231. console.log('zh:AD 失败,直接发放奖励');
  7232. this.qjff_AD_for_uigetAward();
  7233. }
  7234. }
  7235. qjff_AD_for_uigetAward() {
  7236. this.getAward(3);
  7237. }
  7238. normalGetAward() {
  7239. if (PlatMgr.isMisVideo())
  7240. this.tripleGetAward();
  7241. else
  7242. this.getAward();
  7243. }
  7244. getAward(times = 1) {
  7245. this.hide();
  7246. for (let index = 0; index < this.awardArr.length; index++) {
  7247. this.awardArr[index].num *= times;
  7248. }
  7249. this.callback && this.callback(times != 1);
  7250. }
  7251. getIcon(type) {
  7252. switch (type) {
  7253. case Prop.diamond:
  7254. return "ty_zs";
  7255. case Prop.coin:
  7256. return "ty_jb";
  7257. case Prop.gan1:
  7258. return "qg1";
  7259. case Prop.gan2:
  7260. return "qg2";
  7261. case Prop.gan3:
  7262. return "qg3";
  7263. case Prop.gan4:
  7264. return "qg4";
  7265. default:
  7266. break;
  7267. }
  7268. }
  7269. getNameStr(type) {
  7270. switch (type) {
  7271. case Prop.diamond:
  7272. return "Diamond";
  7273. case Prop.coin:
  7274. return "Coins";
  7275. case Prop.gan1:
  7276. case Prop.gan2:
  7277. case Prop.gan3:
  7278. case Prop.gan4:
  7279. return cfgTable.ballrodData[type - 1].name;
  7280. default:
  7281. break;
  7282. }
  7283. }
  7284. }
  7285. UIGetAward.uiName = "UIGetAward";
  7286. class ui_UIRepentProp extends fgui.GComponent {
  7287. static createInstance() {
  7288. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7289. }
  7290. onConstruct() {
  7291. this.c1 = this.getController("c1");
  7292. this.n11 = (this.getChild("n11"));
  7293. this.regretNode = (this.getChild("regretNode"));
  7294. this.helpLineNode = (this.getChild("helpLineNode"));
  7295. this.t0 = this.getTransition("t0");
  7296. }
  7297. }
  7298. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7299. class UIRepentProp extends UIBase {
  7300. constructor() {
  7301. super();
  7302. this.viewType = 0;
  7303. this.regretType = 0;
  7304. }
  7305. onConstructor() {
  7306. this.ui = ui_UIRepentProp.createInstance();
  7307. this.contentPane = this.ui;
  7308. this.isEject = false;
  7309. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7310. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7311. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7312. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7313. }
  7314. show(viewType, regretType, callback) {
  7315. PlatMgr.showInsert(true);
  7316. this.viewType = viewType;
  7317. this.regretType = regretType;
  7318. this.callback = callback;
  7319. super.show();
  7320. this.ui.t0.play();
  7321. this.ui.c1.selectedIndex = this.viewType;
  7322. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7323. if (this.viewType == 0) {
  7324. let guide = DataMgr.getGuideHelpLine();
  7325. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7326. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7327. }
  7328. xGame.common.gameMgr.gamePause = true;
  7329. this.setGlobalFont(this.ui);
  7330. }
  7331. hideSelf() {
  7332. xGame.common.gameMgr.gamePause = false;
  7333. this.callback && this.callback(false);
  7334. this.hide();
  7335. }
  7336. videoRegret() {
  7337. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7338. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7339. }
  7340. else {
  7341. console.log('zh:AD 失败,直接发放奖励');
  7342. this.qjff_AD_for_UIrepentProp_videoRegret();
  7343. }
  7344. }
  7345. qjff_AD_for_UIrepentProp_videoRegret() {
  7346. this.callback && this.callback(true);
  7347. this.hideSelf();
  7348. }
  7349. videoAddHelpLine() {
  7350. let guide = DataMgr.getGuideHelpLine();
  7351. if (guide == 0) {
  7352. this.callback && this.callback(true);
  7353. this.hideSelf();
  7354. DataMgr.setGuideHelpLine();
  7355. xGame.common.gameUI.ui.guideNode.visible = false;
  7356. }
  7357. else {
  7358. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7359. if (Laya.Browser.onAndroid) {
  7360. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7361. if (!boo) {
  7362. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7363. return;
  7364. }
  7365. }
  7366. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7367. }
  7368. else {
  7369. console.log('zh:AD 失败,直接发放奖励');
  7370. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7371. }
  7372. }
  7373. }
  7374. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7375. this.callback && this.callback(true);
  7376. this.hideSelf();
  7377. }
  7378. }
  7379. UIRepentProp.uiName = "UIRepentProp";
  7380. class ui_UITips extends fgui.GComponent {
  7381. static createInstance() {
  7382. return (fgui.UIPackage.createObject("game", "UITips"));
  7383. }
  7384. onConstruct() {
  7385. this.n0 = (this.getChild("n0"));
  7386. this.myNode = (this.getChild("myNode"));
  7387. this.t0 = this.getTransition("t0");
  7388. }
  7389. }
  7390. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7391. class UITips extends UIBase {
  7392. constructor() {
  7393. super();
  7394. this.type = 0;
  7395. }
  7396. onConstructor() {
  7397. this.ui = ui_UITips.createInstance();
  7398. this.contentPane = this.ui;
  7399. this.isEject = false;
  7400. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7401. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7402. }
  7403. show(tipsTxt, womanTxt, type) {
  7404. super.show();
  7405. this.ui.t0.play();
  7406. this.ui.myNode.tipsTxt.text = tipsTxt;
  7407. this.ui.myNode.womanTxt.text = womanTxt;
  7408. PlatMgr.showInsert(true);
  7409. this.ui.myNode.c1.selectedIndex = type;
  7410. this.type = type;
  7411. switch (this.type) {
  7412. case TipsType.exitGame:
  7413. xGame.common.gameMgr.gamePause = true;
  7414. break;
  7415. case TipsType.foul:
  7416. Laya.timer.once(200, this, () => {
  7417. if (xGame.common.gameMgr) {
  7418. xGame.common.gameMgr.gamePause = true;
  7419. }
  7420. else {
  7421. console.log("zh:gameMgr is null");
  7422. }
  7423. });
  7424. break;
  7425. default:
  7426. break;
  7427. }
  7428. this.setGlobalFont(this.ui);
  7429. }
  7430. clickLeftBtn() {
  7431. this.hide();
  7432. xGame.common.gameMgr.gamePause = false;
  7433. switch (this.type) {
  7434. case TipsType.exitGame:
  7435. break;
  7436. case TipsType.foul:
  7437. break;
  7438. default:
  7439. break;
  7440. }
  7441. }
  7442. clickRightBtn() {
  7443. this.hide();
  7444. switch (this.type) {
  7445. case TipsType.exitGame:
  7446. xGame.eventMgr.event(RESET_GAME);
  7447. xGame.uiMgr.Show(UIMain);
  7448. Moyu.recordEnd(this, null);
  7449. xGame.common.longHelpLine = false;
  7450. break;
  7451. case TipsType.foul:
  7452. if (xGame.common.gameMgr) {
  7453. xGame.common.gameMgr.gamePause = false;
  7454. }
  7455. Laya.timer.clearAll(this);
  7456. break;
  7457. default:
  7458. break;
  7459. }
  7460. }
  7461. }
  7462. UITips.uiName = "UITips";
  7463. class UIMain extends UIBase {
  7464. constructor() {
  7465. super();
  7466. this.firstEnter = true;
  7467. this.moni_click_count = 0;
  7468. }
  7469. nativeCallJs(msg) {
  7470. let t = msg;
  7471. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7472. switch (t) {
  7473. case 'qjff_chouJiang':
  7474. let dui = xGame.uiMgr.getUI(UIDraw);
  7475. dui.qjff_chouJiang();
  7476. break;
  7477. case 'qjff_AD_for_uisign':
  7478. let dui2 = xGame.uiMgr.getUI(UISign);
  7479. dui2.qjff_AD_for_uisign();
  7480. break;
  7481. case 'qjff_AD_for_uitry':
  7482. let dui3 = xGame.uiMgr.getUI(UITry);
  7483. dui3.qjff_AD_for_uitry();
  7484. break;
  7485. case 'qjff_AD_for_uipower':
  7486. let dui4 = xGame.uiMgr.getUI(UIPower);
  7487. dui4.qjff_AD_for_uipower();
  7488. break;
  7489. case 'qjff_AD_for_uigetAward':
  7490. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7491. dui5.qjff_AD_for_uigetAward();
  7492. break;
  7493. case 'qjff_AD_for_uiGameEnd':
  7494. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7495. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7496. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7497. break;
  7498. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7499. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7500. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7501. break;
  7502. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7503. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7504. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7505. break;
  7506. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7507. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7508. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7509. break;
  7510. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7511. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7512. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7513. break;
  7514. case 'qjff_AD_for_UIBOX_onOpenBox':
  7515. let dui11 = xGame.uiMgr.getUI(UIBox);
  7516. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7517. break;
  7518. case 'qjff_AD_for_UIAddCoin':
  7519. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7520. dui12.qjff_AD_for_UIAddCoin();
  7521. break;
  7522. case 'app_sign_for_buyProduct_onSuccess':
  7523. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7524. DataMgr.getUserZiChanInfo(false);
  7525. break;
  7526. case '222axxxxxx':
  7527. let dui15 = xGame.uiMgr.getUI(UISign);
  7528. dui15.qjff_AD_for_uisign();
  7529. break;
  7530. case '333axsxxxxxx':
  7531. let dui16 = xGame.uiMgr.getUI(UISign);
  7532. dui16.qjff_AD_for_uisign();
  7533. break;
  7534. default:
  7535. console.log('zh:未知的方法名字' + t);
  7536. break;
  7537. }
  7538. }
  7539. onConstructor() {
  7540. console.log('zh: UIMain onConstructor');
  7541. this.ui = ui_UIMain.createInstance();
  7542. this.contentPane = this.ui;
  7543. this.isEject = false;
  7544. this.addEvent();
  7545. this.addClickSpine();
  7546. this.settingNode = new SettingNode(this.ui.settingNode);
  7547. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7548. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7549. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7550. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7551. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7552. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7553. let curUse = DataMgr.getCurSecretary();
  7554. this.changeSecretary(curUse);
  7555. this.ui.talkNode.visible = false;
  7556. let guide = DataMgr.getSkillGuide();
  7557. if (xGame.common.isNewDay && guide == 1) {
  7558. xGame.common.isNewDay = false;
  7559. xGame.soundMgr.playSound("s_main01");
  7560. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7561. console.log("zh:播放小秘书每天语音");
  7562. }
  7563. this.onGetUserInfo();
  7564. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7565. DataMgr.getUserZiChanInfo(false);
  7566. }
  7567. this.ui.n83.visible = false;
  7568. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7569. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7570. let ua = d.username;
  7571. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7572. }
  7573. this.c_btn_for_user();
  7574. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7575. }
  7576. Logout() {
  7577. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7578. LocalStorageManager.removeItem(keyForLoginInfo);
  7579. this.freshUser();
  7580. }
  7581. JSBridgeUtils.instance.loginOutForApp();
  7582. this.setUserDefaultNickname();
  7583. DataMgr.setCoin2(4000);
  7584. DataMgr.setDiamond2(0);
  7585. this.setDefaultQiuGanInfo();
  7586. DataMgr.setPlaceBallLevelList("");
  7587. DataMgr.setChallengeMode_overLev(1);
  7588. this.setDefaultSignData();
  7589. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  7590. }
  7591. setDefaultSignData() {
  7592. DataMgr.setSignData(1);
  7593. DataMgr.setSignTime(new Date().getTime());
  7594. }
  7595. setDefaultQiuGanInfo() {
  7596. DataMgr.setBallRod(0, 1);
  7597. DataMgr.setBallRod(1, 0);
  7598. DataMgr.setBallRod(2, 0);
  7599. DataMgr.setBallRod(3, 0);
  7600. DataMgr.setBallRod(4, 0);
  7601. DataMgr.setBallRod(5, 1);
  7602. }
  7603. setUserDefaultNickname() {
  7604. let defUsername = "player";
  7605. this.ui.headNode.nameTxt.text = defUsername;
  7606. DataMgr.updateUserNickName(defUsername);
  7607. Moyu.updateUserInfo(defUsername);
  7608. }
  7609. gotoLogin() {
  7610. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7611. xGame.uiMgr.Show(UILogin);
  7612. }
  7613. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7614. this.Logout();
  7615. }
  7616. }
  7617. gotoRegUser() {
  7618. xGame.uiMgr.Show(UIReg);
  7619. }
  7620. showFuLiSp1() {
  7621. console.log('zh:福利1');
  7622. DataMgr.checkForShowFuLi17AndAlert(1);
  7623. }
  7624. showFuLiSp7() {
  7625. console.log('zh:福利7');
  7626. DataMgr.checkForShowFuLi17AndAlert(7);
  7627. }
  7628. c_btn_for_user() {
  7629. this.ui.n_dengLu.c1.selectedIndex = 0;
  7630. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7631. this.ui.n_dengLu.c1.selectedIndex = 1;
  7632. }
  7633. else {
  7634. this.ui.n_dengLu.c1.selectedIndex = 0;
  7635. }
  7636. }
  7637. changeSecretary(curUse) {
  7638. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7639. xGame.common.secretary && xGame.common.secretary.dispose();
  7640. this.addSecretarySpine(name);
  7641. }
  7642. addSecretarySpine(name) {
  7643. let spine = new SpineMgr(name, () => {
  7644. this.playSecretaryIdle();
  7645. });
  7646. xGame.common.secretary = spine;
  7647. }
  7648. addClickSpine() {
  7649. let clickSpine = new SpineMgr("dianji", () => {
  7650. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7651. let parent = Laya.stage;
  7652. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7653. clickSpine.play(data, 0, false, parent, (spine) => {
  7654. spine.destroy(true);
  7655. });
  7656. });
  7657. });
  7658. }
  7659. addEvent() {
  7660. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7661. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7662. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7663. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7664. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7665. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7666. this.addUIClick(this.ui, this.interuptSecretary);
  7667. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7668. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7669. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7670. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7671. this.addUIClick(this.ui.signBtn, this.openSignView);
  7672. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7673. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7674. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  7675. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7676. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7677. }
  7678. show(showFailWords) {
  7679. super.show();
  7680. DataMgr.loadUserSpOrderForAd();
  7681. this.moneyNode.ui.c1.selectedIndex = 1;
  7682. this.playSecretaryIdle();
  7683. xGame.soundMgr.playMusic("caromhall01", 0);
  7684. Laya.timer.clearAll(this);
  7685. this.playSecretaryRandomSound();
  7686. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7687. if (showFailWords) {
  7688. console.log('zh:uimain.ts ');
  7689. setTimeout(() => {
  7690. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7691. let words = -1;
  7692. if (str == "s_main02") {
  7693. words = 2;
  7694. }
  7695. else {
  7696. words = 3;
  7697. }
  7698. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7699. xGame.soundMgr.playSound(str);
  7700. }, 300);
  7701. }
  7702. this.showGuide();
  7703. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7704. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7705. let guide = DataMgr.getSkillGuide();
  7706. if (guide == 1) {
  7707. let randTime = xGame.common.randomNum(300, 800);
  7708. if (this.firstEnter) {
  7709. console.log("zh: firstEnter");
  7710. this.firstEnter = false;
  7711. randTime += 900;
  7712. }
  7713. else {
  7714. console.log("zh: no firstEnter");
  7715. }
  7716. Laya.timer.once(randTime, this, () => {
  7717. });
  7718. Laya.timer.once(1000, this, () => {
  7719. console.log('zh: 1秒后 showFuLiSp7');
  7720. this.showFuLiSp7();
  7721. });
  7722. this.showTipForGuest();
  7723. }
  7724. this.setGlobalFont(this.ui);
  7725. }
  7726. showTipForGuest() {
  7727. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7728. if (userInfo == null) {
  7729. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  7730. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  7731. let woman = "this is an important notice.";
  7732. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7733. return;
  7734. }
  7735. }
  7736. checkActive(show) {
  7737. }
  7738. showGuide() {
  7739. let guide = DataMgr.getSkillGuide();
  7740. this.ui.guideBtn.visible = guide == 0;
  7741. this.ui.enterGuide.visible = false;
  7742. this.ui.secretaryGuide.visible = guide == 0;
  7743. if (guide == 0) {
  7744. console.log("zh:显示引导");
  7745. xGame.soundMgr.playSound("s_guide");
  7746. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7747. }
  7748. else {
  7749. console.log("zh:不需要显示引导");
  7750. }
  7751. }
  7752. ensureSecretary() {
  7753. console.log('zh: ensureSecretary ');
  7754. this.ui.secretaryGuide.visible = false;
  7755. this.ui.enterGuide.visible = true;
  7756. this.ui.wordsNode.t0.play();
  7757. if (DataMgr.getNewUser())
  7758. Moyu.sendDataEvent("gameReady");
  7759. }
  7760. playSecretaryIdle() {
  7761. let parent = this.ui.secretary.displayObject;
  7762. parent.destroyChildren();
  7763. let xx = this.ui.secretary.width / 2;
  7764. let yy = this.ui.secretary.height;
  7765. let scale = xGame.common.getSecretaryScale();
  7766. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7767. xGame.common.secretary.play(data, 0, true, parent);
  7768. }
  7769. startGame(type) {
  7770. if (!this.isReadyForLoadNetSource()) {
  7771. return;
  7772. }
  7773. xGame.common.gameMode = type;
  7774. Moyu.sendDataEvent("PlayGame", { type: type });
  7775. let gm = xGame.common.gameMode;
  7776. console.log('zh:进入游戏gameMode =' + gm);
  7777. switch (gm) {
  7778. case GameMode.classic:
  7779. console.log('zh:进入经典模式111111111');
  7780. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7781. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7782. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7783. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7784. console.log('zh:判断是否可以玩该模式classic =NO');
  7785. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7786. xGame.uiMgr.Show(UIMsg, tipStr);
  7787. return;
  7788. }
  7789. else {
  7790. console.log('zh:可以玩该模式classic');
  7791. this.beginGame();
  7792. }
  7793. }
  7794. else {
  7795. console.log('zh:不需要判断是否可以玩该classic');
  7796. let challengeTimes = DataMgr.getChallengeTimes();
  7797. if (challengeTimes == 0) {
  7798. xGame.uiMgr.Show(UIInvitation);
  7799. }
  7800. else {
  7801. this.beginGame();
  7802. }
  7803. }
  7804. break;
  7805. case GameMode.bigMove:
  7806. console.info('zh:bigMove check 大招');
  7807. let guide = DataMgr.getSkillGuide();
  7808. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7809. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7810. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7811. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7812. console.log('zh:提示不可以玩');
  7813. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7814. xGame.uiMgr.Show(UIMsg, tipStr);
  7815. return;
  7816. }
  7817. else {
  7818. console.log('zh:可以玩该模式 bigMove');
  7819. this.beginGame();
  7820. if (DataMgr.getNewUser())
  7821. Moyu.sendDataEvent("gameStart0");
  7822. }
  7823. }
  7824. else {
  7825. this.beginGame();
  7826. if (DataMgr.getNewUser())
  7827. Moyu.sendDataEvent("gameStart0");
  7828. }
  7829. break;
  7830. default:
  7831. console.error('zh:未知错误!!!!');
  7832. break;
  7833. }
  7834. }
  7835. beginGame(isNice = false) {
  7836. console.log('zh:beginGame ');
  7837. let guide = DataMgr.getSkillGuide();
  7838. if (guide == 1) {
  7839. console.log('zh:非新手引导,showInternAd ');
  7840. JSBridgeUtils.instance.showInternAd('beginGame');
  7841. }
  7842. else {
  7843. console.log('zh:新手引导,不显示AD ');
  7844. }
  7845. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7846. console.log('zh:beginGame 1');
  7847. if (xGame.common.gameMode == GameMode.classic) {
  7848. console.log('zh:beginGame 2');
  7849. if (isNice) {
  7850. console.log('zh:进入巅峰赛');
  7851. this.enterClassic();
  7852. }
  7853. else {
  7854. console.log('zh:beginGame 3-1');
  7855. xGame.uiMgr.Show(UIModeSelection, () => {
  7856. console.log('zh:beginGame 3-2');
  7857. this.enterClassic();
  7858. });
  7859. }
  7860. }
  7861. else if (xGame.common.gameMode == GameMode.bigMove) {
  7862. console.log('zh:beginGame 5');
  7863. this.ui.enterGuide.visible = false;
  7864. xGame.uiMgr.Show(UISkill);
  7865. }
  7866. }
  7867. enterClassic() {
  7868. console.log('zh:beginGame 7');
  7869. xGame.uiMgr.Show(UIGame);
  7870. xGame.uiMgr.Show(UIMatching, () => {
  7871. if (!this.isHide)
  7872. this.hide();
  7873. xGame.common.gameUI.ui.alpha = 1;
  7874. console.log('zh:beginGame 8');
  7875. xGame.common.gameUI.startGame();
  7876. xGame.uiMgr.Hide(UIGameEnd);
  7877. });
  7878. }
  7879. start_debug_for_moni_payOk() {
  7880. let ccc = this.moni_click_count + 1;
  7881. this.moni_click_count = ccc;
  7882. if (ccc % 5 == 0) {
  7883. console.log('zh:start_debug_for_moni_payOk');
  7884. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7885. if (userInfo != null) {
  7886. let token = userInfo.token;
  7887. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7888. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7889. alert('模拟支付OK');
  7890. return;
  7891. }
  7892. else {
  7893. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7894. }
  7895. }
  7896. }
  7897. startGlobal() {
  7898. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7899. }
  7900. startWeekly() {
  7901. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7902. }
  7903. zhouSaiMonth() {
  7904. console.log('zh: zhouSaiMonth 被调用');
  7905. }
  7906. isReadyForLoadNetSource() {
  7907. let reqCount = xGame.cfgMgr.httpReqCount;
  7908. let ok = xGame.cfgMgr.httpReqOkCount;
  7909. if (reqCount > ok) {
  7910. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  7911. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  7912. Laya.timer.once(5000, this, () => {
  7913. let retryCount = 0;
  7914. const maxRetries = 3;
  7915. const tryFetchConfig = () => {
  7916. try {
  7917. xGame.cfgMgr.getConfigFromServer();
  7918. }
  7919. catch (error) {
  7920. if (retryCount < maxRetries) {
  7921. retryCount++;
  7922. console.log(`🔄 第${retryCount}次重试获取配置...`);
  7923. Laya.timer.once(5000, this, tryFetchConfig);
  7924. }
  7925. else {
  7926. console.error("❌ 达到最大重试次数,配置获取失败");
  7927. }
  7928. }
  7929. };
  7930. tryFetchConfig();
  7931. });
  7932. return false;
  7933. }
  7934. return true;
  7935. }
  7936. startPlaceBall() {
  7937. if (!this.isReadyForLoadNetSource()) {
  7938. return;
  7939. }
  7940. xGame.uiMgr.Show(UILevelDisplay);
  7941. }
  7942. hide() {
  7943. console.log('zh:uimain hide ...');
  7944. super.hide();
  7945. xGame.common.stopGirlPop(this.ui.talkNode);
  7946. }
  7947. onGetUserInfo(force = false) {
  7948. if (Moyu.isWx) {
  7949. let info = Moyu.getSystemInfo();
  7950. if (info)
  7951. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  7952. }
  7953. else {
  7954. Moyu.initUser(this, this.freshUser, force);
  7955. }
  7956. this.freshUser();
  7957. console.log('zh:5秒后更新用户信息');
  7958. setTimeout(() => {
  7959. DataMgr.getUserZiChanInfo(true);
  7960. }, 5000);
  7961. }
  7962. event_login_in() {
  7963. console.log("zh:event_login_in被触发");
  7964. this.freshUser();
  7965. }
  7966. freshUser() {
  7967. let user = Moyu.getUserInfo();
  7968. if (!user.isAuth) {
  7969. user.headIcon = 'res/ty_touxiang.png';
  7970. }
  7971. else {
  7972. DataMgr.upRankData();
  7973. }
  7974. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  7975. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  7976. let keyStr = keyForLoginInfo;
  7977. if (LocalStorageManager.hasJosnKey(keyStr)) {
  7978. const d = LocalStorageManager.getItem(keyStr);
  7979. let ua = d.username;
  7980. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7981. }
  7982. else {
  7983. }
  7984. this.c_btn_for_user();
  7985. }
  7986. interuptSecretary() {
  7987. Laya.timer.clearAll(this);
  7988. this.playSecretaryRandomSound();
  7989. }
  7990. playSecretaryRandomSound() {
  7991. if (this.isHide)
  7992. return;
  7993. let time = xGame.common.randomNum(45000, 60000);
  7994. Laya.timer.once(time, this, () => {
  7995. if (this.isHide)
  7996. return;
  7997. let index = xGame.common.randomNum(4, 7);
  7998. xGame.soundMgr.playSound("s_main0" + index);
  7999. let words = 1;
  8000. switch (index) {
  8001. case 4:
  8002. words = 5;
  8003. break;
  8004. case 5:
  8005. words = 3;
  8006. break;
  8007. case 6:
  8008. words = 6;
  8009. break;
  8010. case 7:
  8011. words = 7;
  8012. break;
  8013. default:
  8014. break;
  8015. }
  8016. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8017. this.playSecretaryRandomSound();
  8018. });
  8019. }
  8020. openSecretaryView() {
  8021. xGame.uiMgr.Show(UISecretary);
  8022. Moyu.sendDataEvent("secretary");
  8023. }
  8024. openShopView() {
  8025. xGame.uiMgr.Show(UIShop, 1);
  8026. }
  8027. openShopView0() {
  8028. xGame.uiMgr.Show(UIShop, 0);
  8029. }
  8030. openSignView() {
  8031. xGame.uiMgr.Show(UISign);
  8032. }
  8033. openDrawView() {
  8034. xGame.uiMgr.Show(UIDraw);
  8035. }
  8036. openRanking() {
  8037. console.log('zh:phb openRanking');
  8038. xGame.uiMgr.Show(UIRanking);
  8039. Moyu.sendDataEvent("rankingList");
  8040. }
  8041. }
  8042. UIMain.uiName = "UIMain";
  8043. class UIGameEnd extends UIBase {
  8044. constructor() {
  8045. super();
  8046. this.success = false;
  8047. this.awardCoinNum = 1000;
  8048. this.awardDiamondNum = 10;
  8049. }
  8050. onConstructor() {
  8051. this.ui = ui_UIGameEnd.createInstance();
  8052. this.contentPane = this.ui;
  8053. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8054. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8055. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8056. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8057. this.ui.talkNode.visible = false;
  8058. if (Moyu.isKs)
  8059. this.ui.closeNode.closeBtn.x += 100;
  8060. }
  8061. updateType() {
  8062. switch (xGame.common.gameMode) {
  8063. case GameMode.classic:
  8064. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8065. this.ui.coinNode.visible = this.success;
  8066. if (!this.success) {
  8067. Laya.timer.once(500, this, () => {
  8068. xGame.uiMgr.Show(UIAddCoin);
  8069. });
  8070. }
  8071. else {
  8072. this.logEventForClassic_win();
  8073. }
  8074. this.logEventForClassic_complete();
  8075. this.ui.isGetAward.visible = false;
  8076. this.ui.leftBtn.c1.selectedIndex = 3;
  8077. this.ui.rightBtn.c1.selectedIndex = 0;
  8078. this.moneyNode.ui.c1.selectedIndex = 1;
  8079. break;
  8080. case GameMode.bigMove:
  8081. console.log('zh:招法模式 aaaaaa bigMove');
  8082. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8083. this.ui.coinNode.visible = this.success;
  8084. if (xGame.common.gameMode == GameMode.bigMove) {
  8085. if (this.success) {
  8086. DataMgr.setSkillSuccessTimes(1, true);
  8087. DataMgr.setSkillAccTimes(1);
  8088. }
  8089. else {
  8090. DataMgr.setSkillSuccessTimes(0, false);
  8091. }
  8092. }
  8093. this.logEventForRod_complete_N();
  8094. if (!this.success) {
  8095. Laya.timer.once(500, this, () => {
  8096. xGame.uiMgr.Show(UIAddCoin);
  8097. });
  8098. }
  8099. else {
  8100. this.logEventForRod_win();
  8101. }
  8102. this.ui.isGetAward.visible = false;
  8103. this.ui.leftBtn.c1.selectedIndex = 3;
  8104. this.ui.rightBtn.c1.selectedIndex = 0;
  8105. this.moneyNode.ui.c1.selectedIndex = 1;
  8106. break;
  8107. case GameMode.placeBall:
  8108. this.ui.coinNode.visible = false;
  8109. if (this.success) {
  8110. if (xGame.common.placeBallStarNum == 3) {
  8111. this.ui.c1.selectedIndex = 2;
  8112. }
  8113. else {
  8114. this.ui.c1.selectedIndex = 3;
  8115. }
  8116. let level = xGame.common.placeBallCurLevel;
  8117. if (level > 59) {
  8118. this.logEventForChallenge_level_complete(level);
  8119. }
  8120. else {
  8121. this.logEventForChallenge_level_N(level);
  8122. }
  8123. }
  8124. else {
  8125. this.ui.c1.selectedIndex = 4;
  8126. }
  8127. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8128. if (cfg.type == PlaceBallType.challenge) {
  8129. this.ui.c1.selectedIndex = 2;
  8130. }
  8131. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8132. this.updatePlaceBallBtn();
  8133. this.updatePlaceBallStarNum();
  8134. this.updatePlaceBallAwardState();
  8135. this.moneyNode.ui.c1.selectedIndex = 2;
  8136. this.moneyNode.checkPowerTime();
  8137. this.moneyNode.powerChange();
  8138. DataMgr.upRankData();
  8139. break;
  8140. default:
  8141. break;
  8142. }
  8143. }
  8144. logEventForRod_complete_N() {
  8145. let gfmsIdx = xGame.common.curPlayerSkillType;
  8146. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8147. let gfmc = 'Skyfall Shot';
  8148. if (gfmsIdx == 0) {
  8149. gfmc = 'Skyfall Shot';
  8150. }
  8151. if (gfmsIdx == 1) {
  8152. gfmc = 'Surging break';
  8153. }
  8154. if (gfmsIdx == 2) {
  8155. gfmc = 'Frost Lock';
  8156. }
  8157. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8158. console.log('zh:logEventForRod_complete_N level = ' + level);
  8159. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8160. let jsonStr = {
  8161. "count": 0,
  8162. "name": gfmc
  8163. };
  8164. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8165. const d = LocalStorageManager.getItem(keyStr);
  8166. jsonStr.count = d.count + 1;
  8167. LocalStorageManager.setItem(keyStr, jsonStr);
  8168. }
  8169. else {
  8170. LocalStorageManager.setItem(keyStr, jsonStr);
  8171. }
  8172. const d2 = LocalStorageManager.getItem(keyStr);
  8173. let count = d2.count;
  8174. console.log('zh:logEventForRod_complete_N count = ' + count);
  8175. if (count % 5 == 0) {
  8176. const reqStr = JSON.stringify(jsonStr);
  8177. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8178. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8179. }
  8180. }
  8181. logEventForRod_win() {
  8182. console.log('zh:logEventForRod_win,胜利');
  8183. let gfmsIdx = xGame.common.curPlayerSkillType;
  8184. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8185. let gfmc = 'Skyfall Shot';
  8186. if (gfmsIdx == 0) {
  8187. gfmc = 'Skyfall Shot';
  8188. }
  8189. if (gfmsIdx == 1) {
  8190. gfmc = 'Surging break';
  8191. }
  8192. if (gfmsIdx == 2) {
  8193. gfmc = 'Frost Lock';
  8194. }
  8195. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8196. console.log('zh:logEventForRod_win level = ' + level);
  8197. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8198. let jsonStr = {
  8199. "count": 1,
  8200. "name": gfmc + ' Lev' + level
  8201. };
  8202. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8203. const d = LocalStorageManager.getItem(keyStr);
  8204. jsonStr.count = d.count + 1;
  8205. LocalStorageManager.setItem(keyStr, jsonStr);
  8206. }
  8207. else {
  8208. LocalStorageManager.setItem(keyStr, jsonStr);
  8209. }
  8210. const reqStr = JSON.stringify(jsonStr);
  8211. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8212. }
  8213. logEventForClassic_win() {
  8214. console.log('zh:logEventForClassic_win,胜利');
  8215. let rtype = xGame.common.classicRoomType;
  8216. let msmc = '';
  8217. if (rtype == 1) {
  8218. msmc = 'beginner';
  8219. }
  8220. if (rtype == 2) {
  8221. msmc = 'expert';
  8222. }
  8223. if (rtype == 3) {
  8224. msmc = 'master';
  8225. }
  8226. let keyStr = 'sjmd_classic_win_' + rtype;
  8227. let jsonStr = {
  8228. "difficulty": msmc,
  8229. "classic_count": 1,
  8230. "difficulty_count": 1
  8231. };
  8232. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8233. const d = LocalStorageManager.getItem(keyStr);
  8234. jsonStr.classic_count = d.classic_count + 1;
  8235. jsonStr.difficulty_count = d.difficulty_count + 1;
  8236. LocalStorageManager.setItem(keyStr, jsonStr);
  8237. }
  8238. else {
  8239. LocalStorageManager.setItem(keyStr, jsonStr);
  8240. }
  8241. const reqStr = JSON.stringify(jsonStr);
  8242. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8243. }
  8244. logEventForClassic_complete() {
  8245. console.log('zh:logEventForClassic_complete,胜利');
  8246. let rtype = xGame.common.classicRoomType;
  8247. let msmc = '';
  8248. if (rtype == 1) {
  8249. msmc = 'beginner';
  8250. }
  8251. if (rtype == 2) {
  8252. msmc = 'expert';
  8253. }
  8254. if (rtype == 3) {
  8255. msmc = 'master';
  8256. }
  8257. let keyStr = 'sjmd_classic_complete_' + rtype;
  8258. let jsonStr = {
  8259. "msmc": msmc,
  8260. "count": 0
  8261. };
  8262. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8263. const d = LocalStorageManager.getItem(keyStr);
  8264. jsonStr.count = d.count + 1;
  8265. LocalStorageManager.setItem(keyStr, jsonStr);
  8266. }
  8267. else {
  8268. LocalStorageManager.setItem(keyStr, jsonStr);
  8269. }
  8270. if (jsonStr.count % 5 == 0) {
  8271. const reqStr = JSON.stringify(jsonStr);
  8272. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8273. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8274. }
  8275. }
  8276. updatePlaceBallBtn() {
  8277. this.ui.leftBtn.c1.selectedIndex = 5;
  8278. if (this.success) {
  8279. this.ui.rightBtn.c1.selectedIndex = 14;
  8280. }
  8281. else {
  8282. if (xGame.common.placeBallStarNum == 3) {
  8283. this.ui.rightBtn.c1.selectedIndex = 14;
  8284. }
  8285. else {
  8286. this.ui.rightBtn.c1.selectedIndex = 1;
  8287. }
  8288. }
  8289. }
  8290. updatePlaceBallStarNum() {
  8291. let starNum = xGame.common.placeBallStarNum;
  8292. if (starNum == 0)
  8293. this.ui.starNumNode.c1.selectedIndex = 3;
  8294. else {
  8295. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8296. }
  8297. }
  8298. updatePlaceBallAwardState() {
  8299. let level = xGame.common.placeBallCurLevel;
  8300. let starNum = xGame.common.placeBallStarNum;
  8301. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8302. let data = cfgTable.placeballData[level].award;
  8303. let cfg = cfgTable.placeballData[level];
  8304. this.awardDiamondNum = data[1];
  8305. this.awardCoinNum = data[0];
  8306. if (cfg.type == PlaceBallType.challenge) {
  8307. this.awardDiamondNum = 0;
  8308. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8309. }
  8310. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8311. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8312. if (cfg.type == PlaceBallType.challenge) {
  8313. this.ui.awardNode.coinNode.visible = true;
  8314. }
  8315. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8316. this.ui.awardNode.diamondNode.x = 265;
  8317. this.ui.awardNode.coinNode.x = 354;
  8318. }
  8319. else {
  8320. this.ui.awardNode.diamondNode.x = 291;
  8321. this.ui.awardNode.coinNode.x = 291;
  8322. }
  8323. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8324. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8325. if (this.awardCoinNum == 0) {
  8326. this.ui.awardNode.coinNode.numTxt.text = "";
  8327. }
  8328. if (getAward) {
  8329. this.ui.isGetAward.visible = true;
  8330. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8331. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8332. }
  8333. else {
  8334. this.ui.isGetAward.visible = false;
  8335. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8336. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8337. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8338. }
  8339. else {
  8340. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8341. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8342. }
  8343. }
  8344. }
  8345. show(success) {
  8346. super.show();
  8347. xGame.eventMgr.event(RESET_GAME);
  8348. this.success = success;
  8349. Laya.timer.clearAll(this);
  8350. this.playSecretaryAni();
  8351. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8352. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8353. offsetTime = Math.floor(offsetTime / 1000);
  8354. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8355. this.updateType();
  8356. Laya.timer.once(200, this, () => {
  8357. this.addAward(() => {
  8358. this.updateType();
  8359. Laya.timer.once(500, this, () => {
  8360. this.showChallengeLevel();
  8361. });
  8362. });
  8363. });
  8364. if (this.success) {
  8365. JSBridgeUtils.instance.showInternAd('gameend_success');
  8366. console.log('zh:game end 成功');
  8367. xGame.soundMgr.playSound('slots_roll01');
  8368. xGame.soundMgr.playSound("s_win");
  8369. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8370. this.diyGameDataUtilForGameWin();
  8371. this.updateGamePlaceBallData2Server();
  8372. }
  8373. else {
  8374. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8375. console.log('zh:game end失败');
  8376. xGame.soundMgr.playSound('matchwin01');
  8377. xGame.soundMgr.playSound("s_lose");
  8378. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8379. }
  8380. console.log('zh:开始弹出福利框2个');
  8381. Laya.timer.once(1000, this, () => {
  8382. console.log('zh: 1秒后 showFuLiSp1');
  8383. DataMgr.checkForShowFuLi17AndAlert(1);
  8384. });
  8385. let challengeNum = DataMgr.getChallengeTimes();
  8386. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8387. DataMgr.setChallengeTimes(1);
  8388. }
  8389. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8390. DataMgr.setClassicTimes();
  8391. }
  8392. this.setGlobalFont(this.ui);
  8393. }
  8394. diyGameDataUtilForGameWin() {
  8395. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8396. switch (xGame.common.gameMode) {
  8397. case GameMode.classic:
  8398. console.log('zh:DiyGameDataUtilForGameWin 111');
  8399. case GameMode.bigMove:
  8400. console.log('zh:DiyGameDataUtilForGameWin 222');
  8401. this.restartGame();
  8402. break;
  8403. case GameMode.placeBall:
  8404. console.log('zh:DiyGameDataUtilForGameWin 333');
  8405. var level = xGame.common.placeBallCurLevel;
  8406. console.log('zh:练习模式 联系了多少LEV=' + level);
  8407. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8408. if (level > db_over_lev) {
  8409. DataMgr.setChallengeMode_overLev(level);
  8410. }
  8411. break;
  8412. default:
  8413. console.log('zh:DiyGameDataUtilForGameWin 444');
  8414. break;
  8415. }
  8416. }
  8417. updateGamePlaceBallData2Server() {
  8418. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8419. if (userInfo == null) {
  8420. return;
  8421. }
  8422. let pbdObj = DataMgr.getPlaceBallLevelList();
  8423. let reqData = xGame.httpMgr.getReqData();
  8424. let pd = JSON.parse(reqData);
  8425. pd.placeBallData = JSON.stringify(pbdObj);
  8426. reqData = JSON.stringify(pd);
  8427. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8428. try {
  8429. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8430. let code = res.code;
  8431. let msg = res.msg;
  8432. if (code == 401) {
  8433. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8434. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8435. return;
  8436. }
  8437. if (code == 200) {
  8438. let data = res.data;
  8439. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8440. }
  8441. else {
  8442. xGame.uiMgr.Show(UIMsg, msg);
  8443. }
  8444. }
  8445. catch (error) {
  8446. console.log('error=' + error);
  8447. alert(error);
  8448. }
  8449. finally {
  8450. }
  8451. });
  8452. }
  8453. showChallengeLevel() {
  8454. if (DataMgr.getChallengeTimes() != 0)
  8455. return;
  8456. let skill = DataMgr.getSkillAccTimes();
  8457. let put = DataMgr.getPlaceBallLevelList().length;
  8458. if (skill >= 3 || put >= 5) {
  8459. xGame.uiMgr.Show(UIInvitation);
  8460. this.hide();
  8461. }
  8462. }
  8463. addAward(callback) {
  8464. if (!this.success) {
  8465. callback && callback();
  8466. return;
  8467. }
  8468. switch (xGame.common.gameMode) {
  8469. case GameMode.classic:
  8470. this.awardCoinNum = xGame.common.passAwardCoin;
  8471. this.awardDiamondNum = 0;
  8472. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8473. break;
  8474. case GameMode.bigMove:
  8475. this.awardCoinNum = xGame.common.passAwardCoin;
  8476. this.awardDiamondNum = 0;
  8477. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8478. callback && callback();
  8479. break;
  8480. case GameMode.placeBall:
  8481. let level = xGame.common.placeBallCurLevel;
  8482. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8483. if (xGame.common.placeBallStarNum != 3) {
  8484. callback && callback();
  8485. return;
  8486. }
  8487. else {
  8488. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8489. if (getAward) {
  8490. callback && callback();
  8491. return;
  8492. }
  8493. }
  8494. let cfg = cfgTable.placeballData[level];
  8495. let data = cfgTable.placeballData[level].award;
  8496. this.awardCoinNum = data[0];
  8497. this.awardDiamondNum = data[1];
  8498. if (cfg.type == PlaceBallType.challenge) {
  8499. this.awardDiamondNum = 0;
  8500. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8501. }
  8502. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8503. let diamondAward;
  8504. if (this.awardDiamondNum > 0) {
  8505. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8506. xGame.common.getAward([diamondAward, coinAward], callback);
  8507. }
  8508. else {
  8509. xGame.common.getAward([coinAward], callback);
  8510. }
  8511. if (cfg.type == PlaceBallType.normal) {
  8512. DataMgr.setPlaceBallAward(level);
  8513. }
  8514. break;
  8515. default:
  8516. break;
  8517. }
  8518. }
  8519. playSecretaryAni_old() {
  8520. let parent = this.ui.secretary.displayObject;
  8521. parent.destroyChildren();
  8522. let xx = this.ui.secretary.width / 2;
  8523. let yy = this.ui.secretary.height;
  8524. let scale = xGame.common.getSecretaryScale();
  8525. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8526. if (this.success) {
  8527. let rand = Math.random() <= 0.5 ? 2 : 3;
  8528. xGame.common.secretary.play(data, rand, false, parent, () => {
  8529. xGame.common.secretary.play(data, 1, true, parent);
  8530. });
  8531. }
  8532. else {
  8533. xGame.common.secretary.play(data, 0, true, parent);
  8534. }
  8535. }
  8536. playSecretaryAni() {
  8537. let parent = this.ui.secretary.displayObject;
  8538. parent.destroyChildren();
  8539. let xx = this.ui.secretary.width / 2;
  8540. let yy = this.ui.secretary.height;
  8541. let scale = xGame.common.getSecretaryScale();
  8542. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8543. if (this.success) {
  8544. let rand = 0;
  8545. xGame.common.secretary.play(data, 0, true, parent);
  8546. }
  8547. else {
  8548. xGame.common.secretary.play(data, 0, true, parent);
  8549. }
  8550. }
  8551. restartGame() {
  8552. switch (xGame.common.gameMode) {
  8553. case GameMode.classic:
  8554. xGame.eventMgr.event(RESTART_GAME);
  8555. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8556. break;
  8557. case GameMode.bigMove:
  8558. this.hide();
  8559. xGame.eventMgr.event(RESTART_GAME);
  8560. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8561. break;
  8562. default:
  8563. break;
  8564. }
  8565. }
  8566. hide() {
  8567. super.hide();
  8568. xGame.common.stopGirlPop(this.ui.talkNode);
  8569. PlatMgr.showBanner(false);
  8570. }
  8571. returnHome() {
  8572. this.hide();
  8573. let showFailWords = !this.success;
  8574. xGame.uiMgr.Show(UIMain, showFailWords);
  8575. }
  8576. clickLeftBtn() {
  8577. switch (xGame.common.gameMode) {
  8578. case GameMode.classic:
  8579. case GameMode.bigMove:
  8580. this.returnHome();
  8581. break;
  8582. case GameMode.placeBall:
  8583. let level = xGame.common.placeBallCurLevel;
  8584. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8585. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8586. break;
  8587. default:
  8588. break;
  8589. }
  8590. }
  8591. powerStartPlaceBallLevel(level, btn) {
  8592. if (DataMgr.powerEnough()) {
  8593. btn.touchable = false;
  8594. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8595. btn.touchable = true;
  8596. DataMgr.setPower(-1);
  8597. xGame.eventMgr.event(POWER_TIME);
  8598. this.startPlaceBallLevel(level);
  8599. this.logEventForChallenge_level_start(level);
  8600. }));
  8601. }
  8602. else {
  8603. xGame.uiMgr.Show(UIPower, 0);
  8604. }
  8605. }
  8606. clickRightBtn() {
  8607. switch (xGame.common.gameMode) {
  8608. case GameMode.classic:
  8609. console.log('zh:clickRightBtn 111');
  8610. case GameMode.bigMove:
  8611. console.log('zh:clickRightBtn 222');
  8612. this.restartGame();
  8613. break;
  8614. case GameMode.placeBall:
  8615. console.log('zh:clickRightBtn 333');
  8616. let level = xGame.common.placeBallCurLevel;
  8617. let data = DataMgr.getPlaceBallLevel(level);
  8618. let curPss = data.play && !data.isCur;
  8619. if (curPss) {
  8620. console.log('zh:clickRightBtn 333-111');
  8621. console.log('zh:当前LV=' + level);
  8622. if (level == 60) {
  8623. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8624. Laya.timer.once(3000, this, () => {
  8625. this.returnHome();
  8626. });
  8627. }
  8628. else {
  8629. let lev = level + 1;
  8630. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8631. }
  8632. }
  8633. else {
  8634. console.log('zh:clickRightBtn 333-000');
  8635. Moyu.sendDataEvent("placeBallNextLevel");
  8636. console.log('zh:qjff_AD_for_uiGameEnd');
  8637. if (Laya.Browser.onAndroid) {
  8638. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8639. if (!boo) {
  8640. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8641. return;
  8642. }
  8643. }
  8644. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8645. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8646. }
  8647. else {
  8648. console.log('zh:AD 失败,直接发放奖励');
  8649. this.qjff_AD_for_uiGameEnd(level);
  8650. }
  8651. }
  8652. break;
  8653. default:
  8654. console.log('zh:clickRightBtn 444');
  8655. break;
  8656. }
  8657. }
  8658. logEventForChallenge_level_start(level) {
  8659. let keyStr = 'sjmd_challenge_level_start';
  8660. let jsonStr = {
  8661. "count": 0,
  8662. "gold_balance ": DataMgr.getCoin(),
  8663. "level": level,
  8664. "diamond_balance ": DataMgr.getDiamond()
  8665. };
  8666. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8667. const d = LocalStorageManager.getItem(keyStr);
  8668. if (level > d.level) {
  8669. jsonStr.count = d.count + 1;
  8670. LocalStorageManager.setItem(keyStr, jsonStr);
  8671. }
  8672. else {
  8673. }
  8674. }
  8675. else {
  8676. LocalStorageManager.setItem(keyStr, jsonStr);
  8677. }
  8678. const reqStr = JSON.stringify(jsonStr);
  8679. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8680. }
  8681. qjff_AD_for_uiGameEnd(level) {
  8682. DataMgr.setPlaceBallLevel(level, 1);
  8683. this.startPlaceBallLevel(level + 1);
  8684. }
  8685. startPlaceBallLevel(level) {
  8686. xGame.common.gameMode = GameMode.placeBall;
  8687. xGame.common.placeBallCurLevel = level;
  8688. xGame.uiMgr.Show(UIGame);
  8689. this.hide();
  8690. }
  8691. logEventForChallenge_level_complete(level) {
  8692. let keyStr = 'sjmd_challenge_level_complete';
  8693. let jsonStr = {
  8694. "count": 1,
  8695. "gold_balance ": DataMgr.getCoin(),
  8696. "level": level,
  8697. "diamond_balance ": DataMgr.getDiamond()
  8698. };
  8699. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8700. const d = LocalStorageManager.getItem(keyStr);
  8701. jsonStr.count = d.count + 1;
  8702. LocalStorageManager.setItem(keyStr, jsonStr);
  8703. }
  8704. else {
  8705. LocalStorageManager.setItem(keyStr, jsonStr);
  8706. }
  8707. const reqStr = JSON.stringify(jsonStr);
  8708. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8709. }
  8710. logEventForChallenge_level_N(level) {
  8711. console.log('zh:logEventForChallenge_level_N ' + level);
  8712. let keyStr = 'sjmd_challenge_level_N';
  8713. if (LocalStorageManager.hasKey(keyStr)) {
  8714. let lev = LocalStorageManager.getItem(keyStr);
  8715. if (level > lev) {
  8716. LocalStorageManager.setItem(keyStr, level);
  8717. }
  8718. if ((level) % 5 == 0) {
  8719. console.log('zh:每5关上报1次');
  8720. let sjmc = 'challenge_level_' + level;
  8721. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8722. let sjmcForFirebase = 'challenge_level_' + level;
  8723. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8724. }
  8725. else {
  8726. console.log('zh:5 no 上报');
  8727. }
  8728. }
  8729. else {
  8730. LocalStorageManager.setItem(keyStr, level);
  8731. }
  8732. }
  8733. }
  8734. UIGameEnd.uiName = "UIGameEnd";
  8735. class ui_UIVideoShare extends fgui.GComponent {
  8736. static createInstance() {
  8737. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8738. }
  8739. onConstruct() {
  8740. this.n10 = (this.getChild("n10"));
  8741. this.myNode = (this.getChild("myNode"));
  8742. this.t0 = this.getTransition("t0");
  8743. }
  8744. }
  8745. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8746. class UIVideoShare extends UIBase {
  8747. constructor() {
  8748. super();
  8749. this.success = false;
  8750. this.awardNum = 0;
  8751. this.isShared = true;
  8752. }
  8753. onConstructor() {
  8754. this.ui = ui_UIVideoShare.createInstance();
  8755. this.contentPane = this.ui;
  8756. this.isEject = false;
  8757. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8758. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8759. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8760. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8761. }
  8762. show(success) {
  8763. super.show();
  8764. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8765. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8766. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8767. this.success = success;
  8768. let time = xGame.common.randomNum(600, 1500);
  8769. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8770. if (success)
  8771. xGame.soundMgr.playSound("applause");
  8772. this.ui.t0.play();
  8773. this.checkShareState();
  8774. let times = DataMgr.getDailyVideoShareTimes();
  8775. this.awardNum = times == 0 ? 2000 : 200;
  8776. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8777. this.setGlobalFont(this.ui);
  8778. }
  8779. checkShareState() {
  8780. if (PlatMgr.forceShare == 0) {
  8781. this.ui.myNode.closeBtn.visible = true;
  8782. this.ui.myNode.tipsNode.visible = false;
  8783. this.ui.myNode.closeBtn.x = 90;
  8784. this.ui.myNode.shareBtn.x = 342;
  8785. }
  8786. else if (PlatMgr.forceShare == 1) {
  8787. this.ui.myNode.closeBtn.visible = false;
  8788. this.ui.myNode.tipsNode.visible = true;
  8789. this.ui.myNode.shareBtn.x = 218;
  8790. this.isShared = true;
  8791. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8792. }
  8793. }
  8794. checkForceShare() {
  8795. this.isShared = !this.isShared;
  8796. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8797. }
  8798. videoShare() {
  8799. if (PlatMgr.forceShare == 1) {
  8800. if (this.isShared) {
  8801. this.shareGame();
  8802. }
  8803. else {
  8804. this.hideSelf();
  8805. }
  8806. }
  8807. else {
  8808. this.shareGame();
  8809. }
  8810. }
  8811. shareGame() {
  8812. Moyu.sendDataEvent("VideoShare");
  8813. if (Moyu.canShare() > 100) {
  8814. Moyu.shareGame((success) => {
  8815. if (success) {
  8816. DataMgr.setDailyVideoShareTimes(1);
  8817. DataMgr.setCoin(this.awardNum);
  8818. }
  8819. this.hideSelf();
  8820. }, this);
  8821. }
  8822. else {
  8823. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8824. this.hideSelf();
  8825. }
  8826. }
  8827. hideSelf() {
  8828. this.hide();
  8829. xGame.uiMgr.Show(UIGameEnd, this.success);
  8830. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8831. xGame.common.screenImg.destroy();
  8832. xGame.common.screenImg = null;
  8833. }
  8834. }
  8835. }
  8836. UIVideoShare.uiName = "UIVideoShare";
  8837. class GameMgr {
  8838. constructor() {
  8839. this.selfCamp = "";
  8840. this.selfFoulNum = 0;
  8841. this.selfBallArr = [];
  8842. this.selfTimer = 0;
  8843. this.selfScore = 0;
  8844. this.aiCamp = "";
  8845. this.aiFoulNum = 0;
  8846. this.aiBallArr = [];
  8847. this.aiTimer = 0;
  8848. this.aiScore = 0;
  8849. this.aiSkillLevelNum = 1;
  8850. this.targertScore = 0;
  8851. this.setTime = 30;
  8852. this.selfTurnRate = 0.5;
  8853. this.accTime = 0;
  8854. this.curFoul = "";
  8855. this.maxFoulTimes = 3;
  8856. this.isFirstInGame = true;
  8857. this.firstColliObj = null;
  8858. this.inHoleBalls = [];
  8859. this.blackNum = 8;
  8860. this.success = false;
  8861. this.holePosList = [];
  8862. this.posObj = {};
  8863. this._selfTurn = false;
  8864. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8865. this.ensureBallType = false;
  8866. this.isOpenBall = true;
  8867. this.finishOneShoot = true;
  8868. this.isEnd = false;
  8869. this.isChangeTurn = false;
  8870. this.isInterrupt = false;
  8871. this.aiPlayedBreakArmy = false;
  8872. this.isTouchedBall = false;
  8873. this.finishBalls = 0;
  8874. this.needBalls = 0;
  8875. this.allBallNum = 0;
  8876. this.placeBallPosData = {};
  8877. this.curHP = 0;
  8878. this.showLongView = false;
  8879. this.firstShoot = true;
  8880. this._gamePause = false;
  8881. this.trunCount = 0;
  8882. this.isBlackInHole = false;
  8883. this.isEnter = true;
  8884. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8885. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8886. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8887. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8888. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8889. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8890. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8891. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8892. }
  8893. get gamePause() {
  8894. return this._gamePause;
  8895. }
  8896. set gamePause(v) {
  8897. if (v) {
  8898. Laya.physicsTimer.pause();
  8899. }
  8900. else {
  8901. Laya.physicsTimer.resume();
  8902. }
  8903. this._gamePause = v;
  8904. }
  8905. get selfTurn() {
  8906. return this._selfTurn;
  8907. }
  8908. set selfTurn(val) {
  8909. this.trunCount++;
  8910. this._selfTurn = val;
  8911. if (val) {
  8912. xGame.common.d2World.d2Gan.ui.self.visible = true;
  8913. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  8914. }
  8915. else {
  8916. xGame.common.d2World.d2Gan.ui.self.visible = false;
  8917. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  8918. if (this.trunCount > 1)
  8919. PlatMgr.openBox();
  8920. }
  8921. }
  8922. resetGame() {
  8923. this.inHoleBalls = [];
  8924. this.isFirstInGame = true;
  8925. this.firstColliObj = null;
  8926. this.aiCamp = "";
  8927. this.selfCamp = "";
  8928. this.aiFoulNum = 0;
  8929. this.selfFoulNum = 0;
  8930. this.selfBallArr = [];
  8931. this.aiBallArr = [];
  8932. this.gamePause = false;
  8933. this.ensureBallType = false;
  8934. this.isInterrupt = false;
  8935. this.updateLeftBall();
  8936. this.clearTime();
  8937. this.aiPlayedBreakArmy = false;
  8938. this.isBlackInHole = false;
  8939. this.placeBallPosData = {};
  8940. if (xGame.common.d3World.knifeRoot) {
  8941. xGame.common.d3World.knifeRoot.destroyChildren();
  8942. }
  8943. }
  8944. gameReady() {
  8945. this.trunCount = 0;
  8946. this.firstColliObj = null;
  8947. this.isFirstInGame = true;
  8948. this.selfTurn = Math.random() <= this.selfTurnRate;
  8949. let challengeNum = DataMgr.getChallengeTimes();
  8950. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8951. this.selfTurn = true;
  8952. }
  8953. if (xGame.common.gameMode == GameMode.placeBall)
  8954. this.selfTurn = true;
  8955. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  8956. this.selfTurn = true;
  8957. }
  8958. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  8959. this.checkGuide();
  8960. if (xGame.common.uiRodMethod)
  8961. xGame.common.uiRodMethod.resetRod();
  8962. xGame.common.d2World.getHelpLine();
  8963. this.isOpenBall = true;
  8964. this.isTouchedBall = false;
  8965. xGame.common.aiPlayer.stopRun();
  8966. this.setTime = 30;
  8967. let ui = xGame.common.gameUI.ui;
  8968. switch (xGame.common.gameMode) {
  8969. case GameMode.classic:
  8970. xGame.common.aiPlayer.init();
  8971. this.blackNum = 8;
  8972. this.placeRootBall();
  8973. this.peoplePlay(9, 10);
  8974. ui.wordsBtn.visible = true;
  8975. ui.aiWordsBtn.visible = true;
  8976. xGame.common.talkMgr.changeAIState(true);
  8977. DataMgr.gameData.gameCount++;
  8978. DataMgr.saveGameData();
  8979. break;
  8980. case GameMode.bigMove:
  8981. this.blackNum = -1;
  8982. this.selfScore = 0;
  8983. this.aiScore = 0;
  8984. xGame.common.aiPlayer.init();
  8985. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  8986. this.updateSelfScore();
  8987. this.updateAIScore();
  8988. this.updateTargetSroce();
  8989. this.placeRootBall();
  8990. this.peoplePlay(9, 10);
  8991. ui.wordsBtn.visible = true;
  8992. ui.aiWordsBtn.visible = true;
  8993. xGame.common.talkMgr.changeAIState(true);
  8994. if (DataMgr.getSkillGuide() < 1)
  8995. DataMgr.gameData.gameCount = 0;
  8996. else {
  8997. DataMgr.gameData.gameCount++;
  8998. DataMgr.saveGameData();
  8999. PlatMgr.openTry();
  9000. }
  9001. if (xGame.common.d3World.knifeRoot) {
  9002. xGame.common.d3World.knifeRoot.destroyChildren();
  9003. }
  9004. break;
  9005. case GameMode.placeBall:
  9006. this.blackNum = -1;
  9007. this.selfTurn = true;
  9008. this.setTime = 10000;
  9009. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9010. this.curHP = this.placeBallData.hp;
  9011. if (this.placeBallData.ball == -1)
  9012. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9013. else
  9014. this.needBalls = this.placeBallData.ball;
  9015. console.log("需要的进球数目", this.needBalls);
  9016. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9017. this.finishBalls = 0;
  9018. this.placeBallPosData = {};
  9019. this.updatePlaceBallPos();
  9020. this.updatePlaceBallState();
  9021. this.finishOneShoot = true;
  9022. xGame.common.gameUI.ui.moveNode.visible = false;
  9023. this.isOpenBall = false;
  9024. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9025. ui.wordsBtn.visible = false;
  9026. ui.aiWordsBtn.visible = false;
  9027. xGame.common.talkMgr.changeAIState(false);
  9028. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9029. PlatMgr.openBox();
  9030. });
  9031. break;
  9032. default:
  9033. break;
  9034. }
  9035. this.showLongView = false;
  9036. xGame.common.wordsMgr.comboTimes = 1;
  9037. let guide = DataMgr.getSkillGuide();
  9038. if (guide)
  9039. xGame.eventMgr.event(WAIT_SHOOT);
  9040. xGame.common.upSkillLevel = false;
  9041. xGame.common.gameStartTime = new Date().getTime();
  9042. this.firstShoot = true;
  9043. }
  9044. checkGuide() {
  9045. let guide = DataMgr.getSkillGuide();
  9046. let gameUI = xGame.common.gameUI.ui;
  9047. gameUI.guide1.visible = false;
  9048. gameUI.guide2.visible = false;
  9049. gameUI.guide3.visible = false;
  9050. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9051. this.selfTurn = true;
  9052. }
  9053. else {
  9054. return;
  9055. }
  9056. let oneBall = this.getOneBall();
  9057. gameUI.guide1.visible = true;
  9058. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9059. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9060. }
  9061. getOneBall() {
  9062. let arr = xGame.common.d2World.ballArr;
  9063. for (let index = 0; index < arr.length; index++) {
  9064. if (arr[index].number == 0)
  9065. continue;
  9066. return arr[index];
  9067. }
  9068. }
  9069. updateSelfScore() {
  9070. let ui = xGame.common.gameUI.ui.topNode;
  9071. ui.selfScoreTxt.text = this.selfScore + "";
  9072. }
  9073. updateAIScore() {
  9074. let ui = xGame.common.gameUI.ui.topNode;
  9075. ui.aiScoreTxt.text = this.aiScore + "";
  9076. }
  9077. updateTargetSroce() {
  9078. let ui = xGame.common.gameUI.ui.topNode;
  9079. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9080. }
  9081. updateLeftBall() {
  9082. let topUI = xGame.common.gameUI.ui.topNode;
  9083. topUI.selfBallList.numItems = this.selfBallArr.length;
  9084. topUI.aiBallList.numItems = this.aiBallArr.length;
  9085. }
  9086. ballShoot() {
  9087. this.clearTime();
  9088. this.finishOneShoot = false;
  9089. xGame.common.gameUI.ui.moveNode.visible = false;
  9090. if (xGame.common.gameUI.ui.guideNode.visible) {
  9091. xGame.common.gameUI.ui.guideNode.visible = false;
  9092. }
  9093. if (this.firstShoot) {
  9094. this.firstShoot = false;
  9095. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9096. }
  9097. }
  9098. ensureCamp(number) {
  9099. this.ensureBallType = true;
  9100. this.isOpenBall = false;
  9101. if (xGame.common.gameMode != GameMode.classic)
  9102. return;
  9103. let full = [1, 2, 3, 4, 5, 6, 7];
  9104. let flower = [9, 10, 11, 12, 13, 14, 15];
  9105. let sayWords = "";
  9106. if (this.selfTurn) {
  9107. if (number <= 7) {
  9108. this.selfCamp = ballCamp.full;
  9109. this.selfBallArr = full;
  9110. this.aiCamp = ballCamp.flower;
  9111. this.aiBallArr = flower;
  9112. sayWords = cfgTable.wordsData[3].msg;
  9113. }
  9114. else {
  9115. this.selfCamp = ballCamp.flower;
  9116. this.selfBallArr = flower;
  9117. this.aiCamp = ballCamp.full;
  9118. this.aiBallArr = full;
  9119. sayWords = cfgTable.wordsData[4].msg;
  9120. }
  9121. }
  9122. else {
  9123. if (number <= 7) {
  9124. this.selfCamp = ballCamp.flower;
  9125. this.selfBallArr = flower;
  9126. this.aiCamp = ballCamp.full;
  9127. this.aiBallArr = full;
  9128. sayWords = cfgTable.wordsData[2].msg;
  9129. }
  9130. else {
  9131. this.selfCamp = ballCamp.full;
  9132. this.selfBallArr = full;
  9133. this.aiCamp = ballCamp.flower;
  9134. this.aiBallArr = flower;
  9135. sayWords = cfgTable.wordsData[1].msg;
  9136. }
  9137. }
  9138. this.updateLeftBall();
  9139. xGame.uiMgr.Show(UIMsg, sayWords);
  9140. }
  9141. updatePlaceBallState() {
  9142. let ui = xGame.common.gameUI.ui;
  9143. switch (this.placeBallData.type) {
  9144. case PlaceBallType.normal:
  9145. let normal = ui.placeNormalNode;
  9146. normal.hpTxt.text = this.curHP + "";
  9147. this.updatePlaceBallStar(normal);
  9148. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9149. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9150. break;
  9151. case PlaceBallType.challenge:
  9152. let challenge = ui.placeChallengeNode;
  9153. challenge.hpTxt.text = "Shots:" + this.curHP;
  9154. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9155. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9156. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9157. break;
  9158. default:
  9159. break;
  9160. }
  9161. }
  9162. playSubHpAni() {
  9163. let ui = xGame.common.gameUI.ui;
  9164. switch (this.placeBallData.type) {
  9165. case PlaceBallType.normal:
  9166. let normal = ui.placeNormalNode;
  9167. normal.hpTxt.visible = false;
  9168. normal.starAni.c1.selectedIndex = 1;
  9169. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9170. normal.hpTxt.visible = true;
  9171. normal.starAni.c1.selectedIndex = 0;
  9172. }));
  9173. break;
  9174. default:
  9175. break;
  9176. }
  9177. }
  9178. getEndStarNum() {
  9179. let num;
  9180. let level = xGame.common.placeBallCurLevel;
  9181. if (this.curHP == this.placeBallData.hp) {
  9182. num = 3;
  9183. }
  9184. else if (this.curHP <= 1) {
  9185. num = 1;
  9186. }
  9187. else {
  9188. num = 2;
  9189. }
  9190. if (!this.success) {
  9191. num = 0;
  9192. }
  9193. else {
  9194. DataMgr.setPlaceBallLevel(level, num);
  9195. }
  9196. let myType = cfgTable.placeballData[level].type;
  9197. if (this.success && myType == 1) {
  9198. num = 3;
  9199. }
  9200. xGame.common.placeBallStarNum = num;
  9201. }
  9202. updatePlaceBallStar(node) {
  9203. let star = 0;
  9204. if (this.curHP == this.placeBallData.hp) {
  9205. star = 3;
  9206. }
  9207. else if (this.curHP >= 2) {
  9208. star = 2;
  9209. }
  9210. else if (this.curHP == 1) {
  9211. star = 1;
  9212. }
  9213. else {
  9214. star = 0;
  9215. }
  9216. let temp;
  9217. for (let index = 1; index <= 3; index++) {
  9218. temp = node["star" + index];
  9219. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9220. }
  9221. node.myProgress.value = (star / 3) * 100;
  9222. }
  9223. openRegretView(isFoul, GoalNum, challenge = false) {
  9224. let regretType = -1;
  9225. if (isFoul) {
  9226. regretType = 1;
  9227. }
  9228. else {
  9229. if (GoalNum <= 0) {
  9230. regretType = 0;
  9231. }
  9232. }
  9233. if (challenge) {
  9234. regretType = 1;
  9235. }
  9236. if (regretType != -1) {
  9237. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9238. if (success) {
  9239. this.curHP++;
  9240. this.updatePlaceBallState();
  9241. this.setPlaceBallAllPos();
  9242. xGame.common.gameUI.ui.moveNode.visible = false;
  9243. }
  9244. else {
  9245. if (this.curHP <= 0) {
  9246. this.success = false;
  9247. this.gameEnd();
  9248. }
  9249. this.playSubHpAni();
  9250. }
  9251. this.updatePlaceBallState();
  9252. this.updatePlaceBallPos();
  9253. });
  9254. }
  9255. }
  9256. setPlaceBallAllPos() {
  9257. let allBall = xGame.common.d2World.ballArr;
  9258. let cfgArr = this.placeBallPosData;
  9259. let temp;
  9260. let obj;
  9261. for (let index = 0; index < allBall.length; index++) {
  9262. temp = allBall[index];
  9263. if (temp.destroyed)
  9264. continue;
  9265. obj = cfgArr[temp.myUNID];
  9266. if (obj && obj.src && !obj.src.destroyed) {
  9267. temp.gameObj.x = obj.posX;
  9268. temp.gameObj.y = obj.posY;
  9269. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9270. }
  9271. }
  9272. xGame.common.d2World.getHelpLine();
  9273. }
  9274. updatePlaceBallPos() {
  9275. let arr = xGame.common.d2World.ballArr;
  9276. let temp;
  9277. for (let index = 0; index < arr.length; index++) {
  9278. temp = arr[index];
  9279. if (!this.placeBallPosData[temp.myUNID]) {
  9280. this.placeBallPosData[temp.myUNID] = {
  9281. src: temp,
  9282. posX: temp.gameObj.x,
  9283. posY: temp.gameObj.y
  9284. };
  9285. }
  9286. else {
  9287. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9288. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9289. }
  9290. }
  9291. let check;
  9292. for (const key in this.placeBallPosData) {
  9293. check = this.placeBallPosData[key];
  9294. if (check.src.destroyed) {
  9295. delete this.placeBallPosData[key];
  9296. }
  9297. }
  9298. }
  9299. gameRun(type) {
  9300. if (this.gamePause)
  9301. return;
  9302. this.curFoul = this.getFoulType();
  9303. if (type) {
  9304. xGame.common.d2World.d2Gan.shoot();
  9305. xGame.common.gameUI.forceCancel();
  9306. this.curFoul = type;
  9307. }
  9308. this.isEnd = false;
  9309. this.isChangeTurn = true;
  9310. if (xGame.common.gameMode == GameMode.classic) {
  9311. this.judgeClassic(this.curFoul);
  9312. this.checkClassicWords(() => {
  9313. xGame.common.destroyClassicEmotion();
  9314. if (this.isEnd) {
  9315. if (this.isBlackInHole) {
  9316. xGame.common.gameUI.ui.blackAni.visible = true;
  9317. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9318. xGame.common.gameUI.ui.blackAni.visible = false;
  9319. this.gameEnd();
  9320. }));
  9321. }
  9322. else {
  9323. this.gameEnd();
  9324. }
  9325. }
  9326. else {
  9327. this.waitShoot();
  9328. xGame.eventMgr.event(WAIT_SHOOT);
  9329. }
  9330. });
  9331. }
  9332. else if (xGame.common.gameMode == GameMode.bigMove) {
  9333. xGame.common.aiPlayer.stopRun();
  9334. let scoreArr = this.getScore(this.curFoul);
  9335. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9336. this.isEnd = true;
  9337. }
  9338. this.checkBigSkillWords(() => {
  9339. if (this.isEnd) {
  9340. this.gameEnd();
  9341. }
  9342. else {
  9343. this.waitShoot();
  9344. xGame.eventMgr.event(WAIT_SHOOT);
  9345. }
  9346. });
  9347. }
  9348. else if (xGame.common.gameMode == GameMode.placeBall) {
  9349. xGame.common.destroyAwardSpine();
  9350. let isFoul = this.curFoul == FoulType.rootHole;
  9351. let GoalNum = this.inHoleBalls.length;
  9352. if (this.inHoleBalls.indexOf(0) > -1)
  9353. GoalNum -= 1;
  9354. if (isFoul) {
  9355. this.placeRootBall();
  9356. }
  9357. console.log("neeballs", this.needBalls);
  9358. console.log("当前完成的goalNum", GoalNum);
  9359. this.finishBalls += GoalNum;
  9360. console.log("当前完成的finishballs", this.finishBalls);
  9361. let need = this.needBalls;
  9362. if (this.placeBallData.type == PlaceBallType.challenge) {
  9363. need += 100;
  9364. }
  9365. if (this.finishBalls >= need) {
  9366. this.success = true;
  9367. this.gameEnd();
  9368. }
  9369. else {
  9370. switch (this.placeBallData.type) {
  9371. case PlaceBallType.normal:
  9372. if (!isFoul && GoalNum > 0) {
  9373. this.updatePlaceBallPos();
  9374. this.updatePlaceBallState();
  9375. }
  9376. else {
  9377. this.curHP--;
  9378. this.openRegretView(isFoul, GoalNum);
  9379. }
  9380. this.waitShoot();
  9381. xGame.eventMgr.event(WAIT_SHOOT);
  9382. break;
  9383. case PlaceBallType.challenge:
  9384. this.curHP--;
  9385. this.updatePlaceBallState();
  9386. if (isFoul) {
  9387. this.openRegretView(isFoul, GoalNum, true);
  9388. }
  9389. else {
  9390. this.updatePlaceBallPos();
  9391. if (this.curHP <= 0) {
  9392. this.success = true;
  9393. this.gameEnd();
  9394. }
  9395. }
  9396. this.waitShoot();
  9397. xGame.eventMgr.event(WAIT_SHOOT);
  9398. break;
  9399. default:
  9400. break;
  9401. }
  9402. }
  9403. }
  9404. }
  9405. checkClassicWords(callback) {
  9406. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9407. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9408. let type = this.getClassicWordsType();
  9409. if (condition && type != -1) {
  9410. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9411. xGame.soundMgr.playSound(str);
  9412. xGame.common.wordsMgr.playClassicWords(type, callback);
  9413. }
  9414. else {
  9415. Laya.timer.once(300, this, () => {
  9416. callback && callback();
  9417. });
  9418. }
  9419. }
  9420. getClassicWordsType() {
  9421. let d2world = xGame.common.d2World;
  9422. let type = -1;
  9423. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9424. type = ClassicWordsType.perfectShow;
  9425. return type;
  9426. }
  9427. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9428. type = ClassicWordsType.directShoot;
  9429. return type;
  9430. }
  9431. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9432. type = ClassicWordsType.anotherShoot;
  9433. return type;
  9434. }
  9435. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9436. type = ClassicWordsType.bigPower;
  9437. return type;
  9438. }
  9439. let minSpeed = 1;
  9440. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9441. type = ClassicWordsType.hardShoot;
  9442. return type;
  9443. }
  9444. if (this.inHoleBalls.length > 0) {
  9445. type = ClassicWordsType.directShoot;
  9446. return type;
  9447. }
  9448. return type;
  9449. }
  9450. checkBigSkillWords(callback) {
  9451. if (this.curFoul == FoulType.timeOut) {
  9452. callback && callback();
  9453. }
  9454. else {
  9455. let playSkill = false;
  9456. if (this.selfTurn) {
  9457. playSkill = true;
  9458. }
  9459. else {
  9460. if (!this.aiPlayedBreakArmy) {
  9461. this.aiPlayedBreakArmy = true;
  9462. playSkill = true;
  9463. }
  9464. if (this.aiCurSkill != SkillType.breakArmy) {
  9465. playSkill = true;
  9466. }
  9467. }
  9468. if (xGame.common.skillMgr.playedLastSkill) {
  9469. xGame.common.skillMgr.playedLastSkill = false;
  9470. playSkill = false;
  9471. }
  9472. if (playSkill) {
  9473. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9474. let selfExtra = 0;
  9475. let aiExtra = 0;
  9476. if (this.selfTurn)
  9477. selfExtra += extraScore;
  9478. else
  9479. aiExtra += extraScore;
  9480. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9481. this.isEnd = true;
  9482. }
  9483. this.playBigSkillTimes(callback);
  9484. });
  9485. }
  9486. else {
  9487. this.playBigSkillTimes(callback);
  9488. }
  9489. }
  9490. }
  9491. playBigSkillTimes(callback) {
  9492. let length = this.inHoleBalls.length;
  9493. if (this.inHoleBalls.indexOf(0) > -1) {
  9494. length = this.inHoleBalls.length - 1;
  9495. }
  9496. if (length <= 0) {
  9497. callback && callback();
  9498. return;
  9499. }
  9500. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9501. callback && callback();
  9502. });
  9503. }
  9504. playSkillTips() {
  9505. let levelNum = 0;
  9506. let curType;
  9507. if (this.selfTurn) {
  9508. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9509. curType = this.selfCurSkill;
  9510. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9511. levelNum += 5;
  9512. }
  9513. }
  9514. else {
  9515. levelNum = this.aiSkillLevelNum;
  9516. curType = this.aiCurSkill;
  9517. }
  9518. let str = ``;
  9519. switch (curType) {
  9520. case SkillType.highSpace:
  9521. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9522. break;
  9523. case SkillType.breakArmy:
  9524. str = `You pocketed ${levelNum} extra balls`;
  9525. break;
  9526. case SkillType.ice:
  9527. str = `${levelNum * 2} extra balls were frozen`;
  9528. break;
  9529. case SkillType.fireworks:
  9530. str = `${levelNum} extra balls exploded `;
  9531. break;
  9532. case SkillType.GuanYu:
  9533. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9534. break;
  9535. default:
  9536. break;
  9537. }
  9538. xGame.uiMgr.Show(UIMsg, str);
  9539. }
  9540. getFoulType() {
  9541. let foulType = "";
  9542. if (this.firstColliObj == null) {
  9543. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9544. return FoulType.rootHole;
  9545. }
  9546. return FoulType.notTouch;
  9547. }
  9548. else {
  9549. if (this.selfTurn) {
  9550. if (this.selfBallArr.length > 0) {
  9551. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9552. foulType = FoulType.wrongTouch;
  9553. }
  9554. }
  9555. else {
  9556. if (this.ensureBallType) {
  9557. }
  9558. else {
  9559. if (this.firstColliObj == this.blackNum) {
  9560. foulType = FoulType.wrongTouch;
  9561. }
  9562. }
  9563. }
  9564. }
  9565. else {
  9566. if (this.aiBallArr.length > 0) {
  9567. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9568. foulType = FoulType.wrongTouch;
  9569. }
  9570. }
  9571. else {
  9572. if (this.ensureBallType) {
  9573. }
  9574. else {
  9575. if (this.firstColliObj == this.blackNum) {
  9576. foulType = FoulType.wrongTouch;
  9577. }
  9578. }
  9579. }
  9580. }
  9581. if (this.inHoleBalls.length <= 0) {
  9582. return foulType;
  9583. }
  9584. let temp;
  9585. if (this.inHoleBalls.indexOf(0) > -1) {
  9586. foulType = FoulType.rootHole;
  9587. }
  9588. else {
  9589. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9590. temp = this.inHoleBalls[index];
  9591. if (this.selfTurn) {
  9592. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9593. foulType = FoulType.wrongHole;
  9594. break;
  9595. }
  9596. }
  9597. else {
  9598. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9599. foulType = FoulType.wrongHole;
  9600. break;
  9601. }
  9602. }
  9603. }
  9604. }
  9605. let foo;
  9606. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9607. temp = this.inHoleBalls[index];
  9608. foo = this.selfBallArr.indexOf(temp);
  9609. if (foo > -1) {
  9610. this.selfBallArr.splice(foo, 1);
  9611. }
  9612. foo = this.aiBallArr.indexOf(temp);
  9613. if (foo > -1) {
  9614. this.aiBallArr.splice(foo, 1);
  9615. }
  9616. }
  9617. this.updateLeftBall();
  9618. }
  9619. return foulType;
  9620. }
  9621. judgeGameEndByBlack(arr) {
  9622. if (this.selfTurn) {
  9623. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9624. this.selfFoulNum = this.maxFoulTimes;
  9625. return true;
  9626. }
  9627. }
  9628. else {
  9629. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9630. this.aiFoulNum = this.maxFoulTimes;
  9631. return true;
  9632. }
  9633. }
  9634. }
  9635. judgeClassic(type) {
  9636. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9637. xGame.common.aiPlayer.stopRun();
  9638. if (this.judgeNormalSuccess()) {
  9639. this.isEnd = true;
  9640. return;
  9641. }
  9642. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9643. if (this.selfTurn) {
  9644. if (isFoul) {
  9645. this.selfFoulNum++;
  9646. }
  9647. if (this.selfFoulNum >= this.maxFoulTimes) {
  9648. this.success = false;
  9649. this.isEnd = true;
  9650. return;
  9651. }
  9652. }
  9653. else {
  9654. if (isFoul)
  9655. this.aiFoulNum++;
  9656. if (this.aiFoulNum >= this.maxFoulTimes) {
  9657. this.success = true;
  9658. this.isEnd = true;
  9659. return;
  9660. }
  9661. }
  9662. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9663. this.isChangeTurn = false;
  9664. }
  9665. else {
  9666. this.isInterrupt = true;
  9667. }
  9668. }
  9669. waitShoot() {
  9670. if (xGame.common.gameMode == GameMode.classic) {
  9671. switch (this.curFoul) {
  9672. case FoulType.timeOut:
  9673. case FoulType.rootHole:
  9674. this.selfTurn = !this.selfTurn;
  9675. this.peoplePlay(5, 6, true);
  9676. break;
  9677. case FoulType.notTouch:
  9678. this.selfTurn = !this.selfTurn;
  9679. this.peoplePlay(7, 7);
  9680. break;
  9681. case FoulType.wrongHole:
  9682. this.selfTurn = !this.selfTurn;
  9683. this.peoplePlay(11, 11);
  9684. break;
  9685. default:
  9686. if (this.inHoleBalls.length > 0) {
  9687. this.peoplePlay(0, 0, false, false);
  9688. }
  9689. else {
  9690. this.selfTurn = !this.selfTurn;
  9691. this.peoplePlay(7, 7);
  9692. }
  9693. break;
  9694. }
  9695. }
  9696. else if (xGame.common.gameMode == GameMode.bigMove) {
  9697. if (this.curFoul == FoulType.timeOut) {
  9698. this.selfTurn = !this.selfTurn;
  9699. this.peoplePlay(14, 15);
  9700. this.placeRootBall();
  9701. }
  9702. else {
  9703. this.selfTurn = !this.selfTurn;
  9704. if (this.curFoul == FoulType.rootHole) {
  9705. this.peoplePlay(12, 13);
  9706. this.placeRootBall();
  9707. }
  9708. else {
  9709. this.peoplePlay(0, 0, false, false);
  9710. }
  9711. }
  9712. }
  9713. else if (xGame.common.gameMode == GameMode.placeBall) {
  9714. this.finishOneShoot = true;
  9715. }
  9716. this.gameResult();
  9717. }
  9718. gameResult() {
  9719. this.firstColliObj = null;
  9720. this.inHoleBalls = [];
  9721. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9722. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9723. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9724. if (xGame.common.uiRodMethod)
  9725. xGame.common.uiRodMethod.resetRod();
  9726. xGame.common.d2World.rootBall.showSelf();
  9727. this.clearIceSkill();
  9728. if (this.selfTurn) {
  9729. PlatMgr.gameInsert();
  9730. }
  9731. xGame.common.d3World.knifeRoot.destroyChildren();
  9732. if (this.selfTurn) {
  9733. xGame.common.gameUI.showHelpLineGuide();
  9734. xGame.common.gameUI.setTurnAlpha(true);
  9735. }
  9736. else {
  9737. xGame.common.gameUI.setTurnAlpha(false);
  9738. }
  9739. }
  9740. getScore(type) {
  9741. let selfAdd = 0;
  9742. let aiAdd = 0;
  9743. if (type == FoulType.timeOut) {
  9744. if (this.selfTurn)
  9745. aiAdd += 3;
  9746. else
  9747. selfAdd += 3;
  9748. }
  9749. else {
  9750. if (this.inHoleBalls.length > 0) {
  9751. if (this.selfTurn) {
  9752. if (type == FoulType.rootHole) {
  9753. aiAdd += 3;
  9754. if (this.inHoleBalls.length - 1 > 0) {
  9755. selfAdd += this.inHoleBalls.length - 1;
  9756. }
  9757. }
  9758. else {
  9759. selfAdd += this.inHoleBalls.length;
  9760. }
  9761. }
  9762. else {
  9763. if (type == FoulType.rootHole) {
  9764. selfAdd += 3;
  9765. if (this.inHoleBalls.length - 1 > 0) {
  9766. aiAdd += this.inHoleBalls.length - 1;
  9767. }
  9768. }
  9769. else {
  9770. aiAdd += this.inHoleBalls.length;
  9771. }
  9772. }
  9773. }
  9774. }
  9775. return [selfAdd, aiAdd];
  9776. }
  9777. judgeScoreEnd(selfAdd, aiAdd) {
  9778. this.selfScore += selfAdd;
  9779. this.aiScore += aiAdd;
  9780. this.updateAIScore();
  9781. this.updateSelfScore();
  9782. if (this.selfScore >= this.targertScore) {
  9783. this.success = true;
  9784. return true;
  9785. }
  9786. if (this.aiScore >= this.targertScore) {
  9787. this.success = false;
  9788. return true;
  9789. }
  9790. let ballArr = xGame.common.d2World.ballArr;
  9791. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9792. if (this.selfScore > this.aiScore) {
  9793. this.success = true;
  9794. return true;
  9795. }
  9796. else if (this.selfScore < this.aiScore) {
  9797. this.success = false;
  9798. return true;
  9799. }
  9800. else {
  9801. if (this.selfTurn) {
  9802. this.success = false;
  9803. }
  9804. else {
  9805. this.success = true;
  9806. }
  9807. return true;
  9808. }
  9809. }
  9810. }
  9811. clearIceSkill() {
  9812. let arr = xGame.common.d2World.ballArr;
  9813. let temp;
  9814. if (this.selfTurn) {
  9815. if (this.selfCurSkill == SkillType.ice) {
  9816. for (let index = 0; index < arr.length; index++) {
  9817. temp = arr[index];
  9818. if (temp.ballFunc == "ice") {
  9819. temp.setBallFunc("normal", "self");
  9820. }
  9821. }
  9822. }
  9823. }
  9824. else {
  9825. if (this.aiCurSkill == SkillType.ice) {
  9826. for (let index = 0; index < arr.length; index++) {
  9827. temp = arr[index];
  9828. if (temp.ballFunc == "ice") {
  9829. temp.setBallFunc("normal", "ai");
  9830. }
  9831. }
  9832. }
  9833. }
  9834. }
  9835. judgeNormalSuccess() {
  9836. if (this.selfTurn) {
  9837. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9838. this.success = true;
  9839. return true;
  9840. }
  9841. }
  9842. else {
  9843. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9844. this.success = false;
  9845. return true;
  9846. }
  9847. }
  9848. }
  9849. gameEnd() {
  9850. if (Moyu.isTT) {
  9851. xGame.common.screenImg = getScreenImg();
  9852. }
  9853. console.log("游戏结束", this.success);
  9854. xGame.common.aiPlayer.stopRun();
  9855. if (xGame.common.gameMode == GameMode.placeBall) {
  9856. this.getEndStarNum();
  9857. this.updatePlaceBallState();
  9858. }
  9859. this.isEnter = false;
  9860. Moyu.recordEnd(this, () => {
  9861. if (this.isEnter)
  9862. return;
  9863. this.isEnter = true;
  9864. console.log("进入录结束回调");
  9865. this.enterNext();
  9866. });
  9867. Laya.timer.once(1000, this, () => {
  9868. if (this.isEnter)
  9869. return;
  9870. this.isEnter = true;
  9871. this.enterNext();
  9872. });
  9873. xGame.common.longHelpLine = false;
  9874. }
  9875. enterNext() {
  9876. Laya.timer.clearAll(this);
  9877. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9878. xGame.uiMgr.Show(UIVideoShare, this.success);
  9879. }
  9880. else {
  9881. xGame.uiMgr.Show(UIGameEnd, this.success);
  9882. }
  9883. }
  9884. aiLeave() {
  9885. let ui = xGame.common.gameUI.ui;
  9886. ui.topNode.aiNameTxt.text = "offline";
  9887. }
  9888. aiGameEnd(suc) {
  9889. this.success = suc;
  9890. xGame.common.aiPlayer.stopRun();
  9891. if (this.success) {
  9892. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  9893. Laya.timer.once(1000, this, () => {
  9894. this.clearTime();
  9895. this.gameEnd();
  9896. });
  9897. }
  9898. }
  9899. openTimer() {
  9900. let src = xGame.common.gameUI;
  9901. if (this.selfTurn) {
  9902. src.ui.topNode.selfProgress.visible = true;
  9903. src.ui.topNode.aiProgress.visible = false;
  9904. this.curTimer = src.ui.topNode.selfProgress;
  9905. }
  9906. else {
  9907. src.ui.topNode.selfProgress.visible = false;
  9908. src.ui.topNode.aiProgress.visible = true;
  9909. this.curTimer = src.ui.topNode.aiProgress;
  9910. }
  9911. this.accTime = 0;
  9912. Laya.timer.clearAll(this);
  9913. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  9914. this.curTimer.value = 100;
  9915. }
  9916. updateTime(dt) {
  9917. if (this.gamePause)
  9918. return;
  9919. this.accTime += dt;
  9920. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  9921. if (this.accTime >= this.setTime) {
  9922. this.clearTime();
  9923. console.log("时钟进入了gameRun");
  9924. this.gameRun(FoulType.timeOut);
  9925. }
  9926. }
  9927. clearTime() {
  9928. let src = xGame.common.gameUI;
  9929. src.ui.topNode.selfProgress.visible = false;
  9930. src.ui.topNode.aiProgress.visible = false;
  9931. Laya.timer.clearAll(this);
  9932. }
  9933. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  9934. let ui = xGame.common.gameUI.ui;
  9935. let selfMsg, aiMsg;
  9936. if (sayWords) {
  9937. selfMsg = cfgTable.wordsData[selfIndex].msg;
  9938. aiMsg = cfgTable.wordsData[aiIndex].msg;
  9939. if (Foul) {
  9940. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  9941. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  9942. this.placeRootBall();
  9943. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  9944. if (this.curFoul == FoulType.rootHole) {
  9945. if (!DataMgr.getRootBallFoul()) {
  9946. DataMgr.setRootBallFoul();
  9947. aiMsg = "";
  9948. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  9949. let woman = "Boss, pay attention next time~";
  9950. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9951. }
  9952. }
  9953. else if (this.curFoul == FoulType.timeOut) {
  9954. if (!DataMgr.getTimeoutFoul()) {
  9955. DataMgr.setTimeoutFoul();
  9956. aiMsg = "";
  9957. let tips = "Game timeout, 3 fouls, this game failed.";
  9958. let woman = "Boss, pay attention to the timeline~";
  9959. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  9960. }
  9961. }
  9962. }
  9963. }
  9964. }
  9965. if (this.selfTurn) {
  9966. if (sayWords) {
  9967. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  9968. ui.selfTurn.visible = true;
  9969. ui.aiTurn.visible = false;
  9970. ui.selfTurn.t0.play();
  9971. Moyu.vibration();
  9972. });
  9973. }
  9974. }
  9975. else {
  9976. let aiNum = xGame.tools.random(1, 11);
  9977. let challengeNum = DataMgr.getChallengeTimes();
  9978. let delay = false;
  9979. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9980. aiNum = 9;
  9981. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  9982. aiNum = 3;
  9983. if (challengeNum == 3) {
  9984. if (!this.showLongView) {
  9985. this.showLongView = true;
  9986. delay = true;
  9987. }
  9988. }
  9989. }
  9990. }
  9991. if (delay) {
  9992. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  9993. if (success) {
  9994. xGame.common.longHelpLine = true;
  9995. xGame.common.d2World.getHelpLine();
  9996. }
  9997. else {
  9998. aiNum = 10;
  9999. }
  10000. xGame.common.aiPlayer.setAiLevel(aiNum);
  10001. if (sayWords) {
  10002. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10003. xGame.common.aiPlayer.runAI();
  10004. ui.selfTurn.visible = false;
  10005. ui.aiTurn.visible = true;
  10006. ui.aiTurn.t0.play();
  10007. });
  10008. }
  10009. else {
  10010. xGame.common.aiPlayer.runAI();
  10011. }
  10012. this.openTimer();
  10013. this.finishOneShoot = true;
  10014. if (this.selfTurn) {
  10015. ui.topNode.selfKuang.visible = true;
  10016. ui.topNode.aiKuang.visible = false;
  10017. ui.topNode.selfTips.visible = true;
  10018. ui.topNode.aiTips.visible = false;
  10019. }
  10020. else {
  10021. ui.topNode.selfKuang.visible = false;
  10022. ui.topNode.aiKuang.visible = true;
  10023. ui.topNode.selfTips.visible = false;
  10024. ui.topNode.aiTips.visible = true;
  10025. }
  10026. });
  10027. return;
  10028. }
  10029. if (xGame.common.gameMode == GameMode.classic) {
  10030. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10031. if (cfg) {
  10032. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10033. aiNum = aiLevel;
  10034. }
  10035. }
  10036. xGame.common.aiPlayer.setAiLevel(aiNum);
  10037. if (sayWords) {
  10038. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10039. xGame.common.aiPlayer.runAI();
  10040. ui.selfTurn.visible = false;
  10041. ui.aiTurn.visible = true;
  10042. ui.aiTurn.t0.play();
  10043. });
  10044. }
  10045. else {
  10046. xGame.common.aiPlayer.runAI();
  10047. }
  10048. }
  10049. this.openTimer();
  10050. this.finishOneShoot = true;
  10051. if (this.selfTurn) {
  10052. ui.topNode.selfKuang.visible = true;
  10053. ui.topNode.aiKuang.visible = false;
  10054. ui.topNode.selfTips.visible = true;
  10055. ui.topNode.aiTips.visible = false;
  10056. }
  10057. else {
  10058. ui.topNode.selfKuang.visible = false;
  10059. ui.topNode.aiKuang.visible = true;
  10060. ui.topNode.selfTips.visible = false;
  10061. ui.topNode.aiTips.visible = true;
  10062. }
  10063. }
  10064. placeRootBall() {
  10065. let rootBall = xGame.common.d2World.rootBall;
  10066. if (!rootBall)
  10067. return;
  10068. rootBall.gameObj.x = this.lastRootBallPos.x;
  10069. rootBall.gameObj.y = this.lastRootBallPos.y;
  10070. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10071. let moveNode = xGame.common.gameUI.ui.moveNode;
  10072. moveNode.visible = true;
  10073. moveNode.x = this.lastRootBallPos.x;
  10074. moveNode.y = this.lastRootBallPos.y;
  10075. if (!this.selfTurn) {
  10076. xGame.common.aiPlayer.resetRoot();
  10077. }
  10078. }
  10079. }
  10080. class ui_guanyuAni extends fgui.GComponent {
  10081. static createInstance() {
  10082. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10083. }
  10084. onConstruct() {
  10085. this.n0 = (this.getChild("n0"));
  10086. }
  10087. }
  10088. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10089. class UIFireworks extends UIBase {
  10090. constructor() {
  10091. super();
  10092. }
  10093. onConstructor() {
  10094. this.isEject = false;
  10095. }
  10096. show(callback) {
  10097. super.show();
  10098. }
  10099. }
  10100. UIFireworks.uiName = "UIFireworks";
  10101. class ui_UIGuanYu extends fgui.GComponent {
  10102. static createInstance() {
  10103. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10104. }
  10105. onConstruct() {
  10106. this.n2 = (this.getChild("n2"));
  10107. this.n1 = (this.getChild("n1"));
  10108. this.n3 = (this.getChild("n3"));
  10109. this.n4 = (this.getChild("n4"));
  10110. this.n5 = (this.getChild("n5"));
  10111. this.n6 = (this.getChild("n6"));
  10112. this.n8 = (this.getChild("n8"));
  10113. this.n7 = (this.getChild("n7"));
  10114. this.t0 = this.getTransition("t0");
  10115. }
  10116. }
  10117. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10118. class UIGuanYu extends UIBase {
  10119. constructor() {
  10120. super();
  10121. }
  10122. onConstructor() {
  10123. this.ui = ui_UIGuanYu.createInstance();
  10124. this.contentPane = this.ui;
  10125. this.isEject = false;
  10126. }
  10127. show(callback) {
  10128. super.show();
  10129. this.ui.t0.play(Laya.Handler.create(this, () => {
  10130. callback && callback();
  10131. this.hide();
  10132. }));
  10133. this.setGlobalFont(this.ui);
  10134. }
  10135. }
  10136. UIGuanYu.uiName = "UIGuanYu";
  10137. class SkillMgr {
  10138. constructor() {
  10139. this.leveNum = 0;
  10140. this.extraScore = 0;
  10141. this.selfTurn = false;
  10142. this.playedLastSkill = false;
  10143. this.tweenArr = [];
  10144. this._finishNum = 0;
  10145. this._curFinish = 0;
  10146. this._rootX = 0;
  10147. this._rootY = 0;
  10148. this.knifeTimes = 0;
  10149. this.knifeV2 = new Laya.Vector2();
  10150. this.knifeV3 = new Laya.Vector3();
  10151. this.rtStarX = 0;
  10152. this.rtStarY = 0;
  10153. this.addBigSkillSpine();
  10154. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10155. }
  10156. addBigSkillSpine() {
  10157. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10158. console.log("extra2 success");
  10159. });
  10160. }
  10161. runBigSkill(callback) {
  10162. this.tweenArr = [];
  10163. this.callback = callback;
  10164. this.judgeSkill();
  10165. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10166. let guide = DataMgr.getSkillGuide();
  10167. if (!xGame.common.gameMgr.selfTurn) {
  10168. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10169. }
  10170. else {
  10171. if (xGame.common.temSelfLevel != 0) {
  10172. this.leveNum = xGame.common.temSelfLevel;
  10173. }
  10174. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10175. this.leveNum += 5;
  10176. }
  10177. }
  10178. if (guide == 0) {
  10179. DataMgr.setSkillGuide(1);
  10180. if (DataMgr.getNewUser()) {
  10181. Moyu.sendDataEvent("gameFirstPlay");
  10182. DataMgr.setNewUser();
  10183. }
  10184. }
  10185. this.playSpineAni(() => {
  10186. switch (this.curSkill) {
  10187. case SkillType.highSpace:
  10188. this.runHighSpace();
  10189. break;
  10190. case SkillType.breakArmy:
  10191. this.runBreakArmy();
  10192. break;
  10193. case SkillType.ice:
  10194. this.runIce();
  10195. break;
  10196. case SkillType.fireworks:
  10197. this.runFireworks();
  10198. break;
  10199. case SkillType.GuanYu:
  10200. this.runGuanYu();
  10201. break;
  10202. default:
  10203. break;
  10204. }
  10205. });
  10206. }
  10207. judgeSkill() {
  10208. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10209. let gameMgr = xGame.common.gameMgr;
  10210. let type;
  10211. for (let index = 0; index < typeArr.length; index++) {
  10212. type = typeArr[index];
  10213. if (gameMgr.selfTurn) {
  10214. if (gameMgr.selfCurSkill == type) {
  10215. this.selfTurn = true;
  10216. this.curSkill = type;
  10217. return;
  10218. }
  10219. }
  10220. else {
  10221. if (gameMgr.aiCurSkill == type) {
  10222. this.selfTurn = false;
  10223. this.curSkill = type;
  10224. return;
  10225. }
  10226. }
  10227. }
  10228. }
  10229. playSpineAni(callback) {
  10230. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10231. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10232. parent.destroyChildren();
  10233. let aniIndex = 0;
  10234. let skillSpine;
  10235. switch (this.curSkill) {
  10236. case SkillType.highSpace:
  10237. aniIndex = 1;
  10238. xGame.soundMgr.playSound("skill01");
  10239. skillSpine = this.skillSpine2;
  10240. data.scaleX = 0.5;
  10241. data.scaleY = 0.5;
  10242. skillSpine.play(data, 1, false, parent, () => {
  10243. callback && callback();
  10244. });
  10245. break;
  10246. case SkillType.breakArmy:
  10247. aniIndex = 2;
  10248. xGame.soundMgr.playSound("skill02");
  10249. skillSpine = this.skillSpine2;
  10250. data.scaleX = 0.5;
  10251. data.scaleY = 0.5;
  10252. skillSpine.play(data, 2, false, parent, () => {
  10253. callback && callback();
  10254. });
  10255. break;
  10256. case SkillType.ice:
  10257. aniIndex = 0;
  10258. xGame.soundMgr.playSound("skill03");
  10259. skillSpine = this.skillSpine2;
  10260. data.scaleX = 0.5;
  10261. data.scaleY = 0.5;
  10262. skillSpine.play(data, 0, false, parent, () => {
  10263. callback && callback();
  10264. });
  10265. break;
  10266. case SkillType.fireworks:
  10267. xGame.soundMgr.playSound("skill_04_01");
  10268. xGame.soundMgr.playSound("skill04");
  10269. xGame.uiMgr.Show(UIFireworks, callback);
  10270. break;
  10271. case SkillType.GuanYu:
  10272. xGame.soundMgr.playSound("skill05_1");
  10273. xGame.soundMgr.playSound("skill05");
  10274. xGame.uiMgr.Show(UIGuanYu, callback);
  10275. break;
  10276. default:
  10277. break;
  10278. }
  10279. }
  10280. getAllBallArr() {
  10281. let arr = xGame.common.d2World.ballArr;
  10282. let outArr = [];
  10283. for (let index = 0; index < arr.length; index++) {
  10284. if (arr[index] instanceof D2RootBallSrc)
  10285. continue;
  10286. if (arr[index].ballFunc == "ice")
  10287. continue;
  10288. if (arr[index].destroyed)
  10289. continue;
  10290. outArr.push(arr[index]);
  10291. }
  10292. return outArr;
  10293. }
  10294. getOneArr(deletObj) {
  10295. let allArr = this.getAllBallArr();
  10296. let temp;
  10297. for (let index = 0; index < allArr.length; index++) {
  10298. temp = allArr[index];
  10299. if (temp.id == deletObj.id) {
  10300. allArr.splice(index, 1);
  10301. break;
  10302. }
  10303. }
  10304. return allArr;
  10305. }
  10306. getNearBallBag(ball) {
  10307. let ui = xGame.common.gameUI.ui;
  10308. let circleArr = [];
  10309. for (let index = 1; index <= 6; index++) {
  10310. circleArr.push(ui.border["circle" + index]);
  10311. }
  10312. let outIndex = 0;
  10313. let temp;
  10314. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10315. ;
  10316. let dis = 0;
  10317. for (let index = 1; index < circleArr.length; index++) {
  10318. temp = circleArr[index];
  10319. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10320. if (dis < min) {
  10321. min = dis;
  10322. outIndex = index;
  10323. }
  10324. }
  10325. return [circleArr[outIndex], outIndex];
  10326. }
  10327. ballFlyToBag(ballArr, time = 300) {
  10328. let temp;
  10329. let hole;
  10330. this._finishNum = ballArr.length;
  10331. this._curFinish = 0;
  10332. let holeObj = {};
  10333. let holeCfg = {
  10334. "1": 0,
  10335. "2": 0,
  10336. "3": 0,
  10337. "4": 0,
  10338. "5": 0,
  10339. "6": 0
  10340. };
  10341. for (let index = 0; index < ballArr.length; index++) {
  10342. temp = ballArr[index];
  10343. temp.outColli.isSensor = true;
  10344. temp.innerColli.isSensor = true;
  10345. temp.isRunSkillAni = true;
  10346. let holeArr = this.getNearBallBag(temp);
  10347. hole = holeArr[0];
  10348. holeObj[index] = holeArr[1];
  10349. temp.d3BallSrc.scaleXYZ = 0.5;
  10350. this.tweenArr.push(temp.d3BallSrc, temp);
  10351. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10352. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10353. }));
  10354. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10355. let mIndex = holeObj[this._curFinish];
  10356. let isDone = holeCfg[mIndex];
  10357. if (isDone) {
  10358. ballArr[this._curFinish].checkWrongBall(false);
  10359. }
  10360. else {
  10361. holeCfg[mIndex] = 1;
  10362. ballArr[this._curFinish].checkWrongBall();
  10363. }
  10364. this._curFinish++;
  10365. if (this._curFinish >= this._finishNum) {
  10366. if (this.curSkill == SkillType.highSpace) {
  10367. }
  10368. else if (this.curSkill == SkillType.breakArmy) {
  10369. let rootBall = xGame.common.d2World.rootBall;
  10370. rootBall.gameObj.x = this._rootX;
  10371. rootBall.gameObj.y = this._rootY;
  10372. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10373. xGame.common.d2World.d2Gan.ui.visible = true;
  10374. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10375. xGame.common.d2World.getHelpLine();
  10376. this.callback && this.callback(this.extraScore);
  10377. }
  10378. }
  10379. }));
  10380. }
  10381. }
  10382. runHighSpace() {
  10383. let rootBall = xGame.common.d2World.rootBall;
  10384. rootBall.showSelf();
  10385. let d3Src = rootBall.d3BallSrc;
  10386. let allArr = this.getAllBallArr();
  10387. if (allArr.length <= 0) {
  10388. this.callback && this.callback(0);
  10389. return;
  10390. }
  10391. let selectBall = xGame.common.d2World.targetBall;
  10392. let wrong = selectBall && selectBall.destroyed;
  10393. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10394. selectBall = xGame.common.getRandArrEle(allArr);
  10395. }
  10396. let targetD3Src = selectBall.d3BallSrc;
  10397. xGame.common.d2World.d2Gan.ui.visible = false;
  10398. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10399. d3Src.scaleXYZ = 0.5;
  10400. this.tweenArr.push(d3Src);
  10401. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10402. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10403. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10404. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10405. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10406. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10407. let outArr = [selectBall];
  10408. let other = this.leveNum - 1;
  10409. if (other > 0) {
  10410. let nearArr = this.getOneArr(selectBall);
  10411. if (nearArr.length > 0) {
  10412. xGame.common.botherArr(nearArr);
  10413. if (other >= nearArr.length)
  10414. other = nearArr.length;
  10415. for (let index = 0; index < other; index++) {
  10416. outArr.push(nearArr[index]);
  10417. }
  10418. }
  10419. }
  10420. xGame.common.extraMoveNum = other + 1;
  10421. this.extraScore = other + 1;
  10422. this._rootX = selectBall.gameObj.x;
  10423. this._rootY = selectBall.gameObj.y;
  10424. rootBall.gameObj.x = this._rootX;
  10425. rootBall.gameObj.y = this._rootY;
  10426. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10427. Laya.Tween.clearAll(d3Src);
  10428. this.addRandomForce(outArr);
  10429. }));
  10430. }));
  10431. }
  10432. addRandomForce(outArr) {
  10433. if (outArr.length > 0) {
  10434. xGame.common.d2World.openCheckStill = true;
  10435. this.playedLastSkill = true;
  10436. }
  10437. let temp;
  10438. for (let index = 0; index < outArr.length; index++) {
  10439. let angle = xGame.common.randomNum(0, 360);
  10440. let linearPercent = xGame.common.randomNum(65, 100);
  10441. temp = outArr[index];
  10442. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10443. }
  10444. }
  10445. setLinearSpeed(angle, rigy, linearPercent) {
  10446. let sin = Math.sin(angle * Math.PI / 180);
  10447. let cos = Math.cos(angle * Math.PI / 180);
  10448. let maxSpeed = 4;
  10449. let speed = new Laya.Vector2();
  10450. speed.x = maxSpeed * linearPercent * sin;
  10451. speed.y = -maxSpeed * linearPercent * cos;
  10452. rigy.applyLinearImpulseToCenter(speed);
  10453. }
  10454. runBreakArmy() {
  10455. xGame.common.d2World.d2Gan.ui.visible = false;
  10456. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10457. let gameUI = xGame.common.gameUI.ui;
  10458. gameUI.skillRod.visible = true;
  10459. gameUI.skillRod.rotation = 110;
  10460. let outArr = this.getAllBallArr();
  10461. if (outArr.length <= 0) {
  10462. gameUI.skillRod.visible = false;
  10463. this.callback && this.callback(0);
  10464. return;
  10465. }
  10466. xGame.common.botherArr(outArr);
  10467. if (this.leveNum >= outArr.length)
  10468. this.leveNum = outArr.length;
  10469. let deleteNum = outArr.length - this.leveNum;
  10470. outArr.splice(0, deleteNum);
  10471. this.extraScore = this.leveNum;
  10472. let potX = gameUI.skillRod.x;
  10473. let potY = gameUI.skillRod.y;
  10474. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10475. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10476. let disArr = [];
  10477. for (let index = 0; index < outArr.length; index++) {
  10478. let obj = outArr[index];
  10479. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10480. dis = Math.pow(dis, 0.5);
  10481. disArr.push(dis);
  10482. }
  10483. this.tweenArr.push(gameUI.skillRod);
  10484. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10485. })).update = Laya.Handler.create(this, (e, t, c) => {
  10486. let angle = gameUI.skillRod.rotation;
  10487. let xx;
  10488. let yy;
  10489. let temp;
  10490. for (let index = 0; index < outArr.length; index++) {
  10491. temp = outArr[index];
  10492. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10493. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10494. yy -= 20;
  10495. temp.gameObj.x = xx;
  10496. temp.gameObj.y = yy;
  10497. temp.d3BallSrc.setTransPos(xx, yy);
  10498. }
  10499. if (angle <= 60) {
  10500. Laya.Tween.clearAll(gameUI.skillRod);
  10501. this.ballFlyToBag(outArr, 150);
  10502. gameUI.skillRod.visible = false;
  10503. }
  10504. }, null, false);
  10505. }
  10506. runIce() {
  10507. let ballArr = xGame.common.d2World.ballArr;
  10508. this.leveNum *= 2;
  10509. if (this.leveNum >= ballArr.length - 1)
  10510. this.leveNum = ballArr.length - 1;
  10511. let tempArr = [];
  10512. let outArr = [];
  10513. for (let index = 0; index < ballArr.length; index++) {
  10514. if (ballArr[index] instanceof D2RootBallSrc)
  10515. continue;
  10516. tempArr.push(ballArr[index]);
  10517. }
  10518. if (tempArr.length <= 0) {
  10519. this.callback && this.callback(0);
  10520. return;
  10521. }
  10522. xGame.common.botherArr(tempArr);
  10523. for (let index = 0; index < this.leveNum; index++) {
  10524. outArr.push(tempArr[index]);
  10525. }
  10526. this.extraScore = this.leveNum;
  10527. let temp;
  10528. for (let index = 0; index < outArr.length; index++) {
  10529. temp = outArr[index];
  10530. temp.d3BallSrc.playIceEft();
  10531. }
  10532. Laya.timer.once(2000, this, () => {
  10533. for (let index = 0; index < outArr.length; index++) {
  10534. temp = outArr[index];
  10535. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10536. temp.setBallFunc("ice", str);
  10537. }
  10538. this.callback && this.callback(0);
  10539. });
  10540. }
  10541. runFireworks() {
  10542. let allArr = this.getAllBallArr();
  10543. if (allArr.length <= 0) {
  10544. this.callback && this.callback(0);
  10545. return;
  10546. }
  10547. xGame.common.d2World.d2Gan.ui.visible = false;
  10548. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10549. let outArr = [];
  10550. let other = this.leveNum;
  10551. if (other > 0) {
  10552. if (allArr.length > 0) {
  10553. xGame.common.botherArr(allArr);
  10554. if (other >= allArr.length)
  10555. other = allArr.length;
  10556. for (let index = 0; index < other; index++) {
  10557. outArr.push(allArr[index]);
  10558. }
  10559. }
  10560. }
  10561. xGame.common.extraMoveNum = other;
  10562. this.extraScore = other;
  10563. this.addRandmomFireworks(outArr);
  10564. }
  10565. addRandmomFireworks(outArr) {
  10566. Laya.timer.once(1100, this, () => {
  10567. if (outArr.length > 0) {
  10568. xGame.common.d2World.openCheckStill = true;
  10569. this.playedLastSkill = true;
  10570. }
  10571. });
  10572. xGame.soundMgr.playSound("skill_04_02");
  10573. let temp;
  10574. let delay = -200;
  10575. for (let index = 0; index < outArr.length; index++) {
  10576. temp = outArr[index];
  10577. delay += 200;
  10578. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10579. let angle = xGame.common.randomNum(0, 360);
  10580. angle = this.getFireworksAngle(obj);
  10581. let linearPercent = xGame.common.randomNum(45, 80);
  10582. if (!obj.destroyed)
  10583. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10584. });
  10585. }
  10586. }
  10587. getFireworksAngle(obj) {
  10588. let rootBall = xGame.common.d2World.rootBall;
  10589. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10590. }
  10591. resetGame() {
  10592. Laya.timer.clearAll(this);
  10593. if (this.tweenArr) {
  10594. for (let index = 0; index < this.tweenArr.length; index++) {
  10595. Laya.Tween.clearAll(this.tweenArr[index]);
  10596. }
  10597. }
  10598. this.tweenArr = null;
  10599. }
  10600. runGuanYu() {
  10601. xGame.common.d2World.d2Gan.ui.visible = false;
  10602. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10603. let rootBall = xGame.common.d2World.rootBall;
  10604. if (rootBall.isInHole) {
  10605. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10606. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10607. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10608. rootBall.showSelf();
  10609. }
  10610. this.rtStarX = rootBall.gameObj.x;
  10611. this.rtStarY = rootBall.gameObj.y;
  10612. this.knifeTimes = 0;
  10613. this.playedLastSkill = true;
  10614. rootBall.forceRun = true;
  10615. rootBall.rigy.type = "static";
  10616. xGame.common.d2World.openCheckStill = true;
  10617. this.guanyuRandomKnife();
  10618. }
  10619. guanyuRandomKnife() {
  10620. let rootBall = xGame.common.d2World.rootBall;
  10621. let dir = this.getRandDir();
  10622. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10623. console.log("当前angle", angle);
  10624. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10625. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10626. let dis = 324;
  10627. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10628. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10629. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10630. this.rtStarX = rootBall.gameObj.x;
  10631. this.rtStarY = rootBall.gameObj.y;
  10632. this.knifeTimes++;
  10633. let skillLevel;
  10634. if (xGame.common.gameMgr.selfTurn) {
  10635. skillLevel = DataMgr.getBigSkillByIndex(4);
  10636. }
  10637. else {
  10638. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10639. }
  10640. if (!skillLevel)
  10641. skillLevel = 1;
  10642. skillLevel += 2;
  10643. if (this.knifeTimes < skillLevel) {
  10644. Laya.timer.once(400, this, () => {
  10645. this.guanyuRandomKnife();
  10646. });
  10647. }
  10648. else {
  10649. rootBall.forceRun = false;
  10650. rootBall.rigy.type = "dynamic";
  10651. xGame.common.extraMoveNum = skillLevel;
  10652. }
  10653. }));
  10654. }
  10655. getRandDir() {
  10656. let rootBall = xGame.common.d2World.rootBall;
  10657. let allBall = this.getAllBallArr();
  10658. let target = xGame.common.getRandArrEle(allBall);
  10659. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10660. return this.knifeV2;
  10661. }
  10662. cloneKnife(x, y, rotation) {
  10663. let parent = xGame.common.d3World.knifeRoot;
  10664. let prefab = xGame.common.d3World.knife;
  10665. let clone = prefab.clone();
  10666. parent.addChild(clone);
  10667. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10668. clone.transform.localPositionX = this.knifeV3.x;
  10669. clone.transform.localPositionY = 0;
  10670. clone.transform.localPositionZ = this.knifeV3.z;
  10671. clone.transform.localRotationEulerX = 0;
  10672. clone.transform.localRotationEulerY = rotation;
  10673. clone.transform.localRotationEulerZ = 0;
  10674. clone.active = true;
  10675. return clone;
  10676. }
  10677. cloneGuanYuEft(x, y, angle) {
  10678. return;
  10679. let parent = xGame.common.gameUI.ui.guanyuNode;
  10680. let eft = new ui_guanyuAni();
  10681. eft.parent = parent;
  10682. eft.x = x;
  10683. eft.y = y;
  10684. eft.rotation = angle;
  10685. }
  10686. }
  10687. class ui_UIWordsList extends fgui.GComponent {
  10688. static createInstance() {
  10689. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10690. }
  10691. onConstruct() {
  10692. this.c1 = this.getController("c1");
  10693. this.n74 = (this.getChild("n74"));
  10694. this.clickNode = (this.getChild("clickNode"));
  10695. this.myNode = (this.getChild("myNode"));
  10696. this.n68 = (this.getChild("n68"));
  10697. this.n66 = (this.getChild("n66"));
  10698. this.n55 = (this.getChild("n55"));
  10699. this.wordsBtn = (this.getChild("wordsBtn"));
  10700. this.emotionBtn = (this.getChild("emotionBtn"));
  10701. this.mybggg = (this.getChild("mybggg"));
  10702. this.wordsList = (this.getChild("wordsList"));
  10703. this.emotionList = (this.getChild("emotionList"));
  10704. this.myRoot = (this.getChild("myRoot"));
  10705. }
  10706. }
  10707. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10708. class EmotionDisplay {
  10709. constructor(index, ui) {
  10710. this.ui = ui;
  10711. this.index = index;
  10712. this.ui.onClick(this, this.clickSelf);
  10713. this.updateSelf();
  10714. }
  10715. updateSelf() {
  10716. let data = cfgTable.emotionData[this.index + 1];
  10717. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10718. }
  10719. clickSelf() {
  10720. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10721. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10722. xGame.common.talkMgr.closeTalkView();
  10723. }
  10724. }
  10725. class WordsDisplay {
  10726. constructor(index, ui) {
  10727. this.ui = ui;
  10728. this.index = index;
  10729. this.ui.onClick(this, this.clickSelf);
  10730. this.updateSelf();
  10731. }
  10732. updateSelf() {
  10733. let data = cfgTable.talkwordsData[this.index + 1];
  10734. this.ui.txt.text = data.msg;
  10735. }
  10736. clickSelf() {
  10737. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10738. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10739. xGame.common.talkMgr.closeTalkView();
  10740. }
  10741. }
  10742. class UIWordsList extends UIBase {
  10743. constructor() {
  10744. super();
  10745. }
  10746. onConstructor() {
  10747. this.ui = ui_UIWordsList.createInstance();
  10748. this.contentPane = this.ui;
  10749. this.isEject = false;
  10750. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10751. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10752. this.addUIClick(this.ui.clickNode, this.hide);
  10753. this.initTalkList();
  10754. this.initEmotionList();
  10755. }
  10756. show() {
  10757. super.show();
  10758. this.setGlobalFont(this.ui);
  10759. }
  10760. initTalkList() {
  10761. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10762. let data = cfgTable.talkwordsData;
  10763. let length = Object.keys(data).length;
  10764. this.ui.wordsList.numItems = length;
  10765. }
  10766. initEmotionList() {
  10767. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10768. let data = cfgTable.emotionData;
  10769. let length = Object.keys(data).length;
  10770. this.ui.emotionList.numItems = length;
  10771. }
  10772. renderTalkItem(index, obj) {
  10773. let temp = new WordsDisplay(index, obj);
  10774. }
  10775. renderEmotionItem(index, obj) {
  10776. let temp = new EmotionDisplay(index, obj);
  10777. }
  10778. openTalkList() {
  10779. this.ui.c1.selectedIndex = 0;
  10780. }
  10781. openEmotionList() {
  10782. this.ui.c1.selectedIndex = 1;
  10783. }
  10784. }
  10785. UIWordsList.uiName = "UIWordsList";
  10786. class TalkMgr {
  10787. constructor() {
  10788. this.aiSpeak = true;
  10789. this.emotionList = [];
  10790. this.talkList = [];
  10791. this.addEvent();
  10792. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10793. this.emotionList = [];
  10794. this.talkList = [];
  10795. for (let k in cfgTable.emotionData) {
  10796. this.emotionList.push(cfgTable.emotionData[k].id);
  10797. }
  10798. for (let k in cfgTable.talkwordsData) {
  10799. this.talkList.push(cfgTable.talkwordsData[k].id);
  10800. }
  10801. }
  10802. addEvent() {
  10803. let ui = xGame.common.gameUI.ui;
  10804. ui.wordsBtn.visible = true;
  10805. ui.wordsBtn.onClick(this, this.openTalkView);
  10806. ui.aiWordsBtn.visible = true;
  10807. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10808. }
  10809. openTalkView() {
  10810. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10811. xGame.uiMgr.Show(UIWordsList);
  10812. }
  10813. closeTalkView() {
  10814. xGame.uiMgr.Hide(UIWordsList);
  10815. }
  10816. clickAIState() {
  10817. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10818. this.aiSpeak = !this.aiSpeak;
  10819. this.changeAIState(this.aiSpeak);
  10820. }
  10821. changeAIState(speak) {
  10822. this.aiSpeak = speak;
  10823. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10824. if (speak) {
  10825. btn.c1.selectedIndex = 0;
  10826. }
  10827. else {
  10828. btn.c1.selectedIndex = 1;
  10829. }
  10830. }
  10831. showSelfTalk(wordsId) {
  10832. let ui = xGame.common.gameUI.ui;
  10833. ui.selfTalk.visible = true;
  10834. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10835. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10836. ui.selfTalk.t0.play();
  10837. }
  10838. showSelfEmotion(emotionId) {
  10839. let ui = xGame.common.gameUI.ui;
  10840. ui.selfTalk.visible = true;
  10841. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10842. this.selfSpine && this.selfSpine.dispose();
  10843. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10844. let spineData = cfgTable.emotionData[emotionId].spine;
  10845. this.selfSpine = new SpineMgr(spineData, () => {
  10846. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10847. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10848. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10849. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10850. });
  10851. ui.selfTalk.t0.play();
  10852. }
  10853. showAITalk(wordsId) {
  10854. if (!this.aiSpeak)
  10855. return;
  10856. if (DataMgr.gameData.gameCount < 2)
  10857. return;
  10858. if (wordsId < 1)
  10859. wordsId = this.getRandTalk();
  10860. let ui = xGame.common.gameUI.ui;
  10861. ui.aiTalk.visible = true;
  10862. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10863. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10864. ui.aiTalk.t0.play();
  10865. }
  10866. getRandTalk() {
  10867. let rand = xGame.tools.random(0, this.talkList.length);
  10868. return this.emotionList[rand];
  10869. }
  10870. getRandEmotion() {
  10871. let rand = xGame.tools.random(0, this.emotionList.length);
  10872. return this.emotionList[rand];
  10873. }
  10874. showAIEmotion(emotionId) {
  10875. if (!this.aiSpeak)
  10876. return;
  10877. if (DataMgr.gameData.gameCount < 2)
  10878. return;
  10879. if (emotionId < 1)
  10880. emotionId = this.getRandEmotion();
  10881. let ui = xGame.common.gameUI.ui;
  10882. ui.aiTalk.visible = true;
  10883. ui.aiTalk.myNode.c1.selectedIndex = 0;
  10884. this.aiSpine && this.aiSpine.dispose();
  10885. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10886. let spineData = cfgTable.emotionData[emotionId].spine;
  10887. this.aiSpine = new SpineMgr(spineData, () => {
  10888. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  10889. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  10890. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10891. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  10892. });
  10893. ui.aiTalk.t0.play();
  10894. }
  10895. resetGame() {
  10896. let ui = xGame.common.gameUI.ui;
  10897. ui.aiTalk.visible = false;
  10898. ui.selfTalk.visible = false;
  10899. this.aiSpine && this.aiSpine.dispose();
  10900. this.selfSpine && this.selfSpine.dispose();
  10901. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  10902. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10903. this.closeTalkView();
  10904. }
  10905. }
  10906. class WordsMgr {
  10907. constructor() {
  10908. this.comboTimes = 1;
  10909. this.skillTimes = 0;
  10910. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  10911. this.comboSpine = new SpineMgr("yxz_liangan");
  10912. this.skillSpine = new SpineMgr("yiganxqiu");
  10913. this.scoreSpine = new SpineMgr("defen");
  10914. }
  10915. setClassicCombo(isInterrupt) {
  10916. if (isInterrupt) {
  10917. this.comboTimes = 0;
  10918. }
  10919. }
  10920. playClassicWords(type, callback) {
  10921. this.callback = callback;
  10922. let aniIndex = type;
  10923. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10924. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10925. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  10926. mySpine.destroy(true);
  10927. this.playClassicTimes();
  10928. });
  10929. }
  10930. playClassicTimes() {
  10931. this.comboTimes++;
  10932. if (this.comboTimes <= 1) {
  10933. this.callback && this.callback();
  10934. }
  10935. else {
  10936. let aniIndex = this.comboTimes - 1;
  10937. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10938. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  10939. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  10940. mySpine.destroy(true);
  10941. this.callback && this.callback();
  10942. });
  10943. }
  10944. }
  10945. playBigSkillTimes(times, callback) {
  10946. if (times <= 0) {
  10947. callback && callback();
  10948. return;
  10949. }
  10950. this.callback = callback;
  10951. let pre = "sz_0";
  10952. let aniIndex = 0;
  10953. this.getWordsImg(times, pre, () => {
  10954. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10955. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10956. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  10957. let r1 = ``;
  10958. let r2 = ``;
  10959. if (times <= 9) {
  10960. r1 = `res/d2Res/${pre}${times}.png`;
  10961. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10962. aniIndex = 0;
  10963. }
  10964. else {
  10965. r1 = `res/d2Res/${pre}${times % 10}.png`;
  10966. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  10967. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  10968. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  10969. aniIndex = 1;
  10970. }
  10971. this.skillSpine.play(data, aniIndex, false, parent, () => {
  10972. mySpine.destroy(true);
  10973. xGame.common.gameMgr.playSkillTips();
  10974. this.playScore(times);
  10975. xGame.common.playRandomMutiBallBigSkillSound();
  10976. }, mySpine);
  10977. });
  10978. }
  10979. playScore(score) {
  10980. let pre = "sz_";
  10981. let aniIndex = 0;
  10982. this.getWordsImg(score, pre, () => {
  10983. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  10984. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  10985. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  10986. let r1 = ``;
  10987. let r2 = ``;
  10988. if (score <= 9) {
  10989. r1 = `res/d2Res/${pre}${score}.png`;
  10990. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10991. aniIndex = 0;
  10992. }
  10993. else {
  10994. r1 = `res/d2Res/${pre}${score % 10}.png`;
  10995. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  10996. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  10997. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  10998. aniIndex = 1;
  10999. }
  11000. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11001. mySpine.destroy(true);
  11002. this.callback && this.callback();
  11003. }, mySpine);
  11004. });
  11005. }
  11006. getWordsImg(number, pre = "", callback) {
  11007. let arr = [];
  11008. if (number <= 9) {
  11009. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11010. }
  11011. else {
  11012. 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 });
  11013. }
  11014. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11015. callback && callback();
  11016. }));
  11017. }
  11018. }
  11019. class ui_UIRodMethod extends fgui.GComponent {
  11020. static createInstance() {
  11021. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11022. }
  11023. onConstruct() {
  11024. this.n24 = (this.getChild("n24"));
  11025. this.white = (this.getChild("white"));
  11026. this.dot = (this.getChild("dot"));
  11027. this.sureBtn = (this.getChild("sureBtn"));
  11028. this.n20 = (this.getChild("n20"));
  11029. this.n21 = (this.getChild("n21"));
  11030. this.n22 = (this.getChild("n22"));
  11031. this.n23 = (this.getChild("n23"));
  11032. this.n5 = (this.getChild("n5"));
  11033. this.n14 = (this.getChild("n14"));
  11034. this.t0 = this.getTransition("t0");
  11035. }
  11036. }
  11037. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11038. class UIRodMethod extends UIBase {
  11039. constructor() {
  11040. super();
  11041. this.isPressd = false;
  11042. }
  11043. onConstructor() {
  11044. this.ui = ui_UIRodMethod.createInstance();
  11045. this.contentPane = this.ui;
  11046. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11047. this.moveDir = new Laya.Vector2();
  11048. this.moveDest = new Laya.Vector2();
  11049. this.centerPos = new Laya.Vector2();
  11050. xGame.common.uiRodMethod = this;
  11051. }
  11052. show() {
  11053. super.show();
  11054. xGame.common.gameMgr.gamePause = true;
  11055. this.openPressDotEvent();
  11056. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11057. this.centerPos.x = this.ui.white.x;
  11058. this.centerPos.y = this.ui.white.y;
  11059. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11060. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11061. this.setDot();
  11062. this.setGlobalFont(this.ui);
  11063. }
  11064. setDot() {
  11065. this.ui.dot.x = this.moveDest.x;
  11066. this.ui.dot.y = this.moveDest.y;
  11067. }
  11068. closeSelf() {
  11069. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11070. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11071. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11072. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11073. xGame.common.gameMgr.gamePause = false;
  11074. this.hide();
  11075. }
  11076. openPressDotEvent() {
  11077. this.closePressDotEvent();
  11078. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11079. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11080. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11081. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11082. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11083. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11084. }
  11085. closePressDotEvent() {
  11086. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11087. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11088. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11089. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11090. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11091. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11092. }
  11093. onDown(e) {
  11094. if (e.type == Laya.Event.MOUSE_DOWN)
  11095. this.isPressd = true;
  11096. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11097. this.isPressd = false;
  11098. if (!this.isPressd)
  11099. return;
  11100. this.moveDest.x = e.stageX;
  11101. this.moveDest.y = e.stageY;
  11102. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11103. if (dis > 6724) {
  11104. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11105. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11106. }
  11107. this.setDot();
  11108. }
  11109. resetRod() {
  11110. this.ui.dot.x = this.ui.white.x;
  11111. this.ui.dot.y = this.ui.white.y;
  11112. this.gameRod.dot.x = this.gameRod.bg.x;
  11113. this.gameRod.dot.y = this.gameRod.bg.y;
  11114. xGame.common.rodOffest.x = 0;
  11115. xGame.common.rodOffest.y = 0;
  11116. }
  11117. }
  11118. UIRodMethod.uiName = "UIRodMethod";
  11119. class UIGame extends UIBase {
  11120. constructor() {
  11121. super();
  11122. this.powerNum = 0;
  11123. this.isD3Inited = false;
  11124. this.isPrePlay = false;
  11125. this.isMoveRod = false;
  11126. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11127. this.rulerDis = 20;
  11128. this.rulerOffset = 0;
  11129. }
  11130. onConstructor() {
  11131. this.ui = ui_UIGame.createInstance();
  11132. this.contentPane = this.ui;
  11133. this.ui.x += xGame.common.sysOffestNum;
  11134. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11135. this.isEject = false;
  11136. xGame.common.gameUI = this;
  11137. this.initSelf();
  11138. }
  11139. isTurnSelf() {
  11140. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11141. return true;
  11142. }
  11143. }
  11144. initSelf() {
  11145. let topUI = this.ui.topNode;
  11146. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11147. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11148. this.barInfo = {};
  11149. this.barInfo.curY = 0;
  11150. this.barInfo.height = this.ui.powerNode.height;
  11151. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11152. this.barInfo.powerStartY = this.ui.powerNode.y;
  11153. xGame.common.aiPlayer = new AIPlayer();
  11154. xGame.common.gameMgr = new GameMgr();
  11155. xGame.common.skillMgr = new SkillMgr();
  11156. xGame.common.wordsMgr = new WordsMgr();
  11157. xGame.common.talkMgr = new TalkMgr();
  11158. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11159. });
  11160. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11161. });
  11162. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11163. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11164. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11165. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11166. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11167. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11168. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11169. }
  11170. getGanZiImg() {
  11171. let index = DataMgr.getCurBallRod();
  11172. let data = cfgTable.ballrodData[index + 1];
  11173. let gan_url = xGame.common.getGameIconUrl(data.img);
  11174. this.ui.powerNode.showImg.url = gan_url;
  11175. }
  11176. returnHome() {
  11177. let tips = "Are you sure to exit the game?";
  11178. let woman = "Boss, why don't you play for a while longer?";
  11179. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11180. }
  11181. addRodMethodClick() {
  11182. if (this.isTurnSelf()) {
  11183. xGame.uiMgr.Show(UIRodMethod);
  11184. }
  11185. }
  11186. clickHelpLineBtn(force = false) {
  11187. if (!this.isTurnSelf())
  11188. return;
  11189. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11190. if (success) {
  11191. xGame.common.longHelpLine = true;
  11192. xGame.common.d2World.getHelpLine();
  11193. Moyu.sendDataEvent("guideNum");
  11194. }
  11195. else {
  11196. }
  11197. });
  11198. }
  11199. renderSelfDisplayBalls(index, target) {
  11200. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11201. target.myImg.url = xGame.common.getGameIconUrl(str);
  11202. }
  11203. renderAIDisplayBalls(index, target) {
  11204. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11205. target.myImg.url = xGame.common.getGameIconUrl(str);
  11206. ;
  11207. }
  11208. updateMode() {
  11209. if (xGame.common.gameMode == GameMode.classic) {
  11210. this.ui.topNode.scoreNode.visible = false;
  11211. }
  11212. else if (xGame.common.gameMode == GameMode.bigMove) {
  11213. this.ui.topNode.scoreNode.visible = true;
  11214. }
  11215. }
  11216. show() {
  11217. super.show();
  11218. this.ui.alpha = 0;
  11219. this.updateSelf();
  11220. xGame.common.gameMgr.gamePause = false;
  11221. xGame.common.gameUI.ui.blackAni.visible = false;
  11222. xGame.common.gameUI.ui.whiteAni.visible = false;
  11223. this.ui.powerEft.visible = false;
  11224. this.ui.colorNode.visible = false;
  11225. this.updateHead();
  11226. let curUse = DataMgr.getCurBallRod();
  11227. this.getGanZiImg();
  11228. this.setGlobalFont(this.ui);
  11229. }
  11230. updateSelf() {
  11231. if (xGame.common.gameMode == GameMode.classic) {
  11232. this.ui.c1.selectedIndex = 0;
  11233. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11234. this.ui.topNode.middleNode.visible = true;
  11235. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11236. }
  11237. else if (xGame.common.gameMode == GameMode.bigMove) {
  11238. this.ui.c1.selectedIndex = 0;
  11239. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11240. this.ui.topNode.middleNode.visible = false;
  11241. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11242. let rand = xGame.common.randomNum(1, max);
  11243. let guide = DataMgr.getSkillGuide();
  11244. if (guide == 0)
  11245. rand = 1;
  11246. xGame.common.bigMoveLevelIndex = rand;
  11247. }
  11248. else if (xGame.common.gameMode == GameMode.placeBall) {
  11249. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11250. this.ui.c1.selectedIndex = 1 + data.type;
  11251. this.ui.alpha = 1;
  11252. this.startGame();
  11253. }
  11254. this.updateMode();
  11255. this.initD3world();
  11256. this.initD2world();
  11257. }
  11258. startGame() {
  11259. this.ui.snowNode.visible = Math.random() <= 0.1;
  11260. this.ui.d2Node.visible = false;
  11261. xGame.common.d3World.d3Hand.gameObj.active = false;
  11262. xGame.common.d3World.tableSrc.init();
  11263. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11264. this.cameraViewChange(() => {
  11265. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11266. switch (xGame.common.gameMode) {
  11267. case GameMode.classic:
  11268. xGame.common.d3World.d3Hand.gameObj.active = true;
  11269. this.playPutBallD3Ani();
  11270. break;
  11271. case GameMode.bigMove:
  11272. this.enterGame();
  11273. Laya.timer.once(500, this, () => {
  11274. this.ui.topNode.middleNode.visible = true;
  11275. this.ui.topNode.middleNode.t0.play();
  11276. });
  11277. break;
  11278. case GameMode.placeBall:
  11279. this.enterGame();
  11280. break;
  11281. default:
  11282. break;
  11283. }
  11284. });
  11285. PlatMgr.showBanner(false);
  11286. }
  11287. enterGame() {
  11288. this.ui.d2Node.visible = true;
  11289. xGame.common.d3World.d3Hand.gameObj.active = false;
  11290. xGame.common.showOneCamera("mainCamera");
  11291. Moyu.recordGame(30, true);
  11292. if (!this.isPrePlay) {
  11293. this.isPrePlay = true;
  11294. xGame.common.d3World.prePlayEft();
  11295. }
  11296. xGame.common.gameMgr.gameReady();
  11297. this.openAllEvent();
  11298. this.ui.snowNode.visible = false;
  11299. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11300. this.ui.helpBtn.visible = condition;
  11301. }
  11302. showHelpLineGuide() {
  11303. let longGuide = DataMgr.getGuideHelpLine();
  11304. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11305. this.ui.helpBtn.visible = true;
  11306. this.ui.guideNode.visible = true;
  11307. }
  11308. }
  11309. setTurnAlpha(alpha) {
  11310. this.ui.keduNode.alpha = alpha;
  11311. this.ui.ganNode.alpha = alpha;
  11312. this.ui.rodMethodNode.alpha = alpha;
  11313. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11314. }
  11315. cameraViewChange(callback) {
  11316. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11317. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11318. xGame.common.showOneCamera("visitAngle");
  11319. cameraSrc.localRotationEulerY = 180;
  11320. cameraSrc.localRotationEulerZ = 0;
  11321. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11322. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11323. callback && callback();
  11324. }));
  11325. }));
  11326. }
  11327. playPutBallD3Ani() {
  11328. xGame.common.showOneCamera("mainCamera");
  11329. let handSrc = xGame.common.d3World.d3Hand;
  11330. handSrc.gameObj.active = true;
  11331. handSrc.transform.localPositionZ = 3;
  11332. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11333. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11334. handSrc.gameObj.active = false;
  11335. this.enterGame();
  11336. }), 400);
  11337. }));
  11338. }
  11339. updateHead() {
  11340. let user = Moyu.getUserInfo();
  11341. this.ui.topNode.selfNameTxt.text = user.nickName;
  11342. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11343. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11344. if (DataMgr.getSkillGuide() < 1) {
  11345. this.ui.topNode.aiNameTxt.text = 'billiards';
  11346. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11347. }
  11348. else {
  11349. this.ui.topNode.aiNameTxt.text = aiData.name;
  11350. let randNo = Math.floor(Math.random() * 10) + 1;
  11351. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11352. }
  11353. }
  11354. initD2world() {
  11355. let node = this.ui.d2Root.displayObject;
  11356. let src = node.getComponent(D2World);
  11357. if (!src) {
  11358. xGame.common.d2World = node.addComponent(D2World);
  11359. }
  11360. xGame.common.d2World.initSelf();
  11361. }
  11362. initD3world() {
  11363. if (this.isD3Inited)
  11364. return;
  11365. this.isD3Inited = true;
  11366. let scene3D = xGame.common.d3Scene;
  11367. this.ui.d3Root.displayObject.addChild(scene3D);
  11368. scene3D.active = true;
  11369. xGame.common.d3World.tableSrc.setBorderPos();
  11370. }
  11371. onRootMove(e) {
  11372. let rootBall = xGame.common.d2World.rootBall;
  11373. this.ui.moveNode.x = e.x;
  11374. this.ui.moveNode.y = e.y;
  11375. rootBall.gameObj.x = e.x;
  11376. rootBall.gameObj.y = e.y;
  11377. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11378. }
  11379. aiRootMove(move) {
  11380. if (move)
  11381. this.hideBallUI();
  11382. else {
  11383. this.showBallUI();
  11384. xGame.common.d2World.getHelpLine();
  11385. }
  11386. }
  11387. aiForce(type, force = 0) {
  11388. this.pressTarget = PressType.powerNode;
  11389. if (type == 1)
  11390. this.onEventUp({ force: true });
  11391. else if (type == 2)
  11392. this.onEventMove({ stageY: force, force: true });
  11393. }
  11394. onEventPress(e) {
  11395. if (e.stopPropagation)
  11396. e.stopPropagation();
  11397. if (!this.isTurnSelf())
  11398. return;
  11399. let target = e.target;
  11400. switch (target) {
  11401. case this.ui.myPowerNode.displayObject:
  11402. this.pressTarget = PressType.powerNode;
  11403. this.barInfo.curY = e.stageY;
  11404. this.updateBarInfo();
  11405. break;
  11406. case this.ui.moveNode.displayObject:
  11407. this.pressTarget = PressType.moveNode;
  11408. this.hideBallUI();
  11409. this.eventObj.curX = this.ui.moveNode.x;
  11410. this.eventObj.curY = this.ui.moveNode.y;
  11411. this.ui.moveNode.finger.visible = false;
  11412. this.eventObj.lastX = e.stageX;
  11413. this.eventObj.lastY = e.stageY;
  11414. break;
  11415. case this.ui.rulerClickNode.displayObject:
  11416. this.pressTarget = PressType.rulerNode;
  11417. this.eventObj.lastY = e.stageY;
  11418. break;
  11419. case this.ui.d2Root.displayObject:
  11420. this.pressTarget = PressType.d2Root;
  11421. this.eventObj.lastX = e.stageX;
  11422. this.eventObj.lastY = e.stageY;
  11423. this.eventObj.starX = e.stageX;
  11424. this.eventObj.starY = e.stageY;
  11425. this.eventObj.curX = 0;
  11426. this.eventObj.curY = 0;
  11427. xGame.common.d2World.d2Gan.setGanLastInfo();
  11428. this.rulerOffset = 0;
  11429. break;
  11430. default:
  11431. break;
  11432. }
  11433. }
  11434. onEventMove(e) {
  11435. if (e.stopPropagation)
  11436. e.stopPropagation();
  11437. if (e && e.force) {
  11438. }
  11439. else {
  11440. if (!this.isTurnSelf())
  11441. return;
  11442. }
  11443. switch (this.pressTarget) {
  11444. case PressType.powerNode:
  11445. this.barInfo.curY = e.stageY;
  11446. this.updateBarInfo();
  11447. this.isMoveRod = true;
  11448. break;
  11449. case PressType.moveNode:
  11450. let rootBall = xGame.common.d2World.rootBall;
  11451. let radius = rootBall.gameObj.width / 2;
  11452. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11453. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11454. let border = xGame.common.d2World.borderRect;
  11455. if (curX <= border.x + radius)
  11456. curX = border.x + radius;
  11457. else if (curX >= border.x + border.width - radius)
  11458. curX = border.x + border.width - radius;
  11459. if (curY <= border.y + radius)
  11460. curY = border.y + radius;
  11461. else if (curY >= border.y + border.height - radius)
  11462. curY = border.y + border.height - radius;
  11463. if (xGame.common.gameMgr.isOpenBall) {
  11464. if (curX >= border.x + border.openBallW - radius)
  11465. curX = border.x + border.openBallW - radius;
  11466. }
  11467. this.ui.moveNode.x = curX;
  11468. this.ui.moveNode.y = curY;
  11469. rootBall.gameObj.x = curX;
  11470. rootBall.gameObj.y = curY;
  11471. rootBall.d3BallSrc.setTransPos(curX, curY);
  11472. this.isMoveRod = true;
  11473. break;
  11474. case PressType.rulerNode:
  11475. let yy = e.stageY - this.eventObj.lastY;
  11476. this.eventObj.lastY = e.stageY;
  11477. let ruler1 = this.ui.rulerNode.img1;
  11478. let ruler2 = this.ui.rulerNode.img2;
  11479. ruler1.y += yy;
  11480. ruler2.y += yy;
  11481. this.rulerOffset += yy;
  11482. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11483. this.rulerOffset = 0;
  11484. xGame.soundMgr.playSound("inch", 1, 10);
  11485. }
  11486. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11487. let h = ruler1.height;
  11488. this.checkGuide();
  11489. this.isMoveRod = true;
  11490. if (ruler1.y >= h) {
  11491. ruler1.y = -h;
  11492. ruler2.y = 0;
  11493. return;
  11494. }
  11495. else if (ruler1.y <= -h) {
  11496. ruler1.y = h;
  11497. ruler2.y = 0;
  11498. return;
  11499. }
  11500. if (ruler2.y >= h) {
  11501. ruler2.y = -h;
  11502. ruler1.y = 0;
  11503. return;
  11504. }
  11505. else if (ruler2.y <= -h) {
  11506. ruler2.y = h;
  11507. ruler1.y = 0;
  11508. return;
  11509. }
  11510. break;
  11511. case PressType.d2Root:
  11512. this.eventObj.curX = e.stageX;
  11513. this.eventObj.curY = e.stageY;
  11514. let offset = this.checkRodMoveDir();
  11515. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11516. this.eventObj.lastX = e.stageX;
  11517. this.eventObj.lastY = e.stageY;
  11518. break;
  11519. default:
  11520. break;
  11521. }
  11522. }
  11523. onEventUp(e) {
  11524. if (e.stopPropagation)
  11525. e.stopPropagation();
  11526. if (e && e.force) {
  11527. }
  11528. else {
  11529. if (!this.isTurnSelf())
  11530. return;
  11531. }
  11532. switch (this.pressTarget) {
  11533. case PressType.powerNode:
  11534. this.ui.powerNode.value = 0;
  11535. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11536. this.ui.powerTxt.text = "";
  11537. if (this.powerNum > 0) {
  11538. xGame.eventMgr.event(BALL_SHOOT);
  11539. xGame.common.d2World.shoot(this.powerNum);
  11540. xGame.common.d2World.d2Gan.shoot();
  11541. xGame.common.d2World.d2HelpLine.shoot();
  11542. this.finishGuide();
  11543. this.ui.powerEft.visible = false;
  11544. this.ui.colorNode.visible = false;
  11545. let ganStr = "";
  11546. if (this.powerNum <= 30) {
  11547. ganStr = "gan_30";
  11548. }
  11549. else if (this.powerNum <= 60) {
  11550. ganStr = "gan_50";
  11551. }
  11552. else {
  11553. ganStr = "gan_80";
  11554. }
  11555. xGame.soundMgr.playSound(ganStr);
  11556. }
  11557. break;
  11558. case PressType.moveNode:
  11559. let rootBall = xGame.common.d2World.rootBall;
  11560. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11561. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11562. let isIntersect = this.judgeBallIntersect();
  11563. if (isIntersect) {
  11564. this.ui.moveNode.x = lastX;
  11565. this.ui.moveNode.y = lastY;
  11566. rootBall.gameObj.x = lastX;
  11567. rootBall.gameObj.y = lastY;
  11568. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11569. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11570. }
  11571. else {
  11572. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11573. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11574. }
  11575. this.showBallUI();
  11576. this.ui.moveNode.finger.visible = true;
  11577. xGame.common.d2World.getHelpLine();
  11578. break;
  11579. case PressType.rulerNode:
  11580. break;
  11581. case PressType.d2Root:
  11582. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11583. if (dis <= 25) {
  11584. this.moveToClickDot(e);
  11585. }
  11586. break;
  11587. default:
  11588. break;
  11589. }
  11590. this.pressTarget = -1;
  11591. }
  11592. checkGuide() {
  11593. let guide = DataMgr.getSkillGuide();
  11594. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11595. xGame.common.guideStep++;
  11596. xGame.common.gameUI.ui.guide2.visible = false;
  11597. xGame.common.gameUI.ui.guide3.visible = true;
  11598. }
  11599. }
  11600. finishGuide() {
  11601. let guide = DataMgr.getSkillGuide();
  11602. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11603. xGame.common.guideStep = 10;
  11604. this.closeAllGuide();
  11605. console.log('zh: 新手引导完毕');
  11606. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11607. }
  11608. }
  11609. closeAllGuide() {
  11610. xGame.common.gameUI.ui.guide1.visible = false;
  11611. xGame.common.gameUI.ui.guide2.visible = false;
  11612. xGame.common.gameUI.ui.guide3.visible = false;
  11613. }
  11614. updateBarInfo() {
  11615. let star = this.ui.powerNode.y;
  11616. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11617. if (rate >= 1)
  11618. rate = 1;
  11619. if (rate <= 0)
  11620. rate = 0;
  11621. this.powerNum = Math.ceil(rate * 100);
  11622. this.ui.powerNode.value = this.powerNum;
  11623. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11624. this.ui.colorNode.value = this.powerNum;
  11625. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11626. this.ui.powerEft.visible = this.powerNum != 0;
  11627. this.ui.colorNode.visible = this.powerNum != 0;
  11628. this.ui.powerTxt.text = this.powerNum + "";
  11629. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11630. }
  11631. forceCancel() {
  11632. this.ui.powerNode.value = 0;
  11633. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11634. this.ui.powerTxt.text = "";
  11635. }
  11636. checkRodMoveDir() {
  11637. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11638. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11639. if (tempX >= 0 && tempY <= 0) {
  11640. return this.checkDir();
  11641. }
  11642. else if (tempX < 0 && tempY < 0) {
  11643. return this.checkDir(1, -1);
  11644. }
  11645. else if (tempX < 0 && tempY > 0) {
  11646. return this.checkDir(-1, -1);
  11647. }
  11648. else {
  11649. return this.checkDir(-1, 1);
  11650. }
  11651. }
  11652. checkDir(flagX = 1, flagY = 1) {
  11653. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11654. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11655. if (offsetY == 0) {
  11656. return offsetX * flagX;
  11657. }
  11658. if (offsetX == 0) {
  11659. return offsetY * flagY;
  11660. }
  11661. let angle = offsetY / offsetX;
  11662. if (Math.abs(angle) >= 1) {
  11663. return offsetY * flagY;
  11664. }
  11665. else {
  11666. return offsetX * flagX;
  11667. }
  11668. }
  11669. judgeBallIntersect() {
  11670. let rootBall = xGame.common.d2World.rootBall;
  11671. let ballArr = xGame.common.d2World.ballArr;
  11672. let radius = rootBall.gameObj.width / 2;
  11673. let temp;
  11674. let isIntersect = false;
  11675. for (let index = 0; index < ballArr.length; index++) {
  11676. temp = ballArr[index];
  11677. if (temp.number == rootBall.number)
  11678. continue;
  11679. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11680. if (isIntersect) {
  11681. break;
  11682. }
  11683. }
  11684. return isIntersect;
  11685. }
  11686. hideBallUI() {
  11687. let d2Gan = xGame.common.d2World.d2Gan;
  11688. if (!d2Gan.ui.isDisposed)
  11689. d2Gan.ui.visible = false;
  11690. let d2Help = xGame.common.d2World.d2HelpLine;
  11691. if (!d2Help.ui.isDisposed)
  11692. d2Help.ui.visible = false;
  11693. let rootBall = xGame.common.d2World.rootBall;
  11694. if (!rootBall.destroyed) {
  11695. rootBall.gameObj.active = false;
  11696. }
  11697. }
  11698. showBallUI() {
  11699. let d2Gan = xGame.common.d2World.d2Gan;
  11700. if (!d2Gan.ui.isDisposed)
  11701. d2Gan.ui.visible = true;
  11702. let d2Help = xGame.common.d2World.d2HelpLine;
  11703. if (!d2Help.ui.isDisposed)
  11704. d2Help.ui.visible = true;
  11705. let rootBall = xGame.common.d2World.rootBall;
  11706. if (!rootBall.destroyed) {
  11707. rootBall.gameObj.active = true;
  11708. }
  11709. }
  11710. moveToClickDot(e) {
  11711. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11712. let root = xGame.common.d2World.rootBall.gameObj;
  11713. let xx = e.stageX - xGame.common.sysOffestNum;
  11714. let yy = e.stageY;
  11715. let x = xx - root.x;
  11716. let y = yy - root.y;
  11717. let angle = xGame.common.getfguiRotation(x, y);
  11718. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11719. xGame.common.d2World.getHelpLine();
  11720. }
  11721. this.isMoveRod = false;
  11722. xGame.common.clickedBall = false;
  11723. }
  11724. openAllEvent() {
  11725. this.closeAllEvent();
  11726. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11727. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11728. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11729. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11730. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11731. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11732. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11733. }
  11734. closeAllEvent() {
  11735. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11736. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11737. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11738. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11739. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11740. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11741. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11742. }
  11743. resetGame() {
  11744. this.closeAllEvent();
  11745. this.hideBallUI();
  11746. xGame.common.gameMgr.gamePause = true;
  11747. }
  11748. }
  11749. UIGame.uiName = "UIGame";
  11750. class UIAddProp extends UIBase {
  11751. constructor() {
  11752. super();
  11753. this.curType = "";
  11754. }
  11755. onConstructor() {
  11756. this.ui = ui_UIAddProp.createInstance();
  11757. this.contentPane = this.ui;
  11758. this.isEject = false;
  11759. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11760. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11761. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11762. this.updateUI();
  11763. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11764. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11765. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11766. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11767. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11768. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11769. }
  11770. show(type) {
  11771. super.show();
  11772. this.curType = type == 0 ? "coin" : "diamond";
  11773. this.switchBtn("");
  11774. this.ui.t0.play();
  11775. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11776. PlatMgr.showInsert(true);
  11777. this.setGlobalFont(this.ui);
  11778. }
  11779. closeSelf() {
  11780. this.hide();
  11781. }
  11782. updateUI() {
  11783. let data = cfgTable.moneyData;
  11784. let temp;
  11785. let obj;
  11786. for (const key in data) {
  11787. temp = data[key];
  11788. obj = this.ui.myNode["node" + key];
  11789. if (parseInt(key) <= 2) {
  11790. obj.diamondTxt.text = "+" + temp.num;
  11791. }
  11792. else {
  11793. obj.coinTxt.text = temp.num;
  11794. obj.diamondTxt.text = temp.get.split('_')[1];
  11795. }
  11796. }
  11797. this.updateDiamondShare();
  11798. }
  11799. updateDiamondShare() {
  11800. let data = DataMgr.getShareDiamondTimes();
  11801. if (data >= xGame.common.maxShareDiamondTimes) {
  11802. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11803. this.ui.myNode.node1.touchable = false;
  11804. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11805. }
  11806. else {
  11807. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11808. this.ui.myNode.node1.touchable = true;
  11809. }
  11810. }
  11811. switchBtn(type) {
  11812. if (type == "")
  11813. type = this.curType;
  11814. else {
  11815. if (this.curType == type) {
  11816. return;
  11817. }
  11818. else {
  11819. this.curType = type;
  11820. }
  11821. }
  11822. if (type == "coin") {
  11823. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11824. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11825. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11826. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11827. this.ui.myNode.c1.selectedIndex = 0;
  11828. }
  11829. else {
  11830. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11831. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11832. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11833. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11834. this.ui.myNode.c1.selectedIndex = 1;
  11835. }
  11836. }
  11837. convertCoin(index) {
  11838. let data = cfgTable.moneyData[index];
  11839. let coinNum = data.num;
  11840. let str = data.get.split('_')[1];
  11841. let needDiamond = parseInt(str);
  11842. if (DataMgr.diamondEnough(needDiamond)) {
  11843. DataMgr.setDiamond(-needDiamond);
  11844. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  11845. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  11846. }
  11847. else {
  11848. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  11849. this.switchBtn("diamond");
  11850. }
  11851. }
  11852. videoGetDiamond() {
  11853. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  11854. if (Laya.Browser.onAndroid) {
  11855. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11856. if (!boo) {
  11857. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11858. return;
  11859. }
  11860. }
  11861. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  11862. }
  11863. else {
  11864. console.log('zh:AD 失败,直接发放奖励');
  11865. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  11866. }
  11867. }
  11868. qjff_AD_for_uiAddProp_videoGetDiamond() {
  11869. let num = cfgTable.moneyData[2].num;
  11870. xGame.common.playObjFlyAnim(num, Prop.diamond);
  11871. this.closeSelf();
  11872. }
  11873. videoGetCoin() {
  11874. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  11875. if (Laya.Browser.onAndroid) {
  11876. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11877. if (!boo) {
  11878. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11879. return;
  11880. }
  11881. }
  11882. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  11883. }
  11884. else {
  11885. console.log('zh:AD 失败,直接发放奖励');
  11886. this.qjff_AD_for_uiAddProp_videoGetCoin();
  11887. }
  11888. }
  11889. qjff_AD_for_uiAddProp_videoGetCoin() {
  11890. xGame.common.playObjFlyAnim(2000, Prop.coin);
  11891. this.closeSelf();
  11892. }
  11893. shareGetDiamond() {
  11894. let times = DataMgr.getShareDiamondTimes();
  11895. if (times >= xGame.common.maxShareDiamondTimes) {
  11896. console.log('zh: 233333333333 maxShareDiamondTimes');
  11897. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11898. }
  11899. else {
  11900. console.log('zh:33333333333333ad');
  11901. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  11902. if (Laya.Browser.onAndroid) {
  11903. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  11904. if (!boo) {
  11905. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  11906. return;
  11907. }
  11908. }
  11909. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  11910. }
  11911. else {
  11912. console.log('zh:AD 失败,直接发放奖励');
  11913. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  11914. }
  11915. }
  11916. }
  11917. qjff_AD_for_uiAddProp_shareGetDiamond() {
  11918. let diamond = xGame.common.randomNum(50, 100);
  11919. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  11920. DataMgr.setShareDiamondTimes(1);
  11921. this.updateDiamondShare();
  11922. }
  11923. openPutBallView() {
  11924. let end = xGame.uiMgr.getUI(UIGameEnd);
  11925. let skill = xGame.uiMgr.getUI(UISkill);
  11926. let level = xGame.uiMgr.getUI(UILevelDisplay);
  11927. let uigame = xGame.uiMgr.getUI(UIGame);
  11928. if (end && !end.isHide) {
  11929. xGame.uiMgr.Hide(UIGameEnd);
  11930. xGame.uiMgr.Show(UIMain);
  11931. }
  11932. if (skill && !skill.isHide)
  11933. xGame.uiMgr.Hide(UISkill);
  11934. if (uigame && !uigame.isHide)
  11935. xGame.uiMgr.Hide(UIGame);
  11936. if (level && !level.isHide) {
  11937. }
  11938. else {
  11939. xGame.uiMgr.Show(UILevelDisplay);
  11940. }
  11941. this.closeSelf();
  11942. }
  11943. }
  11944. UIAddProp.uiName = "UIAddProp";
  11945. class MoneyNode {
  11946. constructor(ui) {
  11947. this.leftTime = 0;
  11948. this.ui = ui;
  11949. this.ui.addCoinBtn.onClick(this, this.addCoin);
  11950. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  11951. this.ui.addPowerBtn.onClick(this, this.addPower);
  11952. this.ui.c1.selectedIndex = 1;
  11953. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  11954. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  11955. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  11956. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  11957. this.coinChange();
  11958. this.diamondChange();
  11959. this.powerChange();
  11960. }
  11961. addPower() {
  11962. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  11963. xGame.uiMgr.Show(UIPower);
  11964. }
  11965. powerChange() {
  11966. let powerNum = DataMgr.getPower();
  11967. this.ui.powerTxt.text = powerNum + "";
  11968. }
  11969. checkPowerTime() {
  11970. let cur = new Date().getTime();
  11971. let last = DataMgr.getPowerTime();
  11972. if (last == 0) {
  11973. last = cur;
  11974. DataMgr.setPowerTime(cur);
  11975. }
  11976. let power = DataMgr.getPower();
  11977. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  11978. Laya.timer.clearAll(this);
  11979. if (power >= xGame.common.natureMaxPower) {
  11980. this.ui.powerTimeTxt.text = "";
  11981. DataMgr.setPowerTime(cur);
  11982. return;
  11983. }
  11984. if (power + offset >= xGame.common.natureMaxPower) {
  11985. DataMgr.setPower(xGame.common.natureMaxPower, false);
  11986. this.ui.powerTimeTxt.text = "";
  11987. DataMgr.setPowerTime(cur);
  11988. }
  11989. else {
  11990. if (offset > 0) {
  11991. DataMgr.setPower(offset);
  11992. DataMgr.setPowerTime(cur);
  11993. }
  11994. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  11995. this.leftTime = xGame.common.powerRecoverNum - time;
  11996. if (this.leftTime <= 0)
  11997. this.leftTime = 0;
  11998. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  11999. Laya.timer.loop(1000, this, this.updatePowerTime);
  12000. }
  12001. }
  12002. updatePowerTime() {
  12003. this.leftTime -= 1;
  12004. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12005. if (this.leftTime <= 0) {
  12006. this.checkPowerTime();
  12007. }
  12008. }
  12009. coinChange() {
  12010. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12011. }
  12012. diamondChange() {
  12013. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12014. }
  12015. addCoin() {
  12016. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12017. Moyu.sendDataEvent("AddCoinBtn");
  12018. xGame.uiMgr.Show(UIAddProp, 0);
  12019. }
  12020. addDiamond() {
  12021. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12022. Moyu.sendDataEvent("AddDiamondBtn");
  12023. xGame.uiMgr.Show(UIAddProp, 1);
  12024. }
  12025. }
  12026. class UIDraw extends UIBase {
  12027. constructor() {
  12028. super();
  12029. this.curKey = 0;
  12030. }
  12031. onConstructor() {
  12032. this.ui = ui_UIDraw.createInstance();
  12033. this.contentPane = this.ui;
  12034. this.isEject = false;
  12035. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12036. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12037. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12038. this.initDraw();
  12039. this.initUI();
  12040. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12041. }
  12042. show() {
  12043. super.show();
  12044. this.ui.t0.play();
  12045. this.playSecretaryIdle();
  12046. this.updateDraw();
  12047. this.checkFree();
  12048. if (PlatMgr.bannerDelay > 0) {
  12049. this.ui.closeNode.closeBtn.visible = false;
  12050. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12051. this.ui.closeNode.closeBtn.visible = true;
  12052. });
  12053. }
  12054. PlatMgr.showRateBanner();
  12055. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12056. this.setGlobalFont(this.ui);
  12057. }
  12058. hide() {
  12059. Laya.timer.clearAll(this);
  12060. super.hide();
  12061. }
  12062. checkFree() {
  12063. let isFree = DataMgr.getDailyfreeDrawTimes();
  12064. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12065. }
  12066. initDraw() {
  12067. this.drawObj = [];
  12068. let data = cfgTable.drawData;
  12069. let temp;
  12070. let weight = 0;
  12071. for (const key in data) {
  12072. temp = data[key];
  12073. weight += temp.weight;
  12074. this.drawObj.push(weight);
  12075. }
  12076. this.allWeight = weight;
  12077. }
  12078. initUI() {
  12079. let data = cfgTable.drawData;
  12080. let temp;
  12081. let img;
  12082. let txt;
  12083. for (const key in data) {
  12084. temp = data[key];
  12085. img = this.ui.myNode.rotNode["img" + key];
  12086. txt = this.ui.myNode.rotNode["txt" + key];
  12087. img.url = xGame.common.getGameIconUrl(temp.icon);
  12088. txt.visible = true;
  12089. if (temp.award > 2) {
  12090. img.rotation = 0;
  12091. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12092. }
  12093. else {
  12094. img.rotation = temp.rotation;
  12095. txt.text = temp.num;
  12096. }
  12097. }
  12098. }
  12099. getCurkey() {
  12100. let rand = Math.random() * this.allWeight;
  12101. let temp;
  12102. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12103. temp = this.drawObj[index];
  12104. if (index == 0) {
  12105. if (rand < temp) {
  12106. return index + 1;
  12107. }
  12108. }
  12109. else {
  12110. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12111. return index + 1;
  12112. }
  12113. }
  12114. }
  12115. return 2;
  12116. }
  12117. startDraw() {
  12118. console.log('zh:开始抽奖');
  12119. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12120. if (freeTimes > 0) {
  12121. console.log('zh:freeTimes=' + freeTimes);
  12122. this.beginDraw();
  12123. DataMgr.setDailyfreeDrawTimes(0);
  12124. this.checkFree();
  12125. }
  12126. else {
  12127. if (Laya.Browser.onAndroid) {
  12128. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12129. if (!boo) {
  12130. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12131. return;
  12132. }
  12133. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12134. }
  12135. else {
  12136. console.log('zh:AD 失败,直接发放奖励');
  12137. this.qjff_chouJiang();
  12138. }
  12139. }
  12140. else {
  12141. this.qjff_chouJiang();
  12142. }
  12143. }
  12144. }
  12145. qjff_chouJiang() {
  12146. this.beginDraw();
  12147. }
  12148. beginDraw() {
  12149. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12150. this.ui.drawBtn.touchable = false;
  12151. this.curKey = this.getCurkey();
  12152. console.log("zh:当前key", this.curKey);
  12153. let cell = 60;
  12154. let lap = 3;
  12155. let angle = cell * (this.curKey - 1) + lap * 360;
  12156. let target = this.ui.myNode.rotNode;
  12157. target.rotation = 0;
  12158. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12159. console.log("zh:旋转完成");
  12160. this.ui.drawBtn.touchable = true;
  12161. this.getAward();
  12162. }));
  12163. }
  12164. getAward() {
  12165. let data = cfgTable.drawData[this.curKey];
  12166. let temp = new AwardType();
  12167. temp.type = data.award;
  12168. temp.num = data.num;
  12169. xGame.common.getAward([temp], () => {
  12170. DataMgr.setDrawTimes(1);
  12171. this.updateDraw();
  12172. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12173. });
  12174. }
  12175. updateDraw() {
  12176. let drawTimes = DataMgr.getDrawTimes();
  12177. let awardTimes = DataMgr.getDrawAwardTimes();
  12178. if (Math.floor(drawTimes / 3) > awardTimes) {
  12179. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12180. this.ui.extraNode.boxBtn.touchable = true;
  12181. this.ui.extraNode.tipsTxt.text = "3/3";
  12182. this.ui.extraNode.barNode.width = 265;
  12183. this.getExtraAward();
  12184. }
  12185. else {
  12186. this.ui.extraNode.boxBtn.t0.stop();
  12187. this.ui.extraNode.boxBtn.touchable = false;
  12188. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12189. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12190. }
  12191. let data = cfgTable.drawData[1];
  12192. if (awardTimes == 0) {
  12193. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12194. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12195. this.ui.myNode.rotNode.img1.rotation = 0;
  12196. }
  12197. else {
  12198. let award = data.nextid;
  12199. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12200. this.ui.myNode.rotNode.txt1.text = award[1];
  12201. this.ui.myNode.rotNode.img1.rotation = 0;
  12202. }
  12203. }
  12204. getExtraAward() {
  12205. let drawTimes = DataMgr.getDrawTimes();
  12206. let awardTimes = DataMgr.getDrawAwardTimes();
  12207. let data = cfgTable.drawData[1];
  12208. let award = new AwardType();
  12209. if (awardTimes == 0) {
  12210. award.num = data.num;
  12211. award.type = data.award;
  12212. xGame.common.getAward([award], () => {
  12213. let all = Math.floor(drawTimes / 3);
  12214. DataMgr.setDrawAwardTimes(all);
  12215. this.updateDraw();
  12216. });
  12217. }
  12218. else {
  12219. award.num = parseInt(data.nextid[1]);
  12220. award.type = parseInt(data.nextid[0]);
  12221. xGame.common.getAward([award], () => {
  12222. let all = Math.floor(drawTimes / 3);
  12223. DataMgr.setDrawAwardTimes(all);
  12224. this.updateDraw();
  12225. });
  12226. }
  12227. }
  12228. closeSelf() {
  12229. this.hide();
  12230. }
  12231. playSecretaryIdle() {
  12232. let parent = this.ui.secretary.displayObject;
  12233. parent.destroyChildren();
  12234. let xx = this.ui.secretary.width / 2;
  12235. let yy = this.ui.secretary.height;
  12236. let scale = xGame.common.getSecretaryScale();
  12237. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12238. xGame.common.secretary.play(data, 0, true, parent);
  12239. }
  12240. }
  12241. UIDraw.uiName = "UIDraw";
  12242. class ui_UIFlyEft extends fgui.GComponent {
  12243. static createInstance() {
  12244. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12245. }
  12246. onConstruct() {
  12247. this.n0 = (this.getChild("n0"));
  12248. this.n1 = (this.getChild("n1"));
  12249. this.n2 = (this.getChild("n2"));
  12250. this.n3 = (this.getChild("n3"));
  12251. this.n4 = (this.getChild("n4"));
  12252. this.n5 = (this.getChild("n5"));
  12253. this.n6 = (this.getChild("n6"));
  12254. this.n7 = (this.getChild("n7"));
  12255. this.iconNode = (this.getChild("iconNode"));
  12256. this.txt = (this.getChild("txt"));
  12257. this.txtNode = (this.getChild("txtNode"));
  12258. }
  12259. }
  12260. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12261. class UIFlyEft extends UIBase {
  12262. constructor() {
  12263. super();
  12264. this.max = 8;
  12265. this.delay = 0;
  12266. }
  12267. onConstructor() {
  12268. this.ui = ui_UIFlyEft.createInstance();
  12269. this.contentPane = this.ui;
  12270. this.isEject = false;
  12271. this.isMuti = true;
  12272. this.ui.x += xGame.common.sysOffestNum;
  12273. }
  12274. getArrPos() {
  12275. if (this.iconPos && this.iconPos.length > 0)
  12276. return;
  12277. this.iconPos = [];
  12278. let temp;
  12279. for (let index = 0; index < this.max; index++) {
  12280. temp = this.ui["n" + index];
  12281. this.iconPos.push([temp.x, temp.y]);
  12282. }
  12283. }
  12284. show(stPos, edPos, num, type, callback) {
  12285. super.show();
  12286. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12287. this.getArrPos();
  12288. this.updateUI(type);
  12289. this.updatePos();
  12290. this.runFly(edPos, callback);
  12291. this.runWorlds(stPos, num);
  12292. this.setGlobalFont(this.ui);
  12293. }
  12294. updateUI(type) {
  12295. let temp;
  12296. let str;
  12297. for (let index = 0; index < this.max; index++) {
  12298. temp = this.ui["n" + index];
  12299. str = this.getIconStr(type);
  12300. temp.url = xGame.common.getGameIconUrl(str);
  12301. }
  12302. }
  12303. getIconStr(type) {
  12304. switch (type) {
  12305. case Prop.diamond:
  12306. return "ty_zs";
  12307. case Prop.coin:
  12308. return "ty_jb";
  12309. default:
  12310. break;
  12311. }
  12312. }
  12313. updatePos() {
  12314. let temp;
  12315. for (let index = 0; index < this.max; index++) {
  12316. temp = this.ui["n" + index];
  12317. temp.x = this.iconPos[index][0];
  12318. temp.y = this.iconPos[index][1];
  12319. }
  12320. }
  12321. runFly(endPos, callback) {
  12322. let all = 0;
  12323. let temp;
  12324. for (let index = 0; index < this.max; index++) {
  12325. temp = this.ui["n" + index];
  12326. temp.visible = true;
  12327. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12328. temp.visible = false;
  12329. all++;
  12330. if (all >= this.max) {
  12331. callback && callback();
  12332. }
  12333. }), 20 * index);
  12334. }
  12335. }
  12336. runWorlds(stPos, num) {
  12337. let str = "+" + num;
  12338. this.ui.txt.text = str;
  12339. let starX = stPos.x;
  12340. let starY = stPos.y + 50;
  12341. this.ui.txt.x = starX;
  12342. this.ui.txt.y = starY;
  12343. this.ui.txt.visible = true;
  12344. this.ui.txt.alpha = 1;
  12345. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12346. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12347. this.ui.txt.visible = false;
  12348. this.hide();
  12349. }));
  12350. }));
  12351. }
  12352. }
  12353. UIFlyEft.uiName = "UIFlyEft";
  12354. class Common {
  12355. constructor() {
  12356. this.convertNum = 0.025;
  12357. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12358. this.scaleV3One = new Laya.Vector3();
  12359. this.scaleV3Two = new Laya.Vector3();
  12360. this.posV4 = new Laya.Vector4();
  12361. this.showDebug = false;
  12362. this.openGuide = true;
  12363. this.rodOffest = new Laya.Vector2(0, 0);
  12364. this.rodAngle = 0;
  12365. this.gameMode = GameMode.classic;
  12366. this.bigMoveLevelIndex = 1;
  12367. this.bigMoveNeedCoin = 1000;
  12368. this.classicNiceNeddCoin = 1000;
  12369. this.passAwardCoin = 2000;
  12370. this.classicRoomType = 1;
  12371. this.maxPower = 20;
  12372. this.natureMaxPower = 5;
  12373. this.videoPower = 2;
  12374. this.powerRecoverNum = 900;
  12375. this.curPlayerSkillType = 0;
  12376. this.isNewDay = false;
  12377. this.clickedBall = false;
  12378. this.placeBallCurLevel = 0;
  12379. this.placeBallStarNum = 0;
  12380. this.longHelpLine = false;
  12381. this.maxShareDiamondTimes = 3;
  12382. this.guideStep = 0;
  12383. this.temSelfLevel = 0;
  12384. this.extraMoveNum = 0;
  12385. this.curRankID = 0;
  12386. this.rankID = {
  12387. normalStar: 12000,
  12388. wxStar: 12001
  12389. };
  12390. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12391. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12392. this.btnClickStr = "buttonclick";
  12393. this.maxSkillLevel = 10;
  12394. this.upSkillLevel = false;
  12395. this.gameStartTime = 0;
  12396. this._sysOffestNum = 0;
  12397. this.angleV2 = new Laya.Vector2();
  12398. this.rootV = new Laya.Vector2(0, 1);
  12399. this.tempDir1 = new Laya.Vector2();
  12400. this.tempDir2 = new Laya.Vector2();
  12401. this.ballSize = 33;
  12402. this.stPos = new Laya.Point();
  12403. this.edPos = new Laya.Point();
  12404. Common._instance = this;
  12405. window["common"] = this;
  12406. }
  12407. static getInstance() {
  12408. if (!this._instance) {
  12409. this._instance = new Common();
  12410. }
  12411. return this._instance;
  12412. }
  12413. get sysOffestNum() {
  12414. if (this._sysOffestNum == 0) {
  12415. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12416. }
  12417. return this._sysOffestNum;
  12418. }
  12419. testShader() {
  12420. let test = new LightShader();
  12421. test.texture = "res/d3Res/ballTexture/ball1.png";
  12422. Laya.stage.addChild(test);
  12423. }
  12424. playScale(node) {
  12425. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12426. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12427. }));
  12428. }));
  12429. }
  12430. setGroup(colli, ...group) {
  12431. let out = 0;
  12432. for (let index = 0; index < group.length; index++) {
  12433. if (index == 0) {
  12434. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12435. }
  12436. else {
  12437. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12438. }
  12439. }
  12440. colli.collisionGroup = out;
  12441. }
  12442. setCanGroupWith(colli, ...group) {
  12443. let out = 0;
  12444. for (let index = 0; index < group.length; index++) {
  12445. if (index == 0) {
  12446. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12447. }
  12448. else {
  12449. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12450. }
  12451. }
  12452. colli.canCollideWith = out;
  12453. }
  12454. loadPrefab(name, callback) {
  12455. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12456. let prefab = new Laya.Prefab();
  12457. prefab.json = obj;
  12458. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12459. callback && callback(img);
  12460. }));
  12461. }
  12462. pos2to3Convert(x, y, d3Pos) {
  12463. x = x + this.sysOffestNum;
  12464. d3Pos.setValue(x, y, 0);
  12465. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12466. if (success) {
  12467. }
  12468. else {
  12469. console.error("转换出错了。。。。。。。。");
  12470. }
  12471. }
  12472. scale2to3Convert(num) {
  12473. this.scaleV3One.setValue(0, 0, 0);
  12474. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12475. this.scaleV3Two.setValue(0, num, 0);
  12476. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12477. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12478. return outNum;
  12479. }
  12480. pos3to2Convert(d3Pos) {
  12481. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12482. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12483. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12484. d3Pos.x -= this.sysOffestNum;
  12485. }
  12486. scale3to2Convert(num) {
  12487. let scale = this.scale2to3Convert(1);
  12488. let d2Out = num / scale;
  12489. return d2Out;
  12490. }
  12491. getCollider(type, restitution = 0.9, density = 10) {
  12492. let colli;
  12493. if (type == "box")
  12494. colli = new Laya.BoxCollider();
  12495. else
  12496. colli = new Laya.CircleCollider();
  12497. colli.friction = 0;
  12498. colli.restitution = restitution;
  12499. colli.density = density;
  12500. return colli;
  12501. }
  12502. getRigbody() {
  12503. let rigy = new Laya.RigidBody();
  12504. rigy.bullet = true;
  12505. rigy.allowRotation = false;
  12506. rigy.allowSleep = false;
  12507. rigy.gravityScale = 0;
  12508. return rigy;
  12509. }
  12510. getfguiRotation(x, y) {
  12511. this.angleV2.setValue(x, y);
  12512. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12513. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12514. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12515. angle = -angle;
  12516. }
  12517. return 180 + angle;
  12518. }
  12519. getAngle(x, y) {
  12520. this.angleV2.setValue(x, y);
  12521. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12522. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12523. return angle;
  12524. }
  12525. randomNum(a, b) {
  12526. return a + Math.floor((b - a + 1) * Math.random());
  12527. }
  12528. getRandArrEle(arr) {
  12529. return arr[Math.floor(arr.length * Math.random())];
  12530. }
  12531. getSign(val) {
  12532. return val >= 0 ? 1 : -1;
  12533. }
  12534. botherArr(arr) {
  12535. let times = arr.length + 2;
  12536. let length = arr.length;
  12537. let a;
  12538. let b;
  12539. let temp;
  12540. for (let index = 0; index < times; index++) {
  12541. a = Math.floor(Math.random() * length);
  12542. b = Math.floor(Math.random() * length);
  12543. temp = arr[a];
  12544. arr[a] = arr[b];
  12545. arr[b] = temp;
  12546. }
  12547. }
  12548. getGameIconUrl(id) {
  12549. return "ui://game/" + id;
  12550. }
  12551. getComponentUrl(id) {
  12552. return "ui://game/" + id;
  12553. }
  12554. getAnimation() {
  12555. }
  12556. judgeSkillType(type = SkillType.highSpace) {
  12557. if (this.gameMode == GameMode.classic)
  12558. return;
  12559. let gameMgr = this.gameMgr;
  12560. if (gameMgr.selfTurn) {
  12561. if (gameMgr.selfCurSkill == type) {
  12562. return true;
  12563. }
  12564. }
  12565. else {
  12566. if (gameMgr.aiCurSkill == type) {
  12567. return true;
  12568. }
  12569. }
  12570. }
  12571. ballColliHole(collider) {
  12572. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12573. xGame.common.gameMgr.isFirstInGame = false;
  12574. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12575. }
  12576. collider.owner.mySrc.checkWrongBall();
  12577. }
  12578. getArrMaxEle(arr) {
  12579. let max = -Infinity;
  12580. for (let index = 0; index < arr.length; index++) {
  12581. max = Math.max(arr[index], max);
  12582. }
  12583. return max;
  12584. }
  12585. getArrMinEle(arr) {
  12586. let min = Infinity;
  12587. for (let index = 0; index < arr.length; index++) {
  12588. min = Math.min(arr[index], min);
  12589. }
  12590. return min;
  12591. }
  12592. playRandomMutiBallBigSkillSound() {
  12593. if (Math.random() <= 0.5)
  12594. return;
  12595. let rand = this.randomNum(1, 6);
  12596. let str = "ganfa0" + rand;
  12597. xGame.soundMgr.playSound(str);
  12598. }
  12599. showOneCamera(type) {
  12600. let object = xGame.common.d3World.cameraObj;
  12601. for (const key in object) {
  12602. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12603. object[key].init();
  12604. object[key].owner.active = key == type;
  12605. }
  12606. }
  12607. }
  12608. checkBallOverBorder(x, y) {
  12609. let radius = 17;
  12610. let condition = this._checkBorder(x + radius, y) ||
  12611. this._checkBorder(x - radius, y) ||
  12612. this._checkBorder(x, y + radius) ||
  12613. this._checkBorder(x, y - radius);
  12614. if (condition) {
  12615. return true;
  12616. }
  12617. }
  12618. _checkBorder(x, y) {
  12619. let borderRect = this.d2World.borderRect;
  12620. let xOffest = 20;
  12621. let yOffest = 20;
  12622. if (y <= borderRect.y - yOffest) {
  12623. return true;
  12624. }
  12625. if (y >= borderRect.y + borderRect.height + yOffest) {
  12626. return true;
  12627. }
  12628. if (x <= borderRect.x - xOffest) {
  12629. return true;
  12630. }
  12631. if (x >= borderRect.x + borderRect.width + xOffest) {
  12632. return true;
  12633. }
  12634. }
  12635. initWeight(cfg) {
  12636. let allCfgData = { data: {}, allWeightNum: 0 };
  12637. let weightCfg = allCfgData.data;
  12638. let weight = 0;
  12639. for (const key in cfg) {
  12640. weightCfg[key] = {};
  12641. weightCfg[key].id = cfg[key].id;
  12642. weightCfg[key].minWeight = weight;
  12643. weight += cfg[key].weight;
  12644. weightCfg[key].maxWeight = weight;
  12645. }
  12646. allCfgData.allWeightNum = weight;
  12647. return allCfgData;
  12648. }
  12649. getRandomWeightData(cfg) {
  12650. let weightCfg = cfg.data;
  12651. let allWeightNum = cfg.allWeightNum;
  12652. let rand = Math.floor(Math.random() * allWeightNum);
  12653. for (const key in weightCfg) {
  12654. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12655. return weightCfg[key];
  12656. }
  12657. }
  12658. return weightCfg[1];
  12659. }
  12660. showGirlTalkPop(wordsIndex, node, msgNode) {
  12661. node.visible = true;
  12662. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12663. node.t0.play(Laya.Handler.create(this, () => {
  12664. node.visible = false;
  12665. }));
  12666. }
  12667. stopGirlPop(node) {
  12668. node.t0.stop();
  12669. node.visible = false;
  12670. }
  12671. createHead(loader, url, size = 107) {
  12672. if (Laya.Browser.name == "Browser") {
  12673. loader.url = url;
  12674. return;
  12675. }
  12676. else {
  12677. console.log('zh:url=', url);
  12678. loader.url = url;
  12679. }
  12680. }
  12681. addTestCoin(num) {
  12682. DataMgr.setCoin(num);
  12683. }
  12684. addTestDiamond(num) {
  12685. DataMgr.setDiamond(num);
  12686. }
  12687. addTestSkill() {
  12688. DataMgr.setBigSkill(0, 99);
  12689. DataMgr.setBigSkill(1, 99);
  12690. DataMgr.setBigSkill(2, 99);
  12691. }
  12692. playClassicEmotion(number, x, y) {
  12693. if (this.gameMode == GameMode.bigMove)
  12694. return;
  12695. let randIndex = this.randomNum(0, 2);
  12696. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12697. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12698. if (this.gameMgr.selfTurn) {
  12699. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12700. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12701. }
  12702. else {
  12703. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12704. }
  12705. else {
  12706. if (number == this.gameMgr.blackNum) {
  12707. if (this.gameMgr.selfBallArr.length == 0) {
  12708. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12709. }
  12710. else {
  12711. }
  12712. }
  12713. else {
  12714. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12715. }
  12716. }
  12717. }
  12718. }
  12719. else {
  12720. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12721. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12722. }
  12723. else {
  12724. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12725. }
  12726. else {
  12727. if (number == this.gameMgr.blackNum) {
  12728. if (this.gameMgr.aiBallArr.length == 0) {
  12729. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12730. }
  12731. else {
  12732. }
  12733. }
  12734. else {
  12735. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12736. }
  12737. }
  12738. }
  12739. }
  12740. }
  12741. playHappySound(number) {
  12742. if (this.gameMode != GameMode.classic)
  12743. return;
  12744. if (number == 8)
  12745. return;
  12746. let play = false;
  12747. if (this.gameMgr.selfTurn) {
  12748. if (this.gameMgr.ensureBallType) {
  12749. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12750. play = true;
  12751. }
  12752. }
  12753. else {
  12754. play = true;
  12755. }
  12756. }
  12757. else {
  12758. if (this.gameMgr.ensureBallType) {
  12759. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12760. play = true;
  12761. }
  12762. }
  12763. else {
  12764. play = true;
  12765. }
  12766. }
  12767. if (play)
  12768. xGame.soundMgr.playSound("applause");
  12769. }
  12770. destroyClassicEmotion() {
  12771. if (this.gameMode == GameMode.bigMove)
  12772. return;
  12773. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12774. parent.destroyChildren();
  12775. }
  12776. playAwardSpine(x, y) {
  12777. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12778. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12779. this.awardSpine.play(data, 0, false, parent);
  12780. }
  12781. destroyAwardSpine() {
  12782. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12783. parent.destroyChildren();
  12784. }
  12785. isBlock(bx, by, hx, hy, except = null) {
  12786. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12787. let balls = xGame.common.d2World.ballArr;
  12788. let outArr = [];
  12789. for (let index = 0; index < balls.length; index++) {
  12790. let obj = balls[index];
  12791. if (obj.number == 0)
  12792. continue;
  12793. if (obj == except)
  12794. continue;
  12795. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12796. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12797. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12798. if (num >= 1)
  12799. num = 1;
  12800. if (num < 0)
  12801. continue;
  12802. let gap = Math.sin(Math.acos(num)) * dis;
  12803. if (gap < this.ballSize) {
  12804. outArr.push({
  12805. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12806. disHon: Math.cos(Math.acos(num)) * dis,
  12807. disVer: Math.sin(Math.acos(num)) * dis,
  12808. src: balls[index],
  12809. dir: this.tempDir1
  12810. });
  12811. }
  12812. }
  12813. if (outArr.length > 0) {
  12814. outArr.sort((a, b) => { return a.dis - b.dis; });
  12815. return outArr[0];
  12816. }
  12817. }
  12818. AngleBetween(vector1, vector2) {
  12819. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12820. return rad * (180 / Math.PI);
  12821. }
  12822. getSecretaryScale() {
  12823. if (this.secretary.spineName == "mishu") {
  12824. return 1.28;
  12825. }
  12826. else {
  12827. return 1.024;
  12828. }
  12829. }
  12830. signAwardContainsRod(arr) {
  12831. let temp;
  12832. for (let index = 0; index < arr.length; index++) {
  12833. temp = arr[index].split('-')[0];
  12834. if (parseInt(temp) > 2) {
  12835. return true;
  12836. }
  12837. }
  12838. }
  12839. judgeSameDay() {
  12840. let lastTime = DataMgr.getSignTime();
  12841. let curTime = new Date().getTime();
  12842. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  12843. return true;
  12844. }
  12845. return false;
  12846. }
  12847. getAward(arr, callback) {
  12848. let showTriple = arr[0].type <= 2;
  12849. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  12850. let temp;
  12851. for (let index = 0; index < arr.length; index++) {
  12852. temp = arr[index];
  12853. switch (temp.type) {
  12854. case 1:
  12855. this.playObjFlyAnim(temp.num, temp.type);
  12856. break;
  12857. case 2:
  12858. this.playObjFlyAnim(temp.num, temp.type);
  12859. break;
  12860. case 3:
  12861. case 4:
  12862. case 5:
  12863. case 6:
  12864. DataMgr.setBallRod(temp.type - 2, 1);
  12865. DataMgr.setCurBallRod(temp.type - 2);
  12866. break;
  12867. default:
  12868. break;
  12869. }
  12870. }
  12871. callback && callback(watchVideo);
  12872. });
  12873. }
  12874. getMoneyNode() {
  12875. let moneyNode;
  12876. let sign = xGame.uiMgr.getUI(UISign);
  12877. let draw = xGame.uiMgr.getUI(UIDraw);
  12878. let end = xGame.uiMgr.getUI(UIGameEnd);
  12879. let skill = xGame.uiMgr.getUI(UISkill);
  12880. if (sign && !sign.isHide)
  12881. moneyNode = sign.ui.moneyNode;
  12882. if (draw && !draw.isHide)
  12883. moneyNode = draw.ui.moneyNode;
  12884. if (end && !end.isHide)
  12885. moneyNode = end.ui.moneyNode;
  12886. if (skill && !skill.isHide)
  12887. moneyNode = skill.ui.moneyNode;
  12888. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  12889. let main = xGame.uiMgr.getUI(UIMain);
  12890. if (condition1 && main && !main.isHide) {
  12891. moneyNode = main.ui.moneyNode;
  12892. }
  12893. return moneyNode;
  12894. }
  12895. playObjFlyAnim(num, type, callback = null) {
  12896. this.stPos.x = Laya.stage.width / 2;
  12897. this.stPos.y = Laya.stage.height / 2;
  12898. let moneyNode = this.getMoneyNode();
  12899. switch (type) {
  12900. case Prop.diamond:
  12901. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  12902. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  12903. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  12904. this.edPos.x /= 2;
  12905. this.edPos.y /= 2;
  12906. break;
  12907. case Prop.coin:
  12908. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  12909. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  12910. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  12911. this.edPos.x /= 2;
  12912. this.edPos.y /= 2;
  12913. break;
  12914. default:
  12915. break;
  12916. }
  12917. xGame.soundMgr.playSound("coinbag");
  12918. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  12919. switch (type) {
  12920. case Prop.diamond:
  12921. DataMgr.setDiamond(num);
  12922. break;
  12923. case Prop.coin:
  12924. DataMgr.setCoin(num);
  12925. break;
  12926. default:
  12927. break;
  12928. }
  12929. callback && callback();
  12930. });
  12931. }
  12932. autoPopUIView() {
  12933. let arr = [];
  12934. let sign = this.judgeSameDay() ? false : true;
  12935. if (sign)
  12936. arr.push("sign");
  12937. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  12938. if (draw)
  12939. arr.push("draw");
  12940. if (arr.length <= 0)
  12941. return;
  12942. let str = this.getRandArrEle(arr);
  12943. switch (str) {
  12944. case "sign":
  12945. xGame.uiMgr.Show(UISign);
  12946. break;
  12947. case "draw":
  12948. xGame.uiMgr.Show(UIDraw);
  12949. break;
  12950. default:
  12951. break;
  12952. }
  12953. }
  12954. getMSTime(time) {
  12955. let min = Math.floor(time / 60);
  12956. let sec = Math.floor((time - min * 60));
  12957. if (sec < 10)
  12958. sec = "0" + sec;
  12959. if (min < 10)
  12960. min = "0" + min;
  12961. return `${min}:${sec}`;
  12962. }
  12963. testPower() {
  12964. DataMgr.setPower(0, false);
  12965. }
  12966. getAllStarNum() {
  12967. let data = DataMgr.getPlaceBallLevelList();
  12968. let out = 0;
  12969. for (let index = 0; index < data.length; index++) {
  12970. out += data[index].star;
  12971. }
  12972. return out;
  12973. }
  12974. recoverCameraView() {
  12975. Laya.timer.once(900, this, () => {
  12976. xGame.common.showOneCamera("mainCamera");
  12977. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  12978. xGame.common.gameUI.ui.d2Node.alpha = 1;
  12979. xGame.common.gameUI.ui.border.alpha = 0;
  12980. if (Laya.physicsTimer.scale < 1) {
  12981. Laya.physicsTimer.scale = 1;
  12982. }
  12983. }
  12984. });
  12985. }
  12986. getClassicLevel() {
  12987. let successTimes = DataMgr.getClassicTimes();
  12988. let needKey = "";
  12989. let lastKey = "";
  12990. let cfg = cfgTable.classictimesData;
  12991. let data;
  12992. for (const key in cfg) {
  12993. data = cfg[key];
  12994. if (successTimes <= data.times) {
  12995. needKey = key;
  12996. }
  12997. lastKey = key;
  12998. }
  12999. if (needKey == "")
  13000. needKey = lastKey;
  13001. return cfg[needKey];
  13002. }
  13003. }
  13004. Common._instance = null;
  13005. class ui_Component92 extends fgui.GComponent {
  13006. static createInstance() {
  13007. return (fgui.UIPackage.createObject("game", "Component92"));
  13008. }
  13009. onConstruct() {
  13010. this.n0 = (this.getChild("n0"));
  13011. }
  13012. }
  13013. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13014. class ui_Component129 extends fgui.GProgressBar {
  13015. static createInstance() {
  13016. return (fgui.UIPackage.createObject("game", "Component129"));
  13017. }
  13018. onConstruct() {
  13019. this.bar_v = (this.getChild("bar_v"));
  13020. this.n84 = (this.getChild("n84"));
  13021. }
  13022. }
  13023. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13024. class ui_Component130 extends fgui.GComponent {
  13025. static createInstance() {
  13026. return (fgui.UIPackage.createObject("game", "Component130"));
  13027. }
  13028. onConstruct() {
  13029. this.ani = (this.getChild("ani"));
  13030. this.t0 = this.getTransition("t0");
  13031. }
  13032. }
  13033. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13034. class ui_powerEft extends fgui.GComponent {
  13035. static createInstance() {
  13036. return (fgui.UIPackage.createObject("game", "powerEft"));
  13037. }
  13038. onConstruct() {
  13039. this.ani = (this.getChild("ani"));
  13040. this.n88 = (this.getChild("n88"));
  13041. this.n89 = (this.getChild("n89"));
  13042. }
  13043. }
  13044. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13045. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13046. static createInstance() {
  13047. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13048. }
  13049. onConstruct() {
  13050. this.c1 = this.getController("c1");
  13051. this.n2 = (this.getChild("n2"));
  13052. this.n22 = (this.getChild("n22"));
  13053. this.n23 = (this.getChild("n23"));
  13054. this.n15 = (this.getChild("n15"));
  13055. this.challenge = (this.getChild("challenge"));
  13056. this.n17 = (this.getChild("n17"));
  13057. this.n3 = (this.getChild("n3"));
  13058. this.starNode = (this.getChild("starNode"));
  13059. this.levelTxt = (this.getChild("levelTxt"));
  13060. this.n14 = (this.getChild("n14"));
  13061. this.n19 = (this.getChild("n19"));
  13062. this.n20 = (this.getChild("n20"));
  13063. this.n21 = (this.getChild("n21"));
  13064. this.special = (this.getChild("special"));
  13065. }
  13066. }
  13067. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13068. class ui_Component79 extends fgui.GComponent {
  13069. static createInstance() {
  13070. return (fgui.UIPackage.createObject("game", "Component79"));
  13071. }
  13072. onConstruct() {
  13073. this.c1 = this.getController("c1");
  13074. this.n7 = (this.getChild("n7"));
  13075. this.n8 = (this.getChild("n8"));
  13076. this.n9 = (this.getChild("n9"));
  13077. this.n10 = (this.getChild("n10"));
  13078. this.n11 = (this.getChild("n11"));
  13079. this.n12 = (this.getChild("n12"));
  13080. }
  13081. }
  13082. ui_Component79.URL = "ui://isxx5ak7avag477";
  13083. class ui_Component80 extends fgui.GComponent {
  13084. static createInstance() {
  13085. return (fgui.UIPackage.createObject("game", "Component80"));
  13086. }
  13087. onConstruct() {
  13088. this.n0 = (this.getChild("n0"));
  13089. this.n1 = (this.getChild("n1"));
  13090. this.myList = (this.getChild("myList"));
  13091. this.t0 = this.getTransition("t0");
  13092. }
  13093. }
  13094. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13095. class ui_SignNormal extends fgui.GComponent {
  13096. static createInstance() {
  13097. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13098. }
  13099. onConstruct() {
  13100. this.c1 = this.getController("c1");
  13101. this.n7 = (this.getChild("n7"));
  13102. this.n15 = (this.getChild("n15"));
  13103. this.titleTxt = (this.getChild("titleTxt"));
  13104. this.n8 = (this.getChild("n8"));
  13105. this.myIcon = (this.getChild("myIcon"));
  13106. this.numTxt = (this.getChild("numTxt"));
  13107. this.n12 = (this.getChild("n12"));
  13108. this.n13 = (this.getChild("n13"));
  13109. this.n17 = (this.getChild("n17"));
  13110. this.n14 = (this.getChild("n14"));
  13111. }
  13112. }
  13113. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13114. class ui_Button_reg extends fgui.GButton {
  13115. static createInstance() {
  13116. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13117. }
  13118. onConstruct() {
  13119. this.button = this.getController("button");
  13120. this.n6 = (this.getChild("n6"));
  13121. }
  13122. }
  13123. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13124. class ui_screenNode extends fgui.GComponent {
  13125. static createInstance() {
  13126. return (fgui.UIPackage.createObject("game", "screenNode"));
  13127. }
  13128. onConstruct() {
  13129. this.n9 = (this.getChild("n9"));
  13130. this.screenImg = (this.getChild("screenImg"));
  13131. }
  13132. }
  13133. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13134. class ui_GetAwrad_com1 extends fgui.GComponent {
  13135. static createInstance() {
  13136. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13137. }
  13138. onConstruct() {
  13139. this.n38 = (this.getChild("n38"));
  13140. this.n39 = (this.getChild("n39"));
  13141. this.n40 = (this.getChild("n40"));
  13142. this.t0 = this.getTransition("t0");
  13143. this.t1 = this.getTransition("t1");
  13144. }
  13145. }
  13146. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13147. class ui_GetAwrad_com2 extends fgui.GComponent {
  13148. static createInstance() {
  13149. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13150. }
  13151. onConstruct() {
  13152. this.n39 = (this.getChild("n39"));
  13153. this.n40 = (this.getChild("n40"));
  13154. this.t0 = this.getTransition("t0");
  13155. }
  13156. }
  13157. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13158. class ui_Component128 extends fgui.GComponent {
  13159. static createInstance() {
  13160. return (fgui.UIPackage.createObject("game", "Component128"));
  13161. }
  13162. onConstruct() {
  13163. this.n38 = (this.getChild("n38"));
  13164. this.n40 = (this.getChild("n40"));
  13165. }
  13166. }
  13167. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13168. class ui_Component100_1 extends fgui.GComponent {
  13169. static createInstance() {
  13170. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13171. }
  13172. onConstruct() {
  13173. this.myNode = (this.getChild("myNode"));
  13174. this.t0 = this.getTransition("t0");
  13175. }
  13176. }
  13177. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13178. class ui_Component142 extends fgui.GComponent {
  13179. static createInstance() {
  13180. return (fgui.UIPackage.createObject("game", "Component142"));
  13181. }
  13182. onConstruct() {
  13183. this.n41 = (this.getChild("n41"));
  13184. this.n42 = (this.getChild("n42"));
  13185. }
  13186. }
  13187. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13188. class ui_main_guang extends fgui.GComponent {
  13189. static createInstance() {
  13190. return (fgui.UIPackage.createObject("game", "main_guang"));
  13191. }
  13192. onConstruct() {
  13193. this.n1 = (this.getChild("n1"));
  13194. this.n2 = (this.getChild("n2"));
  13195. this.n3 = (this.getChild("n3"));
  13196. this.n4 = (this.getChild("n4"));
  13197. this.n5 = (this.getChild("n5"));
  13198. this.n6 = (this.getChild("n6"));
  13199. this.n8 = (this.getChild("n8"));
  13200. this.t0 = this.getTransition("t0");
  13201. }
  13202. }
  13203. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13204. class ui_try_com1 extends fgui.GComponent {
  13205. static createInstance() {
  13206. return (fgui.UIPackage.createObject("game", "try_com1"));
  13207. }
  13208. onConstruct() {
  13209. this.c1 = this.getController("c1");
  13210. this.n0 = (this.getChild("n0"));
  13211. this.n2 = (this.getChild("n2"));
  13212. this.cancelBtn = (this.getChild("cancelBtn"));
  13213. this.videoBtn = (this.getChild("videoBtn"));
  13214. this.n9 = (this.getChild("n9"));
  13215. this.n24 = (this.getChild("n24"));
  13216. this.titleTxt = (this.getChild("titleTxt"));
  13217. this.n32 = (this.getChild("n32"));
  13218. this.n29 = (this.getChild("n29"));
  13219. this.n36 = (this.getChild("n36"));
  13220. this.txtTime = (this.getChild("txtTime"));
  13221. this.t0 = this.getTransition("t0");
  13222. }
  13223. }
  13224. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13225. class ui_try_com2 extends fgui.GComponent {
  13226. static createInstance() {
  13227. return (fgui.UIPackage.createObject("game", "try_com2"));
  13228. }
  13229. onConstruct() {
  13230. this.skillicon = (this.getChild("skillicon"));
  13231. this.n35 = (this.getChild("n35"));
  13232. this.n31 = (this.getChild("n31"));
  13233. this.n32 = (this.getChild("n32"));
  13234. this.n33 = (this.getChild("n33"));
  13235. this.n34 = (this.getChild("n34"));
  13236. }
  13237. }
  13238. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13239. class ui_try_com3 extends fgui.GComponent {
  13240. static createInstance() {
  13241. return (fgui.UIPackage.createObject("game", "try_com3"));
  13242. }
  13243. onConstruct() {
  13244. this.n33 = (this.getChild("n33"));
  13245. this.n34 = (this.getChild("n34"));
  13246. this.n35 = (this.getChild("n35"));
  13247. this.t0 = this.getTransition("t0");
  13248. }
  13249. }
  13250. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13251. class ui_huihe1 extends fgui.GComponent {
  13252. static createInstance() {
  13253. return (fgui.UIPackage.createObject("game", "huihe1"));
  13254. }
  13255. onConstruct() {
  13256. this.n0 = (this.getChild("n0"));
  13257. this.n1 = (this.getChild("n1"));
  13258. this.t0 = this.getTransition("t0");
  13259. }
  13260. }
  13261. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13262. class ui_huihe2 extends fgui.GComponent {
  13263. static createInstance() {
  13264. return (fgui.UIPackage.createObject("game", "huihe2"));
  13265. }
  13266. onConstruct() {
  13267. this.n0 = (this.getChild("n0"));
  13268. this.n1 = (this.getChild("n1"));
  13269. this.t0 = this.getTransition("t0");
  13270. }
  13271. }
  13272. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13273. class ui_Component143 extends fgui.GComponent {
  13274. static createInstance() {
  13275. return (fgui.UIPackage.createObject("game", "Component143"));
  13276. }
  13277. onConstruct() {
  13278. this.n3 = (this.getChild("n3"));
  13279. this.n4 = (this.getChild("n4"));
  13280. this.n5 = (this.getChild("n5"));
  13281. this.n6 = (this.getChild("n6"));
  13282. this.n7 = (this.getChild("n7"));
  13283. this.n8 = (this.getChild("n8"));
  13284. this.n9 = (this.getChild("n9"));
  13285. this.n10 = (this.getChild("n10"));
  13286. this.t0 = this.getTransition("t0");
  13287. }
  13288. }
  13289. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13290. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13291. static createInstance() {
  13292. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13293. }
  13294. onConstruct() {
  13295. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13296. }
  13297. }
  13298. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13299. class ui_dh_jingbi2 extends fgui.GComponent {
  13300. static createInstance() {
  13301. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13302. }
  13303. onConstruct() {
  13304. this.n0 = (this.getChild("n0"));
  13305. this.n1 = (this.getChild("n1"));
  13306. this.n2 = (this.getChild("n2"));
  13307. this.n3 = (this.getChild("n3"));
  13308. this.n4 = (this.getChild("n4"));
  13309. this.n5 = (this.getChild("n5"));
  13310. this.n6 = (this.getChild("n6"));
  13311. this.n8 = (this.getChild("n8"));
  13312. this.n10 = (this.getChild("n10"));
  13313. this.t0 = this.getTransition("t0");
  13314. }
  13315. }
  13316. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13317. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13318. static createInstance() {
  13319. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13320. }
  13321. onConstruct() {
  13322. this.n1 = (this.getChild("n1"));
  13323. this.n4 = (this.getChild("n4"));
  13324. this.t0 = this.getTransition("t0");
  13325. }
  13326. }
  13327. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13328. class ui_dh_jingbi3 extends fgui.GComponent {
  13329. static createInstance() {
  13330. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13331. }
  13332. onConstruct() {
  13333. this.n0 = (this.getChild("n0"));
  13334. this.n1 = (this.getChild("n1"));
  13335. this.n2 = (this.getChild("n2"));
  13336. this.n3 = (this.getChild("n3"));
  13337. this.n4 = (this.getChild("n4"));
  13338. this.n5 = (this.getChild("n5"));
  13339. this.n6 = (this.getChild("n6"));
  13340. this.n8 = (this.getChild("n8"));
  13341. this.n10 = (this.getChild("n10"));
  13342. this.t0 = this.getTransition("t0");
  13343. }
  13344. }
  13345. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13346. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13347. static createInstance() {
  13348. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13349. }
  13350. onConstruct() {
  13351. this.n3 = (this.getChild("n3"));
  13352. this.n1 = (this.getChild("n1"));
  13353. this.t0 = this.getTransition("t0");
  13354. }
  13355. }
  13356. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13357. class ui_hb_jinbi1 extends fgui.GButton {
  13358. static createInstance() {
  13359. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13360. }
  13361. onConstruct() {
  13362. this.n20 = (this.getChild("n20"));
  13363. this.n25 = (this.getChild("n25"));
  13364. this.coinTxt = (this.getChild("coinTxt"));
  13365. this.n28 = (this.getChild("n28"));
  13366. this.n32 = (this.getChild("n32"));
  13367. this.n38 = (this.getChild("n38"));
  13368. this.n45 = (this.getChild("n45"));
  13369. this.getTips = (this.getChild("getTips"));
  13370. this.n39 = (this.getChild("n39"));
  13371. this.diamondTxt = (this.getChild("diamondTxt"));
  13372. this.n41 = (this.getChild("n41"));
  13373. this.n42 = (this.getChild("n42"));
  13374. this.n46 = (this.getChild("n46"));
  13375. this.n47 = (this.getChild("n47"));
  13376. this.n48 = (this.getChild("n48"));
  13377. this.t0 = this.getTransition("t0");
  13378. }
  13379. }
  13380. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13381. class ui_hb_jinbi2 extends fgui.GButton {
  13382. static createInstance() {
  13383. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13384. }
  13385. onConstruct() {
  13386. this.n20 = (this.getChild("n20"));
  13387. this.n25 = (this.getChild("n25"));
  13388. this.coinTxt = (this.getChild("coinTxt"));
  13389. this.n28 = (this.getChild("n28"));
  13390. this.n32 = (this.getChild("n32"));
  13391. this.n38 = (this.getChild("n38"));
  13392. this.n39 = (this.getChild("n39"));
  13393. this.diamondTxt = (this.getChild("diamondTxt"));
  13394. this.n41 = (this.getChild("n41"));
  13395. this.n42 = (this.getChild("n42"));
  13396. this.n43 = (this.getChild("n43"));
  13397. this.n44 = (this.getChild("n44"));
  13398. this.n45 = (this.getChild("n45"));
  13399. this.t0 = this.getTransition("t0");
  13400. }
  13401. }
  13402. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13403. class ui_hb_jinbi3 extends fgui.GButton {
  13404. static createInstance() {
  13405. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13406. }
  13407. onConstruct() {
  13408. this.n20 = (this.getChild("n20"));
  13409. this.n25 = (this.getChild("n25"));
  13410. this.coinTxt = (this.getChild("coinTxt"));
  13411. this.n28 = (this.getChild("n28"));
  13412. this.n32 = (this.getChild("n32"));
  13413. this.n38 = (this.getChild("n38"));
  13414. this.n39 = (this.getChild("n39"));
  13415. this.diamondTxt = (this.getChild("diamondTxt"));
  13416. this.n41 = (this.getChild("n41"));
  13417. this.n42 = (this.getChild("n42"));
  13418. this.n43 = (this.getChild("n43"));
  13419. this.n44 = (this.getChild("n44"));
  13420. this.n45 = (this.getChild("n45"));
  13421. this.t0 = this.getTransition("t0");
  13422. }
  13423. }
  13424. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13425. class ui_Component104 extends fgui.GComponent {
  13426. static createInstance() {
  13427. return (fgui.UIPackage.createObject("game", "Component104"));
  13428. }
  13429. onConstruct() {
  13430. this.c1 = this.getController("c1");
  13431. this.n12 = (this.getChild("n12"));
  13432. this.coinBtn = (this.getChild("coinBtn"));
  13433. this.diamondBtn = (this.getChild("diamondBtn"));
  13434. this.node3 = (this.getChild("node3"));
  13435. this.node4 = (this.getChild("node4"));
  13436. this.node5 = (this.getChild("node5"));
  13437. this.node1 = (this.getChild("node1"));
  13438. this.node2 = (this.getChild("node2"));
  13439. this.node6 = (this.getChild("node6"));
  13440. this.t0 = this.getTransition("t0");
  13441. }
  13442. }
  13443. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13444. class ui_Component105 extends fgui.GButton {
  13445. static createInstance() {
  13446. return (fgui.UIPackage.createObject("game", "Component105"));
  13447. }
  13448. onConstruct() {
  13449. this.c1 = this.getController("c1");
  13450. this.n49 = (this.getChild("n49"));
  13451. this.n18 = (this.getChild("n18"));
  13452. this.n46 = (this.getChild("n46"));
  13453. this.n48 = (this.getChild("n48"));
  13454. }
  13455. }
  13456. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13457. class ui_Component106 extends fgui.GButton {
  13458. static createInstance() {
  13459. return (fgui.UIPackage.createObject("game", "Component106"));
  13460. }
  13461. onConstruct() {
  13462. this.c1 = this.getController("c1");
  13463. this.n49 = (this.getChild("n49"));
  13464. this.n18 = (this.getChild("n18"));
  13465. this.n46 = (this.getChild("n46"));
  13466. this.n48 = (this.getChild("n48"));
  13467. }
  13468. }
  13469. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13470. class ui_hb_zs1 extends fgui.GButton {
  13471. static createInstance() {
  13472. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13473. }
  13474. onConstruct() {
  13475. this.c1 = this.getController("c1");
  13476. this.n20 = (this.getChild("n20"));
  13477. this.n21 = (this.getChild("n21"));
  13478. this.n26 = (this.getChild("n26"));
  13479. this.n27 = (this.getChild("n27"));
  13480. this.shareTxt = (this.getChild("shareTxt"));
  13481. this.n32 = (this.getChild("n32"));
  13482. this.n38 = (this.getChild("n38"));
  13483. this.n39 = (this.getChild("n39"));
  13484. this.n44 = (this.getChild("n44"));
  13485. this.diamondTxt = (this.getChild("diamondTxt"));
  13486. this.n41 = (this.getChild("n41"));
  13487. this.n45 = (this.getChild("n45"));
  13488. this.n47 = (this.getChild("n47"));
  13489. this.n48 = (this.getChild("n48"));
  13490. this.randTxt = (this.getChild("randTxt"));
  13491. this.n50 = (this.getChild("n50"));
  13492. this.t0 = this.getTransition("t0");
  13493. }
  13494. }
  13495. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13496. class ui_dh_zs1 extends fgui.GComponent {
  13497. static createInstance() {
  13498. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13499. }
  13500. onConstruct() {
  13501. this.n10 = (this.getChild("n10"));
  13502. this.n9 = (this.getChild("n9"));
  13503. this.n1 = (this.getChild("n1"));
  13504. this.n2 = (this.getChild("n2"));
  13505. this.n3 = (this.getChild("n3"));
  13506. this.n4 = (this.getChild("n4"));
  13507. this.n5 = (this.getChild("n5"));
  13508. this.n6 = (this.getChild("n6"));
  13509. this.n8 = (this.getChild("n8"));
  13510. this.n11 = (this.getChild("n11"));
  13511. this.t0 = this.getTransition("t0");
  13512. }
  13513. }
  13514. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13515. class ui_dh_zs1_1 extends fgui.GComponent {
  13516. static createInstance() {
  13517. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13518. }
  13519. onConstruct() {
  13520. this.n3 = (this.getChild("n3"));
  13521. this.n1 = (this.getChild("n1"));
  13522. this.t0 = this.getTransition("t0");
  13523. }
  13524. }
  13525. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13526. class ui_hb_zs2 extends fgui.GButton {
  13527. static createInstance() {
  13528. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13529. }
  13530. onConstruct() {
  13531. this.n20 = (this.getChild("n20"));
  13532. this.n21 = (this.getChild("n21"));
  13533. this.n26 = (this.getChild("n26"));
  13534. this.n27 = (this.getChild("n27"));
  13535. this.n32 = (this.getChild("n32"));
  13536. this.n38 = (this.getChild("n38"));
  13537. this.n39 = (this.getChild("n39"));
  13538. this.n44 = (this.getChild("n44"));
  13539. this.diamondTxt = (this.getChild("diamondTxt"));
  13540. this.n41 = (this.getChild("n41"));
  13541. this.n45 = (this.getChild("n45"));
  13542. this.t0 = this.getTransition("t0");
  13543. }
  13544. }
  13545. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13546. class ui_hb_zs3 extends fgui.GButton {
  13547. static createInstance() {
  13548. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13549. }
  13550. onConstruct() {
  13551. this.n20 = (this.getChild("n20"));
  13552. this.n21 = (this.getChild("n21"));
  13553. this.n26 = (this.getChild("n26"));
  13554. this.n27 = (this.getChild("n27"));
  13555. this.n32 = (this.getChild("n32"));
  13556. this.n38 = (this.getChild("n38"));
  13557. this.n47 = (this.getChild("n47"));
  13558. this.t0 = this.getTransition("t0");
  13559. }
  13560. }
  13561. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13562. class ui_dh_zs2 extends fgui.GComponent {
  13563. static createInstance() {
  13564. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13565. }
  13566. onConstruct() {
  13567. this.n10 = (this.getChild("n10"));
  13568. this.n9 = (this.getChild("n9"));
  13569. this.n1 = (this.getChild("n1"));
  13570. this.n2 = (this.getChild("n2"));
  13571. this.n3 = (this.getChild("n3"));
  13572. this.n4 = (this.getChild("n4"));
  13573. this.n5 = (this.getChild("n5"));
  13574. this.n6 = (this.getChild("n6"));
  13575. this.n8 = (this.getChild("n8"));
  13576. this.n11 = (this.getChild("n11"));
  13577. this.t0 = this.getTransition("t0");
  13578. }
  13579. }
  13580. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13581. class ui_dh_zs2_1 extends fgui.GComponent {
  13582. static createInstance() {
  13583. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13584. }
  13585. onConstruct() {
  13586. this.n3 = (this.getChild("n3"));
  13587. this.n1 = (this.getChild("n1"));
  13588. this.t0 = this.getTransition("t0");
  13589. }
  13590. }
  13591. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13592. class ui_dh_zs3 extends fgui.GComponent {
  13593. static createInstance() {
  13594. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13595. }
  13596. onConstruct() {
  13597. this.n10 = (this.getChild("n10"));
  13598. this.n9 = (this.getChild("n9"));
  13599. this.n1 = (this.getChild("n1"));
  13600. this.n2 = (this.getChild("n2"));
  13601. this.n3 = (this.getChild("n3"));
  13602. this.n4 = (this.getChild("n4"));
  13603. this.n5 = (this.getChild("n5"));
  13604. this.n6 = (this.getChild("n6"));
  13605. this.n8 = (this.getChild("n8"));
  13606. this.n11 = (this.getChild("n11"));
  13607. this.t0 = this.getTransition("t0");
  13608. }
  13609. }
  13610. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13611. class ui_dh_zs3_1 extends fgui.GComponent {
  13612. static createInstance() {
  13613. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13614. }
  13615. onConstruct() {
  13616. this.n3 = (this.getChild("n3"));
  13617. this.n1 = (this.getChild("n1"));
  13618. this.t0 = this.getTransition("t0");
  13619. }
  13620. }
  13621. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13622. class ui_Component107 extends fgui.GComponent {
  13623. static createInstance() {
  13624. return (fgui.UIPackage.createObject("game", "Component107"));
  13625. }
  13626. onConstruct() {
  13627. this.n18 = (this.getChild("n18"));
  13628. this.n19 = (this.getChild("n19"));
  13629. this.n20 = (this.getChild("n20"));
  13630. this.n21 = (this.getChild("n21"));
  13631. this.n22 = (this.getChild("n22"));
  13632. this.levelTxt = (this.getChild("levelTxt"));
  13633. this.t0 = this.getTransition("t0");
  13634. }
  13635. }
  13636. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13637. class ui_box_com1 extends fgui.GComponent {
  13638. static createInstance() {
  13639. return (fgui.UIPackage.createObject("game", "box_com1"));
  13640. }
  13641. onConstruct() {
  13642. this.n14 = (this.getChild("n14"));
  13643. this.n6 = (this.getChild("n6"));
  13644. this.t0 = this.getTransition("t0");
  13645. }
  13646. }
  13647. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13648. class ui_box_com2 extends fgui.GProgressBar {
  13649. static createInstance() {
  13650. return (fgui.UIPackage.createObject("game", "box_com2"));
  13651. }
  13652. onConstruct() {
  13653. this.bg0 = (this.getChild("bg0"));
  13654. this.bg = (this.getChild("bg"));
  13655. this.bar = (this.getChild("bar"));
  13656. this.n7 = (this.getChild("n7"));
  13657. this.n8 = (this.getChild("n8"));
  13658. this.n10 = (this.getChild("n10"));
  13659. this.n11 = (this.getChild("n11"));
  13660. this.n12 = (this.getChild("n12"));
  13661. }
  13662. }
  13663. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13664. class ui_box_com4 extends fgui.GComponent {
  13665. static createInstance() {
  13666. return (fgui.UIPackage.createObject("game", "box_com4"));
  13667. }
  13668. onConstruct() {
  13669. this.n8 = (this.getChild("n8"));
  13670. this.t0 = this.getTransition("t0");
  13671. }
  13672. }
  13673. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13674. class ui_box_com3 extends fgui.GComponent {
  13675. static createInstance() {
  13676. return (fgui.UIPackage.createObject("game", "box_com3"));
  13677. }
  13678. onConstruct() {
  13679. this.n2 = (this.getChild("n2"));
  13680. this.n3 = (this.getChild("n3"));
  13681. this.n4 = (this.getChild("n4"));
  13682. this.n5 = (this.getChild("n5"));
  13683. this.t0 = this.getTransition("t0");
  13684. this.t1 = this.getTransition("t1");
  13685. }
  13686. }
  13687. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13688. class ui_Component97 extends fgui.GComponent {
  13689. static createInstance() {
  13690. return (fgui.UIPackage.createObject("game", "Component97"));
  13691. }
  13692. onConstruct() {
  13693. this.c1 = this.getController("c1");
  13694. this.n46 = (this.getChild("n46"));
  13695. this.diamondNode = (this.getChild("diamondNode"));
  13696. this.coinNode = (this.getChild("coinNode"));
  13697. this.t0 = this.getTransition("t0");
  13698. }
  13699. }
  13700. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13701. class ui_Component98 extends fgui.GButton {
  13702. static createInstance() {
  13703. return (fgui.UIPackage.createObject("game", "Component98"));
  13704. }
  13705. onConstruct() {
  13706. this.n8 = (this.getChild("n8"));
  13707. this.n40 = (this.getChild("n40"));
  13708. }
  13709. }
  13710. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13711. class ui_Component28_11 extends fgui.GButton {
  13712. static createInstance() {
  13713. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13714. }
  13715. onConstruct() {
  13716. this.c1 = this.getController("c1");
  13717. this.n12 = (this.getChild("n12"));
  13718. this.n17 = (this.getChild("n17"));
  13719. this.n13 = (this.getChild("n13"));
  13720. this.diamondTxt = (this.getChild("diamondTxt"));
  13721. this.n15 = (this.getChild("n15"));
  13722. this.n16 = (this.getChild("n16"));
  13723. }
  13724. }
  13725. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13726. class ui_Component58_11 extends fgui.GComponent {
  13727. static createInstance() {
  13728. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13729. }
  13730. onConstruct() {
  13731. this.c1 = this.getController("c1");
  13732. this.n23 = (this.getChild("n23"));
  13733. this.n41 = (this.getChild("n41"));
  13734. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13735. this.n_daoju = (this.getChild("n_daoju"));
  13736. this.myList = (this.getChild("myList"));
  13737. this.djList = (this.getChild("djList"));
  13738. this.t0 = this.getTransition("t0");
  13739. }
  13740. }
  13741. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13742. class ui_Component100 extends fgui.GComponent {
  13743. static createInstance() {
  13744. return (fgui.UIPackage.createObject("game", "Component100"));
  13745. }
  13746. onConstruct() {
  13747. this.c1 = this.getController("c1");
  13748. this.n75 = (this.getChild("n75"));
  13749. this.n76 = (this.getChild("n76"));
  13750. this.n80 = (this.getChild("n80"));
  13751. this.txt = (this.getChild("txt"));
  13752. this.spineRoot = (this.getChild("spineRoot"));
  13753. }
  13754. }
  13755. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13756. class ui_Component101 extends fgui.GComponent {
  13757. static createInstance() {
  13758. return (fgui.UIPackage.createObject("game", "Component101"));
  13759. }
  13760. onConstruct() {
  13761. this.c1 = this.getController("c1");
  13762. this.n36 = (this.getChild("n36"));
  13763. this.n35 = (this.getChild("n35"));
  13764. this.n33 = (this.getChild("n33"));
  13765. this.n34 = (this.getChild("n34"));
  13766. }
  13767. }
  13768. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13769. class ui_Component53 extends fgui.GComponent {
  13770. static createInstance() {
  13771. return (fgui.UIPackage.createObject("game", "Component53"));
  13772. }
  13773. onConstruct() {
  13774. this.n0 = (this.getChild("n0"));
  13775. this.n1 = (this.getChild("n1"));
  13776. this.n2 = (this.getChild("n2"));
  13777. this.n3 = (this.getChild("n3"));
  13778. this.n4 = (this.getChild("n4"));
  13779. this.n5 = (this.getChild("n5"));
  13780. this.n6 = (this.getChild("n6"));
  13781. this.n7 = (this.getChild("n7"));
  13782. this.n8 = (this.getChild("n8"));
  13783. this.n9 = (this.getChild("n9"));
  13784. this.n10 = (this.getChild("n10"));
  13785. this.n11 = (this.getChild("n11"));
  13786. this.n12 = (this.getChild("n12"));
  13787. this.n13 = (this.getChild("n13"));
  13788. this.n14 = (this.getChild("n14"));
  13789. this.n15 = (this.getChild("n15"));
  13790. this.n16 = (this.getChild("n16"));
  13791. this.n19 = (this.getChild("n19"));
  13792. this.n20 = (this.getChild("n20"));
  13793. this.n21 = (this.getChild("n21"));
  13794. this.n22 = (this.getChild("n22"));
  13795. this.n23 = (this.getChild("n23"));
  13796. this.n24 = (this.getChild("n24"));
  13797. this.n25 = (this.getChild("n25"));
  13798. this.n26 = (this.getChild("n26"));
  13799. this.n27 = (this.getChild("n27"));
  13800. this.n28 = (this.getChild("n28"));
  13801. this.n29 = (this.getChild("n29"));
  13802. this.n30 = (this.getChild("n30"));
  13803. this.n31 = (this.getChild("n31"));
  13804. this.n32 = (this.getChild("n32"));
  13805. this.n33 = (this.getChild("n33"));
  13806. this.n34 = (this.getChild("n34"));
  13807. this.n35 = (this.getChild("n35"));
  13808. this.t0 = this.getTransition("t0");
  13809. }
  13810. }
  13811. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13812. class ui_Component58 extends fgui.GComponent {
  13813. static createInstance() {
  13814. return (fgui.UIPackage.createObject("game", "Component58"));
  13815. }
  13816. onConstruct() {
  13817. this.n23 = (this.getChild("n23"));
  13818. this.n41 = (this.getChild("n41"));
  13819. this.n8 = (this.getChild("n8"));
  13820. this.skillList = (this.getChild("skillList"));
  13821. this.t0 = this.getTransition("t0");
  13822. }
  13823. }
  13824. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13825. class ui_Component59 extends fgui.GComponent {
  13826. static createInstance() {
  13827. return (fgui.UIPackage.createObject("game", "Component59"));
  13828. }
  13829. onConstruct() {
  13830. this.n3 = (this.getChild("n3"));
  13831. this.msgTxt = (this.getChild("msgTxt"));
  13832. this.t0 = this.getTransition("t0");
  13833. }
  13834. }
  13835. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  13836. class ui_RulerNode extends fgui.GComponent {
  13837. static createInstance() {
  13838. return (fgui.UIPackage.createObject("game", "RulerNode"));
  13839. }
  13840. onConstruct() {
  13841. this.n6 = (this.getChild("n6"));
  13842. this.n4 = (this.getChild("n4"));
  13843. this.img1 = (this.getChild("img1"));
  13844. this.img2 = (this.getChild("img2"));
  13845. }
  13846. }
  13847. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  13848. class ui_Component108 extends fgui.GComponent {
  13849. static createInstance() {
  13850. return (fgui.UIPackage.createObject("game", "Component108"));
  13851. }
  13852. onConstruct() {
  13853. this.n19 = (this.getChild("n19"));
  13854. this.t0 = this.getTransition("t0");
  13855. }
  13856. }
  13857. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  13858. class ui_Component63 extends fgui.GComponent {
  13859. static createInstance() {
  13860. return (fgui.UIPackage.createObject("game", "Component63"));
  13861. }
  13862. onConstruct() {
  13863. this.n66 = (this.getChild("n66"));
  13864. this.n56 = (this.getChild("n56"));
  13865. this.n63 = (this.getChild("n63"));
  13866. this.n65 = (this.getChild("n65"));
  13867. this.t0 = this.getTransition("t0");
  13868. }
  13869. }
  13870. ui_Component63.URL = "ui://isxx5ak7h657452";
  13871. class ui_topNode extends fgui.GComponent {
  13872. static createInstance() {
  13873. return (fgui.UIPackage.createObject("game", "topNode"));
  13874. }
  13875. onConstruct() {
  13876. this.selfProgress = (this.getChild("selfProgress"));
  13877. this.aiProgress = (this.getChild("aiProgress"));
  13878. this.selfKuang = (this.getChild("selfKuang"));
  13879. this.aiKuang = (this.getChild("aiKuang"));
  13880. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  13881. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  13882. this.n33 = (this.getChild("n33"));
  13883. this.n34 = (this.getChild("n34"));
  13884. this.selfNameTxt = (this.getChild("selfNameTxt"));
  13885. this.aiNameTxt = (this.getChild("aiNameTxt"));
  13886. this.selfBallList = (this.getChild("selfBallList"));
  13887. this.aiBallList = (this.getChild("aiBallList"));
  13888. this.middleNode = (this.getChild("middleNode"));
  13889. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  13890. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  13891. this.scoreNode = (this.getChild("scoreNode"));
  13892. this.selfTips = (this.getChild("selfTips"));
  13893. this.aiTips = (this.getChild("aiTips"));
  13894. }
  13895. }
  13896. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  13897. class ui_selfProgress extends fgui.GProgressBar {
  13898. static createInstance() {
  13899. return (fgui.UIPackage.createObject("game", "selfProgress"));
  13900. }
  13901. onConstruct() {
  13902. this.n3 = (this.getChild("n3"));
  13903. this.bar = (this.getChild("bar"));
  13904. }
  13905. }
  13906. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  13907. class ui_aiProgress extends fgui.GProgressBar {
  13908. static createInstance() {
  13909. return (fgui.UIPackage.createObject("game", "aiProgress"));
  13910. }
  13911. onConstruct() {
  13912. this.n3 = (this.getChild("n3"));
  13913. this.bar = (this.getChild("bar"));
  13914. }
  13915. }
  13916. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  13917. class ui_ballDisplay extends fgui.GComponent {
  13918. static createInstance() {
  13919. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  13920. }
  13921. onConstruct() {
  13922. this.myImg = (this.getChild("myImg"));
  13923. }
  13924. }
  13925. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  13926. class ui_moveNode extends fgui.GComponent {
  13927. static createInstance() {
  13928. return (fgui.UIPackage.createObject("game", "moveNode"));
  13929. }
  13930. onConstruct() {
  13931. this.n8 = (this.getChild("n8"));
  13932. this.finger = (this.getChild("finger"));
  13933. }
  13934. }
  13935. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  13936. class ui_cancelBtn extends fgui.GButton {
  13937. static createInstance() {
  13938. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  13939. }
  13940. onConstruct() {
  13941. this.c1 = this.getController("c1");
  13942. this.n0 = (this.getChild("n0"));
  13943. this.n1 = (this.getChild("n1"));
  13944. }
  13945. }
  13946. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  13947. class ui_shareBtn extends fgui.GButton {
  13948. static createInstance() {
  13949. return (fgui.UIPackage.createObject("game", "shareBtn"));
  13950. }
  13951. onConstruct() {
  13952. this.c1 = this.getController("c1");
  13953. this.n2 = (this.getChild("n2"));
  13954. this.n1 = (this.getChild("n1"));
  13955. this.n3 = (this.getChild("n3"));
  13956. this.n4 = (this.getChild("n4"));
  13957. this.n5 = (this.getChild("n5"));
  13958. this.n6 = (this.getChild("n6"));
  13959. }
  13960. }
  13961. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  13962. class ui_share2Btn extends fgui.GButton {
  13963. static createInstance() {
  13964. return (fgui.UIPackage.createObject("game", "share2Btn"));
  13965. }
  13966. onConstruct() {
  13967. this.n3 = (this.getChild("n3"));
  13968. }
  13969. }
  13970. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  13971. class ui_rodMethodNode extends fgui.GComponent {
  13972. static createInstance() {
  13973. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  13974. }
  13975. onConstruct() {
  13976. this.bg = (this.getChild("bg"));
  13977. this.dot = (this.getChild("dot"));
  13978. }
  13979. }
  13980. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  13981. class ui_sureBtn extends fgui.GButton {
  13982. static createInstance() {
  13983. return (fgui.UIPackage.createObject("game", "sureBtn"));
  13984. }
  13985. onConstruct() {
  13986. this.n2 = (this.getChild("n2"));
  13987. this.n1 = (this.getChild("n1"));
  13988. }
  13989. }
  13990. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  13991. class ui_Component18 extends fgui.GComponent {
  13992. static createInstance() {
  13993. return (fgui.UIPackage.createObject("game", "Component18"));
  13994. }
  13995. onConstruct() {
  13996. this.c1 = this.getController("c1");
  13997. this.nameTxt = (this.getChild("nameTxt"));
  13998. this.headImg = (this.getChild("headImg"));
  13999. this.n24 = (this.getChild("n24"));
  14000. this.skillImg = (this.getChild("skillImg"));
  14001. this.skillTxt = (this.getChild("skillTxt"));
  14002. }
  14003. }
  14004. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14005. class ui_Component45 extends fgui.GComponent {
  14006. static createInstance() {
  14007. return (fgui.UIPackage.createObject("game", "Component45"));
  14008. }
  14009. onConstruct() {
  14010. this.c1 = this.getController("c1");
  14011. this.n40 = (this.getChild("n40"));
  14012. this.n41 = (this.getChild("n41"));
  14013. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14014. this.n42 = (this.getChild("n42"));
  14015. this.awardTxt = (this.getChild("awardTxt"));
  14016. this.n44 = (this.getChild("n44"));
  14017. this.t0 = this.getTransition("t0");
  14018. }
  14019. }
  14020. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14021. class ui_emotionDisplay extends fgui.GButton {
  14022. static createInstance() {
  14023. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14024. }
  14025. onConstruct() {
  14026. this.myIcon = (this.getChild("myIcon"));
  14027. }
  14028. }
  14029. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14030. class ui_Component49 extends fgui.GButton {
  14031. static createInstance() {
  14032. return (fgui.UIPackage.createObject("game", "Component49"));
  14033. }
  14034. onConstruct() {
  14035. this.n69 = (this.getChild("n69"));
  14036. this.n56 = (this.getChild("n56"));
  14037. }
  14038. }
  14039. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14040. class ui_Component50 extends fgui.GButton {
  14041. static createInstance() {
  14042. return (fgui.UIPackage.createObject("game", "Component50"));
  14043. }
  14044. onConstruct() {
  14045. this.n54 = (this.getChild("n54"));
  14046. this.n65 = (this.getChild("n65"));
  14047. }
  14048. }
  14049. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14050. class ui_Component51 extends fgui.GButton {
  14051. static createInstance() {
  14052. return (fgui.UIPackage.createObject("game", "Component51"));
  14053. }
  14054. onConstruct() {
  14055. this.c1 = this.getController("c1");
  14056. this.n51 = (this.getChild("n51"));
  14057. this.n54 = (this.getChild("n54"));
  14058. }
  14059. }
  14060. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14061. class ui_Button5 extends fgui.GButton {
  14062. static createInstance() {
  14063. return (fgui.UIPackage.createObject("game", "Button5"));
  14064. }
  14065. onConstruct() {
  14066. this.c1 = this.getController("c1");
  14067. this.n0 = (this.getChild("n0"));
  14068. this.n2 = (this.getChild("n2"));
  14069. }
  14070. }
  14071. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14072. class ui_Component124 extends fgui.GComponent {
  14073. static createInstance() {
  14074. return (fgui.UIPackage.createObject("game", "Component124"));
  14075. }
  14076. onConstruct() {
  14077. this.n22 = (this.getChild("n22"));
  14078. this.shareNode = (this.getChild("shareNode"));
  14079. }
  14080. }
  14081. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14082. class ui_Component125 extends fgui.GComponent {
  14083. static createInstance() {
  14084. return (fgui.UIPackage.createObject("game", "Component125"));
  14085. }
  14086. onConstruct() {
  14087. this.n29 = (this.getChild("n29"));
  14088. this.coinTxt = (this.getChild("coinTxt"));
  14089. }
  14090. }
  14091. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14092. class ui_Component52 extends fgui.GButton {
  14093. static createInstance() {
  14094. return (fgui.UIPackage.createObject("game", "Component52"));
  14095. }
  14096. onConstruct() {
  14097. this.n35 = (this.getChild("n35"));
  14098. this.n36 = (this.getChild("n36"));
  14099. }
  14100. }
  14101. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14102. class ui_Component_denglu extends fgui.GComponent {
  14103. static createInstance() {
  14104. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14105. }
  14106. onConstruct() {
  14107. this.c1 = this.getController("c1");
  14108. this.n102 = (this.getChild("n102"));
  14109. this.n103 = (this.getChild("n103"));
  14110. }
  14111. }
  14112. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14113. class ui_UIFuli1 extends fgui.GComponent {
  14114. static createInstance() {
  14115. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  14116. }
  14117. onConstruct() {
  14118. this.n1 = (this.getChild("n1"));
  14119. this.n2 = (this.getChild("n2"));
  14120. }
  14121. }
  14122. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  14123. class ui_Component_fl_1 extends fgui.GComponent {
  14124. static createInstance() {
  14125. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14126. }
  14127. onConstruct() {
  14128. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14129. this.txt_price = (this.getChild("txt_price"));
  14130. this.n_no = (this.getChild("n_no"));
  14131. this.n_buy = (this.getChild("n_buy"));
  14132. }
  14133. }
  14134. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14135. class ui_Component_fl_2 extends fgui.GComponent {
  14136. static createInstance() {
  14137. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14138. }
  14139. onConstruct() {
  14140. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14141. this.txt_price = (this.getChild("txt_price"));
  14142. this.n_no = (this.getChild("n_no"));
  14143. this.n_buy = (this.getChild("n_buy"));
  14144. }
  14145. }
  14146. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14147. class ui_UIFuli2 extends fgui.GComponent {
  14148. static createInstance() {
  14149. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  14150. }
  14151. onConstruct() {
  14152. this.n1 = (this.getChild("n1"));
  14153. this.n2 = (this.getChild("n2"));
  14154. }
  14155. }
  14156. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  14157. class ui_drawBtn extends fgui.GButton {
  14158. static createInstance() {
  14159. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14160. }
  14161. onConstruct() {
  14162. this.c1 = this.getController("c1");
  14163. this.n2 = (this.getChild("n2"));
  14164. this.n1 = (this.getChild("n1"));
  14165. this.n5 = (this.getChild("n5"));
  14166. }
  14167. }
  14168. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14169. class ui_Component43 extends fgui.GButton {
  14170. static createInstance() {
  14171. return (fgui.UIPackage.createObject("game", "Component43"));
  14172. }
  14173. onConstruct() {
  14174. this.n49 = (this.getChild("n49"));
  14175. }
  14176. }
  14177. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14178. class ui_wordsDisplay extends fgui.GComponent {
  14179. static createInstance() {
  14180. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14181. }
  14182. onConstruct() {
  14183. this.txt = (this.getChild("txt"));
  14184. this.n63 = (this.getChild("n63"));
  14185. }
  14186. }
  14187. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14188. class ui_Component_phb extends fgui.GComponent {
  14189. static createInstance() {
  14190. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14191. }
  14192. onConstruct() {
  14193. this.n3 = (this.getChild("n3"));
  14194. this.n4 = (this.getChild("n4"));
  14195. }
  14196. }
  14197. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14198. class ui_Component3 extends fgui.GComponent {
  14199. static createInstance() {
  14200. return (fgui.UIPackage.createObject("game", "Component3"));
  14201. }
  14202. onConstruct() {
  14203. this.n26 = (this.getChild("n26"));
  14204. this.n24 = (this.getChild("n24"));
  14205. this.nameTxt = (this.getChild("nameTxt"));
  14206. this.headRoot = (this.getChild("headRoot"));
  14207. }
  14208. }
  14209. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14210. class ui_Component4 extends fgui.GComponent {
  14211. static createInstance() {
  14212. return (fgui.UIPackage.createObject("game", "Component4"));
  14213. }
  14214. onConstruct() {
  14215. this.headImg = (this.getChild("headImg"));
  14216. }
  14217. }
  14218. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14219. class ui_Component7 extends fgui.GButton {
  14220. static createInstance() {
  14221. return (fgui.UIPackage.createObject("game", "Component7"));
  14222. }
  14223. onConstruct() {
  14224. this.n17 = (this.getChild("n17"));
  14225. }
  14226. }
  14227. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14228. class ui_Component8 extends fgui.GButton {
  14229. static createInstance() {
  14230. return (fgui.UIPackage.createObject("game", "Component8"));
  14231. }
  14232. onConstruct() {
  14233. this.n19 = (this.getChild("n19"));
  14234. }
  14235. }
  14236. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14237. class ui_Component10 extends fgui.GButton {
  14238. static createInstance() {
  14239. return (fgui.UIPackage.createObject("game", "Component10"));
  14240. }
  14241. onConstruct() {
  14242. this.c1 = this.getController("c1");
  14243. this.n40 = (this.getChild("n40"));
  14244. }
  14245. }
  14246. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14247. class ui_Component11 extends fgui.GButton {
  14248. static createInstance() {
  14249. return (fgui.UIPackage.createObject("game", "Component11"));
  14250. }
  14251. onConstruct() {
  14252. this.n34 = (this.getChild("n34"));
  14253. }
  14254. }
  14255. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14256. class ui_Component12 extends fgui.GButton {
  14257. static createInstance() {
  14258. return (fgui.UIPackage.createObject("game", "Component12"));
  14259. }
  14260. onConstruct() {
  14261. this.n35 = (this.getChild("n35"));
  14262. }
  14263. }
  14264. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14265. class ui_Component13 extends fgui.GButton {
  14266. static createInstance() {
  14267. return (fgui.UIPackage.createObject("game", "Component13"));
  14268. }
  14269. onConstruct() {
  14270. this.n27 = (this.getChild("n27"));
  14271. this.n36 = (this.getChild("n36"));
  14272. }
  14273. }
  14274. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14275. class ui_dh_js_tuowei extends fgui.GComponent {
  14276. static createInstance() {
  14277. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14278. }
  14279. onConstruct() {
  14280. this.n19 = (this.getChild("n19"));
  14281. this.n18 = (this.getChild("n18"));
  14282. this.n0 = (this.getChild("n0"));
  14283. this.n3 = (this.getChild("n3"));
  14284. this.n4 = (this.getChild("n4"));
  14285. this.n5 = (this.getChild("n5"));
  14286. this.n6 = (this.getChild("n6"));
  14287. this.n8 = (this.getChild("n8"));
  14288. this.n9 = (this.getChild("n9"));
  14289. this.n10 = (this.getChild("n10"));
  14290. this.n11 = (this.getChild("n11"));
  14291. this.n12 = (this.getChild("n12"));
  14292. this.n13 = (this.getChild("n13"));
  14293. this.n14 = (this.getChild("n14"));
  14294. this.n15 = (this.getChild("n15"));
  14295. this.n20 = (this.getChild("n20"));
  14296. this.t0 = this.getTransition("t0");
  14297. this.t1 = this.getTransition("t1");
  14298. }
  14299. }
  14300. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14301. class ui_dh_js_tw_g extends fgui.GComponent {
  14302. static createInstance() {
  14303. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14304. }
  14305. onConstruct() {
  14306. this.n0 = (this.getChild("n0"));
  14307. this.n1 = (this.getChild("n1"));
  14308. this.t0 = this.getTransition("t0");
  14309. }
  14310. }
  14311. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14312. class ui_dh_js_xingxing extends fgui.GComponent {
  14313. static createInstance() {
  14314. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14315. }
  14316. onConstruct() {
  14317. this.n1 = (this.getChild("n1"));
  14318. this.n2 = (this.getChild("n2"));
  14319. this.n3 = (this.getChild("n3"));
  14320. this.n4 = (this.getChild("n4"));
  14321. this.n0 = (this.getChild("n0"));
  14322. this.t2 = this.getTransition("t2");
  14323. this.t1 = this.getTransition("t1");
  14324. }
  14325. }
  14326. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14327. class ui_dh_zy_jiazai extends fgui.GComponent {
  14328. static createInstance() {
  14329. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14330. }
  14331. onConstruct() {
  14332. this.c1 = this.getController("c1");
  14333. this.n0 = (this.getChild("n0"));
  14334. this.n1 = (this.getChild("n1"));
  14335. this.n2 = (this.getChild("n2"));
  14336. this.n4 = (this.getChild("n4"));
  14337. this.n5 = (this.getChild("n5"));
  14338. this.n6 = (this.getChild("n6"));
  14339. this.n8 = (this.getChild("n8"));
  14340. this.n7 = (this.getChild("n7"));
  14341. this.t0 = this.getTransition("t0");
  14342. }
  14343. }
  14344. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14345. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14346. static createInstance() {
  14347. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14348. }
  14349. onConstruct() {
  14350. this.c1 = this.getController("c1");
  14351. this.n3 = (this.getChild("n3"));
  14352. this.n5 = (this.getChild("n5"));
  14353. this.n4 = (this.getChild("n4"));
  14354. this.n0 = (this.getChild("n0"));
  14355. this.n1 = (this.getChild("n1"));
  14356. this.n2 = (this.getChild("n2"));
  14357. }
  14358. }
  14359. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14360. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14361. static createInstance() {
  14362. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14363. }
  14364. onConstruct() {
  14365. this.n19 = (this.getChild("n19"));
  14366. this.n21 = (this.getChild("n21"));
  14367. this.n0 = (this.getChild("n0"));
  14368. this.n3 = (this.getChild("n3"));
  14369. this.n4 = (this.getChild("n4"));
  14370. this.n5 = (this.getChild("n5"));
  14371. this.n6 = (this.getChild("n6"));
  14372. this.n8 = (this.getChild("n8"));
  14373. this.n9 = (this.getChild("n9"));
  14374. this.n10 = (this.getChild("n10"));
  14375. this.n11 = (this.getChild("n11"));
  14376. this.n12 = (this.getChild("n12"));
  14377. this.n13 = (this.getChild("n13"));
  14378. this.n14 = (this.getChild("n14"));
  14379. this.n15 = (this.getChild("n15"));
  14380. this.n23 = (this.getChild("n23"));
  14381. this.t0 = this.getTransition("t0");
  14382. this.t1 = this.getTransition("t1");
  14383. }
  14384. }
  14385. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14386. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14387. static createInstance() {
  14388. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14389. }
  14390. onConstruct() {
  14391. this.n1 = (this.getChild("n1"));
  14392. this.n2 = (this.getChild("n2"));
  14393. this.t0 = this.getTransition("t0");
  14394. }
  14395. }
  14396. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14397. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14398. static createInstance() {
  14399. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14400. }
  14401. onConstruct() {
  14402. this.n4 = (this.getChild("n4"));
  14403. this.n2 = (this.getChild("n2"));
  14404. this.n3 = (this.getChild("n3"));
  14405. this.idle = this.getTransition("idle");
  14406. this.attack = this.getTransition("attack");
  14407. }
  14408. }
  14409. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14410. class ui_special extends fgui.GComponent {
  14411. static createInstance() {
  14412. return (fgui.UIPackage.createObject("game", "special"));
  14413. }
  14414. onConstruct() {
  14415. this.n18 = (this.getChild("n18"));
  14416. this.n19 = (this.getChild("n19"));
  14417. this.n20 = (this.getChild("n20"));
  14418. this.n21 = (this.getChild("n21"));
  14419. this.n22 = (this.getChild("n22"));
  14420. this.levelTxt = (this.getChild("levelTxt"));
  14421. this.n24 = (this.getChild("n24"));
  14422. this.n25 = (this.getChild("n25"));
  14423. this.t0 = this.getTransition("t0");
  14424. }
  14425. }
  14426. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14427. class ui_Component145 extends fgui.GComponent {
  14428. static createInstance() {
  14429. return (fgui.UIPackage.createObject("game", "Component145"));
  14430. }
  14431. onConstruct() {
  14432. this.guanyuNode = (this.getChild("guanyuNode"));
  14433. }
  14434. }
  14435. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14436. class ui_longBtn extends fgui.GButton {
  14437. static createInstance() {
  14438. return (fgui.UIPackage.createObject("game", "longBtn"));
  14439. }
  14440. onConstruct() {
  14441. this.c1 = this.getController("c1");
  14442. this.n2 = (this.getChild("n2"));
  14443. this.n1 = (this.getChild("n1"));
  14444. this.n4 = (this.getChild("n4"));
  14445. }
  14446. }
  14447. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14448. class ui_Component146 extends fgui.GComponent {
  14449. static createInstance() {
  14450. return (fgui.UIPackage.createObject("game", "Component146"));
  14451. }
  14452. onConstruct() {
  14453. this.n89 = (this.getChild("n89"));
  14454. this.n90 = (this.getChild("n90"));
  14455. this.guideBtn = (this.getChild("guideBtn"));
  14456. }
  14457. }
  14458. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14459. class ui_Component146_11 extends fgui.GComponent {
  14460. static createInstance() {
  14461. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14462. }
  14463. onConstruct() {
  14464. this.n89 = (this.getChild("n89"));
  14465. this.n90 = (this.getChild("n90"));
  14466. this.guideBtn = (this.getChild("guideBtn"));
  14467. }
  14468. }
  14469. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14470. class ui_Component111_1 extends fgui.GComponent {
  14471. static createInstance() {
  14472. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14473. }
  14474. onConstruct() {
  14475. this.n68 = (this.getChild("n68"));
  14476. this.myMask = (this.getChild("myMask"));
  14477. }
  14478. }
  14479. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14480. class ui_Component64_1 extends fgui.GComponent {
  14481. static createInstance() {
  14482. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14483. }
  14484. onConstruct() {
  14485. this.n57 = (this.getChild("n57"));
  14486. this.n54 = (this.getChild("n54"));
  14487. this.n55 = (this.getChild("n55"));
  14488. this.n56 = (this.getChild("n56"));
  14489. this.t1 = this.getTransition("t1");
  14490. }
  14491. }
  14492. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14493. class ui_ModeSelection_com123 extends fgui.GComponent {
  14494. static createInstance() {
  14495. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14496. }
  14497. onConstruct() {
  14498. this.type1 = (this.getChild("type1"));
  14499. this.type2 = (this.getChild("type2"));
  14500. this.type3 = (this.getChild("type3"));
  14501. this.n38 = (this.getChild("n38"));
  14502. this.t0 = this.getTransition("t0");
  14503. }
  14504. }
  14505. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14506. class ui_Component132_2 extends fgui.GComponent {
  14507. static createInstance() {
  14508. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14509. }
  14510. onConstruct() {
  14511. this.n25 = (this.getChild("n25"));
  14512. this.n26 = (this.getChild("n26"));
  14513. this.n27 = (this.getChild("n27"));
  14514. this.t0 = this.getTransition("t0");
  14515. }
  14516. }
  14517. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14518. class ui_UIPower$1 extends fgui.GComponent {
  14519. static createInstance() {
  14520. return (fgui.UIPackage.createObject("game", "UIPower"));
  14521. }
  14522. onConstruct() {
  14523. this.n11 = (this.getChild("n11"));
  14524. this.myNode = (this.getChild("myNode"));
  14525. this.t0 = this.getTransition("t0");
  14526. }
  14527. }
  14528. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14529. class ui_Component133 extends fgui.GComponent {
  14530. static createInstance() {
  14531. return (fgui.UIPackage.createObject("game", "Component133"));
  14532. }
  14533. onConstruct() {
  14534. this.n29 = (this.getChild("n29"));
  14535. this.n30 = (this.getChild("n30"));
  14536. }
  14537. }
  14538. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14539. class ui_Component134 extends fgui.GComponent {
  14540. static createInstance() {
  14541. return (fgui.UIPackage.createObject("game", "Component134"));
  14542. }
  14543. onConstruct() {
  14544. this.n30 = (this.getChild("n30"));
  14545. this.n31 = (this.getChild("n31"));
  14546. this.t0 = this.getTransition("t0");
  14547. }
  14548. }
  14549. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14550. class ui_Component135 extends fgui.GComponent {
  14551. static createInstance() {
  14552. return (fgui.UIPackage.createObject("game", "Component135"));
  14553. }
  14554. onConstruct() {
  14555. this.n30 = (this.getChild("n30"));
  14556. this.t0 = this.getTransition("t0");
  14557. }
  14558. }
  14559. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14560. class ui_Component137 extends fgui.GComponent {
  14561. static createInstance() {
  14562. return (fgui.UIPackage.createObject("game", "Component137"));
  14563. }
  14564. onConstruct() {
  14565. this.n28 = (this.getChild("n28"));
  14566. this.n29 = (this.getChild("n29"));
  14567. this.n30 = (this.getChild("n30"));
  14568. this.n32 = (this.getChild("n32"));
  14569. }
  14570. }
  14571. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14572. class ui_dh_zuanshi extends fgui.GButton {
  14573. static createInstance() {
  14574. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14575. }
  14576. onConstruct() {
  14577. this.n1 = (this.getChild("n1"));
  14578. this.n2 = (this.getChild("n2"));
  14579. this.n0 = (this.getChild("n0"));
  14580. this.n3 = (this.getChild("n3"));
  14581. this.n4 = (this.getChild("n4"));
  14582. }
  14583. }
  14584. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14585. class ui_Component138 extends fgui.GComponent {
  14586. static createInstance() {
  14587. return (fgui.UIPackage.createObject("game", "Component138"));
  14588. }
  14589. onConstruct() {
  14590. this.n1 = (this.getChild("n1"));
  14591. this.n2 = (this.getChild("n2"));
  14592. this.t0 = this.getTransition("t0");
  14593. }
  14594. }
  14595. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14596. class ui_Component139 extends fgui.GComponent {
  14597. static createInstance() {
  14598. return (fgui.UIPackage.createObject("game", "Component139"));
  14599. }
  14600. onConstruct() {
  14601. this.n0 = (this.getChild("n0"));
  14602. this.t0 = this.getTransition("t0");
  14603. }
  14604. }
  14605. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14606. class ui_Component140 extends fgui.GComponent {
  14607. static createInstance() {
  14608. return (fgui.UIPackage.createObject("game", "Component140"));
  14609. }
  14610. onConstruct() {
  14611. this.n2 = (this.getChild("n2"));
  14612. this.n3 = (this.getChild("n3"));
  14613. this.t0 = this.getTransition("t0");
  14614. }
  14615. }
  14616. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14617. class ui_Component141 extends fgui.GComponent {
  14618. static createInstance() {
  14619. return (fgui.UIPackage.createObject("game", "Component141"));
  14620. }
  14621. onConstruct() {
  14622. this.n0 = (this.getChild("n0"));
  14623. this.t0 = this.getTransition("t0");
  14624. }
  14625. }
  14626. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14627. class ui_powerNode extends fgui.GProgressBar {
  14628. static createInstance() {
  14629. return (fgui.UIPackage.createObject("game", "powerNode"));
  14630. }
  14631. onConstruct() {
  14632. this.n2 = (this.getChild("n2"));
  14633. this.bar_v = (this.getChild("bar_v"));
  14634. this.showImg = (this.getChild("showImg"));
  14635. this.n12 = (this.getChild("n12"));
  14636. }
  14637. }
  14638. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14639. class ui_dh_jingbi1 extends fgui.GComponent {
  14640. static createInstance() {
  14641. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14642. }
  14643. onConstruct() {
  14644. this.n0 = (this.getChild("n0"));
  14645. this.n1 = (this.getChild("n1"));
  14646. this.n2 = (this.getChild("n2"));
  14647. this.n3 = (this.getChild("n3"));
  14648. this.n4 = (this.getChild("n4"));
  14649. this.n5 = (this.getChild("n5"));
  14650. this.n6 = (this.getChild("n6"));
  14651. this.n8 = (this.getChild("n8"));
  14652. this.t0 = this.getTransition("t0");
  14653. }
  14654. }
  14655. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14656. class ui_Component94 extends fgui.GButton {
  14657. static createInstance() {
  14658. return (fgui.UIPackage.createObject("game", "Component94"));
  14659. }
  14660. onConstruct() {
  14661. this.n77 = (this.getChild("n77"));
  14662. }
  14663. }
  14664. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14665. class ui_Component95 extends fgui.GButton {
  14666. static createInstance() {
  14667. return (fgui.UIPackage.createObject("game", "Component95"));
  14668. }
  14669. onConstruct() {
  14670. this.n77 = (this.getChild("n77"));
  14671. }
  14672. }
  14673. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14674. class ui_Component126 extends fgui.GComponent {
  14675. static createInstance() {
  14676. return (fgui.UIPackage.createObject("game", "Component126"));
  14677. }
  14678. onConstruct() {
  14679. this.c1 = this.getController("c1");
  14680. this.normalBtn = (this.getChild("normalBtn"));
  14681. this.tripleBtn = (this.getChild("tripleBtn"));
  14682. }
  14683. }
  14684. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14685. class ui_Component60 extends fgui.GComponent {
  14686. static createInstance() {
  14687. return (fgui.UIPackage.createObject("game", "Component60"));
  14688. }
  14689. onConstruct() {
  14690. this.c1 = this.getController("c1");
  14691. this.n48 = (this.getChild("n48"));
  14692. this.womanTxt = (this.getChild("womanTxt"));
  14693. this.t0 = this.getTransition("t0");
  14694. }
  14695. }
  14696. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14697. class ui_Button_h extends fgui.GButton {
  14698. static createInstance() {
  14699. return (fgui.UIPackage.createObject("game", "Button_h"));
  14700. }
  14701. onConstruct() {
  14702. this.button = this.getController("button");
  14703. this.n0 = (this.getChild("n0"));
  14704. }
  14705. }
  14706. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14707. class ui_Button_lv extends fgui.GButton {
  14708. static createInstance() {
  14709. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14710. }
  14711. onConstruct() {
  14712. this.button = this.getController("button");
  14713. this.n0 = (this.getChild("n0"));
  14714. }
  14715. }
  14716. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14717. class ui_Component98_3 extends fgui.GButton {
  14718. static createInstance() {
  14719. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14720. }
  14721. onConstruct() {
  14722. this.c1 = this.getController("c1");
  14723. this.n8 = (this.getChild("n8"));
  14724. this.n41 = (this.getChild("n41"));
  14725. this.n40 = (this.getChild("n40"));
  14726. }
  14727. }
  14728. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14729. class ui_ModeSelection_com1 extends fgui.GButton {
  14730. static createInstance() {
  14731. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14732. }
  14733. onConstruct() {
  14734. this.n34 = (this.getChild("n34"));
  14735. this.n36 = (this.getChild("n36"));
  14736. this.n22 = (this.getChild("n22"));
  14737. this.n20 = (this.getChild("n20"));
  14738. this.n23 = (this.getChild("n23"));
  14739. this.n24 = (this.getChild("n24"));
  14740. this.n26 = (this.getChild("n26"));
  14741. this.n33 = (this.getChild("n33"));
  14742. this.coinImg = (this.getChild("coinImg"));
  14743. this.need = (this.getChild("need"));
  14744. this.n35 = (this.getChild("n35"));
  14745. this.n29 = (this.getChild("n29"));
  14746. this.tipsTxt = (this.getChild("tipsTxt"));
  14747. this.n30 = (this.getChild("n30"));
  14748. this.peopleTxt = (this.getChild("peopleTxt"));
  14749. this.t0 = this.getTransition("t0");
  14750. }
  14751. }
  14752. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14753. class ui_ModeSelection_com2 extends fgui.GButton {
  14754. static createInstance() {
  14755. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14756. }
  14757. onConstruct() {
  14758. this.n36 = (this.getChild("n36"));
  14759. this.n34 = (this.getChild("n34"));
  14760. this.n22 = (this.getChild("n22"));
  14761. this.n20 = (this.getChild("n20"));
  14762. this.n23 = (this.getChild("n23"));
  14763. this.n24 = (this.getChild("n24"));
  14764. this.n26 = (this.getChild("n26"));
  14765. this.n33 = (this.getChild("n33"));
  14766. this.coinImg = (this.getChild("coinImg"));
  14767. this.need = (this.getChild("need"));
  14768. this.n35 = (this.getChild("n35"));
  14769. this.n29 = (this.getChild("n29"));
  14770. this.tipsTxt = (this.getChild("tipsTxt"));
  14771. this.n30 = (this.getChild("n30"));
  14772. this.peopleTxt = (this.getChild("peopleTxt"));
  14773. this.t0 = this.getTransition("t0");
  14774. }
  14775. }
  14776. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14777. class ui_ModeSelection_com3 extends fgui.GButton {
  14778. static createInstance() {
  14779. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14780. }
  14781. onConstruct() {
  14782. this.n34 = (this.getChild("n34"));
  14783. this.n36 = (this.getChild("n36"));
  14784. this.n22 = (this.getChild("n22"));
  14785. this.n20 = (this.getChild("n20"));
  14786. this.n23 = (this.getChild("n23"));
  14787. this.n24 = (this.getChild("n24"));
  14788. this.n26 = (this.getChild("n26"));
  14789. this.n33 = (this.getChild("n33"));
  14790. this.coinImg = (this.getChild("coinImg"));
  14791. this.need = (this.getChild("need"));
  14792. this.n35 = (this.getChild("n35"));
  14793. this.n29 = (this.getChild("n29"));
  14794. this.tipsTxt = (this.getChild("tipsTxt"));
  14795. this.n30 = (this.getChild("n30"));
  14796. this.peopleTxt = (this.getChild("peopleTxt"));
  14797. this.t0 = this.getTransition("t0");
  14798. }
  14799. }
  14800. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14801. class ui_Invitation_com1 extends fgui.GComponent {
  14802. static createInstance() {
  14803. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14804. }
  14805. onConstruct() {
  14806. this.n14 = (this.getChild("n14"));
  14807. this.n13 = (this.getChild("n13"));
  14808. this.n3 = (this.getChild("n3"));
  14809. this.n1 = (this.getChild("n1"));
  14810. this.n6 = (this.getChild("n6"));
  14811. this.n7 = (this.getChild("n7"));
  14812. this.enterBtn = (this.getChild("enterBtn"));
  14813. this.n11 = (this.getChild("n11"));
  14814. this.n12 = (this.getChild("n12"));
  14815. this.n15 = (this.getChild("n15"));
  14816. this.t0 = this.getTransition("t0");
  14817. this.t1 = this.getTransition("t1");
  14818. }
  14819. }
  14820. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  14821. class ui_Component87_1 extends fgui.GComponent {
  14822. static createInstance() {
  14823. return (fgui.UIPackage.createObject("game", "Component87_1"));
  14824. }
  14825. onConstruct() {
  14826. this.n74 = (this.getChild("n74"));
  14827. this.n73 = (this.getChild("n73"));
  14828. this.ballTxt = (this.getChild("ballTxt"));
  14829. this.n76 = (this.getChild("n76"));
  14830. this.helpLineBtn = (this.getChild("helpLineBtn"));
  14831. this.levelTxt = (this.getChild("levelTxt"));
  14832. this.n87 = (this.getChild("n87"));
  14833. this.n84 = (this.getChild("n84"));
  14834. this.hpTxt = (this.getChild("hpTxt"));
  14835. this.n89 = (this.getChild("n89"));
  14836. this.tipsTxt = (this.getChild("tipsTxt"));
  14837. }
  14838. }
  14839. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  14840. class ui_sqg1 extends fgui.GComponent {
  14841. static createInstance() {
  14842. return (fgui.UIPackage.createObject("game", "sqg1"));
  14843. }
  14844. onConstruct() {
  14845. this.n1 = (this.getChild("n1"));
  14846. this.n0 = (this.getChild("n0"));
  14847. }
  14848. }
  14849. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  14850. class ui_sqg2 extends fgui.GComponent {
  14851. static createInstance() {
  14852. return (fgui.UIPackage.createObject("game", "sqg2"));
  14853. }
  14854. onConstruct() {
  14855. this.n1 = (this.getChild("n1"));
  14856. this.n0 = (this.getChild("n0"));
  14857. }
  14858. }
  14859. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  14860. class ui_sqg3 extends fgui.GComponent {
  14861. static createInstance() {
  14862. return (fgui.UIPackage.createObject("game", "sqg3"));
  14863. }
  14864. onConstruct() {
  14865. this.n1 = (this.getChild("n1"));
  14866. this.n0 = (this.getChild("n0"));
  14867. }
  14868. }
  14869. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  14870. class ui_sqg4 extends fgui.GComponent {
  14871. static createInstance() {
  14872. return (fgui.UIPackage.createObject("game", "sqg4"));
  14873. }
  14874. onConstruct() {
  14875. this.n1 = (this.getChild("n1"));
  14876. this.n0 = (this.getChild("n0"));
  14877. }
  14878. }
  14879. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  14880. class ui_Component36 extends fgui.GButton {
  14881. static createInstance() {
  14882. return (fgui.UIPackage.createObject("game", "Component36"));
  14883. }
  14884. onConstruct() {
  14885. this.c1 = this.getController("c1");
  14886. this.n53 = (this.getChild("n53"));
  14887. this.n56 = (this.getChild("n56"));
  14888. }
  14889. }
  14890. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  14891. class ui_Component37 extends fgui.GButton {
  14892. static createInstance() {
  14893. return (fgui.UIPackage.createObject("game", "Component37"));
  14894. }
  14895. onConstruct() {
  14896. this.c1 = this.getController("c1");
  14897. this.n52 = (this.getChild("n52"));
  14898. this.n54 = (this.getChild("n54"));
  14899. }
  14900. }
  14901. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  14902. class ui_UISetting extends fgui.GComponent {
  14903. static createInstance() {
  14904. return (fgui.UIPackage.createObject("game", "UISetting"));
  14905. }
  14906. onConstruct() {
  14907. this.c1 = this.getController("c1");
  14908. this.n4 = (this.getChild("n4"));
  14909. this.soundBtn = (this.getChild("soundBtn"));
  14910. this.shakeBtn = (this.getChild("shakeBtn"));
  14911. this.clickNode = (this.getChild("clickNode"));
  14912. this.xyBtn = (this.getChild("xyBtn"));
  14913. }
  14914. }
  14915. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  14916. class ui_Component39 extends fgui.GComponent {
  14917. static createInstance() {
  14918. return (fgui.UIPackage.createObject("game", "Component39"));
  14919. }
  14920. onConstruct() {
  14921. this.n5 = (this.getChild("n5"));
  14922. this.n6 = (this.getChild("n6"));
  14923. this.n7 = (this.getChild("n7"));
  14924. this.t0 = this.getTransition("t0");
  14925. }
  14926. }
  14927. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  14928. class ui_Component40 extends fgui.GButton {
  14929. static createInstance() {
  14930. return (fgui.UIPackage.createObject("game", "Component40"));
  14931. }
  14932. onConstruct() {
  14933. this.n46 = (this.getChild("n46"));
  14934. this.n47 = (this.getChild("n47"));
  14935. }
  14936. }
  14937. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  14938. class ui_Component41 extends fgui.GComponent {
  14939. static createInstance() {
  14940. return (fgui.UIPackage.createObject("game", "Component41"));
  14941. }
  14942. onConstruct() {
  14943. this.c1 = this.getController("c1");
  14944. this.n0 = (this.getChild("n0"));
  14945. this.titleTxt = (this.getChild("titleTxt"));
  14946. this.n2 = (this.getChild("n2"));
  14947. this.msgTips = (this.getChild("msgTips"));
  14948. this.numTxt = (this.getChild("numTxt"));
  14949. this.n18 = (this.getChild("n18"));
  14950. this.cancelBtn = (this.getChild("cancelBtn"));
  14951. this.videoBtn = (this.getChild("videoBtn"));
  14952. this.n10 = (this.getChild("n10"));
  14953. }
  14954. }
  14955. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  14956. class ui_Component42 extends fgui.GComponent {
  14957. static createInstance() {
  14958. return (fgui.UIPackage.createObject("game", "Component42"));
  14959. }
  14960. onConstruct() {
  14961. this.c1 = this.getController("c1");
  14962. this.n1 = (this.getChild("n1"));
  14963. this.n2 = (this.getChild("n2"));
  14964. this.n3 = (this.getChild("n3"));
  14965. this.tipsTxt = (this.getChild("tipsTxt"));
  14966. this.cancelBtn = (this.getChild("cancelBtn"));
  14967. this.sureBtn = (this.getChild("sureBtn"));
  14968. this.n11 = (this.getChild("n11"));
  14969. this.n13 = (this.getChild("n13"));
  14970. this.n14 = (this.getChild("n14"));
  14971. this.womanTxt = (this.getChild("womanTxt"));
  14972. this.t0 = this.getTransition("t0");
  14973. }
  14974. }
  14975. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  14976. class ui_dh_js_shengli extends fgui.GComponent {
  14977. static createInstance() {
  14978. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  14979. }
  14980. onConstruct() {
  14981. this.n3 = (this.getChild("n3"));
  14982. this.n4 = (this.getChild("n4"));
  14983. this.n1 = (this.getChild("n1"));
  14984. this.n2 = (this.getChild("n2"));
  14985. this.n5 = (this.getChild("n5"));
  14986. this.n6 = (this.getChild("n6"));
  14987. this.n7 = (this.getChild("n7"));
  14988. this.n8 = (this.getChild("n8"));
  14989. this.attack = this.getTransition("attack");
  14990. this.idle = this.getTransition("idle");
  14991. }
  14992. }
  14993. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  14994. class ui_dh_js_shengli_g extends fgui.GComponent {
  14995. static createInstance() {
  14996. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  14997. }
  14998. onConstruct() {
  14999. this.n3 = (this.getChild("n3"));
  15000. this.n1 = (this.getChild("n1"));
  15001. this.t0 = this.getTransition("t0");
  15002. }
  15003. }
  15004. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15005. class ui_dh_js_shibai extends fgui.GComponent {
  15006. static createInstance() {
  15007. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15008. }
  15009. onConstruct() {
  15010. this.n0 = (this.getChild("n0"));
  15011. this.n1 = (this.getChild("n1"));
  15012. this.n2 = (this.getChild("n2"));
  15013. this.n3 = (this.getChild("n3"));
  15014. this.idle = this.getTransition("idle");
  15015. this.attack = this.getTransition("attack");
  15016. }
  15017. }
  15018. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15019. class ui_dh_zy_ganfa extends fgui.GButton {
  15020. static createInstance() {
  15021. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15022. }
  15023. onConstruct() {
  15024. this.n0 = (this.getChild("n0"));
  15025. }
  15026. }
  15027. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15028. class ui_dh_zy_sc_guang extends fgui.GButton {
  15029. static createInstance() {
  15030. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15031. }
  15032. onConstruct() {
  15033. this.n0 = (this.getChild("n0"));
  15034. this.n2 = (this.getChild("n2"));
  15035. }
  15036. }
  15037. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15038. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15039. static createInstance() {
  15040. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15041. }
  15042. onConstruct() {
  15043. this.n0 = (this.getChild("n0"));
  15044. this.n3 = (this.getChild("n3"));
  15045. }
  15046. }
  15047. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15048. class ui_dh_zy_wanfa extends fgui.GButton {
  15049. static createInstance() {
  15050. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15051. }
  15052. onConstruct() {
  15053. this.n0 = (this.getChild("n0"));
  15054. }
  15055. }
  15056. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15057. class ui_Button_login extends fgui.GButton {
  15058. static createInstance() {
  15059. return (fgui.UIPackage.createObject("game", "Button_login"));
  15060. }
  15061. onConstruct() {
  15062. this.button = this.getController("button");
  15063. this.n5 = (this.getChild("n5"));
  15064. }
  15065. }
  15066. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15067. class ui_Component53_1 extends fgui.GComponent {
  15068. static createInstance() {
  15069. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15070. }
  15071. onConstruct() {
  15072. this.n0 = (this.getChild("n0"));
  15073. this.n1 = (this.getChild("n1"));
  15074. this.n2 = (this.getChild("n2"));
  15075. this.n3 = (this.getChild("n3"));
  15076. this.n4 = (this.getChild("n4"));
  15077. this.n5 = (this.getChild("n5"));
  15078. this.n6 = (this.getChild("n6"));
  15079. this.n7 = (this.getChild("n7"));
  15080. this.n8 = (this.getChild("n8"));
  15081. this.n9 = (this.getChild("n9"));
  15082. this.n10 = (this.getChild("n10"));
  15083. this.n11 = (this.getChild("n11"));
  15084. this.n12 = (this.getChild("n12"));
  15085. this.n13 = (this.getChild("n13"));
  15086. this.n14 = (this.getChild("n14"));
  15087. this.n15 = (this.getChild("n15"));
  15088. this.n16 = (this.getChild("n16"));
  15089. this.n19 = (this.getChild("n19"));
  15090. this.n20 = (this.getChild("n20"));
  15091. this.n21 = (this.getChild("n21"));
  15092. this.n22 = (this.getChild("n22"));
  15093. this.n23 = (this.getChild("n23"));
  15094. this.n24 = (this.getChild("n24"));
  15095. this.n25 = (this.getChild("n25"));
  15096. this.n26 = (this.getChild("n26"));
  15097. this.n27 = (this.getChild("n27"));
  15098. this.n28 = (this.getChild("n28"));
  15099. this.n29 = (this.getChild("n29"));
  15100. this.n30 = (this.getChild("n30"));
  15101. this.n31 = (this.getChild("n31"));
  15102. this.n32 = (this.getChild("n32"));
  15103. this.n33 = (this.getChild("n33"));
  15104. this.n34 = (this.getChild("n34"));
  15105. this.n35 = (this.getChild("n35"));
  15106. this.t0 = this.getTransition("t0");
  15107. }
  15108. }
  15109. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15110. class ui_Component30 extends fgui.GComponent {
  15111. static createInstance() {
  15112. return (fgui.UIPackage.createObject("game", "Component30"));
  15113. }
  15114. onConstruct() {
  15115. this.c1 = this.getController("c1");
  15116. this.n46 = (this.getChild("n46"));
  15117. this.n47 = (this.getChild("n47"));
  15118. this.numTxt = (this.getChild("numTxt"));
  15119. this.n50 = (this.getChild("n50"));
  15120. this.n53 = (this.getChild("n53"));
  15121. this.n54 = (this.getChild("n54"));
  15122. this.n55 = (this.getChild("n55"));
  15123. this.n56 = (this.getChild("n56"));
  15124. }
  15125. }
  15126. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15127. class ui_Component30_1 extends fgui.GComponent {
  15128. static createInstance() {
  15129. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15130. }
  15131. onConstruct() {
  15132. this.c1 = this.getController("c1");
  15133. this.n46 = (this.getChild("n46"));
  15134. this.n47 = (this.getChild("n47"));
  15135. this.numTxt = (this.getChild("numTxt"));
  15136. this.n50 = (this.getChild("n50"));
  15137. this.n51 = (this.getChild("n51"));
  15138. this.n52 = (this.getChild("n52"));
  15139. this.n53 = (this.getChild("n53"));
  15140. this.n54 = (this.getChild("n54"));
  15141. }
  15142. }
  15143. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15144. class ui_Component31 extends fgui.GComponent {
  15145. static createInstance() {
  15146. return (fgui.UIPackage.createObject("game", "Component31"));
  15147. }
  15148. onConstruct() {
  15149. this.n55 = (this.getChild("n55"));
  15150. this.n54 = (this.getChild("n54"));
  15151. this.conditionTxt = (this.getChild("conditionTxt"));
  15152. this.n57 = (this.getChild("n57"));
  15153. this.t0 = this.getTransition("t0");
  15154. }
  15155. }
  15156. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15157. class ui_Component32 extends fgui.GComponent {
  15158. static createInstance() {
  15159. return (fgui.UIPackage.createObject("game", "Component32"));
  15160. }
  15161. onConstruct() {
  15162. this.n5 = (this.getChild("n5"));
  15163. this.n6 = (this.getChild("n6"));
  15164. this.n7 = (this.getChild("n7"));
  15165. this.t0 = this.getTransition("t0");
  15166. }
  15167. }
  15168. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15169. class ui_AwardItem extends fgui.GComponent {
  15170. static createInstance() {
  15171. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15172. }
  15173. onConstruct() {
  15174. this.n9 = (this.getChild("n9"));
  15175. this.myIcon = (this.getChild("myIcon"));
  15176. this.numTxt = (this.getChild("numTxt"));
  15177. this.nameTxt = (this.getChild("nameTxt"));
  15178. this.n16 = (this.getChild("n16"));
  15179. this.n17 = (this.getChild("n17"));
  15180. }
  15181. }
  15182. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15183. class ui_ranking_com1 extends fgui.GButton {
  15184. static createInstance() {
  15185. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15186. }
  15187. onConstruct() {
  15188. this.c1 = this.getController("c1");
  15189. this.n49 = (this.getChild("n49"));
  15190. this.n18 = (this.getChild("n18"));
  15191. this.n46 = (this.getChild("n46"));
  15192. this.n48 = (this.getChild("n48"));
  15193. this.n50 = (this.getChild("n50"));
  15194. }
  15195. }
  15196. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15197. class ui_ranking_com2 extends fgui.GButton {
  15198. static createInstance() {
  15199. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15200. }
  15201. onConstruct() {
  15202. this.c1 = this.getController("c1");
  15203. this.n49 = (this.getChild("n49"));
  15204. this.n18 = (this.getChild("n18"));
  15205. this.n46 = (this.getChild("n46"));
  15206. this.n48 = (this.getChild("n48"));
  15207. this.n50 = (this.getChild("n50"));
  15208. }
  15209. }
  15210. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15211. class ui_ranking_com3 extends fgui.GComponent {
  15212. static createInstance() {
  15213. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15214. }
  15215. onConstruct() {
  15216. this.n17 = (this.getChild("n17"));
  15217. this.myIcon = (this.getChild("myIcon"));
  15218. }
  15219. }
  15220. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15221. class ui_ranking_com4 extends fgui.GComponent {
  15222. static createInstance() {
  15223. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15224. }
  15225. onConstruct() {
  15226. this.n16 = (this.getChild("n16"));
  15227. this.head = (this.getChild("head"));
  15228. }
  15229. }
  15230. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15231. class ui_ranking_com5 extends fgui.GComponent {
  15232. static createInstance() {
  15233. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15234. }
  15235. onConstruct() {
  15236. this.c1 = this.getController("c1");
  15237. this.c2 = this.getController("c2");
  15238. this.n2 = (this.getChild("n2"));
  15239. this.n3 = (this.getChild("n3"));
  15240. this.levelBtn = (this.getChild("levelBtn"));
  15241. this.starBtn = (this.getChild("starBtn"));
  15242. this.n23 = (this.getChild("n23"));
  15243. this.n24 = (this.getChild("n24"));
  15244. this.n25 = (this.getChild("n25"));
  15245. this.myList = (this.getChild("myList"));
  15246. this.selfNode = (this.getChild("selfNode"));
  15247. this.n9 = (this.getChild("n9"));
  15248. this.n12 = (this.getChild("n12"));
  15249. this.n13 = (this.getChild("n13"));
  15250. this.n14 = (this.getChild("n14"));
  15251. this.n39 = (this.getChild("n39"));
  15252. this.n41 = (this.getChild("n41"));
  15253. this.n42 = (this.getChild("n42"));
  15254. this.n45 = (this.getChild("n45"));
  15255. this.changeBtn = (this.getChild("changeBtn"));
  15256. this.closeBtn = (this.getChild("closeBtn"));
  15257. this.t0 = this.getTransition("t0");
  15258. }
  15259. }
  15260. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15261. class ui_RankItem extends fgui.GComponent {
  15262. static createInstance() {
  15263. return (fgui.UIPackage.createObject("game", "RankItem"));
  15264. }
  15265. onConstruct() {
  15266. this.n10 = (this.getChild("n10"));
  15267. this.n11 = (this.getChild("n11"));
  15268. this.rankTxt = (this.getChild("rankTxt"));
  15269. this.headNode = (this.getChild("headNode"));
  15270. this.nameTxt = (this.getChild("nameTxt"));
  15271. this.n19 = (this.getChild("n19"));
  15272. this.valueTxt = (this.getChild("valueTxt"));
  15273. this.img1 = (this.getChild("img1"));
  15274. this.img2 = (this.getChild("img2"));
  15275. this.img3 = (this.getChild("img3"));
  15276. }
  15277. }
  15278. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15279. class ui_ranking_com9 extends fgui.GComponent {
  15280. static createInstance() {
  15281. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15282. }
  15283. onConstruct() {
  15284. this.c1 = this.getController("c1");
  15285. this.n27 = (this.getChild("n27"));
  15286. this.n28 = (this.getChild("n28"));
  15287. this.headNode = (this.getChild("headNode"));
  15288. this.rankTxt = (this.getChild("rankTxt"));
  15289. this.nameTxt = (this.getChild("nameTxt"));
  15290. this.n34 = (this.getChild("n34"));
  15291. this.valueTxt = (this.getChild("valueTxt"));
  15292. this.n36 = (this.getChild("n36"));
  15293. this.n37 = (this.getChild("n37"));
  15294. this.n38 = (this.getChild("n38"));
  15295. this.n39 = (this.getChild("n39"));
  15296. this.n40 = (this.getChild("n40"));
  15297. }
  15298. }
  15299. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15300. class ui_ranking_com10 extends fgui.GComponent {
  15301. static createInstance() {
  15302. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15303. }
  15304. onConstruct() {
  15305. this.n23 = (this.getChild("n23"));
  15306. this.n24 = (this.getChild("n24"));
  15307. }
  15308. }
  15309. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15310. class ui_ranking_com11 extends fgui.GComponent {
  15311. static createInstance() {
  15312. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15313. }
  15314. onConstruct() {
  15315. this.n24 = (this.getChild("n24"));
  15316. this.n25 = (this.getChild("n25"));
  15317. this.t0 = this.getTransition("t0");
  15318. }
  15319. }
  15320. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15321. class ui_ranking_com13 extends fgui.GButton {
  15322. static createInstance() {
  15323. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15324. }
  15325. onConstruct() {
  15326. this.c1 = this.getController("c1");
  15327. this.n44 = (this.getChild("n44"));
  15328. this.n45 = (this.getChild("n45"));
  15329. this.n46 = (this.getChild("n46"));
  15330. }
  15331. }
  15332. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15333. class ui_Component122 extends fgui.GComponent {
  15334. static createInstance() {
  15335. return (fgui.UIPackage.createObject("game", "Component122"));
  15336. }
  15337. onConstruct() {
  15338. this.gameNode3 = (this.getChild("gameNode3"));
  15339. }
  15340. }
  15341. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15342. class ui_skillItem extends fgui.GComponent {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "skillItem"));
  15345. }
  15346. onConstruct() {
  15347. this.c1 = this.getController("c1");
  15348. this.n31 = (this.getChild("n31"));
  15349. this.n6 = (this.getChild("n6"));
  15350. this.skillImg = (this.getChild("skillImg"));
  15351. this.nameTxt = (this.getChild("nameTxt"));
  15352. this.levelTxt = (this.getChild("levelTxt"));
  15353. this.n28 = (this.getChild("n28"));
  15354. this.describeTxt = (this.getChild("describeTxt"));
  15355. this.n32 = (this.getChild("n32"));
  15356. this.mutiBtn = (this.getChild("mutiBtn"));
  15357. this.tryNode = (this.getChild("tryNode"));
  15358. this.normalBtn = (this.getChild("normalBtn"));
  15359. this.startBtn = (this.getChild("startBtn"));
  15360. this.n42 = (this.getChild("n42"));
  15361. this.n43 = (this.getChild("n43"));
  15362. this.n44 = (this.getChild("n44"));
  15363. }
  15364. }
  15365. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15366. class ui_Component26 extends fgui.GButton {
  15367. static createInstance() {
  15368. return (fgui.UIPackage.createObject("game", "Component26"));
  15369. }
  15370. onConstruct() {
  15371. this.n11 = (this.getChild("n11"));
  15372. this.n30 = (this.getChild("n30"));
  15373. this.n34 = (this.getChild("n34"));
  15374. }
  15375. }
  15376. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15377. class ui_Component28 extends fgui.GButton {
  15378. static createInstance() {
  15379. return (fgui.UIPackage.createObject("game", "Component28"));
  15380. }
  15381. onConstruct() {
  15382. this.n12 = (this.getChild("n12"));
  15383. this.n31 = (this.getChild("n31"));
  15384. this.curTxt = (this.getChild("curTxt"));
  15385. this.n33 = (this.getChild("n33"));
  15386. }
  15387. }
  15388. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15389. class ui_Component1302 extends fgui.GComponent {
  15390. static createInstance() {
  15391. return (fgui.UIPackage.createObject("game", "Component1302"));
  15392. }
  15393. onConstruct() {
  15394. this.n2 = (this.getChild("n2"));
  15395. this.n3 = (this.getChild("n3"));
  15396. }
  15397. }
  15398. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15399. class ui_Component113 extends fgui.GComponent {
  15400. static createInstance() {
  15401. return (fgui.UIPackage.createObject("game", "Component113"));
  15402. }
  15403. onConstruct() {
  15404. this.n85 = (this.getChild("n85"));
  15405. this.n86 = (this.getChild("n86"));
  15406. this.n77 = (this.getChild("n77"));
  15407. this.n79 = (this.getChild("n79"));
  15408. this.n80 = (this.getChild("n80"));
  15409. this.n81 = (this.getChild("n81"));
  15410. this.n82 = (this.getChild("n82"));
  15411. this.n84 = (this.getChild("n84"));
  15412. this.n87 = (this.getChild("n87"));
  15413. this.t0 = this.getTransition("t0");
  15414. }
  15415. }
  15416. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15417. class ui_Component114 extends fgui.GComponent {
  15418. static createInstance() {
  15419. return (fgui.UIPackage.createObject("game", "Component114"));
  15420. }
  15421. onConstruct() {
  15422. this.n77 = (this.getChild("n77"));
  15423. this.t0 = this.getTransition("t0");
  15424. }
  15425. }
  15426. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15427. class ui_Component115 extends fgui.GComponent {
  15428. static createInstance() {
  15429. return (fgui.UIPackage.createObject("game", "Component115"));
  15430. }
  15431. onConstruct() {
  15432. this.n83 = (this.getChild("n83"));
  15433. this.fingerNode = (this.getChild("fingerNode"));
  15434. this.n84 = (this.getChild("n84"));
  15435. }
  15436. }
  15437. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15438. class ui_Component117 extends fgui.GComponent {
  15439. static createInstance() {
  15440. return (fgui.UIPackage.createObject("game", "Component117"));
  15441. }
  15442. onConstruct() {
  15443. this.n87 = (this.getChild("n87"));
  15444. this.n88 = (this.getChild("n88"));
  15445. this.n84 = (this.getChild("n84"));
  15446. this.n85 = (this.getChild("n85"));
  15447. this.n86 = (this.getChild("n86"));
  15448. this.t0 = this.getTransition("t0");
  15449. }
  15450. }
  15451. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15452. class ui_Component98_1 extends fgui.GButton {
  15453. static createInstance() {
  15454. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15455. }
  15456. onConstruct() {
  15457. this.c1 = this.getController("c1");
  15458. this.n8 = (this.getChild("n8"));
  15459. this.n41 = (this.getChild("n41"));
  15460. this.n40 = (this.getChild("n40"));
  15461. }
  15462. }
  15463. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15464. class ui_Component61 extends fgui.GComponent {
  15465. static createInstance() {
  15466. return (fgui.UIPackage.createObject("game", "Component61"));
  15467. }
  15468. onConstruct() {
  15469. this.n14 = (this.getChild("n14"));
  15470. this.n6 = (this.getChild("n6"));
  15471. this.t0 = this.getTransition("t0");
  15472. }
  15473. }
  15474. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15475. class ui_Component62 extends fgui.GComponent {
  15476. static createInstance() {
  15477. return (fgui.UIPackage.createObject("game", "Component62"));
  15478. }
  15479. onConstruct() {
  15480. this.n66 = (this.getChild("n66"));
  15481. this.n56 = (this.getChild("n56"));
  15482. this.n63 = (this.getChild("n63"));
  15483. this.n65 = (this.getChild("n65"));
  15484. this.t0 = this.getTransition("t0");
  15485. }
  15486. }
  15487. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15488. class ui_d3Root extends fgui.GComponent {
  15489. static createInstance() {
  15490. return (fgui.UIPackage.createObject("game", "d3Root"));
  15491. }
  15492. onConstruct() {
  15493. }
  15494. }
  15495. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15496. class ui_d2Root extends fgui.GComponent {
  15497. static createInstance() {
  15498. return (fgui.UIPackage.createObject("game", "d2Root"));
  15499. }
  15500. onConstruct() {
  15501. }
  15502. }
  15503. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15504. class ui_ballNode extends fgui.GComponent {
  15505. static createInstance() {
  15506. return (fgui.UIPackage.createObject("game", "ballNode"));
  15507. }
  15508. onConstruct() {
  15509. }
  15510. }
  15511. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15512. class ui_border extends fgui.GComponent {
  15513. static createInstance() {
  15514. return (fgui.UIPackage.createObject("game", "border"));
  15515. }
  15516. onConstruct() {
  15517. this.bar1 = (this.getChild("bar1"));
  15518. this.bar2 = (this.getChild("bar2"));
  15519. this.bar3 = (this.getChild("bar3"));
  15520. this.bar4 = (this.getChild("bar4"));
  15521. this.bar5 = (this.getChild("bar5"));
  15522. this.bar6 = (this.getChild("bar6"));
  15523. this.circle1 = (this.getChild("circle1"));
  15524. this.circle2 = (this.getChild("circle2"));
  15525. this.circle3 = (this.getChild("circle3"));
  15526. this.circle4 = (this.getChild("circle4"));
  15527. this.circle5 = (this.getChild("circle5"));
  15528. this.circle6 = (this.getChild("circle6"));
  15529. this.n28 = (this.getChild("n28"));
  15530. }
  15531. }
  15532. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15533. class ui_btn_buy extends fgui.GButton {
  15534. static createInstance() {
  15535. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15536. }
  15537. onConstruct() {
  15538. this.button = this.getController("button");
  15539. this.n0 = (this.getChild("n0"));
  15540. this.n1 = (this.getChild("n1"));
  15541. this.n2 = (this.getChild("n2"));
  15542. }
  15543. }
  15544. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15545. class ui_Component41_2 extends fgui.GComponent {
  15546. static createInstance() {
  15547. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15548. }
  15549. onConstruct() {
  15550. this.c1 = this.getController("c1");
  15551. this.n0 = (this.getChild("n0"));
  15552. this.n2 = (this.getChild("n2"));
  15553. this.n19 = (this.getChild("n19"));
  15554. this.cancelBtn = (this.getChild("cancelBtn"));
  15555. this.videoBtn = (this.getChild("videoBtn"));
  15556. this.n9 = (this.getChild("n9"));
  15557. this.n22 = (this.getChild("n22"));
  15558. this.tipsTxt = (this.getChild("tipsTxt"));
  15559. this.n23 = (this.getChild("n23"));
  15560. this.n24 = (this.getChild("n24"));
  15561. this.n26 = (this.getChild("n26"));
  15562. this.n27 = (this.getChild("n27"));
  15563. this.titleTxt = (this.getChild("titleTxt"));
  15564. }
  15565. }
  15566. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15567. class ui_Component41_1 extends fgui.GComponent {
  15568. static createInstance() {
  15569. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15570. }
  15571. onConstruct() {
  15572. this.c1 = this.getController("c1");
  15573. this.n0 = (this.getChild("n0"));
  15574. this.n2 = (this.getChild("n2"));
  15575. this.cancelBtn = (this.getChild("cancelBtn"));
  15576. this.videoBtn = (this.getChild("videoBtn"));
  15577. this.n27 = (this.getChild("n27"));
  15578. this.n30 = (this.getChild("n30"));
  15579. this.n31 = (this.getChild("n31"));
  15580. this.n32 = (this.getChild("n32"));
  15581. this.n33 = (this.getChild("n33"));
  15582. this.n34 = (this.getChild("n34"));
  15583. this.n35 = (this.getChild("n35"));
  15584. this.n36 = (this.getChild("n36"));
  15585. this.n1 = (this.getChild("n1"));
  15586. this.n37 = (this.getChild("n37"));
  15587. this.t0 = this.getTransition("t0");
  15588. this.t1 = this.getTransition("t1");
  15589. this.t2 = this.getTransition("t2");
  15590. this.t3 = this.getTransition("t3");
  15591. }
  15592. }
  15593. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15594. class ui_againBtn extends fgui.GButton {
  15595. static createInstance() {
  15596. return (fgui.UIPackage.createObject("game", "againBtn"));
  15597. }
  15598. onConstruct() {
  15599. this.n2 = (this.getChild("n2"));
  15600. this.n1 = (this.getChild("n1"));
  15601. this.n5 = (this.getChild("n5"));
  15602. }
  15603. }
  15604. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15605. class ui_Component118 extends fgui.GButton {
  15606. static createInstance() {
  15607. return (fgui.UIPackage.createObject("game", "Component118"));
  15608. }
  15609. onConstruct() {
  15610. this.c1 = this.getController("c1");
  15611. this.n14 = (this.getChild("n14"));
  15612. this.n9 = (this.getChild("n9"));
  15613. this.n10 = (this.getChild("n10"));
  15614. this.diamondTxt = (this.getChild("diamondTxt"));
  15615. this.n13 = (this.getChild("n13"));
  15616. this.n15 = (this.getChild("n15"));
  15617. }
  15618. }
  15619. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15620. class ui_Component119 extends fgui.GComponent {
  15621. static createInstance() {
  15622. return (fgui.UIPackage.createObject("game", "Component119"));
  15623. }
  15624. onConstruct() {
  15625. this.n1 = (this.getChild("n1"));
  15626. this.n2 = (this.getChild("n2"));
  15627. this.n13 = (this.getChild("n13"));
  15628. this.n6 = (this.getChild("n6"));
  15629. this.screenNode = (this.getChild("screenNode"));
  15630. this.n15 = (this.getChild("n15"));
  15631. this.closeBtn = (this.getChild("closeBtn"));
  15632. this.share2Btn = (this.getChild("share2Btn"));
  15633. this.shareBtn = (this.getChild("shareBtn"));
  15634. this.tipsNode = (this.getChild("tipsNode"));
  15635. this.awardNode = (this.getChild("awardNode"));
  15636. }
  15637. }
  15638. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15639. class ui_daoJuDisplay extends fgui.GComponent {
  15640. static createInstance() {
  15641. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15642. }
  15643. onConstruct() {
  15644. this.n6 = (this.getChild("n6"));
  15645. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15646. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15647. this.btn_buy = (this.getChild("btn_buy"));
  15648. this.nameTxt = (this.getChild("nameTxt"));
  15649. this.zsImg = (this.getChild("zsImg"));
  15650. }
  15651. }
  15652. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15653. class ui_Component132_1 extends fgui.GComponent {
  15654. static createInstance() {
  15655. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15656. }
  15657. onConstruct() {
  15658. this.n25 = (this.getChild("n25"));
  15659. this.n26 = (this.getChild("n26"));
  15660. this.n27 = (this.getChild("n27"));
  15661. this.t0 = this.getTransition("t0");
  15662. }
  15663. }
  15664. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15665. class ui_SecretaryDisplay extends fgui.GComponent {
  15666. static createInstance() {
  15667. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15668. }
  15669. onConstruct() {
  15670. this.n2 = (this.getChild("n2"));
  15671. this.levelTxt = (this.getChild("levelTxt"));
  15672. this.n4 = (this.getChild("n4"));
  15673. this.secretary = (this.getChild("secretary"));
  15674. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15675. this.n16 = (this.getChild("n16"));
  15676. this.n37 = (this.getChild("n37"));
  15677. this.n41 = (this.getChild("n41"));
  15678. this.n14 = (this.getChild("n14"));
  15679. this.n17 = (this.getChild("n17"));
  15680. this.heightTxt = (this.getChild("heightTxt"));
  15681. this.n46 = (this.getChild("n46"));
  15682. this.n36 = (this.getChild("n36"));
  15683. this.n38 = (this.getChild("n38"));
  15684. this.foodTxt = (this.getChild("foodTxt"));
  15685. this.n47 = (this.getChild("n47"));
  15686. this.n40 = (this.getChild("n40"));
  15687. this.n42 = (this.getChild("n42"));
  15688. this.historyTxt = (this.getChild("historyTxt"));
  15689. this.n48 = (this.getChild("n48"));
  15690. this.nameImg = (this.getChild("nameImg"));
  15691. this.n12 = (this.getChild("n12"));
  15692. this.n49 = (this.getChild("n49"));
  15693. this.t0 = this.getTransition("t0");
  15694. }
  15695. }
  15696. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15697. class ui_BallRodDisplay extends fgui.GComponent {
  15698. static createInstance() {
  15699. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15700. }
  15701. onConstruct() {
  15702. this.c1 = this.getController("c1");
  15703. this.n31 = (this.getChild("n31"));
  15704. this.n6 = (this.getChild("n6"));
  15705. this.nameTxt = (this.getChild("nameTxt"));
  15706. this.rodImg = (this.getChild("rodImg"));
  15707. this.eftRod = (this.getChild("eftRod"));
  15708. this.levelNode = (this.getChild("levelNode"));
  15709. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15710. }
  15711. }
  15712. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15713. class ui_Component111_11 extends fgui.GComponent {
  15714. static createInstance() {
  15715. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15716. }
  15717. onConstruct() {
  15718. this.n68 = (this.getChild("n68"));
  15719. this.n69 = (this.getChild("n69"));
  15720. }
  15721. }
  15722. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  15723. class ui_Component112 extends fgui.GComponent {
  15724. static createInstance() {
  15725. return (fgui.UIPackage.createObject("game", "Component112"));
  15726. }
  15727. onConstruct() {
  15728. this.n68 = (this.getChild("n68"));
  15729. this.n70 = (this.getChild("n70"));
  15730. this.myMask = (this.getChild("myMask"));
  15731. }
  15732. }
  15733. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  15734. class ui_Component111 extends fgui.GComponent {
  15735. static createInstance() {
  15736. return (fgui.UIPackage.createObject("game", "Component111"));
  15737. }
  15738. onConstruct() {
  15739. this.n68 = (this.getChild("n68"));
  15740. this.myMask = (this.getChild("myMask"));
  15741. }
  15742. }
  15743. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  15744. class ui_Component144 extends fgui.GButton {
  15745. static createInstance() {
  15746. return (fgui.UIPackage.createObject("game", "Component144"));
  15747. }
  15748. onConstruct() {
  15749. this.n8 = (this.getChild("n8"));
  15750. }
  15751. }
  15752. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  15753. class ui_Sign_com2 extends fgui.GComponent {
  15754. static createInstance() {
  15755. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  15756. }
  15757. onConstruct() {
  15758. this.n0 = (this.getChild("n0"));
  15759. this.n1 = (this.getChild("n1"));
  15760. this.t0 = this.getTransition("t0");
  15761. }
  15762. }
  15763. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  15764. class ui_Sign_guang extends fgui.GComponent {
  15765. static createInstance() {
  15766. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  15767. }
  15768. onConstruct() {
  15769. this.n1 = (this.getChild("n1"));
  15770. this.n2 = (this.getChild("n2"));
  15771. this.n3 = (this.getChild("n3"));
  15772. this.n4 = (this.getChild("n4"));
  15773. this.n5 = (this.getChild("n5"));
  15774. this.n6 = (this.getChild("n6"));
  15775. this.n8 = (this.getChild("n8"));
  15776. }
  15777. }
  15778. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  15779. class ui_SignMax extends fgui.GComponent {
  15780. static createInstance() {
  15781. return (fgui.UIPackage.createObject("game", "SignMax"));
  15782. }
  15783. onConstruct() {
  15784. this.c1 = this.getController("c1");
  15785. this.n7 = (this.getChild("n7"));
  15786. this.n15 = (this.getChild("n15"));
  15787. this.n8 = (this.getChild("n8"));
  15788. this.titleTxt = (this.getChild("titleTxt"));
  15789. this.myIcon1 = (this.getChild("myIcon1"));
  15790. this.numTxt1 = (this.getChild("numTxt1"));
  15791. this.myIcon2 = (this.getChild("myIcon2"));
  15792. this.n20 = (this.getChild("n20"));
  15793. this.n17 = (this.getChild("n17"));
  15794. this.numTxt2 = (this.getChild("numTxt2"));
  15795. this.n12 = (this.getChild("n12"));
  15796. this.n13 = (this.getChild("n13"));
  15797. this.n21 = (this.getChild("n21"));
  15798. this.n14 = (this.getChild("n14"));
  15799. }
  15800. }
  15801. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  15802. class ui_Sign_com2_1 extends fgui.GComponent {
  15803. static createInstance() {
  15804. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  15805. }
  15806. onConstruct() {
  15807. this.n0 = (this.getChild("n0"));
  15808. this.n1 = (this.getChild("n1"));
  15809. this.t0 = this.getTransition("t0");
  15810. }
  15811. }
  15812. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  15813. class ui_Sign_com5 extends fgui.GComponent {
  15814. static createInstance() {
  15815. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  15816. }
  15817. onConstruct() {
  15818. this.n3 = (this.getChild("n3"));
  15819. this.n29 = (this.getChild("n29"));
  15820. this.n4 = (this.getChild("n4"));
  15821. this.day1 = (this.getChild("day1"));
  15822. this.day2 = (this.getChild("day2"));
  15823. this.day3 = (this.getChild("day3"));
  15824. this.day4 = (this.getChild("day4"));
  15825. this.day5 = (this.getChild("day5"));
  15826. this.day6 = (this.getChild("day6"));
  15827. this.day7 = (this.getChild("day7"));
  15828. this.t0 = this.getTransition("t0");
  15829. }
  15830. }
  15831. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  15832. class ui_Sign_com8 extends fgui.GComponent {
  15833. static createInstance() {
  15834. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  15835. }
  15836. onConstruct() {
  15837. this.n48 = (this.getChild("n48"));
  15838. this.womanTxt = (this.getChild("womanTxt"));
  15839. this.t0 = this.getTransition("t0");
  15840. }
  15841. }
  15842. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  15843. class ui_Sign_com6 extends fgui.GComponent {
  15844. static createInstance() {
  15845. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  15846. }
  15847. onConstruct() {
  15848. this.n2 = (this.getChild("n2"));
  15849. this.n3 = (this.getChild("n3"));
  15850. this.t0 = this.getTransition("t0");
  15851. }
  15852. }
  15853. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  15854. class ui_Sign_com7 extends fgui.GComponent {
  15855. static createInstance() {
  15856. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  15857. }
  15858. onConstruct() {
  15859. this.n29 = (this.getChild("n29"));
  15860. this.n2 = (this.getChild("n2"));
  15861. }
  15862. }
  15863. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  15864. class ui_UITurntable_com1_2 extends fgui.GComponent {
  15865. static createInstance() {
  15866. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  15867. }
  15868. onConstruct() {
  15869. this.n5 = (this.getChild("n5"));
  15870. this.n4 = (this.getChild("n4"));
  15871. this.t0 = this.getTransition("t0");
  15872. }
  15873. }
  15874. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  15875. class ui_UITurntable_com2 extends fgui.GComponent {
  15876. static createInstance() {
  15877. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  15878. }
  15879. onConstruct() {
  15880. this.c1 = this.getController("c1");
  15881. this.n4 = (this.getChild("n4"));
  15882. this.n6 = (this.getChild("n6"));
  15883. this.n10 = (this.getChild("n10"));
  15884. this.n11 = (this.getChild("n11"));
  15885. this.n12 = (this.getChild("n12"));
  15886. this.n13 = (this.getChild("n13"));
  15887. this.n14 = (this.getChild("n14"));
  15888. this.n15 = (this.getChild("n15"));
  15889. this.n16 = (this.getChild("n16"));
  15890. this.n17 = (this.getChild("n17"));
  15891. this.n18 = (this.getChild("n18"));
  15892. this.n19 = (this.getChild("n19"));
  15893. this.n20 = (this.getChild("n20"));
  15894. this.n21 = (this.getChild("n21"));
  15895. this.n22 = (this.getChild("n22"));
  15896. this.n23 = (this.getChild("n23"));
  15897. this.n24 = (this.getChild("n24"));
  15898. this.n25 = (this.getChild("n25"));
  15899. this.n26 = (this.getChild("n26"));
  15900. this.n27 = (this.getChild("n27"));
  15901. this.n28 = (this.getChild("n28"));
  15902. this.n29 = (this.getChild("n29"));
  15903. this.n30 = (this.getChild("n30"));
  15904. this.n31 = (this.getChild("n31"));
  15905. this.n32 = (this.getChild("n32"));
  15906. this.n33 = (this.getChild("n33"));
  15907. }
  15908. }
  15909. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  15910. class ui_UITurntable_com1_1 extends fgui.GComponent {
  15911. static createInstance() {
  15912. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  15913. }
  15914. onConstruct() {
  15915. this.n5 = (this.getChild("n5"));
  15916. this.n4 = (this.getChild("n4"));
  15917. this.t0 = this.getTransition("t0");
  15918. }
  15919. }
  15920. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  15921. class ui_UITurntable_com5 extends fgui.GComponent {
  15922. static createInstance() {
  15923. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  15924. }
  15925. onConstruct() {
  15926. this.flashNode = (this.getChild("flashNode"));
  15927. this.rotNode = (this.getChild("rotNode"));
  15928. this.n3 = (this.getChild("n3"));
  15929. this.n21 = (this.getChild("n21"));
  15930. this.t0 = this.getTransition("t0");
  15931. }
  15932. }
  15933. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  15934. class ui_UITurntable_com7 extends fgui.GComponent {
  15935. static createInstance() {
  15936. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  15937. }
  15938. onConstruct() {
  15939. this.n2 = (this.getChild("n2"));
  15940. this.n35 = (this.getChild("n35"));
  15941. this.img1 = (this.getChild("img1"));
  15942. this.img2 = (this.getChild("img2"));
  15943. this.img3 = (this.getChild("img3"));
  15944. this.img4 = (this.getChild("img4"));
  15945. this.img6 = (this.getChild("img6"));
  15946. this.img5 = (this.getChild("img5"));
  15947. this.txt1 = (this.getChild("txt1"));
  15948. this.txt2 = (this.getChild("txt2"));
  15949. this.txt3 = (this.getChild("txt3"));
  15950. this.txt4 = (this.getChild("txt4"));
  15951. this.txt5 = (this.getChild("txt5"));
  15952. this.txt6 = (this.getChild("txt6"));
  15953. }
  15954. }
  15955. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  15956. class ui_UITurntable_com9 extends fgui.GComponent {
  15957. static createInstance() {
  15958. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  15959. }
  15960. onConstruct() {
  15961. this.n38 = (this.getChild("n38"));
  15962. this.n39 = (this.getChild("n39"));
  15963. }
  15964. }
  15965. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  15966. class ui_UITurntable_com10 extends fgui.GComponent {
  15967. static createInstance() {
  15968. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  15969. }
  15970. onConstruct() {
  15971. this.n39 = (this.getChild("n39"));
  15972. this.n40 = (this.getChild("n40"));
  15973. this.t0 = this.getTransition("t0");
  15974. }
  15975. }
  15976. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  15977. class ui_UITurntable_com11 extends fgui.GComponent {
  15978. static createInstance() {
  15979. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  15980. }
  15981. onConstruct() {
  15982. this.n38 = (this.getChild("n38"));
  15983. this.n39 = (this.getChild("n39"));
  15984. this.n40 = (this.getChild("n40"));
  15985. this.t0 = this.getTransition("t0");
  15986. }
  15987. }
  15988. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  15989. class ui_UITurntable_com12 extends fgui.GComponent {
  15990. static createInstance() {
  15991. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  15992. }
  15993. onConstruct() {
  15994. this.n43 = (this.getChild("n43"));
  15995. this.barNode = (this.getChild("barNode"));
  15996. this.tipsTxt = (this.getChild("tipsTxt"));
  15997. this.n45 = (this.getChild("n45"));
  15998. this.boxBtn = (this.getChild("boxBtn"));
  15999. }
  16000. }
  16001. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16002. class ui_UITurntable_com1 extends fgui.GButton {
  16003. static createInstance() {
  16004. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16005. }
  16006. onConstruct() {
  16007. this.n41 = (this.getChild("n41"));
  16008. this.n42 = (this.getChild("n42"));
  16009. this.t0 = this.getTransition("t0");
  16010. }
  16011. }
  16012. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16013. class ui_UITurntable_com3 extends fgui.GComponent {
  16014. static createInstance() {
  16015. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16016. }
  16017. onConstruct() {
  16018. this.n48 = (this.getChild("n48"));
  16019. this.womanTxt = (this.getChild("womanTxt"));
  16020. this.t0 = this.getTransition("t0");
  16021. }
  16022. }
  16023. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16024. class ui_cancelBtn2 extends fgui.GButton {
  16025. static createInstance() {
  16026. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16027. }
  16028. onConstruct() {
  16029. this.c1 = this.getController("c1");
  16030. this.n0 = (this.getChild("n0"));
  16031. this.n1 = (this.getChild("n1"));
  16032. this.n2 = (this.getChild("n2"));
  16033. this.n3 = (this.getChild("n3"));
  16034. this.n4 = (this.getChild("n4"));
  16035. this.n5 = (this.getChild("n5"));
  16036. this.n6 = (this.getChild("n6"));
  16037. this.n7 = (this.getChild("n7"));
  16038. this.n8 = (this.getChild("n8"));
  16039. this.powerEft = (this.getChild("powerEft"));
  16040. }
  16041. }
  16042. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16043. class ui_shareBtn2 extends fgui.GButton {
  16044. static createInstance() {
  16045. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16046. }
  16047. onConstruct() {
  16048. this.c1 = this.getController("c1");
  16049. this.n2 = (this.getChild("n2"));
  16050. this.n24 = (this.getChild("n24"));
  16051. this.n1 = (this.getChild("n1"));
  16052. this.n3 = (this.getChild("n3"));
  16053. this.n23 = (this.getChild("n23"));
  16054. this.n4 = (this.getChild("n4"));
  16055. this.n5 = (this.getChild("n5"));
  16056. this.n6 = (this.getChild("n6"));
  16057. this.n20 = (this.getChild("n20"));
  16058. this.n21 = (this.getChild("n21"));
  16059. this.n22 = (this.getChild("n22"));
  16060. this.powerEft = (this.getChild("powerEft"));
  16061. }
  16062. }
  16063. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16064. class ui_UIMoney extends fgui.GComponent {
  16065. static createInstance() {
  16066. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16067. }
  16068. onConstruct() {
  16069. this.c1 = this.getController("c1");
  16070. this.n4 = (this.getChild("n4"));
  16071. this.coinImg = (this.getChild("coinImg"));
  16072. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16073. this.coinTxt = (this.getChild("coinTxt"));
  16074. this.n7 = (this.getChild("n7"));
  16075. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16076. this.diamondTxt = (this.getChild("diamondTxt"));
  16077. this.diamondImg = (this.getChild("diamondImg"));
  16078. this.n12 = (this.getChild("n12"));
  16079. this.powerImg = (this.getChild("powerImg"));
  16080. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16081. this.powerTxt = (this.getChild("powerTxt"));
  16082. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16083. }
  16084. }
  16085. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16086. class ui_backBtn extends fgui.GButton {
  16087. static createInstance() {
  16088. return (fgui.UIPackage.createObject("game", "backBtn"));
  16089. }
  16090. onConstruct() {
  16091. this.n0 = (this.getChild("n0"));
  16092. this.t0 = this.getTransition("t0");
  16093. this.t1 = this.getTransition("t1");
  16094. }
  16095. }
  16096. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16097. class ui_MoneyBtn extends fgui.GButton {
  16098. static createInstance() {
  16099. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16100. }
  16101. onConstruct() {
  16102. this.button = this.getController("button");
  16103. this.n0 = (this.getChild("n0"));
  16104. }
  16105. }
  16106. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16107. class ui_UIMoneyBtn extends fgui.GComponent {
  16108. static createInstance() {
  16109. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16110. }
  16111. onConstruct() {
  16112. this.n1 = (this.getChild("n1"));
  16113. this.closeBtn = (this.getChild("closeBtn"));
  16114. }
  16115. }
  16116. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16117. class ui_Component64 extends fgui.GComponent {
  16118. static createInstance() {
  16119. return (fgui.UIPackage.createObject("game", "Component64"));
  16120. }
  16121. onConstruct() {
  16122. this.n57 = (this.getChild("n57"));
  16123. this.n54 = (this.getChild("n54"));
  16124. this.n55 = (this.getChild("n55"));
  16125. this.n56 = (this.getChild("n56"));
  16126. this.t1 = this.getTransition("t1");
  16127. }
  16128. }
  16129. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16130. class ui_Component41_3 extends fgui.GComponent {
  16131. static createInstance() {
  16132. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16133. }
  16134. onConstruct() {
  16135. this.c1 = this.getController("c1");
  16136. this.n0 = (this.getChild("n0"));
  16137. this.n2 = (this.getChild("n2"));
  16138. this.cancelBtn = (this.getChild("cancelBtn"));
  16139. this.videoBtn = (this.getChild("videoBtn"));
  16140. this.n9 = (this.getChild("n9"));
  16141. this.n24 = (this.getChild("n24"));
  16142. this.n27 = (this.getChild("n27"));
  16143. this.titleTxt = (this.getChild("titleTxt"));
  16144. this.n28 = (this.getChild("n28"));
  16145. this.t0 = this.getTransition("t0");
  16146. }
  16147. }
  16148. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16149. class ui_dh_zs_4 extends fgui.GComponent {
  16150. static createInstance() {
  16151. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16152. }
  16153. onConstruct() {
  16154. this.n1 = (this.getChild("n1"));
  16155. this.n2 = (this.getChild("n2"));
  16156. this.n3 = (this.getChild("n3"));
  16157. this.n4 = (this.getChild("n4"));
  16158. this.n5 = (this.getChild("n5"));
  16159. this.n6 = (this.getChild("n6"));
  16160. this.n8 = (this.getChild("n8"));
  16161. this.t0 = this.getTransition("t0");
  16162. }
  16163. }
  16164. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16165. class ui_Component71_1 extends fgui.GButton {
  16166. static createInstance() {
  16167. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16168. }
  16169. onConstruct() {
  16170. this.n17 = (this.getChild("n17"));
  16171. this.t0 = this.getTransition("t0");
  16172. }
  16173. }
  16174. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16175. class ui_Component83 extends fgui.GComponent {
  16176. static createInstance() {
  16177. return (fgui.UIPackage.createObject("game", "Component83"));
  16178. }
  16179. onConstruct() {
  16180. this.c1 = this.getController("c1");
  16181. this.n17 = (this.getChild("n17"));
  16182. this.n19 = (this.getChild("n19"));
  16183. this.n20 = (this.getChild("n20"));
  16184. }
  16185. }
  16186. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16187. class ui_Component84 extends fgui.GComponent {
  16188. static createInstance() {
  16189. return (fgui.UIPackage.createObject("game", "Component84"));
  16190. }
  16191. onConstruct() {
  16192. this.c1 = this.getController("c1");
  16193. this.n4 = (this.getChild("n4"));
  16194. this.n22 = (this.getChild("n22"));
  16195. this.n23 = (this.getChild("n23"));
  16196. this.numTxt = (this.getChild("numTxt"));
  16197. this.n25 = (this.getChild("n25"));
  16198. this.n26 = (this.getChild("n26"));
  16199. }
  16200. }
  16201. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16202. class ui_Component84_1 extends fgui.GComponent {
  16203. static createInstance() {
  16204. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16205. }
  16206. onConstruct() {
  16207. this.c1 = this.getController("c1");
  16208. this.n4 = (this.getChild("n4"));
  16209. this.n22 = (this.getChild("n22"));
  16210. this.n23 = (this.getChild("n23"));
  16211. this.numTxt = (this.getChild("numTxt"));
  16212. this.n25 = (this.getChild("n25"));
  16213. this.n26 = (this.getChild("n26"));
  16214. }
  16215. }
  16216. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16217. class ui_Component85 extends fgui.GComponent {
  16218. static createInstance() {
  16219. return (fgui.UIPackage.createObject("game", "Component85"));
  16220. }
  16221. onConstruct() {
  16222. this.n1 = (this.getChild("n1"));
  16223. this.n6 = (this.getChild("n6"));
  16224. this.n2 = (this.getChild("n2"));
  16225. this.n3 = (this.getChild("n3"));
  16226. this.levelTxt = (this.getChild("levelTxt"));
  16227. this.n10 = (this.getChild("n10"));
  16228. this.n11 = (this.getChild("n11"));
  16229. this.n12 = (this.getChild("n12"));
  16230. this.n13 = (this.getChild("n13"));
  16231. this.n14 = (this.getChild("n14"));
  16232. this.modeNode = (this.getChild("modeNode"));
  16233. this.n18 = (this.getChild("n18"));
  16234. this.conditionTxt = (this.getChild("conditionTxt"));
  16235. this.diamondNode = (this.getChild("diamondNode"));
  16236. this.coinNode = (this.getChild("coinNode"));
  16237. this.startBtn = (this.getChild("startBtn"));
  16238. this.n28 = (this.getChild("n28"));
  16239. this.displayRoot = (this.getChild("displayRoot"));
  16240. this.t0 = this.getTransition("t0");
  16241. }
  16242. }
  16243. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16244. class ui_Component86 extends fgui.GButton {
  16245. static createInstance() {
  16246. return (fgui.UIPackage.createObject("game", "Component86"));
  16247. }
  16248. onConstruct() {
  16249. this.n15 = (this.getChild("n15"));
  16250. this.t0 = this.getTransition("t0");
  16251. }
  16252. }
  16253. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16254. class ui_Component87 extends fgui.GComponent {
  16255. static createInstance() {
  16256. return (fgui.UIPackage.createObject("game", "Component87"));
  16257. }
  16258. onConstruct() {
  16259. this.n66 = (this.getChild("n66"));
  16260. this.myProgress = (this.getChild("myProgress"));
  16261. this.starAni = (this.getChild("starAni"));
  16262. this.hpTxt = (this.getChild("hpTxt"));
  16263. this.n74 = (this.getChild("n74"));
  16264. this.n73 = (this.getChild("n73"));
  16265. this.ballTxt = (this.getChild("ballTxt"));
  16266. this.n76 = (this.getChild("n76"));
  16267. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16268. this.levelTxt = (this.getChild("levelTxt"));
  16269. this.star1 = (this.getChild("star1"));
  16270. this.star2 = (this.getChild("star2"));
  16271. this.star3 = (this.getChild("star3"));
  16272. }
  16273. }
  16274. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16275. class ui_Component88 extends fgui.GProgressBar {
  16276. static createInstance() {
  16277. return (fgui.UIPackage.createObject("game", "Component88"));
  16278. }
  16279. onConstruct() {
  16280. this.n68 = (this.getChild("n68"));
  16281. this.bar = (this.getChild("bar"));
  16282. }
  16283. }
  16284. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16285. class ui_Component89 extends fgui.GComponent {
  16286. static createInstance() {
  16287. return (fgui.UIPackage.createObject("game", "Component89"));
  16288. }
  16289. onConstruct() {
  16290. this.c1 = this.getController("c1");
  16291. this.n71 = (this.getChild("n71"));
  16292. this.n72 = (this.getChild("n72"));
  16293. }
  16294. }
  16295. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16296. class ui_Component90 extends fgui.GComponent {
  16297. static createInstance() {
  16298. return (fgui.UIPackage.createObject("game", "Component90"));
  16299. }
  16300. onConstruct() {
  16301. this.c1 = this.getController("c1");
  16302. this.n64 = (this.getChild("n64"));
  16303. this.n65 = (this.getChild("n65"));
  16304. this.n66 = (this.getChild("n66"));
  16305. this.t0 = this.getTransition("t0");
  16306. }
  16307. }
  16308. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16309. class ui_Component127 extends fgui.GButton {
  16310. static createInstance() {
  16311. return (fgui.UIPackage.createObject("game", "Component127"));
  16312. }
  16313. onConstruct() {
  16314. this.n5 = (this.getChild("n5"));
  16315. }
  16316. }
  16317. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16318. class gameBinder {
  16319. static bindAll() {
  16320. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16321. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16322. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16323. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16324. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16325. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16326. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16327. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16328. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16329. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16330. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16331. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16332. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16333. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16334. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16335. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16336. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16337. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16338. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16339. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16340. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16341. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16342. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16343. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16344. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16345. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16346. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16347. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16348. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16349. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16350. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16351. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16352. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16353. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16354. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16355. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16356. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16357. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16358. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16359. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16360. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16361. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16362. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16363. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16364. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16365. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16366. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16367. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16368. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16369. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16370. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16371. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16372. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16373. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16374. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16375. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16376. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16377. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16378. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16379. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16380. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16381. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16382. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16383. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16384. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16385. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16386. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16387. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16388. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16389. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16390. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16391. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16392. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16393. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16394. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16395. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16396. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16397. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16398. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16399. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16400. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16401. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16402. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16403. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16404. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16405. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16406. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16407. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16408. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16409. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16410. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16411. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16412. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16413. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16414. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16415. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16416. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16417. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16418. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16419. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16420. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16421. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16422. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16423. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16424. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16425. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16426. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16427. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16428. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16429. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16430. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16431. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16432. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16433. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16434. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16435. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16436. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16437. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16438. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16439. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16440. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16441. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16442. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16443. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16444. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16445. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16446. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16447. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16448. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16449. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16450. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16451. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16452. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16453. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16454. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16455. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16456. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16457. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16458. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16459. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16460. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16461. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16462. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16463. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16464. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16465. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16466. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16467. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16468. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16469. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16470. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16471. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16472. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16473. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16474. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16475. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16476. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16477. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16478. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16479. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16480. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16481. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16482. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16483. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16484. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16485. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16486. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16487. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16488. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16489. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16490. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16491. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16492. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16493. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16494. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16495. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16496. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16497. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16498. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16499. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16500. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16501. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16502. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16503. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16504. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16505. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16506. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16507. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16508. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16509. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16510. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16511. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16512. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16513. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16514. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16515. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16516. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16517. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16518. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16519. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16520. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16521. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16522. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16523. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16524. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16525. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16526. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16527. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16528. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16529. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16530. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16531. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16532. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16533. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16534. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16535. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16536. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16537. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16538. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16539. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16540. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16541. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16542. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16543. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16544. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16545. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16546. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16547. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16548. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16549. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16550. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16551. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16552. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16553. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16554. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16555. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16556. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16557. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16558. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16559. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16560. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16561. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16562. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16563. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16564. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16565. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16566. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16567. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16568. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16569. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16570. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16571. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16572. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16573. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16574. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16575. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16576. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16577. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16578. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16579. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16580. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16581. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16582. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16583. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16584. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16585. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16586. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16587. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16588. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16589. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16590. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16591. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16592. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16593. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16594. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16595. }
  16596. }
  16597. class ui_btn6 extends fgui.GButton {
  16598. static createInstance() {
  16599. return (fgui.UIPackage.createObject("loading", "btn6"));
  16600. }
  16601. onConstruct() {
  16602. this.n6 = (this.getChild("n6"));
  16603. this.n1 = (this.getChild("n1"));
  16604. }
  16605. }
  16606. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16607. class ui_xyItem extends fgui.GComponent {
  16608. static createInstance() {
  16609. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16610. }
  16611. onConstruct() {
  16612. this.xyItem = (this.getChild("xyItem"));
  16613. }
  16614. }
  16615. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16616. class ui_loadinfo extends fgui.GProgressBar {
  16617. static createInstance() {
  16618. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16619. }
  16620. onConstruct() {
  16621. this.bg = (this.getChild("bg"));
  16622. this.bar = (this.getChild("bar"));
  16623. this.title = (this.getChild("title"));
  16624. this.ani = (this.getChild("ani"));
  16625. }
  16626. }
  16627. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16628. class ui_xyNode extends fgui.GComponent {
  16629. static createInstance() {
  16630. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16631. }
  16632. onConstruct() {
  16633. this.n0 = (this.getChild("n0"));
  16634. this.btnYes = (this.getChild("btnYes"));
  16635. this.btnNo = (this.getChild("btnNo"));
  16636. this.btnKnown = (this.getChild("btnKnown"));
  16637. this.btnSure = (this.getChild("btnSure"));
  16638. this.txtWelcom = (this.getChild("txtWelcom"));
  16639. this.txtXy = (this.getChild("txtXy"));
  16640. this.n75 = (this.getChild("n75"));
  16641. this.btnXy1 = (this.getChild("btnXy1"));
  16642. this.btnXy3 = (this.getChild("btnXy3"));
  16643. this.btnXy2 = (this.getChild("btnXy2"));
  16644. this.n74 = (this.getChild("n74"));
  16645. this.xy1 = (this.getChild("xy1"));
  16646. this.txtTitle = (this.getChild("txtTitle"));
  16647. this.btnBack = (this.getChild("btnBack"));
  16648. this.xyList = (this.getChild("xyList"));
  16649. this.xy2 = (this.getChild("xy2"));
  16650. this.xyNode = (this.getChild("xyNode"));
  16651. }
  16652. }
  16653. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16654. class ui_ageNode extends fgui.GComponent {
  16655. static createInstance() {
  16656. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16657. }
  16658. onConstruct() {
  16659. this.n3 = (this.getChild("n3"));
  16660. this.n7 = (this.getChild("n7"));
  16661. this.n4 = (this.getChild("n4"));
  16662. this.btnAge = (this.getChild("btnAge"));
  16663. this.ageNode = (this.getChild("ageNode"));
  16664. }
  16665. }
  16666. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16667. class ui_rnNode extends fgui.GComponent {
  16668. static createInstance() {
  16669. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16670. }
  16671. onConstruct() {
  16672. this.n28 = (this.getChild("n28"));
  16673. this.n30 = (this.getChild("n30"));
  16674. this.n33 = (this.getChild("n33"));
  16675. this.rn1 = (this.getChild("rn1"));
  16676. this.n40 = (this.getChild("n40"));
  16677. this.n41 = (this.getChild("n41"));
  16678. this.rn3 = (this.getChild("rn3"));
  16679. this.n37 = (this.getChild("n37"));
  16680. this.n39 = (this.getChild("n39"));
  16681. this.rn2 = (this.getChild("rn2"));
  16682. this.n47 = (this.getChild("n47"));
  16683. this.n49 = (this.getChild("n49"));
  16684. this.n44 = (this.getChild("n44"));
  16685. this.inputCode = (this.getChild("inputCode"));
  16686. this.inputName = (this.getChild("inputName"));
  16687. this.n48 = (this.getChild("n48"));
  16688. this.n50 = (this.getChild("n50"));
  16689. this.rn4 = (this.getChild("rn4"));
  16690. this.btnCheck = (this.getChild("btnCheck"));
  16691. this.btnExit = (this.getChild("btnExit"));
  16692. this.btnDone = (this.getChild("btnDone"));
  16693. this.rnNode = (this.getChild("rnNode"));
  16694. }
  16695. }
  16696. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16697. class ui_tipNode extends fgui.GComponent {
  16698. static createInstance() {
  16699. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16700. }
  16701. onConstruct() {
  16702. this.bg = (this.getChild("bg"));
  16703. this.n55 = (this.getChild("n55"));
  16704. this.n56 = (this.getChild("n56"));
  16705. this.tipNode = (this.getChild("tipNode"));
  16706. }
  16707. }
  16708. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16709. class ui_fcmNode extends fgui.GComponent {
  16710. static createInstance() {
  16711. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  16712. }
  16713. onConstruct() {
  16714. this.n63 = (this.getChild("n63"));
  16715. this.n62 = (this.getChild("n62"));
  16716. this.btnRn = (this.getChild("btnRn"));
  16717. this.n61 = (this.getChild("n61"));
  16718. this.n58 = (this.getChild("n58"));
  16719. this.fcmNode = (this.getChild("fcmNode"));
  16720. }
  16721. }
  16722. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  16723. class ui_msgNode extends fgui.GComponent {
  16724. static createInstance() {
  16725. return (fgui.UIPackage.createObject("loading", "msgNode"));
  16726. }
  16727. onConstruct() {
  16728. this.n69 = (this.getChild("n69"));
  16729. this.txtMsg = (this.getChild("txtMsg"));
  16730. this.msgNode = (this.getChild("msgNode"));
  16731. }
  16732. }
  16733. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  16734. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  16735. static createInstance() {
  16736. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  16737. }
  16738. onConstruct() {
  16739. this.n1 = (this.getChild("n1"));
  16740. this.n13 = (this.getChild("n13"));
  16741. this.n14 = (this.getChild("n14"));
  16742. this.n15 = (this.getChild("n15"));
  16743. this.n3 = (this.getChild("n3"));
  16744. this.n4 = (this.getChild("n4"));
  16745. this.n5 = (this.getChild("n5"));
  16746. this.n6 = (this.getChild("n6"));
  16747. this.n7 = (this.getChild("n7"));
  16748. this.n8 = (this.getChild("n8"));
  16749. this.n9 = (this.getChild("n9"));
  16750. this.n10 = (this.getChild("n10"));
  16751. this.n12 = (this.getChild("n12"));
  16752. this.n11 = (this.getChild("n11"));
  16753. this.n16 = (this.getChild("n16"));
  16754. this.n17 = (this.getChild("n17"));
  16755. this.n18 = (this.getChild("n18"));
  16756. this.n20 = (this.getChild("n20"));
  16757. this.n21 = (this.getChild("n21"));
  16758. this.t0 = this.getTransition("t0");
  16759. }
  16760. }
  16761. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  16762. class ui_btn5 extends fgui.GButton {
  16763. static createInstance() {
  16764. return (fgui.UIPackage.createObject("loading", "btn5"));
  16765. }
  16766. onConstruct() {
  16767. this.n9 = (this.getChild("n9"));
  16768. this.n1 = (this.getChild("n1"));
  16769. }
  16770. }
  16771. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  16772. class ui_UILoading extends fgui.GComponent {
  16773. static createInstance() {
  16774. return (fgui.UIPackage.createObject("loading", "UILoading"));
  16775. }
  16776. onConstruct() {
  16777. this.n12 = (this.getChild("n12"));
  16778. this.loadinfo = (this.getChild("loadinfo"));
  16779. this.n13 = (this.getChild("n13"));
  16780. this.txtLoad = (this.getChild("txtLoad"));
  16781. this.n18 = (this.getChild("n18"));
  16782. }
  16783. }
  16784. ui_UILoading.URL = "ui://37nctnhwphc33";
  16785. class ui_AgeItem extends fgui.GComponent {
  16786. static createInstance() {
  16787. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  16788. }
  16789. onConstruct() {
  16790. this.txtAge = (this.getChild("txtAge"));
  16791. }
  16792. }
  16793. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  16794. class ui_btn1 extends fgui.GButton {
  16795. static createInstance() {
  16796. return (fgui.UIPackage.createObject("loading", "btn1"));
  16797. }
  16798. onConstruct() {
  16799. this.n6 = (this.getChild("n6"));
  16800. this.n1 = (this.getChild("n1"));
  16801. }
  16802. }
  16803. ui_btn1.URL = "ui://37nctnhwxe622p";
  16804. class ui_btn3 extends fgui.GButton {
  16805. static createInstance() {
  16806. return (fgui.UIPackage.createObject("loading", "btn3"));
  16807. }
  16808. onConstruct() {
  16809. this.n9 = (this.getChild("n9"));
  16810. this.n1 = (this.getChild("n1"));
  16811. }
  16812. }
  16813. ui_btn3.URL = "ui://37nctnhwxe622s";
  16814. class ui_btn2 extends fgui.GButton {
  16815. static createInstance() {
  16816. return (fgui.UIPackage.createObject("loading", "btn2"));
  16817. }
  16818. onConstruct() {
  16819. this.n6 = (this.getChild("n6"));
  16820. this.n1 = (this.getChild("n1"));
  16821. }
  16822. }
  16823. ui_btn2.URL = "ui://37nctnhwxe622t";
  16824. class ui_btnBack extends fgui.GButton {
  16825. static createInstance() {
  16826. return (fgui.UIPackage.createObject("loading", "btnBack"));
  16827. }
  16828. onConstruct() {
  16829. this.n6 = (this.getChild("n6"));
  16830. this.n7 = (this.getChild("n7"));
  16831. }
  16832. }
  16833. ui_btnBack.URL = "ui://37nctnhwxe622u";
  16834. class ui_btnXy1 extends fgui.GButton {
  16835. static createInstance() {
  16836. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  16837. }
  16838. onConstruct() {
  16839. this.n1 = (this.getChild("n1"));
  16840. }
  16841. }
  16842. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  16843. class ui_btnXy2 extends fgui.GButton {
  16844. static createInstance() {
  16845. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  16846. }
  16847. onConstruct() {
  16848. this.n1 = (this.getChild("n1"));
  16849. }
  16850. }
  16851. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  16852. class ui_btnXy3 extends fgui.GButton {
  16853. static createInstance() {
  16854. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  16855. }
  16856. onConstruct() {
  16857. this.n1 = (this.getChild("n1"));
  16858. }
  16859. }
  16860. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  16861. class ui_btn4 extends fgui.GButton {
  16862. static createInstance() {
  16863. return (fgui.UIPackage.createObject("loading", "btn4"));
  16864. }
  16865. onConstruct() {
  16866. this.n9 = (this.getChild("n9"));
  16867. this.n1 = (this.getChild("n1"));
  16868. }
  16869. }
  16870. ui_btn4.URL = "ui://37nctnhwxe622z";
  16871. class loadingBinder {
  16872. static bindAll() {
  16873. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  16874. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  16875. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  16876. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  16877. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  16878. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  16879. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  16880. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  16881. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  16882. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  16883. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  16884. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  16885. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  16886. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  16887. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  16888. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  16889. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  16890. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  16891. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  16892. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  16893. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  16894. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  16895. }
  16896. }
  16897. class UIMgr {
  16898. constructor() {
  16899. this._stage = null;
  16900. this._uiList = [];
  16901. this._showList = [];
  16902. this._bindPkgList = [];
  16903. this.uiIndex = 0;
  16904. }
  16905. static get inst() {
  16906. if (UIMgr._inst == null) {
  16907. UIMgr._inst = new UIMgr();
  16908. }
  16909. return UIMgr._inst;
  16910. }
  16911. setStage(s) {
  16912. if (this._stage) {
  16913. console.log("ViewMgr::Stage->舞台不可赋值两次");
  16914. return;
  16915. }
  16916. this._stage = s;
  16917. }
  16918. clearTempData() {
  16919. console.log('zh:clearTempData start');
  16920. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  16921. console.log('zh:clearTempData end');
  16922. }
  16923. init() {
  16924. this.setStage(Laya.stage);
  16925. fairygui.UIConfig.defaultFont = "arial";
  16926. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  16927. fairygui.UIConfig.packageFileExtension = "obj";
  16928. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  16929. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  16930. fairygui.GRoot.inst.width = Laya.stage.width;
  16931. fairygui.GRoot.inst.height = Laya.stage.height;
  16932. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  16933. }
  16934. addAllUpdate() {
  16935. this.uiIndex = 0;
  16936. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  16937. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  16938. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  16939. }
  16940. }
  16941. }
  16942. bindFUI(pkgname) {
  16943. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  16944. return;
  16945. }
  16946. switch (pkgname) {
  16947. case fguiRes.loading:
  16948. fairygui.UIPackage.addPackage(pkgname);
  16949. loadingBinder.bindAll();
  16950. this._bindPkgList.push(pkgname);
  16951. break;
  16952. case fguiRes.game:
  16953. fairygui.UIPackage.addPackage(pkgname);
  16954. gameBinder.bindAll();
  16955. this._bindPkgList.push(pkgname);
  16956. break;
  16957. default:
  16958. break;
  16959. }
  16960. }
  16961. Show(cls, ...param) {
  16962. let nameStr = cls.uiName;
  16963. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16964. let temp = this._uiList[i];
  16965. let str = temp.className;
  16966. if (str == nameStr) {
  16967. if (temp.isMuti) {
  16968. if (temp.isHide) {
  16969. temp.show(...param);
  16970. this._uiList.splice(i, 1);
  16971. this._uiList.push(temp);
  16972. return temp;
  16973. }
  16974. }
  16975. else {
  16976. temp.show(...param);
  16977. this._uiList.splice(i, 1);
  16978. this._uiList.push(temp);
  16979. return temp;
  16980. }
  16981. }
  16982. }
  16983. let ui = new cls();
  16984. ui.className = nameStr;
  16985. this._showUI(ui, param);
  16986. return ui;
  16987. }
  16988. destroyUI(ui) {
  16989. for (let i = this._uiList.length - 1; i >= 0; i--) {
  16990. let temp = this._uiList[i].className;
  16991. if (temp == ui.className) {
  16992. this._uiList.splice(i, 1);
  16993. break;
  16994. }
  16995. }
  16996. this.checkUIState();
  16997. }
  16998. _showUI(ui, param) {
  16999. this._uiList.push(ui);
  17000. ui.show(...param);
  17001. }
  17002. Hide(uiClass) {
  17003. let ui = this.getUI(uiClass);
  17004. if (ui && !ui.isHide) {
  17005. ui.hide();
  17006. }
  17007. }
  17008. getUI(ui) {
  17009. let nameStr = ui.uiName;
  17010. for (let index = 0; index < this._uiList.length; index++) {
  17011. let temp = this._uiList[index];
  17012. if (temp.className == nameStr) {
  17013. return temp;
  17014. }
  17015. }
  17016. return null;
  17017. }
  17018. isShow(cls) {
  17019. for (var i of this._uiList) {
  17020. if (i instanceof cls) {
  17021. return i.isShowing;
  17022. }
  17023. }
  17024. return false;
  17025. }
  17026. showUINum() {
  17027. let num = 0;
  17028. for (var i of this._uiList) {
  17029. if (i.isShowing) {
  17030. num++;
  17031. }
  17032. }
  17033. return num;
  17034. }
  17035. checkUIState() {
  17036. Laya.timer.clear(this, this._uiCheck);
  17037. Laya.timer.once(400, this, this._uiCheck);
  17038. }
  17039. _uiCheck() {
  17040. let showList = [];
  17041. for (var i of this._uiList) {
  17042. if (!i.isHide) {
  17043. showList.push(i);
  17044. }
  17045. }
  17046. for (let index = 0; index < showList.length; index++) {
  17047. if (index == showList.length - 1) {
  17048. showList[index].checkActive(true);
  17049. }
  17050. else {
  17051. showList[index].checkActive(false);
  17052. }
  17053. }
  17054. }
  17055. showTip(msg, time = 600, size = 30) {
  17056. }
  17057. }
  17058. class UIShowList {
  17059. }
  17060. class SoundMgr {
  17061. constructor() {
  17062. this.soundMax = 4;
  17063. this.isLoad = false;
  17064. this.soundMap = {};
  17065. this.isSound = true;
  17066. this.openShake = true;
  17067. SoundMgr._instance = this;
  17068. }
  17069. static getInstance() {
  17070. if (!this._instance) {
  17071. this._instance = new SoundMgr();
  17072. }
  17073. return this._instance;
  17074. }
  17075. init() {
  17076. console.log('zh:sm init 1');
  17077. Laya.SoundManager.autoReleaseSound = true;
  17078. Laya.SoundManager.autoStopMusic = true;
  17079. Laya.SoundManager.musicVolume = 0.3;
  17080. Laya.SoundManager.soundVolume = 0.5;
  17081. this.musicPlayed = false;
  17082. this.audioUrl = "asset/sound/ogg/";
  17083. console.log('zh:sm init 2');
  17084. console.log('zh:dev type ');
  17085. if (Laya.Browser.onAndroid) {
  17086. console.log('zh:dev type android');
  17087. this.audioUrl = "asset/sound/ogg/";
  17088. this.isLoad = true;
  17089. }
  17090. else {
  17091. console.log('zh:dev type not android');
  17092. this.audioUrl = "asset/sound/mp3/";
  17093. this.isLoad = true;
  17094. }
  17095. }
  17096. onSetting(isS) {
  17097. this.isSound = isS;
  17098. this.mute(!this.isSound);
  17099. }
  17100. clearCount() {
  17101. for (var key in this.soundMap) {
  17102. delete this.soundMap[key];
  17103. }
  17104. }
  17105. playMusic(path, loop = 0) {
  17106. console.log('zh:playMusic 1 PATH=' + path);
  17107. this.musicPath = path;
  17108. if (!this.isLoad) {
  17109. return;
  17110. }
  17111. if (!path || path == "") {
  17112. return;
  17113. }
  17114. if (!this.isSound) {
  17115. return;
  17116. }
  17117. this.musicPlayed = true;
  17118. let url = this.getUrl(path);
  17119. if (!Laya.Browser.onAndroid) {
  17120. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17121. this.play(url, loop);
  17122. }));
  17123. }
  17124. else {
  17125. this.play(url, loop);
  17126. }
  17127. }
  17128. play(url, loop) {
  17129. Laya.SoundManager.playMusic(url, loop);
  17130. }
  17131. getUrl(path) {
  17132. let url = this.audioUrl + path;
  17133. if (Laya.Browser.onAndroid) {
  17134. url += ".ogg";
  17135. }
  17136. else {
  17137. url += ".mp3";
  17138. }
  17139. return url;
  17140. }
  17141. pauseMusic(pause) {
  17142. if (pause) {
  17143. this.mute(true);
  17144. }
  17145. else if (this.isSound)
  17146. this.mute(false);
  17147. }
  17148. stopMusic() {
  17149. Laya.SoundManager.stopMusic();
  17150. if (Moyu.isNeedPlatAudio) {
  17151. Moyu.stopMusic();
  17152. }
  17153. }
  17154. mute(mute) {
  17155. if (Moyu.isNeedPlatAudio) {
  17156. Moyu.pauseMusic(mute);
  17157. }
  17158. else {
  17159. Laya.SoundManager.musicMuted = mute;
  17160. if (!mute && !this.musicPlayed && this.musicPath) {
  17161. this.playMusic(this.musicPath);
  17162. }
  17163. }
  17164. }
  17165. stopSound(path) {
  17166. let url = this.getUrl(path);
  17167. Laya.SoundManager.stopSound(url);
  17168. }
  17169. playSound(path, loop = 1, soundMax = this.soundMax) {
  17170. if (!this.isLoad)
  17171. return;
  17172. if (!this.isSound)
  17173. return;
  17174. if (!path || path == "")
  17175. return;
  17176. let url = this.getUrl(path);
  17177. if (Moyu.isNeedPlatAudio) {
  17178. Moyu.playSound(path, loop == 0);
  17179. }
  17180. else {
  17181. let count = 1;
  17182. if (this.soundMap[path])
  17183. count = this.soundMap[path] + 1;
  17184. if (count > soundMax)
  17185. return;
  17186. this.soundMap[path] = count;
  17187. Laya.SoundManager.playSound(url, loop);
  17188. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17189. }
  17190. }
  17191. removePath(path) {
  17192. if (this.soundMap[path]) {
  17193. let count = this.soundMap[path];
  17194. count--;
  17195. if (count < 1)
  17196. delete this.soundMap[path];
  17197. else
  17198. this.soundMap[path] = count;
  17199. }
  17200. }
  17201. playBtnSound() {
  17202. this.playSound("btn");
  17203. }
  17204. playGetSound() {
  17205. }
  17206. playCloseUISound() {
  17207. }
  17208. }
  17209. SoundMgr._instance = null;
  17210. var Handler$1 = Laya.Handler;
  17211. var EResType;
  17212. (function (EResType) {
  17213. EResType[EResType["none"] = 0] = "none";
  17214. EResType[EResType["nromal"] = 1] = "nromal";
  17215. EResType[EResType["td"] = 2] = "td";
  17216. EResType[EResType["sk"] = 3] = "sk";
  17217. })(EResType || (EResType = {}));
  17218. class CResLoader {
  17219. constructor(doneCall, proCall) {
  17220. this.completrCall = doneCall;
  17221. this.progressCall = proCall;
  17222. this.progressHander = new Handler$1(this, this.onProgress);
  17223. this.tdResMap = {};
  17224. }
  17225. load(resList) {
  17226. this.resCount = 0;
  17227. this.loadCount = 0;
  17228. for (let i = 0; i < resList.length; i++) {
  17229. let path = resList[i];
  17230. if (!path)
  17231. continue;
  17232. this.resCount++;
  17233. let type = this.getResType(path);
  17234. if (type == EResType.nromal)
  17235. this.loadNromal(path);
  17236. else if (type == EResType.td)
  17237. this.loadTd(path);
  17238. }
  17239. }
  17240. getRes(path) {
  17241. let type = this.getResType(path);
  17242. if (type == EResType.nromal)
  17243. return Laya.loader.getRes(path);
  17244. else if (type == EResType.td) {
  17245. let res = this.tdResMap[path];
  17246. if (res)
  17247. return res.clone();
  17248. return null;
  17249. }
  17250. }
  17251. destroy() {
  17252. this.progressHander.clear();
  17253. this.progressHander = null;
  17254. }
  17255. clearRes(path) {
  17256. let type = this.getResType(path);
  17257. if (type == EResType.nromal)
  17258. Laya.loader.clearRes(path);
  17259. else if (type == EResType.td) {
  17260. let obj = this.tdResMap[path];
  17261. if (obj)
  17262. obj.destroy();
  17263. delete this.tdResMap[path];
  17264. }
  17265. }
  17266. getResType(path) {
  17267. let exs = this.getExtension(path);
  17268. if (exs == "sk")
  17269. return EResType.sk;
  17270. if (exs == "ls" || exs == "lh" || exs == "lm")
  17271. return EResType.td;
  17272. else
  17273. return EResType.nromal;
  17274. }
  17275. getExtension(res) {
  17276. var index = res.lastIndexOf(".");
  17277. return res.substr(index + 1);
  17278. }
  17279. loadNromal(path) {
  17280. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17281. if (res) {
  17282. this.onLoad();
  17283. }
  17284. else
  17285. console.log("load res fail:" + path);
  17286. }), this.progressHander);
  17287. }
  17288. loadSk() {
  17289. }
  17290. loadTd(path) {
  17291. if (this.tdResMap[path]) {
  17292. this.onLoad();
  17293. return;
  17294. }
  17295. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17296. if (res) {
  17297. this.tdResMap[path] = res;
  17298. this.onLoad();
  17299. }
  17300. else
  17301. console.log("load res fail:" + path);
  17302. }));
  17303. }
  17304. onLoad() {
  17305. this.loadCount++;
  17306. this.onProgress(1);
  17307. if (this.loadCount >= this.resCount) {
  17308. this.completrCall.run();
  17309. }
  17310. }
  17311. onProgress(pro) {
  17312. let progress = (this.loadCount + pro) / this.resCount;
  17313. this.progressCall.runWith(progress);
  17314. }
  17315. }
  17316. var Handler$2 = Laya.Handler;
  17317. class ResInfo {
  17318. constructor() {
  17319. this.index = 0;
  17320. }
  17321. }
  17322. class ResMgr {
  17323. constructor() {
  17324. this.resList = [];
  17325. this.doneList = [];
  17326. this.resMap = {};
  17327. this.currentLoad = null;
  17328. this.completeHandler = new Handler$2(this, this.onComplete);
  17329. this.progressHandler = new Handler$2(this, this.onProgress);
  17330. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17331. }
  17332. static getInstance() {
  17333. if (ResMgr._instance == null) {
  17334. ResMgr._instance = new ResMgr();
  17335. }
  17336. return ResMgr._instance;
  17337. }
  17338. loadList(list, completeHandler, progressHandler) {
  17339. if (list.length < 1) {
  17340. completeHandler.run();
  17341. return;
  17342. }
  17343. let info = this.getResInfo();
  17344. info.resList = list;
  17345. info.completeHandler = completeHandler;
  17346. info.progressHandler = progressHandler;
  17347. this.resList.push(info);
  17348. this.startLoad();
  17349. }
  17350. loadFguiRes(list, completeHandler, progressHandler) {
  17351. Laya.loader.load(list, completeHandler, progressHandler);
  17352. }
  17353. loadAny(list, completeHandler, progressHandler) {
  17354. Laya.loader.load(list, completeHandler, progressHandler);
  17355. }
  17356. load(path, completeHandler, progressHandler) {
  17357. let count = this.resMap[path];
  17358. if (count && count > 0) {
  17359. if (completeHandler)
  17360. completeHandler.run();
  17361. }
  17362. else
  17363. this.loadList([path], completeHandler, progressHandler);
  17364. }
  17365. getRes(path) {
  17366. let res = this.resMap[path];
  17367. if (!res)
  17368. this.showLog("资源不存在:" + path);
  17369. else
  17370. return this.loader.getRes(path);
  17371. }
  17372. clearList(list, force = false) {
  17373. if (!list || list.length < 1)
  17374. return;
  17375. let cr = () => {
  17376. for (const k in list) {
  17377. let v = list[k];
  17378. if (!v)
  17379. continue;
  17380. if (force) {
  17381. this.loader.clearRes(v);
  17382. delete this.resMap[v];
  17383. }
  17384. else {
  17385. let count = this.resMap[v];
  17386. if (count && count > 1) {
  17387. count--;
  17388. this.resMap[v] = count;
  17389. }
  17390. else {
  17391. this.loader.clearRes(v);
  17392. delete this.resMap[v];
  17393. }
  17394. }
  17395. }
  17396. if (!window.hasOwnProperty("ks"))
  17397. Laya.Resource.destroyUnusedResources();
  17398. };
  17399. Laya.timer.clearAll(this);
  17400. Laya.timer.once(2000, this, cr);
  17401. }
  17402. clear3D() {
  17403. for (const k in this.loader.tdResMap) {
  17404. this.loader.clearRes(k);
  17405. if (this.resMap[k])
  17406. delete this.resMap[k];
  17407. }
  17408. if (!window.hasOwnProperty("ks"))
  17409. Laya.Resource.destroyUnusedResources();
  17410. }
  17411. clear(path, force = false) {
  17412. this.clearList([path], force);
  17413. }
  17414. getResInfo() {
  17415. if (this.doneList.length > 0)
  17416. return this.doneList.pop();
  17417. else
  17418. return new ResInfo();
  17419. }
  17420. startLoad() {
  17421. if (this.currentLoad)
  17422. return;
  17423. this.currentLoad = this.resList.pop();
  17424. if (this.currentLoad) {
  17425. this.loader.load(this.currentLoad.resList);
  17426. }
  17427. }
  17428. onComplete() {
  17429. if (!this.currentLoad)
  17430. return;
  17431. for (const k in this.currentLoad.resList) {
  17432. let v = this.currentLoad.resList[k];
  17433. let count = this.resMap[v];
  17434. if (count)
  17435. count++;
  17436. else
  17437. count = 1;
  17438. this.resMap[v] = count;
  17439. }
  17440. if (this.currentLoad.completeHandler)
  17441. this.currentLoad.completeHandler.run();
  17442. this.doneList.push(this.currentLoad);
  17443. this.currentLoad = null;
  17444. this.startLoad();
  17445. }
  17446. onProgress(pro) {
  17447. if (!this.currentLoad)
  17448. return;
  17449. if (this.currentLoad.progressHandler)
  17450. this.currentLoad.progressHandler.runWith(pro);
  17451. }
  17452. showLog(str, ...args) {
  17453. console.log("[ResLoader] " + str);
  17454. }
  17455. }
  17456. ResMgr._instance = null;
  17457. class EventMgr extends Laya.EventDispatcher {
  17458. }
  17459. let eventMgr = new EventMgr();
  17460. /*! *****************************************************************************
  17461. Copyright (c) Microsoft Corporation. All rights reserved.
  17462. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17463. this file except in compliance with the License. You may obtain a copy of the
  17464. License at http://www.apache.org/licenses/LICENSE-2.0
  17465. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17466. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17467. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17468. MERCHANTABLITY OR NON-INFRINGEMENT.
  17469. See the Apache Version 2.0 License for specific language governing permissions
  17470. and limitations under the License.
  17471. ***************************************************************************** */
  17472. /* global Reflect, Promise */
  17473. var extendStatics = function(d, b) {
  17474. extendStatics = Object.setPrototypeOf ||
  17475. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17476. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17477. return extendStatics(d, b);
  17478. };
  17479. function __extends(d, b) {
  17480. extendStatics(d, b);
  17481. function __() { this.constructor = d; }
  17482. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17483. }
  17484. var __assign = function() {
  17485. __assign = Object.assign || function __assign(t) {
  17486. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17487. s = arguments[i];
  17488. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17489. }
  17490. return t;
  17491. };
  17492. return __assign.apply(this, arguments);
  17493. };
  17494. function __rest(s, e) {
  17495. var t = {};
  17496. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17497. t[p] = s[p];
  17498. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17499. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17500. t[p[i]] = s[p[i]];
  17501. return t;
  17502. }
  17503. function __decorate(decorators, target, key, desc) {
  17504. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17505. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17506. 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;
  17507. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17508. }
  17509. function __param(paramIndex, decorator) {
  17510. return function (target, key) { decorator(target, key, paramIndex); }
  17511. }
  17512. function __metadata(metadataKey, metadataValue) {
  17513. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17514. }
  17515. function __awaiter(thisArg, _arguments, P, generator) {
  17516. return new (P || (P = Promise))(function (resolve, reject) {
  17517. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17518. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17519. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17520. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17521. });
  17522. }
  17523. function __generator(thisArg, body) {
  17524. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17525. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17526. function verb(n) { return function (v) { return step([n, v]); }; }
  17527. function step(op) {
  17528. if (f) throw new TypeError("Generator is already executing.");
  17529. while (_) try {
  17530. 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;
  17531. if (y = 0, t) op = [op[0] & 2, t.value];
  17532. switch (op[0]) {
  17533. case 0: case 1: t = op; break;
  17534. case 4: _.label++; return { value: op[1], done: false };
  17535. case 5: _.label++; y = op[1]; op = [0]; continue;
  17536. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17537. default:
  17538. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17539. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17540. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17541. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17542. if (t[2]) _.ops.pop();
  17543. _.trys.pop(); continue;
  17544. }
  17545. op = body.call(thisArg, _);
  17546. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17547. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17548. }
  17549. }
  17550. function __exportStar(m, exports) {
  17551. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17552. }
  17553. function __values(o) {
  17554. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17555. if (m) return m.call(o);
  17556. return {
  17557. next: function () {
  17558. if (o && i >= o.length) o = void 0;
  17559. return { value: o && o[i++], done: !o };
  17560. }
  17561. };
  17562. }
  17563. function __read(o, n) {
  17564. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17565. if (!m) return o;
  17566. var i = m.call(o), r, ar = [], e;
  17567. try {
  17568. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17569. }
  17570. catch (error) { e = { error: error }; }
  17571. finally {
  17572. try {
  17573. if (r && !r.done && (m = i["return"])) m.call(i);
  17574. }
  17575. finally { if (e) throw e.error; }
  17576. }
  17577. return ar;
  17578. }
  17579. function __spread() {
  17580. for (var ar = [], i = 0; i < arguments.length; i++)
  17581. ar = ar.concat(__read(arguments[i]));
  17582. return ar;
  17583. }
  17584. function __await(v) {
  17585. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17586. }
  17587. function __asyncGenerator(thisArg, _arguments, generator) {
  17588. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17589. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17590. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17591. 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); }); }; }
  17592. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17593. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17594. function fulfill(value) { resume("next", value); }
  17595. function reject(value) { resume("throw", value); }
  17596. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17597. }
  17598. function __asyncDelegator(o) {
  17599. var i, p;
  17600. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17601. 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; }
  17602. }
  17603. function __asyncValues(o) {
  17604. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17605. var m = o[Symbol.asyncIterator], i;
  17606. 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);
  17607. 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); }); }; }
  17608. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17609. }
  17610. function __makeTemplateObject(cooked, raw) {
  17611. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17612. return cooked;
  17613. };
  17614. function __importStar(mod) {
  17615. if (mod && mod.__esModule) return mod;
  17616. var result = {};
  17617. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17618. result.default = mod;
  17619. return result;
  17620. }
  17621. function __importDefault(mod) {
  17622. return (mod && mod.__esModule) ? mod : { default: mod };
  17623. }
  17624. class CustomAlert {
  17625. static show(title, content, buttons) {
  17626. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17627. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17628. return;
  17629. }
  17630. const bg = new Laya.Box();
  17631. bg.alpha = 0;
  17632. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17633. Laya.stage.addChild(bg);
  17634. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17635. const panel = new Laya.Box();
  17636. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17637. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17638. bg.addChild(panel);
  17639. const titleText = new Laya.Text();
  17640. titleText.text = title;
  17641. titleText.fontSize = 32;
  17642. titleText.color = "#333333";
  17643. titleText.bold = true;
  17644. titleText.pos(20, 20);
  17645. titleText.width = 360;
  17646. titleText.align = "center";
  17647. panel.addChild(titleText);
  17648. const contentText = new Laya.Text();
  17649. contentText.text = content;
  17650. contentText.fontSize = 21;
  17651. contentText.color = "#555555";
  17652. contentText.pos(20, 70);
  17653. contentText.width = 360;
  17654. contentText.wordWrap = true;
  17655. contentText.align = "center";
  17656. panel.addChild(contentText);
  17657. const buttonContainer = new Laya.Box();
  17658. buttonContainer.pos(20, 160);
  17659. panel.addChild(buttonContainer);
  17660. const btnWidth = 120;
  17661. const spacing = 30;
  17662. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17663. buttons.forEach((btn, index) => {
  17664. const button = new Laya.Button();
  17665. button.label = btn.label;
  17666. button.size(btnWidth, 40);
  17667. button.labelSize = 22;
  17668. button.pos(index * (btnWidth + spacing), 0);
  17669. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17670. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17671. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17672. button.alpha = 0.9;
  17673. });
  17674. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17675. button.alpha = 1;
  17676. });
  17677. button.on(Laya.Event.CLICK, this, () => {
  17678. btn.handler();
  17679. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17680. bg.removeSelf();
  17681. }));
  17682. });
  17683. buttonContainer.addChild(button);
  17684. });
  17685. buttonContainer.x = (panel.width - totalWidth) / 2;
  17686. }
  17687. }
  17688. class ConfigMgr {
  17689. constructor() {
  17690. this.httpReqCount = 4;
  17691. this.httpReqOkCount = 0;
  17692. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17693. try {
  17694. this.httpReqOkCount = 0;
  17695. let reqData = xGame.httpMgr.getReqData();
  17696. console.log('zh:第1个请求getClassicCfg');
  17697. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17698. this.classicCfg = classicCfg;
  17699. this.httpReqOkCount++;
  17700. console.log('zh:第2个请求getLevelCfg');
  17701. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17702. this.levelCfg = levelCfg;
  17703. this.httpReqOkCount++;
  17704. console.log('zh:第3个请求 getPlaceBallCfg');
  17705. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17706. this.placeBallCfg = placeBallCfg;
  17707. this.httpReqOkCount++;
  17708. console.log('zh:第4个请求 npc');
  17709. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  17710. this.npcJson = npc.Data;
  17711. this.httpReqOkCount++;
  17712. console.log('zh:所有配置加载完成');
  17713. }
  17714. catch (error) {
  17715. console.error('zh:❌请求失败:', error);
  17716. Laya.timer.once(5000, this, () => {
  17717. let retryCount = 0;
  17718. const maxRetries = 3;
  17719. const tryFetchConfig = () => {
  17720. try {
  17721. xGame.cfgMgr.getConfigFromServer();
  17722. }
  17723. catch (error) {
  17724. if (retryCount < maxRetries) {
  17725. retryCount++;
  17726. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  17727. Laya.timer.once(5000, this, tryFetchConfig);
  17728. }
  17729. else {
  17730. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  17731. }
  17732. }
  17733. };
  17734. tryFetchConfig();
  17735. });
  17736. }
  17737. finally {
  17738. if (this.httpReqCount > this.httpReqOkCount) {
  17739. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  17740. label: "Okay", handler: () => {
  17741. JSBridgeUtils.instance.exitAndCloseGame();
  17742. }
  17743. }]);
  17744. }
  17745. }
  17746. });
  17747. this.sendPostAsync = (action, reqData) => {
  17748. return new Promise((resolve, reject) => {
  17749. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  17750. try {
  17751. let code = res.code;
  17752. if (code == 200) {
  17753. const parsedData = JSON.parse(res.msg);
  17754. resolve(parsedData);
  17755. }
  17756. else {
  17757. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  17758. reject(new Error(`Request failed with code: ${code}`));
  17759. }
  17760. }
  17761. catch (error) {
  17762. console.error(`ERROR=${error}`);
  17763. alert("Please check your network connection.");
  17764. reject(error);
  17765. }
  17766. finally {
  17767. console.log(`zh:${action}的请求处理完毕`);
  17768. }
  17769. });
  17770. });
  17771. };
  17772. }
  17773. static getInstance() {
  17774. if (!this._instance) {
  17775. this._instance = new ConfigMgr();
  17776. }
  17777. return this._instance;
  17778. }
  17779. init() {
  17780. this.getConfigFromServer();
  17781. }
  17782. test() {
  17783. let reqData = xGame.httpMgr.getReqData();
  17784. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  17785. console.log('zh:1s');
  17786. try {
  17787. let code = res.code;
  17788. let data = res.data;
  17789. if (code == 200) {
  17790. const parsedData = JSON.parse(data);
  17791. this.classicCfg = parsedData;
  17792. }
  17793. else {
  17794. console.log('zh:res = ' + JSON.stringify(res));
  17795. }
  17796. }
  17797. catch (error) {
  17798. console.log('error=' + error);
  17799. alert("Please check your network connection.");
  17800. }
  17801. finally {
  17802. console.log('zh:1');
  17803. }
  17804. });
  17805. }
  17806. getUserInfoByIndex(index) {
  17807. return this.npcJson[index];
  17808. }
  17809. getRandomUserInfo() {
  17810. let index = xGame.tools.random(0, this.npcJson.length);
  17811. let rs = this.npcJson[index];
  17812. return rs;
  17813. }
  17814. getMaxBigMoveLength() {
  17815. return Object.keys(this.levelCfg).length;
  17816. }
  17817. getBigMoveLevelByIndex(index) {
  17818. let cfg = this.levelCfg;
  17819. cfg = cfg[index];
  17820. return cfg;
  17821. }
  17822. getRandomClassicLevel() {
  17823. let cfg = this.classicCfg;
  17824. let num = Object.keys(cfg).length;
  17825. let rand = xGame.common.randomNum(1, num);
  17826. return cfg[rand];
  17827. }
  17828. getPlaceBallByLevel(level) {
  17829. return this.placeBallCfg[level];
  17830. }
  17831. getMaxPlaceBall() {
  17832. return Object.keys(this.placeBallCfg).length;
  17833. }
  17834. }
  17835. class PoolD3Mgr {
  17836. constructor() {
  17837. this.pool = {};
  17838. }
  17839. static get ins() {
  17840. return this._ins || (this._ins = new PoolD3Mgr);
  17841. }
  17842. createList(key, prefab, parent) {
  17843. if (!this.pool[key]) {
  17844. this.pool[key] = {};
  17845. this.pool[key].prefab = prefab;
  17846. this.pool[key].list = [];
  17847. this.pool[key].parent = parent;
  17848. }
  17849. }
  17850. getItem(key) {
  17851. if (!this.pool[key]) {
  17852. return;
  17853. }
  17854. let temp;
  17855. if (this.pool[key].list.length > 0) {
  17856. temp = this.pool[key].list.pop();
  17857. }
  17858. else {
  17859. temp = this.pool[key].prefab.clone();
  17860. if (this.pool[key].parent) {
  17861. this.pool[key].parent.addChild(temp);
  17862. }
  17863. }
  17864. temp.active = true;
  17865. return temp;
  17866. }
  17867. putItem(key, obj) {
  17868. if (!this.pool[key]) {
  17869. return;
  17870. }
  17871. obj.active = false;
  17872. this.pool[key].list.push(obj);
  17873. }
  17874. }
  17875. let context$1 = context;
  17876. let uiMgr = UIMgr.inst;
  17877. let soundMgr = SoundMgr.getInstance();
  17878. let resMgr = ResMgr.getInstance();
  17879. let httpMgr = HttpMgr.getInstance();
  17880. let common = Common.getInstance();
  17881. let cfgMgr = ConfigMgr.getInstance();
  17882. let poolD3Mgr = PoolD3Mgr.ins;
  17883. let d3TexUrl = "res/d3Res/";
  17884. let d3ModeUrl = "res/unityRes/";
  17885. function setStageSize(view) {
  17886. if (view.width) {
  17887. view.width = Laya.stage.width;
  17888. view.height = Laya.stage.height;
  17889. }
  17890. }
  17891. function filledBg(view) {
  17892. let wh = Laya.stage.height / Laya.stage.width;
  17893. if (wh > 16 / 9) {
  17894. view.height = Laya.stage.height;
  17895. view.width = Laya.stage.height / 1334 * 750;
  17896. }
  17897. else {
  17898. view.width = Laya.stage.width;
  17899. view.height = Laya.stage.width / 750 * 1334;
  17900. }
  17901. }
  17902. function setNotch(view) {
  17903. if (view.height) {
  17904. view.y += context$1.notchHeight;
  17905. }
  17906. }
  17907. function showTip(str) {
  17908. uiMgr.Show(UIMsg, str);
  17909. }
  17910. function log(...args) {
  17911. console.log(args);
  17912. }
  17913. let xGame = {
  17914. context: context$1,
  17915. eventMgr,
  17916. resMgr,
  17917. uiMgr,
  17918. soundMgr,
  17919. define,
  17920. tools,
  17921. httpMgr,
  17922. d3TexUrl,
  17923. d3ModeUrl,
  17924. common,
  17925. cfgMgr,
  17926. poolD3Mgr,
  17927. setStageSize,
  17928. filledBg,
  17929. setNotch,
  17930. showTip,
  17931. log,
  17932. };
  17933. window["xGame"] = xGame;
  17934. let dataName = 'tBall_';
  17935. class UserData {
  17936. constructor() {
  17937. this.userId = "";
  17938. this.isAgree = false;
  17939. this.coinNum = 0;
  17940. this.gemNum = 0;
  17941. this.sound = true;
  17942. this.vibration = true;
  17943. this.currentDate = 0;
  17944. this.createTime = 0;
  17945. this.awardTime = 0;
  17946. this.roleId = 1;
  17947. this.roleList = [];
  17948. this.roleAds = [];
  17949. this.dressId = 101;
  17950. this.itemId = 201;
  17951. this.bigSkills = [1, 1, 1, 1, 1];
  17952. this.coin = 4000;
  17953. this.diamond = 0;
  17954. this.skillSuccessTimes = 0;
  17955. this.skillGuide = 0;
  17956. this.skillAccTimes = 0;
  17957. this.placeBallData = [];
  17958. this.shareDiamondTimes = 0;
  17959. this.dailyVideoShareTimes = 0;
  17960. this.secretary = [1, 0];
  17961. this.curSecretary = 0;
  17962. this.ballRod = [1, 0, 0, 0, 0, 1];
  17963. this.curBallRod = 5;
  17964. this.signData = 0;
  17965. this.signTime = 0;
  17966. this.drawTimes = 0;
  17967. this.drawAwardTimes = 0;
  17968. this.dailyfreeDrawTimes = 1;
  17969. this.power = 5;
  17970. this.powerTime = 0;
  17971. this.challengeTimes = 0;
  17972. this.extraSign = 0;
  17973. this.classicTimes = 0;
  17974. this.guideHelpLine = 0;
  17975. this.newUser = true;
  17976. this.rootBallFoul = 0;
  17977. this.timeoutFoul = 0;
  17978. this.roleList = [1];
  17979. }
  17980. saveData() {
  17981. let data = {};
  17982. for (let k in this) {
  17983. data[k.toString()] = this[k];
  17984. }
  17985. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  17986. }
  17987. getData() {
  17988. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  17989. if (ld) {
  17990. let localData = JSON.parse(ld);
  17991. if (localData) {
  17992. for (let k in this) {
  17993. let key = k.toString();
  17994. let data = localData[key];
  17995. if (data != undefined) {
  17996. this[k] = data;
  17997. }
  17998. }
  17999. }
  18000. }
  18001. }
  18002. }
  18003. class ItemData {
  18004. constructor() {
  18005. this.itemList = {};
  18006. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18007. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18008. }
  18009. saveData() {
  18010. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18011. }
  18012. getData() {
  18013. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18014. if (ld) {
  18015. let localData = JSON.parse(ld);
  18016. if (localData) {
  18017. this.itemList = localData;
  18018. }
  18019. }
  18020. }
  18021. }
  18022. class GameData {
  18023. constructor() {
  18024. this.curLevel = 0;
  18025. this.gameType = 1;
  18026. this.signIdx = 0;
  18027. this.signMax = 0;
  18028. this.rotaryTime = 0;
  18029. this.rotaryCount = 0;
  18030. this.rotaryList = [];
  18031. this.diyCount = 3;
  18032. this.awardIdx = 0;
  18033. this.shareNum = 2;
  18034. this.rankWeek = 0;
  18035. this.rankScore = 0;
  18036. this.gameCount = 0;
  18037. this.trySkill = -1;
  18038. this.tryTime = 0;
  18039. }
  18040. saveData() {
  18041. let data = {};
  18042. for (let k in this) {
  18043. data[k.toString()] = this[k];
  18044. }
  18045. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18046. }
  18047. getData() {
  18048. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18049. if (ld) {
  18050. let localData = JSON.parse(ld);
  18051. if (localData) {
  18052. for (let k in this) {
  18053. let key = k.toString();
  18054. let data = localData[key];
  18055. if (data != undefined) {
  18056. this[k] = data;
  18057. }
  18058. }
  18059. }
  18060. }
  18061. }
  18062. }
  18063. class Diy2025GameData {
  18064. constructor() {
  18065. this.challengeMode_overLev = 0;
  18066. this.xszyForClassic = false;
  18067. this.xszyForChallenge = false;
  18068. }
  18069. saveData() {
  18070. let data = {};
  18071. for (let k in this) {
  18072. data[k.toString()] = this[k];
  18073. }
  18074. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18075. }
  18076. getData() {
  18077. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18078. if (ld) {
  18079. let localData = JSON.parse(ld);
  18080. if (localData) {
  18081. for (let k in this) {
  18082. let key = k.toString();
  18083. let data = localData[key];
  18084. if (data != undefined) {
  18085. this[k] = data;
  18086. }
  18087. }
  18088. }
  18089. }
  18090. }
  18091. }
  18092. class UIFuli1 extends UIBase {
  18093. constructor() {
  18094. super();
  18095. this.jiage = 4.99;
  18096. }
  18097. onConstructor() {
  18098. this.ui = ui_UIFuli1.createInstance();
  18099. this.contentPane = this.ui;
  18100. this.isEject = false;
  18101. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18102. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18103. }
  18104. show() {
  18105. super.show();
  18106. this.x = (Laya.stage.width - this.width) / 2;
  18107. this.y = (Laya.stage.height - this.height) / 2;
  18108. this.ui.n2.txt_price.text = "$" + this.jiage;
  18109. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  18110. this.setGlobalFont(this.ui);
  18111. }
  18112. closeSelf() {
  18113. DataMgr.loadUserSpOrderForAd();
  18114. this.hide();
  18115. }
  18116. gotoBuy() {
  18117. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18118. if (userInfo != null) {
  18119. let token = userInfo.token;
  18120. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  18121. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  18122. DataMgr.loadUserSpOrderForAd();
  18123. return;
  18124. }
  18125. else {
  18126. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18127. }
  18128. }
  18129. gotoBuy2() {
  18130. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18131. if (userInfo == null) {
  18132. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18133. return;
  18134. }
  18135. let reqData = xGame.httpMgr.getReqData();
  18136. let pd = JSON.parse(reqData);
  18137. pd.productId = 1;
  18138. reqData = JSON.stringify(pd);
  18139. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18140. try {
  18141. console.log('zh:buySp res = ' + JSON.stringify(res));
  18142. let code = res.code;
  18143. let msg = res.msg;
  18144. if (code == 401) {
  18145. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18146. alert(TIP_MSG_key.loginTimeOut);
  18147. xGame.uiMgr.Show(UIMsg, msg);
  18148. return;
  18149. }
  18150. if (code == 200) {
  18151. xGame.uiMgr.Show(UIMsg, msg);
  18152. DataMgr.loadUserSpOrderForAd();
  18153. DataMgr.getUserZiChanInfo(false);
  18154. this.closeSelf();
  18155. }
  18156. else {
  18157. xGame.uiMgr.Show(UIMsg, msg);
  18158. }
  18159. }
  18160. catch (error) {
  18161. console.log('error=' + error);
  18162. alert(error);
  18163. }
  18164. finally {
  18165. }
  18166. });
  18167. }
  18168. }
  18169. UIFuli1.uiName = "UIFuli1";
  18170. class UIFuli2 extends UIBase {
  18171. constructor() {
  18172. super();
  18173. this.jiage = 14.99;
  18174. }
  18175. onConstructor() {
  18176. this.ui = ui_UIFuli2.createInstance();
  18177. this.contentPane = this.ui;
  18178. this.isEject = false;
  18179. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18180. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18181. }
  18182. show() {
  18183. super.show();
  18184. this.x = (Laya.stage.width - this.width) / 2;
  18185. this.y = (Laya.stage.height - this.height) / 2;
  18186. this.ui.n2.txt_price.text = "$" + this.jiage;
  18187. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  18188. this.setGlobalFont(this.ui);
  18189. }
  18190. closeSelf() {
  18191. DataMgr.loadUserSpOrderForAd();
  18192. this.hide();
  18193. }
  18194. gotoBuy() {
  18195. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18196. if (userInfo != null) {
  18197. let token = userInfo.token;
  18198. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  18199. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  18200. DataMgr.loadUserSpOrderForAd();
  18201. return;
  18202. }
  18203. else {
  18204. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18205. }
  18206. }
  18207. gotoBuy1() {
  18208. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18209. if (userInfo == null) {
  18210. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18211. return;
  18212. }
  18213. let reqData = xGame.httpMgr.getReqData();
  18214. let pd = JSON.parse(reqData);
  18215. pd.productId = 2;
  18216. reqData = JSON.stringify(pd);
  18217. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18218. try {
  18219. console.log('zh:buySp res = ' + JSON.stringify(res));
  18220. let code = res.code;
  18221. let msg = res.msg;
  18222. if (code == 401) {
  18223. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18224. alert(TIP_MSG_key.loginTimeOut);
  18225. xGame.uiMgr.Show(UIMsg, msg);
  18226. return;
  18227. }
  18228. if (code == 200) {
  18229. xGame.uiMgr.Show(UIMsg, msg);
  18230. DataMgr.loadUserSpOrderForAd();
  18231. DataMgr.getUserZiChanInfo(false);
  18232. this.closeSelf();
  18233. }
  18234. else {
  18235. xGame.uiMgr.Show(UIMsg, msg);
  18236. }
  18237. }
  18238. catch (error) {
  18239. console.log('error=' + error);
  18240. alert(error);
  18241. }
  18242. finally {
  18243. }
  18244. });
  18245. }
  18246. }
  18247. UIFuli2.uiName = "UIFuli2";
  18248. class DataMgr {
  18249. static Init() {
  18250. this.userData = new UserData();
  18251. this.gameData = new GameData();
  18252. this.itemData = new ItemData();
  18253. this.diyGameData = new Diy2025GameData();
  18254. this.userData.getData();
  18255. this.gameData.getData();
  18256. this.itemData.getData();
  18257. this.diyGameData.getData();
  18258. this.roleId = this.userData.roleId;
  18259. this.resetUse();
  18260. }
  18261. static isNewDay() {
  18262. Moyu.isNewDay(this, (isnew) => {
  18263. xGame.common.isNewDay = isnew;
  18264. if (!isnew)
  18265. return;
  18266. DataMgr.setShareDiamondTimes(0, false);
  18267. DataMgr.setDailyVideoShareTimes(0, false);
  18268. DataMgr.setDailyfreeDrawTimes(1);
  18269. DataMgr.setExtraSign(0);
  18270. });
  18271. }
  18272. static deletData() {
  18273. Laya.LocalStorage.clear();
  18274. }
  18275. static upRankData() {
  18276. let num = xGame.common.getAllStarNum();
  18277. if (num > 0)
  18278. Moyu.upRankData(xGame.common.curRankID, num);
  18279. }
  18280. static addItem(id, count = 1) {
  18281. let v = this.itemData.itemList[id];
  18282. if (!v)
  18283. v = { id: id, count: count, adnum: 0, active: true };
  18284. else {
  18285. if (v.active) {
  18286. v.count += count;
  18287. }
  18288. else {
  18289. v.count = count;
  18290. v.active = true;
  18291. }
  18292. }
  18293. this.itemData.itemList[id] = v;
  18294. xGame.soundMgr.playGetSound();
  18295. this.saveItemData();
  18296. }
  18297. static hasItem(id) {
  18298. let v = this.itemData.itemList[id];
  18299. if (v && v.active)
  18300. return true;
  18301. return false;
  18302. }
  18303. static getItem(id) {
  18304. let v = this.itemData.itemList[id];
  18305. return v;
  18306. }
  18307. static getItemCount(id) {
  18308. let v = this.itemData.itemList[id];
  18309. if (v && v.active)
  18310. return v.count;
  18311. return 0;
  18312. }
  18313. static getItemAd(id) {
  18314. let v = this.itemData.itemList[id];
  18315. if (v) {
  18316. return v.adnum;
  18317. }
  18318. return 0;
  18319. }
  18320. static onItemAd(id, num = 1) {
  18321. let v = this.itemData.itemList[id];
  18322. if (!v)
  18323. v = { id: id, count: 1, adnum: num, active: false };
  18324. else
  18325. v.adnum += num;
  18326. this.itemData.itemList[id] = v;
  18327. this.saveItemData();
  18328. }
  18329. static costItem(id, count) {
  18330. let v = this.itemData.itemList[id];
  18331. if (v && v.active) {
  18332. if (v.count < count)
  18333. return false;
  18334. else {
  18335. v.count -= count;
  18336. this.itemData.itemList[id] = v;
  18337. return true;
  18338. }
  18339. }
  18340. return false;
  18341. }
  18342. static resetUse() {
  18343. this.dressId = this.userData.dressId;
  18344. this.itemId = this.userData.itemId;
  18345. }
  18346. static passLevel() {
  18347. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18348. this.gameData.curLevel++;
  18349. this.curLevel = this.gameData.curLevel;
  18350. this.saveGameData();
  18351. }
  18352. static useRole(id) {
  18353. this.roleId = id;
  18354. if (this.hasRole(id)) {
  18355. this.userData.roleId = id;
  18356. this.saveUserData();
  18357. }
  18358. }
  18359. static addRole(id) {
  18360. if (this.hasRole(id))
  18361. return;
  18362. this.userData.roleList.push(id);
  18363. this.saveUserData();
  18364. }
  18365. static hasRole(id) {
  18366. return this.userData.roleList.indexOf(id) >= 0;
  18367. }
  18368. static gemEnough(num) {
  18369. return this.userData.gemNum >= num;
  18370. }
  18371. static roleHasAd(id) {
  18372. let count = this.userData.roleAds[id];
  18373. if (count != undefined && count >= 0)
  18374. return true;
  18375. else
  18376. return false;
  18377. }
  18378. static saveUserData(time = 500, event, arg) {
  18379. if (this.userSaving)
  18380. return;
  18381. this.userSaving = true;
  18382. Laya.timer.once(time, this, () => {
  18383. this.userSaving = false;
  18384. this.userData.saveData();
  18385. if (event)
  18386. xGame.eventMgr.event(event, arg);
  18387. });
  18388. }
  18389. static updateUserNickName(loginUserName) {
  18390. let kyeStr = 'moyudata_180';
  18391. console.log('zh:################### kyeStr=' + kyeStr);
  18392. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18393. if (moyudata) {
  18394. const obj = JSON.parse(moyudata);
  18395. obj.nickName = loginUserName;
  18396. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18397. console.log('zh:################### updateUserNickName');
  18398. }
  18399. }
  18400. static saveGameData() {
  18401. if (this.gameSaving)
  18402. return;
  18403. this.gameSaving = true;
  18404. Laya.timer.once(1000, this, () => {
  18405. this.gameSaving = false;
  18406. this.gameData.saveData();
  18407. });
  18408. }
  18409. static saveItemData() {
  18410. let fun = () => {
  18411. this.itemData.saveData();
  18412. };
  18413. Laya.timer.clear(this, fun);
  18414. Laya.timer.once(500, this, fun);
  18415. }
  18416. static saveData() {
  18417. this.saveUserData();
  18418. this.saveGameData();
  18419. }
  18420. static getBigSkillList() {
  18421. return this.userData.bigSkills;
  18422. }
  18423. static getBigSkillByIndex(index) {
  18424. return this.userData.bigSkills[index];
  18425. }
  18426. static setBigSkill(index, val, addUp = true) {
  18427. if (addUp) {
  18428. this.userData.bigSkills[index] += val;
  18429. }
  18430. else {
  18431. this.userData.bigSkills[index] = val;
  18432. }
  18433. this.saveUserData();
  18434. console.log("zh:大技能更新");
  18435. this.updateUserInfo2Server("bigSkills");
  18436. }
  18437. static setBigSkillFormServer(jsonStr) {
  18438. console.log("zh:大技能 setBigSkillFormServer =" + jsonStr);
  18439. this.userData.bigSkills = JSON.parse(jsonStr);
  18440. this.saveUserData();
  18441. }
  18442. static coinEnough(need) {
  18443. if (typeof need != "number") {
  18444. console.error("金币格式错误");
  18445. return;
  18446. }
  18447. return this.userData.coin >= need;
  18448. }
  18449. static setCoin(val) {
  18450. if (typeof val != "number") {
  18451. return;
  18452. }
  18453. this.userData.coin += val;
  18454. this.saveUserData();
  18455. xGame.eventMgr.event(COIN_CHANGE);
  18456. this.updateUserInfo2Server("jb");
  18457. }
  18458. static setCoin2(val) {
  18459. if (typeof val != "number") {
  18460. return;
  18461. }
  18462. this.userData.coin = val;
  18463. this.saveUserData();
  18464. xGame.eventMgr.event(COIN_CHANGE);
  18465. }
  18466. static setCoinFormServer(val) {
  18467. if (typeof val != "number") {
  18468. return;
  18469. }
  18470. this.userData.coin = val;
  18471. this.saveUserData();
  18472. console.log('zh:通知更新金币变化' + val);
  18473. xGame.eventMgr.event(COIN_CHANGE);
  18474. }
  18475. static getCoin() {
  18476. return this.userData.coin;
  18477. }
  18478. static diamondEnough(need) {
  18479. if (typeof need != "number") {
  18480. console.error("金币格式错误");
  18481. return;
  18482. }
  18483. return this.userData.diamond >= need;
  18484. }
  18485. static setDiamond(val) {
  18486. if (typeof val != "number") {
  18487. return;
  18488. }
  18489. this.userData.diamond += val;
  18490. this.saveUserData();
  18491. xGame.eventMgr.event(DIAMOND_CHANGE);
  18492. this.updateUserInfo2Server("zs");
  18493. }
  18494. static setDiamond2(val) {
  18495. if (typeof val != "number") {
  18496. return;
  18497. }
  18498. this.userData.diamond = val;
  18499. this.saveUserData();
  18500. xGame.eventMgr.event(DIAMOND_CHANGE);
  18501. }
  18502. static setDiamondFormServer(val) {
  18503. if (typeof val != "number") {
  18504. return;
  18505. }
  18506. this.userData.diamond = val;
  18507. this.saveUserData();
  18508. console.log('zh:通知更新钻石变化' + val);
  18509. xGame.eventMgr.event(DIAMOND_CHANGE);
  18510. }
  18511. static getDiamond() {
  18512. return this.userData.diamond;
  18513. }
  18514. static getSkillSuccessTimes() {
  18515. return this.userData.skillSuccessTimes;
  18516. }
  18517. static setSkillSuccessTimes(val, addUp = true) {
  18518. if (addUp)
  18519. this.userData.skillSuccessTimes += val;
  18520. else
  18521. this.userData.skillSuccessTimes = val;
  18522. this.saveUserData();
  18523. }
  18524. static getSkillAccTimes() {
  18525. return this.userData.skillAccTimes;
  18526. }
  18527. static setSkillAccTimes(val) {
  18528. this.userData.skillAccTimes += val;
  18529. this.saveUserData();
  18530. }
  18531. static getSkillGuide() {
  18532. if (!xGame.common.openGuide) {
  18533. return 1;
  18534. }
  18535. return this.userData.skillGuide;
  18536. }
  18537. static setSkillGuide(val) {
  18538. this.userData.skillGuide = val;
  18539. this.saveUserData();
  18540. }
  18541. static getPlaceBallLevelList() {
  18542. return this.userData.placeBallData;
  18543. }
  18544. static setPlaceBallLevelList(objStr) {
  18545. if (objStr) {
  18546. let obj = JSON.parse(objStr);
  18547. this.userData.placeBallData = obj;
  18548. let cd = obj.length;
  18549. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18550. xGame.common.placeBallCurLevel = cd;
  18551. DataMgr.setChallengeMode_overLev(cd);
  18552. this.saveUserData();
  18553. }
  18554. else {
  18555. this.userData.placeBallData = [];
  18556. this.saveUserData();
  18557. }
  18558. }
  18559. static getPlaceBallLevel(level) {
  18560. let arr = this.userData.placeBallData;
  18561. let index = level - 1;
  18562. let out;
  18563. if (arr[index]) {
  18564. out = arr[index];
  18565. }
  18566. else {
  18567. let max = arr.length;
  18568. if (max == index) {
  18569. out = {
  18570. star: 0,
  18571. play: true,
  18572. isCur: true,
  18573. getAward: false
  18574. };
  18575. }
  18576. else {
  18577. out = {
  18578. star: 0,
  18579. play: false,
  18580. getAward: false
  18581. };
  18582. }
  18583. }
  18584. return out;
  18585. }
  18586. static setPlaceBallLevel(level, star) {
  18587. let arr = this.userData.placeBallData;
  18588. let index = level - 1;
  18589. if (arr[index]) {
  18590. arr[index].star = Math.max(arr[index].star, star);
  18591. }
  18592. else {
  18593. let max = arr.length;
  18594. if (max == index) {
  18595. arr.push({
  18596. star: star,
  18597. play: true,
  18598. getAward: false
  18599. });
  18600. }
  18601. else {
  18602. console.error("关卡存储出错");
  18603. }
  18604. }
  18605. this.saveUserData();
  18606. }
  18607. static setPlaceBallAward(level) {
  18608. let arr = this.userData.placeBallData;
  18609. let index = level - 1;
  18610. if (arr[index]) {
  18611. arr[index].getAward = true;
  18612. }
  18613. this.saveUserData();
  18614. }
  18615. static getShareDiamondTimes() {
  18616. return this.userData.shareDiamondTimes;
  18617. }
  18618. static setShareDiamondTimes(val, addUp = true) {
  18619. if (addUp) {
  18620. this.userData.shareDiamondTimes += val;
  18621. }
  18622. else {
  18623. this.userData.shareDiamondTimes = val;
  18624. }
  18625. this.saveUserData();
  18626. }
  18627. static getDailyVideoShareTimes() {
  18628. return this.userData.dailyVideoShareTimes;
  18629. }
  18630. static setDailyVideoShareTimes(val, addUp = true) {
  18631. if (addUp) {
  18632. this.userData.dailyVideoShareTimes += val;
  18633. }
  18634. else {
  18635. this.userData.dailyVideoShareTimes = val;
  18636. }
  18637. this.saveUserData();
  18638. }
  18639. static getSecretary(index) {
  18640. return this.userData.secretary[index];
  18641. }
  18642. static setSecretary(index, val) {
  18643. this.userData.secretary[index] = val;
  18644. this.saveUserData();
  18645. }
  18646. static getCurSecretary() {
  18647. return this.userData.curSecretary;
  18648. }
  18649. static setCurSecretary(index) {
  18650. this.userData.curSecretary = index;
  18651. this.saveUserData();
  18652. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18653. }
  18654. static getBallRod(index) {
  18655. return this.userData.ballRod[index];
  18656. }
  18657. static setBallRod(index, val) {
  18658. this.userData.ballRod[index] = val;
  18659. this.saveUserData();
  18660. }
  18661. static setBallRodFormServer(haveQiuGanJsonStr) {
  18662. if (!haveQiuGanJsonStr) {
  18663. console.log("setBallRodFormServer数据为空或未定义");
  18664. return;
  18665. }
  18666. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18667. const keys = Object.keys(haveQiuGanJsonObj);
  18668. keys.forEach(key => {
  18669. let v = haveQiuGanJsonObj[key];
  18670. let k = parseInt(key);
  18671. let idx = k - 1;
  18672. this.userData.ballRod[idx] = v;
  18673. });
  18674. }
  18675. static getCurBallRod() {
  18676. return this.userData.curBallRod;
  18677. }
  18678. static setCurBallRod(index) {
  18679. this.userData.curBallRod = index;
  18680. this.saveUserData();
  18681. }
  18682. static setSignData(val) {
  18683. this.userData.signData = val;
  18684. this.saveUserData();
  18685. }
  18686. static getSignData() {
  18687. return this.userData.signData;
  18688. }
  18689. static setSignTime(val) {
  18690. this.userData.signTime = val;
  18691. this.saveUserData();
  18692. }
  18693. static getSignTime() {
  18694. return this.userData.signTime;
  18695. }
  18696. static getDrawTimes() {
  18697. return this.userData.drawTimes;
  18698. }
  18699. static setDrawTimes(val, addUp = true) {
  18700. if (addUp) {
  18701. this.userData.drawTimes += val;
  18702. }
  18703. else {
  18704. this.userData.drawTimes = val;
  18705. }
  18706. this.saveUserData();
  18707. }
  18708. static getDrawAwardTimes() {
  18709. return this.userData.drawAwardTimes;
  18710. }
  18711. static setDrawAwardTimes(val) {
  18712. this.userData.drawAwardTimes = val;
  18713. this.saveUserData();
  18714. }
  18715. static getDailyfreeDrawTimes() {
  18716. return this.userData.dailyfreeDrawTimes;
  18717. }
  18718. static setDailyfreeDrawTimes(val) {
  18719. this.userData.dailyfreeDrawTimes = val;
  18720. this.saveUserData();
  18721. }
  18722. static setPower(val, addUp = true) {
  18723. if (addUp)
  18724. this.userData.power += val;
  18725. else
  18726. this.userData.power = val;
  18727. if (this.userData.power >= xGame.common.maxPower) {
  18728. this.userData.power = xGame.common.maxPower;
  18729. }
  18730. xGame.eventMgr.event(POWER_CHANGE, val);
  18731. this.saveUserData();
  18732. this.updateUserInfo2Server("power");
  18733. }
  18734. static getPower() {
  18735. return this.userData.power;
  18736. }
  18737. static setPowerTime(val) {
  18738. this.userData.powerTime = val;
  18739. this.saveUserData();
  18740. }
  18741. static getPowerTime() {
  18742. return this.userData.powerTime;
  18743. }
  18744. static powerEnough() {
  18745. return this.getPower() > 0;
  18746. }
  18747. static getChallengeTimes() {
  18748. return this.userData.challengeTimes;
  18749. }
  18750. static setChallengeTimes(val) {
  18751. this.userData.challengeTimes += val;
  18752. this.saveUserData();
  18753. }
  18754. static getExtraSign() {
  18755. return this.userData.extraSign;
  18756. }
  18757. static setExtraSign(val) {
  18758. this.userData.extraSign = val;
  18759. this.saveUserData();
  18760. }
  18761. static getClassicTimes() {
  18762. return this.userData.classicTimes;
  18763. }
  18764. static setClassicTimes() {
  18765. this.userData.classicTimes += 1;
  18766. this.saveUserData();
  18767. }
  18768. static getGuideHelpLine() {
  18769. return this.userData.guideHelpLine;
  18770. }
  18771. static setGuideHelpLine() {
  18772. this.userData.guideHelpLine = 1;
  18773. this.saveUserData();
  18774. }
  18775. static getNewUser() {
  18776. return this.userData.newUser;
  18777. }
  18778. static setNewUser() {
  18779. this.userData.newUser = false;
  18780. this.saveUserData();
  18781. }
  18782. static getRootBallFoul() {
  18783. return this.userData.rootBallFoul;
  18784. }
  18785. static setRootBallFoul() {
  18786. this.userData.rootBallFoul = 1;
  18787. this.saveUserData();
  18788. }
  18789. static getTimeoutFoul() {
  18790. return this.userData.timeoutFoul;
  18791. }
  18792. static setTimeoutFoul() {
  18793. this.userData.timeoutFoul = 1;
  18794. this.saveUserData();
  18795. }
  18796. static saveDiyGameData() {
  18797. if (this.diyGameSaving)
  18798. return;
  18799. this.diyGameSaving = true;
  18800. Laya.timer.once(500, this, () => {
  18801. this.diyGameSaving = false;
  18802. this.diyGameData.saveData();
  18803. });
  18804. }
  18805. static getChallengeMode_overLev() {
  18806. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  18807. return this.challengeMode_overLev;
  18808. }
  18809. static setChallengeMode_overLev(levNum) {
  18810. this.diyGameData.challengeMode_overLev = levNum;
  18811. this.saveDiyGameData();
  18812. }
  18813. static updateUserInfo2Server(type, count = 0) {
  18814. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18815. if (userInfoData == null) {
  18816. return;
  18817. }
  18818. let reqData = xGame.httpMgr.getReqData();
  18819. let rd = JSON.parse(reqData);
  18820. rd.dataType = type;
  18821. let dataValue = 0;
  18822. if (type == "zs") {
  18823. dataValue = this.getDiamond();
  18824. }
  18825. if (type == "jb") {
  18826. dataValue = this.getCoin();
  18827. }
  18828. if (type == "power") {
  18829. dataValue = this.getPower();
  18830. }
  18831. rd.dataValue = dataValue;
  18832. if (type == "bigSkills") {
  18833. let dataValueStr = this.userData.bigSkills;
  18834. let dvsJson = JSON.parse("[" + dataValueStr + "]");
  18835. rd.dataValueStr = JSON.stringify(dvsJson);
  18836. }
  18837. reqData = JSON.stringify(rd);
  18838. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  18839. try {
  18840. let code = res.code;
  18841. let data = res.data;
  18842. if (code == 401) {
  18843. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18844. console.log('zh:保存资产信息失败,请重新登录 ');
  18845. return;
  18846. }
  18847. if (code == 200) {
  18848. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  18849. }
  18850. else {
  18851. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  18852. }
  18853. }
  18854. catch (error) {
  18855. console.log('error=' + error);
  18856. alert("Please check your network connection.");
  18857. }
  18858. finally {
  18859. }
  18860. });
  18861. }
  18862. static getUserZiChanInfo(winTip = false) {
  18863. console.log('zh:getUserZCI');
  18864. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  18865. console.log('zh:userInfoData=' + userInfoData);
  18866. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  18867. if (winTip) {
  18868. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18869. }
  18870. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18871. return;
  18872. }
  18873. let reqData = xGame.httpMgr.getReqData();
  18874. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  18875. try {
  18876. console.log('zh:buySp res = ' + JSON.stringify(res));
  18877. let code = res.code;
  18878. let msg = res.msg;
  18879. if (code == 401) {
  18880. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18881. if (winTip) {
  18882. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18883. }
  18884. return;
  18885. }
  18886. if (code == 200) {
  18887. let d = res.data;
  18888. let zuanShi = d.zuanShi;
  18889. let jinBi = d.jinBi;
  18890. let haveQiuGanJson = d.haveQiuGanJson;
  18891. let signData = d.signData;
  18892. let placeBallData = d.placeBallData;
  18893. let bigSkills = d.bigSkills;
  18894. DataMgr.setDiamondFormServer(zuanShi);
  18895. DataMgr.setCoinFormServer(jinBi);
  18896. DataMgr.setBallRodFormServer(haveQiuGanJson);
  18897. DataMgr.setPlaceBallLevelList(placeBallData);
  18898. if (signData && signData > 0) {
  18899. DataMgr.setSignData(signData);
  18900. }
  18901. DataMgr.setBigSkillFormServer(bigSkills);
  18902. }
  18903. else {
  18904. console.log("zh:更新用户资产信息error" + msg);
  18905. if (winTip) {
  18906. xGame.uiMgr.Show(UIMsg, msg);
  18907. }
  18908. }
  18909. }
  18910. catch (error) {
  18911. console.log('error=' + error);
  18912. if (winTip) {
  18913. alert(error);
  18914. }
  18915. }
  18916. finally {
  18917. console.log("zh:更新用户资产信息结束");
  18918. }
  18919. });
  18920. }
  18921. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  18922. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18923. console.log('zh:updateLocalUserData=' + userInfo);
  18924. if (userInfo != null) {
  18925. if (!userInfo.buySpids) {
  18926. userInfo.buySpids = { 1: false, 7: false };
  18927. }
  18928. else {
  18929. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  18930. }
  18931. userInfo.buySpids[spid] = isBuyOk;
  18932. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  18933. }
  18934. else {
  18935. }
  18936. }
  18937. static loadUserSpOrderForAd() {
  18938. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18939. if (userInfo == null) {
  18940. return;
  18941. }
  18942. console.log('zh:重新加载更新广告权利');
  18943. let reqData = xGame.httpMgr.getReqData();
  18944. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  18945. try {
  18946. console.log('zh:loadUserSpOrderForAd res = ' + JSON.stringify(res));
  18947. let code = res.code;
  18948. let msg = res.msg;
  18949. if (code == 401) {
  18950. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18951. return;
  18952. }
  18953. if (code == 200) {
  18954. let data = res.data;
  18955. let buy_spid1 = false;
  18956. let buy_spid7 = false;
  18957. for (let index = 0; index < data.length; index++) {
  18958. let element = data[index];
  18959. console.log('zh:list element.spid = ' + element.spid);
  18960. if (element.spid == 1) {
  18961. buy_spid1 = true;
  18962. }
  18963. if (element.spid == 7) {
  18964. buy_spid7 = true;
  18965. }
  18966. }
  18967. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  18968. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  18969. }
  18970. else {
  18971. }
  18972. }
  18973. catch (error) {
  18974. console.log('error=' + error);
  18975. alert(error);
  18976. }
  18977. finally {
  18978. }
  18979. });
  18980. }
  18981. static checkForShowFuLi17AndAlert(alert_spid) {
  18982. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18983. if (userInfo == null) {
  18984. if (alert_spid === 1) {
  18985. xGame.uiMgr.Show(UIFuli1);
  18986. }
  18987. if (alert_spid === 7) {
  18988. xGame.uiMgr.Show(UIFuli2);
  18989. }
  18990. return;
  18991. }
  18992. console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
  18993. let reqData = xGame.httpMgr.getReqData();
  18994. let pd = JSON.parse(reqData);
  18995. pd.productId = alert_spid;
  18996. reqData = JSON.stringify(pd);
  18997. xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
  18998. try {
  18999. let code = res.code;
  19000. let msg = res.msg;
  19001. if (code == 401) {
  19002. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19003. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19004. return;
  19005. }
  19006. if (code == 200) {
  19007. let data = res.data;
  19008. let buyOkSpid = [];
  19009. for (let i = 0; i < data.length; i++) {
  19010. let item = data[i];
  19011. let temp_spid = item.spid;
  19012. DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
  19013. buyOkSpid.push(temp_spid);
  19014. }
  19015. let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
  19016. if (isBuyOk7) {
  19017. return;
  19018. }
  19019. let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
  19020. if (isBuyOk && alert_spid === 1) {
  19021. return;
  19022. }
  19023. else {
  19024. if (isBuyOk === false) {
  19025. if (alert_spid === 1) {
  19026. xGame.uiMgr.Show(UIFuli1);
  19027. }
  19028. if (alert_spid === 7) {
  19029. xGame.uiMgr.Show(UIFuli2);
  19030. }
  19031. }
  19032. else {
  19033. console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了');
  19034. }
  19035. }
  19036. }
  19037. else {
  19038. xGame.uiMgr.Show(UIMsg, msg);
  19039. }
  19040. }
  19041. catch (error) {
  19042. console.log('error=' + error);
  19043. alert(error);
  19044. }
  19045. finally {
  19046. }
  19047. });
  19048. }
  19049. }
  19050. DataMgr.isNewUser = false;
  19051. DataMgr.fristEnter = true;
  19052. DataMgr.levelType = 0;
  19053. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  19054. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  19055. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  19056. DataMgr.challengeMode_overLev = 0;
  19057. DataMgr.xszyForClassic = false;
  19058. DataMgr.xszyForChallenge = false;
  19059. DataMgr.awardId = 0;
  19060. DataMgr.awardCoin = 0;
  19061. DataMgr.sceneId = -1;
  19062. DataMgr.tryId = 0;
  19063. DataMgr.curLevel = 1;
  19064. DataMgr.vipLevel = 0;
  19065. DataMgr.maxLevel = 0;
  19066. DataMgr.awardRatio = 1;
  19067. DataMgr.gameList = [];
  19068. DataMgr.rankList = [];
  19069. DataMgr.recoverTime = 480000;
  19070. DataMgr.minScore = 0;
  19071. DataMgr.rankDis = 0;
  19072. DataMgr.userSaving = false;
  19073. DataMgr.gameSaving = false;
  19074. DataMgr.diyGameSaving = false;
  19075. class D3Tween extends Laya.Script3D {
  19076. constructor() {
  19077. super();
  19078. this.isInited = false;
  19079. }
  19080. ;
  19081. init() {
  19082. if (this.isInited)
  19083. return;
  19084. this.isInited = true;
  19085. this.gameObj = this.owner;
  19086. this.transform = this.gameObj.transform;
  19087. }
  19088. get rotX() {
  19089. return this.transform.localRotationEulerX;
  19090. }
  19091. set rotX(v) {
  19092. this.transform.localRotationEulerX = v;
  19093. }
  19094. get rotY() {
  19095. return this.transform.localRotationEulerY;
  19096. }
  19097. set rotY(v) {
  19098. this.transform.localRotationEulerY = v;
  19099. }
  19100. get rotZ() {
  19101. return this.transform.localRotationEulerZ;
  19102. }
  19103. set rotZ(v) {
  19104. this.transform.localRotationEulerZ = v;
  19105. }
  19106. get posX() {
  19107. return this.transform.localPositionX;
  19108. }
  19109. set posX(v) {
  19110. this.transform.localPositionX = v;
  19111. }
  19112. get posY() {
  19113. return this.transform.localPositionY;
  19114. }
  19115. set posY(v) {
  19116. this.transform.localPositionY = v;
  19117. }
  19118. get posZ() {
  19119. return this.transform.localPositionZ;
  19120. }
  19121. set posZ(v) {
  19122. this.transform.localPositionZ = v;
  19123. }
  19124. get rotation() {
  19125. return this.transform.localRotation;
  19126. }
  19127. set rotation(v) {
  19128. this.transform.localRotation = v;
  19129. }
  19130. }
  19131. class D2Hole extends Laya.Script {
  19132. constructor() { super(); }
  19133. onTriggerEnter(collider) {
  19134. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19135. return;
  19136. }
  19137. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19138. if (collider.owner["mySrc"].isRunSkillAni) {
  19139. return;
  19140. }
  19141. if (collider.owner["mySrc"].number != 0) {
  19142. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19143. }
  19144. xGame.common.ballColliHole(collider);
  19145. xGame.common.recoverCameraView();
  19146. }
  19147. }
  19148. }
  19149. class Table extends Laya.Script3D {
  19150. constructor() {
  19151. super();
  19152. this.isSetBorder = false;
  19153. this.inited = false;
  19154. }
  19155. ;
  19156. onAwake() {
  19157. this.init();
  19158. }
  19159. init() {
  19160. if (this.inited)
  19161. return;
  19162. this.inited = true;
  19163. this.gameObj = this.owner;
  19164. this.border = this.gameObj.getChildByName("border");
  19165. }
  19166. setBorderPos() {
  19167. if (this.isSetBorder)
  19168. return;
  19169. this.isSetBorder = true;
  19170. let ui = xGame.common.gameUI.ui;
  19171. let bar1 = this.border.getChildByName("bar1");
  19172. let bar2 = this.border.getChildByName("bar2");
  19173. let bar3 = this.border.getChildByName("bar3");
  19174. let bar4 = this.border.getChildByName("bar4");
  19175. let bar5 = this.border.getChildByName("bar5");
  19176. let bar6 = this.border.getChildByName("bar6");
  19177. this.setInfo(bar1, ui.border.bar1, "box");
  19178. this.setInfo(bar2, ui.border.bar2, "box");
  19179. this.setInfo(bar3, ui.border.bar3, "box");
  19180. this.setInfo(bar4, ui.border.bar4, "box");
  19181. this.setInfo(bar5, ui.border.bar5, "box");
  19182. this.setInfo(bar6, ui.border.bar6, "box");
  19183. let circle1 = this.border.getChildByName("circle1");
  19184. let circle2 = this.border.getChildByName("circle2");
  19185. let circle3 = this.border.getChildByName("circle3");
  19186. let circle4 = this.border.getChildByName("circle4");
  19187. let circle5 = this.border.getChildByName("circle5");
  19188. let circle6 = this.border.getChildByName("circle6");
  19189. this.setInfo(circle1, ui.border.circle1, "circle");
  19190. this.setInfo(circle2, ui.border.circle2, "circle");
  19191. this.setInfo(circle3, ui.border.circle3, "circle");
  19192. this.setInfo(circle4, ui.border.circle4, "circle");
  19193. this.setInfo(circle5, ui.border.circle5, "circle");
  19194. this.setInfo(circle6, ui.border.circle6, "circle");
  19195. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19196. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19197. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19198. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19199. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19200. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19201. let arr = xGame.common.gameMgr.holePosList;
  19202. xGame.common.gameMgr.posObj = {
  19203. "1": arr[0],
  19204. "3": arr[2],
  19205. "4": arr[3],
  19206. "6": arr[5]
  19207. };
  19208. }
  19209. initHolePos(x, y) {
  19210. if (x < 300)
  19211. x += 25;
  19212. else if (x > 1000)
  19213. x -= 25;
  19214. else if (y > 200)
  19215. y -= 10;
  19216. else
  19217. y += 10;
  19218. if (y < 200)
  19219. y += 30;
  19220. else if (y > 500)
  19221. y -= 30;
  19222. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19223. }
  19224. setInfo(d3Obj, d2Obj, type) {
  19225. let ui = xGame.common.gameUI.ui;
  19226. let sprite = new Laya.Sprite();
  19227. ui.border.displayObject.addChild(sprite);
  19228. let colli = xGame.common.getCollider(type);
  19229. sprite.addComponentIntance(colli);
  19230. let rigy = xGame.common.getRigbody();
  19231. rigy.type = "static";
  19232. sprite.addComponentIntance(rigy);
  19233. let d3Pos = d3Obj.transform.position;
  19234. xGame.common.pos3to2Convert(d3Pos);
  19235. let scaleX = d3Obj.transform.localScaleX;
  19236. let scaleZ = d3Obj.transform.localScaleZ;
  19237. let width = xGame.common.scale3to2Convert(scaleZ);
  19238. let height = xGame.common.scale3to2Convert(scaleX);
  19239. sprite.pivotX = width / 2;
  19240. sprite.pivotY = height / 2;
  19241. sprite.x = d3Pos.x;
  19242. sprite.y = d3Pos.y;
  19243. sprite.width = width;
  19244. sprite.height = height;
  19245. d2Obj.x = d3Pos.x;
  19246. d2Obj.y = d3Pos.y;
  19247. d2Obj.width = width;
  19248. d2Obj.height = height;
  19249. if (type == "box") {
  19250. colli.width = width;
  19251. colli.height = height;
  19252. colli.isSensor = false;
  19253. colli.label = "border";
  19254. }
  19255. else {
  19256. colli.radius = width / 2;
  19257. colli.isSensor = true;
  19258. colli.label = "hole";
  19259. sprite.addComponent(D2Hole);
  19260. }
  19261. }
  19262. }
  19263. class D3World extends Laya.Script3D {
  19264. constructor() {
  19265. super();
  19266. this.loadNum = 0;
  19267. this.setLoadNum = 7;
  19268. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19269. }
  19270. onAwake() {
  19271. }
  19272. loadScene() {
  19273. this.scene = this.owner;
  19274. let url = `res/unityRes/root.lh`;
  19275. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19276. this.scene.addChild(prefab);
  19277. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19278. this.putCameraInfo();
  19279. this.camera.enableHDR = false;
  19280. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19281. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19282. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19283. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19284. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19285. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19286. this.knife.active = false;
  19287. this.loadD3Obj();
  19288. }));
  19289. }
  19290. putCameraInfo() {
  19291. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19292. this.cameraObj = new cameraType();
  19293. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19294. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19295. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19296. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19297. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19298. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19299. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19300. this.visitAngleChild.init();
  19301. this.visitRootObj.posX = this.visitAngleChild.posX;
  19302. this.visitRootObj.posY = this.visitAngleChild.posY;
  19303. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19304. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19305. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19306. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19307. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19308. xGame.common.showOneCamera("mainCamera");
  19309. }
  19310. loadD3Obj() {
  19311. this.loadTable();
  19312. this.loadRoom();
  19313. this.loadInHoleParticial();
  19314. this.loadIceParticial();
  19315. this.loadHitParticial();
  19316. this.loadFireworksParticial();
  19317. this.loadBall();
  19318. }
  19319. loadInHoleParticial() {
  19320. this.loadD3Res("inHoleEft", "", (prefab) => {
  19321. prefab.addComponent(Partical);
  19322. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19323. });
  19324. }
  19325. loadIceParticial() {
  19326. this.loadD3Res("iceEft", "", (prefab) => {
  19327. prefab.addComponent(Partical);
  19328. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19329. });
  19330. }
  19331. loadHitParticial() {
  19332. this.loadD3Res("hitEft", "", (prefab) => {
  19333. prefab.addComponent(Partical);
  19334. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19335. });
  19336. }
  19337. loadFireworksParticial() {
  19338. this.loadD3Res("fireworksEft", "", (prefab) => {
  19339. prefab.addComponent(Partical);
  19340. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19341. });
  19342. }
  19343. loadBall(index = 1) {
  19344. this.loadD3Res("ball", index, (prefab) => {
  19345. this.ballPrefab = prefab;
  19346. this.ballPrefab.addComponent(Ball);
  19347. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19348. });
  19349. }
  19350. loadTable(index = 1) {
  19351. this.loadD3Res("table", index, (prefab) => {
  19352. this.tableSrc = prefab.addComponent(Table);
  19353. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19354. this.d3Hand.init();
  19355. this.tableRoot.addChild(prefab);
  19356. });
  19357. }
  19358. loadRoom(index = 1) {
  19359. this.loadD3Res("room", index, (prefab) => {
  19360. this.roomRoot.addChild(prefab);
  19361. });
  19362. }
  19363. loadD3Res(type, index, callback) {
  19364. let url = `res/unityRes/${type}${index}.lh`;
  19365. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19366. callback && callback(prefab);
  19367. this.checkResLoad();
  19368. }));
  19369. }
  19370. checkResLoad() {
  19371. this.loadNum++;
  19372. if (this.loadNum >= this.setLoadNum) {
  19373. xGame.eventMgr.event(D3RES_LOADED);
  19374. }
  19375. }
  19376. prePlayEft() {
  19377. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19378. eft.transform.localPositionX = 0;
  19379. eft.transform.localPositionY = -5;
  19380. eft.transform.localPositionZ = 0;
  19381. eft.active = true;
  19382. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19383. ice.transform.localPositionX = 0;
  19384. ice.transform.localPositionY = -5;
  19385. ice.transform.localPositionZ = 0;
  19386. ice.active = true;
  19387. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19388. hit.transform.localPositionX = 0;
  19389. hit.transform.localPositionY = -5;
  19390. hit.transform.localPositionZ = 0;
  19391. hit.active = true;
  19392. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19393. fireworks.transform.localPositionX = 0;
  19394. fireworks.transform.localPositionY = -5;
  19395. fireworks.transform.localPositionZ = 0;
  19396. fireworks.active = true;
  19397. }
  19398. }
  19399. class cameraType {
  19400. }
  19401. class MoyuMgr$1 {
  19402. static initMoyu() {
  19403. this.moyuView = new MoyuView$1();
  19404. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19405. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19406. this.moyuView.ui.displayObject.zOrder = 1000;
  19407. this.moyuView.init();
  19408. this.moyuView.showTip(true);
  19409. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19410. window['XApk'] = this;
  19411. }
  19412. static showAge(show) {
  19413. if (this.moyuView)
  19414. this.moyuView.showAge(show);
  19415. }
  19416. static onPlatMsg(idx) {
  19417. if (!MoyuMgr$1.moyuView)
  19418. return;
  19419. if (idx == '0') {
  19420. MoyuMgr$1.moyuView.showTip(false);
  19421. }
  19422. }
  19423. static showAgree(call) {
  19424. if (this.moyuView)
  19425. this.moyuView.showAgree(call);
  19426. else
  19427. call && call();
  19428. }
  19429. static showXy(type = 1) {
  19430. if (this.moyuView)
  19431. this.moyuView.showXy(type);
  19432. }
  19433. }
  19434. MoyuMgr$1.isAdvise = false;
  19435. class MoyuView$1 {
  19436. constructor() {
  19437. this.ysxyNum = 1;
  19438. this.ysJson = null;
  19439. this.ui = ui_UIMoyu.createInstance();
  19440. }
  19441. init() {
  19442. this.ui.mainBg.visible = false;
  19443. this.ui.xyNode.visible = false;
  19444. this.ui.ageNode.visible = false;
  19445. this.ui.tipNode.visible = false;
  19446. this.ui.rnNode.visible = false;
  19447. this.ui.fcmNode.visible = false;
  19448. this.ui.ageTip.visible = false;
  19449. this.ui.msgNode.visible = false;
  19450. this.ui.visible = false;
  19451. this.ui.xyNode.xyList.setVirtual();
  19452. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19453. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19454. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19455. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19456. this.ui.xyNode.btnKnown.visible = false;
  19457. this.ui.xyNode.xy1.visible = false;
  19458. this.ui.xyNode.xy2.visible = false;
  19459. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19460. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19461. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19462. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19463. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19464. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19465. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19466. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19467. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19468. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19469. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19470. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19471. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19472. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19473. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19474. this.ysxyNum = 2;
  19475. }
  19476. }
  19477. onClick(obj) {
  19478. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19479. switch (obj) {
  19480. case this.ui.ageTip:
  19481. if (Moyu.isTTApk) {
  19482. this.ui.ageNode.visible = true;
  19483. this.ui.mainBg.visible = true;
  19484. }
  19485. break;
  19486. case this.ui.tipNode:
  19487. this.showTip(false);
  19488. break;
  19489. case this.ui.ageNode.btnAge:
  19490. this.ui.ageNode.visible = false;
  19491. this.ui.mainBg.visible = false;
  19492. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19493. this.ui.visible = false;
  19494. break;
  19495. case this.ui.xyNode.btnXy3:
  19496. case this.ui.xyNode.btnXy1:
  19497. this.loadXy(1);
  19498. break;
  19499. case this.ui.xyNode.btnXy2:
  19500. this.loadXy(2);
  19501. break;
  19502. case this.ui.xyNode.btnBack:
  19503. this.ui.xyNode.xy1.visible = true;
  19504. this.ui.xyNode.xy2.visible = false;
  19505. break;
  19506. case this.ui.xyNode.btnKnown:
  19507. this.ui.xyNode.visible = false;
  19508. this.ui.mainBg.visible = false;
  19509. this.ui.visible = false;
  19510. break;
  19511. case this.ui.rnNode.btnCheck:
  19512. this.check();
  19513. break;
  19514. case this.ui.rnNode.btnExit:
  19515. case this.ui.xyNode.btnNo:
  19516. this.ysxyNum--;
  19517. if (this.ysxyNum > 0)
  19518. this.showMsg("Refuse to quit the game once again");
  19519. else {
  19520. Moyu.userAgree(false);
  19521. Moyu.exit();
  19522. }
  19523. break;
  19524. case this.ui.xyNode.btnSure:
  19525. case this.ui.xyNode.btnYes:
  19526. DataMgr.userData.isAgree = true;
  19527. DataMgr.saveUserData();
  19528. this.onAgree();
  19529. break;
  19530. case this.ui.rnNode.btnDone:
  19531. this.ui.rnNode.visible = false;
  19532. this.ui.visible = false;
  19533. break;
  19534. case this.ui.fcmNode.btnRn:
  19535. this.showRn();
  19536. break;
  19537. }
  19538. }
  19539. showTip(show) {
  19540. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19541. return;
  19542. if (show) {
  19543. MoyuMgr$1.isAdvise = true;
  19544. this.ui.visible = true;
  19545. this.ui.tipNode.visible = true;
  19546. this.ui.tipNode.alpha = 1;
  19547. Laya.timer.once(1000, this, this.showTip, [false]);
  19548. }
  19549. else {
  19550. this.ui.tipNode.alpha = 1;
  19551. this.ui.tipNode.visible = true;
  19552. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19553. this.ui.tipNode.visible = false;
  19554. MoyuMgr$1.isAdvise = false;
  19555. }), 1000);
  19556. }
  19557. }
  19558. showAge(show, px = 0, py = 0) {
  19559. if (Moyu.platType > 10 && !Moyu.isIos) {
  19560. this.ui.ageTip.x = px;
  19561. this.ui.ageTip.y = py;
  19562. this.ui.ageTip.visible = show;
  19563. if (show)
  19564. this.ui.visible = true;
  19565. }
  19566. }
  19567. showAgree(call) {
  19568. this.agreeCall = call;
  19569. this.onAgree();
  19570. return;
  19571. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19572. this.showXy(0);
  19573. }
  19574. else
  19575. this.onAgree();
  19576. }
  19577. onAgree() {
  19578. if (!this.ui.ageNode.visible)
  19579. this.ui.visible = false;
  19580. this.ui.xyNode.visible = false;
  19581. Moyu.userAgree(true);
  19582. this.showAge(false);
  19583. this.agreeCall && this.agreeCall();
  19584. this.showRn();
  19585. }
  19586. showMsg(txt) {
  19587. this.ui.msgNode.txtMsg.text = txt;
  19588. this.ui.msgNode.visible = true;
  19589. this.ui.msgNode.alpha = 1;
  19590. this.ui.visible = true;
  19591. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19592. this.ui.msgNode.visible = false;
  19593. }), 2500, true);
  19594. }
  19595. showRn() {
  19596. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19597. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19598. this.ui.rnNode.rn1.visible = true;
  19599. this.ui.rnNode.rn2.visible = false;
  19600. this.ui.rnNode.rn3.visible = false;
  19601. this.ui.rnNode.rn4.visible = false;
  19602. this.ui.rnNode.visible = true;
  19603. this.ui.mainBg.visible = true;
  19604. this.ui.rnNode.btnDone.visible = false;
  19605. this.ui.rnNode.btnExit.visible = true;
  19606. this.ui.rnNode.btnCheck.visible = true;
  19607. this.ui.fcmNode.visible = false;
  19608. this.ui.visible = true;
  19609. return;
  19610. }
  19611. }
  19612. this.showFcm();
  19613. }
  19614. showFcm() {
  19615. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19616. Moyu.initFCM(true);
  19617. if (Moyu.gameTime < 1)
  19618. this.fcmLoop();
  19619. else if (Moyu.gameTime < 999)
  19620. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19621. }
  19622. }
  19623. fcmLoop() {
  19624. if (Moyu.gameTime < 1) {
  19625. this.ui.rnNode.visible = false;
  19626. this.ui.fcmNode.visible = true;
  19627. this.ui.mainBg.visible = true;
  19628. this.ui.visible = true;
  19629. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19630. Laya.timer.clear(this.ui, this.fcmLoop);
  19631. }
  19632. }
  19633. check() {
  19634. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19635. this.ui.rnNode.rn1.visible = false;
  19636. this.ui.rnNode.rn2.visible = false;
  19637. this.ui.rnNode.rn4.visible = true;
  19638. }
  19639. else if (this.ui.rnNode.rn4.visible) {
  19640. let name = this.ui.rnNode.inputName.text;
  19641. let code = this.ui.rnNode.inputCode.text;
  19642. if (code && code.length == 18) {
  19643. this.ui.rnNode.rn1.visible = false;
  19644. this.ui.rnNode.rn4.visible = false;
  19645. Moyu.authenticate(name, code, (res) => {
  19646. this.ui.rnNode.rn2.visible = !res;
  19647. this.ui.rnNode.rn3.visible = res;
  19648. this.ui.rnNode.btnDone.visible = res;
  19649. this.ui.rnNode.btnExit.visible = !res;
  19650. this.ui.rnNode.btnCheck.visible = !res;
  19651. if (res)
  19652. this.showFcm();
  19653. });
  19654. }
  19655. else
  19656. this.showMsg("信息填写不完整");
  19657. }
  19658. }
  19659. loadXy(type = 0) {
  19660. this.ui.xyNode.xy1.visible = false;
  19661. this.ui.xyNode.xy2.visible = true;
  19662. this.ui.xyNode.xyList.scrollToView(0);
  19663. if (type == 1) {
  19664. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19665. }
  19666. else if (type == 2) {
  19667. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19668. }
  19669. }
  19670. showXy(type = 0) {
  19671. this.xyBtn();
  19672. if (type == 0) {
  19673. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19674. this.ui.xyNode.btnSure.visible = true;
  19675. }
  19676. else {
  19677. this.ui.xyNode.btnYes.visible = true;
  19678. this.ui.xyNode.btnNo.visible = true;
  19679. }
  19680. }
  19681. else {
  19682. this.ui.xyNode.btnKnown.visible = true;
  19683. this.ui.mainBg.visible = true;
  19684. }
  19685. this.ui.xyNode.xy1.visible = true;
  19686. this.ui.xyNode.xy2.visible = false;
  19687. this.ui.xyNode.visible = true;
  19688. this.ui.visible = true;
  19689. }
  19690. xyBtn() {
  19691. this.ui.xyNode.btnSure.visible = false;
  19692. this.ui.xyNode.btnYes.visible = false;
  19693. this.ui.xyNode.btnNo.visible = false;
  19694. this.ui.xyNode.btnKnown.visible = false;
  19695. {
  19696. this.ui.xyNode.btnXy3.visible = false;
  19697. this.ui.xyNode.btnXy2.visible = true;
  19698. this.ui.xyNode.btnXy1.visible = true;
  19699. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19700. }
  19701. }
  19702. createXY(json) {
  19703. this.ysJson = json.content;
  19704. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  19705. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  19706. this.ui.xyNode.xy2.visible = true;
  19707. }
  19708. renderListItem(idx, cell) {
  19709. let xy = this.ysJson[idx];
  19710. cell.height = xy.line * 30;
  19711. cell.xyItem.text = xy.text;
  19712. }
  19713. onDestroy() {
  19714. this.agreeCall = null;
  19715. }
  19716. }
  19717. class UILoading extends UIBase {
  19718. constructor() {
  19719. super();
  19720. this.accTime = 0;
  19721. this.curNum = 0;
  19722. this.rate = 1;
  19723. this.loadSubOk = false;
  19724. this.loadResOK = false;
  19725. this.openLoading = true;
  19726. this.beginLoadRes = false;
  19727. this.finishD2 = false;
  19728. this.finishD3 = false;
  19729. }
  19730. onConstructor() {
  19731. this.ui = ui_UILoading.createInstance();
  19732. this.contentPane = this.ui;
  19733. this.isEject = false;
  19734. this._initUI();
  19735. this._addEvent();
  19736. }
  19737. _initUI() {
  19738. MoyuMgr$1.initMoyu();
  19739. }
  19740. _addEvent() {
  19741. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  19742. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  19743. }
  19744. show() {
  19745. super.show();
  19746. console.log('zh:加载分包资源');
  19747. loadSubRes(this.subResProgress.bind(this));
  19748. this.ui.txtLoad.text = "Loading...";
  19749. this.setGlobalFont(this.ui);
  19750. }
  19751. subResProgress(pro, finish) {
  19752. this.curNum = pro;
  19753. if (finish) {
  19754. this.curNum = 1;
  19755. this.loadSubOk = true;
  19756. }
  19757. }
  19758. laodD3Res() {
  19759. let scene3D = new Laya.Scene3D();
  19760. xGame.common.d3Scene = scene3D;
  19761. xGame.common.d3World = scene3D.addComponent(D3World);
  19762. xGame.common.d3World.loadScene();
  19763. }
  19764. loadD2Res() {
  19765. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  19766. this.finishD2 = true;
  19767. this.checkLoadAll();
  19768. this.curNum = 1;
  19769. }), Laya.Handler.create(this, (pro) => {
  19770. this.curNum = pro;
  19771. }, null, false));
  19772. }
  19773. d3ResFinish() {
  19774. this.finishD3 = true;
  19775. this.checkLoadAll();
  19776. }
  19777. checkLoadAll() {
  19778. if (this.finishD2 && this.finishD3) {
  19779. this.loadResOK = true;
  19780. }
  19781. }
  19782. loadRes() {
  19783. this.laodD3Res();
  19784. this.loadD2Res();
  19785. }
  19786. myUpdate(dt) {
  19787. if (!this.openLoading)
  19788. return;
  19789. this.accTime += dt * this.rate;
  19790. if (this.accTime >= this.curNum)
  19791. this.accTime = this.curNum;
  19792. this.ui.loadinfo.value = this.accTime * 100;
  19793. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  19794. if (!this.beginLoadRes) {
  19795. this.beginLoadRes = true;
  19796. this.ui.txtLoad.text = "Loading...";
  19797. this.curNum = 0;
  19798. this.accTime = 0;
  19799. this.loadRes();
  19800. }
  19801. if (this.loadResOK) {
  19802. this.openLoading = false;
  19803. Laya.timer.once(300, this, () => {
  19804. xGame.common.d3Scene.active = false;
  19805. MoyuMgr$1.showAgree(enterGame);
  19806. });
  19807. }
  19808. }
  19809. }
  19810. release() {
  19811. }
  19812. hide() {
  19813. super.hide();
  19814. this.release();
  19815. }
  19816. onClose() {
  19817. this.hide();
  19818. }
  19819. }
  19820. UILoading.uiName = "UILoading";
  19821. class UIRepentProp$1 extends UIBase {
  19822. constructor() {
  19823. super();
  19824. this.viewType = 0;
  19825. this.regretType = 0;
  19826. }
  19827. onConstructor() {
  19828. this.ui = ui_UIRepentProp.createInstance();
  19829. this.contentPane = this.ui;
  19830. this.isEject = false;
  19831. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  19832. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  19833. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  19834. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  19835. }
  19836. show(viewType, regretType, callback) {
  19837. PlatMgr.showInsert(true);
  19838. this.viewType = viewType;
  19839. this.regretType = regretType;
  19840. this.callback = callback;
  19841. super.show();
  19842. this.ui.t0.play();
  19843. this.ui.c1.selectedIndex = this.viewType;
  19844. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  19845. if (this.viewType == 0) {
  19846. let guide = DataMgr.getGuideHelpLine();
  19847. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  19848. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  19849. }
  19850. xGame.common.gameMgr.gamePause = true;
  19851. this.setGlobalFont(this.ui);
  19852. }
  19853. hideSelf() {
  19854. xGame.common.gameMgr.gamePause = false;
  19855. this.callback && this.callback(false);
  19856. this.hide();
  19857. }
  19858. videoRegret() {
  19859. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  19860. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  19861. }
  19862. else {
  19863. console.log('zh:AD 失败,直接发放奖励');
  19864. this.qjff_AD_for_UIrepentProp_videoRegret();
  19865. }
  19866. }
  19867. qjff_AD_for_UIrepentProp_videoRegret() {
  19868. this.callback && this.callback(true);
  19869. this.hideSelf();
  19870. }
  19871. videoAddHelpLine() {
  19872. let guide = DataMgr.getGuideHelpLine();
  19873. if (guide == 0) {
  19874. this.callback && this.callback(true);
  19875. this.hideSelf();
  19876. DataMgr.setGuideHelpLine();
  19877. xGame.common.gameUI.ui.guideNode.visible = false;
  19878. }
  19879. else {
  19880. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  19881. if (Laya.Browser.onAndroid) {
  19882. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  19883. if (!boo) {
  19884. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  19885. return;
  19886. }
  19887. }
  19888. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  19889. }
  19890. else {
  19891. console.log('zh:AD 失败,直接发放奖励');
  19892. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  19893. }
  19894. }
  19895. }
  19896. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  19897. this.callback && this.callback(true);
  19898. this.hideSelf();
  19899. }
  19900. }
  19901. UIRepentProp$1.uiName = "UIRepentProp";
  19902. class UIRodMethod$1 extends UIBase {
  19903. constructor() {
  19904. super();
  19905. this.isPressd = false;
  19906. }
  19907. onConstructor() {
  19908. this.ui = ui_UIRodMethod.createInstance();
  19909. this.contentPane = this.ui;
  19910. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  19911. this.moveDir = new Laya.Vector2();
  19912. this.moveDest = new Laya.Vector2();
  19913. this.centerPos = new Laya.Vector2();
  19914. xGame.common.uiRodMethod = this;
  19915. }
  19916. show() {
  19917. super.show();
  19918. xGame.common.gameMgr.gamePause = true;
  19919. this.openPressDotEvent();
  19920. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  19921. this.centerPos.x = this.ui.white.x;
  19922. this.centerPos.y = this.ui.white.y;
  19923. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  19924. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  19925. this.setDot();
  19926. this.setGlobalFont(this.ui);
  19927. }
  19928. setDot() {
  19929. this.ui.dot.x = this.moveDest.x;
  19930. this.ui.dot.y = this.moveDest.y;
  19931. }
  19932. closeSelf() {
  19933. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  19934. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  19935. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  19936. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  19937. xGame.common.gameMgr.gamePause = false;
  19938. this.hide();
  19939. }
  19940. openPressDotEvent() {
  19941. this.closePressDotEvent();
  19942. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19943. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19944. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19945. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19946. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  19947. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19948. }
  19949. closePressDotEvent() {
  19950. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19951. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  19952. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19953. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19954. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  19955. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  19956. }
  19957. onDown(e) {
  19958. if (e.type == Laya.Event.MOUSE_DOWN)
  19959. this.isPressd = true;
  19960. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  19961. this.isPressd = false;
  19962. if (!this.isPressd)
  19963. return;
  19964. this.moveDest.x = e.stageX;
  19965. this.moveDest.y = e.stageY;
  19966. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  19967. if (dis > 6724) {
  19968. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  19969. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  19970. }
  19971. this.setDot();
  19972. }
  19973. resetRod() {
  19974. this.ui.dot.x = this.ui.white.x;
  19975. this.ui.dot.y = this.ui.white.y;
  19976. this.gameRod.dot.x = this.gameRod.bg.x;
  19977. this.gameRod.dot.y = this.gameRod.bg.y;
  19978. xGame.common.rodOffest.x = 0;
  19979. xGame.common.rodOffest.y = 0;
  19980. }
  19981. }
  19982. UIRodMethod$1.uiName = "UIRodMethod";
  19983. class UIMsg$1 extends UIBase {
  19984. constructor() {
  19985. super();
  19986. }
  19987. onConstructor() {
  19988. this.ui = ui_UIMsg.createInstance();
  19989. this.contentPane = this.ui;
  19990. this.isEject = false;
  19991. this.isMuti = true;
  19992. }
  19993. show(msg, callback) {
  19994. super.show();
  19995. this.ui.tipsNode.msgTxt.text = msg;
  19996. this.ui.alpha = 1;
  19997. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  19998. this.hide();
  19999. callback && callback();
  20000. }), 1000);
  20001. this.setGlobalFont(this.ui);
  20002. }
  20003. }
  20004. UIMsg$1.uiName = "UIMsg";
  20005. class UITips$1 extends UIBase {
  20006. constructor() {
  20007. super();
  20008. this.type = 0;
  20009. }
  20010. onConstructor() {
  20011. this.ui = ui_UITips.createInstance();
  20012. this.contentPane = this.ui;
  20013. this.isEject = false;
  20014. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  20015. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  20016. }
  20017. show(tipsTxt, womanTxt, type) {
  20018. super.show();
  20019. this.ui.t0.play();
  20020. this.ui.myNode.tipsTxt.text = tipsTxt;
  20021. this.ui.myNode.womanTxt.text = womanTxt;
  20022. PlatMgr.showInsert(true);
  20023. this.ui.myNode.c1.selectedIndex = type;
  20024. this.type = type;
  20025. switch (this.type) {
  20026. case TipsType.exitGame:
  20027. xGame.common.gameMgr.gamePause = true;
  20028. break;
  20029. case TipsType.foul:
  20030. Laya.timer.once(200, this, () => {
  20031. if (xGame.common.gameMgr) {
  20032. xGame.common.gameMgr.gamePause = true;
  20033. }
  20034. else {
  20035. console.log("zh:gameMgr is null");
  20036. }
  20037. });
  20038. break;
  20039. default:
  20040. break;
  20041. }
  20042. this.setGlobalFont(this.ui);
  20043. }
  20044. clickLeftBtn() {
  20045. this.hide();
  20046. xGame.common.gameMgr.gamePause = false;
  20047. switch (this.type) {
  20048. case TipsType.exitGame:
  20049. break;
  20050. case TipsType.foul:
  20051. break;
  20052. default:
  20053. break;
  20054. }
  20055. }
  20056. clickRightBtn() {
  20057. this.hide();
  20058. switch (this.type) {
  20059. case TipsType.exitGame:
  20060. xGame.eventMgr.event(RESET_GAME);
  20061. xGame.uiMgr.Show(UIMain$1);
  20062. Moyu.recordEnd(this, null);
  20063. xGame.common.longHelpLine = false;
  20064. break;
  20065. case TipsType.foul:
  20066. if (xGame.common.gameMgr) {
  20067. xGame.common.gameMgr.gamePause = false;
  20068. }
  20069. Laya.timer.clearAll(this);
  20070. break;
  20071. default:
  20072. break;
  20073. }
  20074. }
  20075. }
  20076. UITips$1.uiName = "UITips";
  20077. class UIGame$1 extends UIBase {
  20078. constructor() {
  20079. super();
  20080. this.powerNum = 0;
  20081. this.isD3Inited = false;
  20082. this.isPrePlay = false;
  20083. this.isMoveRod = false;
  20084. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  20085. this.rulerDis = 20;
  20086. this.rulerOffset = 0;
  20087. }
  20088. onConstructor() {
  20089. this.ui = ui_UIGame.createInstance();
  20090. this.contentPane = this.ui;
  20091. this.ui.x += xGame.common.sysOffestNum;
  20092. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  20093. this.isEject = false;
  20094. xGame.common.gameUI = this;
  20095. this.initSelf();
  20096. }
  20097. isTurnSelf() {
  20098. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  20099. return true;
  20100. }
  20101. }
  20102. initSelf() {
  20103. let topUI = this.ui.topNode;
  20104. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20105. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20106. this.barInfo = {};
  20107. this.barInfo.curY = 0;
  20108. this.barInfo.height = this.ui.powerNode.height;
  20109. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20110. this.barInfo.powerStartY = this.ui.powerNode.y;
  20111. xGame.common.aiPlayer = new AIPlayer();
  20112. xGame.common.gameMgr = new GameMgr();
  20113. xGame.common.skillMgr = new SkillMgr();
  20114. xGame.common.wordsMgr = new WordsMgr();
  20115. xGame.common.talkMgr = new TalkMgr();
  20116. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20117. });
  20118. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20119. });
  20120. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20121. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20122. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20123. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20124. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20125. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20126. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20127. }
  20128. getGanZiImg() {
  20129. let index = DataMgr.getCurBallRod();
  20130. let data = cfgTable.ballrodData[index + 1];
  20131. let gan_url = xGame.common.getGameIconUrl(data.img);
  20132. this.ui.powerNode.showImg.url = gan_url;
  20133. }
  20134. returnHome() {
  20135. let tips = "Are you sure to exit the game?";
  20136. let woman = "Boss, why don't you play for a while longer?";
  20137. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20138. }
  20139. addRodMethodClick() {
  20140. if (this.isTurnSelf()) {
  20141. xGame.uiMgr.Show(UIRodMethod$1);
  20142. }
  20143. }
  20144. clickHelpLineBtn(force = false) {
  20145. if (!this.isTurnSelf())
  20146. return;
  20147. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20148. if (success) {
  20149. xGame.common.longHelpLine = true;
  20150. xGame.common.d2World.getHelpLine();
  20151. Moyu.sendDataEvent("guideNum");
  20152. }
  20153. else {
  20154. }
  20155. });
  20156. }
  20157. renderSelfDisplayBalls(index, target) {
  20158. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20159. target.myImg.url = xGame.common.getGameIconUrl(str);
  20160. }
  20161. renderAIDisplayBalls(index, target) {
  20162. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20163. target.myImg.url = xGame.common.getGameIconUrl(str);
  20164. ;
  20165. }
  20166. updateMode() {
  20167. if (xGame.common.gameMode == GameMode.classic) {
  20168. this.ui.topNode.scoreNode.visible = false;
  20169. }
  20170. else if (xGame.common.gameMode == GameMode.bigMove) {
  20171. this.ui.topNode.scoreNode.visible = true;
  20172. }
  20173. }
  20174. show() {
  20175. super.show();
  20176. this.ui.alpha = 0;
  20177. this.updateSelf();
  20178. xGame.common.gameMgr.gamePause = false;
  20179. xGame.common.gameUI.ui.blackAni.visible = false;
  20180. xGame.common.gameUI.ui.whiteAni.visible = false;
  20181. this.ui.powerEft.visible = false;
  20182. this.ui.colorNode.visible = false;
  20183. this.updateHead();
  20184. let curUse = DataMgr.getCurBallRod();
  20185. this.getGanZiImg();
  20186. this.setGlobalFont(this.ui);
  20187. }
  20188. updateSelf() {
  20189. if (xGame.common.gameMode == GameMode.classic) {
  20190. this.ui.c1.selectedIndex = 0;
  20191. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20192. this.ui.topNode.middleNode.visible = true;
  20193. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20194. }
  20195. else if (xGame.common.gameMode == GameMode.bigMove) {
  20196. this.ui.c1.selectedIndex = 0;
  20197. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20198. this.ui.topNode.middleNode.visible = false;
  20199. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20200. let rand = xGame.common.randomNum(1, max);
  20201. let guide = DataMgr.getSkillGuide();
  20202. if (guide == 0)
  20203. rand = 1;
  20204. xGame.common.bigMoveLevelIndex = rand;
  20205. }
  20206. else if (xGame.common.gameMode == GameMode.placeBall) {
  20207. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20208. this.ui.c1.selectedIndex = 1 + data.type;
  20209. this.ui.alpha = 1;
  20210. this.startGame();
  20211. }
  20212. this.updateMode();
  20213. this.initD3world();
  20214. this.initD2world();
  20215. }
  20216. startGame() {
  20217. this.ui.snowNode.visible = Math.random() <= 0.1;
  20218. this.ui.d2Node.visible = false;
  20219. xGame.common.d3World.d3Hand.gameObj.active = false;
  20220. xGame.common.d3World.tableSrc.init();
  20221. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20222. this.cameraViewChange(() => {
  20223. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20224. switch (xGame.common.gameMode) {
  20225. case GameMode.classic:
  20226. xGame.common.d3World.d3Hand.gameObj.active = true;
  20227. this.playPutBallD3Ani();
  20228. break;
  20229. case GameMode.bigMove:
  20230. this.enterGame();
  20231. Laya.timer.once(500, this, () => {
  20232. this.ui.topNode.middleNode.visible = true;
  20233. this.ui.topNode.middleNode.t0.play();
  20234. });
  20235. break;
  20236. case GameMode.placeBall:
  20237. this.enterGame();
  20238. break;
  20239. default:
  20240. break;
  20241. }
  20242. });
  20243. PlatMgr.showBanner(false);
  20244. }
  20245. enterGame() {
  20246. this.ui.d2Node.visible = true;
  20247. xGame.common.d3World.d3Hand.gameObj.active = false;
  20248. xGame.common.showOneCamera("mainCamera");
  20249. Moyu.recordGame(30, true);
  20250. if (!this.isPrePlay) {
  20251. this.isPrePlay = true;
  20252. xGame.common.d3World.prePlayEft();
  20253. }
  20254. xGame.common.gameMgr.gameReady();
  20255. this.openAllEvent();
  20256. this.ui.snowNode.visible = false;
  20257. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20258. this.ui.helpBtn.visible = condition;
  20259. }
  20260. showHelpLineGuide() {
  20261. let longGuide = DataMgr.getGuideHelpLine();
  20262. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20263. this.ui.helpBtn.visible = true;
  20264. this.ui.guideNode.visible = true;
  20265. }
  20266. }
  20267. setTurnAlpha(alpha) {
  20268. this.ui.keduNode.alpha = alpha;
  20269. this.ui.ganNode.alpha = alpha;
  20270. this.ui.rodMethodNode.alpha = alpha;
  20271. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20272. }
  20273. cameraViewChange(callback) {
  20274. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20275. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20276. xGame.common.showOneCamera("visitAngle");
  20277. cameraSrc.localRotationEulerY = 180;
  20278. cameraSrc.localRotationEulerZ = 0;
  20279. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20280. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20281. callback && callback();
  20282. }));
  20283. }));
  20284. }
  20285. playPutBallD3Ani() {
  20286. xGame.common.showOneCamera("mainCamera");
  20287. let handSrc = xGame.common.d3World.d3Hand;
  20288. handSrc.gameObj.active = true;
  20289. handSrc.transform.localPositionZ = 3;
  20290. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20291. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20292. handSrc.gameObj.active = false;
  20293. this.enterGame();
  20294. }), 400);
  20295. }));
  20296. }
  20297. updateHead() {
  20298. let user = Moyu.getUserInfo();
  20299. this.ui.topNode.selfNameTxt.text = user.nickName;
  20300. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20301. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20302. if (DataMgr.getSkillGuide() < 1) {
  20303. this.ui.topNode.aiNameTxt.text = 'billiards';
  20304. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20305. }
  20306. else {
  20307. this.ui.topNode.aiNameTxt.text = aiData.name;
  20308. let randNo = Math.floor(Math.random() * 10) + 1;
  20309. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20310. }
  20311. }
  20312. initD2world() {
  20313. let node = this.ui.d2Root.displayObject;
  20314. let src = node.getComponent(D2World);
  20315. if (!src) {
  20316. xGame.common.d2World = node.addComponent(D2World);
  20317. }
  20318. xGame.common.d2World.initSelf();
  20319. }
  20320. initD3world() {
  20321. if (this.isD3Inited)
  20322. return;
  20323. this.isD3Inited = true;
  20324. let scene3D = xGame.common.d3Scene;
  20325. this.ui.d3Root.displayObject.addChild(scene3D);
  20326. scene3D.active = true;
  20327. xGame.common.d3World.tableSrc.setBorderPos();
  20328. }
  20329. onRootMove(e) {
  20330. let rootBall = xGame.common.d2World.rootBall;
  20331. this.ui.moveNode.x = e.x;
  20332. this.ui.moveNode.y = e.y;
  20333. rootBall.gameObj.x = e.x;
  20334. rootBall.gameObj.y = e.y;
  20335. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20336. }
  20337. aiRootMove(move) {
  20338. if (move)
  20339. this.hideBallUI();
  20340. else {
  20341. this.showBallUI();
  20342. xGame.common.d2World.getHelpLine();
  20343. }
  20344. }
  20345. aiForce(type, force = 0) {
  20346. this.pressTarget = PressType.powerNode;
  20347. if (type == 1)
  20348. this.onEventUp({ force: true });
  20349. else if (type == 2)
  20350. this.onEventMove({ stageY: force, force: true });
  20351. }
  20352. onEventPress(e) {
  20353. if (e.stopPropagation)
  20354. e.stopPropagation();
  20355. if (!this.isTurnSelf())
  20356. return;
  20357. let target = e.target;
  20358. switch (target) {
  20359. case this.ui.myPowerNode.displayObject:
  20360. this.pressTarget = PressType.powerNode;
  20361. this.barInfo.curY = e.stageY;
  20362. this.updateBarInfo();
  20363. break;
  20364. case this.ui.moveNode.displayObject:
  20365. this.pressTarget = PressType.moveNode;
  20366. this.hideBallUI();
  20367. this.eventObj.curX = this.ui.moveNode.x;
  20368. this.eventObj.curY = this.ui.moveNode.y;
  20369. this.ui.moveNode.finger.visible = false;
  20370. this.eventObj.lastX = e.stageX;
  20371. this.eventObj.lastY = e.stageY;
  20372. break;
  20373. case this.ui.rulerClickNode.displayObject:
  20374. this.pressTarget = PressType.rulerNode;
  20375. this.eventObj.lastY = e.stageY;
  20376. break;
  20377. case this.ui.d2Root.displayObject:
  20378. this.pressTarget = PressType.d2Root;
  20379. this.eventObj.lastX = e.stageX;
  20380. this.eventObj.lastY = e.stageY;
  20381. this.eventObj.starX = e.stageX;
  20382. this.eventObj.starY = e.stageY;
  20383. this.eventObj.curX = 0;
  20384. this.eventObj.curY = 0;
  20385. xGame.common.d2World.d2Gan.setGanLastInfo();
  20386. this.rulerOffset = 0;
  20387. break;
  20388. default:
  20389. break;
  20390. }
  20391. }
  20392. onEventMove(e) {
  20393. if (e.stopPropagation)
  20394. e.stopPropagation();
  20395. if (e && e.force) {
  20396. }
  20397. else {
  20398. if (!this.isTurnSelf())
  20399. return;
  20400. }
  20401. switch (this.pressTarget) {
  20402. case PressType.powerNode:
  20403. this.barInfo.curY = e.stageY;
  20404. this.updateBarInfo();
  20405. this.isMoveRod = true;
  20406. break;
  20407. case PressType.moveNode:
  20408. let rootBall = xGame.common.d2World.rootBall;
  20409. let radius = rootBall.gameObj.width / 2;
  20410. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20411. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20412. let border = xGame.common.d2World.borderRect;
  20413. if (curX <= border.x + radius)
  20414. curX = border.x + radius;
  20415. else if (curX >= border.x + border.width - radius)
  20416. curX = border.x + border.width - radius;
  20417. if (curY <= border.y + radius)
  20418. curY = border.y + radius;
  20419. else if (curY >= border.y + border.height - radius)
  20420. curY = border.y + border.height - radius;
  20421. if (xGame.common.gameMgr.isOpenBall) {
  20422. if (curX >= border.x + border.openBallW - radius)
  20423. curX = border.x + border.openBallW - radius;
  20424. }
  20425. this.ui.moveNode.x = curX;
  20426. this.ui.moveNode.y = curY;
  20427. rootBall.gameObj.x = curX;
  20428. rootBall.gameObj.y = curY;
  20429. rootBall.d3BallSrc.setTransPos(curX, curY);
  20430. this.isMoveRod = true;
  20431. break;
  20432. case PressType.rulerNode:
  20433. let yy = e.stageY - this.eventObj.lastY;
  20434. this.eventObj.lastY = e.stageY;
  20435. let ruler1 = this.ui.rulerNode.img1;
  20436. let ruler2 = this.ui.rulerNode.img2;
  20437. ruler1.y += yy;
  20438. ruler2.y += yy;
  20439. this.rulerOffset += yy;
  20440. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20441. this.rulerOffset = 0;
  20442. xGame.soundMgr.playSound("inch", 1, 10);
  20443. }
  20444. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20445. let h = ruler1.height;
  20446. this.checkGuide();
  20447. this.isMoveRod = true;
  20448. if (ruler1.y >= h) {
  20449. ruler1.y = -h;
  20450. ruler2.y = 0;
  20451. return;
  20452. }
  20453. else if (ruler1.y <= -h) {
  20454. ruler1.y = h;
  20455. ruler2.y = 0;
  20456. return;
  20457. }
  20458. if (ruler2.y >= h) {
  20459. ruler2.y = -h;
  20460. ruler1.y = 0;
  20461. return;
  20462. }
  20463. else if (ruler2.y <= -h) {
  20464. ruler2.y = h;
  20465. ruler1.y = 0;
  20466. return;
  20467. }
  20468. break;
  20469. case PressType.d2Root:
  20470. this.eventObj.curX = e.stageX;
  20471. this.eventObj.curY = e.stageY;
  20472. let offset = this.checkRodMoveDir();
  20473. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20474. this.eventObj.lastX = e.stageX;
  20475. this.eventObj.lastY = e.stageY;
  20476. break;
  20477. default:
  20478. break;
  20479. }
  20480. }
  20481. onEventUp(e) {
  20482. if (e.stopPropagation)
  20483. e.stopPropagation();
  20484. if (e && e.force) {
  20485. }
  20486. else {
  20487. if (!this.isTurnSelf())
  20488. return;
  20489. }
  20490. switch (this.pressTarget) {
  20491. case PressType.powerNode:
  20492. this.ui.powerNode.value = 0;
  20493. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20494. this.ui.powerTxt.text = "";
  20495. if (this.powerNum > 0) {
  20496. xGame.eventMgr.event(BALL_SHOOT);
  20497. xGame.common.d2World.shoot(this.powerNum);
  20498. xGame.common.d2World.d2Gan.shoot();
  20499. xGame.common.d2World.d2HelpLine.shoot();
  20500. this.finishGuide();
  20501. this.ui.powerEft.visible = false;
  20502. this.ui.colorNode.visible = false;
  20503. let ganStr = "";
  20504. if (this.powerNum <= 30) {
  20505. ganStr = "gan_30";
  20506. }
  20507. else if (this.powerNum <= 60) {
  20508. ganStr = "gan_50";
  20509. }
  20510. else {
  20511. ganStr = "gan_80";
  20512. }
  20513. xGame.soundMgr.playSound(ganStr);
  20514. }
  20515. break;
  20516. case PressType.moveNode:
  20517. let rootBall = xGame.common.d2World.rootBall;
  20518. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20519. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20520. let isIntersect = this.judgeBallIntersect();
  20521. if (isIntersect) {
  20522. this.ui.moveNode.x = lastX;
  20523. this.ui.moveNode.y = lastY;
  20524. rootBall.gameObj.x = lastX;
  20525. rootBall.gameObj.y = lastY;
  20526. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20527. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20528. }
  20529. else {
  20530. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20531. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20532. }
  20533. this.showBallUI();
  20534. this.ui.moveNode.finger.visible = true;
  20535. xGame.common.d2World.getHelpLine();
  20536. break;
  20537. case PressType.rulerNode:
  20538. break;
  20539. case PressType.d2Root:
  20540. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20541. if (dis <= 25) {
  20542. this.moveToClickDot(e);
  20543. }
  20544. break;
  20545. default:
  20546. break;
  20547. }
  20548. this.pressTarget = -1;
  20549. }
  20550. checkGuide() {
  20551. let guide = DataMgr.getSkillGuide();
  20552. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20553. xGame.common.guideStep++;
  20554. xGame.common.gameUI.ui.guide2.visible = false;
  20555. xGame.common.gameUI.ui.guide3.visible = true;
  20556. }
  20557. }
  20558. finishGuide() {
  20559. let guide = DataMgr.getSkillGuide();
  20560. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20561. xGame.common.guideStep = 10;
  20562. this.closeAllGuide();
  20563. console.log('zh: 新手引导完毕');
  20564. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20565. }
  20566. }
  20567. closeAllGuide() {
  20568. xGame.common.gameUI.ui.guide1.visible = false;
  20569. xGame.common.gameUI.ui.guide2.visible = false;
  20570. xGame.common.gameUI.ui.guide3.visible = false;
  20571. }
  20572. updateBarInfo() {
  20573. let star = this.ui.powerNode.y;
  20574. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20575. if (rate >= 1)
  20576. rate = 1;
  20577. if (rate <= 0)
  20578. rate = 0;
  20579. this.powerNum = Math.ceil(rate * 100);
  20580. this.ui.powerNode.value = this.powerNum;
  20581. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20582. this.ui.colorNode.value = this.powerNum;
  20583. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20584. this.ui.powerEft.visible = this.powerNum != 0;
  20585. this.ui.colorNode.visible = this.powerNum != 0;
  20586. this.ui.powerTxt.text = this.powerNum + "";
  20587. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20588. }
  20589. forceCancel() {
  20590. this.ui.powerNode.value = 0;
  20591. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20592. this.ui.powerTxt.text = "";
  20593. }
  20594. checkRodMoveDir() {
  20595. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20596. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20597. if (tempX >= 0 && tempY <= 0) {
  20598. return this.checkDir();
  20599. }
  20600. else if (tempX < 0 && tempY < 0) {
  20601. return this.checkDir(1, -1);
  20602. }
  20603. else if (tempX < 0 && tempY > 0) {
  20604. return this.checkDir(-1, -1);
  20605. }
  20606. else {
  20607. return this.checkDir(-1, 1);
  20608. }
  20609. }
  20610. checkDir(flagX = 1, flagY = 1) {
  20611. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20612. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20613. if (offsetY == 0) {
  20614. return offsetX * flagX;
  20615. }
  20616. if (offsetX == 0) {
  20617. return offsetY * flagY;
  20618. }
  20619. let angle = offsetY / offsetX;
  20620. if (Math.abs(angle) >= 1) {
  20621. return offsetY * flagY;
  20622. }
  20623. else {
  20624. return offsetX * flagX;
  20625. }
  20626. }
  20627. judgeBallIntersect() {
  20628. let rootBall = xGame.common.d2World.rootBall;
  20629. let ballArr = xGame.common.d2World.ballArr;
  20630. let radius = rootBall.gameObj.width / 2;
  20631. let temp;
  20632. let isIntersect = false;
  20633. for (let index = 0; index < ballArr.length; index++) {
  20634. temp = ballArr[index];
  20635. if (temp.number == rootBall.number)
  20636. continue;
  20637. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20638. if (isIntersect) {
  20639. break;
  20640. }
  20641. }
  20642. return isIntersect;
  20643. }
  20644. hideBallUI() {
  20645. let d2Gan = xGame.common.d2World.d2Gan;
  20646. if (!d2Gan.ui.isDisposed)
  20647. d2Gan.ui.visible = false;
  20648. let d2Help = xGame.common.d2World.d2HelpLine;
  20649. if (!d2Help.ui.isDisposed)
  20650. d2Help.ui.visible = false;
  20651. let rootBall = xGame.common.d2World.rootBall;
  20652. if (!rootBall.destroyed) {
  20653. rootBall.gameObj.active = false;
  20654. }
  20655. }
  20656. showBallUI() {
  20657. let d2Gan = xGame.common.d2World.d2Gan;
  20658. if (!d2Gan.ui.isDisposed)
  20659. d2Gan.ui.visible = true;
  20660. let d2Help = xGame.common.d2World.d2HelpLine;
  20661. if (!d2Help.ui.isDisposed)
  20662. d2Help.ui.visible = true;
  20663. let rootBall = xGame.common.d2World.rootBall;
  20664. if (!rootBall.destroyed) {
  20665. rootBall.gameObj.active = true;
  20666. }
  20667. }
  20668. moveToClickDot(e) {
  20669. if (!this.isMoveRod && !xGame.common.clickedBall) {
  20670. let root = xGame.common.d2World.rootBall.gameObj;
  20671. let xx = e.stageX - xGame.common.sysOffestNum;
  20672. let yy = e.stageY;
  20673. let x = xx - root.x;
  20674. let y = yy - root.y;
  20675. let angle = xGame.common.getfguiRotation(x, y);
  20676. xGame.common.d2World.d2Gan.ui.rotation = angle;
  20677. xGame.common.d2World.getHelpLine();
  20678. }
  20679. this.isMoveRod = false;
  20680. xGame.common.clickedBall = false;
  20681. }
  20682. openAllEvent() {
  20683. this.closeAllEvent();
  20684. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20685. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20686. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20687. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20688. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20689. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20690. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20691. }
  20692. closeAllEvent() {
  20693. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20694. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20695. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20696. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  20697. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  20698. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  20699. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  20700. }
  20701. resetGame() {
  20702. this.closeAllEvent();
  20703. this.hideBallUI();
  20704. xGame.common.gameMgr.gamePause = true;
  20705. }
  20706. }
  20707. UIGame$1.uiName = "UIGame";
  20708. class UIAddCoin$1 extends UIBase {
  20709. constructor() {
  20710. super();
  20711. this.coinNum = 2000;
  20712. }
  20713. onConstructor() {
  20714. this.ui = ui_UIAddCoin.createInstance();
  20715. this.contentPane = this.ui;
  20716. this.isEject = false;
  20717. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20718. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  20719. }
  20720. show() {
  20721. super.show();
  20722. this.ui.t0.play();
  20723. this.setGlobalFont(this.ui);
  20724. }
  20725. videoAddCoin() {
  20726. console.log('zh:qjff_AD_for_UIAddCoin');
  20727. if (Laya.Browser.onAndroid) {
  20728. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20729. if (!boo) {
  20730. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20731. return;
  20732. }
  20733. }
  20734. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  20735. }
  20736. else {
  20737. console.log('zh:AD 失败,直接发放奖励');
  20738. this.qjff_AD_for_UIAddCoin();
  20739. }
  20740. }
  20741. qjff_AD_for_UIAddCoin() {
  20742. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  20743. this.hide();
  20744. }
  20745. }
  20746. UIAddCoin$1.uiName = "UIAddCoin";
  20747. class UIInvitation$1 extends UIBase {
  20748. constructor() {
  20749. super();
  20750. }
  20751. onConstructor() {
  20752. this.ui = ui_UIInvitation.createInstance();
  20753. this.contentPane = this.ui;
  20754. this.isEject = false;
  20755. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  20756. }
  20757. show() {
  20758. super.show();
  20759. this.setGlobalFont(this.ui);
  20760. }
  20761. enterGame() {
  20762. xGame.common.gameMode = GameMode.classic;
  20763. DataMgr.setChallengeTimes(1);
  20764. xGame.common.passAwardCoin = 2000;
  20765. let need = xGame.common.classicNiceNeddCoin;
  20766. if (DataMgr.coinEnough(need)) {
  20767. DataMgr.setCoin(-need);
  20768. xGame.eventMgr.event(RESTART_GAME, true);
  20769. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  20770. }
  20771. else {
  20772. xGame.eventMgr.event(RESTART_GAME, true);
  20773. }
  20774. this.hide();
  20775. }
  20776. hide() {
  20777. super.hide();
  20778. }
  20779. }
  20780. UIInvitation$1.uiName = "UIInvitation";
  20781. class UIPower$1 extends UIBase {
  20782. constructor() {
  20783. super();
  20784. }
  20785. onConstructor() {
  20786. this.ui = ui_UIPower.createInstance();
  20787. this.contentPane = this.ui;
  20788. this.isEject = false;
  20789. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  20790. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  20791. }
  20792. show() {
  20793. super.show();
  20794. this.ui.t0.play();
  20795. this.setGlobalFont(this.ui);
  20796. }
  20797. videoGetPower() {
  20798. console.log('zh:qjff_AD_for_uipower');
  20799. if (Laya.Browser.onAndroid) {
  20800. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20801. if (!boo) {
  20802. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20803. return;
  20804. }
  20805. }
  20806. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  20807. }
  20808. else {
  20809. console.log('zh:AD 失败,直接发放奖励');
  20810. this.qjff_AD_for_uipower();
  20811. }
  20812. }
  20813. qjff_AD_for_uipower() {
  20814. DataMgr.setPower(xGame.common.videoPower, true);
  20815. xGame.eventMgr.event(POWER_TIME);
  20816. this.hide();
  20817. }
  20818. }
  20819. UIPower$1.uiName = "UIPower";
  20820. class UIGameEnd$1 extends UIBase {
  20821. constructor() {
  20822. super();
  20823. this.success = false;
  20824. this.awardCoinNum = 1000;
  20825. this.awardDiamondNum = 10;
  20826. }
  20827. onConstructor() {
  20828. this.ui = ui_UIGameEnd.createInstance();
  20829. this.contentPane = this.ui;
  20830. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  20831. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  20832. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  20833. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  20834. this.ui.talkNode.visible = false;
  20835. if (Moyu.isKs)
  20836. this.ui.closeNode.closeBtn.x += 100;
  20837. }
  20838. updateType() {
  20839. switch (xGame.common.gameMode) {
  20840. case GameMode.classic:
  20841. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20842. this.ui.coinNode.visible = this.success;
  20843. if (!this.success) {
  20844. Laya.timer.once(500, this, () => {
  20845. xGame.uiMgr.Show(UIAddCoin$1);
  20846. });
  20847. }
  20848. else {
  20849. this.logEventForClassic_win();
  20850. }
  20851. this.logEventForClassic_complete();
  20852. this.ui.isGetAward.visible = false;
  20853. this.ui.leftBtn.c1.selectedIndex = 3;
  20854. this.ui.rightBtn.c1.selectedIndex = 0;
  20855. this.moneyNode.ui.c1.selectedIndex = 1;
  20856. break;
  20857. case GameMode.bigMove:
  20858. console.log('zh:招法模式 aaaaaa bigMove');
  20859. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  20860. this.ui.coinNode.visible = this.success;
  20861. if (xGame.common.gameMode == GameMode.bigMove) {
  20862. if (this.success) {
  20863. DataMgr.setSkillSuccessTimes(1, true);
  20864. DataMgr.setSkillAccTimes(1);
  20865. }
  20866. else {
  20867. DataMgr.setSkillSuccessTimes(0, false);
  20868. }
  20869. }
  20870. this.logEventForRod_complete_N();
  20871. if (!this.success) {
  20872. Laya.timer.once(500, this, () => {
  20873. xGame.uiMgr.Show(UIAddCoin$1);
  20874. });
  20875. }
  20876. else {
  20877. this.logEventForRod_win();
  20878. }
  20879. this.ui.isGetAward.visible = false;
  20880. this.ui.leftBtn.c1.selectedIndex = 3;
  20881. this.ui.rightBtn.c1.selectedIndex = 0;
  20882. this.moneyNode.ui.c1.selectedIndex = 1;
  20883. break;
  20884. case GameMode.placeBall:
  20885. this.ui.coinNode.visible = false;
  20886. if (this.success) {
  20887. if (xGame.common.placeBallStarNum == 3) {
  20888. this.ui.c1.selectedIndex = 2;
  20889. }
  20890. else {
  20891. this.ui.c1.selectedIndex = 3;
  20892. }
  20893. let level = xGame.common.placeBallCurLevel;
  20894. if (level > 59) {
  20895. this.logEventForChallenge_level_complete(level);
  20896. }
  20897. else {
  20898. this.logEventForChallenge_level_N(level);
  20899. }
  20900. }
  20901. else {
  20902. this.ui.c1.selectedIndex = 4;
  20903. }
  20904. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20905. if (cfg.type == PlaceBallType.challenge) {
  20906. this.ui.c1.selectedIndex = 2;
  20907. }
  20908. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  20909. this.updatePlaceBallBtn();
  20910. this.updatePlaceBallStarNum();
  20911. this.updatePlaceBallAwardState();
  20912. this.moneyNode.ui.c1.selectedIndex = 2;
  20913. this.moneyNode.checkPowerTime();
  20914. this.moneyNode.powerChange();
  20915. DataMgr.upRankData();
  20916. break;
  20917. default:
  20918. break;
  20919. }
  20920. }
  20921. logEventForRod_complete_N() {
  20922. let gfmsIdx = xGame.common.curPlayerSkillType;
  20923. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  20924. let gfmc = 'Skyfall Shot';
  20925. if (gfmsIdx == 0) {
  20926. gfmc = 'Skyfall Shot';
  20927. }
  20928. if (gfmsIdx == 1) {
  20929. gfmc = 'Surging break';
  20930. }
  20931. if (gfmsIdx == 2) {
  20932. gfmc = 'Frost Lock';
  20933. }
  20934. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20935. console.log('zh:logEventForRod_complete_N level = ' + level);
  20936. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  20937. let jsonStr = {
  20938. "count": 0,
  20939. "name": gfmc
  20940. };
  20941. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20942. const d = LocalStorageManager.getItem(keyStr);
  20943. jsonStr.count = d.count + 1;
  20944. LocalStorageManager.setItem(keyStr, jsonStr);
  20945. }
  20946. else {
  20947. LocalStorageManager.setItem(keyStr, jsonStr);
  20948. }
  20949. const d2 = LocalStorageManager.getItem(keyStr);
  20950. let count = d2.count;
  20951. console.log('zh:logEventForRod_complete_N count = ' + count);
  20952. if (count % 5 == 0) {
  20953. const reqStr = JSON.stringify(jsonStr);
  20954. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  20955. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  20956. }
  20957. }
  20958. logEventForRod_win() {
  20959. console.log('zh:logEventForRod_win,胜利');
  20960. let gfmsIdx = xGame.common.curPlayerSkillType;
  20961. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  20962. let gfmc = 'Skyfall Shot';
  20963. if (gfmsIdx == 0) {
  20964. gfmc = 'Skyfall Shot';
  20965. }
  20966. if (gfmsIdx == 1) {
  20967. gfmc = 'Surging break';
  20968. }
  20969. if (gfmsIdx == 2) {
  20970. gfmc = 'Frost Lock';
  20971. }
  20972. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  20973. console.log('zh:logEventForRod_win level = ' + level);
  20974. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  20975. let jsonStr = {
  20976. "count": 1,
  20977. "name": gfmc + ' Lev' + level
  20978. };
  20979. if (LocalStorageManager.hasJosnKey(keyStr)) {
  20980. const d = LocalStorageManager.getItem(keyStr);
  20981. jsonStr.count = d.count + 1;
  20982. LocalStorageManager.setItem(keyStr, jsonStr);
  20983. }
  20984. else {
  20985. LocalStorageManager.setItem(keyStr, jsonStr);
  20986. }
  20987. const reqStr = JSON.stringify(jsonStr);
  20988. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  20989. }
  20990. logEventForClassic_win() {
  20991. console.log('zh:logEventForClassic_win,胜利');
  20992. let rtype = xGame.common.classicRoomType;
  20993. let msmc = '';
  20994. if (rtype == 1) {
  20995. msmc = 'beginner';
  20996. }
  20997. if (rtype == 2) {
  20998. msmc = 'expert';
  20999. }
  21000. if (rtype == 3) {
  21001. msmc = 'master';
  21002. }
  21003. let keyStr = 'sjmd_classic_win_' + rtype;
  21004. let jsonStr = {
  21005. "difficulty": msmc,
  21006. "classic_count": 1,
  21007. "difficulty_count": 1
  21008. };
  21009. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21010. const d = LocalStorageManager.getItem(keyStr);
  21011. jsonStr.classic_count = d.classic_count + 1;
  21012. jsonStr.difficulty_count = d.difficulty_count + 1;
  21013. LocalStorageManager.setItem(keyStr, jsonStr);
  21014. }
  21015. else {
  21016. LocalStorageManager.setItem(keyStr, jsonStr);
  21017. }
  21018. const reqStr = JSON.stringify(jsonStr);
  21019. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  21020. }
  21021. logEventForClassic_complete() {
  21022. console.log('zh:logEventForClassic_complete,胜利');
  21023. let rtype = xGame.common.classicRoomType;
  21024. let msmc = '';
  21025. if (rtype == 1) {
  21026. msmc = 'beginner';
  21027. }
  21028. if (rtype == 2) {
  21029. msmc = 'expert';
  21030. }
  21031. if (rtype == 3) {
  21032. msmc = 'master';
  21033. }
  21034. let keyStr = 'sjmd_classic_complete_' + rtype;
  21035. let jsonStr = {
  21036. "msmc": msmc,
  21037. "count": 0
  21038. };
  21039. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21040. const d = LocalStorageManager.getItem(keyStr);
  21041. jsonStr.count = d.count + 1;
  21042. LocalStorageManager.setItem(keyStr, jsonStr);
  21043. }
  21044. else {
  21045. LocalStorageManager.setItem(keyStr, jsonStr);
  21046. }
  21047. if (jsonStr.count % 5 == 0) {
  21048. const reqStr = JSON.stringify(jsonStr);
  21049. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  21050. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  21051. }
  21052. }
  21053. updatePlaceBallBtn() {
  21054. this.ui.leftBtn.c1.selectedIndex = 5;
  21055. if (this.success) {
  21056. this.ui.rightBtn.c1.selectedIndex = 14;
  21057. }
  21058. else {
  21059. if (xGame.common.placeBallStarNum == 3) {
  21060. this.ui.rightBtn.c1.selectedIndex = 14;
  21061. }
  21062. else {
  21063. this.ui.rightBtn.c1.selectedIndex = 1;
  21064. }
  21065. }
  21066. }
  21067. updatePlaceBallStarNum() {
  21068. let starNum = xGame.common.placeBallStarNum;
  21069. if (starNum == 0)
  21070. this.ui.starNumNode.c1.selectedIndex = 3;
  21071. else {
  21072. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  21073. }
  21074. }
  21075. updatePlaceBallAwardState() {
  21076. let level = xGame.common.placeBallCurLevel;
  21077. let starNum = xGame.common.placeBallStarNum;
  21078. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21079. let data = cfgTable.placeballData[level].award;
  21080. let cfg = cfgTable.placeballData[level];
  21081. this.awardDiamondNum = data[1];
  21082. this.awardCoinNum = data[0];
  21083. if (cfg.type == PlaceBallType.challenge) {
  21084. this.awardDiamondNum = 0;
  21085. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21086. }
  21087. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  21088. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  21089. if (cfg.type == PlaceBallType.challenge) {
  21090. this.ui.awardNode.coinNode.visible = true;
  21091. }
  21092. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  21093. this.ui.awardNode.diamondNode.x = 265;
  21094. this.ui.awardNode.coinNode.x = 354;
  21095. }
  21096. else {
  21097. this.ui.awardNode.diamondNode.x = 291;
  21098. this.ui.awardNode.coinNode.x = 291;
  21099. }
  21100. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  21101. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  21102. if (this.awardCoinNum == 0) {
  21103. this.ui.awardNode.coinNode.numTxt.text = "";
  21104. }
  21105. if (getAward) {
  21106. this.ui.isGetAward.visible = true;
  21107. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21108. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21109. }
  21110. else {
  21111. this.ui.isGetAward.visible = false;
  21112. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21113. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21114. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21115. }
  21116. else {
  21117. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21118. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21119. }
  21120. }
  21121. }
  21122. show(success) {
  21123. super.show();
  21124. xGame.eventMgr.event(RESET_GAME);
  21125. this.success = success;
  21126. Laya.timer.clearAll(this);
  21127. this.playSecretaryAni();
  21128. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21129. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21130. offsetTime = Math.floor(offsetTime / 1000);
  21131. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21132. this.updateType();
  21133. Laya.timer.once(200, this, () => {
  21134. this.addAward(() => {
  21135. this.updateType();
  21136. Laya.timer.once(500, this, () => {
  21137. this.showChallengeLevel();
  21138. });
  21139. });
  21140. });
  21141. if (this.success) {
  21142. JSBridgeUtils.instance.showInternAd('gameend_success');
  21143. console.log('zh:game end 成功');
  21144. xGame.soundMgr.playSound('slots_roll01');
  21145. xGame.soundMgr.playSound("s_win");
  21146. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21147. this.diyGameDataUtilForGameWin();
  21148. this.updateGamePlaceBallData2Server();
  21149. }
  21150. else {
  21151. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21152. console.log('zh:game end失败');
  21153. xGame.soundMgr.playSound('matchwin01');
  21154. xGame.soundMgr.playSound("s_lose");
  21155. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21156. }
  21157. console.log('zh:开始弹出福利框2个');
  21158. Laya.timer.once(1000, this, () => {
  21159. console.log('zh: 1秒后 showFuLiSp1');
  21160. DataMgr.checkForShowFuLi17AndAlert(1);
  21161. });
  21162. let challengeNum = DataMgr.getChallengeTimes();
  21163. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21164. DataMgr.setChallengeTimes(1);
  21165. }
  21166. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21167. DataMgr.setClassicTimes();
  21168. }
  21169. this.setGlobalFont(this.ui);
  21170. }
  21171. diyGameDataUtilForGameWin() {
  21172. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21173. switch (xGame.common.gameMode) {
  21174. case GameMode.classic:
  21175. console.log('zh:DiyGameDataUtilForGameWin 111');
  21176. case GameMode.bigMove:
  21177. console.log('zh:DiyGameDataUtilForGameWin 222');
  21178. this.restartGame();
  21179. break;
  21180. case GameMode.placeBall:
  21181. console.log('zh:DiyGameDataUtilForGameWin 333');
  21182. var level = xGame.common.placeBallCurLevel;
  21183. console.log('zh:练习模式 联系了多少LEV=' + level);
  21184. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21185. if (level > db_over_lev) {
  21186. DataMgr.setChallengeMode_overLev(level);
  21187. }
  21188. break;
  21189. default:
  21190. console.log('zh:DiyGameDataUtilForGameWin 444');
  21191. break;
  21192. }
  21193. }
  21194. updateGamePlaceBallData2Server() {
  21195. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21196. if (userInfo == null) {
  21197. return;
  21198. }
  21199. let pbdObj = DataMgr.getPlaceBallLevelList();
  21200. let reqData = xGame.httpMgr.getReqData();
  21201. let pd = JSON.parse(reqData);
  21202. pd.placeBallData = JSON.stringify(pbdObj);
  21203. reqData = JSON.stringify(pd);
  21204. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21205. try {
  21206. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21207. let code = res.code;
  21208. let msg = res.msg;
  21209. if (code == 401) {
  21210. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21211. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21212. return;
  21213. }
  21214. if (code == 200) {
  21215. let data = res.data;
  21216. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21217. }
  21218. else {
  21219. xGame.uiMgr.Show(UIMsg$1, msg);
  21220. }
  21221. }
  21222. catch (error) {
  21223. console.log('error=' + error);
  21224. alert(error);
  21225. }
  21226. finally {
  21227. }
  21228. });
  21229. }
  21230. showChallengeLevel() {
  21231. if (DataMgr.getChallengeTimes() != 0)
  21232. return;
  21233. let skill = DataMgr.getSkillAccTimes();
  21234. let put = DataMgr.getPlaceBallLevelList().length;
  21235. if (skill >= 3 || put >= 5) {
  21236. xGame.uiMgr.Show(UIInvitation$1);
  21237. this.hide();
  21238. }
  21239. }
  21240. addAward(callback) {
  21241. if (!this.success) {
  21242. callback && callback();
  21243. return;
  21244. }
  21245. switch (xGame.common.gameMode) {
  21246. case GameMode.classic:
  21247. this.awardCoinNum = xGame.common.passAwardCoin;
  21248. this.awardDiamondNum = 0;
  21249. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21250. break;
  21251. case GameMode.bigMove:
  21252. this.awardCoinNum = xGame.common.passAwardCoin;
  21253. this.awardDiamondNum = 0;
  21254. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21255. callback && callback();
  21256. break;
  21257. case GameMode.placeBall:
  21258. let level = xGame.common.placeBallCurLevel;
  21259. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21260. if (xGame.common.placeBallStarNum != 3) {
  21261. callback && callback();
  21262. return;
  21263. }
  21264. else {
  21265. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21266. if (getAward) {
  21267. callback && callback();
  21268. return;
  21269. }
  21270. }
  21271. let cfg = cfgTable.placeballData[level];
  21272. let data = cfgTable.placeballData[level].award;
  21273. this.awardCoinNum = data[0];
  21274. this.awardDiamondNum = data[1];
  21275. if (cfg.type == PlaceBallType.challenge) {
  21276. this.awardDiamondNum = 0;
  21277. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21278. }
  21279. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21280. let diamondAward;
  21281. if (this.awardDiamondNum > 0) {
  21282. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21283. xGame.common.getAward([diamondAward, coinAward], callback);
  21284. }
  21285. else {
  21286. xGame.common.getAward([coinAward], callback);
  21287. }
  21288. if (cfg.type == PlaceBallType.normal) {
  21289. DataMgr.setPlaceBallAward(level);
  21290. }
  21291. break;
  21292. default:
  21293. break;
  21294. }
  21295. }
  21296. playSecretaryAni_old() {
  21297. let parent = this.ui.secretary.displayObject;
  21298. parent.destroyChildren();
  21299. let xx = this.ui.secretary.width / 2;
  21300. let yy = this.ui.secretary.height;
  21301. let scale = xGame.common.getSecretaryScale();
  21302. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21303. if (this.success) {
  21304. let rand = Math.random() <= 0.5 ? 2 : 3;
  21305. xGame.common.secretary.play(data, rand, false, parent, () => {
  21306. xGame.common.secretary.play(data, 1, true, parent);
  21307. });
  21308. }
  21309. else {
  21310. xGame.common.secretary.play(data, 0, true, parent);
  21311. }
  21312. }
  21313. playSecretaryAni() {
  21314. let parent = this.ui.secretary.displayObject;
  21315. parent.destroyChildren();
  21316. let xx = this.ui.secretary.width / 2;
  21317. let yy = this.ui.secretary.height;
  21318. let scale = xGame.common.getSecretaryScale();
  21319. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21320. if (this.success) {
  21321. let rand = 0;
  21322. xGame.common.secretary.play(data, 0, true, parent);
  21323. }
  21324. else {
  21325. xGame.common.secretary.play(data, 0, true, parent);
  21326. }
  21327. }
  21328. restartGame() {
  21329. switch (xGame.common.gameMode) {
  21330. case GameMode.classic:
  21331. xGame.eventMgr.event(RESTART_GAME);
  21332. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21333. break;
  21334. case GameMode.bigMove:
  21335. this.hide();
  21336. xGame.eventMgr.event(RESTART_GAME);
  21337. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21338. break;
  21339. default:
  21340. break;
  21341. }
  21342. }
  21343. hide() {
  21344. super.hide();
  21345. xGame.common.stopGirlPop(this.ui.talkNode);
  21346. PlatMgr.showBanner(false);
  21347. }
  21348. returnHome() {
  21349. this.hide();
  21350. let showFailWords = !this.success;
  21351. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21352. }
  21353. clickLeftBtn() {
  21354. switch (xGame.common.gameMode) {
  21355. case GameMode.classic:
  21356. case GameMode.bigMove:
  21357. this.returnHome();
  21358. break;
  21359. case GameMode.placeBall:
  21360. let level = xGame.common.placeBallCurLevel;
  21361. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21362. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21363. break;
  21364. default:
  21365. break;
  21366. }
  21367. }
  21368. powerStartPlaceBallLevel(level, btn) {
  21369. if (DataMgr.powerEnough()) {
  21370. btn.touchable = false;
  21371. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21372. btn.touchable = true;
  21373. DataMgr.setPower(-1);
  21374. xGame.eventMgr.event(POWER_TIME);
  21375. this.startPlaceBallLevel(level);
  21376. this.logEventForChallenge_level_start(level);
  21377. }));
  21378. }
  21379. else {
  21380. xGame.uiMgr.Show(UIPower$1, 0);
  21381. }
  21382. }
  21383. clickRightBtn() {
  21384. switch (xGame.common.gameMode) {
  21385. case GameMode.classic:
  21386. console.log('zh:clickRightBtn 111');
  21387. case GameMode.bigMove:
  21388. console.log('zh:clickRightBtn 222');
  21389. this.restartGame();
  21390. break;
  21391. case GameMode.placeBall:
  21392. console.log('zh:clickRightBtn 333');
  21393. let level = xGame.common.placeBallCurLevel;
  21394. let data = DataMgr.getPlaceBallLevel(level);
  21395. let curPss = data.play && !data.isCur;
  21396. if (curPss) {
  21397. console.log('zh:clickRightBtn 333-111');
  21398. console.log('zh:当前LV=' + level);
  21399. if (level == 60) {
  21400. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21401. Laya.timer.once(3000, this, () => {
  21402. this.returnHome();
  21403. });
  21404. }
  21405. else {
  21406. let lev = level + 1;
  21407. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21408. }
  21409. }
  21410. else {
  21411. console.log('zh:clickRightBtn 333-000');
  21412. Moyu.sendDataEvent("placeBallNextLevel");
  21413. console.log('zh:qjff_AD_for_uiGameEnd');
  21414. if (Laya.Browser.onAndroid) {
  21415. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21416. if (!boo) {
  21417. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21418. return;
  21419. }
  21420. }
  21421. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21422. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21423. }
  21424. else {
  21425. console.log('zh:AD 失败,直接发放奖励');
  21426. this.qjff_AD_for_uiGameEnd(level);
  21427. }
  21428. }
  21429. break;
  21430. default:
  21431. console.log('zh:clickRightBtn 444');
  21432. break;
  21433. }
  21434. }
  21435. logEventForChallenge_level_start(level) {
  21436. let keyStr = 'sjmd_challenge_level_start';
  21437. let jsonStr = {
  21438. "count": 0,
  21439. "gold_balance ": DataMgr.getCoin(),
  21440. "level": level,
  21441. "diamond_balance ": DataMgr.getDiamond()
  21442. };
  21443. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21444. const d = LocalStorageManager.getItem(keyStr);
  21445. if (level > d.level) {
  21446. jsonStr.count = d.count + 1;
  21447. LocalStorageManager.setItem(keyStr, jsonStr);
  21448. }
  21449. else {
  21450. }
  21451. }
  21452. else {
  21453. LocalStorageManager.setItem(keyStr, jsonStr);
  21454. }
  21455. const reqStr = JSON.stringify(jsonStr);
  21456. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21457. }
  21458. qjff_AD_for_uiGameEnd(level) {
  21459. DataMgr.setPlaceBallLevel(level, 1);
  21460. this.startPlaceBallLevel(level + 1);
  21461. }
  21462. startPlaceBallLevel(level) {
  21463. xGame.common.gameMode = GameMode.placeBall;
  21464. xGame.common.placeBallCurLevel = level;
  21465. xGame.uiMgr.Show(UIGame$1);
  21466. this.hide();
  21467. }
  21468. logEventForChallenge_level_complete(level) {
  21469. let keyStr = 'sjmd_challenge_level_complete';
  21470. let jsonStr = {
  21471. "count": 1,
  21472. "gold_balance ": DataMgr.getCoin(),
  21473. "level": level,
  21474. "diamond_balance ": DataMgr.getDiamond()
  21475. };
  21476. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21477. const d = LocalStorageManager.getItem(keyStr);
  21478. jsonStr.count = d.count + 1;
  21479. LocalStorageManager.setItem(keyStr, jsonStr);
  21480. }
  21481. else {
  21482. LocalStorageManager.setItem(keyStr, jsonStr);
  21483. }
  21484. const reqStr = JSON.stringify(jsonStr);
  21485. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21486. }
  21487. logEventForChallenge_level_N(level) {
  21488. console.log('zh:logEventForChallenge_level_N ' + level);
  21489. let keyStr = 'sjmd_challenge_level_N';
  21490. if (LocalStorageManager.hasKey(keyStr)) {
  21491. let lev = LocalStorageManager.getItem(keyStr);
  21492. if (level > lev) {
  21493. LocalStorageManager.setItem(keyStr, level);
  21494. }
  21495. if ((level) % 5 == 0) {
  21496. console.log('zh:每5关上报1次');
  21497. let sjmc = 'challenge_level_' + level;
  21498. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21499. let sjmcForFirebase = 'challenge_level_' + level;
  21500. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21501. }
  21502. else {
  21503. console.log('zh:5 no 上报');
  21504. }
  21505. }
  21506. else {
  21507. LocalStorageManager.setItem(keyStr, level);
  21508. }
  21509. }
  21510. }
  21511. UIGameEnd$1.uiName = "UIGameEnd";
  21512. class ShowItem$1 {
  21513. constructor() {
  21514. this.ui = ui_ShowItem.createInstance();
  21515. }
  21516. destroySelf() {
  21517. if (!this.ui.isDisposed) {
  21518. this.ui.removeFromParent();
  21519. this.ui.dispose();
  21520. }
  21521. }
  21522. setParent(parent) {
  21523. parent.addChild(this.ui);
  21524. }
  21525. setPos(x, y) {
  21526. this.ui.x = x;
  21527. this.ui.y = y;
  21528. }
  21529. setUrl(index) {
  21530. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21531. }
  21532. }
  21533. class UILevelProp$1 extends UIBase {
  21534. constructor() {
  21535. super();
  21536. this.firstPos = 385;
  21537. this.secondPos = 467;
  21538. this.showItemArr = [];
  21539. }
  21540. onConstructor() {
  21541. this.ui = ui_UILevelProp.createInstance();
  21542. this.contentPane = this.ui;
  21543. this.isEject = false;
  21544. this.addUIClick(this.ui.closeBtn, this.hideWin);
  21545. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21546. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21547. }
  21548. show(level) {
  21549. console.log('zh:show.');
  21550. super.show();
  21551. this.ui.t1.play();
  21552. this.level = level;
  21553. this.data = cfgTable.placeballData[this.level];
  21554. this.updateSelf();
  21555. this.showPreView();
  21556. this.moneyNode.ui.c1.selectedIndex = 2;
  21557. this.moneyNode.checkPowerTime();
  21558. this.moneyNode.powerChange();
  21559. this.setGlobalFont(this.ui);
  21560. }
  21561. showPreView() {
  21562. let item;
  21563. let data;
  21564. for (let index = 0; index < this.showItemArr.length; index++) {
  21565. item = this.showItemArr[index];
  21566. item.destroySelf();
  21567. }
  21568. this.showItemArr = [];
  21569. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21570. for (const key in cfgData) {
  21571. data = cfgData[key];
  21572. item = new ShowItem$1();
  21573. item.setParent(this.ui.myNode.displayRoot);
  21574. item.setPos(data.x, data.y);
  21575. item.setUrl(data.value);
  21576. this.showItemArr.push(item);
  21577. }
  21578. }
  21579. updateSelf() {
  21580. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21581. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21582. if (this.data.ball == -1) {
  21583. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21584. }
  21585. else {
  21586. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21587. }
  21588. let localData = DataMgr.getPlaceBallLevel(this.level);
  21589. let getAward = localData.getAward;
  21590. let cfg = cfgTable.placeballData[this.level];
  21591. let coin = this.data.award[0];
  21592. let diamond = this.data.award[1];
  21593. if (cfg.type == PlaceBallType.challenge) {
  21594. diamond = 0;
  21595. coin = 100;
  21596. }
  21597. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21598. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21599. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21600. if (cfg.type == PlaceBallType.challenge) {
  21601. this.ui.myNode.coinNode.numTxt.text = "";
  21602. }
  21603. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21604. if (coin > 0 && diamond > 0) {
  21605. this.ui.myNode.diamondNode.x = 385;
  21606. this.ui.myNode.coinNode.x = 467;
  21607. }
  21608. else {
  21609. this.ui.myNode.diamondNode.x = 385;
  21610. this.ui.myNode.coinNode.x = 385;
  21611. }
  21612. if (!getAward) {
  21613. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21614. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21615. }
  21616. else {
  21617. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21618. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21619. }
  21620. }
  21621. startGame() {
  21622. console.log("zh:startGame");
  21623. if (DataMgr.powerEnough()) {
  21624. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21625. this.ui.myNode.startBtn.touchable = false;
  21626. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21627. console.log('zh:startGame dh ');
  21628. this.ui.myNode.startBtn.touchable = true;
  21629. DataMgr.setPower(-1);
  21630. xGame.eventMgr.event(POWER_TIME);
  21631. xGame.common.gameMode = GameMode.placeBall;
  21632. xGame.common.placeBallCurLevel = this.level;
  21633. xGame.uiMgr.Show(UIGame$1);
  21634. xGame.uiMgr.Hide(UILevelDisplay$1);
  21635. xGame.uiMgr.Hide(UIMain$1);
  21636. this.logEventForChallenge_level_start(this.level);
  21637. this.hideWin();
  21638. }));
  21639. console.log('zh:eeeee');
  21640. }
  21641. else {
  21642. console.log('zh:powerEnough 不足 =' + DataMgr.powerEnough());
  21643. xGame.uiMgr.Show(UIPower$1);
  21644. }
  21645. }
  21646. logEventForChallenge_level_start(level) {
  21647. let keyStr = 'sjmd_challenge_level_start';
  21648. let jsonStr = {
  21649. "count": 1,
  21650. "gold_balance ": DataMgr.getCoin(),
  21651. "level": level,
  21652. "diamond_balance ": DataMgr.getDiamond()
  21653. };
  21654. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21655. const d = LocalStorageManager.getItem(keyStr);
  21656. if (level > d.level) {
  21657. jsonStr.count = d.count + 1;
  21658. LocalStorageManager.setItem(keyStr, jsonStr);
  21659. }
  21660. else {
  21661. }
  21662. }
  21663. else {
  21664. LocalStorageManager.setItem(keyStr, jsonStr);
  21665. }
  21666. const reqStr = JSON.stringify(jsonStr);
  21667. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21668. }
  21669. hideWin() {
  21670. super.hide();
  21671. if (this.ui.myNode.startBtn) {
  21672. this.ui.myNode.startBtn.touchable = true;
  21673. if (this.ui.myNode.startBtn.powerEft.t0) {
  21674. this.ui.myNode.startBtn.powerEft.t0.stop();
  21675. }
  21676. }
  21677. }
  21678. }
  21679. UILevelProp$1.uiName = "UILevelProp";
  21680. class PutBallLevelDisplay$1 {
  21681. constructor(ui, index) {
  21682. this.index = 0;
  21683. this.ui = ui;
  21684. this.index = index;
  21685. this.ui.onClick(this, this.clickSelf);
  21686. this.updateSelf();
  21687. this.ui.levelTxt.text = (this.index + 1) + "";
  21688. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  21689. this.ui.special.levelTxt.text = (this.index + 1) + "";
  21690. }
  21691. updateSelf() {
  21692. let level = this.index + 1;
  21693. this.data = DataMgr.getPlaceBallLevel(level);
  21694. this.ui.starNode.c1.selectedIndex = this.data.star;
  21695. let isChallenge = cfgTable.placeballData[level].type;
  21696. if (this.data.isCur) {
  21697. if (isChallenge) {
  21698. this.ui.c1.selectedIndex = 5;
  21699. }
  21700. else {
  21701. this.ui.c1.selectedIndex = 2;
  21702. }
  21703. }
  21704. else {
  21705. if (this.data.play) {
  21706. if (this.data.star == 3) {
  21707. this.ui.c1.selectedIndex = 0;
  21708. }
  21709. else {
  21710. this.ui.c1.selectedIndex = 1;
  21711. }
  21712. }
  21713. else {
  21714. if (isChallenge) {
  21715. this.ui.c1.selectedIndex = 4;
  21716. }
  21717. else {
  21718. this.ui.c1.selectedIndex = 3;
  21719. }
  21720. }
  21721. }
  21722. }
  21723. clickSelf() {
  21724. if (!this.data.play)
  21725. return;
  21726. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21727. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  21728. }
  21729. }
  21730. class UILevelDisplay$1 extends UIBase {
  21731. constructor() {
  21732. super();
  21733. }
  21734. onConstructor() {
  21735. this.ui = ui_UILevelDisplay.createInstance();
  21736. this.contentPane = this.ui;
  21737. this.isEject = false;
  21738. this.myList = this.ui.myNode.myList;
  21739. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  21740. this.levelItemArr = [];
  21741. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  21742. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  21743. this.myList.numItems = levelNum;
  21744. }
  21745. levelItemRender(index, target) {
  21746. let item = new PutBallLevelDisplay$1(target, index);
  21747. this.levelItemArr.push(item);
  21748. }
  21749. show() {
  21750. super.show();
  21751. this.updateLevel();
  21752. this.scrollToPlace();
  21753. this.setGlobalFont(this.ui);
  21754. }
  21755. updateLevel() {
  21756. let temp;
  21757. for (let index = 0; index < this.levelItemArr.length; index++) {
  21758. temp = this.levelItemArr[index];
  21759. temp.updateSelf();
  21760. }
  21761. }
  21762. scrollToPlace() {
  21763. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  21764. let passArr = DataMgr.getPlaceBallLevelList();
  21765. let offest = passArr.length;
  21766. if (offest >= maxNum - 1)
  21767. offest = maxNum - 1;
  21768. this.myList.scrollToView(offest, true, true);
  21769. }
  21770. hide() {
  21771. super.hide();
  21772. }
  21773. }
  21774. UILevelDisplay$1.uiName = "UILevelDisplay";
  21775. class UIMatching$1 extends UIBase {
  21776. constructor() {
  21777. super();
  21778. }
  21779. onConstructor() {
  21780. this.ui = ui_UIMatching.createInstance();
  21781. this.contentPane = this.ui;
  21782. this.isEject = false;
  21783. }
  21784. show(callback) {
  21785. super.show();
  21786. PlatMgr.showBanner(true);
  21787. this.callback = callback;
  21788. let user = Moyu.getUserInfo();
  21789. if (!this.selfPot) {
  21790. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  21791. }
  21792. if (!this.aiPot) {
  21793. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  21794. }
  21795. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  21796. this.ui.selfHead.nameTxt.text = user.nickName;
  21797. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  21798. this.ui.aiHead.nameTxt.text = "???";
  21799. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  21800. this.ui.selfHead.c1.selectedIndex = 0;
  21801. this.ui.aiHead.c1.selectedIndex = 0;
  21802. this.ui.selfHead.x = this.selfPot.x;
  21803. this.ui.selfHead.y = this.selfPot.y;
  21804. this.ui.aiHead.x = this.aiPot.x;
  21805. this.ui.aiHead.y = this.aiPot.y;
  21806. switch (xGame.common.gameMode) {
  21807. case GameMode.classic:
  21808. break;
  21809. case GameMode.bigMove:
  21810. this.initSkillData();
  21811. break;
  21812. default:
  21813. break;
  21814. }
  21815. this.ui.t1.play(Laya.Handler.create(this, () => {
  21816. this.ui.t2.play(Laya.Handler.create(this, () => {
  21817. switch (xGame.common.gameMode) {
  21818. case GameMode.classic:
  21819. this.waitingPeople();
  21820. break;
  21821. case GameMode.bigMove:
  21822. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  21823. break;
  21824. default:
  21825. break;
  21826. }
  21827. }));
  21828. }));
  21829. this.setGlobalFont(this.ui);
  21830. }
  21831. initSkillData() {
  21832. this.skillSelectData = [];
  21833. let skillUrl = xGame.common.skillIconList;
  21834. let skillName = xGame.common.skillNameList;
  21835. let skillLevel = DataMgr.getBigSkillList();
  21836. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  21837. for (let index = 0; index < 5; index++) {
  21838. let obj = {};
  21839. obj.skillImg = skillUrl[index];
  21840. obj.skillName = skillName[index];
  21841. obj.skillType = skillType[index];
  21842. obj.skillLevel = skillLevel[index];
  21843. this.skillSelectData.push(obj);
  21844. }
  21845. }
  21846. getAISkillLevel(myLevel) {
  21847. let video = xGame.common.upSkillLevel;
  21848. let aiLevel;
  21849. let temp;
  21850. if (video) {
  21851. temp = xGame.common.randomNum(-2, -1);
  21852. }
  21853. else {
  21854. if (myLevel <= 5) {
  21855. temp = xGame.common.randomNum(1, 3);
  21856. }
  21857. else if (myLevel <= 9) {
  21858. temp = xGame.common.randomNum(-2, 1);
  21859. }
  21860. else {
  21861. temp = xGame.common.randomNum(-4, 0);
  21862. }
  21863. }
  21864. aiLevel = temp + myLevel;
  21865. if (aiLevel <= 1)
  21866. aiLevel = 1;
  21867. if (aiLevel >= 10)
  21868. aiLevel = 10;
  21869. return aiLevel;
  21870. }
  21871. getAISkillType() {
  21872. return xGame.common.randomNum(1, 4);
  21873. let successTimes = DataMgr.getSkillSuccessTimes();
  21874. let info = cfgTable.aiskillData[successTimes];
  21875. if (!info) {
  21876. let max = Object.keys(cfgTable.aiskillData).length - 1;
  21877. info = cfgTable.aiskillData[max];
  21878. }
  21879. let dataArr = info.skillselect;
  21880. let myCfg = {};
  21881. for (let index = 0; index < dataArr.length; index++) {
  21882. let temp = dataArr[index].split('-');
  21883. myCfg[temp[0]] = {};
  21884. myCfg[temp[0]].id = parseInt(temp[0]);
  21885. myCfg[temp[0]].weight = parseInt(temp[1]);
  21886. }
  21887. let aiCfg = xGame.common.initWeight(myCfg);
  21888. let curData = xGame.common.getRandomWeightData(aiCfg);
  21889. return parseInt(curData.id);
  21890. }
  21891. getAISkillData(index) {
  21892. let myLevel = this.skillSelectData[index].skillLevel;
  21893. let aiLevel = this.getAISkillLevel(myLevel);
  21894. let aiType = this.getAISkillType() - 1;
  21895. return { aiLevel, aiType } = { aiLevel, aiType };
  21896. }
  21897. skillSelectFinish(index) {
  21898. let aiInfo = this.getAISkillData(index);
  21899. xGame.common.gameMgr.selfCurSkill = index;
  21900. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  21901. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  21902. this.ui.selfHead.c1.selectedIndex = 1;
  21903. this.ui.aiHead.c1.selectedIndex = 1;
  21904. let myData = this.skillSelectData[index];
  21905. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  21906. let guide = DataMgr.getSkillGuide();
  21907. if (guide == 0) {
  21908. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  21909. }
  21910. else {
  21911. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  21912. }
  21913. let aiData = this.skillSelectData[aiInfo.aiType];
  21914. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  21915. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  21916. this.waitingPeople();
  21917. }
  21918. waitingPeople() {
  21919. let time = xGame.common.randomNum(1000, 3000);
  21920. time += 1000;
  21921. Laya.timer.once(time, this, () => {
  21922. this.matchingSuccess();
  21923. });
  21924. }
  21925. matchingSuccess() {
  21926. let gameUI = xGame.common.gameUI;
  21927. let name = gameUI.ui.topNode.aiNameTxt.text;
  21928. let url = gameUI.ui.topNode.aiHeadLoader.url;
  21929. this.ui.aiHead.nameTxt.text = name;
  21930. this.ui.aiHead.headImg.url = url;
  21931. name = gameUI.ui.topNode.selfNameTxt.text;
  21932. url = gameUI.ui.topNode.selfHeadLoader.url;
  21933. this.ui.selfHead.nameTxt.text = name;
  21934. this.ui.selfHead.headImg.url = url;
  21935. this.ui.t3.play(Laya.Handler.create(this, () => {
  21936. this.callback && this.callback();
  21937. this.ui.t4.play(Laya.Handler.create(this, () => {
  21938. this.destroySelf();
  21939. }));
  21940. }));
  21941. }
  21942. destroySelf() {
  21943. this.callback = null;
  21944. this.skillSelectData = null;
  21945. this.selfPot = null;
  21946. this.aiPot = null;
  21947. if (!this.ui.isDisposed) {
  21948. this.ui.removeFromParent();
  21949. this.ui.dispose();
  21950. }
  21951. xGame.uiMgr.destroyUI(this);
  21952. }
  21953. }
  21954. UIMatching$1.uiName = "UIMatching";
  21955. class SkillDisplay$1 {
  21956. constructor(ui, data, uiIndex) {
  21957. this.starX = 0;
  21958. this.starY = 0;
  21959. this.index = 0;
  21960. this.ui = ui;
  21961. this.data = data;
  21962. this.index = uiIndex;
  21963. this.initSelf();
  21964. console.log('zh:SkillDisplay constructor this.skillData=', data);
  21965. }
  21966. initSelf() {
  21967. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  21968. this.ui.nameTxt.text = this.data.name;
  21969. this.ui.describeTxt.text = this.data.describe;
  21970. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  21971. this.ui.startBtn.onClick(this, this.startGame);
  21972. this.updateSelf();
  21973. }
  21974. updateSelf() {
  21975. this.checkTry();
  21976. let level = DataMgr.getBigSkillByIndex(this.index);
  21977. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  21978. }
  21979. checkTry() {
  21980. let index = this.index;
  21981. let level = DataMgr.getBigSkillByIndex(index);
  21982. if (level == null) {
  21983. DataMgr.setBigSkill(index, 1, false);
  21984. level = 1;
  21985. }
  21986. this.ui.levelTxt.text = "LV." + level;
  21987. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  21988. this.ui.tryNode.visible = true;
  21989. else
  21990. this.ui.tryNode.visible = false;
  21991. }
  21992. clickAddLevel() {
  21993. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  21994. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  21995. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  21996. if (Laya.Browser.onAndroid) {
  21997. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  21998. this.qjff_AD_for_skilldisplay_clickAddLevel();
  21999. }
  22000. else {
  22001. console.log('zh:AD 失败,直接发放奖励');
  22002. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22003. }
  22004. }
  22005. else {
  22006. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22007. }
  22008. }
  22009. qjff_AD_for_skilldisplay_clickAddLevel() {
  22010. DataMgr.setBigSkill(this.data.index, 1);
  22011. this.updateSelf();
  22012. xGame.common.upSkillLevel = true;
  22013. }
  22014. startGame() {
  22015. console.log('zh:rod skill startgame');
  22016. if (this.data.index == 3) {
  22017. alert('Coming soon!');
  22018. return;
  22019. }
  22020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22021. let needCoin = xGame.common.bigMoveNeedCoin;
  22022. xGame.common.passAwardCoin = 2000;
  22023. let guide = DataMgr.getSkillGuide();
  22024. console.log('zh:startGame guide=' + guide);
  22025. xGame.common.temSelfLevel = 0;
  22026. if (guide == 0) {
  22027. needCoin = 0;
  22028. xGame.common.temSelfLevel = 100;
  22029. }
  22030. if (DataMgr.coinEnough(needCoin)) {
  22031. DataMgr.setCoin(-needCoin);
  22032. xGame.common.curPlayerSkillType = this.index;
  22033. if (guide == 0)
  22034. xGame.common.curPlayerSkillType = 0;
  22035. console.log('zh: skilldisplay 1');
  22036. xGame.uiMgr.Show(UIGame$1);
  22037. xGame.uiMgr.Hide(UIMain$1);
  22038. xGame.uiMgr.Show(UIMatching$1, () => {
  22039. xGame.common.gameUI.ui.alpha = 1;
  22040. xGame.common.gameUI.startGame();
  22041. xGame.uiMgr.Hide(UISkill$1);
  22042. });
  22043. this.logEventForRod_start();
  22044. }
  22045. else {
  22046. console.log('zh: skilldisplay 2');
  22047. xGame.uiMgr.Show(UIAddProp$1, 0);
  22048. Moyu.sendDataEvent("AddCoinVideo");
  22049. }
  22050. }
  22051. logEventForRod_start() {
  22052. let gfmsIdx = xGame.common.curPlayerSkillType;
  22053. console.log('zh:选择的技能=' + gfmsIdx);
  22054. let gfmc = 'Skyfall Shot';
  22055. if (gfmsIdx == 0) {
  22056. gfmc = 'Skyfall Shot';
  22057. }
  22058. if (gfmsIdx == 1) {
  22059. gfmc = 'Surging break';
  22060. }
  22061. if (gfmsIdx == 2) {
  22062. gfmc = 'Frost Lock';
  22063. }
  22064. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  22065. let jsonStr = {
  22066. "count": 0,
  22067. "name": gfmc
  22068. };
  22069. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22070. const d = LocalStorageManager.getItem(keyStr);
  22071. jsonStr.count = d.count + 1;
  22072. LocalStorageManager.setItem(keyStr, jsonStr);
  22073. }
  22074. else {
  22075. LocalStorageManager.setItem(keyStr, jsonStr);
  22076. }
  22077. const reqStr = JSON.stringify(jsonStr);
  22078. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  22079. }
  22080. }
  22081. class UISkill$1 extends UIBase {
  22082. constructor() {
  22083. super();
  22084. this.skillData = [];
  22085. }
  22086. onConstructor() {
  22087. this.ui = ui_UISkill.createInstance();
  22088. this.contentPane = this.ui;
  22089. this.isEject = false;
  22090. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22091. this.initSkillData();
  22092. console.log('zh:aaaaaa1111111111');
  22093. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  22094. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  22095. console.log('zh:aaaaaa22222222');
  22096. this.displayList = [];
  22097. this.ui.skillNode.skillList.numItems = 3;
  22098. this.addUIClick(this.ui, this.interuptSecretary);
  22099. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  22100. this.ui.talkNode.visible = false;
  22101. if (Moyu.isKs)
  22102. this.ui.closeNode.closeBtn.x += 100;
  22103. }
  22104. show() {
  22105. super.show();
  22106. this.playSecretaryIdle();
  22107. this.moneyNode.ui.c1.selectedIndex = 1;
  22108. Laya.timer.clearAll(this);
  22109. xGame.soundMgr.playSound("s_start");
  22110. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22111. let guide = DataMgr.getSkillGuide();
  22112. this.ui.guideNode.visible = guide == 0;
  22113. let item = this.getSkillItemByUIIndex(0);
  22114. if (guide == 0) {
  22115. item.ui.c1.selectedIndex = 1;
  22116. }
  22117. else {
  22118. item.ui.c1.selectedIndex = 0;
  22119. }
  22120. this.ui.guideNode.guideBtn.visible = guide == 0;
  22121. for (let index = 0; index < this.displayList.length; index++) {
  22122. this.displayList[index].checkTry();
  22123. }
  22124. this.setGlobalFont(this.ui);
  22125. }
  22126. getSkillItemByUIIndex(cur) {
  22127. for (let index = 0; index < this.displayList.length; index++) {
  22128. if (this.displayList[index].index == cur) {
  22129. return this.displayList[index];
  22130. }
  22131. }
  22132. }
  22133. enterGuideLevel() {
  22134. let item = this.getSkillItemByUIIndex(0);
  22135. item.startGame();
  22136. if (DataMgr.getNewUser())
  22137. Moyu.sendDataEvent("gameStart1");
  22138. }
  22139. initSkillData() {
  22140. this.skillData = [];
  22141. let nameList = xGame.common.skillNameList;
  22142. let iconList = xGame.common.skillIconList;
  22143. let describeList = [
  22144. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22145. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22146. "The power of frost descends—freezing the flow and taking full control of the game!"
  22147. ];
  22148. console.log('zh:initSkillData 111111111');
  22149. let data;
  22150. for (let index = 0; index < nameList.length; index++) {
  22151. data = {};
  22152. data.name = nameList[index];
  22153. data.icon = iconList[index];
  22154. data.describe = describeList[index];
  22155. data.index = index;
  22156. this.skillData.push(data);
  22157. }
  22158. }
  22159. updateSkillItem(index, target) {
  22160. if (this.displayList[index] == null) {
  22161. let uiIndex;
  22162. switch (index) {
  22163. case 0:
  22164. uiIndex = 1;
  22165. break;
  22166. case 1:
  22167. uiIndex = 0;
  22168. break;
  22169. case 2:
  22170. uiIndex = 2;
  22171. break;
  22172. case 3:
  22173. uiIndex = 3;
  22174. break;
  22175. default:
  22176. break;
  22177. }
  22178. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22179. this.displayList.push(temp);
  22180. }
  22181. }
  22182. playSecretaryIdle() {
  22183. let parent = this.ui.secretary.displayObject;
  22184. parent.destroyChildren();
  22185. let xx = this.ui.secretary.width / 2;
  22186. let yy = this.ui.secretary.height;
  22187. let scale = xGame.common.getSecretaryScale();
  22188. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22189. xGame.common.secretary.play(data, 0, true, parent);
  22190. }
  22191. returnUIMain() {
  22192. this.hide();
  22193. xGame.common.stopGirlPop(this.ui.talkNode);
  22194. xGame.uiMgr.Show(UIMain$1);
  22195. }
  22196. interuptSecretary() {
  22197. Laya.timer.clearAll(this);
  22198. this.playSecretaryRandomSound();
  22199. }
  22200. playSecretaryRandomSound() {
  22201. if (this.isHide)
  22202. return;
  22203. let time = xGame.common.randomNum(45000, 60000);
  22204. Laya.timer.once(time, this, () => {
  22205. if (this.isHide)
  22206. return;
  22207. let index = xGame.common.randomNum(4, 7);
  22208. xGame.soundMgr.playSound("s_main0" + index);
  22209. let words = 1;
  22210. switch (index) {
  22211. case 4:
  22212. words = 5;
  22213. break;
  22214. case 5:
  22215. words = 3;
  22216. break;
  22217. case 6:
  22218. words = 6;
  22219. break;
  22220. case 7:
  22221. words = 7;
  22222. break;
  22223. default:
  22224. break;
  22225. }
  22226. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22227. this.playSecretaryRandomSound();
  22228. });
  22229. }
  22230. }
  22231. UISkill$1.uiName = "UISkill";
  22232. class UIAddProp$1 extends UIBase {
  22233. constructor() {
  22234. super();
  22235. this.curType = "";
  22236. }
  22237. onConstructor() {
  22238. this.ui = ui_UIAddProp.createInstance();
  22239. this.contentPane = this.ui;
  22240. this.isEject = false;
  22241. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22242. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22243. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22244. this.updateUI();
  22245. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22246. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22247. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22248. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22249. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22250. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22251. }
  22252. show(type) {
  22253. super.show();
  22254. this.curType = type == 0 ? "coin" : "diamond";
  22255. this.switchBtn("");
  22256. this.ui.t0.play();
  22257. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22258. PlatMgr.showInsert(true);
  22259. this.setGlobalFont(this.ui);
  22260. }
  22261. closeSelf() {
  22262. this.hide();
  22263. }
  22264. updateUI() {
  22265. let data = cfgTable.moneyData;
  22266. let temp;
  22267. let obj;
  22268. for (const key in data) {
  22269. temp = data[key];
  22270. obj = this.ui.myNode["node" + key];
  22271. if (parseInt(key) <= 2) {
  22272. obj.diamondTxt.text = "+" + temp.num;
  22273. }
  22274. else {
  22275. obj.coinTxt.text = temp.num;
  22276. obj.diamondTxt.text = temp.get.split('_')[1];
  22277. }
  22278. }
  22279. this.updateDiamondShare();
  22280. }
  22281. updateDiamondShare() {
  22282. let data = DataMgr.getShareDiamondTimes();
  22283. if (data >= xGame.common.maxShareDiamondTimes) {
  22284. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22285. this.ui.myNode.node1.touchable = false;
  22286. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22287. }
  22288. else {
  22289. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22290. this.ui.myNode.node1.touchable = true;
  22291. }
  22292. }
  22293. switchBtn(type) {
  22294. if (type == "")
  22295. type = this.curType;
  22296. else {
  22297. if (this.curType == type) {
  22298. return;
  22299. }
  22300. else {
  22301. this.curType = type;
  22302. }
  22303. }
  22304. if (type == "coin") {
  22305. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22306. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22307. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22308. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22309. this.ui.myNode.c1.selectedIndex = 0;
  22310. }
  22311. else {
  22312. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22313. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22314. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22315. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22316. this.ui.myNode.c1.selectedIndex = 1;
  22317. }
  22318. }
  22319. convertCoin(index) {
  22320. let data = cfgTable.moneyData[index];
  22321. let coinNum = data.num;
  22322. let str = data.get.split('_')[1];
  22323. let needDiamond = parseInt(str);
  22324. if (DataMgr.diamondEnough(needDiamond)) {
  22325. DataMgr.setDiamond(-needDiamond);
  22326. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22327. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22328. }
  22329. else {
  22330. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22331. this.switchBtn("diamond");
  22332. }
  22333. }
  22334. videoGetDiamond() {
  22335. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22336. if (Laya.Browser.onAndroid) {
  22337. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22338. if (!boo) {
  22339. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22340. return;
  22341. }
  22342. }
  22343. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22344. }
  22345. else {
  22346. console.log('zh:AD 失败,直接发放奖励');
  22347. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22348. }
  22349. }
  22350. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22351. let num = cfgTable.moneyData[2].num;
  22352. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22353. this.closeSelf();
  22354. }
  22355. videoGetCoin() {
  22356. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22357. if (Laya.Browser.onAndroid) {
  22358. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22359. if (!boo) {
  22360. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22361. return;
  22362. }
  22363. }
  22364. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22365. }
  22366. else {
  22367. console.log('zh:AD 失败,直接发放奖励');
  22368. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22369. }
  22370. }
  22371. qjff_AD_for_uiAddProp_videoGetCoin() {
  22372. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22373. this.closeSelf();
  22374. }
  22375. shareGetDiamond() {
  22376. let times = DataMgr.getShareDiamondTimes();
  22377. if (times >= xGame.common.maxShareDiamondTimes) {
  22378. console.log('zh: 233333333333 maxShareDiamondTimes');
  22379. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22380. }
  22381. else {
  22382. console.log('zh:33333333333333ad');
  22383. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22384. if (Laya.Browser.onAndroid) {
  22385. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22386. if (!boo) {
  22387. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22388. return;
  22389. }
  22390. }
  22391. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22392. }
  22393. else {
  22394. console.log('zh:AD 失败,直接发放奖励');
  22395. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22396. }
  22397. }
  22398. }
  22399. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22400. let diamond = xGame.common.randomNum(50, 100);
  22401. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22402. DataMgr.setShareDiamondTimes(1);
  22403. this.updateDiamondShare();
  22404. }
  22405. openPutBallView() {
  22406. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22407. let skill = xGame.uiMgr.getUI(UISkill$1);
  22408. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22409. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22410. if (end && !end.isHide) {
  22411. xGame.uiMgr.Hide(UIGameEnd$1);
  22412. xGame.uiMgr.Show(UIMain$1);
  22413. }
  22414. if (skill && !skill.isHide)
  22415. xGame.uiMgr.Hide(UISkill$1);
  22416. if (uigame && !uigame.isHide)
  22417. xGame.uiMgr.Hide(UIGame$1);
  22418. if (level && !level.isHide) {
  22419. }
  22420. else {
  22421. xGame.uiMgr.Show(UILevelDisplay$1);
  22422. }
  22423. this.closeSelf();
  22424. }
  22425. }
  22426. UIAddProp$1.uiName = "UIAddProp";
  22427. class MoneyNode$1 {
  22428. constructor(ui) {
  22429. this.leftTime = 0;
  22430. this.ui = ui;
  22431. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22432. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22433. this.ui.addPowerBtn.onClick(this, this.addPower);
  22434. this.ui.c1.selectedIndex = 1;
  22435. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22436. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22437. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22438. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22439. this.coinChange();
  22440. this.diamondChange();
  22441. this.powerChange();
  22442. }
  22443. addPower() {
  22444. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22445. xGame.uiMgr.Show(UIPower$1);
  22446. }
  22447. powerChange() {
  22448. let powerNum = DataMgr.getPower();
  22449. this.ui.powerTxt.text = powerNum + "";
  22450. }
  22451. checkPowerTime() {
  22452. let cur = new Date().getTime();
  22453. let last = DataMgr.getPowerTime();
  22454. if (last == 0) {
  22455. last = cur;
  22456. DataMgr.setPowerTime(cur);
  22457. }
  22458. let power = DataMgr.getPower();
  22459. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22460. Laya.timer.clearAll(this);
  22461. if (power >= xGame.common.natureMaxPower) {
  22462. this.ui.powerTimeTxt.text = "";
  22463. DataMgr.setPowerTime(cur);
  22464. return;
  22465. }
  22466. if (power + offset >= xGame.common.natureMaxPower) {
  22467. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22468. this.ui.powerTimeTxt.text = "";
  22469. DataMgr.setPowerTime(cur);
  22470. }
  22471. else {
  22472. if (offset > 0) {
  22473. DataMgr.setPower(offset);
  22474. DataMgr.setPowerTime(cur);
  22475. }
  22476. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22477. this.leftTime = xGame.common.powerRecoverNum - time;
  22478. if (this.leftTime <= 0)
  22479. this.leftTime = 0;
  22480. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22481. Laya.timer.loop(1000, this, this.updatePowerTime);
  22482. }
  22483. }
  22484. updatePowerTime() {
  22485. this.leftTime -= 1;
  22486. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22487. if (this.leftTime <= 0) {
  22488. this.checkPowerTime();
  22489. }
  22490. }
  22491. coinChange() {
  22492. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22493. }
  22494. diamondChange() {
  22495. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22496. }
  22497. addCoin() {
  22498. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22499. Moyu.sendDataEvent("AddCoinBtn");
  22500. xGame.uiMgr.Show(UIAddProp$1, 0);
  22501. }
  22502. addDiamond() {
  22503. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22504. Moyu.sendDataEvent("AddDiamondBtn");
  22505. xGame.uiMgr.Show(UIAddProp$1, 1);
  22506. }
  22507. }
  22508. class SettingNode$1 {
  22509. constructor(ui) {
  22510. this.showSetting = false;
  22511. this.openSound = true;
  22512. this.openShake = true;
  22513. this.ui = ui;
  22514. this.ui.soundBtn.onClick(this, this.switchSound);
  22515. this.ui.shakeBtn.onClick(this, this.switchShake);
  22516. this.ui.xyBtn.onClick(this, this.onXy);
  22517. this.ui.clickNode.onClick(this, this.changeSetting);
  22518. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22519. this.ui.xyBtn.visible = false;
  22520. this.ui.shakeBtn.visible = false;
  22521. }
  22522. changeSetting() {
  22523. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22524. this.showSetting = !this.showSetting;
  22525. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22526. }
  22527. switchSound() {
  22528. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22529. this.openSound = !this.openSound;
  22530. Moyu.onSetting(this.openSound, this.openShake);
  22531. xGame.soundMgr.onSetting(this.openSound);
  22532. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22533. }
  22534. switchShake() {
  22535. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22536. this.openShake = !this.openShake;
  22537. Moyu.onSetting(this.openSound, this.openShake);
  22538. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22539. }
  22540. onXy() {
  22541. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22542. MoyuMgr$1.showXy(1);
  22543. }
  22544. }
  22545. class UIDraw$1 extends UIBase {
  22546. constructor() {
  22547. super();
  22548. this.curKey = 0;
  22549. }
  22550. onConstructor() {
  22551. this.ui = ui_UIDraw.createInstance();
  22552. this.contentPane = this.ui;
  22553. this.isEject = false;
  22554. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22555. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22556. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22557. this.initDraw();
  22558. this.initUI();
  22559. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22560. }
  22561. show() {
  22562. super.show();
  22563. this.ui.t0.play();
  22564. this.playSecretaryIdle();
  22565. this.updateDraw();
  22566. this.checkFree();
  22567. if (PlatMgr.bannerDelay > 0) {
  22568. this.ui.closeNode.closeBtn.visible = false;
  22569. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22570. this.ui.closeNode.closeBtn.visible = true;
  22571. });
  22572. }
  22573. PlatMgr.showRateBanner();
  22574. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22575. this.setGlobalFont(this.ui);
  22576. }
  22577. hide() {
  22578. Laya.timer.clearAll(this);
  22579. super.hide();
  22580. }
  22581. checkFree() {
  22582. let isFree = DataMgr.getDailyfreeDrawTimes();
  22583. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22584. }
  22585. initDraw() {
  22586. this.drawObj = [];
  22587. let data = cfgTable.drawData;
  22588. let temp;
  22589. let weight = 0;
  22590. for (const key in data) {
  22591. temp = data[key];
  22592. weight += temp.weight;
  22593. this.drawObj.push(weight);
  22594. }
  22595. this.allWeight = weight;
  22596. }
  22597. initUI() {
  22598. let data = cfgTable.drawData;
  22599. let temp;
  22600. let img;
  22601. let txt;
  22602. for (const key in data) {
  22603. temp = data[key];
  22604. img = this.ui.myNode.rotNode["img" + key];
  22605. txt = this.ui.myNode.rotNode["txt" + key];
  22606. img.url = xGame.common.getGameIconUrl(temp.icon);
  22607. txt.visible = true;
  22608. if (temp.award > 2) {
  22609. img.rotation = 0;
  22610. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22611. }
  22612. else {
  22613. img.rotation = temp.rotation;
  22614. txt.text = temp.num;
  22615. }
  22616. }
  22617. }
  22618. getCurkey() {
  22619. let rand = Math.random() * this.allWeight;
  22620. let temp;
  22621. for (let index = 0; index < this.drawObj.length - 1; index++) {
  22622. temp = this.drawObj[index];
  22623. if (index == 0) {
  22624. if (rand < temp) {
  22625. return index + 1;
  22626. }
  22627. }
  22628. else {
  22629. if (rand >= temp && rand < this.drawObj[index + 1]) {
  22630. return index + 1;
  22631. }
  22632. }
  22633. }
  22634. return 2;
  22635. }
  22636. startDraw() {
  22637. console.log('zh:开始抽奖');
  22638. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  22639. if (freeTimes > 0) {
  22640. console.log('zh:freeTimes=' + freeTimes);
  22641. this.beginDraw();
  22642. DataMgr.setDailyfreeDrawTimes(0);
  22643. this.checkFree();
  22644. }
  22645. else {
  22646. if (Laya.Browser.onAndroid) {
  22647. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22648. if (!boo) {
  22649. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22650. return;
  22651. }
  22652. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  22653. }
  22654. else {
  22655. console.log('zh:AD 失败,直接发放奖励');
  22656. this.qjff_chouJiang();
  22657. }
  22658. }
  22659. else {
  22660. this.qjff_chouJiang();
  22661. }
  22662. }
  22663. }
  22664. qjff_chouJiang() {
  22665. this.beginDraw();
  22666. }
  22667. beginDraw() {
  22668. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  22669. this.ui.drawBtn.touchable = false;
  22670. this.curKey = this.getCurkey();
  22671. console.log("zh:当前key", this.curKey);
  22672. let cell = 60;
  22673. let lap = 3;
  22674. let angle = cell * (this.curKey - 1) + lap * 360;
  22675. let target = this.ui.myNode.rotNode;
  22676. target.rotation = 0;
  22677. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  22678. console.log("zh:旋转完成");
  22679. this.ui.drawBtn.touchable = true;
  22680. this.getAward();
  22681. }));
  22682. }
  22683. getAward() {
  22684. let data = cfgTable.drawData[this.curKey];
  22685. let temp = new AwardType();
  22686. temp.type = data.award;
  22687. temp.num = data.num;
  22688. xGame.common.getAward([temp], () => {
  22689. DataMgr.setDrawTimes(1);
  22690. this.updateDraw();
  22691. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22692. });
  22693. }
  22694. updateDraw() {
  22695. let drawTimes = DataMgr.getDrawTimes();
  22696. let awardTimes = DataMgr.getDrawAwardTimes();
  22697. if (Math.floor(drawTimes / 3) > awardTimes) {
  22698. this.ui.extraNode.boxBtn.t0.play(null, -1);
  22699. this.ui.extraNode.boxBtn.touchable = true;
  22700. this.ui.extraNode.tipsTxt.text = "3/3";
  22701. this.ui.extraNode.barNode.width = 265;
  22702. this.getExtraAward();
  22703. }
  22704. else {
  22705. this.ui.extraNode.boxBtn.t0.stop();
  22706. this.ui.extraNode.boxBtn.touchable = false;
  22707. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  22708. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  22709. }
  22710. let data = cfgTable.drawData[1];
  22711. if (awardTimes == 0) {
  22712. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  22713. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  22714. this.ui.myNode.rotNode.img1.rotation = 0;
  22715. }
  22716. else {
  22717. let award = data.nextid;
  22718. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  22719. this.ui.myNode.rotNode.txt1.text = award[1];
  22720. this.ui.myNode.rotNode.img1.rotation = 0;
  22721. }
  22722. }
  22723. getExtraAward() {
  22724. let drawTimes = DataMgr.getDrawTimes();
  22725. let awardTimes = DataMgr.getDrawAwardTimes();
  22726. let data = cfgTable.drawData[1];
  22727. let award = new AwardType();
  22728. if (awardTimes == 0) {
  22729. award.num = data.num;
  22730. award.type = data.award;
  22731. xGame.common.getAward([award], () => {
  22732. let all = Math.floor(drawTimes / 3);
  22733. DataMgr.setDrawAwardTimes(all);
  22734. this.updateDraw();
  22735. });
  22736. }
  22737. else {
  22738. award.num = parseInt(data.nextid[1]);
  22739. award.type = parseInt(data.nextid[0]);
  22740. xGame.common.getAward([award], () => {
  22741. let all = Math.floor(drawTimes / 3);
  22742. DataMgr.setDrawAwardTimes(all);
  22743. this.updateDraw();
  22744. });
  22745. }
  22746. }
  22747. closeSelf() {
  22748. this.hide();
  22749. }
  22750. playSecretaryIdle() {
  22751. let parent = this.ui.secretary.displayObject;
  22752. parent.destroyChildren();
  22753. let xx = this.ui.secretary.width / 2;
  22754. let yy = this.ui.secretary.height;
  22755. let scale = xGame.common.getSecretaryScale();
  22756. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22757. xGame.common.secretary.play(data, 0, true, parent);
  22758. }
  22759. }
  22760. UIDraw$1.uiName = "UIDraw";
  22761. class UIRanking$1 extends UIBase {
  22762. constructor() {
  22763. super();
  22764. this.showSelf = true;
  22765. this.rankType = 1;
  22766. this.rankList = [];
  22767. this.topX = 10;
  22768. this.myIndex = this.topX + 1;
  22769. this.myStar = 0;
  22770. }
  22771. onConstructor() {
  22772. this.ui = ui_UIRanking.createInstance();
  22773. this.contentPane = this.ui;
  22774. this.isEject = false;
  22775. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  22776. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  22777. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  22778. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  22779. this.ui.myNode.myList.setVirtual();
  22780. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  22781. }
  22782. show() {
  22783. super.show();
  22784. this.getPaiHangBangDataFormJosnFile();
  22785. this.updateSelf();
  22786. let self = Moyu.getUserInfo();
  22787. if (!self.isAuth) {
  22788. Moyu.initUser(this, () => {
  22789. DataMgr.upRankData();
  22790. });
  22791. }
  22792. this.setGlobalFont(this.ui);
  22793. }
  22794. getPaiHangBangDataFormJosnFile() {
  22795. const rankingList = cfgTable.paiHangBangData.list;
  22796. this.updateItemData(rankingList);
  22797. }
  22798. updateSelfItem() {
  22799. console.log('zh:Moyu.platType =' + Moyu.platType);
  22800. let self = Moyu.getUserInfo();
  22801. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  22802. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  22803. if (this.myIndex > this.topX) {
  22804. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  22805. }
  22806. else {
  22807. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  22808. }
  22809. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  22810. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  22811. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  22812. }
  22813. updateItemData(data) {
  22814. this.myStar = xGame.common.getAllStarNum();
  22815. if (this.rankList.length < 2) {
  22816. this.rankList = data;
  22817. let self = Moyu.getUserInfo();
  22818. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  22819. self.headIcon = self.headIcon;
  22820. for (let i = 0; i < data.length; i++) {
  22821. let data = this.rankList[i];
  22822. if (data.userId == self.userId) {
  22823. this.rankList.splice(i, 1);
  22824. break;
  22825. }
  22826. }
  22827. for (let i = 0; i < data.length; i++) {
  22828. let data = this.rankList[i];
  22829. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  22830. this.myIndex = i + 1;
  22831. let user = { headIcon: self.headIcon, nickName: "myself" };
  22832. let ud = { user: user, data: {} };
  22833. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  22834. console.log('zh:Moyu.platType = ' + Moyu.platType);
  22835. if (Moyu.platType < 11) {
  22836. user.headIcon = self.headIcon;
  22837. user.nickName = self.nickName;
  22838. }
  22839. this.rankList.splice(i, 0, md);
  22840. break;
  22841. }
  22842. }
  22843. }
  22844. this.updateSelfItem();
  22845. this.ui.myNode.myList.numItems = this.rankList.length;
  22846. }
  22847. updateItemUI(index, obj) {
  22848. let data = this.rankList[index];
  22849. let userData = JSON.parse(data.userData).user;
  22850. obj.nameTxt.text = userData.nickName.toString();
  22851. obj.valueTxt.text = data.rankScore;
  22852. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  22853. obj.rankTxt.text = index + 1;
  22854. switch (index) {
  22855. case 0:
  22856. this.setImg(obj, 1, 0, 0);
  22857. obj.rankTxt.color = "#FFC047";
  22858. break;
  22859. case 1:
  22860. this.setImg(obj, 0, 1, 0);
  22861. obj.rankTxt.color = "#ACACAC";
  22862. break;
  22863. case 2:
  22864. this.setImg(obj, 0, 0, 1);
  22865. obj.rankTxt.color = "#D09672";
  22866. break;
  22867. default:
  22868. this.setImg(obj, 0, 0, 0);
  22869. obj.rankTxt.color = "#496FAB";
  22870. break;
  22871. }
  22872. }
  22873. setImg(obj, a, b, c) {
  22874. obj.img1.visible = a ? true : false;
  22875. obj.img2.visible = b ? true : false;
  22876. obj.img3.visible = c ? true : false;
  22877. }
  22878. changeList(type) {
  22879. this.rankType = type;
  22880. this.updateSelf();
  22881. }
  22882. changeSelfNode() {
  22883. this.showSelf = !this.showSelf;
  22884. this.updateSelf();
  22885. }
  22886. updateSelf() {
  22887. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  22888. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  22889. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22890. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  22891. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  22892. }
  22893. }
  22894. UIRanking$1.uiName = "UIRanking";
  22895. class UISecretary$1 extends UIBase {
  22896. constructor() {
  22897. super();
  22898. this.curIndex = 1;
  22899. }
  22900. onConstructor() {
  22901. this.ui = ui_UISecretary.createInstance();
  22902. this.contentPane = this.ui;
  22903. this.isEject = false;
  22904. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22905. this.nodeObj = { left: null, right: null, cur: null };
  22906. this.nodeObj.cur = this.ui.myNode.gameNode3;
  22907. }
  22908. show() {
  22909. super.show();
  22910. this.ui.t0.play();
  22911. this.updateData();
  22912. this.setGlobalFont(this.ui);
  22913. }
  22914. addSecretarySpine(node, spineName) {
  22915. if (spineName == "mishu") {
  22916. if (this.secretarySpine1) {
  22917. node.displayObject.destroyChildren();
  22918. this.playWoman(this.secretarySpine1, node.displayObject);
  22919. }
  22920. else {
  22921. let spine1 = new SpineMgr("mishu", () => {
  22922. this.secretarySpine1 = spine1;
  22923. this.playWoman(this.secretarySpine1, node.displayObject);
  22924. });
  22925. }
  22926. }
  22927. else {
  22928. if (this.secretarySpine2) {
  22929. node.displayObject.destroyChildren();
  22930. this.playWoman(this.secretarySpine2, node.displayObject);
  22931. }
  22932. else {
  22933. let spine2 = new SpineMgr("xiaomishu2", () => {
  22934. this.secretarySpine2 = spine2;
  22935. this.playWoman(this.secretarySpine2, node.displayObject);
  22936. });
  22937. }
  22938. }
  22939. }
  22940. playWoman(node, parent) {
  22941. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  22942. let yy = this.ui.myNode.gameNode3.secretary.height;
  22943. let scale = 1.5;
  22944. if (node == this.secretarySpine2) {
  22945. scale = 1.2;
  22946. }
  22947. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22948. node.play(data, 0, true, parent);
  22949. }
  22950. turnLeft() {
  22951. this.curIndex--;
  22952. if (this.curIndex < 1) {
  22953. this.curIndex = 2;
  22954. }
  22955. let left = this.nodeObj.left;
  22956. let right = this.nodeObj.right;
  22957. let cur = this.nodeObj.cur;
  22958. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22959. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22960. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22961. this.updateData();
  22962. }));
  22963. this.ui.myNode.setChildIndex(right, 2);
  22964. this.nodeObj.left = cur;
  22965. this.nodeObj.right = left;
  22966. this.nodeObj.cur = right;
  22967. }
  22968. turnRight() {
  22969. this.curIndex++;
  22970. if (this.curIndex > 2) {
  22971. this.curIndex = 1;
  22972. }
  22973. let left = this.nodeObj.left;
  22974. let right = this.nodeObj.right;
  22975. let cur = this.nodeObj.cur;
  22976. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  22977. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  22978. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  22979. this.updateData();
  22980. }));
  22981. this.ui.myNode.setChildIndex(left, 2);
  22982. this.nodeObj.left = right;
  22983. this.nodeObj.right = cur;
  22984. this.nodeObj.cur = left;
  22985. }
  22986. updateData() {
  22987. console.log('zh: updateData FFFFFFFFFF');
  22988. let data = cfgTable.secretaryshopData;
  22989. let children = this.ui.myNode._children;
  22990. let temp;
  22991. let curData;
  22992. for (let index = 0; index < children.length; index++) {
  22993. temp = children[index];
  22994. curData = data[1];
  22995. temp.heightTxt.text = curData.height;
  22996. temp.foodTxt.text = curData.food;
  22997. temp.historyTxt.text = curData.history;
  22998. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  22999. this.addSecretarySpine(temp.secretary, curData.spine);
  23000. let womanIndex = curData.id - 1;
  23001. let getWoman = DataMgr.getSecretary(womanIndex);
  23002. let curUse = DataMgr.getCurSecretary();
  23003. if (getWoman) {
  23004. if (curUse == womanIndex) {
  23005. temp.purchaseBtn.c1.selectedIndex = 1;
  23006. }
  23007. else {
  23008. temp.purchaseBtn.c1.selectedIndex = 2;
  23009. }
  23010. }
  23011. else {
  23012. temp.purchaseBtn.c1.selectedIndex = 0;
  23013. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  23014. }
  23015. temp.purchaseBtn.visible = false;
  23016. }
  23017. }
  23018. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  23019. console.log('zh: 点击了clickSecretary ');
  23020. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23021. if (getWoman) {
  23022. if (curUse != womanIndex) {
  23023. console.log();
  23024. DataMgr.setCurSecretary(womanIndex);
  23025. this.updateData();
  23026. }
  23027. }
  23028. else {
  23029. console.log('zh:点击购买了');
  23030. let need = needDiamond;
  23031. if (DataMgr.diamondEnough(need)) {
  23032. DataMgr.setDiamond(-need);
  23033. DataMgr.setSecretary(womanIndex, 1);
  23034. DataMgr.setCurSecretary(womanIndex);
  23035. this.updateData();
  23036. }
  23037. else {
  23038. xGame.uiMgr.Show(UIAddProp$1, 1);
  23039. }
  23040. }
  23041. }
  23042. closeSelf() {
  23043. this.hide();
  23044. }
  23045. }
  23046. UISecretary$1.uiName = "UISecretary";
  23047. class BallRodDisplay$1 {
  23048. constructor(ui, index) {
  23049. this.index = 0;
  23050. this.uiIndex = 0;
  23051. this.ui = ui;
  23052. this.index = index;
  23053. this.initData();
  23054. }
  23055. initData() {
  23056. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  23057. let data = cfgTable.ballrodData[this.index + 1];
  23058. this.ui.nameTxt.text = data.name;
  23059. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  23060. this.ui.levelNode.c1.selectedIndex = data.quality;
  23061. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  23062. if (data.spine) {
  23063. this.mySpine = new SpineMgr(data.spine, () => {
  23064. let xx = 150;
  23065. let yy = 70;
  23066. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  23067. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  23068. });
  23069. }
  23070. }
  23071. updateSelf() {
  23072. let get = DataMgr.getBallRod(this.index);
  23073. if (get == null)
  23074. get = 1;
  23075. let curUse = DataMgr.getCurBallRod();
  23076. if (get) {
  23077. if (curUse == this.index) {
  23078. this.ui.purchaseBtn.c1.selectedIndex = 0;
  23079. }
  23080. else {
  23081. this.ui.purchaseBtn.c1.selectedIndex = 1;
  23082. }
  23083. }
  23084. else {
  23085. this.ui.purchaseBtn.c1.selectedIndex = 2;
  23086. }
  23087. }
  23088. buyBallRod() {
  23089. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23090. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  23091. switch (selectedIndex) {
  23092. case 0:
  23093. break;
  23094. case 1:
  23095. console.log('zh:点击了 USE THIS');
  23096. DataMgr.setCurBallRod(this.index);
  23097. let curUse = DataMgr.getCurBallRod();
  23098. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  23099. let ui = xGame.uiMgr.getUI(UIShop$1);
  23100. ui.updateBallRod();
  23101. break;
  23102. case 2:
  23103. let data = cfgTable.ballrodData[this.index + 1];
  23104. let need = data.price;
  23105. if (DataMgr.diamondEnough(need)) {
  23106. this.buyQiuGan(data);
  23107. DataMgr.setDiamond(-need);
  23108. DataMgr.setBallRod(this.index, 1);
  23109. DataMgr.setCurBallRod(this.index);
  23110. let ui = xGame.uiMgr.getUI(UIShop$1);
  23111. ui.updateBallRod();
  23112. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  23113. }
  23114. else {
  23115. xGame.uiMgr.Show(UIAddProp$1, 1);
  23116. }
  23117. break;
  23118. default:
  23119. break;
  23120. }
  23121. }
  23122. buyQiuGan(qgItem) {
  23123. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  23124. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23125. if (userInfo == null) {
  23126. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23127. return;
  23128. }
  23129. let reqData = xGame.httpMgr.getReqData();
  23130. let pd = JSON.parse(reqData);
  23131. pd.qiuGanData = qgItem;
  23132. reqData = JSON.stringify(pd);
  23133. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23134. try {
  23135. console.log('zh:buySp res = ' + JSON.stringify(res));
  23136. let code = res.code;
  23137. let msg = res.msg;
  23138. if (code == 401) {
  23139. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23140. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23141. return;
  23142. }
  23143. if (code == 200) {
  23144. xGame.uiMgr.Show(UIMsg$1, msg);
  23145. DataMgr.getUserZiChanInfo(false);
  23146. }
  23147. else {
  23148. xGame.uiMgr.Show(UIMsg$1, msg);
  23149. }
  23150. }
  23151. catch (error) {
  23152. console.log('error=' + error);
  23153. alert(error);
  23154. }
  23155. finally {
  23156. }
  23157. });
  23158. }
  23159. logEventForGouMaiGan(qiuGanName) {
  23160. const ev = {
  23161. value: qiuGanName
  23162. };
  23163. const jsonStr = JSON.stringify(ev);
  23164. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23165. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23166. }
  23167. }
  23168. class DaoJuDisplay$1 {
  23169. constructor(ui, index) {
  23170. this.index = 0;
  23171. this.uiIndex = 0;
  23172. this.ggSpid = "";
  23173. this.spid = 0;
  23174. this.ui = ui;
  23175. this.index = index;
  23176. this.initData();
  23177. }
  23178. initData() {
  23179. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23180. let data = cfgTable.daoJuData[this.index + 1];
  23181. this.ui.nameTxt.text = data.spbt;
  23182. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23183. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23184. this.ggSpid = data.ggSpid;
  23185. this.spid = data.spid;
  23186. let baseUrl = "asset/sound/ogg/";
  23187. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23188. }
  23189. gotoBuy() {
  23190. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23191. if (userInfo != null) {
  23192. let token = userInfo.token;
  23193. let ggSpid = this.ggSpid;
  23194. let spid = this.spid;
  23195. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23196. console.log('zh:gotoBuy1 spid =' + spid);
  23197. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23198. return;
  23199. }
  23200. else {
  23201. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23202. }
  23203. }
  23204. gotoBuy1() {
  23205. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23206. let djItem = cfgTable.daoJuData[this.index + 1];
  23207. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23208. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23209. if (userInfo == null) {
  23210. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23211. return;
  23212. }
  23213. let reqData = xGame.httpMgr.getReqData();
  23214. let pd = JSON.parse(reqData);
  23215. pd.spItem = djItem;
  23216. reqData = JSON.stringify(pd);
  23217. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23218. try {
  23219. console.log('zh:buySp res = ' + JSON.stringify(res));
  23220. let code = res.code;
  23221. let msg = res.msg;
  23222. if (code == 401) {
  23223. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23224. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23225. return;
  23226. }
  23227. if (code == 200) {
  23228. xGame.uiMgr.Show(UIMsg$1, msg);
  23229. DataMgr.getUserZiChanInfo(false);
  23230. }
  23231. else {
  23232. xGame.uiMgr.Show(UIMsg$1, msg);
  23233. }
  23234. }
  23235. catch (error) {
  23236. console.log('error=' + error);
  23237. alert(error);
  23238. }
  23239. finally {
  23240. }
  23241. });
  23242. }
  23243. }
  23244. class UIShop$1 extends UIBase {
  23245. constructor() {
  23246. super();
  23247. this.itemNums = 0;
  23248. this.itemNumsForDj = 0;
  23249. this.curType = "";
  23250. }
  23251. onConstructor() {
  23252. this.ui = ui_UIShop.createInstance();
  23253. this.contentPane = this.ui;
  23254. this.isEject = false;
  23255. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23256. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23257. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23258. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23259. this.addUIClick(this.ui, this.interuptSecretary);
  23260. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23261. this.ballRodArr = [];
  23262. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23263. this.ui.myNode.myList.numItems = this.itemNums;
  23264. this.loadDjdata_old();
  23265. }
  23266. loadDjdata_old() {
  23267. let fff = cfgTable.daoJuData;
  23268. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23269. this.daoJuArr = [];
  23270. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23271. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23272. }
  23273. getProductList() {
  23274. let reqData = xGame.httpMgr.getReqData();
  23275. let pd = JSON.parse(reqData);
  23276. pd.splx = "Consumable";
  23277. reqData = JSON.stringify(pd);
  23278. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23279. try {
  23280. let code = res.code;
  23281. let msg = res.msg;
  23282. if (code == 401) {
  23283. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23284. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23285. return;
  23286. }
  23287. if (code == 200) {
  23288. let data = res.data;
  23289. for (let index = 0; index < data.length; index++) {
  23290. let element = data[index];
  23291. cfgTable.daoJuData[element.spid] = element;
  23292. }
  23293. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23294. }
  23295. else {
  23296. xGame.uiMgr.Show(UIMsg, msg);
  23297. }
  23298. }
  23299. catch (error) {
  23300. console.log('error=' + error);
  23301. alert(error);
  23302. }
  23303. finally {
  23304. }
  23305. });
  23306. }
  23307. show(type) {
  23308. super.show();
  23309. this.curType = type == 0 ? "qiugan" : "daoju";
  23310. this.switchBtn("");
  23311. this.playSecretaryIdle();
  23312. this.updateBallRod();
  23313. this.setGlobalFont(this.ui);
  23314. }
  23315. test123() {
  23316. console.log('zh:test123 ');
  23317. }
  23318. switchBtn(type) {
  23319. console.log('zh:1111切換 sel type=' + type);
  23320. if (type == "") {
  23321. type = this.curType;
  23322. }
  23323. else {
  23324. if (this.curType == type) {
  23325. return;
  23326. }
  23327. else {
  23328. this.curType = type;
  23329. }
  23330. }
  23331. if (type == "qiugan") {
  23332. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23333. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23334. this.ui.myNode.c1.selectedIndex = 0;
  23335. this.ui.myNode.myList.visible = true;
  23336. this.ui.myNode.djList.visible = false;
  23337. }
  23338. else {
  23339. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23340. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23341. this.ui.myNode.c1.selectedIndex = 1;
  23342. this.ui.myNode.myList.visible = false;
  23343. this.ui.myNode.djList.visible = true;
  23344. }
  23345. }
  23346. updateBallRod() {
  23347. for (let index = 0; index < this.ballRodArr.length; index++) {
  23348. this.ballRodArr[index].updateSelf();
  23349. }
  23350. }
  23351. renderBallRod(sort, obj) {
  23352. let index = this.getIndexBySort(sort + 1) - 1;
  23353. let ballRod = new BallRodDisplay$1(obj, index);
  23354. this.ballRodArr.push(ballRod);
  23355. }
  23356. renderDaoJu(idx, obj) {
  23357. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23358. let b = new DaoJuDisplay$1(obj, index);
  23359. this.daoJuArr.push(b);
  23360. }
  23361. getIndexBySort(sort) {
  23362. let object = cfgTable.ballrodData;
  23363. for (const key in object) {
  23364. if (object[key].sort == sort) {
  23365. return parseInt(key);
  23366. }
  23367. }
  23368. }
  23369. getIndexBySortForDj(idx) {
  23370. let object = cfgTable.daoJuData;
  23371. for (const key in object) {
  23372. if (object[key].idx == idx) {
  23373. return parseInt(key);
  23374. }
  23375. }
  23376. }
  23377. playSecretaryIdle() {
  23378. let parent = this.ui.secretary.displayObject;
  23379. parent.destroyChildren();
  23380. let xx = this.ui.secretary.width / 2;
  23381. let yy = this.ui.secretary.height;
  23382. let scale = xGame.common.getSecretaryScale();
  23383. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23384. xGame.common.secretary.play(data, 0, true, parent);
  23385. }
  23386. interuptSecretary() {
  23387. Laya.timer.clearAll(this);
  23388. this.playSecretaryRandomSound();
  23389. }
  23390. playSecretaryRandomSound() {
  23391. if (this.isHide)
  23392. return;
  23393. let time = xGame.common.randomNum(45000, 60000);
  23394. Laya.timer.once(time, this, () => {
  23395. if (this.isHide)
  23396. return;
  23397. let index = xGame.common.randomNum(4, 7);
  23398. xGame.soundMgr.playSound("s_main0" + index);
  23399. let words = 1;
  23400. switch (index) {
  23401. case 4:
  23402. words = 5;
  23403. break;
  23404. case 5:
  23405. words = 3;
  23406. break;
  23407. case 6:
  23408. words = 6;
  23409. break;
  23410. case 7:
  23411. words = 7;
  23412. break;
  23413. default:
  23414. break;
  23415. }
  23416. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23417. this.playSecretaryRandomSound();
  23418. });
  23419. }
  23420. closeSelf() {
  23421. this.hide();
  23422. }
  23423. }
  23424. UIShop$1.uiName = "UIShop";
  23425. class SignMax$1 {
  23426. constructor(ui) {
  23427. this.ui = ui;
  23428. }
  23429. updateSelf(index, sameDay, curDayIndex) {
  23430. let data = cfgTable.signData[index + 1];
  23431. this.ui.titleTxt.text = data.title;
  23432. let arr1 = data.award[0].split('-');
  23433. let arr2 = data.award[1].split('-');
  23434. let num1 = parseInt(arr1[1]);
  23435. let num2 = parseInt(arr2[1]);
  23436. this.ui.numTxt1.text = num1 + "";
  23437. this.ui.numTxt2.text = num2 + "";
  23438. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23439. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23440. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23441. this.ui.numTxt1.visible = false;
  23442. }
  23443. else {
  23444. this.ui.numTxt1.visible = true;
  23445. }
  23446. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23447. this.ui.numTxt2.visible = false;
  23448. }
  23449. else {
  23450. this.ui.numTxt2.visible = true;
  23451. }
  23452. if (index < curDayIndex) {
  23453. this.ui.c1.selectedIndex = 1;
  23454. }
  23455. else if (index == curDayIndex) {
  23456. if (sameDay) {
  23457. this.ui.c1.selectedIndex = 2;
  23458. }
  23459. else {
  23460. this.ui.c1.selectedIndex = 2;
  23461. }
  23462. }
  23463. else {
  23464. this.ui.c1.selectedIndex = 0;
  23465. }
  23466. }
  23467. }
  23468. class SignNormal$1 {
  23469. constructor(ui) {
  23470. this.ui = ui;
  23471. }
  23472. updateSelf(index, sameDay, curDayIndex) {
  23473. let data = cfgTable.signData[index + 1];
  23474. this.ui.titleTxt.text = data.title;
  23475. let arr = data.award[0].split('-');
  23476. let type = parseInt(arr[0]);
  23477. let num = parseInt(arr[1]);
  23478. this.ui.numTxt.text = num + "";
  23479. if (type > 2) {
  23480. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23481. this.ui.myIcon.rotation = 0;
  23482. }
  23483. else {
  23484. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23485. this.ui.myIcon.rotation = 0;
  23486. }
  23487. if (xGame.common.signAwardContainsRod(data.award)) {
  23488. this.ui.numTxt.visible = false;
  23489. }
  23490. else {
  23491. this.ui.numTxt.visible = true;
  23492. }
  23493. if (index < curDayIndex) {
  23494. this.ui.c1.selectedIndex = 1;
  23495. }
  23496. else if (index == curDayIndex) {
  23497. if (sameDay) {
  23498. this.ui.c1.selectedIndex = 2;
  23499. }
  23500. else {
  23501. this.ui.c1.selectedIndex = 2;
  23502. }
  23503. }
  23504. else {
  23505. this.ui.c1.selectedIndex = 0;
  23506. }
  23507. }
  23508. }
  23509. class UISign$1 extends UIBase {
  23510. constructor() {
  23511. super();
  23512. this.curDayIndex = 0;
  23513. this.starX = 0;
  23514. }
  23515. onConstructor() {
  23516. this.ui = ui_UISign.createInstance();
  23517. this.contentPane = this.ui;
  23518. this.isEject = false;
  23519. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23520. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23521. this.initSignItem();
  23522. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23523. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23524. }
  23525. show() {
  23526. super.show();
  23527. this.ui.t0.play();
  23528. this.playSecretaryIdle();
  23529. this.updateSign();
  23530. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23531. this.setGlobalFont(this.ui);
  23532. }
  23533. initSignItem() {
  23534. this.signArr = [];
  23535. for (let index = 0; index < 6; index++) {
  23536. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23537. this.signArr.push(temp);
  23538. }
  23539. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23540. if (Moyu.isKs)
  23541. this.ui.closeNode.closeBtn.x += 100;
  23542. }
  23543. updateSign() {
  23544. let sameDay = xGame.common.judgeSameDay();
  23545. let max = 7;
  23546. this.curDayIndex = DataMgr.getSignData();
  23547. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23548. this.curDayIndex = 0;
  23549. if (!sameDay) {
  23550. this.ui.normalBtn.visible = true;
  23551. this.ui.tipsNode.visible = false;
  23552. this.ui.againBtn.visible = false;
  23553. }
  23554. else {
  23555. this.ui.normalBtn.visible = false;
  23556. let again = DataMgr.getExtraSign();
  23557. let isCurrency = false;
  23558. let index = this.curDayIndex;
  23559. if (index == 0)
  23560. index = 7;
  23561. let award = cfgTable.signData[index].award;
  23562. let num = award[0].split("-")[0];
  23563. if (num == "1" || num == "2")
  23564. isCurrency = true;
  23565. let showAgain = again == 0 && isCurrency;
  23566. this.ui.againBtn.visible = showAgain;
  23567. this.ui.tipsNode.visible = !showAgain;
  23568. }
  23569. for (let index = 0; index < this.signArr.length; index++) {
  23570. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23571. }
  23572. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23573. }
  23574. playSecretaryIdle() {
  23575. let parent = this.ui.secretary.displayObject;
  23576. parent.destroyChildren();
  23577. let xx = this.ui.secretary.width / 2;
  23578. let yy = this.ui.secretary.height;
  23579. let scale = xGame.common.getSecretaryScale();
  23580. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23581. xGame.common.secretary.play(data, 0, true, parent);
  23582. }
  23583. closeSelf() {
  23584. this.hide();
  23585. }
  23586. normalGetAward() {
  23587. let sameDay = xGame.common.judgeSameDay();
  23588. if (!sameDay) {
  23589. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23590. let temp;
  23591. let type;
  23592. let num;
  23593. let arr = [];
  23594. for (let index = 0; index < award.length; index++) {
  23595. temp = award[index].split("-");
  23596. type = parseInt(temp[0]);
  23597. num = parseInt(temp[1]);
  23598. let awardType = new AwardType();
  23599. awardType.num = num;
  23600. awardType.type = type;
  23601. arr.push(awardType);
  23602. }
  23603. xGame.common.getAward(arr, (watchVideo) => {
  23604. this.curDayIndex++;
  23605. if (this.curDayIndex > 7)
  23606. this.curDayIndex = 0;
  23607. DataMgr.setSignData(this.curDayIndex);
  23608. this.updateSignData2Server(this.curDayIndex);
  23609. DataMgr.setSignTime(new Date().getTime());
  23610. if (watchVideo) {
  23611. DataMgr.setExtraSign(1);
  23612. Moyu.sendDataEvent("signIn1");
  23613. }
  23614. this.updateSign();
  23615. });
  23616. }
  23617. }
  23618. againGetAward() {
  23619. Moyu.sendDataEvent("signIn2");
  23620. console.log('zh:qjff_AD_for_uisign');
  23621. if (Laya.Browser.onAndroid) {
  23622. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23623. if (!boo) {
  23624. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23625. return;
  23626. }
  23627. }
  23628. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  23629. }
  23630. else {
  23631. console.log('zh:AD 失败,直接发放奖励');
  23632. this.qjff_AD_for_uisign();
  23633. }
  23634. }
  23635. qjff_AD_for_uisign() {
  23636. let index = this.curDayIndex;
  23637. if (index == 0)
  23638. index = 7;
  23639. let award = cfgTable.signData[index].award;
  23640. let temp;
  23641. let type;
  23642. let num;
  23643. for (let index = 0; index < award.length; index++) {
  23644. temp = award[index].split("-");
  23645. type = parseInt(temp[0]);
  23646. num = parseInt(temp[1]) * 3;
  23647. xGame.common.playObjFlyAnim(num, type);
  23648. }
  23649. DataMgr.setExtraSign(1);
  23650. this.updateSign();
  23651. }
  23652. updateSignData2Server(day) {
  23653. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23654. if (userInfo == null) {
  23655. return;
  23656. }
  23657. let reqData = xGame.httpMgr.getReqData();
  23658. let pd = JSON.parse(reqData);
  23659. pd.signData = day;
  23660. reqData = JSON.stringify(pd);
  23661. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  23662. try {
  23663. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  23664. let code = res.code;
  23665. let msg = res.msg;
  23666. if (code == 401) {
  23667. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23668. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23669. return;
  23670. }
  23671. if (code == 200) {
  23672. let data = res.data;
  23673. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  23674. }
  23675. else {
  23676. xGame.uiMgr.Show(UIMsg$1, msg);
  23677. }
  23678. }
  23679. catch (error) {
  23680. console.log('error=' + error);
  23681. alert(error);
  23682. }
  23683. finally {
  23684. }
  23685. });
  23686. }
  23687. }
  23688. UISign$1.uiName = "UISign";
  23689. class UIModeSelection$1 extends UIBase {
  23690. constructor() {
  23691. super();
  23692. }
  23693. onConstructor() {
  23694. this.ui = ui_UIModeSelection.createInstance();
  23695. this.contentPane = this.ui;
  23696. this.isEject = false;
  23697. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  23698. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  23699. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  23700. this.addUIClick(this.ui.closeBtn, this.hide);
  23701. this.peopleArr = [65, 990, 580];
  23702. this.peopleOffest = [5, 10, 10];
  23703. }
  23704. show(callback) {
  23705. this.updateSelf();
  23706. super.show();
  23707. this.ui.t0.play();
  23708. this.callback = callback;
  23709. this.setGlobalFont(this.ui);
  23710. }
  23711. updateSelf() {
  23712. let cfg = cfgTable.modeselectData;
  23713. for (let index = 1; index <= 3; index++) {
  23714. let node = this.ui.myNode["type" + index];
  23715. node.need.text = cfg[index].need;
  23716. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  23717. node.peopleTxt.text = this.getRandPeople(index - 1);
  23718. }
  23719. }
  23720. enterGame(type) {
  23721. console.log('zh: 进入经典模式 type: ' + type);
  23722. xGame.common.classicRoomType = type;
  23723. let cfg = cfgTable.modeselectData[type];
  23724. let need = cfg.need;
  23725. xGame.common.passAwardCoin = cfg.award;
  23726. if (DataMgr.coinEnough(need)) {
  23727. DataMgr.setCoin(-need);
  23728. this.ui.myNode["type" + type].t0.play();
  23729. Laya.timer.once(200, this, () => {
  23730. this.callback && this.callback();
  23731. });
  23732. this.logEventForClassic_start();
  23733. }
  23734. else {
  23735. Moyu.sendDataEvent("AddCoinVideo");
  23736. xGame.uiMgr.Show(UIAddProp$1, 0);
  23737. }
  23738. }
  23739. getRandPeople(index) {
  23740. let rand = this.peopleOffest[index];
  23741. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  23742. }
  23743. logEventForClassic_start() {
  23744. let rtype = xGame.common.classicRoomType;
  23745. let msmc = '';
  23746. if (rtype == 1) {
  23747. msmc = 'beginner';
  23748. }
  23749. if (rtype == 2) {
  23750. msmc = 'expert';
  23751. }
  23752. if (rtype == 3) {
  23753. msmc = 'master';
  23754. }
  23755. let keyStr = 'sjmd_classic_start_' + rtype;
  23756. let jsonStr = {
  23757. "difficulty": msmc,
  23758. "classic_count": 1,
  23759. "difficulty_count": 1
  23760. };
  23761. if (LocalStorageManager.hasJosnKey(keyStr)) {
  23762. const d = LocalStorageManager.getItem(keyStr);
  23763. jsonStr.classic_count = d.classic_count + 1;
  23764. jsonStr.difficulty_count = d.difficulty_count + 1;
  23765. LocalStorageManager.setItem(keyStr, jsonStr);
  23766. }
  23767. else {
  23768. LocalStorageManager.setItem(keyStr, jsonStr);
  23769. }
  23770. const reqStr = JSON.stringify(jsonStr);
  23771. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  23772. }
  23773. }
  23774. UIModeSelection$1.uiName = "UIModeSelection";
  23775. class UILogin$1 extends UIBase {
  23776. constructor() {
  23777. super();
  23778. this.fontStr = 'big-john-woff2-2';
  23779. try {
  23780. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  23781. console.log("zh: constructor加载arial字体成功");
  23782. }
  23783. catch (error) {
  23784. console.log("zh: constructor加载arial字体失败");
  23785. }
  23786. }
  23787. onFontLoaded() {
  23788. try {
  23789. Laya.Text.defaultFont = this.fontStr;
  23790. this.ui.txt_ua.font = this.fontStr;
  23791. this.ui.txt_up.font = this.fontStr;
  23792. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  23793. }
  23794. catch (error) {
  23795. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  23796. }
  23797. }
  23798. onConstructor() {
  23799. this.ui = ui_UILogin.createInstance();
  23800. this.contentPane = this.ui;
  23801. this.isEject = false;
  23802. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23803. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  23804. this.addUIClick(this.ui.btn_login, this.userLogin);
  23805. }
  23806. show() {
  23807. super.show();
  23808. this.x = (Laya.stage.width - this.width) / 2;
  23809. this.y = (Laya.stage.height - this.height) / 2;
  23810. this.onFontLoaded();
  23811. }
  23812. closeSelf() {
  23813. this.hide();
  23814. }
  23815. userLogin() {
  23816. let ua = this.ui.txt_ua.text;
  23817. let up = this.ui.txt_up.text;
  23818. console.log('zh:ua font' + this.ui.txt_ua.font);
  23819. if (ua && up) {
  23820. let reqData = JSON.stringify({
  23821. username: ua.trim(),
  23822. password: up.trim(),
  23823. fromMark: 'app_game'
  23824. });
  23825. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  23826. try {
  23827. console.log('zh:res = ' + JSON.stringify(res));
  23828. let code = res.code;
  23829. let msg = res.msg;
  23830. if (code == 200) {
  23831. let keyStr = keyForLoginInfo;
  23832. let jsonStr = {
  23833. "username": res.username,
  23834. "token": res.token,
  23835. "buySpids": { 1: false, 7: false }
  23836. };
  23837. LocalStorageManager.setItem(keyStr, jsonStr);
  23838. let myu = Moyu.getUserInfo();
  23839. console.log('zh:myu = ' + JSON.stringify(myu));
  23840. DataMgr.updateUserNickName(res.username);
  23841. Moyu.updateUserInfo(res.username);
  23842. xGame.uiMgr.Show(UIMsg$1, msg);
  23843. DataMgr.loadUserSpOrderForAd();
  23844. DataMgr.getUserZiChanInfo(false);
  23845. xGame.eventMgr.event(LOGIN_IN);
  23846. this.closeSelf();
  23847. }
  23848. else {
  23849. xGame.uiMgr.Show(UIMsg$1, msg);
  23850. }
  23851. }
  23852. catch (error) {
  23853. console.log('error=' + error);
  23854. alert(error);
  23855. }
  23856. finally {
  23857. }
  23858. });
  23859. }
  23860. else {
  23861. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23862. }
  23863. }
  23864. gotoRegPage() {
  23865. this.closeSelf();
  23866. xGame.uiMgr.Show(UIReg$1);
  23867. }
  23868. }
  23869. UILogin$1.uiName = "UILogin";
  23870. class UIReg$1 extends UIBase {
  23871. constructor() {
  23872. super();
  23873. this.fontStr = 'big-john-woff2-2';
  23874. try {
  23875. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  23876. console.log("zh: constructor加载arial字体成功");
  23877. }
  23878. catch (error) {
  23879. console.log("zh: constructor加载arial字体失败");
  23880. }
  23881. }
  23882. onFontLoaded() {
  23883. try {
  23884. Laya.Text.defaultFont = this.fontStr;
  23885. this.ui.txt_ua.font = this.fontStr;
  23886. this.ui.txt_up1.font = this.fontStr;
  23887. this.ui.txt_up2.font = this.fontStr;
  23888. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  23889. }
  23890. catch (error) {
  23891. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  23892. }
  23893. }
  23894. onConstructor() {
  23895. this.ui = ui_UIReg.createInstance();
  23896. this.contentPane = this.ui;
  23897. this.isEject = false;
  23898. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23899. this.addUIClick(this.ui.btn_reg, this.regUser);
  23900. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  23901. }
  23902. show() {
  23903. super.show();
  23904. this.x = (Laya.stage.width - this.width) / 2;
  23905. this.y = (Laya.stage.height - this.height) / 2;
  23906. this.onFontLoaded();
  23907. }
  23908. closeSelf() {
  23909. this.hide();
  23910. }
  23911. regUser() {
  23912. this.ui.lab_tip.visible = false;
  23913. let ua = this.ui.txt_ua.text;
  23914. let up1 = this.ui.txt_up1.text;
  23915. let up2 = this.ui.txt_up2.text;
  23916. if (ua && up1 && up2 && up1 == up2) {
  23917. let reqData = JSON.stringify({
  23918. username: ua.trim(),
  23919. password: up1.trim(),
  23920. fromMark: 'app_game'
  23921. });
  23922. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  23923. try {
  23924. console.log('zh:res = ' + JSON.stringify(res));
  23925. let code = res.code;
  23926. let msg = res.msg;
  23927. xGame.uiMgr.Show(UIMsg$1, msg);
  23928. if (code == 200) {
  23929. this.ui.lab_tip.color = "#FFFFFF";
  23930. xGame.uiMgr.Show(UIMsg$1, msg);
  23931. this.closeSelf();
  23932. }
  23933. else {
  23934. this.ui.lab_tip.color = "#FF0000";
  23935. xGame.uiMgr.Show(UIMsg$1, msg);
  23936. }
  23937. }
  23938. catch (error) {
  23939. console.log('error=' + error);
  23940. alert(error);
  23941. }
  23942. finally {
  23943. }
  23944. });
  23945. }
  23946. else {
  23947. if (up1 != up2) {
  23948. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  23949. }
  23950. else {
  23951. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  23952. }
  23953. }
  23954. }
  23955. gotoLogin() {
  23956. this.closeSelf();
  23957. xGame.uiMgr.Show(UILogin$1);
  23958. }
  23959. }
  23960. UIReg$1.uiName = "UIReg";
  23961. class UITry$1 extends UIBase {
  23962. constructor() {
  23963. super();
  23964. this.closeTime = 0;
  23965. this.closeNum = 0;
  23966. this.skillUrl = xGame.common.skillIconList;
  23967. }
  23968. onConstructor() {
  23969. this.ui = ui_UITry.createInstance();
  23970. this.contentPane = this.ui;
  23971. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  23972. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  23973. }
  23974. show() {
  23975. super.show();
  23976. this.closeNum = 0;
  23977. this.closeTime = 15;
  23978. this.ui.t0.play();
  23979. PlatMgr.showRateBanner();
  23980. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23981. Laya.timer.loop(1000, this, this.updateTime);
  23982. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  23983. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  23984. xGame.common.gameMgr.gamePause = true;
  23985. this.setGlobalFont(this.ui);
  23986. }
  23987. updateTime() {
  23988. if (this.closeTime > 1) {
  23989. this.closeTime--;
  23990. this.ui.myNode.txtTime.text = this.closeTime.toString();
  23991. }
  23992. else
  23993. this.hide();
  23994. }
  23995. hide() {
  23996. Laya.timer.clearAll(this);
  23997. Moyu.showBannerAd(false);
  23998. super.hide();
  23999. xGame.common.gameMgr.gamePause = false;
  24000. }
  24001. onTry() {
  24002. console.log('zh:qjff_AD_for_uitry');
  24003. if (Laya.Browser.onAndroid) {
  24004. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24005. if (!boo) {
  24006. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24007. return;
  24008. }
  24009. }
  24010. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  24011. }
  24012. else {
  24013. console.log('zh:AD 失败,直接发放奖励');
  24014. this.qjff_AD_for_uitry();
  24015. }
  24016. }
  24017. qjff_AD_for_uitry() {
  24018. let select = xGame.common.curPlayerSkillType;
  24019. DataMgr.gameData.trySkill = select;
  24020. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24021. DataMgr.saveGameData();
  24022. DataMgr.setBigSkill(select, 1);
  24023. xGame.showTip("Trial Successful");
  24024. this.hide();
  24025. }
  24026. onCancel() {
  24027. if (this.closeNum > 0) {
  24028. this.closeNum--;
  24029. if (this.closeNum < 2)
  24030. this.hide();
  24031. return;
  24032. }
  24033. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24034. this.onTry();
  24035. }
  24036. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24037. this.closeNum = 3;
  24038. }
  24039. else
  24040. this.hide();
  24041. }
  24042. }
  24043. UITry$1.uiName = "UITry";
  24044. class UIGetAward$1 extends UIBase {
  24045. constructor() {
  24046. super();
  24047. this.showTriple = true;
  24048. }
  24049. onConstructor() {
  24050. this.ui = ui_UIGetAward.createInstance();
  24051. this.contentPane = this.ui;
  24052. this.isEject = false;
  24053. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24054. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24055. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24056. }
  24057. show(arr, showTriple, callback) {
  24058. super.show();
  24059. this.ui.t0.play();
  24060. this.ui.eftNode.visible = true;
  24061. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24062. this.ui.eftNode.visible = false;
  24063. }), 1, 0, 0, 0.9);
  24064. this.awardArr = arr;
  24065. this.showTriple = showTriple;
  24066. this.callback = callback;
  24067. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24068. this.ui.myList.numItems = arr.length;
  24069. xGame.soundMgr.playSound("getaward");
  24070. this.setGlobalFont(this.ui);
  24071. }
  24072. updateSelf(index, obj) {
  24073. let temp = this.awardArr[index];
  24074. let icon = this.getIcon(temp.type);
  24075. let str = icon;
  24076. if (temp.type > 2) {
  24077. str = "s" + icon;
  24078. }
  24079. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24080. obj.myIcon.rotation = 0;
  24081. obj.numTxt.text = temp.num + "";
  24082. obj.numTxt.visible = temp.type > 2 ? false : true;
  24083. obj.nameTxt.text = this.getNameStr(temp.type);
  24084. }
  24085. renderItem(index, obj) {
  24086. this.updateSelf(index, obj);
  24087. }
  24088. tripleGetAward() {
  24089. console.log('zh:qjff_AD_for_uigetAward');
  24090. if (Laya.Browser.onAndroid) {
  24091. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24092. if (!boo) {
  24093. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24094. return;
  24095. }
  24096. }
  24097. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24098. }
  24099. else {
  24100. console.log('zh:AD 失败,直接发放奖励');
  24101. this.qjff_AD_for_uigetAward();
  24102. }
  24103. }
  24104. qjff_AD_for_uigetAward() {
  24105. this.getAward(3);
  24106. }
  24107. normalGetAward() {
  24108. if (PlatMgr.isMisVideo())
  24109. this.tripleGetAward();
  24110. else
  24111. this.getAward();
  24112. }
  24113. getAward(times = 1) {
  24114. this.hide();
  24115. for (let index = 0; index < this.awardArr.length; index++) {
  24116. this.awardArr[index].num *= times;
  24117. }
  24118. this.callback && this.callback(times != 1);
  24119. }
  24120. getIcon(type) {
  24121. switch (type) {
  24122. case Prop.diamond:
  24123. return "ty_zs";
  24124. case Prop.coin:
  24125. return "ty_jb";
  24126. case Prop.gan1:
  24127. return "qg1";
  24128. case Prop.gan2:
  24129. return "qg2";
  24130. case Prop.gan3:
  24131. return "qg3";
  24132. case Prop.gan4:
  24133. return "qg4";
  24134. default:
  24135. break;
  24136. }
  24137. }
  24138. getNameStr(type) {
  24139. switch (type) {
  24140. case Prop.diamond:
  24141. return "Diamond";
  24142. case Prop.coin:
  24143. return "Coins";
  24144. case Prop.gan1:
  24145. case Prop.gan2:
  24146. case Prop.gan3:
  24147. case Prop.gan4:
  24148. return cfgTable.ballrodData[type - 1].name;
  24149. default:
  24150. break;
  24151. }
  24152. }
  24153. }
  24154. UIGetAward$1.uiName = "UIGetAward";
  24155. class UIBox$1 extends UIBase {
  24156. constructor() {
  24157. super();
  24158. this.boxNum = 0;
  24159. this.boxMax = 10;
  24160. this.inAd = false;
  24161. this.isClose = false;
  24162. }
  24163. onConstructor() {
  24164. this.ui = ui_UIBox.createInstance();
  24165. this.contentPane = this.ui;
  24166. this.isEject = false;
  24167. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24168. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24169. Laya.timer.loop(1000, this, this.update);
  24170. }
  24171. update() {
  24172. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24173. this.boxNum -= 1;
  24174. this.upBar();
  24175. }
  24176. }
  24177. upBar() {
  24178. if (this.boxNum > this.boxMax)
  24179. this.boxNum = this.boxMax;
  24180. this.ui.bar.value = this.boxNum * 10;
  24181. }
  24182. show() {
  24183. super.show();
  24184. this.isClose = false;
  24185. this.boxNum = 0;
  24186. this.inAd = false;
  24187. this.upBar();
  24188. this.ui.t0.play();
  24189. this.ui.closeBtn.visible = false;
  24190. Laya.timer.once(3000, this, () => {
  24191. this.ui.closeBtn.visible = true;
  24192. this.ui.bar.alpha = 1;
  24193. });
  24194. Laya.timer.once(500, this, () => {
  24195. this.ui.t1.play();
  24196. });
  24197. this.setGlobalFont(this.ui);
  24198. }
  24199. hide() {
  24200. Laya.timer.clearAll(this);
  24201. Moyu.showBannerAd(false);
  24202. super.hide();
  24203. }
  24204. onOpenBox() {
  24205. this.boxNum++;
  24206. if (this.boxNum < this.boxMax) {
  24207. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24208. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24209. }
  24210. }
  24211. else if (this.boxNum == this.boxMax) {
  24212. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24213. this.ui.openBtn.c1.selectedIndex = 13;
  24214. this.inAd = true;
  24215. }
  24216. else
  24217. this.getAward();
  24218. }
  24219. else if (this.inAd) {
  24220. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24221. if (Laya.Browser.onAndroid) {
  24222. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24223. if (!boo) {
  24224. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24225. return;
  24226. }
  24227. }
  24228. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24229. }
  24230. else {
  24231. console.log('zh:AD 失败,直接发放奖励');
  24232. this.qjff_AD_for_UIBOX_onOpenBox();
  24233. }
  24234. }
  24235. this.upBar();
  24236. }
  24237. qjff_AD_for_UIBOX_onOpenBox() {
  24238. this.getAward();
  24239. }
  24240. onCloseBox() {
  24241. if (this.isClose)
  24242. this.hide();
  24243. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24244. this.isClose = true;
  24245. PlatMgr.showBanner(true, 0, 3000);
  24246. }
  24247. else
  24248. this.hide();
  24249. }
  24250. getAward() {
  24251. let str = "";
  24252. if (Math.random() < 0.5) {
  24253. let max = Moyu.isLegal ? 500 : 2500;
  24254. let num = xGame.tools.random(max, 500 + max);
  24255. DataMgr.setCoin(num);
  24256. str = "金币x" + num;
  24257. }
  24258. else {
  24259. let max = Moyu.isLegal ? 10 : 30;
  24260. let num = xGame.tools.random(max, 30 + max);
  24261. DataMgr.setDiamond(num);
  24262. str = "钻石x" + num;
  24263. }
  24264. xGame.showTip("恭喜获得-" + str);
  24265. this.hide();
  24266. }
  24267. }
  24268. UIBox$1.uiName = "UIBox";
  24269. class UIMain$1 extends UIBase {
  24270. constructor() {
  24271. super();
  24272. this.firstEnter = true;
  24273. this.moni_click_count = 0;
  24274. }
  24275. nativeCallJs(msg) {
  24276. let t = msg;
  24277. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24278. switch (t) {
  24279. case 'qjff_chouJiang':
  24280. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24281. dui.qjff_chouJiang();
  24282. break;
  24283. case 'qjff_AD_for_uisign':
  24284. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24285. dui2.qjff_AD_for_uisign();
  24286. break;
  24287. case 'qjff_AD_for_uitry':
  24288. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24289. dui3.qjff_AD_for_uitry();
  24290. break;
  24291. case 'qjff_AD_for_uipower':
  24292. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24293. dui4.qjff_AD_for_uipower();
  24294. break;
  24295. case 'qjff_AD_for_uigetAward':
  24296. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24297. dui5.qjff_AD_for_uigetAward();
  24298. break;
  24299. case 'qjff_AD_for_uiGameEnd':
  24300. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24301. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24302. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24303. break;
  24304. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24305. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24306. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24307. break;
  24308. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24309. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24310. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24311. break;
  24312. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24313. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24314. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24315. break;
  24316. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24317. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24318. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24319. break;
  24320. case 'qjff_AD_for_UIBOX_onOpenBox':
  24321. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24322. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24323. break;
  24324. case 'qjff_AD_for_UIAddCoin':
  24325. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24326. dui12.qjff_AD_for_UIAddCoin();
  24327. break;
  24328. case 'app_sign_for_buyProduct_onSuccess':
  24329. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24330. DataMgr.getUserZiChanInfo(false);
  24331. break;
  24332. case '222axxxxxx':
  24333. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24334. dui15.qjff_AD_for_uisign();
  24335. break;
  24336. case '333axsxxxxxx':
  24337. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24338. dui16.qjff_AD_for_uisign();
  24339. break;
  24340. default:
  24341. console.log('zh:未知的方法名字' + t);
  24342. break;
  24343. }
  24344. }
  24345. onConstructor() {
  24346. console.log('zh: UIMain onConstructor');
  24347. this.ui = ui_UIMain.createInstance();
  24348. this.contentPane = this.ui;
  24349. this.isEject = false;
  24350. this.addEvent();
  24351. this.addClickSpine();
  24352. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24353. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24354. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24355. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24356. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24357. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24358. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24359. let curUse = DataMgr.getCurSecretary();
  24360. this.changeSecretary(curUse);
  24361. this.ui.talkNode.visible = false;
  24362. let guide = DataMgr.getSkillGuide();
  24363. if (xGame.common.isNewDay && guide == 1) {
  24364. xGame.common.isNewDay = false;
  24365. xGame.soundMgr.playSound("s_main01");
  24366. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24367. console.log("zh:播放小秘书每天语音");
  24368. }
  24369. this.onGetUserInfo();
  24370. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24371. DataMgr.getUserZiChanInfo(false);
  24372. }
  24373. this.ui.n83.visible = false;
  24374. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24375. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24376. let ua = d.username;
  24377. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24378. }
  24379. this.c_btn_for_user();
  24380. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24381. }
  24382. Logout() {
  24383. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24384. LocalStorageManager.removeItem(keyForLoginInfo);
  24385. this.freshUser();
  24386. }
  24387. JSBridgeUtils.instance.loginOutForApp();
  24388. this.setUserDefaultNickname();
  24389. DataMgr.setCoin2(4000);
  24390. DataMgr.setDiamond2(0);
  24391. this.setDefaultQiuGanInfo();
  24392. DataMgr.setPlaceBallLevelList("");
  24393. DataMgr.setChallengeMode_overLev(1);
  24394. this.setDefaultSignData();
  24395. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  24396. }
  24397. setDefaultSignData() {
  24398. DataMgr.setSignData(1);
  24399. DataMgr.setSignTime(new Date().getTime());
  24400. }
  24401. setDefaultQiuGanInfo() {
  24402. DataMgr.setBallRod(0, 1);
  24403. DataMgr.setBallRod(1, 0);
  24404. DataMgr.setBallRod(2, 0);
  24405. DataMgr.setBallRod(3, 0);
  24406. DataMgr.setBallRod(4, 0);
  24407. DataMgr.setBallRod(5, 1);
  24408. }
  24409. setUserDefaultNickname() {
  24410. let defUsername = "player";
  24411. this.ui.headNode.nameTxt.text = defUsername;
  24412. DataMgr.updateUserNickName(defUsername);
  24413. Moyu.updateUserInfo(defUsername);
  24414. }
  24415. gotoLogin() {
  24416. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24417. xGame.uiMgr.Show(UILogin$1);
  24418. }
  24419. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24420. this.Logout();
  24421. }
  24422. }
  24423. gotoRegUser() {
  24424. xGame.uiMgr.Show(UIReg$1);
  24425. }
  24426. showFuLiSp1() {
  24427. console.log('zh:福利1');
  24428. DataMgr.checkForShowFuLi17AndAlert(1);
  24429. }
  24430. showFuLiSp7() {
  24431. console.log('zh:福利7');
  24432. DataMgr.checkForShowFuLi17AndAlert(7);
  24433. }
  24434. c_btn_for_user() {
  24435. this.ui.n_dengLu.c1.selectedIndex = 0;
  24436. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24437. this.ui.n_dengLu.c1.selectedIndex = 1;
  24438. }
  24439. else {
  24440. this.ui.n_dengLu.c1.selectedIndex = 0;
  24441. }
  24442. }
  24443. changeSecretary(curUse) {
  24444. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24445. xGame.common.secretary && xGame.common.secretary.dispose();
  24446. this.addSecretarySpine(name);
  24447. }
  24448. addSecretarySpine(name) {
  24449. let spine = new SpineMgr(name, () => {
  24450. this.playSecretaryIdle();
  24451. });
  24452. xGame.common.secretary = spine;
  24453. }
  24454. addClickSpine() {
  24455. let clickSpine = new SpineMgr("dianji", () => {
  24456. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24457. let parent = Laya.stage;
  24458. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24459. clickSpine.play(data, 0, false, parent, (spine) => {
  24460. spine.destroy(true);
  24461. });
  24462. });
  24463. });
  24464. }
  24465. addEvent() {
  24466. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24467. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24468. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24469. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24470. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24471. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24472. this.addUIClick(this.ui, this.interuptSecretary);
  24473. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24474. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24475. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24476. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24477. this.addUIClick(this.ui.signBtn, this.openSignView);
  24478. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24479. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24480. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  24481. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24482. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24483. }
  24484. show(showFailWords) {
  24485. super.show();
  24486. DataMgr.loadUserSpOrderForAd();
  24487. this.moneyNode.ui.c1.selectedIndex = 1;
  24488. this.playSecretaryIdle();
  24489. xGame.soundMgr.playMusic("caromhall01", 0);
  24490. Laya.timer.clearAll(this);
  24491. this.playSecretaryRandomSound();
  24492. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24493. if (showFailWords) {
  24494. console.log('zh:uimain.ts ');
  24495. setTimeout(() => {
  24496. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24497. let words = -1;
  24498. if (str == "s_main02") {
  24499. words = 2;
  24500. }
  24501. else {
  24502. words = 3;
  24503. }
  24504. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24505. xGame.soundMgr.playSound(str);
  24506. }, 300);
  24507. }
  24508. this.showGuide();
  24509. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24510. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24511. let guide = DataMgr.getSkillGuide();
  24512. if (guide == 1) {
  24513. let randTime = xGame.common.randomNum(300, 800);
  24514. if (this.firstEnter) {
  24515. console.log("zh: firstEnter");
  24516. this.firstEnter = false;
  24517. randTime += 900;
  24518. }
  24519. else {
  24520. console.log("zh: no firstEnter");
  24521. }
  24522. Laya.timer.once(randTime, this, () => {
  24523. });
  24524. Laya.timer.once(1000, this, () => {
  24525. console.log('zh: 1秒后 showFuLiSp7');
  24526. this.showFuLiSp7();
  24527. });
  24528. this.showTipForGuest();
  24529. }
  24530. this.setGlobalFont(this.ui);
  24531. }
  24532. showTipForGuest() {
  24533. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24534. if (userInfo == null) {
  24535. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  24536. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  24537. let woman = "this is an important notice.";
  24538. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  24539. return;
  24540. }
  24541. }
  24542. checkActive(show) {
  24543. }
  24544. showGuide() {
  24545. let guide = DataMgr.getSkillGuide();
  24546. this.ui.guideBtn.visible = guide == 0;
  24547. this.ui.enterGuide.visible = false;
  24548. this.ui.secretaryGuide.visible = guide == 0;
  24549. if (guide == 0) {
  24550. console.log("zh:显示引导");
  24551. xGame.soundMgr.playSound("s_guide");
  24552. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24553. }
  24554. else {
  24555. console.log("zh:不需要显示引导");
  24556. }
  24557. }
  24558. ensureSecretary() {
  24559. console.log('zh: ensureSecretary ');
  24560. this.ui.secretaryGuide.visible = false;
  24561. this.ui.enterGuide.visible = true;
  24562. this.ui.wordsNode.t0.play();
  24563. if (DataMgr.getNewUser())
  24564. Moyu.sendDataEvent("gameReady");
  24565. }
  24566. playSecretaryIdle() {
  24567. let parent = this.ui.secretary.displayObject;
  24568. parent.destroyChildren();
  24569. let xx = this.ui.secretary.width / 2;
  24570. let yy = this.ui.secretary.height;
  24571. let scale = xGame.common.getSecretaryScale();
  24572. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24573. xGame.common.secretary.play(data, 0, true, parent);
  24574. }
  24575. startGame(type) {
  24576. if (!this.isReadyForLoadNetSource()) {
  24577. return;
  24578. }
  24579. xGame.common.gameMode = type;
  24580. Moyu.sendDataEvent("PlayGame", { type: type });
  24581. let gm = xGame.common.gameMode;
  24582. console.log('zh:进入游戏gameMode =' + gm);
  24583. switch (gm) {
  24584. case GameMode.classic:
  24585. console.log('zh:进入经典模式111111111');
  24586. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24587. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24588. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  24589. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  24590. console.log('zh:判断是否可以玩该模式classic =NO');
  24591. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  24592. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24593. return;
  24594. }
  24595. else {
  24596. console.log('zh:可以玩该模式classic');
  24597. this.beginGame();
  24598. }
  24599. }
  24600. else {
  24601. console.log('zh:不需要判断是否可以玩该classic');
  24602. let challengeTimes = DataMgr.getChallengeTimes();
  24603. if (challengeTimes == 0) {
  24604. xGame.uiMgr.Show(UIInvitation$1);
  24605. }
  24606. else {
  24607. this.beginGame();
  24608. }
  24609. }
  24610. break;
  24611. case GameMode.bigMove:
  24612. console.info('zh:bigMove check 大招');
  24613. let guide = DataMgr.getSkillGuide();
  24614. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  24615. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24616. console.log('zh:bigMove db_over_lev=', db_over_lev);
  24617. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  24618. console.log('zh:提示不可以玩');
  24619. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  24620. xGame.uiMgr.Show(UIMsg$1, tipStr);
  24621. return;
  24622. }
  24623. else {
  24624. console.log('zh:可以玩该模式 bigMove');
  24625. this.beginGame();
  24626. if (DataMgr.getNewUser())
  24627. Moyu.sendDataEvent("gameStart0");
  24628. }
  24629. }
  24630. else {
  24631. this.beginGame();
  24632. if (DataMgr.getNewUser())
  24633. Moyu.sendDataEvent("gameStart0");
  24634. }
  24635. break;
  24636. default:
  24637. console.error('zh:未知错误!!!!');
  24638. break;
  24639. }
  24640. }
  24641. beginGame(isNice = false) {
  24642. console.log('zh:beginGame ');
  24643. let guide = DataMgr.getSkillGuide();
  24644. if (guide == 1) {
  24645. console.log('zh:非新手引导,showInternAd ');
  24646. JSBridgeUtils.instance.showInternAd('beginGame');
  24647. }
  24648. else {
  24649. console.log('zh:新手引导,不显示AD ');
  24650. }
  24651. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  24652. console.log('zh:beginGame 1');
  24653. if (xGame.common.gameMode == GameMode.classic) {
  24654. console.log('zh:beginGame 2');
  24655. if (isNice) {
  24656. console.log('zh:进入巅峰赛');
  24657. this.enterClassic();
  24658. }
  24659. else {
  24660. console.log('zh:beginGame 3-1');
  24661. xGame.uiMgr.Show(UIModeSelection$1, () => {
  24662. console.log('zh:beginGame 3-2');
  24663. this.enterClassic();
  24664. });
  24665. }
  24666. }
  24667. else if (xGame.common.gameMode == GameMode.bigMove) {
  24668. console.log('zh:beginGame 5');
  24669. this.ui.enterGuide.visible = false;
  24670. xGame.uiMgr.Show(UISkill$1);
  24671. }
  24672. }
  24673. enterClassic() {
  24674. console.log('zh:beginGame 7');
  24675. xGame.uiMgr.Show(UIGame$1);
  24676. xGame.uiMgr.Show(UIMatching$1, () => {
  24677. if (!this.isHide)
  24678. this.hide();
  24679. xGame.common.gameUI.ui.alpha = 1;
  24680. console.log('zh:beginGame 8');
  24681. xGame.common.gameUI.startGame();
  24682. xGame.uiMgr.Hide(UIGameEnd$1);
  24683. });
  24684. }
  24685. start_debug_for_moni_payOk() {
  24686. let ccc = this.moni_click_count + 1;
  24687. this.moni_click_count = ccc;
  24688. if (ccc % 5 == 0) {
  24689. console.log('zh:start_debug_for_moni_payOk');
  24690. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24691. if (userInfo != null) {
  24692. let token = userInfo.token;
  24693. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  24694. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  24695. alert('模拟支付OK');
  24696. return;
  24697. }
  24698. else {
  24699. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24700. }
  24701. }
  24702. }
  24703. startGlobal() {
  24704. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  24705. }
  24706. startWeekly() {
  24707. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  24708. }
  24709. zhouSaiMonth() {
  24710. console.log('zh: zhouSaiMonth 被调用');
  24711. }
  24712. isReadyForLoadNetSource() {
  24713. let reqCount = xGame.cfgMgr.httpReqCount;
  24714. let ok = xGame.cfgMgr.httpReqOkCount;
  24715. if (reqCount > ok) {
  24716. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  24717. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  24718. Laya.timer.once(5000, this, () => {
  24719. let retryCount = 0;
  24720. const maxRetries = 3;
  24721. const tryFetchConfig = () => {
  24722. try {
  24723. xGame.cfgMgr.getConfigFromServer();
  24724. }
  24725. catch (error) {
  24726. if (retryCount < maxRetries) {
  24727. retryCount++;
  24728. console.log(`🔄 第${retryCount}次重试获取配置...`);
  24729. Laya.timer.once(5000, this, tryFetchConfig);
  24730. }
  24731. else {
  24732. console.error("❌ 达到最大重试次数,配置获取失败");
  24733. }
  24734. }
  24735. };
  24736. tryFetchConfig();
  24737. });
  24738. return false;
  24739. }
  24740. return true;
  24741. }
  24742. startPlaceBall() {
  24743. if (!this.isReadyForLoadNetSource()) {
  24744. return;
  24745. }
  24746. xGame.uiMgr.Show(UILevelDisplay$1);
  24747. }
  24748. hide() {
  24749. console.log('zh:uimain hide ...');
  24750. super.hide();
  24751. xGame.common.stopGirlPop(this.ui.talkNode);
  24752. }
  24753. onGetUserInfo(force = false) {
  24754. if (Moyu.isWx) {
  24755. let info = Moyu.getSystemInfo();
  24756. if (info)
  24757. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  24758. }
  24759. else {
  24760. Moyu.initUser(this, this.freshUser, force);
  24761. }
  24762. this.freshUser();
  24763. console.log('zh:5秒后更新用户信息');
  24764. setTimeout(() => {
  24765. DataMgr.getUserZiChanInfo(true);
  24766. }, 5000);
  24767. }
  24768. event_login_in() {
  24769. console.log("zh:event_login_in被触发");
  24770. this.freshUser();
  24771. }
  24772. freshUser() {
  24773. let user = Moyu.getUserInfo();
  24774. if (!user.isAuth) {
  24775. user.headIcon = 'res/ty_touxiang.png';
  24776. }
  24777. else {
  24778. DataMgr.upRankData();
  24779. }
  24780. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  24781. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  24782. let keyStr = keyForLoginInfo;
  24783. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24784. const d = LocalStorageManager.getItem(keyStr);
  24785. let ua = d.username;
  24786. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24787. }
  24788. else {
  24789. }
  24790. this.c_btn_for_user();
  24791. }
  24792. interuptSecretary() {
  24793. Laya.timer.clearAll(this);
  24794. this.playSecretaryRandomSound();
  24795. }
  24796. playSecretaryRandomSound() {
  24797. if (this.isHide)
  24798. return;
  24799. let time = xGame.common.randomNum(45000, 60000);
  24800. Laya.timer.once(time, this, () => {
  24801. if (this.isHide)
  24802. return;
  24803. let index = xGame.common.randomNum(4, 7);
  24804. xGame.soundMgr.playSound("s_main0" + index);
  24805. let words = 1;
  24806. switch (index) {
  24807. case 4:
  24808. words = 5;
  24809. break;
  24810. case 5:
  24811. words = 3;
  24812. break;
  24813. case 6:
  24814. words = 6;
  24815. break;
  24816. case 7:
  24817. words = 7;
  24818. break;
  24819. default:
  24820. break;
  24821. }
  24822. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24823. this.playSecretaryRandomSound();
  24824. });
  24825. }
  24826. openSecretaryView() {
  24827. xGame.uiMgr.Show(UISecretary$1);
  24828. Moyu.sendDataEvent("secretary");
  24829. }
  24830. openShopView() {
  24831. xGame.uiMgr.Show(UIShop$1, 1);
  24832. }
  24833. openShopView0() {
  24834. xGame.uiMgr.Show(UIShop$1, 0);
  24835. }
  24836. openSignView() {
  24837. xGame.uiMgr.Show(UISign$1);
  24838. }
  24839. openDrawView() {
  24840. xGame.uiMgr.Show(UIDraw$1);
  24841. }
  24842. openRanking() {
  24843. console.log('zh:phb openRanking');
  24844. xGame.uiMgr.Show(UIRanking$1);
  24845. Moyu.sendDataEvent("rankingList");
  24846. }
  24847. }
  24848. UIMain$1.uiName = "UIMain";
  24849. function InitShader() {
  24850. }
  24851. function appInit() {
  24852. xGame.context.init(getLoadingResList(), initCallback);
  24853. }
  24854. function getLoadingResList() {
  24855. return [
  24856. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  24857. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  24858. ];
  24859. }
  24860. function getGameResList() {
  24861. return [
  24862. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  24863. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  24864. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  24865. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  24866. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  24867. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  24868. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  24869. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  24870. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  24871. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  24872. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  24873. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  24874. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  24875. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  24876. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  24877. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  24878. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  24879. ];
  24880. }
  24881. function initCallback() {
  24882. window["DataMgr"] = DataMgr;
  24883. DataMgr.Init();
  24884. Moyu.init(getPlat(), this, () => {
  24885. DataMgr.isNewDay();
  24886. PlatMgr.initConfig();
  24887. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  24888. }, true);
  24889. console.log('zh:开始sm init1 start');
  24890. xGame.soundMgr.init();
  24891. console.log('zh:开始sm init1 end');
  24892. xGame.uiMgr.init();
  24893. xGame.uiMgr.clearTempData();
  24894. xGame.uiMgr.bindFUI(fguiRes.loading);
  24895. xGame.uiMgr.Show(UILoading);
  24896. }
  24897. function onFontLoaded() {
  24898. try {
  24899. Laya.Text.defaultFont = "arial";
  24900. console.log("zh: onFontLoaded 设置arial字体成功");
  24901. }
  24902. catch (error) {
  24903. console.log("zh: constructor onFontLoaded加载arial字体失败");
  24904. }
  24905. }
  24906. function loadSubRes(callback) {
  24907. var tab = ["asset", "res", "spine"];
  24908. let subDone = 0;
  24909. for (var i = 0; i < tab.length; i++) {
  24910. let sub = tab[i];
  24911. Moyu.loadSubRes(sub, (pro) => {
  24912. callback && callback(pro, false);
  24913. }).then(() => {
  24914. subDone++;
  24915. if (subDone >= tab.length)
  24916. callback && callback(1, true);
  24917. });
  24918. }
  24919. }
  24920. function enterGame() {
  24921. xGame.cfgMgr.init();
  24922. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  24923. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  24924. xGame.uiMgr.Hide(UILoading);
  24925. fgui.UIPackage.removePackage(fguiRes.loading);
  24926. xGame.uiMgr.bindFUI(fguiRes.game);
  24927. xGame.uiMgr.Show(UIMain$1);
  24928. if (DataMgr.getNewUser())
  24929. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  24930. }
  24931. function getPlat() {
  24932. let cfg = new MoyuCfg();
  24933. cfg.plat = MoyuPlat.web;
  24934. cfg.myId = 180;
  24935. cfg.myKey = '8848a885774230a4';
  24936. cfg.version = 0;
  24937. if (window.hasOwnProperty("gamebox")) {
  24938. cfg.plat = MoyuPlat.f399;
  24939. cfg.version = 0;
  24940. }
  24941. else if (window.hasOwnProperty("ks")) {
  24942. cfg.plat = MoyuPlat.ks;
  24943. cfg.version = 0;
  24944. cfg.ads.ksVideoId = '2300002254_01';
  24945. cfg.ads.ksInsertId = '2300002254_02';
  24946. }
  24947. else if (Laya.Browser.onTTMiniGame) {
  24948. cfg.plat = MoyuPlat.tt;
  24949. cfg.version = 0;
  24950. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  24951. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  24952. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  24953. }
  24954. else if (Laya.Browser.onMiniGame) {
  24955. cfg.plat = MoyuPlat.wx;
  24956. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  24957. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  24958. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  24959. }
  24960. else if (Laya.Browser.onQQMiniGame) {
  24961. cfg.plat = MoyuPlat.qq;
  24962. }
  24963. else if (Laya.Browser.onQGMiniGame) {
  24964. cfg.plat = MoyuPlat.op;
  24965. cfg.ads.opVideoId = '455502';
  24966. cfg.ads.opBannerId = '455507';
  24967. }
  24968. else if (Laya.Browser.onVVMiniGame) {
  24969. cfg.plat = MoyuPlat.vv;
  24970. cfg.version = 0;
  24971. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  24972. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  24973. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  24974. }
  24975. else if (Laya.Browser.onHWMiniGame) {
  24976. cfg.plat = MoyuPlat.hw;
  24977. }
  24978. else if (window["mz"]) {
  24979. cfg.plat = MoyuPlat.mz;
  24980. }
  24981. else {
  24982. let cfg = window['conchConfig'];
  24983. if (cfg) {
  24984. var os = cfg.getOS();
  24985. if (os == "Conch-ios") {
  24986. cfg.plat = MoyuPlat.ios;
  24987. }
  24988. else if (os == "Conch-android") {
  24989. }
  24990. }
  24991. }
  24992. return cfg;
  24993. }
  24994. class Main {
  24995. constructor() {
  24996. if (window["Laya3D"])
  24997. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  24998. else {
  24999. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25000. this.initMain();
  25001. }
  25002. }
  25003. initMain() {
  25004. Laya["Physics"] && Laya["Physics"].enable();
  25005. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25006. Laya.stage.scaleMode = GameConfig.scaleMode;
  25007. Laya.stage.screenMode = GameConfig.screenMode;
  25008. Laya.stage.alignV = GameConfig.alignV;
  25009. Laya.stage.alignH = GameConfig.alignH;
  25010. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25011. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25012. Laya.enableDebugPanel();
  25013. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25014. Laya["PhysicsDebugDraw"].enable();
  25015. if (GameConfig.stat)
  25016. Laya.Stat.show();
  25017. Laya.alertGlobalError(true);
  25018. this.loadFont();
  25019. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25020. }
  25021. loadFont() {
  25022. try {
  25023. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25024. console.log("zh: constructor加载arial字体成功1");
  25025. }
  25026. catch (error) {
  25027. console.log("zh: constructor加载arial字体失败1");
  25028. }
  25029. }
  25030. onFontLoaded() {
  25031. try {
  25032. Laya.Text.defaultFont = "Arial";
  25033. console.log("zh: onFontLoaded 设置arial字体成功1");
  25034. }
  25035. catch (error) {
  25036. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25037. }
  25038. }
  25039. onVersionLoaded() {
  25040. appInit();
  25041. }
  25042. }
  25043. new Main();
  25044. }());
  25045. //# sourceMappingURL=bundle.js.map