bundle.js 997 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924
  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. console.log('zh:点击之后=判断引导');
  3129. this.checkGuide();
  3130. this.checkGuideForLianXi();
  3131. }
  3132. checkGuide() {
  3133. let guide = DataMgr.getSkillGuide();
  3134. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 0) {
  3135. xGame.common.guideStep++;
  3136. xGame.common.gameUI.ui.guide1.visible = false;
  3137. xGame.common.gameUI.ui.guide2.visible = true;
  3138. }
  3139. }
  3140. checkGuideForLianXi() {
  3141. let guide_lianxi = DataMgr.getLianXiGuide();
  3142. if (guide_lianxi == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 0) {
  3143. xGame.common.guideStepForLianXi = 1;
  3144. xGame.common.gameUI.ui.n_lxms_yd1.visible = true;
  3145. return;
  3146. }
  3147. if (guide_lianxi == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 1) {
  3148. xGame.common.guideStepForLianXi = 2;
  3149. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  3150. xGame.common.gameUI.ui.n_lxms_yd2.visible = true;
  3151. }
  3152. else {
  3153. console.log('zh: xGame.common.guideStepForLianXi=' + xGame.common.guideStepForLianXi);
  3154. }
  3155. }
  3156. checkDistance(disX, disY, angle) {
  3157. let diameter = this.gameObj.width - 1;
  3158. let dis = Math.pow(disX - this.gameObj.x, 2) + Math.pow(disY - this.gameObj.y, 2);
  3159. if (!this.lastDis)
  3160. this.lastDis = dis;
  3161. else {
  3162. if (dis > this.lastDis) {
  3163. this.helpOut.type = "remove";
  3164. return this.helpOut;
  3165. }
  3166. }
  3167. if (dis <= Math.pow(diameter, 2)) {
  3168. let del = 0.01;
  3169. let offest = 0;
  3170. let realX = disX - this.gameObj.x;
  3171. let realY = disY - this.gameObj.y;
  3172. while (Math.pow(diameter, 2) - (realX * realX + realY * realY) > 0.01) {
  3173. offest += del;
  3174. realX = (disX - this.gameObj.x) - offest * Math.sin(angle * Math.PI / 180);
  3175. realY = (disY - this.gameObj.y) - offest * -Math.cos(angle * Math.PI / 180);
  3176. }
  3177. this.helpOut.type = "ok";
  3178. this.helpOut.x = realX + this.gameObj.x;
  3179. this.helpOut.y = realY + this.gameObj.y;
  3180. return this.helpOut;
  3181. }
  3182. else {
  3183. this.helpOut.type = "no";
  3184. return this.helpOut;
  3185. }
  3186. }
  3187. clearBallEft() {
  3188. this.clearBallRightEft();
  3189. this.clearBallWrongEft();
  3190. }
  3191. clearBallRightEft() {
  3192. this.ui.breathAni.stop();
  3193. this.ui.rightTips.visible = false;
  3194. }
  3195. clearBallWrongEft() {
  3196. this.ui.wrongTips.visible = false;
  3197. }
  3198. showWrongEft() {
  3199. if (!xGame.common.gameMgr.selfTurn)
  3200. return;
  3201. this.ui.wrongTips.visible = true;
  3202. }
  3203. showRightEft() {
  3204. if (!xGame.common.gameMgr.selfTurn)
  3205. return;
  3206. this.ui.rightTips.visible = true;
  3207. this.ui.rightTips.scaleX = 1;
  3208. this.ui.rightTips.scaleY = 1;
  3209. this.ui.breathAni.play();
  3210. }
  3211. setBallFunc(type, owner) {
  3212. if (type == "ice") {
  3213. this.ballFunc = type;
  3214. this.d3BallSrc.setAlbedoTexture(true);
  3215. this.rigy.type = "static";
  3216. this.iceOwner = owner;
  3217. }
  3218. else {
  3219. if (owner == this.iceOwner) {
  3220. this.ballFunc = type;
  3221. this.d3BallSrc.setAlbedoTexture(false);
  3222. this.rigy.type = "dynamic";
  3223. }
  3224. }
  3225. }
  3226. }
  3227. D2BallSrc._unid = 0;
  3228. class D2RootBallSrc extends D2BallSrc {
  3229. constructor() {
  3230. super();
  3231. this.maxSpeed = 0;
  3232. this.classicMaxSpeed = 2.2;
  3233. this.bigSkillMaxSpeed = 4;
  3234. this.angle = 0;
  3235. this.allPercent = 0;
  3236. this.linearPercent = 0;
  3237. this.anglePercent = 0;
  3238. this.maxAngleRate = 0.6;
  3239. this.baseRot = 7;
  3240. this.angleMax = 0;
  3241. this.speed = new Laya.Vector2();
  3242. this.rotSpeed = new Laya.Vector2();
  3243. }
  3244. isStill() {
  3245. let speed = this.rigy.linearVelocity;
  3246. if (Math.abs(speed.x) <= this.stillSpeed && Math.abs(speed.y) <= this.stillSpeed && !this.forceRun) {
  3247. if (this.anglePercent <= 0.1) {
  3248. this.rigy.linearVelocity = { x: 0, y: 0 };
  3249. return true;
  3250. }
  3251. }
  3252. return false;
  3253. }
  3254. reset() {
  3255. this.linearPercent = 0;
  3256. this.anglePercent = 0;
  3257. }
  3258. setSpeed(percent, angle) {
  3259. this.allPercent = percent;
  3260. this.angle = angle;
  3261. this.setAngleSpeed();
  3262. this.setLinearSpeed();
  3263. let hit = "hit";
  3264. if (percent < 25)
  3265. hit = "hit03";
  3266. else if (percent < 50)
  3267. hit = "hit02";
  3268. else if (percent < 75)
  3269. hit = "hit01";
  3270. xGame.soundMgr.playSound(hit);
  3271. }
  3272. setAngleSpeed() {
  3273. let offest = xGame.common.rodOffest;
  3274. let radius = 82;
  3275. let rate = Math.abs(offest.y / radius) * 0.5;
  3276. if (offest.y > 0)
  3277. this.angleMax = -this.baseRot * 2;
  3278. else
  3279. this.angleMax = this.baseRot;
  3280. this.rotY = -offest.x / radius * 100;
  3281. this.anglePercent = this.maxAngleRate * rate * this.allPercent;
  3282. this.linearPercent = this.allPercent - this.anglePercent;
  3283. }
  3284. setLinearSpeed() {
  3285. if (xGame.common.gameMode == GameMode.classic && DataMgr.getChallengeTimes() == 3) {
  3286. if (xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.aiBallArr.length <= 2 && xGame.common.gameMgr.ensureBallType) {
  3287. if (!xGame.common.longHelpLine) {
  3288. let offset = -150 + xGame.common.randomNum(0, 300);
  3289. offset /= 100;
  3290. this.angle += offset;
  3291. }
  3292. }
  3293. }
  3294. let sin = Math.sin(this.angle * Math.PI / 180);
  3295. let cos = Math.cos(this.angle * Math.PI / 180);
  3296. switch (xGame.common.gameMode) {
  3297. case GameMode.classic:
  3298. this.maxSpeed = this.classicMaxSpeed;
  3299. break;
  3300. case GameMode.bigMove:
  3301. this.maxSpeed = this.bigSkillMaxSpeed;
  3302. break;
  3303. case GameMode.placeBall:
  3304. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  3305. if (data.type == 1) {
  3306. this.maxSpeed = this.bigSkillMaxSpeed;
  3307. }
  3308. else {
  3309. this.maxSpeed = this.classicMaxSpeed;
  3310. }
  3311. break;
  3312. default:
  3313. break;
  3314. }
  3315. this.speed.x = this.maxSpeed * this.linearPercent * sin;
  3316. this.speed.y = -this.maxSpeed * this.linearPercent * cos;
  3317. this.rotSpeed.x = -this.angleMax * sin * this.anglePercent;
  3318. this.rotSpeed.y = this.angleMax * cos * this.anglePercent;
  3319. this.rigy.applyLinearImpulseToCenter(this.speed);
  3320. }
  3321. onUpdate() {
  3322. if (this.anglePercent > 0.1) {
  3323. this.anglePercent *= 0.97;
  3324. this.rotSpeed.x = -this.angleMax * Math.sin(this.angle * Math.PI / 180) * this.anglePercent;
  3325. this.rotSpeed.y = this.angleMax * Math.cos(this.angle * Math.PI / 180) * this.anglePercent;
  3326. this.rigy.applyForceToCenter(this.rotSpeed);
  3327. Laya.Vector2.normalize(this.rigy.linearVelocity, this.speed);
  3328. Laya.Vector2.normalize(this.rotSpeed, this.rotSpeed);
  3329. let num = Laya.Vector2.dot(this.speed, this.rotSpeed);
  3330. if (num > 0.9)
  3331. this.canRot = true;
  3332. }
  3333. else
  3334. this.canRot = true;
  3335. if (Math.abs(this.rotY) > 0.1)
  3336. this.rotY *= 0.98;
  3337. super.onUpdate();
  3338. }
  3339. destroySelf() {
  3340. super.destroySelf();
  3341. this.speed = null;
  3342. }
  3343. }
  3344. class D2Ball extends Laya.Sprite {
  3345. constructor(isRootBall = false) {
  3346. super();
  3347. this.ui = ui_D2Ball.createInstance();
  3348. this.pivotX = this.ui.width / 2;
  3349. this.pivotY = this.ui.width / 2;
  3350. this.x = 0;
  3351. this.y = 0;
  3352. this.addChild(this.ui.displayObject);
  3353. this.ui.displayObject.x += this.ui.width / 2;
  3354. this.ui.displayObject.y += this.ui.width / 2;
  3355. if (isRootBall) {
  3356. this.d2Src = this.addComponent(D2RootBallSrc);
  3357. }
  3358. else {
  3359. this.d2Src = this.addComponent(D2BallSrc);
  3360. }
  3361. this.d2Src.ui = this.ui;
  3362. this.addCircleCollider();
  3363. this.addInnerCircleCollider();
  3364. this.addRigyBody();
  3365. }
  3366. addCircleCollider() {
  3367. let colli = xGame.common.getCollider("circle");
  3368. colli.radius = this.ui.width / 2;
  3369. this.addComponentIntance(colli);
  3370. this.d2Src.outColli = colli;
  3371. colli.label = "ball";
  3372. }
  3373. addInnerCircleCollider() {
  3374. let colli = xGame.common.getCollider("circle");
  3375. colli.radius = this.ui.inner.width / 2;
  3376. colli.x = (this.ui.width - this.ui.inner.width) / 2;
  3377. colli.y = (this.ui.width - this.ui.inner.width) / 2;
  3378. this.addComponentIntance(colli);
  3379. this.d2Src.innerColli = colli;
  3380. colli.label = "inner";
  3381. }
  3382. addRigyBody() {
  3383. let rigy = xGame.common.getRigbody();
  3384. rigy.type = "dynamic";
  3385. this.addComponentIntance(rigy);
  3386. this.d2Src.rigy = rigy;
  3387. }
  3388. disposeSelf() {
  3389. if (!this.ui.isDisposed) {
  3390. this.ui.dispose();
  3391. this.ui.removeFromParent();
  3392. this.ui = null;
  3393. }
  3394. }
  3395. }
  3396. class ui_D2Gan extends fgui.GComponent {
  3397. static createInstance() {
  3398. return (fgui.UIPackage.createObject("game", "D2Gan"));
  3399. }
  3400. onConstruct() {
  3401. this.myIcon = (this.getChild("myIcon"));
  3402. this.selfRodIcon = (this.getChild("selfRodIcon"));
  3403. this.selfEftRoot = (this.getChild("selfEftRoot"));
  3404. this.self = (this.getChild("self"));
  3405. this.aiRodIcon = (this.getChild("aiRodIcon"));
  3406. this.aiEftRoot = (this.getChild("aiEftRoot"));
  3407. this.ai = (this.getChild("ai"));
  3408. }
  3409. }
  3410. ui_D2Gan.URL = "ui://isxx5ak7sdh33qp";
  3411. class D2Gan {
  3412. constructor() {
  3413. this.offset = 0.15;
  3414. this.cell = 1.5;
  3415. this.onBallCell = 0.4;
  3416. this.lastInfo = { x: 0, y: 0, rotation: 0 };
  3417. this.moveNum = 70;
  3418. this.rulerRate = 0.1;
  3419. this.ui = ui_D2Gan.createInstance();
  3420. this.changeSelfRod();
  3421. this.changeAIRod();
  3422. }
  3423. changeSelfRod() {
  3424. let index = DataMgr.getCurBallRod();
  3425. let data = cfgTable.ballrodData[index + 1];
  3426. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3427. this.selfMySpine && this.selfMySpine.dispose();
  3428. this.ui.selfRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3429. if (data.spine) {
  3430. this.ui.selfEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3431. this.selfMySpine = new SpineMgr(data.spine, () => {
  3432. let xx = this.ui.selfEftRoot.width / 2;
  3433. let yy = this.ui.selfEftRoot.height / 2;
  3434. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3435. let outSpine = this.selfMySpine.play(data, 0, true, this.ui.selfEftRoot.displayObject);
  3436. outSpine.rotation = -90;
  3437. });
  3438. }
  3439. }
  3440. changeAIRod() {
  3441. let length = Object.keys(cfgTable.ballrodData).length;
  3442. let rand = Math.floor(length * Math.random()) + 1;
  3443. let data = cfgTable.ballrodData[rand];
  3444. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3445. this.aiMySpine && this.aiMySpine.dispose();
  3446. this.ui.aiRodIcon.url = xGame.common.getGameIconUrl(data.img);
  3447. if (data.spine) {
  3448. this.ui.aiEftRoot.url = xGame.common.getGameIconUrl(data.img);
  3449. this.aiMySpine = new SpineMgr(data.spine, () => {
  3450. let xx = this.ui.aiEftRoot.width / 2;
  3451. let yy = this.ui.aiEftRoot.height / 2;
  3452. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  3453. let outSpine = this.aiMySpine.play(data, 0, true, this.ui.aiEftRoot.displayObject);
  3454. outSpine.rotation = -90;
  3455. });
  3456. }
  3457. }
  3458. setGanLastInfo() {
  3459. this.lastInfo.rotation = this.ui.rotation;
  3460. this.lastInfo.x = this.ui.x;
  3461. this.lastInfo.y = this.ui.y;
  3462. }
  3463. rotateSelf(flag, isRuler = false) {
  3464. let angle;
  3465. flag = flag * this.offset;
  3466. if (xGame.common.d2World.isHelpLineOnBall) {
  3467. angle = flag * this.onBallCell;
  3468. }
  3469. else {
  3470. angle = flag * this.cell;
  3471. }
  3472. if (isRuler) {
  3473. angle *= this.rulerRate;
  3474. }
  3475. this.ui.rotation += angle;
  3476. xGame.common.d2World.getHelpLine();
  3477. }
  3478. checkDistance() {
  3479. let target = xGame.common.d2World.targetBall;
  3480. let root = xGame.common.d2World.rootBall;
  3481. if (target == null) {
  3482. return 1;
  3483. }
  3484. let dis = Math.pow(target.gameObj.x - root.gameObj.x, 2) + Math.pow(target.gameObj.y - root.gameObj.y, 2);
  3485. if (dis <= 2500) {
  3486. return 5;
  3487. }
  3488. return 1;
  3489. }
  3490. rotDest(rot) {
  3491. this.ui.rotation = rot;
  3492. xGame.common.d2World.getHelpLine();
  3493. }
  3494. storagePower(powerNum) {
  3495. let pos = (powerNum / 100) * this.moveNum;
  3496. let xx = -Math.sin(Math.PI * this.ui.rotation / 180) * pos;
  3497. let yy = Math.cos(Math.PI * this.ui.rotation / 180) * pos;
  3498. this.ui.x = this.lastInfo.x + xx;
  3499. this.ui.y = this.lastInfo.y + yy;
  3500. }
  3501. shoot() {
  3502. this.storagePower(0);
  3503. this.ui.visible = false;
  3504. }
  3505. destroySelf() {
  3506. this.ui.selfEftRoot.displayObject && this.ui.selfEftRoot.displayObject.destroyChildren();
  3507. this.ui.aiEftRoot.displayObject && this.ui.aiEftRoot.displayObject.destroyChildren();
  3508. this.selfMySpine && this.selfMySpine.dispose();
  3509. this.aiMySpine && this.aiMySpine.dispose();
  3510. this.lastInfo = null;
  3511. if (!this.ui.isDisposed) {
  3512. this.ui.removeFromParent();
  3513. this.ui.dispose();
  3514. }
  3515. }
  3516. }
  3517. class ui_HelpLine extends fgui.GComponent {
  3518. static createInstance() {
  3519. return (fgui.UIPackage.createObject("game", "HelpLine"));
  3520. }
  3521. onConstruct() {
  3522. this.n10 = (this.getChild("n10"));
  3523. this.rect = (this.getChild("rect"));
  3524. this.dir11 = (this.getChild("dir11"));
  3525. this.dir = (this.getChild("dir"));
  3526. this.rootDir = (this.getChild("rootDir"));
  3527. this.dirDot = (this.getChild("dirDot"));
  3528. }
  3529. }
  3530. ui_HelpLine.URL = "ui://isxx5ak7sdh33qs";
  3531. class D2HelpLine {
  3532. constructor() {
  3533. this.starX = 0;
  3534. this.starY = 0;
  3535. this.ui = ui_HelpLine.createInstance();
  3536. xGame.common.gameUI.ui.ballNode.addChild(this.ui);
  3537. this.starX = this.ui.rect.x;
  3538. this.starY = this.ui.rect.y;
  3539. }
  3540. shoot() {
  3541. this.ui.visible = false;
  3542. }
  3543. destroySelf() {
  3544. if (this.ui.isDisposed) {
  3545. this.ui.removeFromParent();
  3546. this.ui.dispose();
  3547. }
  3548. }
  3549. }
  3550. class D2World extends Laya.Script {
  3551. constructor() {
  3552. super();
  3553. this.ballArr = [];
  3554. this.openCheckStill = false;
  3555. this.checkArr = [];
  3556. this.borderRect = { x: 169, y: 179.25, width: 996, height: 495, openBallW: 236 };
  3557. this.isHelpLineOnBall = false;
  3558. this.isOnSameLine = false;
  3559. this.reflectAngle = 0;
  3560. this.powerPercent = 0;
  3561. this.inHolesSpeed = [];
  3562. this.outDir = new Laya.Vector2();
  3563. this.rootDir = new Laya.Vector2();
  3564. this.aiLv = 0;
  3565. this.rootPos = new Laya.Vector2();
  3566. this.tempDir1 = new Laya.Vector2();
  3567. this.tempDir2 = new Laya.Vector2();
  3568. this.tempDir3 = new Laya.Vector2();
  3569. this.ballSize = 33;
  3570. this.destRot = 0;
  3571. }
  3572. initSelf() {
  3573. this.createBalls();
  3574. xGame.eventMgr.off(ALL_BALL_STOP, this, this.allBallStop);
  3575. xGame.eventMgr.on(ALL_BALL_STOP, this, this.allBallStop);
  3576. xGame.eventMgr.off(WAIT_SHOOT, this, this.waitShoot);
  3577. xGame.eventMgr.on(WAIT_SHOOT, this, this.waitShoot);
  3578. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  3579. }
  3580. setBorderRect() {
  3581. let ui = xGame.common.gameUI.ui;
  3582. let starX = ui.border.bar5.x + ui.border.bar5.width / 2;
  3583. let starY = ui.border.bar1.y + ui.border.bar1.height / 2;
  3584. let width = Math.abs(ui.border.bar6.x - ui.border.bar5.x - ui.border.bar5.width);
  3585. let height = Math.abs(ui.border.bar3.y - ui.border.bar1.y - ui.border.bar1.height);
  3586. this.borderRect.x = starX;
  3587. this.borderRect.y = starY;
  3588. this.borderRect.width = width;
  3589. this.borderRect.height = height;
  3590. }
  3591. resetGame() {
  3592. this.openCheckStill = false;
  3593. let temp;
  3594. for (let index = 0; index < this.ballArr.length; index++) {
  3595. temp = this.ballArr[index];
  3596. temp.destroySelf();
  3597. }
  3598. xGame.common.d3World.ballRoot.destroyChildren();
  3599. xGame.common.gameUI.ui.ballNode.removeChildren();
  3600. console.log("进入摧毁逻辑");
  3601. this.d2Gan.destroySelf();
  3602. this.d2HelpLine.destroySelf();
  3603. this.ballArr = [];
  3604. }
  3605. setD2Gan() {
  3606. let ballNode = this.rootBall.ui;
  3607. let d2Gan = new D2Gan();
  3608. this.d2Gan = d2Gan;
  3609. let ganNode = d2Gan.ui;
  3610. ballNode.addChild(ganNode);
  3611. ganNode.pivotX = ganNode.pivotX;
  3612. ganNode.pivotY = ganNode.pivotY;
  3613. ganNode.x = ganNode.myIcon.width / 2;
  3614. ganNode.y = this.rootBall.gameObj.width;
  3615. d2Gan.setGanLastInfo();
  3616. }
  3617. setHelpLine() {
  3618. let d2Help = new D2HelpLine();
  3619. this.d2HelpLine = d2Help;
  3620. }
  3621. createBalls() {
  3622. let cfg;
  3623. switch (xGame.common.gameMode) {
  3624. case GameMode.classic:
  3625. cfg = xGame.cfgMgr.getRandomClassicLevel();
  3626. break;
  3627. case GameMode.bigMove:
  3628. cfg = xGame.cfgMgr.getBigMoveLevelByIndex(xGame.common.bigMoveLevelIndex);
  3629. break;
  3630. case GameMode.placeBall:
  3631. cfg = xGame.cfgMgr.getPlaceBallByLevel(xGame.common.placeBallCurLevel);
  3632. break;
  3633. default:
  3634. break;
  3635. }
  3636. cfg = JSON.parse(JSON.stringify(cfg));
  3637. for (const key in cfg) {
  3638. if (cfg[key].value == 0) {
  3639. this.createRootBall(cfg[key]);
  3640. delete cfg[key];
  3641. break;
  3642. }
  3643. }
  3644. this.createOtherBalls(cfg);
  3645. }
  3646. createRootBall(data) {
  3647. let root = new D2Ball(true);
  3648. xGame.common.gameUI.ui.ballNode.displayObject.addChild(root);
  3649. this.rootBall = root.d2Src;
  3650. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3651. let d3BallSrc = d3Ball.getComponent(Ball);
  3652. xGame.common.d3World.rootBall = d3Ball;
  3653. xGame.common.d3World.rootBallSrc = d3BallSrc;
  3654. let xx = data.x;
  3655. let yy = data.y;
  3656. let numer = data.value;
  3657. xGame.common.gameMgr.lastRootBallPos.setValue(xx, yy);
  3658. this.rootBall.initSelf(numer, xx, yy, d3Ball);
  3659. this.ballArr.push(this.rootBall);
  3660. this.setD2Gan();
  3661. this.setHelpLine();
  3662. }
  3663. createOtherBalls(cfg) {
  3664. let temp;
  3665. let src;
  3666. let data;
  3667. for (const key in cfg) {
  3668. data = cfg[key];
  3669. temp = new D2Ball();
  3670. xGame.common.gameUI.ui.ballNode.displayObject.addChild(temp);
  3671. src = temp.d2Src;
  3672. let d3Ball = xGame.poolD3Mgr.getItem(poolKey.d3ball);
  3673. src.initSelf(data.value, data.x, data.y, d3Ball);
  3674. this.ballArr.push(src);
  3675. }
  3676. }
  3677. shoot(percent) {
  3678. this.powerPercent = percent;
  3679. this.openCheckStill = true;
  3680. let d2Angle = this.d2Gan.ui.rotation;
  3681. this.rootBall.setSpeed(percent, d2Angle);
  3682. this.clearBallAllEft();
  3683. this.changePlayerView();
  3684. }
  3685. onUpdate() {
  3686. if (!this.openCheckStill)
  3687. return;
  3688. this.checkStill();
  3689. }
  3690. checkStill() {
  3691. for (let index = 0; index < this.ballArr.length; index++) {
  3692. if (!this.ballArr[index].isStill()) {
  3693. return;
  3694. }
  3695. }
  3696. xGame.eventMgr.event(ALL_BALL_STOP);
  3697. }
  3698. allBallStop() {
  3699. this.openCheckStill = false;
  3700. xGame.common.recoverCameraView();
  3701. }
  3702. waitShoot() {
  3703. if (!this.d2Gan.ui.isDisposed) {
  3704. this.d2Gan.ui.visible = true;
  3705. }
  3706. if (!this.d2HelpLine.ui.isDisposed) {
  3707. this.d2HelpLine.ui.visible = true;
  3708. }
  3709. this.clearBallAllEft();
  3710. this.showBallRightEft();
  3711. this.getHelpLine();
  3712. this.inHolesSpeed = [];
  3713. this.selectOneBall();
  3714. }
  3715. _getAllBallArr() {
  3716. let arr = this.ballArr;
  3717. let outArr = [];
  3718. for (let index = 0; index < arr.length; index++) {
  3719. if (arr[index] instanceof D2RootBallSrc)
  3720. continue;
  3721. if (arr[index].ballFunc == "ice")
  3722. continue;
  3723. if (arr[index].destroyed)
  3724. continue;
  3725. outArr.push(arr[index]);
  3726. }
  3727. return outArr;
  3728. }
  3729. _getBlackObj() {
  3730. let arr = this.ballArr;
  3731. for (let index = 0; index < arr.length; index++) {
  3732. if (arr[index].number == 8 && xGame.common.gameMode == GameMode.classic) {
  3733. return arr[index];
  3734. }
  3735. }
  3736. }
  3737. selectOneBall() {
  3738. let all = this._getAllBallArr();
  3739. let target;
  3740. switch (xGame.common.gameMode) {
  3741. case GameMode.classic:
  3742. if (xGame.common.gameMgr.selfTurn) {
  3743. let self = xGame.common.gameMgr.selfBallArr;
  3744. let black = this._getBlackObj();
  3745. if (xGame.common.gameMgr.ensureBallType) {
  3746. if (self.length > 0) {
  3747. let out = [];
  3748. for (let j = 0; j < all.length; j++) {
  3749. if (self.indexOf(all[j].number) > -1) {
  3750. out.push(all[j]);
  3751. }
  3752. }
  3753. target = this.selectBestEnterOne(out);
  3754. }
  3755. else {
  3756. target = this.selectBestEnterOne([black]);
  3757. }
  3758. }
  3759. else {
  3760. target = this.selectBestEnterOne(all);
  3761. }
  3762. }
  3763. else {
  3764. target = this.selectBestEnterOne(all);
  3765. }
  3766. break;
  3767. case GameMode.bigMove:
  3768. target = this.selectBestEnterOne(all);
  3769. break;
  3770. case GameMode.placeBall:
  3771. if (all.length > 0) {
  3772. target = this.selectBestEnterOne(all);
  3773. }
  3774. break;
  3775. default:
  3776. break;
  3777. }
  3778. if (target && !target.destroyed && target.onClick) {
  3779. target.onClick(0, true);
  3780. let num = -200 + xGame.common.randomNum(0, 400);
  3781. num /= 150;
  3782. if (xGame.common.longHelpLine) {
  3783. num = 0;
  3784. }
  3785. this.destRot += num;
  3786. xGame.common.d2World.d2Gan.rotDest(this.destRot);
  3787. }
  3788. }
  3789. removeOneBall(ball) {
  3790. for (let index = 0; index < this.ballArr.length; index++) {
  3791. if (this.ballArr[index].id == ball.id) {
  3792. this.ballArr.splice(index, 1);
  3793. break;
  3794. }
  3795. }
  3796. }
  3797. getHelpLine() {
  3798. this.d2HelpLine.ui.dirDot.visible = false;
  3799. this.isOnSameLine = false;
  3800. let startX = this.rootBall.gameObj.x;
  3801. let startY = this.rootBall.gameObj.y;
  3802. let dis = this.getBorderDot(startX, startY, this.d2Gan.ui.rotation);
  3803. if (dis == null) {
  3804. this.d2HelpLine.ui.visible = false;
  3805. console.error("辅助线异常");
  3806. return;
  3807. }
  3808. this.d2HelpLine.ui.visible = true;
  3809. let angle = this.d2Gan.ui.rotation;
  3810. let radius = 16.5;
  3811. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  3812. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  3813. let colliObj = xGame.common.isBlock(startX, startY, disX, disY);
  3814. if (colliObj == null) {
  3815. this.getColliPos(disX, disY, radius, angle);
  3816. xGame.common.d2World.isHelpLineOnBall = false;
  3817. this.targetBall = null;
  3818. this.reflectAngle = 0;
  3819. this.showBallWrongEft();
  3820. }
  3821. else {
  3822. let target = colliObj.src;
  3823. let radius = 16.5;
  3824. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  3825. dis1 = Math.sqrt(dis1);
  3826. let realDis = colliObj.disHon - dis1;
  3827. let dir = colliObj.dir;
  3828. let xx = startX + dir.x * realDis;
  3829. let yy = startY + dir.y * realDis;
  3830. this.getColliPos(xx, yy, radius, angle);
  3831. let reflectAngle = this.getReflectLine(xx, yy, radius, target.gameObj) - 180;
  3832. if (Math.abs(reflectAngle - angle) <= 0.02) {
  3833. let offset = xGame.common.rodOffest;
  3834. if (Math.abs(offset.x) < 1 && Math.abs(offset.y) < 1)
  3835. this.isOnSameLine = true;
  3836. }
  3837. this.getRootDirLine(reflectAngle, angle, xx, yy, target);
  3838. xGame.common.d2World.isHelpLineOnBall = true;
  3839. this.targetBall = target;
  3840. this.reflectAngle = reflectAngle;
  3841. this.showBallWrongEft();
  3842. if (xGame.common.longHelpLine) {
  3843. this.delayReflectLine(target, reflectAngle);
  3844. }
  3845. }
  3846. }
  3847. getBorderDot(startX, startY, angle) {
  3848. let radius = 17;
  3849. let distance;
  3850. let isDone;
  3851. distance = -(this.borderRect.y - startY + radius) / Math.cos(angle * Math.PI / 180);
  3852. isDone = this.judgeUpDown(distance, angle, startX);
  3853. if (isDone != null) {
  3854. return isDone;
  3855. }
  3856. distance = -(this.borderRect.y + this.borderRect.height - startY - radius) / Math.cos(angle * Math.PI / 180);
  3857. isDone = this.judgeUpDown(distance, angle, startX);
  3858. if (isDone != null) {
  3859. return isDone;
  3860. }
  3861. distance = (this.borderRect.x - startX + radius) / Math.sin(angle * Math.PI / 180);
  3862. isDone = this.judgeLeftRight(distance, angle, startY);
  3863. if (isDone != null) {
  3864. return isDone;
  3865. }
  3866. distance = (this.borderRect.x + this.borderRect.width - startX - radius) / Math.sin(angle * Math.PI / 180);
  3867. isDone = this.judgeLeftRight(distance, angle, startY);
  3868. if (isDone != null) {
  3869. return isDone;
  3870. }
  3871. }
  3872. judgeUpDown(distance, angle, startX) {
  3873. let flag = Math.sin(angle * Math.PI / 180);
  3874. let temp = startX + distance * Math.sin(angle * Math.PI / 180);
  3875. if (distance >= 0) {
  3876. if (flag > 0) {
  3877. if (temp < this.borderRect.x + this.borderRect.width) {
  3878. return distance;
  3879. }
  3880. }
  3881. else {
  3882. if (temp > this.borderRect.x) {
  3883. return distance;
  3884. }
  3885. }
  3886. }
  3887. }
  3888. judgeLeftRight(distance, angle, starY) {
  3889. let flag = -Math.cos(angle * Math.PI / 180);
  3890. let temp = starY + distance * -Math.cos(angle * Math.PI / 180);
  3891. if (distance >= 0) {
  3892. if (flag > 0) {
  3893. if (temp < this.borderRect.y + this.borderRect.height) {
  3894. return distance;
  3895. }
  3896. }
  3897. else {
  3898. if (temp > this.borderRect.y) {
  3899. return distance;
  3900. }
  3901. }
  3902. }
  3903. }
  3904. clearBallAllEft() {
  3905. let temp;
  3906. for (let index = 0; index < this.ballArr.length; index++) {
  3907. temp = this.ballArr[index];
  3908. temp.clearBallEft();
  3909. }
  3910. }
  3911. showBallRightEft() {
  3912. let gameMgr = xGame.common.gameMgr;
  3913. let temp;
  3914. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3915. if (targetArr.length <= 0)
  3916. return;
  3917. for (let index = 0; index < this.ballArr.length; index++) {
  3918. temp = this.ballArr[index];
  3919. if (targetArr.indexOf(temp.number) > -1) {
  3920. temp.showRightEft();
  3921. }
  3922. }
  3923. }
  3924. showBallWrongEft() {
  3925. let gameMgr = xGame.common.gameMgr;
  3926. let targetArr = gameMgr.selfTurn ? gameMgr.selfBallArr : gameMgr.aiBallArr;
  3927. if (targetArr.length <= 0)
  3928. return;
  3929. let temp;
  3930. for (let index = 0; index < this.ballArr.length; index++) {
  3931. temp = this.ballArr[index];
  3932. if (this.targetBall && this.targetBall.number == temp.number) {
  3933. if (targetArr.indexOf(temp.number) <= -1) {
  3934. temp.showWrongEft();
  3935. }
  3936. else {
  3937. temp.clearBallWrongEft();
  3938. }
  3939. }
  3940. else {
  3941. temp.clearBallWrongEft();
  3942. }
  3943. }
  3944. }
  3945. getColliPos(x, y, radius, angle) {
  3946. this.d2HelpLine.ui.x = x;
  3947. this.d2HelpLine.ui.y = y;
  3948. let dirX = x - this.rootBall.gameObj.x;
  3949. let dirY = y - this.rootBall.gameObj.y;
  3950. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  3951. if (rectH <= 0)
  3952. rectH = 0;
  3953. this.d2HelpLine.ui.rect.height = 0;
  3954. this.d2HelpLine.ui.rect.height = rectH;
  3955. this.d2HelpLine.ui.rect.rotation = xGame.common.getfguiRotation(dirX, dirY);
  3956. if (rectH < this.rootBall.gameObj.width) {
  3957. this.d2HelpLine.ui.rect.visible = false;
  3958. }
  3959. else {
  3960. this.d2HelpLine.ui.rect.visible = true;
  3961. }
  3962. this.d2HelpLine.ui.dir.visible = false;
  3963. this.d2HelpLine.ui.rootDir.visible = false;
  3964. }
  3965. getReflectLine(x, y, radius, target) {
  3966. this.d2HelpLine.ui.dir.visible = true;
  3967. let dirX = target.x - x;
  3968. let dirY = target.y - y;
  3969. let angle = xGame.common.getfguiRotation(dirX, dirY) + 180;
  3970. this.d2HelpLine.ui.dir.x = this.d2HelpLine.starX;
  3971. this.d2HelpLine.ui.dir.y = this.d2HelpLine.starY;
  3972. this.d2HelpLine.ui.dir.height = 48;
  3973. this.d2HelpLine.ui.dir.rotation = angle;
  3974. this.d2HelpLine.ui.dir.x -= 2 * radius * Math.sin(angle * Math.PI / 180);
  3975. this.d2HelpLine.ui.dir.y -= 2 * radius * -Math.cos(angle * Math.PI / 180);
  3976. return angle;
  3977. }
  3978. getRootDirLine(angle, rodAngle, xx, yy, target) {
  3979. let rtX = xGame.common.d2World.rootBall.gameObj.x;
  3980. let rtY = xGame.common.d2World.rootBall.gameObj.y;
  3981. let targetX = target.gameObj.x;
  3982. let targetY = target.gameObj.y;
  3983. this.outDir.setValue(targetX - xx, targetY - yy);
  3984. this.rootDir.setValue(rtX - xx, rtY - yy);
  3985. let ver = Math.PI / 2;
  3986. let sin = Math.sin(ver);
  3987. let cos = Math.cos(ver);
  3988. let outX = this.outDir.x * cos - this.outDir.y * sin;
  3989. let outY = this.outDir.x * sin + this.outDir.y * cos;
  3990. this.outDir.setValue(outX, outY);
  3991. Laya.Vector2.normalize(this.rootDir, this.rootDir);
  3992. Laya.Vector2.normalize(this.outDir, this.outDir);
  3993. let result = Laya.Vector2.dot(this.rootDir, this.outDir);
  3994. if (Math.abs(result) <= 0.08) {
  3995. this.d2HelpLine.ui.rootDir.visible = false;
  3996. return;
  3997. }
  3998. if (result > 0) {
  3999. angle += 90;
  4000. }
  4001. else if (result < 0) {
  4002. angle -= 90;
  4003. }
  4004. this.d2HelpLine.ui.rootDir.visible = true;
  4005. this.d2HelpLine.ui.rootDir.x = this.d2HelpLine.starX;
  4006. this.d2HelpLine.ui.rootDir.y = this.d2HelpLine.starY;
  4007. this.d2HelpLine.ui.rootDir.rotation = angle;
  4008. }
  4009. delayReflectLine(obj, angle) {
  4010. if (xGame.common.gameMode != GameMode.placeBall && !xGame.common.gameMgr.selfTurn) {
  4011. return;
  4012. }
  4013. this.isOnSameLine = false;
  4014. let startX = obj.gameObj.x;
  4015. let startY = obj.gameObj.y;
  4016. let dis = this.getBorderDot(startX, startY, angle);
  4017. if (dis == null) {
  4018. this.d2HelpLine.ui.dirDot.visible = false;
  4019. return;
  4020. }
  4021. this.d2HelpLine.ui.visible = true;
  4022. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4023. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4024. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, obj);
  4025. if (colliObj == null) {
  4026. this.setDelayLine(disX, disY, obj, angle);
  4027. }
  4028. else {
  4029. let radius = 16;
  4030. let dis1 = 4 * radius * radius - colliObj.disVer * colliObj.disVer;
  4031. dis1 = Math.sqrt(dis1);
  4032. let realDis = colliObj.disHon - dis1;
  4033. let dir = colliObj.dir;
  4034. let xx = startX + dir.x * realDis;
  4035. let yy = startY + dir.y * realDis;
  4036. this.setDelayLine(xx, yy, obj, angle);
  4037. }
  4038. }
  4039. setDelayLine(x, y, obj, angle) {
  4040. let dirX = x - obj.gameObj.x;
  4041. let dirY = y - obj.gameObj.y;
  4042. let rectH = Math.pow(dirX * dirX + dirY * dirY, 0.5);
  4043. if (rectH <= 0)
  4044. rectH = 0;
  4045. this.d2HelpLine.ui.dir.height = rectH;
  4046. this.d2HelpLine.ui.dirDot.visible = true;
  4047. this.d2HelpLine.ui.dirDot.x = 17;
  4048. this.d2HelpLine.ui.dirDot.y = 17;
  4049. this.d2HelpLine.ui.dirDot.x += (rectH + 34) * Math.sin(angle * Math.PI / 180);
  4050. ;
  4051. this.d2HelpLine.ui.dirDot.y += (rectH + 34) * -Math.cos(angle * Math.PI / 180);
  4052. }
  4053. changePlayerView() {
  4054. if (Math.random() >= 0.7)
  4055. return;
  4056. if (!this.targetBall) {
  4057. return;
  4058. }
  4059. if (!xGame.common.gameMgr.selfTurn)
  4060. return;
  4061. switch (xGame.common.gameMode) {
  4062. case GameMode.classic:
  4063. if (xGame.common.gameMgr.selfBallArr.indexOf(this.targetBall.number) <= -1) {
  4064. if (this.targetBall.number != 8) {
  4065. return;
  4066. }
  4067. }
  4068. break;
  4069. case GameMode.bigMove:
  4070. return;
  4071. case GameMode.placeBall:
  4072. break;
  4073. default:
  4074. break;
  4075. }
  4076. let startX = this.targetBall.gameObj.x;
  4077. let startY = this.targetBall.gameObj.y;
  4078. let angle = this.reflectAngle;
  4079. let dis = this.getBorderDot(startX, startY, angle);
  4080. let disX = startX + dis * Math.sin(angle * Math.PI / 180);
  4081. let disY = startY + dis * -Math.cos(angle * Math.PI / 180);
  4082. let colliObj = xGame.common.isBlock(startX, startY, disX, disY, this.targetBall);
  4083. if (colliObj) {
  4084. return;
  4085. }
  4086. let offset = 40;
  4087. let posObj = xGame.common.gameMgr.posObj;
  4088. let temp;
  4089. let radius;
  4090. let tarX, tarY;
  4091. for (const key in posObj) {
  4092. temp = posObj[key];
  4093. radius = Math.pow((startX - temp.x) * (startX - temp.x) + (startY - temp.y) * (startY - temp.y), 0.5);
  4094. tarX = startX + radius * Math.sin(angle * Math.PI / 180);
  4095. tarY = startY + radius * -Math.cos(angle * Math.PI / 180);
  4096. if ((tarX - temp.x) * (tarX - temp.x) + (tarY - temp.y) * (tarY - temp.y) < offset) {
  4097. xGame.common.showOneCamera("angle" + key);
  4098. xGame.common.gameUI.ui.d2Node.alpha = 0;
  4099. Laya.physicsTimer.scale = 0.7;
  4100. break;
  4101. }
  4102. }
  4103. }
  4104. selectBestEnterOne(arr) {
  4105. this.aiLv = xGame.tools.random(1, 11);
  4106. this.aiLv = 10;
  4107. this.wBall = xGame.common.d2World.rootBall;
  4108. this.rootPos.x = this.wBall.gameObj.x;
  4109. this.rootPos.y = this.wBall.gameObj.y;
  4110. this.initHoleBall(arr);
  4111. return this.selectBall();
  4112. }
  4113. selectBall() {
  4114. let ball = null;
  4115. this.destRot = 0;
  4116. let ai = 110 - this.aiLv * 10;
  4117. let mis = xGame.tools.random(-ai, ai) * 0.005;
  4118. let score = false;
  4119. if (this.scoreBall.length < 1) {
  4120. if (this.lineBall.length < 1) {
  4121. for (let i = 0; i < this.kickBall.length; i++) {
  4122. let list = [];
  4123. let bo = this.kickBall[i];
  4124. let bobj = bo.gameObj;
  4125. let rect = xGame.common.d2World.borderRect;
  4126. let mobj = this.wBall.gameObj;
  4127. let minb = bobj.y - rect.y - 20;
  4128. let minw = mobj.y - rect.y - 50;
  4129. if (minb > 0 && minw > 0) {
  4130. let dlenx = 0;
  4131. let dleny = mobj.y - rect.y;
  4132. let spx = mobj.x;
  4133. let spy = rect.y - dleny;
  4134. list.push({ order: minb, bx: 0, by: rect.y, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4135. }
  4136. minb = rect.y + rect.height - bobj.y - 20;
  4137. minw = rect.y + rect.height - mobj.y - 50;
  4138. if (minb > 0 && minw > 0) {
  4139. let dlenx = 0;
  4140. let dleny = rect.y + rect.height - mobj.y;
  4141. let spx = mobj.x;
  4142. let spy = rect.y + rect.height + dleny;
  4143. list.push({ order: minb, bx: 0, by: rect.y + rect.height, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4144. }
  4145. minb = bobj.x - rect.x - 20;
  4146. minw = mobj.x - rect.x - 50;
  4147. if (minb > 0 && minw > 0) {
  4148. let dlenx = mobj.x - rect.x;
  4149. let dleny = 0;
  4150. let spx = rect.x - dlenx;
  4151. let spy = mobj.y;
  4152. list.push({ order: minb, bx: rect.x, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4153. }
  4154. minb = rect.x + rect.width - bobj.x - 20;
  4155. minw = rect.x + rect.width - mobj.x - 50;
  4156. if (minb > 0 && minw > 0) {
  4157. let dlenx = rect.x + rect.width - mobj.x;
  4158. let dleny = 0;
  4159. let spx = rect.x + rect.width + dlenx;
  4160. let spy = mobj.y;
  4161. list.push({ order: minb, bx: rect.x + rect.width, by: 0, spx: spx, spy: spy, dlenx: dlenx, dleny: dleny });
  4162. }
  4163. list.sort(function (a, b) {
  4164. return a.order - b.order;
  4165. });
  4166. for (let i = 0; i < list.length; i++) {
  4167. let data = list[i];
  4168. let mx = mobj.x - bobj.x;
  4169. let my = mobj.y - bobj.y;
  4170. xGame.tools.getV2Dir(data.spx, data.spy, bobj.x, bobj.y, this.tempDir1);
  4171. xGame.tools.getV2Dir(data.spx, data.spy, mobj.x, mobj.y, this.tempDir2);
  4172. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4173. if (num > 1)
  4174. num = 1;
  4175. let cos = Math.acos(num);
  4176. if (cos > 1.57)
  4177. cos = 1.57;
  4178. else if (cos < 0.01)
  4179. cos = 0.01;
  4180. let tan = Math.tan(cos);
  4181. let dx = tan * data.dleny;
  4182. let dy = tan * data.dlenx;
  4183. let bx = data.bx > 0 ? data.bx : (mobj.x + (mx > 0 ? -dx : dx));
  4184. if (Math.abs(bx - 667) < 40)
  4185. continue;
  4186. let by = data.by > 0 ? data.by : (mobj.y + (my > 0 ? -dy : dy));
  4187. if (!this.isBlock(0, mobj.x, mobj.y, bx, by) && !this.isBlock(bo.number, bobj.x, bobj.y, bx, by)) {
  4188. let dis = Math.abs(data.dlenx) + Math.abs(data.dleny) + xGame.tools.getDistance(bx, by, bo.gameObj.x, bo.gameObj.y);
  4189. this.forceMax = dis * 0.08;
  4190. this.destRot += mis * 0.1;
  4191. this.setKick(bx, by);
  4192. return true;
  4193. }
  4194. }
  4195. }
  4196. }
  4197. else {
  4198. ball = xGame.common.getRandArrEle(this.lineBall);
  4199. }
  4200. }
  4201. else {
  4202. for (let i = 0; i < this.scoreBall.length; i++) {
  4203. if (i < this.scoreBall.length - 1) {
  4204. let rand = 70 + this.aiLv * 10 + i * 10;
  4205. if (xGame.tools.random(0, 100) < rand) {
  4206. ball = this.scoreBall[i];
  4207. break;
  4208. }
  4209. }
  4210. else {
  4211. ball = this.scoreBall[i];
  4212. break;
  4213. }
  4214. }
  4215. score = true;
  4216. this.selectNum++;
  4217. }
  4218. if (!ball)
  4219. ball = xGame.common.getRandArrEle(xGame.common.d2World.ballArr);
  4220. let dx = ball.gameObj.x;
  4221. let dy = ball.gameObj.y;
  4222. let kickAngle = 0;
  4223. if (score) {
  4224. dx = ball.kickPos.x;
  4225. dy = ball.kickPos.y;
  4226. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4227. this.tempDir3 = xGame.tools.getV2Dir(dx, dy, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4228. let adot = Laya.Vector2.dot(this.tempDir3, this.tempDir2);
  4229. if (adot > 1)
  4230. adot = 1;
  4231. kickAngle = Math.acos(adot) * 57.3;
  4232. if (kickAngle > 45) {
  4233. let kdx = ball.kickPos.x - ball.gameObj.x;
  4234. let kdy = ball.kickPos.y - ball.gameObj.y;
  4235. dx = ball.kickPos.x - kdx * mis * 0.3;
  4236. dy = ball.kickPos.y - kdy * mis * 0.3;
  4237. }
  4238. else
  4239. this.destRot += mis;
  4240. }
  4241. else if (ball.poleAngle != 0) {
  4242. this.destRot += ball.poleAngle;
  4243. }
  4244. if (xGame.common.gameMode == 0) {
  4245. let af = kickAngle * 0.08;
  4246. this.forceMax = ball.hard * 0.1 + af * af;
  4247. }
  4248. this.setKick(dx, dy);
  4249. return ball;
  4250. }
  4251. initHoleBall(arr) {
  4252. this.kickBall = [];
  4253. this.lineBall = [];
  4254. this.scoreBall = [];
  4255. this.holeBall = [];
  4256. this.selectNum = 0;
  4257. this.forceNum = 0;
  4258. this.forceMax = 0;
  4259. this.turnNum = 0;
  4260. let list = arr;
  4261. let holes = xGame.common.gameMgr.holePosList;
  4262. let self = xGame.common.aiPlayer;
  4263. for (let i = 0; i < list.length; i++) {
  4264. let obj = list[i];
  4265. if (!obj)
  4266. continue;
  4267. obj.kickPos.x = 0;
  4268. obj.kickPos.y = 0;
  4269. obj.poleAngle = 0;
  4270. obj.hard = 0;
  4271. obj.borderDis = 0;
  4272. obj.kickAngle = 180;
  4273. let b = obj.gameObj;
  4274. let wbp = this.rootPos;
  4275. let bx = wbp.x - b.x;
  4276. let by = wbp.y - b.y;
  4277. obj.borderDis = xGame.tools.random(0, 100);
  4278. this.kickBall.push(obj);
  4279. if (!this.isLine(wbp, obj))
  4280. continue;
  4281. obj.kickAngle = xGame.tools.random(90, 180);
  4282. obj.kickPos.x = b.x;
  4283. obj.kickPos.y = b.y;
  4284. this.lineBall.push(obj);
  4285. let minDis = 999999;
  4286. let hole = false;
  4287. for (let j = 0; j < holes.length; j++) {
  4288. let hp = holes[j];
  4289. if (bx >= 0 && hp.x > b.x + 100)
  4290. continue;
  4291. if (bx <= 0 && hp.x < b.x - 100)
  4292. continue;
  4293. if (by < -10 && hp.y < wbp.y)
  4294. continue;
  4295. if (by > 10 && hp.y > wbp.y)
  4296. continue;
  4297. if (!this.isBlock(obj.number, b.x, b.y, hp.x, hp.y)) {
  4298. let dis = xGame.tools.getDeltaxy(b.x, b.y, hp.x, hp.y);
  4299. if (dis < minDis) {
  4300. let dx = b.x - this.tempDir1.x * this.ballSize;
  4301. let dy = b.y - this.tempDir1.y * this.ballSize;
  4302. this.tempDir3.x = this.tempDir1.x;
  4303. this.tempDir3.y = this.tempDir1.y;
  4304. if (!this.isBlock(this.wBall.number, wbp.x, wbp.y, dx, dy, obj.number)) {
  4305. obj.kickPos.x = dx;
  4306. obj.kickPos.y = dy;
  4307. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir3);
  4308. if (num > 1)
  4309. num = 1;
  4310. obj.kickAngle = Math.acos(num) * 57.3;
  4311. if (b.x < self.rectL + 2 || b.x > self.rectR - 2 || b.y < self.rectT + 2 || b.y > self.rectB - 2)
  4312. dis = dis * 2;
  4313. if (Math.abs(hp.x - 600) < 100)
  4314. dis += 50;
  4315. obj.hard = dis + obj.kickAngle * 3;
  4316. hole = true;
  4317. }
  4318. }
  4319. }
  4320. }
  4321. if (hole) {
  4322. this.scoreBall.push(obj);
  4323. this.holeBall.push(obj);
  4324. }
  4325. }
  4326. this.scoreBall.sort(function (a, b) {
  4327. return a.hard - b.hard;
  4328. });
  4329. this.holeBall.sort(function (a, b) {
  4330. return a.kickAngle - b.kickAngle;
  4331. });
  4332. this.kickBall.sort(function (a, b) {
  4333. return a.borderDis - b.borderDis;
  4334. });
  4335. }
  4336. isBlock(bn, bx, by, hx, hy, dn = -1) {
  4337. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  4338. let balls = xGame.common.d2World.ballArr;
  4339. let max = xGame.tools.getDis(hx, hy, bx, by);
  4340. for (let index = 0; index < balls.length; index++) {
  4341. let obj = balls[index];
  4342. if (obj.number == 0)
  4343. continue;
  4344. if (obj.number == bn || obj.number == dn)
  4345. continue;
  4346. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  4347. if (dis * dis > max)
  4348. continue;
  4349. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  4350. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4351. if (num > 1)
  4352. num = 1;
  4353. if (num < 0)
  4354. continue;
  4355. let gap = Math.sin(Math.acos(num)) * dis;
  4356. if (gap < this.ballSize)
  4357. return true;
  4358. }
  4359. return false;
  4360. }
  4361. isLine(xy, ball) {
  4362. let bx = xy.x;
  4363. let by = xy.y;
  4364. if (this.isBlock(0, bx, by, ball.gameObj.x, ball.gameObj.y, ball.number)) {
  4365. let dis = ball.getDestDis(xy);
  4366. let angle = Math.asin((ball.gameObj.width - 3) / dis);
  4367. let sin = Math.sin(angle);
  4368. let cos = Math.cos(angle);
  4369. this.tempDir3 = xGame.tools.getV2Dir(bx, by, ball.gameObj.x, ball.gameObj.y, this.tempDir3);
  4370. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4371. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4372. let dx = bx + this.tempDir2.x * dis;
  4373. let dy = by + this.tempDir2.y * dis;
  4374. let isr = this.isBlock(0, bx, by, dx, dy, ball.number);
  4375. sin = Math.sin(-angle);
  4376. cos = Math.cos(-angle);
  4377. this.tempDir2.x = this.tempDir3.x * cos - this.tempDir3.y * sin;
  4378. this.tempDir2.y = this.tempDir3.x * sin + this.tempDir3.y * cos;
  4379. dx = bx + this.tempDir2.x * dis;
  4380. dy = by + this.tempDir2.y * dis;
  4381. let isl = this.isBlock(0, bx, by, dx, dy, ball.number);
  4382. if (isr && isl)
  4383. return false;
  4384. ball.poleAngle = isr ? -angle * 57.3 : angle * 57.3;
  4385. }
  4386. return true;
  4387. }
  4388. setKick(dx, dy) {
  4389. this.forceMax += this.wBall.getDestDis({ x: dx, y: dy }) * 0.1;
  4390. this.tempDir2 = xGame.tools.getV2Dir(this.wBall.gameObj.x, this.wBall.gameObj.y, dx, dy, this.tempDir2);
  4391. this.tempDir1.x = 0;
  4392. this.tempDir1.y = 1;
  4393. this.tempDir2.y = -this.tempDir2.y;
  4394. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  4395. if (num > 1)
  4396. num = 1;
  4397. let rot = Math.acos(num) * 57.3;
  4398. if (this.tempDir2.x < 0)
  4399. rot = 360 - rot;
  4400. this.destRot += rot;
  4401. }
  4402. }
  4403. class ui_UIGame extends fgui.GComponent {
  4404. static createInstance() {
  4405. return (fgui.UIPackage.createObject("game", "UIGame"));
  4406. }
  4407. onConstruct() {
  4408. this.c1 = this.getController("c1");
  4409. this.d3Root = (this.getChild("d3Root"));
  4410. this.clickNode = (this.getChild("clickNode"));
  4411. this.d2Root = (this.getChild("d2Root"));
  4412. this.topNode = (this.getChild("topNode"));
  4413. this.n72 = (this.getChild("n72"));
  4414. this.n40 = (this.getChild("n40"));
  4415. this.rulerNode = (this.getChild("rulerNode"));
  4416. this.rulerClickNode = (this.getChild("rulerClickNode"));
  4417. this.n50 = (this.getChild("n50"));
  4418. this.keduNode = (this.getChild("keduNode"));
  4419. this.powerTxt = (this.getChild("powerTxt"));
  4420. this.powerNode = (this.getChild("powerNode"));
  4421. this.colorNode = (this.getChild("colorNode"));
  4422. this.powerEft = (this.getChild("powerEft"));
  4423. this.myPowerNode = (this.getChild("myPowerNode"));
  4424. this.ganNode = (this.getChild("ganNode"));
  4425. this.rodMethodNode = (this.getChild("rodMethodNode"));
  4426. this.placeChallengeNode = (this.getChild("placeChallengeNode"));
  4427. this.placeNormalNode = (this.getChild("placeNormalNode"));
  4428. this.skillRod = (this.getChild("skillRod"));
  4429. this.border = (this.getChild("border"));
  4430. this.bigSkillNode = (this.getChild("bigSkillNode"));
  4431. this.classicWorldsNode = (this.getChild("classicWorldsNode"));
  4432. this.bigMoveWorldsNode = (this.getChild("bigMoveWorldsNode"));
  4433. this.classicEmotionSpineNode = (this.getChild("classicEmotionSpineNode"));
  4434. this.awardSpineNode = (this.getChild("awardSpineNode"));
  4435. this.guanyuNode = (this.getChild("guanyuNode"));
  4436. this.helpBtn = (this.getChild("helpBtn"));
  4437. this.wordsBtn = (this.getChild("wordsBtn"));
  4438. this.aiWordsBtn = (this.getChild("aiWordsBtn"));
  4439. this.returnBtn = (this.getChild("returnBtn"));
  4440. this.ballNode = (this.getChild("ballNode"));
  4441. this.whiteAni = (this.getChild("whiteAni"));
  4442. this.blackAni = (this.getChild("blackAni"));
  4443. this.selfTurn = (this.getChild("selfTurn"));
  4444. this.aiTurn = (this.getChild("aiTurn"));
  4445. this.deskNode = (this.getChild("deskNode"));
  4446. this.moveNode = (this.getChild("moveNode"));
  4447. this.selfTalk = (this.getChild("selfTalk"));
  4448. this.aiTalk = (this.getChild("aiTalk"));
  4449. this.d2Node = (this.getChild("d2Node"));
  4450. this.snowNode = (this.getChild("snowNode"));
  4451. this.guide2 = (this.getChild("guide2"));
  4452. this.guide1 = (this.getChild("guide1"));
  4453. this.guide3 = (this.getChild("guide3"));
  4454. this.guideNode = (this.getChild("guideNode"));
  4455. this.n_lxms_yd1 = (this.getChild("n_lxms_yd1"));
  4456. this.n_lxms_yd2 = (this.getChild("n_lxms_yd2"));
  4457. this.n_lxms_yd3 = (this.getChild("n_lxms_yd3"));
  4458. }
  4459. }
  4460. ui_UIGame.URL = "ui://isxx5ak7kt443qg";
  4461. class ui_UIGameEnd extends fgui.GComponent {
  4462. static createInstance() {
  4463. return (fgui.UIPackage.createObject("game", "UIGameEnd"));
  4464. }
  4465. onConstruct() {
  4466. this.c1 = this.getController("c1");
  4467. this.n22 = (this.getChild("n22"));
  4468. this.n2 = (this.getChild("n2"));
  4469. this.n52 = (this.getChild("n52"));
  4470. this.n53 = (this.getChild("n53"));
  4471. this.coinNode = (this.getChild("coinNode"));
  4472. this.closeNode = (this.getChild("closeNode"));
  4473. this.moneyNode = (this.getChild("moneyNode"));
  4474. this.secretary = (this.getChild("secretary"));
  4475. this.n27 = (this.getChild("n27"));
  4476. this.n29 = (this.getChild("n29"));
  4477. this.talkNode = (this.getChild("talkNode"));
  4478. this.n38 = (this.getChild("n38"));
  4479. this.n39 = (this.getChild("n39"));
  4480. this.n40 = (this.getChild("n40"));
  4481. this.awardNode = (this.getChild("awardNode"));
  4482. this.starNumNode = (this.getChild("starNumNode"));
  4483. this.n47 = (this.getChild("n47"));
  4484. this.conditionNode = (this.getChild("conditionNode"));
  4485. this.isGetAward = (this.getChild("isGetAward"));
  4486. this.leftBtn = (this.getChild("leftBtn"));
  4487. this.rightBtn = (this.getChild("rightBtn"));
  4488. this.btnNode = (this.getChild("btnNode"));
  4489. }
  4490. }
  4491. ui_UIGameEnd.URL = "ui://isxx5ak7hkrz3u3";
  4492. class ui_UIAddCoin extends fgui.GComponent {
  4493. static createInstance() {
  4494. return (fgui.UIPackage.createObject("game", "UIAddCoin"));
  4495. }
  4496. onConstruct() {
  4497. this.n11 = (this.getChild("n11"));
  4498. this.myNode = (this.getChild("myNode"));
  4499. this.t0 = this.getTransition("t0");
  4500. }
  4501. }
  4502. ui_UIAddCoin.URL = "ui://isxx5ak7uxuev4hs";
  4503. class UIAddCoin extends UIBase {
  4504. constructor() {
  4505. super();
  4506. this.coinNum = 2000;
  4507. }
  4508. onConstructor() {
  4509. this.ui = ui_UIAddCoin.createInstance();
  4510. this.contentPane = this.ui;
  4511. this.isEject = false;
  4512. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  4513. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  4514. }
  4515. show() {
  4516. super.show();
  4517. this.ui.t0.play();
  4518. this.setGlobalFont(this.ui);
  4519. }
  4520. videoAddCoin() {
  4521. console.log('zh:qjff_AD_for_UIAddCoin');
  4522. if (Laya.Browser.onAndroid) {
  4523. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  4524. if (!boo) {
  4525. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  4526. return;
  4527. }
  4528. }
  4529. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  4530. }
  4531. else {
  4532. console.log('zh:AD 失败,直接发放奖励');
  4533. this.qjff_AD_for_UIAddCoin();
  4534. }
  4535. }
  4536. qjff_AD_for_UIAddCoin() {
  4537. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  4538. this.hide();
  4539. }
  4540. }
  4541. UIAddCoin.uiName = "UIAddCoin";
  4542. class ui_UIInvitation extends fgui.GComponent {
  4543. static createInstance() {
  4544. return (fgui.UIPackage.createObject("game", "UIInvitation"));
  4545. }
  4546. onConstruct() {
  4547. this.n14 = (this.getChild("n14"));
  4548. this.myNode = (this.getChild("myNode"));
  4549. this.t0 = this.getTransition("t0");
  4550. }
  4551. }
  4552. ui_UIInvitation.URL = "ui://isxx5ak7lrxgv50r";
  4553. class UIInvitation extends UIBase {
  4554. constructor() {
  4555. super();
  4556. }
  4557. onConstructor() {
  4558. this.ui = ui_UIInvitation.createInstance();
  4559. this.contentPane = this.ui;
  4560. this.isEject = false;
  4561. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  4562. }
  4563. show() {
  4564. super.show();
  4565. this.setGlobalFont(this.ui);
  4566. }
  4567. enterGame() {
  4568. xGame.common.gameMode = GameMode.classic;
  4569. DataMgr.setChallengeTimes(1);
  4570. xGame.common.passAwardCoin = 2000;
  4571. let need = xGame.common.classicNiceNeddCoin;
  4572. if (DataMgr.coinEnough(need)) {
  4573. DataMgr.setCoin(-need);
  4574. xGame.eventMgr.event(RESTART_GAME, true);
  4575. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  4576. }
  4577. else {
  4578. xGame.eventMgr.event(RESTART_GAME, true);
  4579. }
  4580. this.hide();
  4581. }
  4582. hide() {
  4583. super.hide();
  4584. }
  4585. }
  4586. UIInvitation.uiName = "UIInvitation";
  4587. class ui_UIMain extends fgui.GComponent {
  4588. static createInstance() {
  4589. return (fgui.UIPackage.createObject("game", "UIMain"));
  4590. }
  4591. onConstruct() {
  4592. this.n47 = (this.getChild("n47"));
  4593. this.n10 = (this.getChild("n10"));
  4594. this.secretary = (this.getChild("secretary"));
  4595. this.moneyNode = (this.getChild("moneyNode"));
  4596. this.headNode = (this.getChild("headNode"));
  4597. this.bigMoveBtn = (this.getChild("bigMoveBtn"));
  4598. this.placeBallBtn = (this.getChild("placeBallBtn"));
  4599. this.classicBtn = (this.getChild("classicBtn"));
  4600. this.globalBtn = (this.getChild("globalBtn"));
  4601. this.n44 = (this.getChild("n44"));
  4602. this.n_dengLu = (this.getChild("n_dengLu"));
  4603. this.settingNode = (this.getChild("settingNode"));
  4604. this.drawBtn = (this.getChild("drawBtn"));
  4605. this.signBtn = (this.getChild("signBtn"));
  4606. this.shopBtn = (this.getChild("shopBtn"));
  4607. this.n45 = (this.getChild("n45"));
  4608. this.ganFaMoShiBtn = (this.getChild("ganFaMoShiBtn"));
  4609. this.secretaryBtn = (this.getChild("secretaryBtn"));
  4610. this.rankBtn = (this.getChild("rankBtn"));
  4611. this.n46 = (this.getChild("n46"));
  4612. this.liucheng1 = (this.getChild("liucheng1"));
  4613. this.rightBtn = (this.getChild("rightBtn"));
  4614. this.n75 = (this.getChild("n75"));
  4615. this.secretaryGuide = (this.getChild("secretaryGuide"));
  4616. this.liucheng2 = (this.getChild("liucheng2"));
  4617. this.guideBtn = (this.getChild("guideBtn"));
  4618. this.n73 = (this.getChild("n73"));
  4619. this.wordsNode = (this.getChild("wordsNode"));
  4620. this.enterGuide = (this.getChild("enterGuide"));
  4621. this.talkNode = (this.getChild("talkNode"));
  4622. this.n83 = (this.getChild("n83"));
  4623. this.n84 = (this.getChild("n84"));
  4624. this.n_yd_challenge_1_mask = (this.getChild("n_yd_challenge_1_mask"));
  4625. this.n_yd_challenge_1_btn = (this.getChild("n_yd_challenge_1_btn"));
  4626. this.n_yd_challenge_1_hand = (this.getChild("n_yd_challenge_1_hand"));
  4627. this.n_yd_challenge_1 = (this.getChild("n_yd_challenge_1"));
  4628. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  4629. }
  4630. }
  4631. ui_UIMain.URL = "ui://isxx5ak7kt443qc";
  4632. class ui_UIMoyu extends fgui.GComponent {
  4633. static createInstance() {
  4634. return (fgui.UIPackage.createObject("loading", "UIMoyu"));
  4635. }
  4636. onConstruct() {
  4637. this.ageTip = (this.getChild("ageTip"));
  4638. this.mainBg = (this.getChild("mainBg"));
  4639. this.xyNode = (this.getChild("xyNode"));
  4640. this.rnNode = (this.getChild("rnNode"));
  4641. this.fcmNode = (this.getChild("fcmNode"));
  4642. this.ageNode = (this.getChild("ageNode"));
  4643. this.tipNode = (this.getChild("tipNode"));
  4644. this.msgNode = (this.getChild("msgNode"));
  4645. }
  4646. }
  4647. ui_UIMoyu.URL = "ui://37nctnhwxe62v4ea";
  4648. class MoyuMgr {
  4649. static initMoyu() {
  4650. this.moyuView = new MoyuView();
  4651. Laya.stage.addChild(this.moyuView.ui.displayObject);
  4652. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  4653. this.moyuView.ui.displayObject.zOrder = 1000;
  4654. this.moyuView.init();
  4655. this.moyuView.showTip(true);
  4656. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  4657. window['XApk'] = this;
  4658. }
  4659. static showAge(show) {
  4660. if (this.moyuView)
  4661. this.moyuView.showAge(show);
  4662. }
  4663. static onPlatMsg(idx) {
  4664. if (!MoyuMgr.moyuView)
  4665. return;
  4666. if (idx == '0') {
  4667. MoyuMgr.moyuView.showTip(false);
  4668. }
  4669. }
  4670. static showAgree(call) {
  4671. if (this.moyuView)
  4672. this.moyuView.showAgree(call);
  4673. else
  4674. call && call();
  4675. }
  4676. static showXy(type = 1) {
  4677. if (this.moyuView)
  4678. this.moyuView.showXy(type);
  4679. }
  4680. }
  4681. MoyuMgr.isAdvise = false;
  4682. class MoyuView {
  4683. constructor() {
  4684. this.ysxyNum = 1;
  4685. this.ysJson = null;
  4686. this.ui = ui_UIMoyu.createInstance();
  4687. }
  4688. init() {
  4689. this.ui.mainBg.visible = false;
  4690. this.ui.xyNode.visible = false;
  4691. this.ui.ageNode.visible = false;
  4692. this.ui.tipNode.visible = false;
  4693. this.ui.rnNode.visible = false;
  4694. this.ui.fcmNode.visible = false;
  4695. this.ui.ageTip.visible = false;
  4696. this.ui.msgNode.visible = false;
  4697. this.ui.visible = false;
  4698. this.ui.xyNode.xyList.setVirtual();
  4699. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  4700. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  4701. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  4702. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  4703. this.ui.xyNode.btnKnown.visible = false;
  4704. this.ui.xyNode.xy1.visible = false;
  4705. this.ui.xyNode.xy2.visible = false;
  4706. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  4707. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  4708. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  4709. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  4710. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  4711. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  4712. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  4713. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  4714. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  4715. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  4716. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  4717. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  4718. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  4719. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  4720. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  4721. this.ysxyNum = 2;
  4722. }
  4723. }
  4724. onClick(obj) {
  4725. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4726. switch (obj) {
  4727. case this.ui.ageTip:
  4728. if (Moyu.isTTApk) {
  4729. this.ui.ageNode.visible = true;
  4730. this.ui.mainBg.visible = true;
  4731. }
  4732. break;
  4733. case this.ui.tipNode:
  4734. this.showTip(false);
  4735. break;
  4736. case this.ui.ageNode.btnAge:
  4737. this.ui.ageNode.visible = false;
  4738. this.ui.mainBg.visible = false;
  4739. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  4740. this.ui.visible = false;
  4741. break;
  4742. case this.ui.xyNode.btnXy3:
  4743. case this.ui.xyNode.btnXy1:
  4744. this.loadXy(1);
  4745. break;
  4746. case this.ui.xyNode.btnXy2:
  4747. this.loadXy(2);
  4748. break;
  4749. case this.ui.xyNode.btnBack:
  4750. this.ui.xyNode.xy1.visible = true;
  4751. this.ui.xyNode.xy2.visible = false;
  4752. break;
  4753. case this.ui.xyNode.btnKnown:
  4754. this.ui.xyNode.visible = false;
  4755. this.ui.mainBg.visible = false;
  4756. this.ui.visible = false;
  4757. break;
  4758. case this.ui.rnNode.btnCheck:
  4759. this.check();
  4760. break;
  4761. case this.ui.rnNode.btnExit:
  4762. case this.ui.xyNode.btnNo:
  4763. this.ysxyNum--;
  4764. if (this.ysxyNum > 0)
  4765. this.showMsg("Refuse to quit the game once again");
  4766. else {
  4767. Moyu.userAgree(false);
  4768. Moyu.exit();
  4769. }
  4770. break;
  4771. case this.ui.xyNode.btnSure:
  4772. case this.ui.xyNode.btnYes:
  4773. DataMgr.userData.isAgree = true;
  4774. DataMgr.saveUserData();
  4775. this.onAgree();
  4776. break;
  4777. case this.ui.rnNode.btnDone:
  4778. this.ui.rnNode.visible = false;
  4779. this.ui.visible = false;
  4780. break;
  4781. case this.ui.fcmNode.btnRn:
  4782. this.showRn();
  4783. break;
  4784. }
  4785. }
  4786. showTip(show) {
  4787. if (!Moyu.isVVApk && !Moyu.isOPApk)
  4788. return;
  4789. if (show) {
  4790. MoyuMgr.isAdvise = true;
  4791. this.ui.visible = true;
  4792. this.ui.tipNode.visible = true;
  4793. this.ui.tipNode.alpha = 1;
  4794. Laya.timer.once(1000, this, this.showTip, [false]);
  4795. }
  4796. else {
  4797. this.ui.tipNode.alpha = 1;
  4798. this.ui.tipNode.visible = true;
  4799. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  4800. this.ui.tipNode.visible = false;
  4801. MoyuMgr.isAdvise = false;
  4802. }), 1000);
  4803. }
  4804. }
  4805. showAge(show, px = 0, py = 0) {
  4806. if (Moyu.platType > 10 && !Moyu.isIos) {
  4807. this.ui.ageTip.x = px;
  4808. this.ui.ageTip.y = py;
  4809. this.ui.ageTip.visible = show;
  4810. if (show)
  4811. this.ui.visible = true;
  4812. }
  4813. }
  4814. showAgree(call) {
  4815. this.agreeCall = call;
  4816. this.onAgree();
  4817. return;
  4818. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  4819. this.showXy(0);
  4820. }
  4821. else
  4822. this.onAgree();
  4823. }
  4824. onAgree() {
  4825. if (!this.ui.ageNode.visible)
  4826. this.ui.visible = false;
  4827. this.ui.xyNode.visible = false;
  4828. Moyu.userAgree(true);
  4829. this.showAge(false);
  4830. this.agreeCall && this.agreeCall();
  4831. this.showRn();
  4832. }
  4833. showMsg(txt) {
  4834. this.ui.msgNode.txtMsg.text = txt;
  4835. this.ui.msgNode.visible = true;
  4836. this.ui.msgNode.alpha = 1;
  4837. this.ui.visible = true;
  4838. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  4839. this.ui.msgNode.visible = false;
  4840. }), 2500, true);
  4841. }
  4842. showRn() {
  4843. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4844. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  4845. this.ui.rnNode.rn1.visible = true;
  4846. this.ui.rnNode.rn2.visible = false;
  4847. this.ui.rnNode.rn3.visible = false;
  4848. this.ui.rnNode.rn4.visible = false;
  4849. this.ui.rnNode.visible = true;
  4850. this.ui.mainBg.visible = true;
  4851. this.ui.rnNode.btnDone.visible = false;
  4852. this.ui.rnNode.btnExit.visible = true;
  4853. this.ui.rnNode.btnCheck.visible = true;
  4854. this.ui.fcmNode.visible = false;
  4855. this.ui.visible = true;
  4856. return;
  4857. }
  4858. }
  4859. this.showFcm();
  4860. }
  4861. showFcm() {
  4862. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  4863. Moyu.initFCM(true);
  4864. if (Moyu.gameTime < 1)
  4865. this.fcmLoop();
  4866. else if (Moyu.gameTime < 999)
  4867. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  4868. }
  4869. }
  4870. fcmLoop() {
  4871. if (Moyu.gameTime < 1) {
  4872. this.ui.rnNode.visible = false;
  4873. this.ui.fcmNode.visible = true;
  4874. this.ui.mainBg.visible = true;
  4875. this.ui.visible = true;
  4876. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  4877. Laya.timer.clear(this.ui, this.fcmLoop);
  4878. }
  4879. }
  4880. check() {
  4881. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  4882. this.ui.rnNode.rn1.visible = false;
  4883. this.ui.rnNode.rn2.visible = false;
  4884. this.ui.rnNode.rn4.visible = true;
  4885. }
  4886. else if (this.ui.rnNode.rn4.visible) {
  4887. let name = this.ui.rnNode.inputName.text;
  4888. let code = this.ui.rnNode.inputCode.text;
  4889. if (code && code.length == 18) {
  4890. this.ui.rnNode.rn1.visible = false;
  4891. this.ui.rnNode.rn4.visible = false;
  4892. Moyu.authenticate(name, code, (res) => {
  4893. this.ui.rnNode.rn2.visible = !res;
  4894. this.ui.rnNode.rn3.visible = res;
  4895. this.ui.rnNode.btnDone.visible = res;
  4896. this.ui.rnNode.btnExit.visible = !res;
  4897. this.ui.rnNode.btnCheck.visible = !res;
  4898. if (res)
  4899. this.showFcm();
  4900. });
  4901. }
  4902. else
  4903. this.showMsg("信息填写不完整");
  4904. }
  4905. }
  4906. loadXy(type = 0) {
  4907. this.ui.xyNode.xy1.visible = false;
  4908. this.ui.xyNode.xy2.visible = true;
  4909. this.ui.xyNode.xyList.scrollToView(0);
  4910. if (type == 1) {
  4911. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  4912. }
  4913. else if (type == 2) {
  4914. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  4915. }
  4916. }
  4917. showXy(type = 0) {
  4918. this.xyBtn();
  4919. if (type == 0) {
  4920. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  4921. this.ui.xyNode.btnSure.visible = true;
  4922. }
  4923. else {
  4924. this.ui.xyNode.btnYes.visible = true;
  4925. this.ui.xyNode.btnNo.visible = true;
  4926. }
  4927. }
  4928. else {
  4929. this.ui.xyNode.btnKnown.visible = true;
  4930. this.ui.mainBg.visible = true;
  4931. }
  4932. this.ui.xyNode.xy1.visible = true;
  4933. this.ui.xyNode.xy2.visible = false;
  4934. this.ui.xyNode.visible = true;
  4935. this.ui.visible = true;
  4936. }
  4937. xyBtn() {
  4938. this.ui.xyNode.btnSure.visible = false;
  4939. this.ui.xyNode.btnYes.visible = false;
  4940. this.ui.xyNode.btnNo.visible = false;
  4941. this.ui.xyNode.btnKnown.visible = false;
  4942. {
  4943. this.ui.xyNode.btnXy3.visible = false;
  4944. this.ui.xyNode.btnXy2.visible = true;
  4945. this.ui.xyNode.btnXy1.visible = true;
  4946. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  4947. }
  4948. }
  4949. createXY(json) {
  4950. this.ysJson = json.content;
  4951. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  4952. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  4953. this.ui.xyNode.xy2.visible = true;
  4954. }
  4955. renderListItem(idx, cell) {
  4956. let xy = this.ysJson[idx];
  4957. cell.height = xy.line * 30;
  4958. cell.xyItem.text = xy.text;
  4959. }
  4960. onDestroy() {
  4961. this.agreeCall = null;
  4962. }
  4963. }
  4964. class SettingNode {
  4965. constructor(ui) {
  4966. this.showSetting = false;
  4967. this.openSound = true;
  4968. this.openShake = true;
  4969. this.ui = ui;
  4970. this.ui.soundBtn.onClick(this, this.switchSound);
  4971. this.ui.shakeBtn.onClick(this, this.switchShake);
  4972. this.ui.xyBtn.onClick(this, this.onXy);
  4973. this.ui.clickNode.onClick(this, this.changeSetting);
  4974. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  4975. this.ui.xyBtn.visible = false;
  4976. this.ui.shakeBtn.visible = false;
  4977. }
  4978. changeSetting() {
  4979. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4980. this.showSetting = !this.showSetting;
  4981. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  4982. }
  4983. switchSound() {
  4984. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4985. this.openSound = !this.openSound;
  4986. Moyu.onSetting(this.openSound, this.openShake);
  4987. xGame.soundMgr.onSetting(this.openSound);
  4988. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  4989. }
  4990. switchShake() {
  4991. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4992. this.openShake = !this.openShake;
  4993. Moyu.onSetting(this.openSound, this.openShake);
  4994. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  4995. }
  4996. onXy() {
  4997. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  4998. MoyuMgr.showXy(1);
  4999. }
  5000. }
  5001. class ui_UILevelDisplay extends fgui.GComponent {
  5002. static createInstance() {
  5003. return (fgui.UIPackage.createObject("game", "UILevelDisplay"));
  5004. }
  5005. onConstruct() {
  5006. this.n9 = (this.getChild("n9"));
  5007. this.myNode = (this.getChild("myNode"));
  5008. this.closeNode = (this.getChild("closeNode"));
  5009. }
  5010. }
  5011. ui_UILevelDisplay.URL = "ui://isxx5ak7avag46o";
  5012. class ui_UILevelProp extends fgui.GComponent {
  5013. static createInstance() {
  5014. return (fgui.UIPackage.createObject("game", "UILevelProp"));
  5015. }
  5016. onConstruct() {
  5017. this.n16 = (this.getChild("n16"));
  5018. this.myNode = (this.getChild("myNode"));
  5019. this.closeBtn = (this.getChild("closeBtn"));
  5020. this.moneyNode = (this.getChild("moneyNode"));
  5021. this.t1 = this.getTransition("t1");
  5022. }
  5023. }
  5024. ui_UILevelProp.URL = "ui://isxx5ak7xs1r47l";
  5025. class ui_ShowItem extends fgui.GComponent {
  5026. static createInstance() {
  5027. return (fgui.UIPackage.createObject("game", "ShowItem"));
  5028. }
  5029. onConstruct() {
  5030. this.myImg = (this.getChild("myImg"));
  5031. }
  5032. }
  5033. ui_ShowItem.URL = "ui://isxx5ak710hfv49o";
  5034. class ShowItem {
  5035. constructor() {
  5036. this.ui = ui_ShowItem.createInstance();
  5037. }
  5038. destroySelf() {
  5039. if (!this.ui.isDisposed) {
  5040. this.ui.removeFromParent();
  5041. this.ui.dispose();
  5042. }
  5043. }
  5044. setParent(parent) {
  5045. parent.addChild(this.ui);
  5046. }
  5047. setPos(x, y) {
  5048. this.ui.x = x;
  5049. this.ui.y = y;
  5050. }
  5051. setUrl(index) {
  5052. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  5053. }
  5054. }
  5055. class ui_UIPower extends fgui.GComponent {
  5056. static createInstance() {
  5057. return (fgui.UIPackage.createObject("game", "UIPower"));
  5058. }
  5059. onConstruct() {
  5060. this.n11 = (this.getChild("n11"));
  5061. this.myNode = (this.getChild("myNode"));
  5062. this.t0 = this.getTransition("t0");
  5063. }
  5064. }
  5065. ui_UIPower.URL = "ui://isxx5ak7jpszv4n1";
  5066. class UIPower extends UIBase {
  5067. constructor() {
  5068. super();
  5069. }
  5070. onConstructor() {
  5071. this.ui = ui_UIPower.createInstance();
  5072. this.contentPane = this.ui;
  5073. this.isEject = false;
  5074. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  5075. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  5076. }
  5077. show() {
  5078. super.show();
  5079. this.ui.t0.play();
  5080. this.setGlobalFont(this.ui);
  5081. }
  5082. videoGetPower() {
  5083. console.log('zh:qjff_AD_for_uipower');
  5084. if (Laya.Browser.onAndroid) {
  5085. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  5086. if (!boo) {
  5087. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  5088. return;
  5089. }
  5090. }
  5091. if (Laya.Browser.onAndroid) {
  5092. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  5093. }
  5094. else {
  5095. console.log('zh:AD 失败,直接发放奖励');
  5096. this.qjff_AD_for_uipower();
  5097. }
  5098. }
  5099. else {
  5100. this.qjff_AD_for_uipower();
  5101. }
  5102. }
  5103. qjff_AD_for_uipower() {
  5104. DataMgr.setPower(xGame.common.videoPower, true);
  5105. xGame.eventMgr.event(POWER_TIME);
  5106. this.hide();
  5107. }
  5108. }
  5109. UIPower.uiName = "UIPower";
  5110. class UILevelProp extends UIBase {
  5111. constructor() {
  5112. super();
  5113. this.firstPos = 385;
  5114. this.secondPos = 467;
  5115. this.showItemArr = [];
  5116. }
  5117. onConstructor() {
  5118. this.ui = ui_UILevelProp.createInstance();
  5119. this.contentPane = this.ui;
  5120. this.isEject = false;
  5121. this.addUIClick(this.ui.closeBtn, this.hideWin);
  5122. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  5123. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  5124. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  5125. }
  5126. show(level) {
  5127. console.log('zh:show.');
  5128. super.show();
  5129. this.ui.t1.play();
  5130. this.level = level;
  5131. this.data = cfgTable.placeballData[this.level];
  5132. this.updateSelf();
  5133. this.showPreView();
  5134. this.moneyNode.ui.c1.selectedIndex = 2;
  5135. this.moneyNode.checkPowerTime();
  5136. this.moneyNode.powerChange();
  5137. this.yinDaoForLianxi();
  5138. this.setGlobalFont(this.ui);
  5139. }
  5140. yinDaoForLianxi() {
  5141. let lianXiGuide = DataMgr.getLianXiGuide();
  5142. console.log('zh:lianXiGuide=', lianXiGuide);
  5143. if (lianXiGuide === 0) {
  5144. this.ui.myNode.n_yd_3.visible = true;
  5145. console.log('zh:yinDaoForLianxi 333 set ok');
  5146. }
  5147. else {
  5148. this.ui.myNode.n_yd_3.visible = false;
  5149. console.log('zh:无需引导33');
  5150. }
  5151. }
  5152. showPreView() {
  5153. let item;
  5154. let data;
  5155. for (let index = 0; index < this.showItemArr.length; index++) {
  5156. item = this.showItemArr[index];
  5157. item.destroySelf();
  5158. }
  5159. this.showItemArr = [];
  5160. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  5161. for (const key in cfgData) {
  5162. data = cfgData[key];
  5163. item = new ShowItem();
  5164. item.setParent(this.ui.myNode.displayRoot);
  5165. item.setPos(data.x, data.y);
  5166. item.setUrl(data.value);
  5167. this.showItemArr.push(item);
  5168. }
  5169. }
  5170. updateSelf() {
  5171. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  5172. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  5173. if (this.data.ball == -1) {
  5174. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  5175. }
  5176. else {
  5177. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  5178. }
  5179. let localData = DataMgr.getPlaceBallLevel(this.level);
  5180. let getAward = localData.getAward;
  5181. let cfg = cfgTable.placeballData[this.level];
  5182. let coin = this.data.award[0];
  5183. let diamond = this.data.award[1];
  5184. if (cfg.type == PlaceBallType.challenge) {
  5185. diamond = 0;
  5186. coin = 100;
  5187. }
  5188. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  5189. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  5190. this.ui.myNode.coinNode.numTxt.text = coin + "";
  5191. if (cfg.type == PlaceBallType.challenge) {
  5192. this.ui.myNode.coinNode.numTxt.text = "";
  5193. }
  5194. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  5195. if (coin > 0 && diamond > 0) {
  5196. this.ui.myNode.diamondNode.x = 385;
  5197. this.ui.myNode.coinNode.x = 467;
  5198. }
  5199. else {
  5200. this.ui.myNode.diamondNode.x = 385;
  5201. this.ui.myNode.coinNode.x = 385;
  5202. }
  5203. if (!getAward) {
  5204. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  5205. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  5206. }
  5207. else {
  5208. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  5209. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  5210. }
  5211. }
  5212. startGame() {
  5213. console.log("zh:startGame");
  5214. if (DataMgr.powerEnough()) {
  5215. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  5216. this.ui.myNode.startBtn.touchable = false;
  5217. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  5218. console.log('zh:startGame dh ');
  5219. this.ui.myNode.startBtn.touchable = true;
  5220. DataMgr.setPower(-1);
  5221. xGame.eventMgr.event(POWER_TIME);
  5222. xGame.common.gameMode = GameMode.placeBall;
  5223. xGame.common.placeBallCurLevel = this.level;
  5224. xGame.uiMgr.Show(UIGame);
  5225. xGame.uiMgr.Hide(UILevelDisplay);
  5226. xGame.uiMgr.Hide(UIMain);
  5227. this.logEventForChallenge_level_start(this.level);
  5228. this.hideWin();
  5229. }));
  5230. console.log('zh:eeeee');
  5231. }
  5232. else {
  5233. let guide = DataMgr.getLianXiGuide();
  5234. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  5235. console.log('zh:自动添加2点体力,以便于完成练习引导模式');
  5236. DataMgr.setPower(2);
  5237. }
  5238. console.log('zh:guide = ' + guide);
  5239. console.log('zh:xGame.common.gameMode = ' + xGame.common.gameMode);
  5240. console.log('zh:powerEnough不足=' + DataMgr.powerEnough());
  5241. xGame.uiMgr.Show(UIPower);
  5242. }
  5243. }
  5244. logEventForChallenge_level_start(level) {
  5245. let keyStr = 'sjmd_challenge_level_start';
  5246. let jsonStr = {
  5247. "count": 1,
  5248. "gold_balance ": DataMgr.getCoin(),
  5249. "level": level,
  5250. "diamond_balance ": DataMgr.getDiamond()
  5251. };
  5252. if (LocalStorageManager.hasJosnKey(keyStr)) {
  5253. const d = LocalStorageManager.getItem(keyStr);
  5254. if (level > d.level) {
  5255. jsonStr.count = d.count + 1;
  5256. LocalStorageManager.setItem(keyStr, jsonStr);
  5257. }
  5258. else {
  5259. }
  5260. }
  5261. else {
  5262. LocalStorageManager.setItem(keyStr, jsonStr);
  5263. }
  5264. const reqStr = JSON.stringify(jsonStr);
  5265. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  5266. }
  5267. hideWin() {
  5268. super.hide();
  5269. if (this.ui.myNode.startBtn) {
  5270. this.ui.myNode.startBtn.touchable = true;
  5271. if (this.ui.myNode.startBtn.powerEft.t0) {
  5272. this.ui.myNode.startBtn.powerEft.t0.stop();
  5273. }
  5274. }
  5275. }
  5276. }
  5277. UILevelProp.uiName = "UILevelProp";
  5278. class PutBallLevelDisplay {
  5279. constructor(ui, index) {
  5280. this.index = 0;
  5281. this.ui = ui;
  5282. this.index = index;
  5283. this.ui.onClick(this, this.clickSelf);
  5284. this.updateSelf();
  5285. this.ui.levelTxt.text = (this.index + 1) + "";
  5286. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  5287. this.ui.special.levelTxt.text = (this.index + 1) + "";
  5288. }
  5289. updateSelf() {
  5290. let level = this.index + 1;
  5291. this.data = DataMgr.getPlaceBallLevel(level);
  5292. this.ui.starNode.c1.selectedIndex = this.data.star;
  5293. let isChallenge = cfgTable.placeballData[level].type;
  5294. if (this.data.isCur) {
  5295. if (isChallenge) {
  5296. this.ui.c1.selectedIndex = 5;
  5297. }
  5298. else {
  5299. this.ui.c1.selectedIndex = 2;
  5300. }
  5301. }
  5302. else {
  5303. if (this.data.play) {
  5304. if (this.data.star == 3) {
  5305. this.ui.c1.selectedIndex = 0;
  5306. }
  5307. else {
  5308. this.ui.c1.selectedIndex = 1;
  5309. }
  5310. }
  5311. else {
  5312. if (isChallenge) {
  5313. this.ui.c1.selectedIndex = 4;
  5314. }
  5315. else {
  5316. this.ui.c1.selectedIndex = 3;
  5317. }
  5318. }
  5319. }
  5320. }
  5321. clickSelf() {
  5322. console.log("zh:lev clickSelf");
  5323. if (!this.data.play)
  5324. return;
  5325. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5326. xGame.uiMgr.Show(UILevelProp, this.index + 1);
  5327. }
  5328. }
  5329. class UILevelDisplay extends UIBase {
  5330. constructor() {
  5331. super();
  5332. }
  5333. onConstructor() {
  5334. this.ui = ui_UILevelDisplay.createInstance();
  5335. this.contentPane = this.ui;
  5336. this.isEject = false;
  5337. this.myList = this.ui.myNode.myList;
  5338. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  5339. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  5340. this.levelItemArr = [];
  5341. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  5342. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  5343. this.myList.numItems = levelNum;
  5344. }
  5345. levelItemRender(index, target) {
  5346. let item = new PutBallLevelDisplay(target, index);
  5347. this.levelItemArr.push(item);
  5348. }
  5349. show() {
  5350. super.show();
  5351. this.updateLevel();
  5352. this.scrollToPlace();
  5353. this.yinDaoForLianxi();
  5354. this.setGlobalFont(this.ui);
  5355. }
  5356. yinDaoForLianxi() {
  5357. let lianXiGuide = DataMgr.getLianXiGuide();
  5358. console.log('zh:lianXiGuide=', lianXiGuide);
  5359. if (lianXiGuide === 0) {
  5360. this.ui.myNode.n_yd.visible = true;
  5361. console.log('zh:yinDaoForLianxi 222 set ok');
  5362. }
  5363. else {
  5364. this.ui.myNode.n_yd.visible = false;
  5365. console.log('zh:无需引导');
  5366. }
  5367. }
  5368. showLevelTipWindows() {
  5369. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5370. xGame.uiMgr.Show(UILevelProp, 1);
  5371. }
  5372. updateLevel() {
  5373. let temp;
  5374. for (let index = 0; index < this.levelItemArr.length; index++) {
  5375. temp = this.levelItemArr[index];
  5376. temp.updateSelf();
  5377. }
  5378. }
  5379. scrollToPlace() {
  5380. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  5381. let passArr = DataMgr.getPlaceBallLevelList();
  5382. let offest = passArr.length;
  5383. if (offest >= maxNum - 1)
  5384. offest = maxNum - 1;
  5385. this.myList.scrollToView(offest, true, true);
  5386. }
  5387. hide() {
  5388. super.hide();
  5389. }
  5390. }
  5391. UILevelDisplay.uiName = "UILevelDisplay";
  5392. class ui_UIMatching extends fgui.GComponent {
  5393. static createInstance() {
  5394. return (fgui.UIPackage.createObject("game", "UIMatching"));
  5395. }
  5396. onConstruct() {
  5397. this.n5 = (this.getChild("n5"));
  5398. this.n49 = (this.getChild("n49"));
  5399. this.n51 = (this.getChild("n51"));
  5400. this.n64 = (this.getChild("n64"));
  5401. this.n2 = (this.getChild("n2"));
  5402. this.n53 = (this.getChild("n53"));
  5403. this.n54 = (this.getChild("n54"));
  5404. this.n56 = (this.getChild("n56"));
  5405. this.n58 = (this.getChild("n58"));
  5406. this.n59 = (this.getChild("n59"));
  5407. this.n57 = (this.getChild("n57"));
  5408. this.n60 = (this.getChild("n60"));
  5409. this.n62 = (this.getChild("n62"));
  5410. this.awardTxt = (this.getChild("awardTxt"));
  5411. this.n61 = (this.getChild("n61"));
  5412. this.selfHead = (this.getChild("selfHead"));
  5413. this.aiHead = (this.getChild("aiHead"));
  5414. this.n82 = (this.getChild("n82"));
  5415. this.n84 = (this.getChild("n84"));
  5416. this.n83 = (this.getChild("n83"));
  5417. this.t1 = this.getTransition("t1");
  5418. this.t2 = this.getTransition("t2");
  5419. this.t3 = this.getTransition("t3");
  5420. this.t4 = this.getTransition("t4");
  5421. }
  5422. }
  5423. ui_UIMatching.URL = "ui://isxx5ak7n0xy3y2";
  5424. class UIMatching extends UIBase {
  5425. constructor() {
  5426. super();
  5427. }
  5428. onConstructor() {
  5429. this.ui = ui_UIMatching.createInstance();
  5430. this.contentPane = this.ui;
  5431. this.isEject = false;
  5432. }
  5433. show(callback) {
  5434. super.show();
  5435. PlatMgr.showBanner(true);
  5436. this.callback = callback;
  5437. let user = Moyu.getUserInfo();
  5438. if (!this.selfPot) {
  5439. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  5440. }
  5441. if (!this.aiPot) {
  5442. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  5443. }
  5444. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  5445. this.ui.selfHead.nameTxt.text = user.nickName;
  5446. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  5447. this.ui.aiHead.nameTxt.text = "???";
  5448. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  5449. this.ui.selfHead.c1.selectedIndex = 0;
  5450. this.ui.aiHead.c1.selectedIndex = 0;
  5451. this.ui.selfHead.x = this.selfPot.x;
  5452. this.ui.selfHead.y = this.selfPot.y;
  5453. this.ui.aiHead.x = this.aiPot.x;
  5454. this.ui.aiHead.y = this.aiPot.y;
  5455. switch (xGame.common.gameMode) {
  5456. case GameMode.classic:
  5457. break;
  5458. case GameMode.bigMove:
  5459. this.initSkillData();
  5460. break;
  5461. default:
  5462. break;
  5463. }
  5464. this.ui.t1.play(Laya.Handler.create(this, () => {
  5465. this.ui.t2.play(Laya.Handler.create(this, () => {
  5466. switch (xGame.common.gameMode) {
  5467. case GameMode.classic:
  5468. this.waitingPeople();
  5469. break;
  5470. case GameMode.bigMove:
  5471. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  5472. break;
  5473. default:
  5474. break;
  5475. }
  5476. }));
  5477. }));
  5478. this.setGlobalFont(this.ui);
  5479. }
  5480. initSkillData() {
  5481. this.skillSelectData = [];
  5482. let skillUrl = xGame.common.skillIconList;
  5483. let skillName = xGame.common.skillNameList;
  5484. let skillLevel = DataMgr.getBigSkillList();
  5485. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  5486. for (let index = 0; index < 5; index++) {
  5487. let obj = {};
  5488. obj.skillImg = skillUrl[index];
  5489. obj.skillName = skillName[index];
  5490. obj.skillType = skillType[index];
  5491. obj.skillLevel = skillLevel[index];
  5492. this.skillSelectData.push(obj);
  5493. }
  5494. }
  5495. getAISkillLevel(myLevel) {
  5496. let video = xGame.common.upSkillLevel;
  5497. let aiLevel;
  5498. let temp;
  5499. if (video) {
  5500. temp = xGame.common.randomNum(-2, -1);
  5501. }
  5502. else {
  5503. if (myLevel <= 5) {
  5504. temp = xGame.common.randomNum(1, 3);
  5505. }
  5506. else if (myLevel <= 9) {
  5507. temp = xGame.common.randomNum(-2, 1);
  5508. }
  5509. else {
  5510. temp = xGame.common.randomNum(-4, 0);
  5511. }
  5512. }
  5513. aiLevel = temp + myLevel;
  5514. if (aiLevel <= 1)
  5515. aiLevel = 1;
  5516. if (aiLevel >= 10)
  5517. aiLevel = 10;
  5518. return aiLevel;
  5519. }
  5520. getAISkillType() {
  5521. return xGame.common.randomNum(1, 4);
  5522. let successTimes = DataMgr.getSkillSuccessTimes();
  5523. let info = cfgTable.aiskillData[successTimes];
  5524. if (!info) {
  5525. let max = Object.keys(cfgTable.aiskillData).length - 1;
  5526. info = cfgTable.aiskillData[max];
  5527. }
  5528. let dataArr = info.skillselect;
  5529. let myCfg = {};
  5530. for (let index = 0; index < dataArr.length; index++) {
  5531. let temp = dataArr[index].split('-');
  5532. myCfg[temp[0]] = {};
  5533. myCfg[temp[0]].id = parseInt(temp[0]);
  5534. myCfg[temp[0]].weight = parseInt(temp[1]);
  5535. }
  5536. let aiCfg = xGame.common.initWeight(myCfg);
  5537. let curData = xGame.common.getRandomWeightData(aiCfg);
  5538. return parseInt(curData.id);
  5539. }
  5540. getAISkillData(index) {
  5541. let myLevel = this.skillSelectData[index].skillLevel;
  5542. let aiLevel = this.getAISkillLevel(myLevel);
  5543. let aiType = this.getAISkillType() - 1;
  5544. return { aiLevel, aiType } = { aiLevel, aiType };
  5545. }
  5546. skillSelectFinish(index) {
  5547. let aiInfo = this.getAISkillData(index);
  5548. xGame.common.gameMgr.selfCurSkill = index;
  5549. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  5550. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  5551. this.ui.selfHead.c1.selectedIndex = 1;
  5552. this.ui.aiHead.c1.selectedIndex = 1;
  5553. let myData = this.skillSelectData[index];
  5554. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  5555. let guide = DataMgr.getSkillGuide();
  5556. if (guide == 0) {
  5557. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  5558. }
  5559. else {
  5560. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  5561. }
  5562. let aiData = this.skillSelectData[aiInfo.aiType];
  5563. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  5564. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  5565. this.waitingPeople();
  5566. }
  5567. waitingPeople() {
  5568. let time = xGame.common.randomNum(1000, 3000);
  5569. time += 1000;
  5570. Laya.timer.once(time, this, () => {
  5571. this.matchingSuccess();
  5572. });
  5573. }
  5574. matchingSuccess() {
  5575. let gameUI = xGame.common.gameUI;
  5576. let name = gameUI.ui.topNode.aiNameTxt.text;
  5577. let url = gameUI.ui.topNode.aiHeadLoader.url;
  5578. this.ui.aiHead.nameTxt.text = name;
  5579. this.ui.aiHead.headImg.url = url;
  5580. name = gameUI.ui.topNode.selfNameTxt.text;
  5581. url = gameUI.ui.topNode.selfHeadLoader.url;
  5582. this.ui.selfHead.nameTxt.text = name;
  5583. this.ui.selfHead.headImg.url = url;
  5584. this.ui.t3.play(Laya.Handler.create(this, () => {
  5585. this.callback && this.callback();
  5586. this.ui.t4.play(Laya.Handler.create(this, () => {
  5587. this.destroySelf();
  5588. }));
  5589. }));
  5590. }
  5591. destroySelf() {
  5592. this.callback = null;
  5593. this.skillSelectData = null;
  5594. this.selfPot = null;
  5595. this.aiPot = null;
  5596. if (!this.ui.isDisposed) {
  5597. this.ui.removeFromParent();
  5598. this.ui.dispose();
  5599. }
  5600. xGame.uiMgr.destroyUI(this);
  5601. }
  5602. }
  5603. UIMatching.uiName = "UIMatching";
  5604. class ui_UIRanking extends fgui.GComponent {
  5605. static createInstance() {
  5606. return (fgui.UIPackage.createObject("game", "UIRanking"));
  5607. }
  5608. onConstruct() {
  5609. this.n26 = (this.getChild("n26"));
  5610. this.myNode = (this.getChild("myNode"));
  5611. }
  5612. }
  5613. ui_UIRanking.URL = "ui://isxx5ak7p7rrv4p8";
  5614. class UIRanking extends UIBase {
  5615. constructor() {
  5616. super();
  5617. this.showSelf = true;
  5618. this.rankType = 1;
  5619. this.rankList = [];
  5620. this.topX = 10;
  5621. this.myIndex = this.topX + 1;
  5622. this.myStar = 0;
  5623. }
  5624. onConstructor() {
  5625. this.ui = ui_UIRanking.createInstance();
  5626. this.contentPane = this.ui;
  5627. this.isEject = false;
  5628. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  5629. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  5630. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  5631. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  5632. this.ui.myNode.myList.setVirtual();
  5633. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  5634. }
  5635. show() {
  5636. super.show();
  5637. this.getPaiHangBangDataFormJosnFile();
  5638. this.updateSelf();
  5639. let self = Moyu.getUserInfo();
  5640. if (!self.isAuth) {
  5641. Moyu.initUser(this, () => {
  5642. DataMgr.upRankData();
  5643. });
  5644. }
  5645. this.setGlobalFont(this.ui);
  5646. }
  5647. getPaiHangBangDataFormJosnFile() {
  5648. const rankingList = cfgTable.paiHangBangData.list;
  5649. this.updateItemData(rankingList);
  5650. }
  5651. updateSelfItem() {
  5652. console.log('zh:Moyu.platType =' + Moyu.platType);
  5653. let self = Moyu.getUserInfo();
  5654. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  5655. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  5656. if (this.myIndex > this.topX) {
  5657. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  5658. }
  5659. else {
  5660. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  5661. }
  5662. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  5663. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  5664. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  5665. }
  5666. updateItemData(data) {
  5667. this.myStar = xGame.common.getAllStarNum();
  5668. if (this.rankList.length < 2) {
  5669. this.rankList = data;
  5670. let self = Moyu.getUserInfo();
  5671. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  5672. self.headIcon = self.headIcon;
  5673. for (let i = 0; i < data.length; i++) {
  5674. let data = this.rankList[i];
  5675. if (data.userId == self.userId) {
  5676. this.rankList.splice(i, 1);
  5677. break;
  5678. }
  5679. }
  5680. for (let i = 0; i < data.length; i++) {
  5681. let data = this.rankList[i];
  5682. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  5683. this.myIndex = i + 1;
  5684. let user = { headIcon: self.headIcon, nickName: "myself" };
  5685. let ud = { user: user, data: {} };
  5686. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  5687. console.log('zh:Moyu.platType = ' + Moyu.platType);
  5688. if (Moyu.platType < 11) {
  5689. user.headIcon = self.headIcon;
  5690. user.nickName = self.nickName;
  5691. }
  5692. this.rankList.splice(i, 0, md);
  5693. break;
  5694. }
  5695. }
  5696. }
  5697. this.updateSelfItem();
  5698. this.ui.myNode.myList.numItems = this.rankList.length;
  5699. }
  5700. updateItemUI(index, obj) {
  5701. let data = this.rankList[index];
  5702. let userData = JSON.parse(data.userData).user;
  5703. obj.nameTxt.text = userData.nickName.toString();
  5704. obj.valueTxt.text = data.rankScore;
  5705. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  5706. obj.rankTxt.text = index + 1;
  5707. switch (index) {
  5708. case 0:
  5709. this.setImg(obj, 1, 0, 0);
  5710. obj.rankTxt.color = "#FFC047";
  5711. break;
  5712. case 1:
  5713. this.setImg(obj, 0, 1, 0);
  5714. obj.rankTxt.color = "#ACACAC";
  5715. break;
  5716. case 2:
  5717. this.setImg(obj, 0, 0, 1);
  5718. obj.rankTxt.color = "#D09672";
  5719. break;
  5720. default:
  5721. this.setImg(obj, 0, 0, 0);
  5722. obj.rankTxt.color = "#496FAB";
  5723. break;
  5724. }
  5725. }
  5726. setImg(obj, a, b, c) {
  5727. obj.img1.visible = a ? true : false;
  5728. obj.img2.visible = b ? true : false;
  5729. obj.img3.visible = c ? true : false;
  5730. }
  5731. changeList(type) {
  5732. this.rankType = type;
  5733. this.updateSelf();
  5734. }
  5735. changeSelfNode() {
  5736. this.showSelf = !this.showSelf;
  5737. this.updateSelf();
  5738. }
  5739. updateSelf() {
  5740. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  5741. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  5742. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5743. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  5744. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  5745. }
  5746. }
  5747. UIRanking.uiName = "UIRanking";
  5748. class ui_UISecretary extends fgui.GComponent {
  5749. static createInstance() {
  5750. return (fgui.UIPackage.createObject("game", "UISecretary"));
  5751. }
  5752. onConstruct() {
  5753. this.n0 = (this.getChild("n0"));
  5754. this.myNode = (this.getChild("myNode"));
  5755. this.closeBtn = (this.getChild("closeBtn"));
  5756. this.t0 = this.getTransition("t0");
  5757. }
  5758. }
  5759. ui_UISecretary.URL = "ui://isxx5ak7s46iv4f1";
  5760. class UISecretary extends UIBase {
  5761. constructor() {
  5762. super();
  5763. this.curIndex = 1;
  5764. }
  5765. onConstructor() {
  5766. this.ui = ui_UISecretary.createInstance();
  5767. this.contentPane = this.ui;
  5768. this.isEject = false;
  5769. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  5770. this.nodeObj = { left: null, right: null, cur: null };
  5771. this.nodeObj.cur = this.ui.myNode.gameNode3;
  5772. }
  5773. show() {
  5774. super.show();
  5775. this.ui.t0.play();
  5776. this.updateData();
  5777. this.setGlobalFont(this.ui);
  5778. }
  5779. addSecretarySpine(node, spineName) {
  5780. if (spineName == "mishu") {
  5781. if (this.secretarySpine1) {
  5782. node.displayObject.destroyChildren();
  5783. this.playWoman(this.secretarySpine1, node.displayObject);
  5784. }
  5785. else {
  5786. let spine1 = new SpineMgr("mishu", () => {
  5787. this.secretarySpine1 = spine1;
  5788. this.playWoman(this.secretarySpine1, node.displayObject);
  5789. });
  5790. }
  5791. }
  5792. else {
  5793. if (this.secretarySpine2) {
  5794. node.displayObject.destroyChildren();
  5795. this.playWoman(this.secretarySpine2, node.displayObject);
  5796. }
  5797. else {
  5798. let spine2 = new SpineMgr("xiaomishu2", () => {
  5799. this.secretarySpine2 = spine2;
  5800. this.playWoman(this.secretarySpine2, node.displayObject);
  5801. });
  5802. }
  5803. }
  5804. }
  5805. playWoman(node, parent) {
  5806. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  5807. let yy = this.ui.myNode.gameNode3.secretary.height;
  5808. let scale = 1.5;
  5809. if (node == this.secretarySpine2) {
  5810. scale = 1.2;
  5811. }
  5812. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  5813. node.play(data, 0, true, parent);
  5814. }
  5815. turnLeft() {
  5816. this.curIndex--;
  5817. if (this.curIndex < 1) {
  5818. this.curIndex = 2;
  5819. }
  5820. let left = this.nodeObj.left;
  5821. let right = this.nodeObj.right;
  5822. let cur = this.nodeObj.cur;
  5823. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5824. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5825. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5826. this.updateData();
  5827. }));
  5828. this.ui.myNode.setChildIndex(right, 2);
  5829. this.nodeObj.left = cur;
  5830. this.nodeObj.right = left;
  5831. this.nodeObj.cur = right;
  5832. }
  5833. turnRight() {
  5834. this.curIndex++;
  5835. if (this.curIndex > 2) {
  5836. this.curIndex = 1;
  5837. }
  5838. let left = this.nodeObj.left;
  5839. let right = this.nodeObj.right;
  5840. let cur = this.nodeObj.cur;
  5841. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  5842. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  5843. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  5844. this.updateData();
  5845. }));
  5846. this.ui.myNode.setChildIndex(left, 2);
  5847. this.nodeObj.left = right;
  5848. this.nodeObj.right = cur;
  5849. this.nodeObj.cur = left;
  5850. }
  5851. updateData() {
  5852. console.log('zh: updateData FFFFFFFFFF');
  5853. let data = cfgTable.secretaryshopData;
  5854. let children = this.ui.myNode._children;
  5855. let temp;
  5856. let curData;
  5857. for (let index = 0; index < children.length; index++) {
  5858. temp = children[index];
  5859. curData = data[1];
  5860. temp.heightTxt.text = curData.height;
  5861. temp.foodTxt.text = curData.food;
  5862. temp.historyTxt.text = curData.history;
  5863. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  5864. this.addSecretarySpine(temp.secretary, curData.spine);
  5865. let womanIndex = curData.id - 1;
  5866. let getWoman = DataMgr.getSecretary(womanIndex);
  5867. let curUse = DataMgr.getCurSecretary();
  5868. if (getWoman) {
  5869. if (curUse == womanIndex) {
  5870. temp.purchaseBtn.c1.selectedIndex = 1;
  5871. }
  5872. else {
  5873. temp.purchaseBtn.c1.selectedIndex = 2;
  5874. }
  5875. }
  5876. else {
  5877. temp.purchaseBtn.c1.selectedIndex = 0;
  5878. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  5879. }
  5880. temp.purchaseBtn.visible = false;
  5881. }
  5882. }
  5883. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  5884. console.log('zh: 点击了clickSecretary ');
  5885. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  5886. if (getWoman) {
  5887. if (curUse != womanIndex) {
  5888. console.log();
  5889. DataMgr.setCurSecretary(womanIndex);
  5890. this.updateData();
  5891. }
  5892. }
  5893. else {
  5894. console.log('zh:点击购买了');
  5895. let need = needDiamond;
  5896. if (DataMgr.diamondEnough(need)) {
  5897. DataMgr.setDiamond(-need);
  5898. DataMgr.setSecretary(womanIndex, 1);
  5899. DataMgr.setCurSecretary(womanIndex);
  5900. this.updateData();
  5901. }
  5902. else {
  5903. xGame.uiMgr.Show(UIAddProp, 1);
  5904. }
  5905. }
  5906. }
  5907. closeSelf() {
  5908. this.hide();
  5909. }
  5910. }
  5911. UISecretary.uiName = "UISecretary";
  5912. class ui_UIShop extends fgui.GComponent {
  5913. static createInstance() {
  5914. return (fgui.UIPackage.createObject("game", "UIShop"));
  5915. }
  5916. onConstruct() {
  5917. this.n48 = (this.getChild("n48"));
  5918. this.n0 = (this.getChild("n0"));
  5919. this.secretary = (this.getChild("secretary"));
  5920. this.talkNode = (this.getChild("talkNode"));
  5921. this.closeNode = (this.getChild("closeNode"));
  5922. this.moneyNode = (this.getChild("moneyNode"));
  5923. this.myNode = (this.getChild("myNode"));
  5924. }
  5925. }
  5926. ui_UIShop.URL = "ui://isxx5ak7g1giv4ep";
  5927. class ui_UIMsg extends fgui.GComponent {
  5928. static createInstance() {
  5929. return (fgui.UIPackage.createObject("game", "UIMsg"));
  5930. }
  5931. onConstruct() {
  5932. this.tipsNode = (this.getChild("tipsNode"));
  5933. }
  5934. }
  5935. ui_UIMsg.URL = "ui://isxx5ak7hkrz3qt";
  5936. class UIMsg extends UIBase {
  5937. constructor() {
  5938. super();
  5939. }
  5940. onConstructor() {
  5941. this.ui = ui_UIMsg.createInstance();
  5942. this.contentPane = this.ui;
  5943. this.isEject = false;
  5944. this.isMuti = true;
  5945. }
  5946. show(msg, callback) {
  5947. super.show();
  5948. this.ui.tipsNode.msgTxt.text = msg;
  5949. this.ui.alpha = 1;
  5950. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  5951. this.hide();
  5952. callback && callback();
  5953. }), 1000);
  5954. this.setGlobalFont(this.ui);
  5955. }
  5956. }
  5957. UIMsg.uiName = "UIMsg";
  5958. class BallRodDisplay {
  5959. constructor(ui, index) {
  5960. this.index = 0;
  5961. this.uiIndex = 0;
  5962. this.ui = ui;
  5963. this.index = index;
  5964. this.initData();
  5965. }
  5966. initData() {
  5967. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  5968. let data = cfgTable.ballrodData[this.index + 1];
  5969. this.ui.nameTxt.text = data.name;
  5970. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  5971. this.ui.levelNode.c1.selectedIndex = data.quality;
  5972. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  5973. if (data.spine) {
  5974. this.mySpine = new SpineMgr(data.spine, () => {
  5975. let xx = 150;
  5976. let yy = 70;
  5977. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  5978. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  5979. });
  5980. }
  5981. }
  5982. updateSelf() {
  5983. let get = DataMgr.getBallRod(this.index);
  5984. if (get == null)
  5985. get = 1;
  5986. let curUse = DataMgr.getCurBallRod();
  5987. if (get) {
  5988. if (curUse == this.index) {
  5989. this.ui.purchaseBtn.c1.selectedIndex = 0;
  5990. }
  5991. else {
  5992. this.ui.purchaseBtn.c1.selectedIndex = 1;
  5993. }
  5994. }
  5995. else {
  5996. this.ui.purchaseBtn.c1.selectedIndex = 2;
  5997. }
  5998. }
  5999. buyBallRod() {
  6000. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6001. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  6002. switch (selectedIndex) {
  6003. case 0:
  6004. break;
  6005. case 1:
  6006. console.log('zh:点击了 USE THIS');
  6007. DataMgr.setCurBallRod(this.index);
  6008. let curUse = DataMgr.getCurBallRod();
  6009. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  6010. let ui = xGame.uiMgr.getUI(UIShop);
  6011. ui.updateBallRod();
  6012. break;
  6013. case 2:
  6014. let data = cfgTable.ballrodData[this.index + 1];
  6015. let need = data.price;
  6016. if (DataMgr.diamondEnough(need)) {
  6017. this.buyQiuGan(data);
  6018. DataMgr.setDiamond(-need);
  6019. DataMgr.setBallRod(this.index, 1);
  6020. DataMgr.setCurBallRod(this.index);
  6021. let ui = xGame.uiMgr.getUI(UIShop);
  6022. ui.updateBallRod();
  6023. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  6024. }
  6025. else {
  6026. xGame.uiMgr.Show(UIAddProp, 1);
  6027. }
  6028. break;
  6029. default:
  6030. break;
  6031. }
  6032. }
  6033. buyQiuGan(qgItem) {
  6034. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  6035. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6036. if (userInfo == null) {
  6037. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6038. return;
  6039. }
  6040. let reqData = xGame.httpMgr.getReqData();
  6041. let pd = JSON.parse(reqData);
  6042. pd.qiuGanData = qgItem;
  6043. reqData = JSON.stringify(pd);
  6044. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  6045. try {
  6046. console.log('zh:buySp res = ' + JSON.stringify(res));
  6047. let code = res.code;
  6048. let msg = res.msg;
  6049. if (code == 401) {
  6050. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6051. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.loginTimeOut);
  6052. return;
  6053. }
  6054. if (code == 200) {
  6055. xGame.uiMgr.Show(UIMsg, msg);
  6056. DataMgr.getUserZiChanInfo(false);
  6057. }
  6058. else {
  6059. xGame.uiMgr.Show(UIMsg, msg);
  6060. }
  6061. }
  6062. catch (error) {
  6063. console.log('error=' + error);
  6064. alert(error);
  6065. }
  6066. finally {
  6067. }
  6068. });
  6069. }
  6070. logEventForGouMaiGan(qiuGanName) {
  6071. const ev = {
  6072. value: qiuGanName
  6073. };
  6074. const jsonStr = JSON.stringify(ev);
  6075. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  6076. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  6077. }
  6078. }
  6079. class DaoJuDisplay {
  6080. constructor(ui, index) {
  6081. this.index = 0;
  6082. this.uiIndex = 0;
  6083. this.ggSpid = "";
  6084. this.spid = 0;
  6085. this.ui = ui;
  6086. this.index = index;
  6087. this.initData();
  6088. }
  6089. initData() {
  6090. this.ui.btn_buy.onClick(this, this.gotoBuy);
  6091. let data = cfgTable.daoJuData[this.index + 1];
  6092. this.ui.nameTxt.text = data.spbt;
  6093. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  6094. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  6095. this.ggSpid = data.ggSpid;
  6096. this.spid = data.spid;
  6097. let baseUrl = "asset/sound/ogg/";
  6098. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  6099. }
  6100. gotoBuy() {
  6101. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6102. if (userInfo != null) {
  6103. let token = userInfo.token;
  6104. let ggSpid = this.ggSpid;
  6105. let spid = this.spid;
  6106. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  6107. console.log('zh:gotoBuy1 spid =' + spid);
  6108. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  6109. return;
  6110. }
  6111. else {
  6112. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6113. }
  6114. }
  6115. gotoBuy1() {
  6116. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6117. let djItem = cfgTable.daoJuData[this.index + 1];
  6118. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  6119. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6120. if (userInfo == null) {
  6121. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6122. return;
  6123. }
  6124. let reqData = xGame.httpMgr.getReqData();
  6125. let pd = JSON.parse(reqData);
  6126. pd.spItem = djItem;
  6127. reqData = JSON.stringify(pd);
  6128. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  6129. try {
  6130. console.log('zh:buySp res = ' + JSON.stringify(res));
  6131. let code = res.code;
  6132. let msg = res.msg;
  6133. if (code == 401) {
  6134. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6135. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6136. return;
  6137. }
  6138. if (code == 200) {
  6139. xGame.uiMgr.Show(UIMsg, msg);
  6140. DataMgr.getUserZiChanInfo(false);
  6141. }
  6142. else {
  6143. xGame.uiMgr.Show(UIMsg, msg);
  6144. }
  6145. }
  6146. catch (error) {
  6147. console.log('error=' + error);
  6148. alert(error);
  6149. }
  6150. finally {
  6151. }
  6152. });
  6153. }
  6154. }
  6155. class UIShop extends UIBase {
  6156. constructor() {
  6157. super();
  6158. this.itemNums = 0;
  6159. this.itemNumsForDj = 0;
  6160. this.curType = "";
  6161. }
  6162. onConstructor() {
  6163. this.ui = ui_UIShop.createInstance();
  6164. this.contentPane = this.ui;
  6165. this.isEject = false;
  6166. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6167. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6168. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  6169. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  6170. this.addUIClick(this.ui, this.interuptSecretary);
  6171. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  6172. this.ballRodArr = [];
  6173. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  6174. this.ui.myNode.myList.numItems = this.itemNums;
  6175. this.loadDjdata_old();
  6176. }
  6177. loadDjdata_old() {
  6178. let fff = cfgTable.daoJuData;
  6179. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  6180. this.daoJuArr = [];
  6181. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  6182. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  6183. }
  6184. getProductList() {
  6185. let reqData = xGame.httpMgr.getReqData();
  6186. let pd = JSON.parse(reqData);
  6187. pd.splx = "Consumable";
  6188. reqData = JSON.stringify(pd);
  6189. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  6190. try {
  6191. let code = res.code;
  6192. let msg = res.msg;
  6193. if (code == 401) {
  6194. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6195. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6196. return;
  6197. }
  6198. if (code == 200) {
  6199. let data = res.data;
  6200. for (let index = 0; index < data.length; index++) {
  6201. let element = data[index];
  6202. cfgTable.daoJuData[element.spid] = element;
  6203. }
  6204. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  6205. }
  6206. else {
  6207. xGame.uiMgr.Show(UIMsg, msg);
  6208. }
  6209. }
  6210. catch (error) {
  6211. console.log('error=' + error);
  6212. alert(error);
  6213. }
  6214. finally {
  6215. }
  6216. });
  6217. }
  6218. show(type) {
  6219. super.show();
  6220. this.curType = type == 0 ? "qiugan" : "daoju";
  6221. this.switchBtn("");
  6222. this.playSecretaryIdle();
  6223. this.updateBallRod();
  6224. this.setGlobalFont(this.ui);
  6225. }
  6226. test123() {
  6227. console.log('zh:test123 ');
  6228. }
  6229. switchBtn(type) {
  6230. console.log('zh:1111切換 sel type=' + type);
  6231. if (type == "") {
  6232. type = this.curType;
  6233. }
  6234. else {
  6235. if (this.curType == type) {
  6236. return;
  6237. }
  6238. else {
  6239. this.curType = type;
  6240. }
  6241. }
  6242. if (type == "qiugan") {
  6243. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  6244. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  6245. this.ui.myNode.c1.selectedIndex = 0;
  6246. this.ui.myNode.myList.visible = true;
  6247. this.ui.myNode.djList.visible = false;
  6248. }
  6249. else {
  6250. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  6251. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  6252. this.ui.myNode.c1.selectedIndex = 1;
  6253. this.ui.myNode.myList.visible = false;
  6254. this.ui.myNode.djList.visible = true;
  6255. }
  6256. }
  6257. updateBallRod() {
  6258. for (let index = 0; index < this.ballRodArr.length; index++) {
  6259. this.ballRodArr[index].updateSelf();
  6260. }
  6261. }
  6262. renderBallRod(sort, obj) {
  6263. let index = this.getIndexBySort(sort + 1) - 1;
  6264. let ballRod = new BallRodDisplay(obj, index);
  6265. this.ballRodArr.push(ballRod);
  6266. }
  6267. renderDaoJu(idx, obj) {
  6268. let index = this.getIndexBySortForDj(idx + 1) - 1;
  6269. let b = new DaoJuDisplay(obj, index);
  6270. this.daoJuArr.push(b);
  6271. }
  6272. getIndexBySort(sort) {
  6273. let object = cfgTable.ballrodData;
  6274. for (const key in object) {
  6275. if (object[key].sort == sort) {
  6276. return parseInt(key);
  6277. }
  6278. }
  6279. }
  6280. getIndexBySortForDj(idx) {
  6281. let object = cfgTable.daoJuData;
  6282. for (const key in object) {
  6283. if (object[key].idx == idx) {
  6284. return parseInt(key);
  6285. }
  6286. }
  6287. }
  6288. playSecretaryIdle() {
  6289. let parent = this.ui.secretary.displayObject;
  6290. parent.destroyChildren();
  6291. let xx = this.ui.secretary.width / 2;
  6292. let yy = this.ui.secretary.height;
  6293. let scale = xGame.common.getSecretaryScale();
  6294. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6295. xGame.common.secretary.play(data, 0, true, parent);
  6296. }
  6297. interuptSecretary() {
  6298. Laya.timer.clearAll(this);
  6299. this.playSecretaryRandomSound();
  6300. }
  6301. playSecretaryRandomSound() {
  6302. if (this.isHide)
  6303. return;
  6304. let time = xGame.common.randomNum(45000, 60000);
  6305. Laya.timer.once(time, this, () => {
  6306. if (this.isHide)
  6307. return;
  6308. let index = xGame.common.randomNum(4, 7);
  6309. xGame.soundMgr.playSound("s_main0" + index);
  6310. let words = 1;
  6311. switch (index) {
  6312. case 4:
  6313. words = 5;
  6314. break;
  6315. case 5:
  6316. words = 3;
  6317. break;
  6318. case 6:
  6319. words = 6;
  6320. break;
  6321. case 7:
  6322. words = 7;
  6323. break;
  6324. default:
  6325. break;
  6326. }
  6327. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6328. this.playSecretaryRandomSound();
  6329. });
  6330. }
  6331. closeSelf() {
  6332. this.hide();
  6333. }
  6334. }
  6335. UIShop.uiName = "UIShop";
  6336. class ui_UISign extends fgui.GComponent {
  6337. static createInstance() {
  6338. return (fgui.UIPackage.createObject("game", "UISign"));
  6339. }
  6340. onConstruct() {
  6341. this.n_zzq_bj = (this.getChild("n_zzq_bj"));
  6342. this.n6 = (this.getChild("n6"));
  6343. this.closeNode = (this.getChild("closeNode"));
  6344. this.myNode = (this.getChild("myNode"));
  6345. this.moneyNode = (this.getChild("moneyNode"));
  6346. this.secretary = (this.getChild("secretary"));
  6347. this.talkNode = (this.getChild("talkNode"));
  6348. this.tripleBtn = (this.getChild("tripleBtn"));
  6349. this.normalBtn = (this.getChild("normalBtn"));
  6350. this.tipsNode = (this.getChild("tipsNode"));
  6351. this.againBtn = (this.getChild("againBtn"));
  6352. this.t0 = this.getTransition("t0");
  6353. }
  6354. }
  6355. ui_UISign.URL = "ui://isxx5ak7bf9jv4jj";
  6356. class SignMax {
  6357. constructor(ui) {
  6358. this.ui = ui;
  6359. }
  6360. updateSelf(index, sameDay, curDayIndex) {
  6361. let data = cfgTable.signData[index + 1];
  6362. this.ui.titleTxt.text = data.title;
  6363. let arr1 = data.award[0].split('-');
  6364. let arr2 = data.award[1].split('-');
  6365. let num1 = parseInt(arr1[1]);
  6366. let num2 = parseInt(arr2[1]);
  6367. this.ui.numTxt1.text = num1 + "";
  6368. this.ui.numTxt2.text = num2 + "";
  6369. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  6370. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  6371. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  6372. this.ui.numTxt1.visible = false;
  6373. }
  6374. else {
  6375. this.ui.numTxt1.visible = true;
  6376. }
  6377. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  6378. this.ui.numTxt2.visible = false;
  6379. }
  6380. else {
  6381. this.ui.numTxt2.visible = true;
  6382. }
  6383. if (index < curDayIndex) {
  6384. this.ui.c1.selectedIndex = 1;
  6385. }
  6386. else if (index == curDayIndex) {
  6387. if (sameDay) {
  6388. this.ui.c1.selectedIndex = 2;
  6389. }
  6390. else {
  6391. this.ui.c1.selectedIndex = 2;
  6392. }
  6393. }
  6394. else {
  6395. this.ui.c1.selectedIndex = 0;
  6396. }
  6397. }
  6398. }
  6399. class SignNormal {
  6400. constructor(ui) {
  6401. this.ui = ui;
  6402. }
  6403. updateSelf(index, sameDay, curDayIndex) {
  6404. let data = cfgTable.signData[index + 1];
  6405. this.ui.titleTxt.text = data.title;
  6406. let arr = data.award[0].split('-');
  6407. let type = parseInt(arr[0]);
  6408. let num = parseInt(arr[1]);
  6409. this.ui.numTxt.text = num + "";
  6410. if (type > 2) {
  6411. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  6412. this.ui.myIcon.rotation = 0;
  6413. }
  6414. else {
  6415. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  6416. this.ui.myIcon.rotation = 0;
  6417. }
  6418. if (xGame.common.signAwardContainsRod(data.award)) {
  6419. this.ui.numTxt.visible = false;
  6420. }
  6421. else {
  6422. this.ui.numTxt.visible = true;
  6423. }
  6424. if (index < curDayIndex) {
  6425. this.ui.c1.selectedIndex = 1;
  6426. }
  6427. else if (index == curDayIndex) {
  6428. if (sameDay) {
  6429. this.ui.c1.selectedIndex = 2;
  6430. }
  6431. else {
  6432. this.ui.c1.selectedIndex = 2;
  6433. }
  6434. }
  6435. else {
  6436. this.ui.c1.selectedIndex = 0;
  6437. }
  6438. }
  6439. }
  6440. class UISign extends UIBase {
  6441. constructor() {
  6442. super();
  6443. this.curDayIndex = 0;
  6444. this.starX = 0;
  6445. }
  6446. onConstructor() {
  6447. this.ui = ui_UISign.createInstance();
  6448. this.contentPane = this.ui;
  6449. this.isEject = false;
  6450. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6451. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  6452. this.initSignItem();
  6453. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  6454. this.addUIClick(this.ui.againBtn, this.againGetAward);
  6455. }
  6456. show() {
  6457. super.show();
  6458. this.ui.t0.play();
  6459. this.playSecretaryIdle();
  6460. this.updateSign();
  6461. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  6462. this.setGlobalFont(this.ui);
  6463. }
  6464. initSignItem() {
  6465. this.signArr = [];
  6466. for (let index = 0; index < 6; index++) {
  6467. let temp = new SignNormal(this.ui.myNode["day" + (index + 1)]);
  6468. this.signArr.push(temp);
  6469. }
  6470. this.signMax = new SignMax(this.ui.myNode.day7);
  6471. if (Moyu.isKs)
  6472. this.ui.closeNode.closeBtn.x += 100;
  6473. }
  6474. updateSign() {
  6475. let sameDay = xGame.common.judgeSameDay();
  6476. let max = 7;
  6477. this.curDayIndex = DataMgr.getSignData();
  6478. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  6479. this.curDayIndex = 0;
  6480. if (!sameDay) {
  6481. this.ui.normalBtn.visible = true;
  6482. this.ui.tipsNode.visible = false;
  6483. this.ui.againBtn.visible = false;
  6484. }
  6485. else {
  6486. this.ui.normalBtn.visible = false;
  6487. let again = DataMgr.getExtraSign();
  6488. let isCurrency = false;
  6489. let index = this.curDayIndex;
  6490. if (index == 0)
  6491. index = 7;
  6492. let award = cfgTable.signData[index].award;
  6493. let num = award[0].split("-")[0];
  6494. if (num == "1" || num == "2")
  6495. isCurrency = true;
  6496. let showAgain = again == 0 && isCurrency;
  6497. this.ui.againBtn.visible = showAgain;
  6498. this.ui.tipsNode.visible = !showAgain;
  6499. }
  6500. for (let index = 0; index < this.signArr.length; index++) {
  6501. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  6502. }
  6503. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  6504. }
  6505. playSecretaryIdle() {
  6506. let parent = this.ui.secretary.displayObject;
  6507. parent.destroyChildren();
  6508. let xx = this.ui.secretary.width / 2;
  6509. let yy = this.ui.secretary.height;
  6510. let scale = xGame.common.getSecretaryScale();
  6511. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6512. xGame.common.secretary.play(data, 0, true, parent);
  6513. }
  6514. closeSelf() {
  6515. this.hide();
  6516. }
  6517. normalGetAward() {
  6518. let sameDay = xGame.common.judgeSameDay();
  6519. if (!sameDay) {
  6520. let award = cfgTable.signData[this.curDayIndex + 1].award;
  6521. let temp;
  6522. let type;
  6523. let num;
  6524. let arr = [];
  6525. for (let index = 0; index < award.length; index++) {
  6526. temp = award[index].split("-");
  6527. type = parseInt(temp[0]);
  6528. num = parseInt(temp[1]);
  6529. let awardType = new AwardType();
  6530. awardType.num = num;
  6531. awardType.type = type;
  6532. arr.push(awardType);
  6533. }
  6534. xGame.common.getAward(arr, (watchVideo) => {
  6535. this.curDayIndex++;
  6536. if (this.curDayIndex > 7)
  6537. this.curDayIndex = 0;
  6538. DataMgr.setSignData(this.curDayIndex);
  6539. this.updateSignData2Server(this.curDayIndex);
  6540. DataMgr.setSignTime(new Date().getTime());
  6541. if (watchVideo) {
  6542. DataMgr.setExtraSign(1);
  6543. Moyu.sendDataEvent("signIn1");
  6544. }
  6545. this.updateSign();
  6546. });
  6547. }
  6548. }
  6549. againGetAward() {
  6550. Moyu.sendDataEvent("signIn2");
  6551. console.log('zh:qjff_AD_for_uisign');
  6552. if (Laya.Browser.onAndroid) {
  6553. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  6554. if (!boo) {
  6555. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  6556. return;
  6557. }
  6558. }
  6559. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  6560. }
  6561. else {
  6562. console.log('zh:AD 失败,直接发放奖励');
  6563. this.qjff_AD_for_uisign();
  6564. }
  6565. }
  6566. qjff_AD_for_uisign() {
  6567. let index = this.curDayIndex;
  6568. if (index == 0)
  6569. index = 7;
  6570. let award = cfgTable.signData[index].award;
  6571. let temp;
  6572. let type;
  6573. let num;
  6574. for (let index = 0; index < award.length; index++) {
  6575. temp = award[index].split("-");
  6576. type = parseInt(temp[0]);
  6577. num = parseInt(temp[1]) * 3;
  6578. xGame.common.playObjFlyAnim(num, type);
  6579. }
  6580. DataMgr.setExtraSign(1);
  6581. this.updateSign();
  6582. }
  6583. updateSignData2Server(day) {
  6584. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  6585. if (userInfo == null) {
  6586. return;
  6587. }
  6588. let reqData = xGame.httpMgr.getReqData();
  6589. let pd = JSON.parse(reqData);
  6590. pd.signData = day;
  6591. reqData = JSON.stringify(pd);
  6592. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  6593. try {
  6594. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  6595. let code = res.code;
  6596. let msg = res.msg;
  6597. if (code == 401) {
  6598. Laya.LocalStorage.removeItem(keyForLoginInfo);
  6599. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  6600. return;
  6601. }
  6602. if (code == 200) {
  6603. let data = res.data;
  6604. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  6605. }
  6606. else {
  6607. xGame.uiMgr.Show(UIMsg, msg);
  6608. }
  6609. }
  6610. catch (error) {
  6611. console.log('error=' + error);
  6612. alert(error);
  6613. }
  6614. finally {
  6615. }
  6616. });
  6617. }
  6618. }
  6619. UISign.uiName = "UISign";
  6620. class ui_UISkill extends fgui.GComponent {
  6621. static createInstance() {
  6622. return (fgui.UIPackage.createObject("game", "UISkill"));
  6623. }
  6624. onConstruct() {
  6625. this.n48 = (this.getChild("n48"));
  6626. this.n0 = (this.getChild("n0"));
  6627. this.secretary = (this.getChild("secretary"));
  6628. this.talkNode = (this.getChild("talkNode"));
  6629. this.closeNode = (this.getChild("closeNode"));
  6630. this.moneyNode = (this.getChild("moneyNode"));
  6631. this.skillNode = (this.getChild("skillNode"));
  6632. this.guideNode = (this.getChild("guideNode"));
  6633. }
  6634. }
  6635. ui_UISkill.URL = "ui://isxx5ak7j69a40z";
  6636. class SkillDisplay {
  6637. constructor(ui, data, uiIndex) {
  6638. this.starX = 0;
  6639. this.starY = 0;
  6640. this.index = 0;
  6641. this.ui = ui;
  6642. this.data = data;
  6643. this.index = uiIndex;
  6644. this.initSelf();
  6645. console.log('zh:SkillDisplay constructor this.skillData=', data);
  6646. }
  6647. initSelf() {
  6648. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  6649. this.ui.nameTxt.text = this.data.name;
  6650. this.ui.describeTxt.text = this.data.describe;
  6651. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  6652. this.ui.startBtn.onClick(this, this.startGame);
  6653. this.updateSelf();
  6654. }
  6655. updateSelf() {
  6656. this.checkTry();
  6657. let level = DataMgr.getBigSkillByIndex(this.index);
  6658. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  6659. }
  6660. checkTry() {
  6661. let index = this.index;
  6662. let level = DataMgr.getBigSkillByIndex(index);
  6663. if (level == null) {
  6664. DataMgr.setBigSkill(index, 1, false);
  6665. level = 1;
  6666. }
  6667. this.ui.levelTxt.text = "LV." + level;
  6668. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  6669. this.ui.tryNode.visible = true;
  6670. else
  6671. this.ui.tryNode.visible = false;
  6672. }
  6673. clickAddLevel() {
  6674. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6675. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  6676. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  6677. if (Laya.Browser.onAndroid) {
  6678. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  6679. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6680. }
  6681. else {
  6682. console.log('zh:AD 失败,直接发放奖励');
  6683. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6684. }
  6685. }
  6686. else {
  6687. this.qjff_AD_for_skilldisplay_clickAddLevel();
  6688. }
  6689. }
  6690. qjff_AD_for_skilldisplay_clickAddLevel() {
  6691. DataMgr.setBigSkill(this.data.index, 1);
  6692. this.updateSelf();
  6693. xGame.common.upSkillLevel = true;
  6694. }
  6695. startGame() {
  6696. console.log('zh:rod skill startgame');
  6697. if (this.data.index == 3) {
  6698. alert('Coming soon!');
  6699. return;
  6700. }
  6701. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  6702. let needCoin = xGame.common.bigMoveNeedCoin;
  6703. xGame.common.passAwardCoin = 2000;
  6704. let guide = DataMgr.getSkillGuide();
  6705. console.log('zh:startGame guide=' + guide);
  6706. xGame.common.temSelfLevel = 0;
  6707. if (guide == 0) {
  6708. needCoin = 0;
  6709. xGame.common.temSelfLevel = 100;
  6710. }
  6711. if (DataMgr.coinEnough(needCoin)) {
  6712. DataMgr.setCoin(-needCoin);
  6713. xGame.common.curPlayerSkillType = this.index;
  6714. if (guide == 0)
  6715. xGame.common.curPlayerSkillType = 0;
  6716. console.log('zh: skilldisplay 1');
  6717. xGame.uiMgr.Show(UIGame);
  6718. xGame.uiMgr.Hide(UIMain);
  6719. xGame.uiMgr.Show(UIMatching, () => {
  6720. xGame.common.gameUI.ui.alpha = 1;
  6721. xGame.common.gameUI.startGame();
  6722. xGame.uiMgr.Hide(UISkill);
  6723. });
  6724. this.logEventForRod_start();
  6725. }
  6726. else {
  6727. console.log('zh: skilldisplay 2');
  6728. xGame.uiMgr.Show(UIAddProp, 0);
  6729. Moyu.sendDataEvent("AddCoinVideo");
  6730. }
  6731. }
  6732. logEventForRod_start() {
  6733. let gfmsIdx = xGame.common.curPlayerSkillType;
  6734. console.log('zh:选择的技能=' + gfmsIdx);
  6735. let gfmc = 'Skyfall Shot';
  6736. if (gfmsIdx == 0) {
  6737. gfmc = 'Skyfall Shot';
  6738. }
  6739. if (gfmsIdx == 1) {
  6740. gfmc = 'Surging break';
  6741. }
  6742. if (gfmsIdx == 2) {
  6743. gfmc = 'Frost Lock';
  6744. }
  6745. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  6746. let jsonStr = {
  6747. "count": 0,
  6748. "name": gfmc
  6749. };
  6750. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6751. const d = LocalStorageManager.getItem(keyStr);
  6752. jsonStr.count = d.count + 1;
  6753. LocalStorageManager.setItem(keyStr, jsonStr);
  6754. }
  6755. else {
  6756. LocalStorageManager.setItem(keyStr, jsonStr);
  6757. }
  6758. const reqStr = JSON.stringify(jsonStr);
  6759. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  6760. }
  6761. }
  6762. class UISkill extends UIBase {
  6763. constructor() {
  6764. super();
  6765. this.skillData = [];
  6766. }
  6767. onConstructor() {
  6768. this.ui = ui_UISkill.createInstance();
  6769. this.contentPane = this.ui;
  6770. this.isEject = false;
  6771. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  6772. this.initSkillData();
  6773. console.log('zh:aaaaaa1111111111');
  6774. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  6775. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  6776. console.log('zh:aaaaaa22222222');
  6777. this.displayList = [];
  6778. this.ui.skillNode.skillList.numItems = 3;
  6779. this.addUIClick(this.ui, this.interuptSecretary);
  6780. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  6781. this.ui.talkNode.visible = false;
  6782. if (Moyu.isKs)
  6783. this.ui.closeNode.closeBtn.x += 100;
  6784. }
  6785. show() {
  6786. super.show();
  6787. this.playSecretaryIdle();
  6788. this.moneyNode.ui.c1.selectedIndex = 1;
  6789. Laya.timer.clearAll(this);
  6790. xGame.soundMgr.playSound("s_start");
  6791. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6792. let guide = DataMgr.getSkillGuide();
  6793. this.ui.guideNode.visible = guide == 0;
  6794. let item = this.getSkillItemByUIIndex(0);
  6795. if (guide == 0) {
  6796. item.ui.c1.selectedIndex = 1;
  6797. }
  6798. else {
  6799. item.ui.c1.selectedIndex = 0;
  6800. }
  6801. this.ui.guideNode.guideBtn.visible = guide == 0;
  6802. for (let index = 0; index < this.displayList.length; index++) {
  6803. this.displayList[index].checkTry();
  6804. }
  6805. this.setGlobalFont(this.ui);
  6806. }
  6807. getSkillItemByUIIndex(cur) {
  6808. for (let index = 0; index < this.displayList.length; index++) {
  6809. if (this.displayList[index].index == cur) {
  6810. return this.displayList[index];
  6811. }
  6812. }
  6813. }
  6814. enterGuideLevel() {
  6815. let item = this.getSkillItemByUIIndex(0);
  6816. item.startGame();
  6817. if (DataMgr.getNewUser())
  6818. Moyu.sendDataEvent("gameStart1");
  6819. }
  6820. initSkillData() {
  6821. this.skillData = [];
  6822. let nameList = xGame.common.skillNameList;
  6823. let iconList = xGame.common.skillIconList;
  6824. let describeList = [
  6825. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  6826. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  6827. "The power of frost descends—freezing the flow and taking full control of the game!"
  6828. ];
  6829. console.log('zh:initSkillData 111111111');
  6830. let data;
  6831. for (let index = 0; index < nameList.length; index++) {
  6832. data = {};
  6833. data.name = nameList[index];
  6834. data.icon = iconList[index];
  6835. data.describe = describeList[index];
  6836. data.index = index;
  6837. this.skillData.push(data);
  6838. }
  6839. }
  6840. updateSkillItem(index, target) {
  6841. if (this.displayList[index] == null) {
  6842. let uiIndex;
  6843. switch (index) {
  6844. case 0:
  6845. uiIndex = 1;
  6846. break;
  6847. case 1:
  6848. uiIndex = 0;
  6849. break;
  6850. case 2:
  6851. uiIndex = 2;
  6852. break;
  6853. case 3:
  6854. uiIndex = 3;
  6855. break;
  6856. default:
  6857. break;
  6858. }
  6859. let temp = new SkillDisplay(target, this.skillData[uiIndex], uiIndex);
  6860. this.displayList.push(temp);
  6861. }
  6862. }
  6863. playSecretaryIdle() {
  6864. let parent = this.ui.secretary.displayObject;
  6865. parent.destroyChildren();
  6866. let xx = this.ui.secretary.width / 2;
  6867. let yy = this.ui.secretary.height;
  6868. let scale = xGame.common.getSecretaryScale();
  6869. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  6870. xGame.common.secretary.play(data, 0, true, parent);
  6871. }
  6872. returnUIMain() {
  6873. this.hide();
  6874. xGame.common.stopGirlPop(this.ui.talkNode);
  6875. xGame.uiMgr.Show(UIMain);
  6876. }
  6877. interuptSecretary() {
  6878. Laya.timer.clearAll(this);
  6879. this.playSecretaryRandomSound();
  6880. }
  6881. playSecretaryRandomSound() {
  6882. if (this.isHide)
  6883. return;
  6884. let time = xGame.common.randomNum(45000, 60000);
  6885. Laya.timer.once(time, this, () => {
  6886. if (this.isHide)
  6887. return;
  6888. let index = xGame.common.randomNum(4, 7);
  6889. xGame.soundMgr.playSound("s_main0" + index);
  6890. let words = 1;
  6891. switch (index) {
  6892. case 4:
  6893. words = 5;
  6894. break;
  6895. case 5:
  6896. words = 3;
  6897. break;
  6898. case 6:
  6899. words = 6;
  6900. break;
  6901. case 7:
  6902. words = 7;
  6903. break;
  6904. default:
  6905. break;
  6906. }
  6907. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  6908. this.playSecretaryRandomSound();
  6909. });
  6910. }
  6911. }
  6912. UISkill.uiName = "UISkill";
  6913. class ui_UIModeSelection extends fgui.GComponent {
  6914. static createInstance() {
  6915. return (fgui.UIPackage.createObject("game", "UIModeSelection"));
  6916. }
  6917. onConstruct() {
  6918. this.n19 = (this.getChild("n19"));
  6919. this.closeBtn = (this.getChild("closeBtn"));
  6920. this.myNode = (this.getChild("myNode"));
  6921. this.t0 = this.getTransition("t0");
  6922. }
  6923. }
  6924. ui_UIModeSelection.URL = "ui://isxx5ak7rz5r458";
  6925. class UIModeSelection extends UIBase {
  6926. constructor() {
  6927. super();
  6928. }
  6929. onConstructor() {
  6930. this.ui = ui_UIModeSelection.createInstance();
  6931. this.contentPane = this.ui;
  6932. this.isEject = false;
  6933. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  6934. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  6935. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  6936. this.addUIClick(this.ui.closeBtn, this.hide);
  6937. this.peopleArr = [65, 990, 580];
  6938. this.peopleOffest = [5, 10, 10];
  6939. }
  6940. show(callback) {
  6941. this.updateSelf();
  6942. super.show();
  6943. this.ui.t0.play();
  6944. this.callback = callback;
  6945. this.setGlobalFont(this.ui);
  6946. }
  6947. updateSelf() {
  6948. let cfg = cfgTable.modeselectData;
  6949. for (let index = 1; index <= 3; index++) {
  6950. let node = this.ui.myNode["type" + index];
  6951. node.need.text = cfg[index].need;
  6952. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  6953. node.peopleTxt.text = this.getRandPeople(index - 1);
  6954. }
  6955. }
  6956. enterGame(type) {
  6957. console.log('zh: 进入经典模式 type: ' + type);
  6958. xGame.common.classicRoomType = type;
  6959. let cfg = cfgTable.modeselectData[type];
  6960. let need = cfg.need;
  6961. xGame.common.passAwardCoin = cfg.award;
  6962. if (DataMgr.coinEnough(need)) {
  6963. DataMgr.setCoin(-need);
  6964. this.ui.myNode["type" + type].t0.play();
  6965. Laya.timer.once(200, this, () => {
  6966. this.callback && this.callback();
  6967. });
  6968. this.logEventForClassic_start();
  6969. }
  6970. else {
  6971. Moyu.sendDataEvent("AddCoinVideo");
  6972. xGame.uiMgr.Show(UIAddProp, 0);
  6973. }
  6974. }
  6975. getRandPeople(index) {
  6976. let rand = this.peopleOffest[index];
  6977. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  6978. }
  6979. logEventForClassic_start() {
  6980. let rtype = xGame.common.classicRoomType;
  6981. let msmc = '';
  6982. if (rtype == 1) {
  6983. msmc = 'beginner';
  6984. }
  6985. if (rtype == 2) {
  6986. msmc = 'expert';
  6987. }
  6988. if (rtype == 3) {
  6989. msmc = 'master';
  6990. }
  6991. let keyStr = 'sjmd_classic_start_' + rtype;
  6992. let jsonStr = {
  6993. "difficulty": msmc,
  6994. "classic_count": 1,
  6995. "difficulty_count": 1
  6996. };
  6997. if (LocalStorageManager.hasJosnKey(keyStr)) {
  6998. const d = LocalStorageManager.getItem(keyStr);
  6999. jsonStr.classic_count = d.classic_count + 1;
  7000. jsonStr.difficulty_count = d.difficulty_count + 1;
  7001. LocalStorageManager.setItem(keyStr, jsonStr);
  7002. }
  7003. else {
  7004. LocalStorageManager.setItem(keyStr, jsonStr);
  7005. }
  7006. const reqStr = JSON.stringify(jsonStr);
  7007. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  7008. }
  7009. }
  7010. UIModeSelection.uiName = "UIModeSelection";
  7011. class ui_UIReg extends fgui.GComponent {
  7012. static createInstance() {
  7013. return (fgui.UIPackage.createObject("game", "UIReg"));
  7014. }
  7015. onConstruct() {
  7016. this.n38 = (this.getChild("n38"));
  7017. this.n51 = (this.getChild("n51"));
  7018. this.closeBtn = (this.getChild("closeBtn"));
  7019. this.lab_tip = (this.getChild("lab_tip"));
  7020. this.txt_ua = (this.getChild("txt_ua"));
  7021. this.txt_up1 = (this.getChild("txt_up1"));
  7022. this.txt_up2 = (this.getChild("txt_up2"));
  7023. this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
  7024. this.btn_reg = (this.getChild("btn_reg"));
  7025. }
  7026. }
  7027. ui_UIReg.URL = "ui://isxx5ak7bobav57v";
  7028. class ui_UILogin extends fgui.GComponent {
  7029. static createInstance() {
  7030. return (fgui.UIPackage.createObject("game", "UILogin"));
  7031. }
  7032. onConstruct() {
  7033. this.c1 = this.getController("c1");
  7034. this.n18 = (this.getChild("n18"));
  7035. this.n21 = (this.getChild("n21"));
  7036. this.closeBtn = (this.getChild("closeBtn"));
  7037. this.txt_ua = (this.getChild("txt_ua"));
  7038. this.btn_gotoReg = (this.getChild("btn_gotoReg"));
  7039. this.btn_login = (this.getChild("btn_login"));
  7040. this.txt_up = (this.getChild("txt_up"));
  7041. }
  7042. }
  7043. ui_UILogin.URL = "ui://isxx5ak7bobav57u";
  7044. class UILogin extends UIBase {
  7045. constructor() {
  7046. super();
  7047. this.fontStr = 'big-john-woff2-2';
  7048. try {
  7049. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7050. console.log("zh: constructor加载arial字体成功");
  7051. }
  7052. catch (error) {
  7053. console.log("zh: constructor加载arial字体失败");
  7054. }
  7055. }
  7056. onFontLoaded() {
  7057. try {
  7058. Laya.Text.defaultFont = this.fontStr;
  7059. this.ui.txt_ua.font = this.fontStr;
  7060. this.ui.txt_up.font = this.fontStr;
  7061. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7062. }
  7063. catch (error) {
  7064. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7065. }
  7066. }
  7067. onConstructor() {
  7068. this.ui = ui_UILogin.createInstance();
  7069. this.contentPane = this.ui;
  7070. this.isEject = false;
  7071. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7072. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  7073. this.addUIClick(this.ui.btn_login, this.userLogin);
  7074. }
  7075. show() {
  7076. super.show();
  7077. this.x = (Laya.stage.width - this.width) / 2;
  7078. this.y = (Laya.stage.height - this.height) / 2;
  7079. this.onFontLoaded();
  7080. }
  7081. closeSelf() {
  7082. this.hide();
  7083. }
  7084. userLogin() {
  7085. let ua = this.ui.txt_ua.text;
  7086. let up = this.ui.txt_up.text;
  7087. console.log('zh:ua font' + this.ui.txt_ua.font);
  7088. if (ua && up) {
  7089. let reqData = JSON.stringify({
  7090. username: ua.trim(),
  7091. password: up.trim(),
  7092. fromMark: 'app_game'
  7093. });
  7094. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  7095. try {
  7096. console.log('zh:res = ' + JSON.stringify(res));
  7097. let code = res.code;
  7098. let msg = res.msg;
  7099. if (code == 200) {
  7100. let keyStr = keyForLoginInfo;
  7101. let jsonStr = {
  7102. "username": res.username,
  7103. "token": res.token,
  7104. "buySpids": { 1: false, 7: false }
  7105. };
  7106. LocalStorageManager.setItem(keyStr, jsonStr);
  7107. let myu = Moyu.getUserInfo();
  7108. console.log('zh:myu = ' + JSON.stringify(myu));
  7109. DataMgr.updateUserNickName(res.username);
  7110. Moyu.updateUserInfo(res.username);
  7111. xGame.uiMgr.Show(UIMsg, msg);
  7112. DataMgr.loadUserSpOrderForAd();
  7113. DataMgr.getUserZiChanInfo(false);
  7114. xGame.eventMgr.event(LOGIN_IN);
  7115. this.closeSelf();
  7116. }
  7117. else {
  7118. xGame.uiMgr.Show(UIMsg, msg);
  7119. }
  7120. }
  7121. catch (error) {
  7122. console.log('error=' + error);
  7123. alert(error);
  7124. }
  7125. finally {
  7126. }
  7127. });
  7128. }
  7129. else {
  7130. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7131. }
  7132. }
  7133. gotoRegPage() {
  7134. this.closeSelf();
  7135. xGame.uiMgr.Show(UIReg);
  7136. }
  7137. }
  7138. UILogin.uiName = "UILogin";
  7139. class UIReg extends UIBase {
  7140. constructor() {
  7141. super();
  7142. this.fontStr = 'big-john-woff2-2';
  7143. try {
  7144. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  7145. console.log("zh: constructor加载arial字体成功");
  7146. }
  7147. catch (error) {
  7148. console.log("zh: constructor加载arial字体失败");
  7149. }
  7150. }
  7151. onFontLoaded() {
  7152. try {
  7153. Laya.Text.defaultFont = this.fontStr;
  7154. this.ui.txt_ua.font = this.fontStr;
  7155. this.ui.txt_up1.font = this.fontStr;
  7156. this.ui.txt_up2.font = this.fontStr;
  7157. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  7158. }
  7159. catch (error) {
  7160. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  7161. }
  7162. }
  7163. onConstructor() {
  7164. this.ui = ui_UIReg.createInstance();
  7165. this.contentPane = this.ui;
  7166. this.isEject = false;
  7167. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  7168. this.addUIClick(this.ui.btn_reg, this.regUser);
  7169. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  7170. }
  7171. show() {
  7172. super.show();
  7173. this.x = (Laya.stage.width - this.width) / 2;
  7174. this.y = (Laya.stage.height - this.height) / 2;
  7175. this.onFontLoaded();
  7176. }
  7177. closeSelf() {
  7178. this.hide();
  7179. }
  7180. regUser() {
  7181. this.ui.lab_tip.visible = false;
  7182. let ua = this.ui.txt_ua.text;
  7183. let up1 = this.ui.txt_up1.text;
  7184. let up2 = this.ui.txt_up2.text;
  7185. if (ua && up1 && up2 && up1 == up2) {
  7186. let reqData = JSON.stringify({
  7187. username: ua.trim(),
  7188. password: up1.trim(),
  7189. fromMark: 'app_game'
  7190. });
  7191. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  7192. try {
  7193. console.log('zh:res = ' + JSON.stringify(res));
  7194. let code = res.code;
  7195. let msg = res.msg;
  7196. xGame.uiMgr.Show(UIMsg, msg);
  7197. if (code == 200) {
  7198. this.ui.lab_tip.color = "#FFFFFF";
  7199. xGame.uiMgr.Show(UIMsg, msg);
  7200. this.closeSelf();
  7201. }
  7202. else {
  7203. this.ui.lab_tip.color = "#FF0000";
  7204. xGame.uiMgr.Show(UIMsg, msg);
  7205. }
  7206. }
  7207. catch (error) {
  7208. console.log('error=' + error);
  7209. alert(error);
  7210. }
  7211. finally {
  7212. }
  7213. });
  7214. }
  7215. else {
  7216. if (up1 != up2) {
  7217. xGame.uiMgr.Show(UIMsg, "Password mismatch!");
  7218. }
  7219. else {
  7220. xGame.uiMgr.Show(UIMsg, "Missing information!");
  7221. }
  7222. }
  7223. }
  7224. gotoLogin() {
  7225. this.closeSelf();
  7226. xGame.uiMgr.Show(UILogin);
  7227. }
  7228. }
  7229. UIReg.uiName = "UIReg";
  7230. class ui_UIGetAward extends fgui.GComponent {
  7231. static createInstance() {
  7232. return (fgui.UIPackage.createObject("game", "UIGetAward"));
  7233. }
  7234. onConstruct() {
  7235. this.n4 = (this.getChild("n4"));
  7236. this.n0 = (this.getChild("n0"));
  7237. this.myList = (this.getChild("myList"));
  7238. this.n1 = (this.getChild("n1"));
  7239. this.eftNode = (this.getChild("eftNode"));
  7240. this.btnNode = (this.getChild("btnNode"));
  7241. this.t0 = this.getTransition("t0");
  7242. }
  7243. }
  7244. ui_UIGetAward.URL = "ui://isxx5ak7p4tr426";
  7245. class UIGetAward extends UIBase {
  7246. constructor() {
  7247. super();
  7248. this.showTriple = true;
  7249. }
  7250. onConstructor() {
  7251. this.ui = ui_UIGetAward.createInstance();
  7252. this.contentPane = this.ui;
  7253. this.isEject = false;
  7254. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  7255. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  7256. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  7257. }
  7258. show(arr, showTriple, callback) {
  7259. super.show();
  7260. this.ui.t0.play();
  7261. this.ui.eftNode.visible = true;
  7262. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  7263. this.ui.eftNode.visible = false;
  7264. }), 1, 0, 0, 0.9);
  7265. this.awardArr = arr;
  7266. this.showTriple = showTriple;
  7267. this.callback = callback;
  7268. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  7269. this.ui.myList.numItems = arr.length;
  7270. xGame.soundMgr.playSound("getaward");
  7271. this.setGlobalFont(this.ui);
  7272. }
  7273. updateSelf(index, obj) {
  7274. let temp = this.awardArr[index];
  7275. let icon = this.getIcon(temp.type);
  7276. let str = icon;
  7277. if (temp.type > 2) {
  7278. str = "s" + icon;
  7279. }
  7280. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  7281. obj.myIcon.rotation = 0;
  7282. obj.numTxt.text = temp.num + "";
  7283. obj.numTxt.visible = temp.type > 2 ? false : true;
  7284. obj.nameTxt.text = this.getNameStr(temp.type);
  7285. }
  7286. renderItem(index, obj) {
  7287. this.updateSelf(index, obj);
  7288. }
  7289. tripleGetAward() {
  7290. console.log('zh:qjff_AD_for_uigetAward');
  7291. if (Laya.Browser.onAndroid) {
  7292. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7293. if (!boo) {
  7294. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7295. return;
  7296. }
  7297. }
  7298. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  7299. }
  7300. else {
  7301. console.log('zh:AD 失败,直接发放奖励');
  7302. this.qjff_AD_for_uigetAward();
  7303. }
  7304. }
  7305. qjff_AD_for_uigetAward() {
  7306. this.getAward(3);
  7307. }
  7308. normalGetAward() {
  7309. if (PlatMgr.isMisVideo())
  7310. this.tripleGetAward();
  7311. else
  7312. this.getAward();
  7313. }
  7314. getAward(times = 1) {
  7315. this.hide();
  7316. for (let index = 0; index < this.awardArr.length; index++) {
  7317. this.awardArr[index].num *= times;
  7318. }
  7319. this.callback && this.callback(times != 1);
  7320. }
  7321. getIcon(type) {
  7322. switch (type) {
  7323. case Prop.diamond:
  7324. return "ty_zs";
  7325. case Prop.coin:
  7326. return "ty_jb";
  7327. case Prop.gan1:
  7328. return "qg1";
  7329. case Prop.gan2:
  7330. return "qg2";
  7331. case Prop.gan3:
  7332. return "qg3";
  7333. case Prop.gan4:
  7334. return "qg4";
  7335. default:
  7336. break;
  7337. }
  7338. }
  7339. getNameStr(type) {
  7340. switch (type) {
  7341. case Prop.diamond:
  7342. return "Diamond";
  7343. case Prop.coin:
  7344. return "Coins";
  7345. case Prop.gan1:
  7346. case Prop.gan2:
  7347. case Prop.gan3:
  7348. case Prop.gan4:
  7349. return cfgTable.ballrodData[type - 1].name;
  7350. default:
  7351. break;
  7352. }
  7353. }
  7354. }
  7355. UIGetAward.uiName = "UIGetAward";
  7356. class ui_UIRepentProp extends fgui.GComponent {
  7357. static createInstance() {
  7358. return (fgui.UIPackage.createObject("game", "UIRepentProp"));
  7359. }
  7360. onConstruct() {
  7361. this.c1 = this.getController("c1");
  7362. this.n11 = (this.getChild("n11"));
  7363. this.regretNode = (this.getChild("regretNode"));
  7364. this.helpLineNode = (this.getChild("helpLineNode"));
  7365. this.t0 = this.getTransition("t0");
  7366. }
  7367. }
  7368. ui_UIRepentProp.URL = "ui://isxx5ak7trk948v";
  7369. class UIRepentProp extends UIBase {
  7370. constructor() {
  7371. super();
  7372. this.viewType = 0;
  7373. this.regretType = 0;
  7374. }
  7375. onConstructor() {
  7376. this.ui = ui_UIRepentProp.createInstance();
  7377. this.contentPane = this.ui;
  7378. this.isEject = false;
  7379. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  7380. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  7381. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  7382. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  7383. }
  7384. show(viewType, regretType, callback) {
  7385. PlatMgr.showInsert(true);
  7386. this.viewType = viewType;
  7387. this.regretType = regretType;
  7388. this.callback = callback;
  7389. super.show();
  7390. this.ui.t0.play();
  7391. this.ui.c1.selectedIndex = this.viewType;
  7392. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  7393. if (this.viewType == 0) {
  7394. let guide = DataMgr.getGuideHelpLine();
  7395. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  7396. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  7397. }
  7398. xGame.common.gameMgr.gamePause = true;
  7399. this.setGlobalFont(this.ui);
  7400. }
  7401. hideSelf() {
  7402. xGame.common.gameMgr.gamePause = false;
  7403. this.callback && this.callback(false);
  7404. this.hide();
  7405. }
  7406. videoRegret() {
  7407. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  7408. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  7409. }
  7410. else {
  7411. console.log('zh:AD 失败,直接发放奖励');
  7412. this.qjff_AD_for_UIrepentProp_videoRegret();
  7413. }
  7414. }
  7415. qjff_AD_for_UIrepentProp_videoRegret() {
  7416. this.callback && this.callback(true);
  7417. this.hideSelf();
  7418. }
  7419. videoAddHelpLine() {
  7420. let guide = DataMgr.getGuideHelpLine();
  7421. if (guide == 0) {
  7422. this.callback && this.callback(true);
  7423. this.hideSelf();
  7424. DataMgr.setGuideHelpLine();
  7425. xGame.common.gameUI.ui.guideNode.visible = false;
  7426. }
  7427. else {
  7428. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  7429. if (Laya.Browser.onAndroid) {
  7430. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  7431. if (!boo) {
  7432. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  7433. return;
  7434. }
  7435. }
  7436. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  7437. }
  7438. else {
  7439. console.log('zh:AD 失败,直接发放奖励');
  7440. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7441. }
  7442. }
  7443. }
  7444. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  7445. this.callback && this.callback(true);
  7446. this.hideSelf();
  7447. }
  7448. }
  7449. UIRepentProp.uiName = "UIRepentProp";
  7450. class ui_UITips extends fgui.GComponent {
  7451. static createInstance() {
  7452. return (fgui.UIPackage.createObject("game", "UITips"));
  7453. }
  7454. onConstruct() {
  7455. this.n0 = (this.getChild("n0"));
  7456. this.myNode = (this.getChild("myNode"));
  7457. this.t0 = this.getTransition("t0");
  7458. }
  7459. }
  7460. ui_UITips.URL = "ui://isxx5ak7mnrs42z";
  7461. class UITips extends UIBase {
  7462. constructor() {
  7463. super();
  7464. this.type = 0;
  7465. }
  7466. onConstructor() {
  7467. this.ui = ui_UITips.createInstance();
  7468. this.contentPane = this.ui;
  7469. this.isEject = false;
  7470. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  7471. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  7472. }
  7473. show(tipsTxt, womanTxt, type) {
  7474. super.show();
  7475. this.ui.t0.play();
  7476. this.ui.myNode.tipsTxt.text = tipsTxt;
  7477. this.ui.myNode.womanTxt.text = womanTxt;
  7478. PlatMgr.showInsert(true);
  7479. this.ui.myNode.c1.selectedIndex = type;
  7480. this.type = type;
  7481. switch (this.type) {
  7482. case TipsType.exitGame:
  7483. xGame.common.gameMgr.gamePause = true;
  7484. break;
  7485. case TipsType.foul:
  7486. Laya.timer.once(200, this, () => {
  7487. if (xGame.common.gameMgr) {
  7488. xGame.common.gameMgr.gamePause = true;
  7489. }
  7490. else {
  7491. console.log("zh:gameMgr is null");
  7492. }
  7493. });
  7494. break;
  7495. default:
  7496. break;
  7497. }
  7498. this.setGlobalFont(this.ui);
  7499. }
  7500. clickLeftBtn() {
  7501. this.hide();
  7502. xGame.common.gameMgr.gamePause = false;
  7503. switch (this.type) {
  7504. case TipsType.exitGame:
  7505. break;
  7506. case TipsType.foul:
  7507. break;
  7508. default:
  7509. break;
  7510. }
  7511. }
  7512. clickRightBtn() {
  7513. this.hide();
  7514. switch (this.type) {
  7515. case TipsType.exitGame:
  7516. xGame.eventMgr.event(RESET_GAME);
  7517. xGame.uiMgr.Show(UIMain);
  7518. Moyu.recordEnd(this, null);
  7519. xGame.common.longHelpLine = false;
  7520. break;
  7521. case TipsType.foul:
  7522. if (xGame.common.gameMgr) {
  7523. xGame.common.gameMgr.gamePause = false;
  7524. }
  7525. Laya.timer.clearAll(this);
  7526. break;
  7527. default:
  7528. break;
  7529. }
  7530. }
  7531. }
  7532. UITips.uiName = "UITips";
  7533. class UIMain extends UIBase {
  7534. constructor() {
  7535. super();
  7536. this.firstEnter = true;
  7537. this.moni_click_count = 0;
  7538. }
  7539. nativeCallJs(msg) {
  7540. let t = msg;
  7541. console.log("zh: nativeCallJs 奖励开始发放:", t);
  7542. switch (t) {
  7543. case 'qjff_chouJiang':
  7544. let dui = xGame.uiMgr.getUI(UIDraw);
  7545. dui.qjff_chouJiang();
  7546. break;
  7547. case 'qjff_AD_for_uisign':
  7548. let dui2 = xGame.uiMgr.getUI(UISign);
  7549. dui2.qjff_AD_for_uisign();
  7550. break;
  7551. case 'qjff_AD_for_uitry':
  7552. let dui3 = xGame.uiMgr.getUI(UITry);
  7553. dui3.qjff_AD_for_uitry();
  7554. break;
  7555. case 'qjff_AD_for_uipower':
  7556. let dui4 = xGame.uiMgr.getUI(UIPower);
  7557. dui4.qjff_AD_for_uipower();
  7558. break;
  7559. case 'qjff_AD_for_uigetAward':
  7560. let dui5 = xGame.uiMgr.getUI(UIGetAward);
  7561. dui5.qjff_AD_for_uigetAward();
  7562. break;
  7563. case 'qjff_AD_for_uiGameEnd':
  7564. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  7565. let dui6 = xGame.uiMgr.getUI(UIGameEnd);
  7566. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  7567. break;
  7568. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  7569. let dui7 = xGame.uiMgr.getUI(UIAddProp);
  7570. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  7571. break;
  7572. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  7573. let dui8 = xGame.uiMgr.getUI(UIAddProp);
  7574. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  7575. break;
  7576. case 'qjff_AD_for_UIrepentProp_videoRegret':
  7577. let dui9 = xGame.uiMgr.getUI(UIRepentProp);
  7578. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  7579. break;
  7580. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  7581. let dui10 = xGame.uiMgr.getUI(UIRepentProp);
  7582. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  7583. break;
  7584. case 'qjff_AD_for_UIBOX_onOpenBox':
  7585. let dui11 = xGame.uiMgr.getUI(UIBox);
  7586. dui11.qjff_AD_for_UIBOX_onOpenBox();
  7587. break;
  7588. case 'qjff_AD_for_UIAddCoin':
  7589. let dui12 = xGame.uiMgr.getUI(UIAddCoin);
  7590. dui12.qjff_AD_for_UIAddCoin();
  7591. break;
  7592. case 'app_sign_for_buyProduct_onSuccess':
  7593. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  7594. DataMgr.getUserZiChanInfo(false);
  7595. break;
  7596. case '222axxxxxx':
  7597. let dui15 = xGame.uiMgr.getUI(UISign);
  7598. dui15.qjff_AD_for_uisign();
  7599. break;
  7600. case '333axsxxxxxx':
  7601. let dui16 = xGame.uiMgr.getUI(UISign);
  7602. dui16.qjff_AD_for_uisign();
  7603. break;
  7604. default:
  7605. console.log('zh:未知的方法名字' + t);
  7606. break;
  7607. }
  7608. }
  7609. onConstructor() {
  7610. console.log('zh: UIMain onConstructor');
  7611. this.ui = ui_UIMain.createInstance();
  7612. this.contentPane = this.ui;
  7613. this.isEject = false;
  7614. this.addEvent();
  7615. this.addClickSpine();
  7616. this.settingNode = new SettingNode(this.ui.settingNode);
  7617. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  7618. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  7619. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  7620. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  7621. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  7622. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  7623. let curUse = DataMgr.getCurSecretary();
  7624. this.changeSecretary(curUse);
  7625. this.ui.talkNode.visible = false;
  7626. let guide = DataMgr.getSkillGuide();
  7627. if (xGame.common.isNewDay && guide == 1) {
  7628. xGame.common.isNewDay = false;
  7629. xGame.soundMgr.playSound("s_main01");
  7630. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7631. console.log("zh:播放小秘书每天语音");
  7632. }
  7633. this.onGetUserInfo();
  7634. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7635. DataMgr.getUserZiChanInfo(false);
  7636. }
  7637. this.ui.n83.visible = false;
  7638. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7639. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7640. let ua = d.username;
  7641. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7642. }
  7643. this.c_btn_for_user();
  7644. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7645. }
  7646. Logout() {
  7647. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7648. LocalStorageManager.removeItem(keyForLoginInfo);
  7649. this.freshUser();
  7650. }
  7651. JSBridgeUtils.instance.loginOutForApp();
  7652. this.setUserDefaultNickname();
  7653. DataMgr.setCoin2(4000);
  7654. DataMgr.setDiamond2(0);
  7655. this.setDefaultQiuGanInfo();
  7656. DataMgr.setPlaceBallLevelList("");
  7657. DataMgr.setChallengeMode_overLev(1);
  7658. this.setDefaultSignData();
  7659. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  7660. }
  7661. setDefaultSignData() {
  7662. DataMgr.setSignData(1);
  7663. DataMgr.setSignTime(new Date().getTime());
  7664. }
  7665. setDefaultQiuGanInfo() {
  7666. DataMgr.setBallRod(0, 1);
  7667. DataMgr.setBallRod(1, 0);
  7668. DataMgr.setBallRod(2, 0);
  7669. DataMgr.setBallRod(3, 0);
  7670. DataMgr.setBallRod(4, 0);
  7671. DataMgr.setBallRod(5, 1);
  7672. }
  7673. setUserDefaultNickname() {
  7674. let defUsername = "player";
  7675. this.ui.headNode.nameTxt.text = defUsername;
  7676. DataMgr.updateUserNickName(defUsername);
  7677. Moyu.updateUserInfo(defUsername);
  7678. }
  7679. gotoLogin() {
  7680. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7681. xGame.uiMgr.Show(UILogin);
  7682. }
  7683. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7684. this.Logout();
  7685. }
  7686. }
  7687. gotoRegUser() {
  7688. xGame.uiMgr.Show(UIReg);
  7689. }
  7690. showFuLiSp1() {
  7691. console.log('zh:福利1');
  7692. DataMgr.checkForShowFuLi17AndAlert(1);
  7693. }
  7694. showFuLiSp7() {
  7695. console.log('zh:福利7');
  7696. DataMgr.checkForShowFuLi17AndAlert(7);
  7697. }
  7698. c_btn_for_user() {
  7699. this.ui.n_dengLu.c1.selectedIndex = 0;
  7700. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7701. this.ui.n_dengLu.c1.selectedIndex = 1;
  7702. }
  7703. else {
  7704. this.ui.n_dengLu.c1.selectedIndex = 0;
  7705. }
  7706. }
  7707. changeSecretary(curUse) {
  7708. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7709. xGame.common.secretary && xGame.common.secretary.dispose();
  7710. this.addSecretarySpine(name);
  7711. }
  7712. addSecretarySpine(name) {
  7713. let spine = new SpineMgr(name, () => {
  7714. this.playSecretaryIdle();
  7715. });
  7716. xGame.common.secretary = spine;
  7717. }
  7718. addClickSpine() {
  7719. let clickSpine = new SpineMgr("dianji", () => {
  7720. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7721. let parent = Laya.stage;
  7722. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7723. clickSpine.play(data, 0, false, parent, (spine) => {
  7724. spine.destroy(true);
  7725. });
  7726. });
  7727. });
  7728. }
  7729. addEvent() {
  7730. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7731. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7732. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7733. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7734. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7735. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7736. this.addUIClick(this.ui, this.interuptSecretary);
  7737. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7738. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7739. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7740. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7741. this.addUIClick(this.ui.signBtn, this.openSignView);
  7742. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7743. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7744. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  7745. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  7746. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7747. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7748. }
  7749. show(showFailWords) {
  7750. super.show();
  7751. DataMgr.loadUserSpOrderForAd();
  7752. this.moneyNode.ui.c1.selectedIndex = 1;
  7753. this.playSecretaryIdle();
  7754. xGame.soundMgr.playMusic("caromhall01", 0);
  7755. Laya.timer.clearAll(this);
  7756. this.playSecretaryRandomSound();
  7757. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7758. if (showFailWords) {
  7759. console.log('zh:uimain.ts ');
  7760. setTimeout(() => {
  7761. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7762. let words = -1;
  7763. if (str == "s_main02") {
  7764. words = 2;
  7765. }
  7766. else {
  7767. words = 3;
  7768. }
  7769. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7770. xGame.soundMgr.playSound(str);
  7771. }, 300);
  7772. }
  7773. this.showGuide();
  7774. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  7775. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  7776. let guide = DataMgr.getSkillGuide();
  7777. if (guide == 1) {
  7778. let randTime = xGame.common.randomNum(300, 800);
  7779. if (this.firstEnter) {
  7780. console.log("zh: firstEnter");
  7781. this.firstEnter = false;
  7782. randTime += 900;
  7783. }
  7784. else {
  7785. console.log("zh: no firstEnter");
  7786. }
  7787. Laya.timer.once(randTime, this, () => {
  7788. });
  7789. Laya.timer.once(1000, this, () => {
  7790. console.log('zh: 1秒后 showFuLiSp7');
  7791. this.showFuLiSp7();
  7792. });
  7793. this.showTipForGuest();
  7794. }
  7795. this.setGlobalFont(this.ui);
  7796. this.yinDaoForLianxi();
  7797. }
  7798. yinDaoForLianxi() {
  7799. let g = DataMgr.getSkillGuide();
  7800. if (g === 0) {
  7801. console.log('zh:默认的引导还没有完毕');
  7802. return;
  7803. }
  7804. let lianXiGuide = DataMgr.getLianXiGuide();
  7805. if (lianXiGuide == 0) {
  7806. let x = this.ui.placeBallBtn.x;
  7807. let y = this.ui.placeBallBtn.y;
  7808. this.ui.n_yd_challenge_1.visible = true;
  7809. this.ui.n_yd_challenge_1_hand.x = x + 150;
  7810. this.ui.n_yd_challenge_1_hand.y = y;
  7811. this.ui.n_yd_challenge_1_btn.x = x;
  7812. this.ui.n_yd_challenge_1_btn.y = y;
  7813. console.log('zh:yinDaoForLianxi set ok');
  7814. }
  7815. else {
  7816. this.ui.n_yd_challenge_1.visible = false;
  7817. }
  7818. }
  7819. showTipForGuest() {
  7820. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7821. if (userInfo == null) {
  7822. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  7823. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  7824. let woman = "this is an important notice.";
  7825. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7826. return;
  7827. }
  7828. }
  7829. checkActive(show) {
  7830. }
  7831. showGuide() {
  7832. let guide = DataMgr.getSkillGuide();
  7833. this.ui.guideBtn.visible = guide == 0;
  7834. this.ui.enterGuide.visible = false;
  7835. this.ui.secretaryGuide.visible = guide == 0;
  7836. if (guide == 0) {
  7837. console.log("zh:显示引导");
  7838. xGame.soundMgr.playSound("s_guide");
  7839. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7840. }
  7841. else {
  7842. console.log("zh:不需要显示引导");
  7843. }
  7844. }
  7845. ensureSecretary() {
  7846. console.log('zh: ensureSecretary ');
  7847. this.ui.secretaryGuide.visible = false;
  7848. this.ui.enterGuide.visible = true;
  7849. this.ui.wordsNode.t0.play();
  7850. if (DataMgr.getNewUser())
  7851. Moyu.sendDataEvent("gameReady");
  7852. }
  7853. playSecretaryIdle() {
  7854. let parent = this.ui.secretary.displayObject;
  7855. parent.destroyChildren();
  7856. let xx = this.ui.secretary.width / 2;
  7857. let yy = this.ui.secretary.height;
  7858. let scale = xGame.common.getSecretaryScale();
  7859. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7860. xGame.common.secretary.play(data, 0, true, parent);
  7861. }
  7862. startGame(type) {
  7863. if (!this.isReadyForLoadNetSource()) {
  7864. return;
  7865. }
  7866. xGame.common.gameMode = type;
  7867. Moyu.sendDataEvent("PlayGame", { type: type });
  7868. let gm = xGame.common.gameMode;
  7869. console.log('zh:进入游戏gameMode =' + gm);
  7870. switch (gm) {
  7871. case GameMode.classic:
  7872. console.log('zh:进入经典模式111111111');
  7873. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7874. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7875. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7876. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7877. console.log('zh:判断是否可以玩该模式classic =NO');
  7878. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7879. xGame.uiMgr.Show(UIMsg, tipStr);
  7880. return;
  7881. }
  7882. else {
  7883. console.log('zh:可以玩该模式classic');
  7884. this.beginGame();
  7885. }
  7886. }
  7887. else {
  7888. console.log('zh:不需要判断是否可以玩该classic');
  7889. let challengeTimes = DataMgr.getChallengeTimes();
  7890. if (challengeTimes == 0) {
  7891. xGame.uiMgr.Show(UIInvitation);
  7892. }
  7893. else {
  7894. this.beginGame();
  7895. }
  7896. }
  7897. break;
  7898. case GameMode.bigMove:
  7899. console.info('zh:bigMove check 大招');
  7900. let guide = DataMgr.getSkillGuide();
  7901. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7902. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7903. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7904. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7905. console.log('zh:提示不可以玩');
  7906. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7907. xGame.uiMgr.Show(UIMsg, tipStr);
  7908. return;
  7909. }
  7910. else {
  7911. console.log('zh:可以玩该模式 bigMove');
  7912. this.beginGame();
  7913. if (DataMgr.getNewUser())
  7914. Moyu.sendDataEvent("gameStart0");
  7915. }
  7916. }
  7917. else {
  7918. this.beginGame();
  7919. if (DataMgr.getNewUser())
  7920. Moyu.sendDataEvent("gameStart0");
  7921. }
  7922. break;
  7923. default:
  7924. console.error('zh:未知错误!!!!');
  7925. break;
  7926. }
  7927. }
  7928. beginGame(isNice = false) {
  7929. console.log('zh:beginGame ');
  7930. let guide = DataMgr.getSkillGuide();
  7931. if (guide == 1) {
  7932. console.log('zh:非新手引导,showInternAd ');
  7933. JSBridgeUtils.instance.showInternAd('beginGame');
  7934. }
  7935. else {
  7936. console.log('zh:新手引导,不显示AD ');
  7937. }
  7938. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7939. console.log('zh:beginGame 1');
  7940. if (xGame.common.gameMode == GameMode.classic) {
  7941. console.log('zh:beginGame 2');
  7942. if (isNice) {
  7943. console.log('zh:进入巅峰赛');
  7944. this.enterClassic();
  7945. }
  7946. else {
  7947. console.log('zh:beginGame 3-1');
  7948. xGame.uiMgr.Show(UIModeSelection, () => {
  7949. console.log('zh:beginGame 3-2');
  7950. this.enterClassic();
  7951. });
  7952. }
  7953. }
  7954. else if (xGame.common.gameMode == GameMode.bigMove) {
  7955. console.log('zh:beginGame 5');
  7956. this.ui.enterGuide.visible = false;
  7957. xGame.uiMgr.Show(UISkill);
  7958. }
  7959. }
  7960. enterClassic() {
  7961. console.log('zh:beginGame 7');
  7962. xGame.uiMgr.Show(UIGame);
  7963. xGame.uiMgr.Show(UIMatching, () => {
  7964. if (!this.isHide)
  7965. this.hide();
  7966. xGame.common.gameUI.ui.alpha = 1;
  7967. console.log('zh:beginGame 8');
  7968. xGame.common.gameUI.startGame();
  7969. xGame.uiMgr.Hide(UIGameEnd);
  7970. });
  7971. }
  7972. start_debug_for_moni_payOk() {
  7973. let ccc = this.moni_click_count + 1;
  7974. this.moni_click_count = ccc;
  7975. if (ccc % 5 == 0) {
  7976. console.log('zh:start_debug_for_moni_payOk');
  7977. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7978. if (userInfo != null) {
  7979. let token = userInfo.token;
  7980. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7981. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7982. alert('模拟支付OK');
  7983. return;
  7984. }
  7985. else {
  7986. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7987. }
  7988. }
  7989. }
  7990. startGlobal() {
  7991. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7992. }
  7993. startWeekly() {
  7994. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7995. }
  7996. zhouSaiMonth() {
  7997. console.log('zh: zhouSaiMonth 被调用');
  7998. }
  7999. isReadyForLoadNetSource() {
  8000. let reqCount = xGame.cfgMgr.httpReqCount;
  8001. let ok = xGame.cfgMgr.httpReqOkCount;
  8002. if (reqCount > ok) {
  8003. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  8004. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  8005. Laya.timer.once(5000, this, () => {
  8006. let retryCount = 0;
  8007. const maxRetries = 3;
  8008. const tryFetchConfig = () => {
  8009. try {
  8010. xGame.cfgMgr.getConfigFromServer();
  8011. }
  8012. catch (error) {
  8013. if (retryCount < maxRetries) {
  8014. retryCount++;
  8015. console.log(`🔄 第${retryCount}次重试获取配置...`);
  8016. Laya.timer.once(5000, this, tryFetchConfig);
  8017. }
  8018. else {
  8019. console.error("❌ 达到最大重试次数,配置获取失败");
  8020. }
  8021. }
  8022. };
  8023. tryFetchConfig();
  8024. });
  8025. return false;
  8026. }
  8027. return true;
  8028. }
  8029. startPlaceBall() {
  8030. if (!this.isReadyForLoadNetSource()) {
  8031. return;
  8032. }
  8033. xGame.uiMgr.Show(UILevelDisplay);
  8034. }
  8035. hide() {
  8036. console.log('zh:uimain hide ...');
  8037. super.hide();
  8038. xGame.common.stopGirlPop(this.ui.talkNode);
  8039. }
  8040. onGetUserInfo(force = false) {
  8041. if (Moyu.isWx) {
  8042. let info = Moyu.getSystemInfo();
  8043. if (info)
  8044. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  8045. }
  8046. else {
  8047. Moyu.initUser(this, this.freshUser, force);
  8048. }
  8049. this.freshUser();
  8050. console.log('zh:5秒后更新用户信息');
  8051. setTimeout(() => {
  8052. DataMgr.getUserZiChanInfo(true);
  8053. }, 5000);
  8054. }
  8055. event_login_in() {
  8056. console.log("zh:event_login_in被触发");
  8057. this.freshUser();
  8058. }
  8059. freshUser() {
  8060. let user = Moyu.getUserInfo();
  8061. if (!user.isAuth) {
  8062. user.headIcon = 'res/ty_touxiang.png';
  8063. }
  8064. else {
  8065. DataMgr.upRankData();
  8066. }
  8067. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8068. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8069. let keyStr = keyForLoginInfo;
  8070. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8071. const d = LocalStorageManager.getItem(keyStr);
  8072. let ua = d.username;
  8073. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8074. }
  8075. else {
  8076. }
  8077. this.c_btn_for_user();
  8078. }
  8079. interuptSecretary() {
  8080. Laya.timer.clearAll(this);
  8081. this.playSecretaryRandomSound();
  8082. }
  8083. playSecretaryRandomSound() {
  8084. if (this.isHide)
  8085. return;
  8086. let time = xGame.common.randomNum(45000, 60000);
  8087. Laya.timer.once(time, this, () => {
  8088. if (this.isHide)
  8089. return;
  8090. let index = xGame.common.randomNum(4, 7);
  8091. xGame.soundMgr.playSound("s_main0" + index);
  8092. let words = 1;
  8093. switch (index) {
  8094. case 4:
  8095. words = 5;
  8096. break;
  8097. case 5:
  8098. words = 3;
  8099. break;
  8100. case 6:
  8101. words = 6;
  8102. break;
  8103. case 7:
  8104. words = 7;
  8105. break;
  8106. default:
  8107. break;
  8108. }
  8109. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8110. this.playSecretaryRandomSound();
  8111. });
  8112. }
  8113. openSecretaryView() {
  8114. xGame.uiMgr.Show(UISecretary);
  8115. Moyu.sendDataEvent("secretary");
  8116. }
  8117. openShopView() {
  8118. xGame.uiMgr.Show(UIShop, 1);
  8119. }
  8120. openShopView0() {
  8121. xGame.uiMgr.Show(UIShop, 0);
  8122. }
  8123. openSignView() {
  8124. xGame.uiMgr.Show(UISign);
  8125. }
  8126. openDrawView() {
  8127. xGame.uiMgr.Show(UIDraw);
  8128. }
  8129. openRanking() {
  8130. console.log('zh:phb openRanking');
  8131. xGame.uiMgr.Show(UIRanking);
  8132. Moyu.sendDataEvent("rankingList");
  8133. }
  8134. }
  8135. UIMain.uiName = "UIMain";
  8136. class UIGameEnd extends UIBase {
  8137. constructor() {
  8138. super();
  8139. this.success = false;
  8140. this.awardCoinNum = 1000;
  8141. this.awardDiamondNum = 10;
  8142. }
  8143. onConstructor() {
  8144. this.ui = ui_UIGameEnd.createInstance();
  8145. this.contentPane = this.ui;
  8146. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8147. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8148. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8149. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8150. this.ui.talkNode.visible = false;
  8151. if (Moyu.isKs)
  8152. this.ui.closeNode.closeBtn.x += 100;
  8153. }
  8154. updateType() {
  8155. switch (xGame.common.gameMode) {
  8156. case GameMode.classic:
  8157. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8158. this.ui.coinNode.visible = this.success;
  8159. if (!this.success) {
  8160. Laya.timer.once(500, this, () => {
  8161. xGame.uiMgr.Show(UIAddCoin);
  8162. });
  8163. }
  8164. else {
  8165. this.logEventForClassic_win();
  8166. }
  8167. this.logEventForClassic_complete();
  8168. this.ui.isGetAward.visible = false;
  8169. this.ui.leftBtn.c1.selectedIndex = 3;
  8170. this.ui.rightBtn.c1.selectedIndex = 0;
  8171. this.moneyNode.ui.c1.selectedIndex = 1;
  8172. break;
  8173. case GameMode.bigMove:
  8174. console.log('zh:招法模式 aaaaaa bigMove');
  8175. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8176. this.ui.coinNode.visible = this.success;
  8177. if (xGame.common.gameMode == GameMode.bigMove) {
  8178. if (this.success) {
  8179. DataMgr.setSkillSuccessTimes(1, true);
  8180. DataMgr.setSkillAccTimes(1);
  8181. }
  8182. else {
  8183. DataMgr.setSkillSuccessTimes(0, false);
  8184. }
  8185. }
  8186. this.logEventForRod_complete_N();
  8187. if (!this.success) {
  8188. Laya.timer.once(500, this, () => {
  8189. xGame.uiMgr.Show(UIAddCoin);
  8190. });
  8191. }
  8192. else {
  8193. this.logEventForRod_win();
  8194. }
  8195. this.ui.isGetAward.visible = false;
  8196. this.ui.leftBtn.c1.selectedIndex = 3;
  8197. this.ui.rightBtn.c1.selectedIndex = 0;
  8198. this.moneyNode.ui.c1.selectedIndex = 1;
  8199. break;
  8200. case GameMode.placeBall:
  8201. this.ui.coinNode.visible = false;
  8202. if (this.success) {
  8203. if (xGame.common.placeBallStarNum == 3) {
  8204. this.ui.c1.selectedIndex = 2;
  8205. }
  8206. else {
  8207. this.ui.c1.selectedIndex = 3;
  8208. }
  8209. let level = xGame.common.placeBallCurLevel;
  8210. if (level > 59) {
  8211. this.logEventForChallenge_level_complete(level);
  8212. }
  8213. else {
  8214. this.logEventForChallenge_level_N(level);
  8215. }
  8216. }
  8217. else {
  8218. this.ui.c1.selectedIndex = 4;
  8219. }
  8220. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8221. if (cfg.type == PlaceBallType.challenge) {
  8222. this.ui.c1.selectedIndex = 2;
  8223. }
  8224. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8225. this.updatePlaceBallBtn();
  8226. this.updatePlaceBallStarNum();
  8227. this.updatePlaceBallAwardState();
  8228. this.moneyNode.ui.c1.selectedIndex = 2;
  8229. this.moneyNode.checkPowerTime();
  8230. this.moneyNode.powerChange();
  8231. DataMgr.upRankData();
  8232. break;
  8233. default:
  8234. break;
  8235. }
  8236. }
  8237. logEventForRod_complete_N() {
  8238. let gfmsIdx = xGame.common.curPlayerSkillType;
  8239. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8240. let gfmc = 'Skyfall Shot';
  8241. if (gfmsIdx == 0) {
  8242. gfmc = 'Skyfall Shot';
  8243. }
  8244. if (gfmsIdx == 1) {
  8245. gfmc = 'Surging break';
  8246. }
  8247. if (gfmsIdx == 2) {
  8248. gfmc = 'Frost Lock';
  8249. }
  8250. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8251. console.log('zh:logEventForRod_complete_N level = ' + level);
  8252. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8253. let jsonStr = {
  8254. "count": 0,
  8255. "name": gfmc
  8256. };
  8257. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8258. const d = LocalStorageManager.getItem(keyStr);
  8259. jsonStr.count = d.count + 1;
  8260. LocalStorageManager.setItem(keyStr, jsonStr);
  8261. }
  8262. else {
  8263. LocalStorageManager.setItem(keyStr, jsonStr);
  8264. }
  8265. const d2 = LocalStorageManager.getItem(keyStr);
  8266. let count = d2.count;
  8267. console.log('zh:logEventForRod_complete_N count = ' + count);
  8268. if (count % 5 == 0) {
  8269. const reqStr = JSON.stringify(jsonStr);
  8270. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8271. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8272. }
  8273. }
  8274. logEventForRod_win() {
  8275. console.log('zh:logEventForRod_win,胜利');
  8276. let gfmsIdx = xGame.common.curPlayerSkillType;
  8277. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8278. let gfmc = 'Skyfall Shot';
  8279. if (gfmsIdx == 0) {
  8280. gfmc = 'Skyfall Shot';
  8281. }
  8282. if (gfmsIdx == 1) {
  8283. gfmc = 'Surging break';
  8284. }
  8285. if (gfmsIdx == 2) {
  8286. gfmc = 'Frost Lock';
  8287. }
  8288. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8289. console.log('zh:logEventForRod_win level = ' + level);
  8290. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8291. let jsonStr = {
  8292. "count": 1,
  8293. "name": gfmc + ' Lev' + level
  8294. };
  8295. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8296. const d = LocalStorageManager.getItem(keyStr);
  8297. jsonStr.count = d.count + 1;
  8298. LocalStorageManager.setItem(keyStr, jsonStr);
  8299. }
  8300. else {
  8301. LocalStorageManager.setItem(keyStr, jsonStr);
  8302. }
  8303. const reqStr = JSON.stringify(jsonStr);
  8304. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8305. }
  8306. logEventForClassic_win() {
  8307. console.log('zh:logEventForClassic_win,胜利');
  8308. let rtype = xGame.common.classicRoomType;
  8309. let msmc = '';
  8310. if (rtype == 1) {
  8311. msmc = 'beginner';
  8312. }
  8313. if (rtype == 2) {
  8314. msmc = 'expert';
  8315. }
  8316. if (rtype == 3) {
  8317. msmc = 'master';
  8318. }
  8319. let keyStr = 'sjmd_classic_win_' + rtype;
  8320. let jsonStr = {
  8321. "difficulty": msmc,
  8322. "classic_count": 1,
  8323. "difficulty_count": 1
  8324. };
  8325. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8326. const d = LocalStorageManager.getItem(keyStr);
  8327. jsonStr.classic_count = d.classic_count + 1;
  8328. jsonStr.difficulty_count = d.difficulty_count + 1;
  8329. LocalStorageManager.setItem(keyStr, jsonStr);
  8330. }
  8331. else {
  8332. LocalStorageManager.setItem(keyStr, jsonStr);
  8333. }
  8334. const reqStr = JSON.stringify(jsonStr);
  8335. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8336. }
  8337. logEventForClassic_complete() {
  8338. console.log('zh:logEventForClassic_complete,胜利');
  8339. let rtype = xGame.common.classicRoomType;
  8340. let msmc = '';
  8341. if (rtype == 1) {
  8342. msmc = 'beginner';
  8343. }
  8344. if (rtype == 2) {
  8345. msmc = 'expert';
  8346. }
  8347. if (rtype == 3) {
  8348. msmc = 'master';
  8349. }
  8350. let keyStr = 'sjmd_classic_complete_' + rtype;
  8351. let jsonStr = {
  8352. "msmc": msmc,
  8353. "count": 0
  8354. };
  8355. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8356. const d = LocalStorageManager.getItem(keyStr);
  8357. jsonStr.count = d.count + 1;
  8358. LocalStorageManager.setItem(keyStr, jsonStr);
  8359. }
  8360. else {
  8361. LocalStorageManager.setItem(keyStr, jsonStr);
  8362. }
  8363. if (jsonStr.count % 5 == 0) {
  8364. const reqStr = JSON.stringify(jsonStr);
  8365. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8366. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8367. }
  8368. }
  8369. updatePlaceBallBtn() {
  8370. this.ui.leftBtn.c1.selectedIndex = 5;
  8371. if (this.success) {
  8372. this.ui.rightBtn.c1.selectedIndex = 14;
  8373. }
  8374. else {
  8375. if (xGame.common.placeBallStarNum == 3) {
  8376. this.ui.rightBtn.c1.selectedIndex = 14;
  8377. }
  8378. else {
  8379. this.ui.rightBtn.c1.selectedIndex = 1;
  8380. }
  8381. }
  8382. }
  8383. updatePlaceBallStarNum() {
  8384. let starNum = xGame.common.placeBallStarNum;
  8385. if (starNum == 0)
  8386. this.ui.starNumNode.c1.selectedIndex = 3;
  8387. else {
  8388. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8389. }
  8390. }
  8391. updatePlaceBallAwardState() {
  8392. let level = xGame.common.placeBallCurLevel;
  8393. let starNum = xGame.common.placeBallStarNum;
  8394. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8395. let data = cfgTable.placeballData[level].award;
  8396. let cfg = cfgTable.placeballData[level];
  8397. this.awardDiamondNum = data[1];
  8398. this.awardCoinNum = data[0];
  8399. if (cfg.type == PlaceBallType.challenge) {
  8400. this.awardDiamondNum = 0;
  8401. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8402. }
  8403. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8404. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8405. if (cfg.type == PlaceBallType.challenge) {
  8406. this.ui.awardNode.coinNode.visible = true;
  8407. }
  8408. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8409. this.ui.awardNode.diamondNode.x = 265;
  8410. this.ui.awardNode.coinNode.x = 354;
  8411. }
  8412. else {
  8413. this.ui.awardNode.diamondNode.x = 291;
  8414. this.ui.awardNode.coinNode.x = 291;
  8415. }
  8416. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8417. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8418. if (this.awardCoinNum == 0) {
  8419. this.ui.awardNode.coinNode.numTxt.text = "";
  8420. }
  8421. if (getAward) {
  8422. this.ui.isGetAward.visible = true;
  8423. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8424. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8425. }
  8426. else {
  8427. this.ui.isGetAward.visible = false;
  8428. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8429. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8430. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8431. }
  8432. else {
  8433. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8434. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8435. }
  8436. }
  8437. }
  8438. show(success) {
  8439. super.show();
  8440. xGame.eventMgr.event(RESET_GAME);
  8441. this.success = success;
  8442. Laya.timer.clearAll(this);
  8443. this.playSecretaryAni();
  8444. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8445. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8446. offsetTime = Math.floor(offsetTime / 1000);
  8447. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8448. this.updateType();
  8449. Laya.timer.once(200, this, () => {
  8450. this.addAward(() => {
  8451. this.updateType();
  8452. Laya.timer.once(500, this, () => {
  8453. this.showChallengeLevel();
  8454. });
  8455. });
  8456. });
  8457. if (this.success) {
  8458. JSBridgeUtils.instance.showInternAd('gameend_success');
  8459. console.log('zh:game end 成功');
  8460. xGame.soundMgr.playSound('slots_roll01');
  8461. xGame.soundMgr.playSound("s_win");
  8462. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8463. this.diyGameDataUtilForGameWin();
  8464. this.updateGamePlaceBallData2Server();
  8465. }
  8466. else {
  8467. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8468. console.log('zh:game end失败');
  8469. xGame.soundMgr.playSound('matchwin01');
  8470. xGame.soundMgr.playSound("s_lose");
  8471. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8472. }
  8473. console.log('zh:开始弹出福利框2个');
  8474. Laya.timer.once(1000, this, () => {
  8475. console.log('zh: 1秒后 showFuLiSp1');
  8476. DataMgr.checkForShowFuLi17AndAlert(1);
  8477. });
  8478. let challengeNum = DataMgr.getChallengeTimes();
  8479. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8480. DataMgr.setChallengeTimes(1);
  8481. }
  8482. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8483. DataMgr.setClassicTimes();
  8484. }
  8485. this.setGlobalFont(this.ui);
  8486. }
  8487. diyGameDataUtilForGameWin() {
  8488. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8489. switch (xGame.common.gameMode) {
  8490. case GameMode.classic:
  8491. console.log('zh:DiyGameDataUtilForGameWin 111');
  8492. case GameMode.bigMove:
  8493. console.log('zh:DiyGameDataUtilForGameWin 222');
  8494. this.restartGame();
  8495. break;
  8496. case GameMode.placeBall:
  8497. console.log('zh:DiyGameDataUtilForGameWin 333');
  8498. var level = xGame.common.placeBallCurLevel;
  8499. console.log('zh:练习模式 联系了多少LEV=' + level);
  8500. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8501. if (level > db_over_lev) {
  8502. DataMgr.setChallengeMode_overLev(level);
  8503. }
  8504. break;
  8505. default:
  8506. console.log('zh:DiyGameDataUtilForGameWin 444');
  8507. break;
  8508. }
  8509. }
  8510. updateGamePlaceBallData2Server() {
  8511. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8512. if (userInfo == null) {
  8513. return;
  8514. }
  8515. let pbdObj = DataMgr.getPlaceBallLevelList();
  8516. let reqData = xGame.httpMgr.getReqData();
  8517. let pd = JSON.parse(reqData);
  8518. pd.placeBallData = JSON.stringify(pbdObj);
  8519. reqData = JSON.stringify(pd);
  8520. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8521. try {
  8522. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8523. let code = res.code;
  8524. let msg = res.msg;
  8525. if (code == 401) {
  8526. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8527. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8528. return;
  8529. }
  8530. if (code == 200) {
  8531. let data = res.data;
  8532. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8533. }
  8534. else {
  8535. xGame.uiMgr.Show(UIMsg, msg);
  8536. }
  8537. }
  8538. catch (error) {
  8539. console.log('error=' + error);
  8540. alert(error);
  8541. }
  8542. finally {
  8543. }
  8544. });
  8545. }
  8546. showChallengeLevel() {
  8547. if (DataMgr.getChallengeTimes() != 0)
  8548. return;
  8549. let skill = DataMgr.getSkillAccTimes();
  8550. let put = DataMgr.getPlaceBallLevelList().length;
  8551. if (skill >= 3 || put >= 5) {
  8552. xGame.uiMgr.Show(UIInvitation);
  8553. this.hide();
  8554. }
  8555. }
  8556. addAward(callback) {
  8557. if (!this.success) {
  8558. callback && callback();
  8559. return;
  8560. }
  8561. switch (xGame.common.gameMode) {
  8562. case GameMode.classic:
  8563. this.awardCoinNum = xGame.common.passAwardCoin;
  8564. this.awardDiamondNum = 0;
  8565. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8566. break;
  8567. case GameMode.bigMove:
  8568. this.awardCoinNum = xGame.common.passAwardCoin;
  8569. this.awardDiamondNum = 0;
  8570. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8571. callback && callback();
  8572. break;
  8573. case GameMode.placeBall:
  8574. let level = xGame.common.placeBallCurLevel;
  8575. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8576. if (xGame.common.placeBallStarNum != 3) {
  8577. callback && callback();
  8578. return;
  8579. }
  8580. else {
  8581. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8582. if (getAward) {
  8583. callback && callback();
  8584. return;
  8585. }
  8586. }
  8587. let cfg = cfgTable.placeballData[level];
  8588. let data = cfgTable.placeballData[level].award;
  8589. this.awardCoinNum = data[0];
  8590. this.awardDiamondNum = data[1];
  8591. if (cfg.type == PlaceBallType.challenge) {
  8592. this.awardDiamondNum = 0;
  8593. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8594. }
  8595. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8596. let diamondAward;
  8597. if (this.awardDiamondNum > 0) {
  8598. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8599. xGame.common.getAward([diamondAward, coinAward], callback);
  8600. }
  8601. else {
  8602. xGame.common.getAward([coinAward], callback);
  8603. }
  8604. if (cfg.type == PlaceBallType.normal) {
  8605. DataMgr.setPlaceBallAward(level);
  8606. }
  8607. break;
  8608. default:
  8609. break;
  8610. }
  8611. }
  8612. playSecretaryAni_old() {
  8613. let parent = this.ui.secretary.displayObject;
  8614. parent.destroyChildren();
  8615. let xx = this.ui.secretary.width / 2;
  8616. let yy = this.ui.secretary.height;
  8617. let scale = xGame.common.getSecretaryScale();
  8618. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8619. if (this.success) {
  8620. let rand = Math.random() <= 0.5 ? 2 : 3;
  8621. xGame.common.secretary.play(data, rand, false, parent, () => {
  8622. xGame.common.secretary.play(data, 1, true, parent);
  8623. });
  8624. }
  8625. else {
  8626. xGame.common.secretary.play(data, 0, true, parent);
  8627. }
  8628. }
  8629. playSecretaryAni() {
  8630. let parent = this.ui.secretary.displayObject;
  8631. parent.destroyChildren();
  8632. let xx = this.ui.secretary.width / 2;
  8633. let yy = this.ui.secretary.height;
  8634. let scale = xGame.common.getSecretaryScale();
  8635. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8636. if (this.success) {
  8637. let rand = 0;
  8638. xGame.common.secretary.play(data, 0, true, parent);
  8639. }
  8640. else {
  8641. xGame.common.secretary.play(data, 0, true, parent);
  8642. }
  8643. }
  8644. restartGame() {
  8645. switch (xGame.common.gameMode) {
  8646. case GameMode.classic:
  8647. xGame.eventMgr.event(RESTART_GAME);
  8648. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8649. break;
  8650. case GameMode.bigMove:
  8651. this.hide();
  8652. xGame.eventMgr.event(RESTART_GAME);
  8653. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8654. break;
  8655. default:
  8656. break;
  8657. }
  8658. }
  8659. hide() {
  8660. super.hide();
  8661. xGame.common.stopGirlPop(this.ui.talkNode);
  8662. PlatMgr.showBanner(false);
  8663. }
  8664. returnHome() {
  8665. this.hide();
  8666. let showFailWords = !this.success;
  8667. xGame.uiMgr.Show(UIMain, showFailWords);
  8668. }
  8669. clickLeftBtn() {
  8670. switch (xGame.common.gameMode) {
  8671. case GameMode.classic:
  8672. case GameMode.bigMove:
  8673. this.returnHome();
  8674. break;
  8675. case GameMode.placeBall:
  8676. let level = xGame.common.placeBallCurLevel;
  8677. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8678. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8679. break;
  8680. default:
  8681. break;
  8682. }
  8683. }
  8684. powerStartPlaceBallLevel(level, btn) {
  8685. if (DataMgr.powerEnough()) {
  8686. btn.touchable = false;
  8687. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8688. btn.touchable = true;
  8689. DataMgr.setPower(-1);
  8690. xGame.eventMgr.event(POWER_TIME);
  8691. this.startPlaceBallLevel(level);
  8692. this.logEventForChallenge_level_start(level);
  8693. }));
  8694. }
  8695. else {
  8696. xGame.uiMgr.Show(UIPower, 0);
  8697. }
  8698. }
  8699. clickRightBtn() {
  8700. switch (xGame.common.gameMode) {
  8701. case GameMode.classic:
  8702. console.log('zh:clickRightBtn 111');
  8703. case GameMode.bigMove:
  8704. console.log('zh:clickRightBtn 222');
  8705. this.restartGame();
  8706. break;
  8707. case GameMode.placeBall:
  8708. console.log('zh:clickRightBtn 333');
  8709. let level = xGame.common.placeBallCurLevel;
  8710. let data = DataMgr.getPlaceBallLevel(level);
  8711. let curPss = data.play && !data.isCur;
  8712. if (curPss) {
  8713. console.log('zh:clickRightBtn 333-111');
  8714. console.log('zh:当前LV=' + level);
  8715. if (level == 60) {
  8716. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8717. Laya.timer.once(3000, this, () => {
  8718. this.returnHome();
  8719. });
  8720. }
  8721. else {
  8722. let lev = level + 1;
  8723. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8724. }
  8725. }
  8726. else {
  8727. console.log('zh:clickRightBtn 333-000');
  8728. Moyu.sendDataEvent("placeBallNextLevel");
  8729. console.log('zh:qjff_AD_for_uiGameEnd');
  8730. if (Laya.Browser.onAndroid) {
  8731. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8732. if (!boo) {
  8733. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8734. return;
  8735. }
  8736. }
  8737. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8738. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8739. }
  8740. else {
  8741. console.log('zh:AD 失败,直接发放奖励');
  8742. this.qjff_AD_for_uiGameEnd(level);
  8743. }
  8744. }
  8745. break;
  8746. default:
  8747. console.log('zh:clickRightBtn 444');
  8748. break;
  8749. }
  8750. }
  8751. logEventForChallenge_level_start(level) {
  8752. let keyStr = 'sjmd_challenge_level_start';
  8753. let jsonStr = {
  8754. "count": 0,
  8755. "gold_balance ": DataMgr.getCoin(),
  8756. "level": level,
  8757. "diamond_balance ": DataMgr.getDiamond()
  8758. };
  8759. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8760. const d = LocalStorageManager.getItem(keyStr);
  8761. if (level > d.level) {
  8762. jsonStr.count = d.count + 1;
  8763. LocalStorageManager.setItem(keyStr, jsonStr);
  8764. }
  8765. else {
  8766. }
  8767. }
  8768. else {
  8769. LocalStorageManager.setItem(keyStr, jsonStr);
  8770. }
  8771. const reqStr = JSON.stringify(jsonStr);
  8772. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8773. }
  8774. qjff_AD_for_uiGameEnd(level) {
  8775. DataMgr.setPlaceBallLevel(level, 1);
  8776. this.startPlaceBallLevel(level + 1);
  8777. }
  8778. startPlaceBallLevel(level) {
  8779. xGame.common.gameMode = GameMode.placeBall;
  8780. xGame.common.placeBallCurLevel = level;
  8781. xGame.uiMgr.Show(UIGame);
  8782. this.hide();
  8783. }
  8784. logEventForChallenge_level_complete(level) {
  8785. let keyStr = 'sjmd_challenge_level_complete';
  8786. let jsonStr = {
  8787. "count": 1,
  8788. "gold_balance ": DataMgr.getCoin(),
  8789. "level": level,
  8790. "diamond_balance ": DataMgr.getDiamond()
  8791. };
  8792. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8793. const d = LocalStorageManager.getItem(keyStr);
  8794. jsonStr.count = d.count + 1;
  8795. LocalStorageManager.setItem(keyStr, jsonStr);
  8796. }
  8797. else {
  8798. LocalStorageManager.setItem(keyStr, jsonStr);
  8799. }
  8800. const reqStr = JSON.stringify(jsonStr);
  8801. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8802. }
  8803. logEventForChallenge_level_N(level) {
  8804. console.log('zh:logEventForChallenge_level_N ' + level);
  8805. let keyStr = 'sjmd_challenge_level_N';
  8806. if (LocalStorageManager.hasKey(keyStr)) {
  8807. let lev = LocalStorageManager.getItem(keyStr);
  8808. if (level > lev) {
  8809. LocalStorageManager.setItem(keyStr, level);
  8810. }
  8811. if ((level) % 5 == 0) {
  8812. console.log('zh:每5关上报1次');
  8813. let sjmc = 'challenge_level_' + level;
  8814. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8815. let sjmcForFirebase = 'challenge_level_' + level;
  8816. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8817. }
  8818. else {
  8819. console.log('zh:5 no 上报');
  8820. }
  8821. }
  8822. else {
  8823. LocalStorageManager.setItem(keyStr, level);
  8824. }
  8825. }
  8826. }
  8827. UIGameEnd.uiName = "UIGameEnd";
  8828. class ui_UIVideoShare extends fgui.GComponent {
  8829. static createInstance() {
  8830. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8831. }
  8832. onConstruct() {
  8833. this.n10 = (this.getChild("n10"));
  8834. this.myNode = (this.getChild("myNode"));
  8835. this.t0 = this.getTransition("t0");
  8836. }
  8837. }
  8838. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8839. class UIVideoShare extends UIBase {
  8840. constructor() {
  8841. super();
  8842. this.success = false;
  8843. this.awardNum = 0;
  8844. this.isShared = true;
  8845. }
  8846. onConstructor() {
  8847. this.ui = ui_UIVideoShare.createInstance();
  8848. this.contentPane = this.ui;
  8849. this.isEject = false;
  8850. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8851. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8852. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8853. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8854. }
  8855. show(success) {
  8856. super.show();
  8857. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8858. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8859. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8860. this.success = success;
  8861. let time = xGame.common.randomNum(600, 1500);
  8862. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8863. if (success)
  8864. xGame.soundMgr.playSound("applause");
  8865. this.ui.t0.play();
  8866. this.checkShareState();
  8867. let times = DataMgr.getDailyVideoShareTimes();
  8868. this.awardNum = times == 0 ? 2000 : 200;
  8869. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8870. this.setGlobalFont(this.ui);
  8871. }
  8872. checkShareState() {
  8873. if (PlatMgr.forceShare == 0) {
  8874. this.ui.myNode.closeBtn.visible = true;
  8875. this.ui.myNode.tipsNode.visible = false;
  8876. this.ui.myNode.closeBtn.x = 90;
  8877. this.ui.myNode.shareBtn.x = 342;
  8878. }
  8879. else if (PlatMgr.forceShare == 1) {
  8880. this.ui.myNode.closeBtn.visible = false;
  8881. this.ui.myNode.tipsNode.visible = true;
  8882. this.ui.myNode.shareBtn.x = 218;
  8883. this.isShared = true;
  8884. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8885. }
  8886. }
  8887. checkForceShare() {
  8888. this.isShared = !this.isShared;
  8889. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8890. }
  8891. videoShare() {
  8892. if (PlatMgr.forceShare == 1) {
  8893. if (this.isShared) {
  8894. this.shareGame();
  8895. }
  8896. else {
  8897. this.hideSelf();
  8898. }
  8899. }
  8900. else {
  8901. this.shareGame();
  8902. }
  8903. }
  8904. shareGame() {
  8905. Moyu.sendDataEvent("VideoShare");
  8906. if (Moyu.canShare() > 100) {
  8907. Moyu.shareGame((success) => {
  8908. if (success) {
  8909. DataMgr.setDailyVideoShareTimes(1);
  8910. DataMgr.setCoin(this.awardNum);
  8911. }
  8912. this.hideSelf();
  8913. }, this);
  8914. }
  8915. else {
  8916. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8917. this.hideSelf();
  8918. }
  8919. }
  8920. hideSelf() {
  8921. this.hide();
  8922. xGame.uiMgr.Show(UIGameEnd, this.success);
  8923. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8924. xGame.common.screenImg.destroy();
  8925. xGame.common.screenImg = null;
  8926. }
  8927. }
  8928. }
  8929. UIVideoShare.uiName = "UIVideoShare";
  8930. class GameMgr {
  8931. constructor() {
  8932. this.selfCamp = "";
  8933. this.selfFoulNum = 0;
  8934. this.selfBallArr = [];
  8935. this.selfTimer = 0;
  8936. this.selfScore = 0;
  8937. this.aiCamp = "";
  8938. this.aiFoulNum = 0;
  8939. this.aiBallArr = [];
  8940. this.aiTimer = 0;
  8941. this.aiScore = 0;
  8942. this.aiSkillLevelNum = 1;
  8943. this.targertScore = 0;
  8944. this.setTime = 30;
  8945. this.selfTurnRate = 0.5;
  8946. this.accTime = 0;
  8947. this.curFoul = "";
  8948. this.maxFoulTimes = 3;
  8949. this.isFirstInGame = true;
  8950. this.firstColliObj = null;
  8951. this.inHoleBalls = [];
  8952. this.blackNum = 8;
  8953. this.success = false;
  8954. this.holePosList = [];
  8955. this.posObj = {};
  8956. this._selfTurn = false;
  8957. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8958. this.ensureBallType = false;
  8959. this.isOpenBall = true;
  8960. this.finishOneShoot = true;
  8961. this.isEnd = false;
  8962. this.isChangeTurn = false;
  8963. this.isInterrupt = false;
  8964. this.aiPlayedBreakArmy = false;
  8965. this.isTouchedBall = false;
  8966. this.finishBalls = 0;
  8967. this.needBalls = 0;
  8968. this.allBallNum = 0;
  8969. this.placeBallPosData = {};
  8970. this.curHP = 0;
  8971. this.showLongView = false;
  8972. this.firstShoot = true;
  8973. this._gamePause = false;
  8974. this.trunCount = 0;
  8975. this.isBlackInHole = false;
  8976. this.isEnter = true;
  8977. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8978. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8979. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8980. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8981. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8982. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8983. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8984. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8985. }
  8986. get gamePause() {
  8987. return this._gamePause;
  8988. }
  8989. set gamePause(v) {
  8990. if (v) {
  8991. Laya.physicsTimer.pause();
  8992. }
  8993. else {
  8994. Laya.physicsTimer.resume();
  8995. }
  8996. this._gamePause = v;
  8997. }
  8998. get selfTurn() {
  8999. return this._selfTurn;
  9000. }
  9001. set selfTurn(val) {
  9002. this.trunCount++;
  9003. this._selfTurn = val;
  9004. if (val) {
  9005. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9006. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9007. }
  9008. else {
  9009. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9010. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9011. if (this.trunCount > 1)
  9012. PlatMgr.openBox();
  9013. }
  9014. }
  9015. resetGame() {
  9016. this.inHoleBalls = [];
  9017. this.isFirstInGame = true;
  9018. this.firstColliObj = null;
  9019. this.aiCamp = "";
  9020. this.selfCamp = "";
  9021. this.aiFoulNum = 0;
  9022. this.selfFoulNum = 0;
  9023. this.selfBallArr = [];
  9024. this.aiBallArr = [];
  9025. this.gamePause = false;
  9026. this.ensureBallType = false;
  9027. this.isInterrupt = false;
  9028. this.updateLeftBall();
  9029. this.clearTime();
  9030. this.aiPlayedBreakArmy = false;
  9031. this.isBlackInHole = false;
  9032. this.placeBallPosData = {};
  9033. if (xGame.common.d3World.knifeRoot) {
  9034. xGame.common.d3World.knifeRoot.destroyChildren();
  9035. }
  9036. }
  9037. gameReady() {
  9038. this.trunCount = 0;
  9039. this.firstColliObj = null;
  9040. this.isFirstInGame = true;
  9041. this.selfTurn = Math.random() <= this.selfTurnRate;
  9042. let challengeNum = DataMgr.getChallengeTimes();
  9043. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9044. this.selfTurn = true;
  9045. }
  9046. if (xGame.common.gameMode == GameMode.placeBall)
  9047. this.selfTurn = true;
  9048. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9049. this.selfTurn = true;
  9050. }
  9051. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9052. this.checkGuide();
  9053. this.checkGuideForPlaceBall();
  9054. if (xGame.common.uiRodMethod)
  9055. xGame.common.uiRodMethod.resetRod();
  9056. xGame.common.d2World.getHelpLine();
  9057. this.isOpenBall = true;
  9058. this.isTouchedBall = false;
  9059. xGame.common.aiPlayer.stopRun();
  9060. this.setTime = 30;
  9061. let ui = xGame.common.gameUI.ui;
  9062. switch (xGame.common.gameMode) {
  9063. case GameMode.classic:
  9064. xGame.common.aiPlayer.init();
  9065. this.blackNum = 8;
  9066. this.placeRootBall();
  9067. this.peoplePlay(9, 10);
  9068. ui.wordsBtn.visible = true;
  9069. ui.aiWordsBtn.visible = true;
  9070. xGame.common.talkMgr.changeAIState(true);
  9071. DataMgr.gameData.gameCount++;
  9072. DataMgr.saveGameData();
  9073. break;
  9074. case GameMode.bigMove:
  9075. this.blackNum = -1;
  9076. this.selfScore = 0;
  9077. this.aiScore = 0;
  9078. xGame.common.aiPlayer.init();
  9079. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9080. this.updateSelfScore();
  9081. this.updateAIScore();
  9082. this.updateTargetSroce();
  9083. this.placeRootBall();
  9084. this.peoplePlay(9, 10);
  9085. ui.wordsBtn.visible = true;
  9086. ui.aiWordsBtn.visible = true;
  9087. xGame.common.talkMgr.changeAIState(true);
  9088. if (DataMgr.getSkillGuide() < 1)
  9089. DataMgr.gameData.gameCount = 0;
  9090. else {
  9091. DataMgr.gameData.gameCount++;
  9092. DataMgr.saveGameData();
  9093. PlatMgr.openTry();
  9094. }
  9095. if (xGame.common.d3World.knifeRoot) {
  9096. xGame.common.d3World.knifeRoot.destroyChildren();
  9097. }
  9098. break;
  9099. case GameMode.placeBall:
  9100. this.blackNum = -1;
  9101. this.selfTurn = true;
  9102. this.setTime = 10000;
  9103. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9104. this.curHP = this.placeBallData.hp;
  9105. if (this.placeBallData.ball == -1)
  9106. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9107. else
  9108. this.needBalls = this.placeBallData.ball;
  9109. console.log("需要的进球数目", this.needBalls);
  9110. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9111. this.finishBalls = 0;
  9112. this.placeBallPosData = {};
  9113. this.updatePlaceBallPos();
  9114. this.updatePlaceBallState();
  9115. this.finishOneShoot = true;
  9116. xGame.common.gameUI.ui.moveNode.visible = false;
  9117. this.isOpenBall = false;
  9118. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9119. ui.wordsBtn.visible = false;
  9120. ui.aiWordsBtn.visible = false;
  9121. xGame.common.talkMgr.changeAIState(false);
  9122. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9123. PlatMgr.openBox();
  9124. });
  9125. break;
  9126. default:
  9127. break;
  9128. }
  9129. this.showLongView = false;
  9130. xGame.common.wordsMgr.comboTimes = 1;
  9131. let guide = DataMgr.getSkillGuide();
  9132. if (guide)
  9133. xGame.eventMgr.event(WAIT_SHOOT);
  9134. xGame.common.upSkillLevel = false;
  9135. xGame.common.gameStartTime = new Date().getTime();
  9136. this.firstShoot = true;
  9137. }
  9138. checkGuide() {
  9139. console.log('zh: 检查引导123');
  9140. let guide = DataMgr.getSkillGuide();
  9141. let gameUI = xGame.common.gameUI.ui;
  9142. gameUI.guide1.visible = false;
  9143. gameUI.guide2.visible = false;
  9144. gameUI.guide3.visible = false;
  9145. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9146. this.selfTurn = true;
  9147. }
  9148. else {
  9149. return;
  9150. }
  9151. let oneBall = this.getOneBall();
  9152. gameUI.guide1.visible = true;
  9153. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9154. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9155. }
  9156. checkGuideForPlaceBall() {
  9157. console.log('zh: 检查引导123 checkGuideForPlaceBall');
  9158. let gameUI = xGame.common.gameUI.ui;
  9159. let guide = DataMgr.getLianXiGuide();
  9160. console.log('zh:checkGuideForPlaceBall =', guide);
  9161. console.log('zh:xGame.common.gameMode=' + xGame.common.gameMode);
  9162. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  9163. this.selfTurn = true;
  9164. gameUI.n_lxms_yd1.visible = true;
  9165. }
  9166. else {
  9167. gameUI.n_lxms_yd1.visible = false;
  9168. return;
  9169. }
  9170. let oneBall = this.getOneBallForPlaceBall();
  9171. gameUI.n_lxms_yd1.visible = true;
  9172. gameUI.n_lxms_yd1.fingerNode.x = oneBall.gameObj.x;
  9173. gameUI.n_lxms_yd1.fingerNode.y = oneBall.gameObj.y;
  9174. }
  9175. getOneBall() {
  9176. let arr = xGame.common.d2World.ballArr;
  9177. for (let index = 0; index < arr.length; index++) {
  9178. if (arr[index].number == 0)
  9179. continue;
  9180. return arr[index];
  9181. }
  9182. }
  9183. getOneBallForPlaceBall() {
  9184. let arr = xGame.common.d2World.ballArr;
  9185. return arr[2];
  9186. }
  9187. updateSelfScore() {
  9188. let ui = xGame.common.gameUI.ui.topNode;
  9189. ui.selfScoreTxt.text = this.selfScore + "";
  9190. }
  9191. updateAIScore() {
  9192. let ui = xGame.common.gameUI.ui.topNode;
  9193. ui.aiScoreTxt.text = this.aiScore + "";
  9194. }
  9195. updateTargetSroce() {
  9196. let ui = xGame.common.gameUI.ui.topNode;
  9197. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9198. }
  9199. updateLeftBall() {
  9200. let topUI = xGame.common.gameUI.ui.topNode;
  9201. topUI.selfBallList.numItems = this.selfBallArr.length;
  9202. topUI.aiBallList.numItems = this.aiBallArr.length;
  9203. }
  9204. ballShoot() {
  9205. this.clearTime();
  9206. this.finishOneShoot = false;
  9207. xGame.common.gameUI.ui.moveNode.visible = false;
  9208. if (xGame.common.gameUI.ui.guideNode.visible) {
  9209. xGame.common.gameUI.ui.guideNode.visible = false;
  9210. }
  9211. if (this.firstShoot) {
  9212. this.firstShoot = false;
  9213. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9214. }
  9215. }
  9216. ensureCamp(number) {
  9217. this.ensureBallType = true;
  9218. this.isOpenBall = false;
  9219. if (xGame.common.gameMode != GameMode.classic)
  9220. return;
  9221. let full = [1, 2, 3, 4, 5, 6, 7];
  9222. let flower = [9, 10, 11, 12, 13, 14, 15];
  9223. let sayWords = "";
  9224. if (this.selfTurn) {
  9225. if (number <= 7) {
  9226. this.selfCamp = ballCamp.full;
  9227. this.selfBallArr = full;
  9228. this.aiCamp = ballCamp.flower;
  9229. this.aiBallArr = flower;
  9230. sayWords = cfgTable.wordsData[3].msg;
  9231. }
  9232. else {
  9233. this.selfCamp = ballCamp.flower;
  9234. this.selfBallArr = flower;
  9235. this.aiCamp = ballCamp.full;
  9236. this.aiBallArr = full;
  9237. sayWords = cfgTable.wordsData[4].msg;
  9238. }
  9239. }
  9240. else {
  9241. if (number <= 7) {
  9242. this.selfCamp = ballCamp.flower;
  9243. this.selfBallArr = flower;
  9244. this.aiCamp = ballCamp.full;
  9245. this.aiBallArr = full;
  9246. sayWords = cfgTable.wordsData[2].msg;
  9247. }
  9248. else {
  9249. this.selfCamp = ballCamp.full;
  9250. this.selfBallArr = full;
  9251. this.aiCamp = ballCamp.flower;
  9252. this.aiBallArr = flower;
  9253. sayWords = cfgTable.wordsData[1].msg;
  9254. }
  9255. }
  9256. this.updateLeftBall();
  9257. xGame.uiMgr.Show(UIMsg, sayWords);
  9258. }
  9259. updatePlaceBallState() {
  9260. let ui = xGame.common.gameUI.ui;
  9261. switch (this.placeBallData.type) {
  9262. case PlaceBallType.normal:
  9263. let normal = ui.placeNormalNode;
  9264. normal.hpTxt.text = this.curHP + "";
  9265. this.updatePlaceBallStar(normal);
  9266. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9267. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9268. break;
  9269. case PlaceBallType.challenge:
  9270. let challenge = ui.placeChallengeNode;
  9271. challenge.hpTxt.text = "Shots:" + this.curHP;
  9272. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9273. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9274. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9275. break;
  9276. default:
  9277. break;
  9278. }
  9279. }
  9280. playSubHpAni() {
  9281. let ui = xGame.common.gameUI.ui;
  9282. switch (this.placeBallData.type) {
  9283. case PlaceBallType.normal:
  9284. let normal = ui.placeNormalNode;
  9285. normal.hpTxt.visible = false;
  9286. normal.starAni.c1.selectedIndex = 1;
  9287. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9288. normal.hpTxt.visible = true;
  9289. normal.starAni.c1.selectedIndex = 0;
  9290. }));
  9291. break;
  9292. default:
  9293. break;
  9294. }
  9295. }
  9296. getEndStarNum() {
  9297. let num;
  9298. let level = xGame.common.placeBallCurLevel;
  9299. if (this.curHP == this.placeBallData.hp) {
  9300. num = 3;
  9301. }
  9302. else if (this.curHP <= 1) {
  9303. num = 1;
  9304. }
  9305. else {
  9306. num = 2;
  9307. }
  9308. if (!this.success) {
  9309. num = 0;
  9310. }
  9311. else {
  9312. DataMgr.setPlaceBallLevel(level, num);
  9313. }
  9314. let myType = cfgTable.placeballData[level].type;
  9315. if (this.success && myType == 1) {
  9316. num = 3;
  9317. }
  9318. xGame.common.placeBallStarNum = num;
  9319. }
  9320. updatePlaceBallStar(node) {
  9321. let star = 0;
  9322. if (this.curHP == this.placeBallData.hp) {
  9323. star = 3;
  9324. }
  9325. else if (this.curHP >= 2) {
  9326. star = 2;
  9327. }
  9328. else if (this.curHP == 1) {
  9329. star = 1;
  9330. }
  9331. else {
  9332. star = 0;
  9333. }
  9334. let temp;
  9335. for (let index = 1; index <= 3; index++) {
  9336. temp = node["star" + index];
  9337. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9338. }
  9339. node.myProgress.value = (star / 3) * 100;
  9340. }
  9341. openRegretView(isFoul, GoalNum, challenge = false) {
  9342. let regretType = -1;
  9343. if (isFoul) {
  9344. regretType = 1;
  9345. }
  9346. else {
  9347. if (GoalNum <= 0) {
  9348. regretType = 0;
  9349. }
  9350. }
  9351. if (challenge) {
  9352. regretType = 1;
  9353. }
  9354. if (regretType != -1) {
  9355. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9356. if (success) {
  9357. this.curHP++;
  9358. this.updatePlaceBallState();
  9359. this.setPlaceBallAllPos();
  9360. xGame.common.gameUI.ui.moveNode.visible = false;
  9361. }
  9362. else {
  9363. if (this.curHP <= 0) {
  9364. this.success = false;
  9365. this.gameEnd();
  9366. }
  9367. this.playSubHpAni();
  9368. }
  9369. this.updatePlaceBallState();
  9370. this.updatePlaceBallPos();
  9371. });
  9372. }
  9373. }
  9374. setPlaceBallAllPos() {
  9375. let allBall = xGame.common.d2World.ballArr;
  9376. let cfgArr = this.placeBallPosData;
  9377. let temp;
  9378. let obj;
  9379. for (let index = 0; index < allBall.length; index++) {
  9380. temp = allBall[index];
  9381. if (temp.destroyed)
  9382. continue;
  9383. obj = cfgArr[temp.myUNID];
  9384. if (obj && obj.src && !obj.src.destroyed) {
  9385. temp.gameObj.x = obj.posX;
  9386. temp.gameObj.y = obj.posY;
  9387. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9388. }
  9389. }
  9390. xGame.common.d2World.getHelpLine();
  9391. }
  9392. updatePlaceBallPos() {
  9393. let arr = xGame.common.d2World.ballArr;
  9394. let temp;
  9395. for (let index = 0; index < arr.length; index++) {
  9396. temp = arr[index];
  9397. if (!this.placeBallPosData[temp.myUNID]) {
  9398. this.placeBallPosData[temp.myUNID] = {
  9399. src: temp,
  9400. posX: temp.gameObj.x,
  9401. posY: temp.gameObj.y
  9402. };
  9403. }
  9404. else {
  9405. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9406. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9407. }
  9408. }
  9409. let check;
  9410. for (const key in this.placeBallPosData) {
  9411. check = this.placeBallPosData[key];
  9412. if (check.src.destroyed) {
  9413. delete this.placeBallPosData[key];
  9414. }
  9415. }
  9416. }
  9417. gameRun(type) {
  9418. if (this.gamePause)
  9419. return;
  9420. this.curFoul = this.getFoulType();
  9421. if (type) {
  9422. xGame.common.d2World.d2Gan.shoot();
  9423. xGame.common.gameUI.forceCancel();
  9424. this.curFoul = type;
  9425. }
  9426. this.isEnd = false;
  9427. this.isChangeTurn = true;
  9428. if (xGame.common.gameMode == GameMode.classic) {
  9429. this.judgeClassic(this.curFoul);
  9430. this.checkClassicWords(() => {
  9431. xGame.common.destroyClassicEmotion();
  9432. if (this.isEnd) {
  9433. if (this.isBlackInHole) {
  9434. xGame.common.gameUI.ui.blackAni.visible = true;
  9435. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9436. xGame.common.gameUI.ui.blackAni.visible = false;
  9437. this.gameEnd();
  9438. }));
  9439. }
  9440. else {
  9441. this.gameEnd();
  9442. }
  9443. }
  9444. else {
  9445. this.waitShoot();
  9446. xGame.eventMgr.event(WAIT_SHOOT);
  9447. }
  9448. });
  9449. }
  9450. else if (xGame.common.gameMode == GameMode.bigMove) {
  9451. xGame.common.aiPlayer.stopRun();
  9452. let scoreArr = this.getScore(this.curFoul);
  9453. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9454. this.isEnd = true;
  9455. }
  9456. this.checkBigSkillWords(() => {
  9457. if (this.isEnd) {
  9458. this.gameEnd();
  9459. }
  9460. else {
  9461. this.waitShoot();
  9462. xGame.eventMgr.event(WAIT_SHOOT);
  9463. }
  9464. });
  9465. }
  9466. else if (xGame.common.gameMode == GameMode.placeBall) {
  9467. xGame.common.destroyAwardSpine();
  9468. let isFoul = this.curFoul == FoulType.rootHole;
  9469. let GoalNum = this.inHoleBalls.length;
  9470. if (this.inHoleBalls.indexOf(0) > -1)
  9471. GoalNum -= 1;
  9472. if (isFoul) {
  9473. this.placeRootBall();
  9474. }
  9475. console.log("neeballs", this.needBalls);
  9476. console.log("当前完成的goalNum", GoalNum);
  9477. this.finishBalls += GoalNum;
  9478. console.log("当前完成的finishballs", this.finishBalls);
  9479. let need = this.needBalls;
  9480. if (this.placeBallData.type == PlaceBallType.challenge) {
  9481. need += 100;
  9482. }
  9483. if (this.finishBalls >= need) {
  9484. this.success = true;
  9485. this.gameEnd();
  9486. }
  9487. else {
  9488. switch (this.placeBallData.type) {
  9489. case PlaceBallType.normal:
  9490. if (!isFoul && GoalNum > 0) {
  9491. this.updatePlaceBallPos();
  9492. this.updatePlaceBallState();
  9493. }
  9494. else {
  9495. this.curHP--;
  9496. this.openRegretView(isFoul, GoalNum);
  9497. }
  9498. this.waitShoot();
  9499. xGame.eventMgr.event(WAIT_SHOOT);
  9500. break;
  9501. case PlaceBallType.challenge:
  9502. this.curHP--;
  9503. this.updatePlaceBallState();
  9504. if (isFoul) {
  9505. this.openRegretView(isFoul, GoalNum, true);
  9506. }
  9507. else {
  9508. this.updatePlaceBallPos();
  9509. if (this.curHP <= 0) {
  9510. this.success = true;
  9511. this.gameEnd();
  9512. }
  9513. }
  9514. this.waitShoot();
  9515. xGame.eventMgr.event(WAIT_SHOOT);
  9516. break;
  9517. default:
  9518. break;
  9519. }
  9520. }
  9521. }
  9522. }
  9523. checkClassicWords(callback) {
  9524. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9525. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9526. let type = this.getClassicWordsType();
  9527. if (condition && type != -1) {
  9528. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9529. xGame.soundMgr.playSound(str);
  9530. xGame.common.wordsMgr.playClassicWords(type, callback);
  9531. }
  9532. else {
  9533. Laya.timer.once(300, this, () => {
  9534. callback && callback();
  9535. });
  9536. }
  9537. }
  9538. getClassicWordsType() {
  9539. let d2world = xGame.common.d2World;
  9540. let type = -1;
  9541. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9542. type = ClassicWordsType.perfectShow;
  9543. return type;
  9544. }
  9545. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9546. type = ClassicWordsType.directShoot;
  9547. return type;
  9548. }
  9549. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9550. type = ClassicWordsType.anotherShoot;
  9551. return type;
  9552. }
  9553. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9554. type = ClassicWordsType.bigPower;
  9555. return type;
  9556. }
  9557. let minSpeed = 1;
  9558. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9559. type = ClassicWordsType.hardShoot;
  9560. return type;
  9561. }
  9562. if (this.inHoleBalls.length > 0) {
  9563. type = ClassicWordsType.directShoot;
  9564. return type;
  9565. }
  9566. return type;
  9567. }
  9568. checkBigSkillWords(callback) {
  9569. if (this.curFoul == FoulType.timeOut) {
  9570. callback && callback();
  9571. }
  9572. else {
  9573. let playSkill = false;
  9574. if (this.selfTurn) {
  9575. playSkill = true;
  9576. }
  9577. else {
  9578. if (!this.aiPlayedBreakArmy) {
  9579. this.aiPlayedBreakArmy = true;
  9580. playSkill = true;
  9581. }
  9582. if (this.aiCurSkill != SkillType.breakArmy) {
  9583. playSkill = true;
  9584. }
  9585. }
  9586. if (xGame.common.skillMgr.playedLastSkill) {
  9587. xGame.common.skillMgr.playedLastSkill = false;
  9588. playSkill = false;
  9589. }
  9590. if (playSkill) {
  9591. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9592. let selfExtra = 0;
  9593. let aiExtra = 0;
  9594. if (this.selfTurn)
  9595. selfExtra += extraScore;
  9596. else
  9597. aiExtra += extraScore;
  9598. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9599. this.isEnd = true;
  9600. }
  9601. this.playBigSkillTimes(callback);
  9602. });
  9603. }
  9604. else {
  9605. this.playBigSkillTimes(callback);
  9606. }
  9607. }
  9608. }
  9609. playBigSkillTimes(callback) {
  9610. let length = this.inHoleBalls.length;
  9611. if (this.inHoleBalls.indexOf(0) > -1) {
  9612. length = this.inHoleBalls.length - 1;
  9613. }
  9614. if (length <= 0) {
  9615. callback && callback();
  9616. return;
  9617. }
  9618. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9619. callback && callback();
  9620. });
  9621. }
  9622. playSkillTips() {
  9623. let levelNum = 0;
  9624. let curType;
  9625. if (this.selfTurn) {
  9626. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9627. curType = this.selfCurSkill;
  9628. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9629. levelNum += 5;
  9630. }
  9631. }
  9632. else {
  9633. levelNum = this.aiSkillLevelNum;
  9634. curType = this.aiCurSkill;
  9635. }
  9636. let str = ``;
  9637. switch (curType) {
  9638. case SkillType.highSpace:
  9639. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9640. break;
  9641. case SkillType.breakArmy:
  9642. str = `You pocketed ${levelNum} extra balls`;
  9643. break;
  9644. case SkillType.ice:
  9645. str = `${levelNum * 2} extra balls were frozen`;
  9646. break;
  9647. case SkillType.fireworks:
  9648. str = `${levelNum} extra balls exploded `;
  9649. break;
  9650. case SkillType.GuanYu:
  9651. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9652. break;
  9653. default:
  9654. break;
  9655. }
  9656. xGame.uiMgr.Show(UIMsg, str);
  9657. }
  9658. getFoulType() {
  9659. let foulType = "";
  9660. if (this.firstColliObj == null) {
  9661. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9662. return FoulType.rootHole;
  9663. }
  9664. return FoulType.notTouch;
  9665. }
  9666. else {
  9667. if (this.selfTurn) {
  9668. if (this.selfBallArr.length > 0) {
  9669. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9670. foulType = FoulType.wrongTouch;
  9671. }
  9672. }
  9673. else {
  9674. if (this.ensureBallType) {
  9675. }
  9676. else {
  9677. if (this.firstColliObj == this.blackNum) {
  9678. foulType = FoulType.wrongTouch;
  9679. }
  9680. }
  9681. }
  9682. }
  9683. else {
  9684. if (this.aiBallArr.length > 0) {
  9685. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9686. foulType = FoulType.wrongTouch;
  9687. }
  9688. }
  9689. else {
  9690. if (this.ensureBallType) {
  9691. }
  9692. else {
  9693. if (this.firstColliObj == this.blackNum) {
  9694. foulType = FoulType.wrongTouch;
  9695. }
  9696. }
  9697. }
  9698. }
  9699. if (this.inHoleBalls.length <= 0) {
  9700. return foulType;
  9701. }
  9702. let temp;
  9703. if (this.inHoleBalls.indexOf(0) > -1) {
  9704. foulType = FoulType.rootHole;
  9705. }
  9706. else {
  9707. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9708. temp = this.inHoleBalls[index];
  9709. if (this.selfTurn) {
  9710. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9711. foulType = FoulType.wrongHole;
  9712. break;
  9713. }
  9714. }
  9715. else {
  9716. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9717. foulType = FoulType.wrongHole;
  9718. break;
  9719. }
  9720. }
  9721. }
  9722. }
  9723. let foo;
  9724. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9725. temp = this.inHoleBalls[index];
  9726. foo = this.selfBallArr.indexOf(temp);
  9727. if (foo > -1) {
  9728. this.selfBallArr.splice(foo, 1);
  9729. }
  9730. foo = this.aiBallArr.indexOf(temp);
  9731. if (foo > -1) {
  9732. this.aiBallArr.splice(foo, 1);
  9733. }
  9734. }
  9735. this.updateLeftBall();
  9736. }
  9737. return foulType;
  9738. }
  9739. judgeGameEndByBlack(arr) {
  9740. if (this.selfTurn) {
  9741. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9742. this.selfFoulNum = this.maxFoulTimes;
  9743. return true;
  9744. }
  9745. }
  9746. else {
  9747. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9748. this.aiFoulNum = this.maxFoulTimes;
  9749. return true;
  9750. }
  9751. }
  9752. }
  9753. judgeClassic(type) {
  9754. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9755. xGame.common.aiPlayer.stopRun();
  9756. if (this.judgeNormalSuccess()) {
  9757. this.isEnd = true;
  9758. return;
  9759. }
  9760. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9761. if (this.selfTurn) {
  9762. if (isFoul) {
  9763. this.selfFoulNum++;
  9764. }
  9765. if (this.selfFoulNum >= this.maxFoulTimes) {
  9766. this.success = false;
  9767. this.isEnd = true;
  9768. return;
  9769. }
  9770. }
  9771. else {
  9772. if (isFoul)
  9773. this.aiFoulNum++;
  9774. if (this.aiFoulNum >= this.maxFoulTimes) {
  9775. this.success = true;
  9776. this.isEnd = true;
  9777. return;
  9778. }
  9779. }
  9780. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9781. this.isChangeTurn = false;
  9782. }
  9783. else {
  9784. this.isInterrupt = true;
  9785. }
  9786. }
  9787. waitShoot() {
  9788. if (xGame.common.gameMode == GameMode.classic) {
  9789. switch (this.curFoul) {
  9790. case FoulType.timeOut:
  9791. case FoulType.rootHole:
  9792. this.selfTurn = !this.selfTurn;
  9793. this.peoplePlay(5, 6, true);
  9794. break;
  9795. case FoulType.notTouch:
  9796. this.selfTurn = !this.selfTurn;
  9797. this.peoplePlay(7, 7);
  9798. break;
  9799. case FoulType.wrongHole:
  9800. this.selfTurn = !this.selfTurn;
  9801. this.peoplePlay(11, 11);
  9802. break;
  9803. default:
  9804. if (this.inHoleBalls.length > 0) {
  9805. this.peoplePlay(0, 0, false, false);
  9806. }
  9807. else {
  9808. this.selfTurn = !this.selfTurn;
  9809. this.peoplePlay(7, 7);
  9810. }
  9811. break;
  9812. }
  9813. }
  9814. else if (xGame.common.gameMode == GameMode.bigMove) {
  9815. if (this.curFoul == FoulType.timeOut) {
  9816. this.selfTurn = !this.selfTurn;
  9817. this.peoplePlay(14, 15);
  9818. this.placeRootBall();
  9819. }
  9820. else {
  9821. this.selfTurn = !this.selfTurn;
  9822. if (this.curFoul == FoulType.rootHole) {
  9823. this.peoplePlay(12, 13);
  9824. this.placeRootBall();
  9825. }
  9826. else {
  9827. this.peoplePlay(0, 0, false, false);
  9828. }
  9829. }
  9830. }
  9831. else if (xGame.common.gameMode == GameMode.placeBall) {
  9832. this.finishOneShoot = true;
  9833. }
  9834. this.gameResult();
  9835. }
  9836. gameResult() {
  9837. this.firstColliObj = null;
  9838. this.inHoleBalls = [];
  9839. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9840. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9841. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9842. if (xGame.common.uiRodMethod)
  9843. xGame.common.uiRodMethod.resetRod();
  9844. xGame.common.d2World.rootBall.showSelf();
  9845. this.clearIceSkill();
  9846. if (this.selfTurn) {
  9847. PlatMgr.gameInsert();
  9848. }
  9849. xGame.common.d3World.knifeRoot.destroyChildren();
  9850. if (this.selfTurn) {
  9851. xGame.common.gameUI.showHelpLineGuide();
  9852. xGame.common.gameUI.setTurnAlpha(true);
  9853. }
  9854. else {
  9855. xGame.common.gameUI.setTurnAlpha(false);
  9856. }
  9857. }
  9858. getScore(type) {
  9859. let selfAdd = 0;
  9860. let aiAdd = 0;
  9861. if (type == FoulType.timeOut) {
  9862. if (this.selfTurn)
  9863. aiAdd += 3;
  9864. else
  9865. selfAdd += 3;
  9866. }
  9867. else {
  9868. if (this.inHoleBalls.length > 0) {
  9869. if (this.selfTurn) {
  9870. if (type == FoulType.rootHole) {
  9871. aiAdd += 3;
  9872. if (this.inHoleBalls.length - 1 > 0) {
  9873. selfAdd += this.inHoleBalls.length - 1;
  9874. }
  9875. }
  9876. else {
  9877. selfAdd += this.inHoleBalls.length;
  9878. }
  9879. }
  9880. else {
  9881. if (type == FoulType.rootHole) {
  9882. selfAdd += 3;
  9883. if (this.inHoleBalls.length - 1 > 0) {
  9884. aiAdd += this.inHoleBalls.length - 1;
  9885. }
  9886. }
  9887. else {
  9888. aiAdd += this.inHoleBalls.length;
  9889. }
  9890. }
  9891. }
  9892. }
  9893. return [selfAdd, aiAdd];
  9894. }
  9895. judgeScoreEnd(selfAdd, aiAdd) {
  9896. this.selfScore += selfAdd;
  9897. this.aiScore += aiAdd;
  9898. this.updateAIScore();
  9899. this.updateSelfScore();
  9900. if (this.selfScore >= this.targertScore) {
  9901. this.success = true;
  9902. return true;
  9903. }
  9904. if (this.aiScore >= this.targertScore) {
  9905. this.success = false;
  9906. return true;
  9907. }
  9908. let ballArr = xGame.common.d2World.ballArr;
  9909. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9910. if (this.selfScore > this.aiScore) {
  9911. this.success = true;
  9912. return true;
  9913. }
  9914. else if (this.selfScore < this.aiScore) {
  9915. this.success = false;
  9916. return true;
  9917. }
  9918. else {
  9919. if (this.selfTurn) {
  9920. this.success = false;
  9921. }
  9922. else {
  9923. this.success = true;
  9924. }
  9925. return true;
  9926. }
  9927. }
  9928. }
  9929. clearIceSkill() {
  9930. let arr = xGame.common.d2World.ballArr;
  9931. let temp;
  9932. if (this.selfTurn) {
  9933. if (this.selfCurSkill == SkillType.ice) {
  9934. for (let index = 0; index < arr.length; index++) {
  9935. temp = arr[index];
  9936. if (temp.ballFunc == "ice") {
  9937. temp.setBallFunc("normal", "self");
  9938. }
  9939. }
  9940. }
  9941. }
  9942. else {
  9943. if (this.aiCurSkill == SkillType.ice) {
  9944. for (let index = 0; index < arr.length; index++) {
  9945. temp = arr[index];
  9946. if (temp.ballFunc == "ice") {
  9947. temp.setBallFunc("normal", "ai");
  9948. }
  9949. }
  9950. }
  9951. }
  9952. }
  9953. judgeNormalSuccess() {
  9954. if (this.selfTurn) {
  9955. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9956. this.success = true;
  9957. return true;
  9958. }
  9959. }
  9960. else {
  9961. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9962. this.success = false;
  9963. return true;
  9964. }
  9965. }
  9966. }
  9967. gameEnd() {
  9968. if (Moyu.isTT) {
  9969. xGame.common.screenImg = getScreenImg();
  9970. }
  9971. console.log("游戏结束", this.success);
  9972. xGame.common.aiPlayer.stopRun();
  9973. if (xGame.common.gameMode == GameMode.placeBall) {
  9974. this.getEndStarNum();
  9975. this.updatePlaceBallState();
  9976. }
  9977. this.isEnter = false;
  9978. Moyu.recordEnd(this, () => {
  9979. if (this.isEnter)
  9980. return;
  9981. this.isEnter = true;
  9982. console.log("进入录结束回调");
  9983. this.enterNext();
  9984. });
  9985. Laya.timer.once(1000, this, () => {
  9986. if (this.isEnter)
  9987. return;
  9988. this.isEnter = true;
  9989. this.enterNext();
  9990. });
  9991. xGame.common.longHelpLine = false;
  9992. }
  9993. enterNext() {
  9994. Laya.timer.clearAll(this);
  9995. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9996. xGame.uiMgr.Show(UIVideoShare, this.success);
  9997. }
  9998. else {
  9999. xGame.uiMgr.Show(UIGameEnd, this.success);
  10000. }
  10001. }
  10002. aiLeave() {
  10003. let ui = xGame.common.gameUI.ui;
  10004. ui.topNode.aiNameTxt.text = "offline";
  10005. }
  10006. aiGameEnd(suc) {
  10007. this.success = suc;
  10008. xGame.common.aiPlayer.stopRun();
  10009. if (this.success) {
  10010. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  10011. Laya.timer.once(1000, this, () => {
  10012. this.clearTime();
  10013. this.gameEnd();
  10014. });
  10015. }
  10016. }
  10017. openTimer() {
  10018. let src = xGame.common.gameUI;
  10019. if (this.selfTurn) {
  10020. src.ui.topNode.selfProgress.visible = true;
  10021. src.ui.topNode.aiProgress.visible = false;
  10022. this.curTimer = src.ui.topNode.selfProgress;
  10023. }
  10024. else {
  10025. src.ui.topNode.selfProgress.visible = false;
  10026. src.ui.topNode.aiProgress.visible = true;
  10027. this.curTimer = src.ui.topNode.aiProgress;
  10028. }
  10029. this.accTime = 0;
  10030. Laya.timer.clearAll(this);
  10031. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10032. this.curTimer.value = 100;
  10033. }
  10034. updateTime(dt) {
  10035. if (this.gamePause)
  10036. return;
  10037. this.accTime += dt;
  10038. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10039. if (this.accTime >= this.setTime) {
  10040. this.clearTime();
  10041. console.log("时钟进入了gameRun");
  10042. this.gameRun(FoulType.timeOut);
  10043. }
  10044. }
  10045. clearTime() {
  10046. let src = xGame.common.gameUI;
  10047. src.ui.topNode.selfProgress.visible = false;
  10048. src.ui.topNode.aiProgress.visible = false;
  10049. Laya.timer.clearAll(this);
  10050. }
  10051. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10052. let ui = xGame.common.gameUI.ui;
  10053. let selfMsg, aiMsg;
  10054. if (sayWords) {
  10055. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10056. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10057. if (Foul) {
  10058. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10059. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10060. this.placeRootBall();
  10061. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10062. if (this.curFoul == FoulType.rootHole) {
  10063. if (!DataMgr.getRootBallFoul()) {
  10064. DataMgr.setRootBallFoul();
  10065. aiMsg = "";
  10066. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10067. let woman = "Boss, pay attention next time~";
  10068. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10069. }
  10070. }
  10071. else if (this.curFoul == FoulType.timeOut) {
  10072. if (!DataMgr.getTimeoutFoul()) {
  10073. DataMgr.setTimeoutFoul();
  10074. aiMsg = "";
  10075. let tips = "Game timeout, 3 fouls, this game failed.";
  10076. let woman = "Boss, pay attention to the timeline~";
  10077. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10078. }
  10079. }
  10080. }
  10081. }
  10082. }
  10083. if (this.selfTurn) {
  10084. if (sayWords) {
  10085. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10086. ui.selfTurn.visible = true;
  10087. ui.aiTurn.visible = false;
  10088. ui.selfTurn.t0.play();
  10089. Moyu.vibration();
  10090. });
  10091. }
  10092. }
  10093. else {
  10094. let aiNum = xGame.tools.random(1, 11);
  10095. let challengeNum = DataMgr.getChallengeTimes();
  10096. let delay = false;
  10097. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10098. aiNum = 9;
  10099. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10100. aiNum = 3;
  10101. if (challengeNum == 3) {
  10102. if (!this.showLongView) {
  10103. this.showLongView = true;
  10104. delay = true;
  10105. }
  10106. }
  10107. }
  10108. }
  10109. if (delay) {
  10110. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10111. if (success) {
  10112. xGame.common.longHelpLine = true;
  10113. xGame.common.d2World.getHelpLine();
  10114. }
  10115. else {
  10116. aiNum = 10;
  10117. }
  10118. xGame.common.aiPlayer.setAiLevel(aiNum);
  10119. if (sayWords) {
  10120. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10121. xGame.common.aiPlayer.runAI();
  10122. ui.selfTurn.visible = false;
  10123. ui.aiTurn.visible = true;
  10124. ui.aiTurn.t0.play();
  10125. });
  10126. }
  10127. else {
  10128. xGame.common.aiPlayer.runAI();
  10129. }
  10130. this.openTimer();
  10131. this.finishOneShoot = true;
  10132. if (this.selfTurn) {
  10133. ui.topNode.selfKuang.visible = true;
  10134. ui.topNode.aiKuang.visible = false;
  10135. ui.topNode.selfTips.visible = true;
  10136. ui.topNode.aiTips.visible = false;
  10137. }
  10138. else {
  10139. ui.topNode.selfKuang.visible = false;
  10140. ui.topNode.aiKuang.visible = true;
  10141. ui.topNode.selfTips.visible = false;
  10142. ui.topNode.aiTips.visible = true;
  10143. }
  10144. });
  10145. return;
  10146. }
  10147. if (xGame.common.gameMode == GameMode.classic) {
  10148. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10149. if (cfg) {
  10150. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10151. aiNum = aiLevel;
  10152. }
  10153. }
  10154. xGame.common.aiPlayer.setAiLevel(aiNum);
  10155. if (sayWords) {
  10156. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10157. xGame.common.aiPlayer.runAI();
  10158. ui.selfTurn.visible = false;
  10159. ui.aiTurn.visible = true;
  10160. ui.aiTurn.t0.play();
  10161. });
  10162. }
  10163. else {
  10164. xGame.common.aiPlayer.runAI();
  10165. }
  10166. }
  10167. this.openTimer();
  10168. this.finishOneShoot = true;
  10169. if (this.selfTurn) {
  10170. ui.topNode.selfKuang.visible = true;
  10171. ui.topNode.aiKuang.visible = false;
  10172. ui.topNode.selfTips.visible = true;
  10173. ui.topNode.aiTips.visible = false;
  10174. }
  10175. else {
  10176. ui.topNode.selfKuang.visible = false;
  10177. ui.topNode.aiKuang.visible = true;
  10178. ui.topNode.selfTips.visible = false;
  10179. ui.topNode.aiTips.visible = true;
  10180. }
  10181. }
  10182. placeRootBall() {
  10183. let rootBall = xGame.common.d2World.rootBall;
  10184. if (!rootBall)
  10185. return;
  10186. rootBall.gameObj.x = this.lastRootBallPos.x;
  10187. rootBall.gameObj.y = this.lastRootBallPos.y;
  10188. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10189. let moveNode = xGame.common.gameUI.ui.moveNode;
  10190. moveNode.visible = true;
  10191. moveNode.x = this.lastRootBallPos.x;
  10192. moveNode.y = this.lastRootBallPos.y;
  10193. if (!this.selfTurn) {
  10194. xGame.common.aiPlayer.resetRoot();
  10195. }
  10196. }
  10197. }
  10198. class ui_guanyuAni extends fgui.GComponent {
  10199. static createInstance() {
  10200. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10201. }
  10202. onConstruct() {
  10203. this.n0 = (this.getChild("n0"));
  10204. }
  10205. }
  10206. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10207. class UIFireworks extends UIBase {
  10208. constructor() {
  10209. super();
  10210. }
  10211. onConstructor() {
  10212. this.isEject = false;
  10213. }
  10214. show(callback) {
  10215. super.show();
  10216. }
  10217. }
  10218. UIFireworks.uiName = "UIFireworks";
  10219. class ui_UIGuanYu extends fgui.GComponent {
  10220. static createInstance() {
  10221. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10222. }
  10223. onConstruct() {
  10224. this.n2 = (this.getChild("n2"));
  10225. this.n1 = (this.getChild("n1"));
  10226. this.n3 = (this.getChild("n3"));
  10227. this.n4 = (this.getChild("n4"));
  10228. this.n5 = (this.getChild("n5"));
  10229. this.n6 = (this.getChild("n6"));
  10230. this.n8 = (this.getChild("n8"));
  10231. this.n7 = (this.getChild("n7"));
  10232. this.t0 = this.getTransition("t0");
  10233. }
  10234. }
  10235. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10236. class UIGuanYu extends UIBase {
  10237. constructor() {
  10238. super();
  10239. }
  10240. onConstructor() {
  10241. this.ui = ui_UIGuanYu.createInstance();
  10242. this.contentPane = this.ui;
  10243. this.isEject = false;
  10244. }
  10245. show(callback) {
  10246. super.show();
  10247. this.ui.t0.play(Laya.Handler.create(this, () => {
  10248. callback && callback();
  10249. this.hide();
  10250. }));
  10251. this.setGlobalFont(this.ui);
  10252. }
  10253. }
  10254. UIGuanYu.uiName = "UIGuanYu";
  10255. class SkillMgr {
  10256. constructor() {
  10257. this.leveNum = 0;
  10258. this.extraScore = 0;
  10259. this.selfTurn = false;
  10260. this.playedLastSkill = false;
  10261. this.tweenArr = [];
  10262. this._finishNum = 0;
  10263. this._curFinish = 0;
  10264. this._rootX = 0;
  10265. this._rootY = 0;
  10266. this.knifeTimes = 0;
  10267. this.knifeV2 = new Laya.Vector2();
  10268. this.knifeV3 = new Laya.Vector3();
  10269. this.rtStarX = 0;
  10270. this.rtStarY = 0;
  10271. this.addBigSkillSpine();
  10272. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10273. }
  10274. addBigSkillSpine() {
  10275. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10276. console.log("extra2 success");
  10277. });
  10278. }
  10279. runBigSkill(callback) {
  10280. this.tweenArr = [];
  10281. this.callback = callback;
  10282. this.judgeSkill();
  10283. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10284. let guide = DataMgr.getSkillGuide();
  10285. if (!xGame.common.gameMgr.selfTurn) {
  10286. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10287. }
  10288. else {
  10289. if (xGame.common.temSelfLevel != 0) {
  10290. this.leveNum = xGame.common.temSelfLevel;
  10291. }
  10292. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10293. this.leveNum += 5;
  10294. }
  10295. }
  10296. if (guide == 0) {
  10297. DataMgr.setSkillGuide(1);
  10298. if (DataMgr.getNewUser()) {
  10299. Moyu.sendDataEvent("gameFirstPlay");
  10300. DataMgr.setNewUser();
  10301. }
  10302. }
  10303. this.playSpineAni(() => {
  10304. switch (this.curSkill) {
  10305. case SkillType.highSpace:
  10306. this.runHighSpace();
  10307. break;
  10308. case SkillType.breakArmy:
  10309. this.runBreakArmy();
  10310. break;
  10311. case SkillType.ice:
  10312. this.runIce();
  10313. break;
  10314. case SkillType.fireworks:
  10315. this.runFireworks();
  10316. break;
  10317. case SkillType.GuanYu:
  10318. this.runGuanYu();
  10319. break;
  10320. default:
  10321. break;
  10322. }
  10323. });
  10324. }
  10325. judgeSkill() {
  10326. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10327. let gameMgr = xGame.common.gameMgr;
  10328. let type;
  10329. for (let index = 0; index < typeArr.length; index++) {
  10330. type = typeArr[index];
  10331. if (gameMgr.selfTurn) {
  10332. if (gameMgr.selfCurSkill == type) {
  10333. this.selfTurn = true;
  10334. this.curSkill = type;
  10335. return;
  10336. }
  10337. }
  10338. else {
  10339. if (gameMgr.aiCurSkill == type) {
  10340. this.selfTurn = false;
  10341. this.curSkill = type;
  10342. return;
  10343. }
  10344. }
  10345. }
  10346. }
  10347. playSpineAni(callback) {
  10348. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10349. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10350. parent.destroyChildren();
  10351. let aniIndex = 0;
  10352. let skillSpine;
  10353. switch (this.curSkill) {
  10354. case SkillType.highSpace:
  10355. aniIndex = 1;
  10356. xGame.soundMgr.playSound("skill01");
  10357. skillSpine = this.skillSpine2;
  10358. data.scaleX = 0.5;
  10359. data.scaleY = 0.5;
  10360. skillSpine.play(data, 1, false, parent, () => {
  10361. callback && callback();
  10362. });
  10363. break;
  10364. case SkillType.breakArmy:
  10365. aniIndex = 2;
  10366. xGame.soundMgr.playSound("skill02");
  10367. skillSpine = this.skillSpine2;
  10368. data.scaleX = 0.5;
  10369. data.scaleY = 0.5;
  10370. skillSpine.play(data, 2, false, parent, () => {
  10371. callback && callback();
  10372. });
  10373. break;
  10374. case SkillType.ice:
  10375. aniIndex = 0;
  10376. xGame.soundMgr.playSound("skill03");
  10377. skillSpine = this.skillSpine2;
  10378. data.scaleX = 0.5;
  10379. data.scaleY = 0.5;
  10380. skillSpine.play(data, 0, false, parent, () => {
  10381. callback && callback();
  10382. });
  10383. break;
  10384. case SkillType.fireworks:
  10385. xGame.soundMgr.playSound("skill_04_01");
  10386. xGame.soundMgr.playSound("skill04");
  10387. xGame.uiMgr.Show(UIFireworks, callback);
  10388. break;
  10389. case SkillType.GuanYu:
  10390. xGame.soundMgr.playSound("skill05_1");
  10391. xGame.soundMgr.playSound("skill05");
  10392. xGame.uiMgr.Show(UIGuanYu, callback);
  10393. break;
  10394. default:
  10395. break;
  10396. }
  10397. }
  10398. getAllBallArr() {
  10399. let arr = xGame.common.d2World.ballArr;
  10400. let outArr = [];
  10401. for (let index = 0; index < arr.length; index++) {
  10402. if (arr[index] instanceof D2RootBallSrc)
  10403. continue;
  10404. if (arr[index].ballFunc == "ice")
  10405. continue;
  10406. if (arr[index].destroyed)
  10407. continue;
  10408. outArr.push(arr[index]);
  10409. }
  10410. return outArr;
  10411. }
  10412. getOneArr(deletObj) {
  10413. let allArr = this.getAllBallArr();
  10414. let temp;
  10415. for (let index = 0; index < allArr.length; index++) {
  10416. temp = allArr[index];
  10417. if (temp.id == deletObj.id) {
  10418. allArr.splice(index, 1);
  10419. break;
  10420. }
  10421. }
  10422. return allArr;
  10423. }
  10424. getNearBallBag(ball) {
  10425. let ui = xGame.common.gameUI.ui;
  10426. let circleArr = [];
  10427. for (let index = 1; index <= 6; index++) {
  10428. circleArr.push(ui.border["circle" + index]);
  10429. }
  10430. let outIndex = 0;
  10431. let temp;
  10432. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10433. ;
  10434. let dis = 0;
  10435. for (let index = 1; index < circleArr.length; index++) {
  10436. temp = circleArr[index];
  10437. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10438. if (dis < min) {
  10439. min = dis;
  10440. outIndex = index;
  10441. }
  10442. }
  10443. return [circleArr[outIndex], outIndex];
  10444. }
  10445. ballFlyToBag(ballArr, time = 300) {
  10446. let temp;
  10447. let hole;
  10448. this._finishNum = ballArr.length;
  10449. this._curFinish = 0;
  10450. let holeObj = {};
  10451. let holeCfg = {
  10452. "1": 0,
  10453. "2": 0,
  10454. "3": 0,
  10455. "4": 0,
  10456. "5": 0,
  10457. "6": 0
  10458. };
  10459. for (let index = 0; index < ballArr.length; index++) {
  10460. temp = ballArr[index];
  10461. temp.outColli.isSensor = true;
  10462. temp.innerColli.isSensor = true;
  10463. temp.isRunSkillAni = true;
  10464. let holeArr = this.getNearBallBag(temp);
  10465. hole = holeArr[0];
  10466. holeObj[index] = holeArr[1];
  10467. temp.d3BallSrc.scaleXYZ = 0.5;
  10468. this.tweenArr.push(temp.d3BallSrc, temp);
  10469. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10470. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10471. }));
  10472. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10473. let mIndex = holeObj[this._curFinish];
  10474. let isDone = holeCfg[mIndex];
  10475. if (isDone) {
  10476. ballArr[this._curFinish].checkWrongBall(false);
  10477. }
  10478. else {
  10479. holeCfg[mIndex] = 1;
  10480. ballArr[this._curFinish].checkWrongBall();
  10481. }
  10482. this._curFinish++;
  10483. if (this._curFinish >= this._finishNum) {
  10484. if (this.curSkill == SkillType.highSpace) {
  10485. }
  10486. else if (this.curSkill == SkillType.breakArmy) {
  10487. let rootBall = xGame.common.d2World.rootBall;
  10488. rootBall.gameObj.x = this._rootX;
  10489. rootBall.gameObj.y = this._rootY;
  10490. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10491. xGame.common.d2World.d2Gan.ui.visible = true;
  10492. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10493. xGame.common.d2World.getHelpLine();
  10494. this.callback && this.callback(this.extraScore);
  10495. }
  10496. }
  10497. }));
  10498. }
  10499. }
  10500. runHighSpace() {
  10501. let rootBall = xGame.common.d2World.rootBall;
  10502. rootBall.showSelf();
  10503. let d3Src = rootBall.d3BallSrc;
  10504. let allArr = this.getAllBallArr();
  10505. if (allArr.length <= 0) {
  10506. this.callback && this.callback(0);
  10507. return;
  10508. }
  10509. let selectBall = xGame.common.d2World.targetBall;
  10510. let wrong = selectBall && selectBall.destroyed;
  10511. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10512. selectBall = xGame.common.getRandArrEle(allArr);
  10513. }
  10514. let targetD3Src = selectBall.d3BallSrc;
  10515. xGame.common.d2World.d2Gan.ui.visible = false;
  10516. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10517. d3Src.scaleXYZ = 0.5;
  10518. this.tweenArr.push(d3Src);
  10519. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10520. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10521. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10522. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10523. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10524. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10525. let outArr = [selectBall];
  10526. let other = this.leveNum - 1;
  10527. if (other > 0) {
  10528. let nearArr = this.getOneArr(selectBall);
  10529. if (nearArr.length > 0) {
  10530. xGame.common.botherArr(nearArr);
  10531. if (other >= nearArr.length)
  10532. other = nearArr.length;
  10533. for (let index = 0; index < other; index++) {
  10534. outArr.push(nearArr[index]);
  10535. }
  10536. }
  10537. }
  10538. xGame.common.extraMoveNum = other + 1;
  10539. this.extraScore = other + 1;
  10540. this._rootX = selectBall.gameObj.x;
  10541. this._rootY = selectBall.gameObj.y;
  10542. rootBall.gameObj.x = this._rootX;
  10543. rootBall.gameObj.y = this._rootY;
  10544. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10545. Laya.Tween.clearAll(d3Src);
  10546. this.addRandomForce(outArr);
  10547. }));
  10548. }));
  10549. }
  10550. addRandomForce(outArr) {
  10551. if (outArr.length > 0) {
  10552. xGame.common.d2World.openCheckStill = true;
  10553. this.playedLastSkill = true;
  10554. }
  10555. let temp;
  10556. for (let index = 0; index < outArr.length; index++) {
  10557. let angle = xGame.common.randomNum(0, 360);
  10558. let linearPercent = xGame.common.randomNum(65, 100);
  10559. temp = outArr[index];
  10560. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10561. }
  10562. }
  10563. setLinearSpeed(angle, rigy, linearPercent) {
  10564. let sin = Math.sin(angle * Math.PI / 180);
  10565. let cos = Math.cos(angle * Math.PI / 180);
  10566. let maxSpeed = 4;
  10567. let speed = new Laya.Vector2();
  10568. speed.x = maxSpeed * linearPercent * sin;
  10569. speed.y = -maxSpeed * linearPercent * cos;
  10570. rigy.applyLinearImpulseToCenter(speed);
  10571. }
  10572. runBreakArmy() {
  10573. xGame.common.d2World.d2Gan.ui.visible = false;
  10574. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10575. let gameUI = xGame.common.gameUI.ui;
  10576. gameUI.skillRod.visible = true;
  10577. gameUI.skillRod.rotation = 110;
  10578. let outArr = this.getAllBallArr();
  10579. if (outArr.length <= 0) {
  10580. gameUI.skillRod.visible = false;
  10581. this.callback && this.callback(0);
  10582. return;
  10583. }
  10584. xGame.common.botherArr(outArr);
  10585. if (this.leveNum >= outArr.length)
  10586. this.leveNum = outArr.length;
  10587. let deleteNum = outArr.length - this.leveNum;
  10588. outArr.splice(0, deleteNum);
  10589. this.extraScore = this.leveNum;
  10590. let potX = gameUI.skillRod.x;
  10591. let potY = gameUI.skillRod.y;
  10592. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10593. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10594. let disArr = [];
  10595. for (let index = 0; index < outArr.length; index++) {
  10596. let obj = outArr[index];
  10597. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10598. dis = Math.pow(dis, 0.5);
  10599. disArr.push(dis);
  10600. }
  10601. this.tweenArr.push(gameUI.skillRod);
  10602. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10603. })).update = Laya.Handler.create(this, (e, t, c) => {
  10604. let angle = gameUI.skillRod.rotation;
  10605. let xx;
  10606. let yy;
  10607. let temp;
  10608. for (let index = 0; index < outArr.length; index++) {
  10609. temp = outArr[index];
  10610. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10611. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10612. yy -= 20;
  10613. temp.gameObj.x = xx;
  10614. temp.gameObj.y = yy;
  10615. temp.d3BallSrc.setTransPos(xx, yy);
  10616. }
  10617. if (angle <= 60) {
  10618. Laya.Tween.clearAll(gameUI.skillRod);
  10619. this.ballFlyToBag(outArr, 150);
  10620. gameUI.skillRod.visible = false;
  10621. }
  10622. }, null, false);
  10623. }
  10624. runIce() {
  10625. let ballArr = xGame.common.d2World.ballArr;
  10626. this.leveNum *= 2;
  10627. if (this.leveNum >= ballArr.length - 1)
  10628. this.leveNum = ballArr.length - 1;
  10629. let tempArr = [];
  10630. let outArr = [];
  10631. for (let index = 0; index < ballArr.length; index++) {
  10632. if (ballArr[index] instanceof D2RootBallSrc)
  10633. continue;
  10634. tempArr.push(ballArr[index]);
  10635. }
  10636. if (tempArr.length <= 0) {
  10637. this.callback && this.callback(0);
  10638. return;
  10639. }
  10640. xGame.common.botherArr(tempArr);
  10641. for (let index = 0; index < this.leveNum; index++) {
  10642. outArr.push(tempArr[index]);
  10643. }
  10644. this.extraScore = this.leveNum;
  10645. let temp;
  10646. for (let index = 0; index < outArr.length; index++) {
  10647. temp = outArr[index];
  10648. temp.d3BallSrc.playIceEft();
  10649. }
  10650. Laya.timer.once(2000, this, () => {
  10651. for (let index = 0; index < outArr.length; index++) {
  10652. temp = outArr[index];
  10653. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10654. temp.setBallFunc("ice", str);
  10655. }
  10656. this.callback && this.callback(0);
  10657. });
  10658. }
  10659. runFireworks() {
  10660. let allArr = this.getAllBallArr();
  10661. if (allArr.length <= 0) {
  10662. this.callback && this.callback(0);
  10663. return;
  10664. }
  10665. xGame.common.d2World.d2Gan.ui.visible = false;
  10666. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10667. let outArr = [];
  10668. let other = this.leveNum;
  10669. if (other > 0) {
  10670. if (allArr.length > 0) {
  10671. xGame.common.botherArr(allArr);
  10672. if (other >= allArr.length)
  10673. other = allArr.length;
  10674. for (let index = 0; index < other; index++) {
  10675. outArr.push(allArr[index]);
  10676. }
  10677. }
  10678. }
  10679. xGame.common.extraMoveNum = other;
  10680. this.extraScore = other;
  10681. this.addRandmomFireworks(outArr);
  10682. }
  10683. addRandmomFireworks(outArr) {
  10684. Laya.timer.once(1100, this, () => {
  10685. if (outArr.length > 0) {
  10686. xGame.common.d2World.openCheckStill = true;
  10687. this.playedLastSkill = true;
  10688. }
  10689. });
  10690. xGame.soundMgr.playSound("skill_04_02");
  10691. let temp;
  10692. let delay = -200;
  10693. for (let index = 0; index < outArr.length; index++) {
  10694. temp = outArr[index];
  10695. delay += 200;
  10696. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10697. let angle = xGame.common.randomNum(0, 360);
  10698. angle = this.getFireworksAngle(obj);
  10699. let linearPercent = xGame.common.randomNum(45, 80);
  10700. if (!obj.destroyed)
  10701. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10702. });
  10703. }
  10704. }
  10705. getFireworksAngle(obj) {
  10706. let rootBall = xGame.common.d2World.rootBall;
  10707. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10708. }
  10709. resetGame() {
  10710. Laya.timer.clearAll(this);
  10711. if (this.tweenArr) {
  10712. for (let index = 0; index < this.tweenArr.length; index++) {
  10713. Laya.Tween.clearAll(this.tweenArr[index]);
  10714. }
  10715. }
  10716. this.tweenArr = null;
  10717. }
  10718. runGuanYu() {
  10719. xGame.common.d2World.d2Gan.ui.visible = false;
  10720. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10721. let rootBall = xGame.common.d2World.rootBall;
  10722. if (rootBall.isInHole) {
  10723. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10724. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10725. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10726. rootBall.showSelf();
  10727. }
  10728. this.rtStarX = rootBall.gameObj.x;
  10729. this.rtStarY = rootBall.gameObj.y;
  10730. this.knifeTimes = 0;
  10731. this.playedLastSkill = true;
  10732. rootBall.forceRun = true;
  10733. rootBall.rigy.type = "static";
  10734. xGame.common.d2World.openCheckStill = true;
  10735. this.guanyuRandomKnife();
  10736. }
  10737. guanyuRandomKnife() {
  10738. let rootBall = xGame.common.d2World.rootBall;
  10739. let dir = this.getRandDir();
  10740. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10741. console.log("当前angle", angle);
  10742. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10743. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10744. let dis = 324;
  10745. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10746. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10747. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10748. this.rtStarX = rootBall.gameObj.x;
  10749. this.rtStarY = rootBall.gameObj.y;
  10750. this.knifeTimes++;
  10751. let skillLevel;
  10752. if (xGame.common.gameMgr.selfTurn) {
  10753. skillLevel = DataMgr.getBigSkillByIndex(4);
  10754. }
  10755. else {
  10756. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10757. }
  10758. if (!skillLevel)
  10759. skillLevel = 1;
  10760. skillLevel += 2;
  10761. if (this.knifeTimes < skillLevel) {
  10762. Laya.timer.once(400, this, () => {
  10763. this.guanyuRandomKnife();
  10764. });
  10765. }
  10766. else {
  10767. rootBall.forceRun = false;
  10768. rootBall.rigy.type = "dynamic";
  10769. xGame.common.extraMoveNum = skillLevel;
  10770. }
  10771. }));
  10772. }
  10773. getRandDir() {
  10774. let rootBall = xGame.common.d2World.rootBall;
  10775. let allBall = this.getAllBallArr();
  10776. let target = xGame.common.getRandArrEle(allBall);
  10777. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10778. return this.knifeV2;
  10779. }
  10780. cloneKnife(x, y, rotation) {
  10781. let parent = xGame.common.d3World.knifeRoot;
  10782. let prefab = xGame.common.d3World.knife;
  10783. let clone = prefab.clone();
  10784. parent.addChild(clone);
  10785. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10786. clone.transform.localPositionX = this.knifeV3.x;
  10787. clone.transform.localPositionY = 0;
  10788. clone.transform.localPositionZ = this.knifeV3.z;
  10789. clone.transform.localRotationEulerX = 0;
  10790. clone.transform.localRotationEulerY = rotation;
  10791. clone.transform.localRotationEulerZ = 0;
  10792. clone.active = true;
  10793. return clone;
  10794. }
  10795. cloneGuanYuEft(x, y, angle) {
  10796. return;
  10797. let parent = xGame.common.gameUI.ui.guanyuNode;
  10798. let eft = new ui_guanyuAni();
  10799. eft.parent = parent;
  10800. eft.x = x;
  10801. eft.y = y;
  10802. eft.rotation = angle;
  10803. }
  10804. }
  10805. class ui_UIWordsList extends fgui.GComponent {
  10806. static createInstance() {
  10807. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10808. }
  10809. onConstruct() {
  10810. this.c1 = this.getController("c1");
  10811. this.n74 = (this.getChild("n74"));
  10812. this.clickNode = (this.getChild("clickNode"));
  10813. this.myNode = (this.getChild("myNode"));
  10814. this.n68 = (this.getChild("n68"));
  10815. this.n66 = (this.getChild("n66"));
  10816. this.n55 = (this.getChild("n55"));
  10817. this.wordsBtn = (this.getChild("wordsBtn"));
  10818. this.emotionBtn = (this.getChild("emotionBtn"));
  10819. this.mybggg = (this.getChild("mybggg"));
  10820. this.wordsList = (this.getChild("wordsList"));
  10821. this.emotionList = (this.getChild("emotionList"));
  10822. this.myRoot = (this.getChild("myRoot"));
  10823. }
  10824. }
  10825. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10826. class EmotionDisplay {
  10827. constructor(index, ui) {
  10828. this.ui = ui;
  10829. this.index = index;
  10830. this.ui.onClick(this, this.clickSelf);
  10831. this.updateSelf();
  10832. }
  10833. updateSelf() {
  10834. let data = cfgTable.emotionData[this.index + 1];
  10835. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10836. }
  10837. clickSelf() {
  10838. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10839. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10840. xGame.common.talkMgr.closeTalkView();
  10841. }
  10842. }
  10843. class WordsDisplay {
  10844. constructor(index, ui) {
  10845. this.ui = ui;
  10846. this.index = index;
  10847. this.ui.onClick(this, this.clickSelf);
  10848. this.updateSelf();
  10849. }
  10850. updateSelf() {
  10851. let data = cfgTable.talkwordsData[this.index + 1];
  10852. this.ui.txt.text = data.msg;
  10853. }
  10854. clickSelf() {
  10855. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10856. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10857. xGame.common.talkMgr.closeTalkView();
  10858. }
  10859. }
  10860. class UIWordsList extends UIBase {
  10861. constructor() {
  10862. super();
  10863. }
  10864. onConstructor() {
  10865. this.ui = ui_UIWordsList.createInstance();
  10866. this.contentPane = this.ui;
  10867. this.isEject = false;
  10868. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10869. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10870. this.addUIClick(this.ui.clickNode, this.hide);
  10871. this.initTalkList();
  10872. this.initEmotionList();
  10873. }
  10874. show() {
  10875. super.show();
  10876. this.setGlobalFont(this.ui);
  10877. }
  10878. initTalkList() {
  10879. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10880. let data = cfgTable.talkwordsData;
  10881. let length = Object.keys(data).length;
  10882. this.ui.wordsList.numItems = length;
  10883. }
  10884. initEmotionList() {
  10885. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10886. let data = cfgTable.emotionData;
  10887. let length = Object.keys(data).length;
  10888. this.ui.emotionList.numItems = length;
  10889. }
  10890. renderTalkItem(index, obj) {
  10891. let temp = new WordsDisplay(index, obj);
  10892. }
  10893. renderEmotionItem(index, obj) {
  10894. let temp = new EmotionDisplay(index, obj);
  10895. }
  10896. openTalkList() {
  10897. this.ui.c1.selectedIndex = 0;
  10898. }
  10899. openEmotionList() {
  10900. this.ui.c1.selectedIndex = 1;
  10901. }
  10902. }
  10903. UIWordsList.uiName = "UIWordsList";
  10904. class TalkMgr {
  10905. constructor() {
  10906. this.aiSpeak = true;
  10907. this.emotionList = [];
  10908. this.talkList = [];
  10909. this.addEvent();
  10910. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10911. this.emotionList = [];
  10912. this.talkList = [];
  10913. for (let k in cfgTable.emotionData) {
  10914. this.emotionList.push(cfgTable.emotionData[k].id);
  10915. }
  10916. for (let k in cfgTable.talkwordsData) {
  10917. this.talkList.push(cfgTable.talkwordsData[k].id);
  10918. }
  10919. }
  10920. addEvent() {
  10921. let ui = xGame.common.gameUI.ui;
  10922. ui.wordsBtn.visible = true;
  10923. ui.wordsBtn.onClick(this, this.openTalkView);
  10924. ui.aiWordsBtn.visible = true;
  10925. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10926. }
  10927. openTalkView() {
  10928. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10929. xGame.uiMgr.Show(UIWordsList);
  10930. }
  10931. closeTalkView() {
  10932. xGame.uiMgr.Hide(UIWordsList);
  10933. }
  10934. clickAIState() {
  10935. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10936. this.aiSpeak = !this.aiSpeak;
  10937. this.changeAIState(this.aiSpeak);
  10938. }
  10939. changeAIState(speak) {
  10940. this.aiSpeak = speak;
  10941. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10942. if (speak) {
  10943. btn.c1.selectedIndex = 0;
  10944. }
  10945. else {
  10946. btn.c1.selectedIndex = 1;
  10947. }
  10948. }
  10949. showSelfTalk(wordsId) {
  10950. let ui = xGame.common.gameUI.ui;
  10951. ui.selfTalk.visible = true;
  10952. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10953. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10954. ui.selfTalk.t0.play();
  10955. }
  10956. showSelfEmotion(emotionId) {
  10957. let ui = xGame.common.gameUI.ui;
  10958. ui.selfTalk.visible = true;
  10959. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10960. this.selfSpine && this.selfSpine.dispose();
  10961. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10962. let spineData = cfgTable.emotionData[emotionId].spine;
  10963. this.selfSpine = new SpineMgr(spineData, () => {
  10964. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10965. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10966. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10967. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10968. });
  10969. ui.selfTalk.t0.play();
  10970. }
  10971. showAITalk(wordsId) {
  10972. if (!this.aiSpeak)
  10973. return;
  10974. if (DataMgr.gameData.gameCount < 2)
  10975. return;
  10976. if (wordsId < 1)
  10977. wordsId = this.getRandTalk();
  10978. let ui = xGame.common.gameUI.ui;
  10979. ui.aiTalk.visible = true;
  10980. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10981. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10982. ui.aiTalk.t0.play();
  10983. }
  10984. getRandTalk() {
  10985. let rand = xGame.tools.random(0, this.talkList.length);
  10986. return this.emotionList[rand];
  10987. }
  10988. getRandEmotion() {
  10989. let rand = xGame.tools.random(0, this.emotionList.length);
  10990. return this.emotionList[rand];
  10991. }
  10992. showAIEmotion(emotionId) {
  10993. if (!this.aiSpeak)
  10994. return;
  10995. if (DataMgr.gameData.gameCount < 2)
  10996. return;
  10997. if (emotionId < 1)
  10998. emotionId = this.getRandEmotion();
  10999. let ui = xGame.common.gameUI.ui;
  11000. ui.aiTalk.visible = true;
  11001. ui.aiTalk.myNode.c1.selectedIndex = 0;
  11002. this.aiSpine && this.aiSpine.dispose();
  11003. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11004. let spineData = cfgTable.emotionData[emotionId].spine;
  11005. this.aiSpine = new SpineMgr(spineData, () => {
  11006. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  11007. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  11008. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11009. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  11010. });
  11011. ui.aiTalk.t0.play();
  11012. }
  11013. resetGame() {
  11014. let ui = xGame.common.gameUI.ui;
  11015. ui.aiTalk.visible = false;
  11016. ui.selfTalk.visible = false;
  11017. this.aiSpine && this.aiSpine.dispose();
  11018. this.selfSpine && this.selfSpine.dispose();
  11019. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11020. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11021. this.closeTalkView();
  11022. }
  11023. }
  11024. class WordsMgr {
  11025. constructor() {
  11026. this.comboTimes = 1;
  11027. this.skillTimes = 0;
  11028. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11029. this.comboSpine = new SpineMgr("yxz_liangan");
  11030. this.skillSpine = new SpineMgr("yiganxqiu");
  11031. this.scoreSpine = new SpineMgr("defen");
  11032. }
  11033. setClassicCombo(isInterrupt) {
  11034. if (isInterrupt) {
  11035. this.comboTimes = 0;
  11036. }
  11037. }
  11038. playClassicWords(type, callback) {
  11039. this.callback = callback;
  11040. let aniIndex = type;
  11041. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11042. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11043. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11044. mySpine.destroy(true);
  11045. this.playClassicTimes();
  11046. });
  11047. }
  11048. playClassicTimes() {
  11049. this.comboTimes++;
  11050. if (this.comboTimes <= 1) {
  11051. this.callback && this.callback();
  11052. }
  11053. else {
  11054. let aniIndex = this.comboTimes - 1;
  11055. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11056. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11057. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11058. mySpine.destroy(true);
  11059. this.callback && this.callback();
  11060. });
  11061. }
  11062. }
  11063. playBigSkillTimes(times, callback) {
  11064. if (times <= 0) {
  11065. callback && callback();
  11066. return;
  11067. }
  11068. this.callback = callback;
  11069. let pre = "sz_0";
  11070. let aniIndex = 0;
  11071. this.getWordsImg(times, pre, () => {
  11072. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11073. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11074. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11075. let r1 = ``;
  11076. let r2 = ``;
  11077. if (times <= 9) {
  11078. r1 = `res/d2Res/${pre}${times}.png`;
  11079. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11080. aniIndex = 0;
  11081. }
  11082. else {
  11083. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11084. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11085. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11086. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11087. aniIndex = 1;
  11088. }
  11089. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11090. mySpine.destroy(true);
  11091. xGame.common.gameMgr.playSkillTips();
  11092. this.playScore(times);
  11093. xGame.common.playRandomMutiBallBigSkillSound();
  11094. }, mySpine);
  11095. });
  11096. }
  11097. playScore(score) {
  11098. let pre = "sz_";
  11099. let aniIndex = 0;
  11100. this.getWordsImg(score, pre, () => {
  11101. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11102. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11103. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11104. let r1 = ``;
  11105. let r2 = ``;
  11106. if (score <= 9) {
  11107. r1 = `res/d2Res/${pre}${score}.png`;
  11108. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11109. aniIndex = 0;
  11110. }
  11111. else {
  11112. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11113. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11114. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11115. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11116. aniIndex = 1;
  11117. }
  11118. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11119. mySpine.destroy(true);
  11120. this.callback && this.callback();
  11121. }, mySpine);
  11122. });
  11123. }
  11124. getWordsImg(number, pre = "", callback) {
  11125. let arr = [];
  11126. if (number <= 9) {
  11127. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11128. }
  11129. else {
  11130. 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 });
  11131. }
  11132. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11133. callback && callback();
  11134. }));
  11135. }
  11136. }
  11137. class ui_UIRodMethod extends fgui.GComponent {
  11138. static createInstance() {
  11139. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11140. }
  11141. onConstruct() {
  11142. this.n24 = (this.getChild("n24"));
  11143. this.white = (this.getChild("white"));
  11144. this.dot = (this.getChild("dot"));
  11145. this.sureBtn = (this.getChild("sureBtn"));
  11146. this.n20 = (this.getChild("n20"));
  11147. this.n21 = (this.getChild("n21"));
  11148. this.n22 = (this.getChild("n22"));
  11149. this.n23 = (this.getChild("n23"));
  11150. this.n5 = (this.getChild("n5"));
  11151. this.n14 = (this.getChild("n14"));
  11152. this.t0 = this.getTransition("t0");
  11153. }
  11154. }
  11155. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11156. class UIRodMethod extends UIBase {
  11157. constructor() {
  11158. super();
  11159. this.isPressd = false;
  11160. }
  11161. onConstructor() {
  11162. this.ui = ui_UIRodMethod.createInstance();
  11163. this.contentPane = this.ui;
  11164. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11165. this.moveDir = new Laya.Vector2();
  11166. this.moveDest = new Laya.Vector2();
  11167. this.centerPos = new Laya.Vector2();
  11168. xGame.common.uiRodMethod = this;
  11169. }
  11170. show() {
  11171. super.show();
  11172. xGame.common.gameMgr.gamePause = true;
  11173. this.openPressDotEvent();
  11174. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11175. this.centerPos.x = this.ui.white.x;
  11176. this.centerPos.y = this.ui.white.y;
  11177. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11178. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11179. this.setDot();
  11180. this.setGlobalFont(this.ui);
  11181. }
  11182. setDot() {
  11183. this.ui.dot.x = this.moveDest.x;
  11184. this.ui.dot.y = this.moveDest.y;
  11185. }
  11186. closeSelf() {
  11187. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11188. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11189. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11190. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11191. xGame.common.gameMgr.gamePause = false;
  11192. this.hide();
  11193. }
  11194. openPressDotEvent() {
  11195. this.closePressDotEvent();
  11196. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11197. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11198. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11199. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11200. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11201. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11202. }
  11203. closePressDotEvent() {
  11204. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11205. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11206. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11207. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11208. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11209. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11210. }
  11211. onDown(e) {
  11212. if (e.type == Laya.Event.MOUSE_DOWN)
  11213. this.isPressd = true;
  11214. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11215. this.isPressd = false;
  11216. if (!this.isPressd)
  11217. return;
  11218. this.moveDest.x = e.stageX;
  11219. this.moveDest.y = e.stageY;
  11220. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11221. if (dis > 6724) {
  11222. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11223. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11224. }
  11225. this.setDot();
  11226. }
  11227. resetRod() {
  11228. this.ui.dot.x = this.ui.white.x;
  11229. this.ui.dot.y = this.ui.white.y;
  11230. this.gameRod.dot.x = this.gameRod.bg.x;
  11231. this.gameRod.dot.y = this.gameRod.bg.y;
  11232. xGame.common.rodOffest.x = 0;
  11233. xGame.common.rodOffest.y = 0;
  11234. }
  11235. }
  11236. UIRodMethod.uiName = "UIRodMethod";
  11237. class UIGame extends UIBase {
  11238. constructor() {
  11239. super();
  11240. this.powerNum = 0;
  11241. this.isD3Inited = false;
  11242. this.isPrePlay = false;
  11243. this.isMoveRod = false;
  11244. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11245. this.rulerDis = 20;
  11246. this.rulerOffset = 0;
  11247. }
  11248. onConstructor() {
  11249. this.ui = ui_UIGame.createInstance();
  11250. this.contentPane = this.ui;
  11251. this.ui.x += xGame.common.sysOffestNum;
  11252. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11253. this.isEject = false;
  11254. xGame.common.gameUI = this;
  11255. this.initSelf();
  11256. }
  11257. isTurnSelf() {
  11258. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11259. return true;
  11260. }
  11261. }
  11262. initSelf() {
  11263. let topUI = this.ui.topNode;
  11264. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11265. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11266. this.barInfo = {};
  11267. this.barInfo.curY = 0;
  11268. this.barInfo.height = this.ui.powerNode.height;
  11269. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11270. this.barInfo.powerStartY = this.ui.powerNode.y;
  11271. xGame.common.aiPlayer = new AIPlayer();
  11272. xGame.common.gameMgr = new GameMgr();
  11273. xGame.common.skillMgr = new SkillMgr();
  11274. xGame.common.wordsMgr = new WordsMgr();
  11275. xGame.common.talkMgr = new TalkMgr();
  11276. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11277. });
  11278. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11279. });
  11280. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11281. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11282. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11283. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11284. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11285. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11286. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11287. }
  11288. getGanZiImg() {
  11289. let index = DataMgr.getCurBallRod();
  11290. let data = cfgTable.ballrodData[index + 1];
  11291. let gan_url = xGame.common.getGameIconUrl(data.img);
  11292. this.ui.powerNode.showImg.url = gan_url;
  11293. }
  11294. returnHome() {
  11295. let tips = "Are you sure to exit the game?";
  11296. let woman = "Boss, why don't you play for a while longer?";
  11297. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11298. }
  11299. addRodMethodClick() {
  11300. if (this.isTurnSelf()) {
  11301. xGame.uiMgr.Show(UIRodMethod);
  11302. }
  11303. }
  11304. clickHelpLineBtn(force = false) {
  11305. if (!this.isTurnSelf())
  11306. return;
  11307. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11308. if (success) {
  11309. xGame.common.longHelpLine = true;
  11310. xGame.common.d2World.getHelpLine();
  11311. Moyu.sendDataEvent("guideNum");
  11312. }
  11313. else {
  11314. }
  11315. });
  11316. }
  11317. renderSelfDisplayBalls(index, target) {
  11318. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11319. target.myImg.url = xGame.common.getGameIconUrl(str);
  11320. }
  11321. renderAIDisplayBalls(index, target) {
  11322. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11323. target.myImg.url = xGame.common.getGameIconUrl(str);
  11324. ;
  11325. }
  11326. updateMode() {
  11327. if (xGame.common.gameMode == GameMode.classic) {
  11328. this.ui.topNode.scoreNode.visible = false;
  11329. }
  11330. else if (xGame.common.gameMode == GameMode.bigMove) {
  11331. this.ui.topNode.scoreNode.visible = true;
  11332. }
  11333. }
  11334. show() {
  11335. super.show();
  11336. this.ui.alpha = 0;
  11337. this.updateSelf();
  11338. xGame.common.gameMgr.gamePause = false;
  11339. xGame.common.gameUI.ui.blackAni.visible = false;
  11340. xGame.common.gameUI.ui.whiteAni.visible = false;
  11341. this.ui.powerEft.visible = false;
  11342. this.ui.colorNode.visible = false;
  11343. this.updateHead();
  11344. let curUse = DataMgr.getCurBallRod();
  11345. this.getGanZiImg();
  11346. this.yinDaoForLianxi();
  11347. this.setGlobalFont(this.ui);
  11348. }
  11349. yinDaoForLianxi() {
  11350. let g = DataMgr.getSkillGuide();
  11351. if (g === 0) {
  11352. console.log('zh:默认的引导还没有完毕');
  11353. return;
  11354. }
  11355. let lianXiGuide = DataMgr.getLianXiGuide();
  11356. console.log('zh:lianXiGuide=', lianXiGuide);
  11357. if (lianXiGuide === 0) {
  11358. this.ui.n_lxms_yd1.visible = true;
  11359. console.log('zh:yinDaoForLianxi 111 set ok');
  11360. }
  11361. else {
  11362. this.ui.n_lxms_yd1.visible = false;
  11363. console.log('zh:无需引导11');
  11364. }
  11365. DataMgr.setLianXiGuide(0);
  11366. }
  11367. updateSelf() {
  11368. if (xGame.common.gameMode == GameMode.classic) {
  11369. this.ui.c1.selectedIndex = 0;
  11370. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11371. this.ui.topNode.middleNode.visible = true;
  11372. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11373. }
  11374. else if (xGame.common.gameMode == GameMode.bigMove) {
  11375. this.ui.c1.selectedIndex = 0;
  11376. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11377. this.ui.topNode.middleNode.visible = false;
  11378. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11379. let rand = xGame.common.randomNum(1, max);
  11380. let guide = DataMgr.getSkillGuide();
  11381. if (guide == 0)
  11382. rand = 1;
  11383. xGame.common.bigMoveLevelIndex = rand;
  11384. }
  11385. else if (xGame.common.gameMode == GameMode.placeBall) {
  11386. console.log('zh:练习模式...');
  11387. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11388. this.ui.c1.selectedIndex = 1 + data.type;
  11389. this.ui.alpha = 1;
  11390. this.startGame();
  11391. }
  11392. this.updateMode();
  11393. this.initD3world();
  11394. this.initD2world();
  11395. }
  11396. startGame() {
  11397. this.ui.snowNode.visible = Math.random() <= 0.1;
  11398. this.ui.d2Node.visible = false;
  11399. xGame.common.d3World.d3Hand.gameObj.active = false;
  11400. xGame.common.d3World.tableSrc.init();
  11401. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11402. this.cameraViewChange(() => {
  11403. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11404. switch (xGame.common.gameMode) {
  11405. case GameMode.classic:
  11406. xGame.common.d3World.d3Hand.gameObj.active = true;
  11407. this.playPutBallD3Ani();
  11408. break;
  11409. case GameMode.bigMove:
  11410. this.enterGame();
  11411. Laya.timer.once(500, this, () => {
  11412. this.ui.topNode.middleNode.visible = true;
  11413. this.ui.topNode.middleNode.t0.play();
  11414. });
  11415. break;
  11416. case GameMode.placeBall:
  11417. this.enterGame();
  11418. break;
  11419. default:
  11420. break;
  11421. }
  11422. });
  11423. PlatMgr.showBanner(false);
  11424. }
  11425. enterGame() {
  11426. this.ui.d2Node.visible = true;
  11427. xGame.common.d3World.d3Hand.gameObj.active = false;
  11428. xGame.common.showOneCamera("mainCamera");
  11429. Moyu.recordGame(30, true);
  11430. if (!this.isPrePlay) {
  11431. this.isPrePlay = true;
  11432. xGame.common.d3World.prePlayEft();
  11433. }
  11434. xGame.common.gameMgr.gameReady();
  11435. this.openAllEvent();
  11436. this.ui.snowNode.visible = false;
  11437. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11438. this.ui.helpBtn.visible = condition;
  11439. }
  11440. showHelpLineGuide() {
  11441. let longGuide = DataMgr.getGuideHelpLine();
  11442. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11443. this.ui.helpBtn.visible = true;
  11444. this.ui.guideNode.visible = true;
  11445. }
  11446. }
  11447. setTurnAlpha(alpha) {
  11448. this.ui.keduNode.alpha = alpha;
  11449. this.ui.ganNode.alpha = alpha;
  11450. this.ui.rodMethodNode.alpha = alpha;
  11451. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11452. }
  11453. cameraViewChange(callback) {
  11454. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11455. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11456. xGame.common.showOneCamera("visitAngle");
  11457. cameraSrc.localRotationEulerY = 180;
  11458. cameraSrc.localRotationEulerZ = 0;
  11459. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11460. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11461. callback && callback();
  11462. }));
  11463. }));
  11464. }
  11465. playPutBallD3Ani() {
  11466. xGame.common.showOneCamera("mainCamera");
  11467. let handSrc = xGame.common.d3World.d3Hand;
  11468. handSrc.gameObj.active = true;
  11469. handSrc.transform.localPositionZ = 3;
  11470. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11471. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11472. handSrc.gameObj.active = false;
  11473. this.enterGame();
  11474. }), 400);
  11475. }));
  11476. }
  11477. updateHead() {
  11478. let user = Moyu.getUserInfo();
  11479. this.ui.topNode.selfNameTxt.text = user.nickName;
  11480. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11481. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11482. if (DataMgr.getSkillGuide() < 1) {
  11483. this.ui.topNode.aiNameTxt.text = 'billiards';
  11484. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11485. }
  11486. else {
  11487. this.ui.topNode.aiNameTxt.text = aiData.name;
  11488. let randNo = Math.floor(Math.random() * 10) + 1;
  11489. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11490. }
  11491. }
  11492. initD2world() {
  11493. let node = this.ui.d2Root.displayObject;
  11494. let src = node.getComponent(D2World);
  11495. if (!src) {
  11496. xGame.common.d2World = node.addComponent(D2World);
  11497. }
  11498. xGame.common.d2World.initSelf();
  11499. }
  11500. initD3world() {
  11501. if (this.isD3Inited)
  11502. return;
  11503. this.isD3Inited = true;
  11504. let scene3D = xGame.common.d3Scene;
  11505. this.ui.d3Root.displayObject.addChild(scene3D);
  11506. scene3D.active = true;
  11507. xGame.common.d3World.tableSrc.setBorderPos();
  11508. }
  11509. onRootMove(e) {
  11510. let rootBall = xGame.common.d2World.rootBall;
  11511. this.ui.moveNode.x = e.x;
  11512. this.ui.moveNode.y = e.y;
  11513. rootBall.gameObj.x = e.x;
  11514. rootBall.gameObj.y = e.y;
  11515. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11516. }
  11517. aiRootMove(move) {
  11518. if (move)
  11519. this.hideBallUI();
  11520. else {
  11521. this.showBallUI();
  11522. xGame.common.d2World.getHelpLine();
  11523. }
  11524. }
  11525. aiForce(type, force = 0) {
  11526. this.pressTarget = PressType.powerNode;
  11527. if (type == 1)
  11528. this.onEventUp({ force: true });
  11529. else if (type == 2)
  11530. this.onEventMove({ stageY: force, force: true });
  11531. }
  11532. onEventPress(e) {
  11533. if (e.stopPropagation)
  11534. e.stopPropagation();
  11535. if (!this.isTurnSelf())
  11536. return;
  11537. let target = e.target;
  11538. switch (target) {
  11539. case this.ui.myPowerNode.displayObject:
  11540. this.pressTarget = PressType.powerNode;
  11541. this.barInfo.curY = e.stageY;
  11542. this.updateBarInfo();
  11543. break;
  11544. case this.ui.moveNode.displayObject:
  11545. this.pressTarget = PressType.moveNode;
  11546. this.hideBallUI();
  11547. this.eventObj.curX = this.ui.moveNode.x;
  11548. this.eventObj.curY = this.ui.moveNode.y;
  11549. this.ui.moveNode.finger.visible = false;
  11550. this.eventObj.lastX = e.stageX;
  11551. this.eventObj.lastY = e.stageY;
  11552. break;
  11553. case this.ui.rulerClickNode.displayObject:
  11554. this.pressTarget = PressType.rulerNode;
  11555. this.eventObj.lastY = e.stageY;
  11556. break;
  11557. case this.ui.d2Root.displayObject:
  11558. this.pressTarget = PressType.d2Root;
  11559. this.eventObj.lastX = e.stageX;
  11560. this.eventObj.lastY = e.stageY;
  11561. this.eventObj.starX = e.stageX;
  11562. this.eventObj.starY = e.stageY;
  11563. this.eventObj.curX = 0;
  11564. this.eventObj.curY = 0;
  11565. xGame.common.d2World.d2Gan.setGanLastInfo();
  11566. this.rulerOffset = 0;
  11567. break;
  11568. default:
  11569. break;
  11570. }
  11571. }
  11572. onEventMove(e) {
  11573. if (e.stopPropagation)
  11574. e.stopPropagation();
  11575. if (e && e.force) {
  11576. }
  11577. else {
  11578. if (!this.isTurnSelf())
  11579. return;
  11580. }
  11581. switch (this.pressTarget) {
  11582. case PressType.powerNode:
  11583. this.barInfo.curY = e.stageY;
  11584. this.updateBarInfo();
  11585. this.isMoveRod = true;
  11586. break;
  11587. case PressType.moveNode:
  11588. let rootBall = xGame.common.d2World.rootBall;
  11589. let radius = rootBall.gameObj.width / 2;
  11590. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11591. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11592. let border = xGame.common.d2World.borderRect;
  11593. if (curX <= border.x + radius)
  11594. curX = border.x + radius;
  11595. else if (curX >= border.x + border.width - radius)
  11596. curX = border.x + border.width - radius;
  11597. if (curY <= border.y + radius)
  11598. curY = border.y + radius;
  11599. else if (curY >= border.y + border.height - radius)
  11600. curY = border.y + border.height - radius;
  11601. if (xGame.common.gameMgr.isOpenBall) {
  11602. if (curX >= border.x + border.openBallW - radius)
  11603. curX = border.x + border.openBallW - radius;
  11604. }
  11605. this.ui.moveNode.x = curX;
  11606. this.ui.moveNode.y = curY;
  11607. rootBall.gameObj.x = curX;
  11608. rootBall.gameObj.y = curY;
  11609. rootBall.d3BallSrc.setTransPos(curX, curY);
  11610. this.isMoveRod = true;
  11611. break;
  11612. case PressType.rulerNode:
  11613. let yy = e.stageY - this.eventObj.lastY;
  11614. this.eventObj.lastY = e.stageY;
  11615. let ruler1 = this.ui.rulerNode.img1;
  11616. let ruler2 = this.ui.rulerNode.img2;
  11617. ruler1.y += yy;
  11618. ruler2.y += yy;
  11619. this.rulerOffset += yy;
  11620. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11621. this.rulerOffset = 0;
  11622. xGame.soundMgr.playSound("inch", 1, 10);
  11623. }
  11624. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11625. let h = ruler1.height;
  11626. this.checkGuide();
  11627. this.checkGuideForLxms();
  11628. this.isMoveRod = true;
  11629. if (ruler1.y >= h) {
  11630. ruler1.y = -h;
  11631. ruler2.y = 0;
  11632. return;
  11633. }
  11634. else if (ruler1.y <= -h) {
  11635. ruler1.y = h;
  11636. ruler2.y = 0;
  11637. return;
  11638. }
  11639. if (ruler2.y >= h) {
  11640. ruler2.y = -h;
  11641. ruler1.y = 0;
  11642. return;
  11643. }
  11644. else if (ruler2.y <= -h) {
  11645. ruler2.y = h;
  11646. ruler1.y = 0;
  11647. return;
  11648. }
  11649. break;
  11650. case PressType.d2Root:
  11651. this.eventObj.curX = e.stageX;
  11652. this.eventObj.curY = e.stageY;
  11653. let offset = this.checkRodMoveDir();
  11654. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11655. this.eventObj.lastX = e.stageX;
  11656. this.eventObj.lastY = e.stageY;
  11657. break;
  11658. default:
  11659. break;
  11660. }
  11661. }
  11662. onEventUp(e) {
  11663. if (e.stopPropagation)
  11664. e.stopPropagation();
  11665. if (e && e.force) {
  11666. }
  11667. else {
  11668. if (!this.isTurnSelf())
  11669. return;
  11670. }
  11671. switch (this.pressTarget) {
  11672. case PressType.powerNode:
  11673. this.ui.powerNode.value = 0;
  11674. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11675. this.ui.powerTxt.text = "";
  11676. if (this.powerNum > 0) {
  11677. xGame.eventMgr.event(BALL_SHOOT);
  11678. xGame.common.d2World.shoot(this.powerNum);
  11679. xGame.common.d2World.d2Gan.shoot();
  11680. xGame.common.d2World.d2HelpLine.shoot();
  11681. this.finishGuide();
  11682. this.finishGuideForLxms();
  11683. this.ui.powerEft.visible = false;
  11684. this.ui.colorNode.visible = false;
  11685. let ganStr = "";
  11686. if (this.powerNum <= 30) {
  11687. ganStr = "gan_30";
  11688. }
  11689. else if (this.powerNum <= 60) {
  11690. ganStr = "gan_50";
  11691. }
  11692. else {
  11693. ganStr = "gan_80";
  11694. }
  11695. xGame.soundMgr.playSound(ganStr);
  11696. }
  11697. break;
  11698. case PressType.moveNode:
  11699. let rootBall = xGame.common.d2World.rootBall;
  11700. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11701. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11702. let isIntersect = this.judgeBallIntersect();
  11703. if (isIntersect) {
  11704. this.ui.moveNode.x = lastX;
  11705. this.ui.moveNode.y = lastY;
  11706. rootBall.gameObj.x = lastX;
  11707. rootBall.gameObj.y = lastY;
  11708. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11709. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11710. }
  11711. else {
  11712. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11713. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11714. }
  11715. this.showBallUI();
  11716. this.ui.moveNode.finger.visible = true;
  11717. xGame.common.d2World.getHelpLine();
  11718. break;
  11719. case PressType.rulerNode:
  11720. break;
  11721. case PressType.d2Root:
  11722. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11723. if (dis <= 25) {
  11724. this.moveToClickDot(e);
  11725. }
  11726. break;
  11727. default:
  11728. break;
  11729. }
  11730. this.pressTarget = -1;
  11731. }
  11732. checkGuide() {
  11733. let guide = DataMgr.getSkillGuide();
  11734. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11735. xGame.common.guideStep++;
  11736. xGame.common.gameUI.ui.guide2.visible = false;
  11737. xGame.common.gameUI.ui.guide3.visible = true;
  11738. }
  11739. }
  11740. checkGuideForLxms() {
  11741. let guide = DataMgr.getLianXiGuide();
  11742. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 2) {
  11743. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  11744. xGame.common.gameUI.ui.n_lxms_yd3.visible = true;
  11745. xGame.common.guideStepForLianXi = 3;
  11746. }
  11747. }
  11748. finishGuide() {
  11749. let guide = DataMgr.getSkillGuide();
  11750. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11751. xGame.common.guideStep = 10;
  11752. this.closeAllGuide();
  11753. console.log('zh: 新手引导完毕');
  11754. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11755. }
  11756. }
  11757. finishGuideForLxms() {
  11758. let guide = DataMgr.getLianXiGuide();
  11759. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  11760. xGame.common.guideStepForLianXi = 3;
  11761. DataMgr.setLianXiGuide(1);
  11762. this.closeAllGuideForLxms();
  11763. console.log('zh: lxms新手引导完毕');
  11764. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11765. }
  11766. }
  11767. closeAllGuide() {
  11768. xGame.common.gameUI.ui.guide1.visible = false;
  11769. xGame.common.gameUI.ui.guide2.visible = false;
  11770. xGame.common.gameUI.ui.guide3.visible = false;
  11771. }
  11772. closeAllGuideForLxms() {
  11773. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  11774. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  11775. xGame.common.gameUI.ui.n_lxms_yd3.visible = false;
  11776. }
  11777. updateBarInfo() {
  11778. let star = this.ui.powerNode.y;
  11779. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11780. if (rate >= 1)
  11781. rate = 1;
  11782. if (rate <= 0)
  11783. rate = 0;
  11784. this.powerNum = Math.ceil(rate * 100);
  11785. this.ui.powerNode.value = this.powerNum;
  11786. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11787. this.ui.colorNode.value = this.powerNum;
  11788. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11789. this.ui.powerEft.visible = this.powerNum != 0;
  11790. this.ui.colorNode.visible = this.powerNum != 0;
  11791. this.ui.powerTxt.text = this.powerNum + "";
  11792. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11793. }
  11794. forceCancel() {
  11795. this.ui.powerNode.value = 0;
  11796. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11797. this.ui.powerTxt.text = "";
  11798. }
  11799. checkRodMoveDir() {
  11800. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11801. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11802. if (tempX >= 0 && tempY <= 0) {
  11803. return this.checkDir();
  11804. }
  11805. else if (tempX < 0 && tempY < 0) {
  11806. return this.checkDir(1, -1);
  11807. }
  11808. else if (tempX < 0 && tempY > 0) {
  11809. return this.checkDir(-1, -1);
  11810. }
  11811. else {
  11812. return this.checkDir(-1, 1);
  11813. }
  11814. }
  11815. checkDir(flagX = 1, flagY = 1) {
  11816. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11817. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11818. if (offsetY == 0) {
  11819. return offsetX * flagX;
  11820. }
  11821. if (offsetX == 0) {
  11822. return offsetY * flagY;
  11823. }
  11824. let angle = offsetY / offsetX;
  11825. if (Math.abs(angle) >= 1) {
  11826. return offsetY * flagY;
  11827. }
  11828. else {
  11829. return offsetX * flagX;
  11830. }
  11831. }
  11832. judgeBallIntersect() {
  11833. let rootBall = xGame.common.d2World.rootBall;
  11834. let ballArr = xGame.common.d2World.ballArr;
  11835. let radius = rootBall.gameObj.width / 2;
  11836. let temp;
  11837. let isIntersect = false;
  11838. for (let index = 0; index < ballArr.length; index++) {
  11839. temp = ballArr[index];
  11840. if (temp.number == rootBall.number)
  11841. continue;
  11842. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11843. if (isIntersect) {
  11844. break;
  11845. }
  11846. }
  11847. return isIntersect;
  11848. }
  11849. hideBallUI() {
  11850. let d2Gan = xGame.common.d2World.d2Gan;
  11851. if (!d2Gan.ui.isDisposed)
  11852. d2Gan.ui.visible = false;
  11853. let d2Help = xGame.common.d2World.d2HelpLine;
  11854. if (!d2Help.ui.isDisposed)
  11855. d2Help.ui.visible = false;
  11856. let rootBall = xGame.common.d2World.rootBall;
  11857. if (!rootBall.destroyed) {
  11858. rootBall.gameObj.active = false;
  11859. }
  11860. }
  11861. showBallUI() {
  11862. let d2Gan = xGame.common.d2World.d2Gan;
  11863. if (!d2Gan.ui.isDisposed)
  11864. d2Gan.ui.visible = true;
  11865. let d2Help = xGame.common.d2World.d2HelpLine;
  11866. if (!d2Help.ui.isDisposed)
  11867. d2Help.ui.visible = true;
  11868. let rootBall = xGame.common.d2World.rootBall;
  11869. if (!rootBall.destroyed) {
  11870. rootBall.gameObj.active = true;
  11871. }
  11872. }
  11873. moveToClickDot(e) {
  11874. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11875. let root = xGame.common.d2World.rootBall.gameObj;
  11876. let xx = e.stageX - xGame.common.sysOffestNum;
  11877. let yy = e.stageY;
  11878. let x = xx - root.x;
  11879. let y = yy - root.y;
  11880. let angle = xGame.common.getfguiRotation(x, y);
  11881. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11882. xGame.common.d2World.getHelpLine();
  11883. }
  11884. this.isMoveRod = false;
  11885. xGame.common.clickedBall = false;
  11886. }
  11887. openAllEvent() {
  11888. this.closeAllEvent();
  11889. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11890. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11891. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11892. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11893. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11894. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11895. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11896. }
  11897. closeAllEvent() {
  11898. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11899. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11900. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11901. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11902. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11903. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11904. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11905. }
  11906. resetGame() {
  11907. this.closeAllEvent();
  11908. this.hideBallUI();
  11909. xGame.common.gameMgr.gamePause = true;
  11910. }
  11911. }
  11912. UIGame.uiName = "UIGame";
  11913. class UIAddProp extends UIBase {
  11914. constructor() {
  11915. super();
  11916. this.curType = "";
  11917. }
  11918. onConstructor() {
  11919. this.ui = ui_UIAddProp.createInstance();
  11920. this.contentPane = this.ui;
  11921. this.isEject = false;
  11922. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11923. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11924. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11925. this.updateUI();
  11926. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11927. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11928. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11929. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11930. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11931. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11932. }
  11933. show(type) {
  11934. super.show();
  11935. this.curType = type == 0 ? "coin" : "diamond";
  11936. this.switchBtn("");
  11937. this.ui.t0.play();
  11938. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11939. PlatMgr.showInsert(true);
  11940. this.setGlobalFont(this.ui);
  11941. }
  11942. closeSelf() {
  11943. this.hide();
  11944. }
  11945. updateUI() {
  11946. let data = cfgTable.moneyData;
  11947. let temp;
  11948. let obj;
  11949. for (const key in data) {
  11950. temp = data[key];
  11951. obj = this.ui.myNode["node" + key];
  11952. if (parseInt(key) <= 2) {
  11953. obj.diamondTxt.text = "+" + temp.num;
  11954. }
  11955. else {
  11956. obj.coinTxt.text = temp.num;
  11957. obj.diamondTxt.text = temp.get.split('_')[1];
  11958. }
  11959. }
  11960. this.updateDiamondShare();
  11961. }
  11962. updateDiamondShare() {
  11963. let data = DataMgr.getShareDiamondTimes();
  11964. if (data >= xGame.common.maxShareDiamondTimes) {
  11965. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11966. this.ui.myNode.node1.touchable = false;
  11967. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11968. }
  11969. else {
  11970. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11971. this.ui.myNode.node1.touchable = true;
  11972. }
  11973. }
  11974. switchBtn(type) {
  11975. if (type == "")
  11976. type = this.curType;
  11977. else {
  11978. if (this.curType == type) {
  11979. return;
  11980. }
  11981. else {
  11982. this.curType = type;
  11983. }
  11984. }
  11985. if (type == "coin") {
  11986. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11987. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11988. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11989. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11990. this.ui.myNode.c1.selectedIndex = 0;
  11991. }
  11992. else {
  11993. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11994. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11995. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11996. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11997. this.ui.myNode.c1.selectedIndex = 1;
  11998. }
  11999. }
  12000. convertCoin(index) {
  12001. let data = cfgTable.moneyData[index];
  12002. let coinNum = data.num;
  12003. let str = data.get.split('_')[1];
  12004. let needDiamond = parseInt(str);
  12005. if (DataMgr.diamondEnough(needDiamond)) {
  12006. DataMgr.setDiamond(-needDiamond);
  12007. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  12008. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  12009. }
  12010. else {
  12011. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  12012. this.switchBtn("diamond");
  12013. }
  12014. }
  12015. videoGetDiamond() {
  12016. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  12017. if (Laya.Browser.onAndroid) {
  12018. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12019. if (!boo) {
  12020. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12021. return;
  12022. }
  12023. }
  12024. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  12025. }
  12026. else {
  12027. console.log('zh:AD 失败,直接发放奖励');
  12028. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  12029. }
  12030. }
  12031. qjff_AD_for_uiAddProp_videoGetDiamond() {
  12032. let num = cfgTable.moneyData[2].num;
  12033. xGame.common.playObjFlyAnim(num, Prop.diamond);
  12034. this.closeSelf();
  12035. }
  12036. videoGetCoin() {
  12037. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  12038. if (Laya.Browser.onAndroid) {
  12039. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12040. if (!boo) {
  12041. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12042. return;
  12043. }
  12044. }
  12045. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  12046. }
  12047. else {
  12048. console.log('zh:AD 失败,直接发放奖励');
  12049. this.qjff_AD_for_uiAddProp_videoGetCoin();
  12050. }
  12051. }
  12052. qjff_AD_for_uiAddProp_videoGetCoin() {
  12053. xGame.common.playObjFlyAnim(2000, Prop.coin);
  12054. this.closeSelf();
  12055. }
  12056. shareGetDiamond() {
  12057. let times = DataMgr.getShareDiamondTimes();
  12058. if (times >= xGame.common.maxShareDiamondTimes) {
  12059. console.log('zh: 233333333333 maxShareDiamondTimes');
  12060. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12061. }
  12062. else {
  12063. console.log('zh:33333333333333ad');
  12064. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  12065. if (Laya.Browser.onAndroid) {
  12066. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12067. if (!boo) {
  12068. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12069. return;
  12070. }
  12071. }
  12072. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12073. }
  12074. else {
  12075. console.log('zh:AD 失败,直接发放奖励');
  12076. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12077. }
  12078. }
  12079. }
  12080. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12081. let diamond = xGame.common.randomNum(50, 100);
  12082. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12083. DataMgr.setShareDiamondTimes(1);
  12084. this.updateDiamondShare();
  12085. }
  12086. openPutBallView() {
  12087. let end = xGame.uiMgr.getUI(UIGameEnd);
  12088. let skill = xGame.uiMgr.getUI(UISkill);
  12089. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12090. let uigame = xGame.uiMgr.getUI(UIGame);
  12091. if (end && !end.isHide) {
  12092. xGame.uiMgr.Hide(UIGameEnd);
  12093. xGame.uiMgr.Show(UIMain);
  12094. }
  12095. if (skill && !skill.isHide)
  12096. xGame.uiMgr.Hide(UISkill);
  12097. if (uigame && !uigame.isHide)
  12098. xGame.uiMgr.Hide(UIGame);
  12099. if (level && !level.isHide) {
  12100. }
  12101. else {
  12102. xGame.uiMgr.Show(UILevelDisplay);
  12103. }
  12104. this.closeSelf();
  12105. }
  12106. }
  12107. UIAddProp.uiName = "UIAddProp";
  12108. class MoneyNode {
  12109. constructor(ui) {
  12110. this.leftTime = 0;
  12111. this.ui = ui;
  12112. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12113. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12114. this.ui.addPowerBtn.onClick(this, this.addPower);
  12115. this.ui.c1.selectedIndex = 1;
  12116. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12117. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12118. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12119. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12120. this.coinChange();
  12121. this.diamondChange();
  12122. this.powerChange();
  12123. }
  12124. addPower() {
  12125. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12126. xGame.uiMgr.Show(UIPower);
  12127. }
  12128. powerChange() {
  12129. let powerNum = DataMgr.getPower();
  12130. this.ui.powerTxt.text = powerNum + "";
  12131. }
  12132. checkPowerTime() {
  12133. let cur = new Date().getTime();
  12134. let last = DataMgr.getPowerTime();
  12135. if (last == 0) {
  12136. last = cur;
  12137. DataMgr.setPowerTime(cur);
  12138. }
  12139. let power = DataMgr.getPower();
  12140. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12141. Laya.timer.clearAll(this);
  12142. if (power >= xGame.common.natureMaxPower) {
  12143. this.ui.powerTimeTxt.text = "";
  12144. DataMgr.setPowerTime(cur);
  12145. return;
  12146. }
  12147. if (power + offset >= xGame.common.natureMaxPower) {
  12148. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12149. this.ui.powerTimeTxt.text = "";
  12150. DataMgr.setPowerTime(cur);
  12151. }
  12152. else {
  12153. if (offset > 0) {
  12154. DataMgr.setPower(offset);
  12155. DataMgr.setPowerTime(cur);
  12156. }
  12157. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12158. this.leftTime = xGame.common.powerRecoverNum - time;
  12159. if (this.leftTime <= 0)
  12160. this.leftTime = 0;
  12161. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12162. Laya.timer.loop(1000, this, this.updatePowerTime);
  12163. }
  12164. }
  12165. updatePowerTime() {
  12166. this.leftTime -= 1;
  12167. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12168. if (this.leftTime <= 0) {
  12169. this.checkPowerTime();
  12170. }
  12171. }
  12172. coinChange() {
  12173. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12174. }
  12175. diamondChange() {
  12176. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12177. }
  12178. addCoin() {
  12179. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12180. Moyu.sendDataEvent("AddCoinBtn");
  12181. xGame.uiMgr.Show(UIAddProp, 0);
  12182. }
  12183. addDiamond() {
  12184. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12185. Moyu.sendDataEvent("AddDiamondBtn");
  12186. xGame.uiMgr.Show(UIAddProp, 1);
  12187. }
  12188. }
  12189. class UIDraw extends UIBase {
  12190. constructor() {
  12191. super();
  12192. this.curKey = 0;
  12193. }
  12194. onConstructor() {
  12195. this.ui = ui_UIDraw.createInstance();
  12196. this.contentPane = this.ui;
  12197. this.isEject = false;
  12198. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12199. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12200. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12201. this.initDraw();
  12202. this.initUI();
  12203. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12204. }
  12205. show() {
  12206. super.show();
  12207. this.ui.t0.play();
  12208. this.playSecretaryIdle();
  12209. this.updateDraw();
  12210. this.checkFree();
  12211. if (PlatMgr.bannerDelay > 0) {
  12212. this.ui.closeNode.closeBtn.visible = false;
  12213. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12214. this.ui.closeNode.closeBtn.visible = true;
  12215. });
  12216. }
  12217. PlatMgr.showRateBanner();
  12218. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12219. this.setGlobalFont(this.ui);
  12220. }
  12221. hide() {
  12222. Laya.timer.clearAll(this);
  12223. super.hide();
  12224. }
  12225. checkFree() {
  12226. let isFree = DataMgr.getDailyfreeDrawTimes();
  12227. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12228. }
  12229. initDraw() {
  12230. this.drawObj = [];
  12231. let data = cfgTable.drawData;
  12232. let temp;
  12233. let weight = 0;
  12234. for (const key in data) {
  12235. temp = data[key];
  12236. weight += temp.weight;
  12237. this.drawObj.push(weight);
  12238. }
  12239. this.allWeight = weight;
  12240. }
  12241. initUI() {
  12242. let data = cfgTable.drawData;
  12243. let temp;
  12244. let img;
  12245. let txt;
  12246. for (const key in data) {
  12247. temp = data[key];
  12248. img = this.ui.myNode.rotNode["img" + key];
  12249. txt = this.ui.myNode.rotNode["txt" + key];
  12250. img.url = xGame.common.getGameIconUrl(temp.icon);
  12251. txt.visible = true;
  12252. if (temp.award > 2) {
  12253. img.rotation = 0;
  12254. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12255. }
  12256. else {
  12257. img.rotation = temp.rotation;
  12258. txt.text = temp.num;
  12259. }
  12260. }
  12261. }
  12262. getCurkey() {
  12263. let rand = Math.random() * this.allWeight;
  12264. let temp;
  12265. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12266. temp = this.drawObj[index];
  12267. if (index == 0) {
  12268. if (rand < temp) {
  12269. return index + 1;
  12270. }
  12271. }
  12272. else {
  12273. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12274. return index + 1;
  12275. }
  12276. }
  12277. }
  12278. return 2;
  12279. }
  12280. startDraw() {
  12281. console.log('zh:开始抽奖');
  12282. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12283. if (freeTimes > 0) {
  12284. console.log('zh:freeTimes=' + freeTimes);
  12285. this.beginDraw();
  12286. DataMgr.setDailyfreeDrawTimes(0);
  12287. this.checkFree();
  12288. }
  12289. else {
  12290. if (Laya.Browser.onAndroid) {
  12291. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12292. if (!boo) {
  12293. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12294. return;
  12295. }
  12296. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12297. }
  12298. else {
  12299. console.log('zh:AD 失败,直接发放奖励');
  12300. this.qjff_chouJiang();
  12301. }
  12302. }
  12303. else {
  12304. this.qjff_chouJiang();
  12305. }
  12306. }
  12307. }
  12308. qjff_chouJiang() {
  12309. this.beginDraw();
  12310. }
  12311. beginDraw() {
  12312. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12313. this.ui.drawBtn.touchable = false;
  12314. this.curKey = this.getCurkey();
  12315. console.log("zh:当前key", this.curKey);
  12316. let cell = 60;
  12317. let lap = 3;
  12318. let angle = cell * (this.curKey - 1) + lap * 360;
  12319. let target = this.ui.myNode.rotNode;
  12320. target.rotation = 0;
  12321. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12322. console.log("zh:旋转完成");
  12323. this.ui.drawBtn.touchable = true;
  12324. this.getAward();
  12325. }));
  12326. }
  12327. getAward() {
  12328. let data = cfgTable.drawData[this.curKey];
  12329. let temp = new AwardType();
  12330. temp.type = data.award;
  12331. temp.num = data.num;
  12332. xGame.common.getAward([temp], () => {
  12333. DataMgr.setDrawTimes(1);
  12334. this.updateDraw();
  12335. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12336. });
  12337. }
  12338. updateDraw() {
  12339. let drawTimes = DataMgr.getDrawTimes();
  12340. let awardTimes = DataMgr.getDrawAwardTimes();
  12341. if (Math.floor(drawTimes / 3) > awardTimes) {
  12342. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12343. this.ui.extraNode.boxBtn.touchable = true;
  12344. this.ui.extraNode.tipsTxt.text = "3/3";
  12345. this.ui.extraNode.barNode.width = 265;
  12346. this.getExtraAward();
  12347. }
  12348. else {
  12349. this.ui.extraNode.boxBtn.t0.stop();
  12350. this.ui.extraNode.boxBtn.touchable = false;
  12351. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12352. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12353. }
  12354. let data = cfgTable.drawData[1];
  12355. if (awardTimes == 0) {
  12356. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12357. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12358. this.ui.myNode.rotNode.img1.rotation = 0;
  12359. }
  12360. else {
  12361. let award = data.nextid;
  12362. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12363. this.ui.myNode.rotNode.txt1.text = award[1];
  12364. this.ui.myNode.rotNode.img1.rotation = 0;
  12365. }
  12366. }
  12367. getExtraAward() {
  12368. let drawTimes = DataMgr.getDrawTimes();
  12369. let awardTimes = DataMgr.getDrawAwardTimes();
  12370. let data = cfgTable.drawData[1];
  12371. let award = new AwardType();
  12372. if (awardTimes == 0) {
  12373. award.num = data.num;
  12374. award.type = data.award;
  12375. xGame.common.getAward([award], () => {
  12376. let all = Math.floor(drawTimes / 3);
  12377. DataMgr.setDrawAwardTimes(all);
  12378. this.updateDraw();
  12379. });
  12380. }
  12381. else {
  12382. award.num = parseInt(data.nextid[1]);
  12383. award.type = parseInt(data.nextid[0]);
  12384. xGame.common.getAward([award], () => {
  12385. let all = Math.floor(drawTimes / 3);
  12386. DataMgr.setDrawAwardTimes(all);
  12387. this.updateDraw();
  12388. });
  12389. }
  12390. }
  12391. closeSelf() {
  12392. this.hide();
  12393. }
  12394. playSecretaryIdle() {
  12395. let parent = this.ui.secretary.displayObject;
  12396. parent.destroyChildren();
  12397. let xx = this.ui.secretary.width / 2;
  12398. let yy = this.ui.secretary.height;
  12399. let scale = xGame.common.getSecretaryScale();
  12400. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12401. xGame.common.secretary.play(data, 0, true, parent);
  12402. }
  12403. }
  12404. UIDraw.uiName = "UIDraw";
  12405. class ui_UIFlyEft extends fgui.GComponent {
  12406. static createInstance() {
  12407. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12408. }
  12409. onConstruct() {
  12410. this.n0 = (this.getChild("n0"));
  12411. this.n1 = (this.getChild("n1"));
  12412. this.n2 = (this.getChild("n2"));
  12413. this.n3 = (this.getChild("n3"));
  12414. this.n4 = (this.getChild("n4"));
  12415. this.n5 = (this.getChild("n5"));
  12416. this.n6 = (this.getChild("n6"));
  12417. this.n7 = (this.getChild("n7"));
  12418. this.iconNode = (this.getChild("iconNode"));
  12419. this.txt = (this.getChild("txt"));
  12420. this.txtNode = (this.getChild("txtNode"));
  12421. }
  12422. }
  12423. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12424. class UIFlyEft extends UIBase {
  12425. constructor() {
  12426. super();
  12427. this.max = 8;
  12428. this.delay = 0;
  12429. }
  12430. onConstructor() {
  12431. this.ui = ui_UIFlyEft.createInstance();
  12432. this.contentPane = this.ui;
  12433. this.isEject = false;
  12434. this.isMuti = true;
  12435. this.ui.x += xGame.common.sysOffestNum;
  12436. }
  12437. getArrPos() {
  12438. if (this.iconPos && this.iconPos.length > 0)
  12439. return;
  12440. this.iconPos = [];
  12441. let temp;
  12442. for (let index = 0; index < this.max; index++) {
  12443. temp = this.ui["n" + index];
  12444. this.iconPos.push([temp.x, temp.y]);
  12445. }
  12446. }
  12447. show(stPos, edPos, num, type, callback) {
  12448. super.show();
  12449. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12450. this.getArrPos();
  12451. this.updateUI(type);
  12452. this.updatePos();
  12453. this.runFly(edPos, callback);
  12454. this.runWorlds(stPos, num);
  12455. this.setGlobalFont(this.ui);
  12456. }
  12457. updateUI(type) {
  12458. let temp;
  12459. let str;
  12460. for (let index = 0; index < this.max; index++) {
  12461. temp = this.ui["n" + index];
  12462. str = this.getIconStr(type);
  12463. temp.url = xGame.common.getGameIconUrl(str);
  12464. }
  12465. }
  12466. getIconStr(type) {
  12467. switch (type) {
  12468. case Prop.diamond:
  12469. return "ty_zs";
  12470. case Prop.coin:
  12471. return "ty_jb";
  12472. default:
  12473. break;
  12474. }
  12475. }
  12476. updatePos() {
  12477. let temp;
  12478. for (let index = 0; index < this.max; index++) {
  12479. temp = this.ui["n" + index];
  12480. temp.x = this.iconPos[index][0];
  12481. temp.y = this.iconPos[index][1];
  12482. }
  12483. }
  12484. runFly(endPos, callback) {
  12485. let all = 0;
  12486. let temp;
  12487. for (let index = 0; index < this.max; index++) {
  12488. temp = this.ui["n" + index];
  12489. temp.visible = true;
  12490. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12491. temp.visible = false;
  12492. all++;
  12493. if (all >= this.max) {
  12494. callback && callback();
  12495. }
  12496. }), 20 * index);
  12497. }
  12498. }
  12499. runWorlds(stPos, num) {
  12500. let str = "+" + num;
  12501. this.ui.txt.text = str;
  12502. let starX = stPos.x;
  12503. let starY = stPos.y + 50;
  12504. this.ui.txt.x = starX;
  12505. this.ui.txt.y = starY;
  12506. this.ui.txt.visible = true;
  12507. this.ui.txt.alpha = 1;
  12508. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12509. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12510. this.ui.txt.visible = false;
  12511. this.hide();
  12512. }));
  12513. }));
  12514. }
  12515. }
  12516. UIFlyEft.uiName = "UIFlyEft";
  12517. class Common {
  12518. constructor() {
  12519. this.convertNum = 0.025;
  12520. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12521. this.scaleV3One = new Laya.Vector3();
  12522. this.scaleV3Two = new Laya.Vector3();
  12523. this.posV4 = new Laya.Vector4();
  12524. this.showDebug = false;
  12525. this.openGuide = true;
  12526. this.rodOffest = new Laya.Vector2(0, 0);
  12527. this.rodAngle = 0;
  12528. this.gameMode = GameMode.classic;
  12529. this.bigMoveLevelIndex = 1;
  12530. this.bigMoveNeedCoin = 1000;
  12531. this.classicNiceNeddCoin = 1000;
  12532. this.passAwardCoin = 2000;
  12533. this.classicRoomType = 1;
  12534. this.maxPower = 20;
  12535. this.natureMaxPower = 5;
  12536. this.videoPower = 2;
  12537. this.powerRecoverNum = 900;
  12538. this.curPlayerSkillType = 0;
  12539. this.isNewDay = false;
  12540. this.clickedBall = false;
  12541. this.placeBallCurLevel = 0;
  12542. this.placeBallStarNum = 0;
  12543. this.longHelpLine = false;
  12544. this.maxShareDiamondTimes = 3;
  12545. this.guideStep = 0;
  12546. this.guideStepForLianXi = 0;
  12547. this.temSelfLevel = 0;
  12548. this.extraMoveNum = 0;
  12549. this.curRankID = 0;
  12550. this.rankID = {
  12551. normalStar: 12000,
  12552. wxStar: 12001
  12553. };
  12554. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12555. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12556. this.btnClickStr = "buttonclick";
  12557. this.maxSkillLevel = 10;
  12558. this.upSkillLevel = false;
  12559. this.gameStartTime = 0;
  12560. this._sysOffestNum = 0;
  12561. this.angleV2 = new Laya.Vector2();
  12562. this.rootV = new Laya.Vector2(0, 1);
  12563. this.tempDir1 = new Laya.Vector2();
  12564. this.tempDir2 = new Laya.Vector2();
  12565. this.ballSize = 33;
  12566. this.stPos = new Laya.Point();
  12567. this.edPos = new Laya.Point();
  12568. Common._instance = this;
  12569. window["common"] = this;
  12570. }
  12571. static getInstance() {
  12572. if (!this._instance) {
  12573. this._instance = new Common();
  12574. }
  12575. return this._instance;
  12576. }
  12577. get sysOffestNum() {
  12578. if (this._sysOffestNum == 0) {
  12579. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12580. }
  12581. return this._sysOffestNum;
  12582. }
  12583. testShader() {
  12584. let test = new LightShader();
  12585. test.texture = "res/d3Res/ballTexture/ball1.png";
  12586. Laya.stage.addChild(test);
  12587. }
  12588. playScale(node) {
  12589. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12590. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12591. }));
  12592. }));
  12593. }
  12594. setGroup(colli, ...group) {
  12595. let out = 0;
  12596. for (let index = 0; index < group.length; index++) {
  12597. if (index == 0) {
  12598. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12599. }
  12600. else {
  12601. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12602. }
  12603. }
  12604. colli.collisionGroup = out;
  12605. }
  12606. setCanGroupWith(colli, ...group) {
  12607. let out = 0;
  12608. for (let index = 0; index < group.length; index++) {
  12609. if (index == 0) {
  12610. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12611. }
  12612. else {
  12613. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12614. }
  12615. }
  12616. colli.canCollideWith = out;
  12617. }
  12618. loadPrefab(name, callback) {
  12619. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12620. let prefab = new Laya.Prefab();
  12621. prefab.json = obj;
  12622. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12623. callback && callback(img);
  12624. }));
  12625. }
  12626. pos2to3Convert(x, y, d3Pos) {
  12627. x = x + this.sysOffestNum;
  12628. d3Pos.setValue(x, y, 0);
  12629. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12630. if (success) {
  12631. }
  12632. else {
  12633. console.error("转换出错了。。。。。。。。");
  12634. }
  12635. }
  12636. scale2to3Convert(num) {
  12637. this.scaleV3One.setValue(0, 0, 0);
  12638. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12639. this.scaleV3Two.setValue(0, num, 0);
  12640. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12641. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12642. return outNum;
  12643. }
  12644. pos3to2Convert(d3Pos) {
  12645. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12646. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12647. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12648. d3Pos.x -= this.sysOffestNum;
  12649. }
  12650. scale3to2Convert(num) {
  12651. let scale = this.scale2to3Convert(1);
  12652. let d2Out = num / scale;
  12653. return d2Out;
  12654. }
  12655. getCollider(type, restitution = 0.9, density = 10) {
  12656. let colli;
  12657. if (type == "box")
  12658. colli = new Laya.BoxCollider();
  12659. else
  12660. colli = new Laya.CircleCollider();
  12661. colli.friction = 0;
  12662. colli.restitution = restitution;
  12663. colli.density = density;
  12664. return colli;
  12665. }
  12666. getRigbody() {
  12667. let rigy = new Laya.RigidBody();
  12668. rigy.bullet = true;
  12669. rigy.allowRotation = false;
  12670. rigy.allowSleep = false;
  12671. rigy.gravityScale = 0;
  12672. return rigy;
  12673. }
  12674. getfguiRotation(x, y) {
  12675. this.angleV2.setValue(x, y);
  12676. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12677. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12678. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12679. angle = -angle;
  12680. }
  12681. return 180 + angle;
  12682. }
  12683. getAngle(x, y) {
  12684. this.angleV2.setValue(x, y);
  12685. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12686. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12687. return angle;
  12688. }
  12689. randomNum(a, b) {
  12690. return a + Math.floor((b - a + 1) * Math.random());
  12691. }
  12692. getRandArrEle(arr) {
  12693. return arr[Math.floor(arr.length * Math.random())];
  12694. }
  12695. getSign(val) {
  12696. return val >= 0 ? 1 : -1;
  12697. }
  12698. botherArr(arr) {
  12699. let times = arr.length + 2;
  12700. let length = arr.length;
  12701. let a;
  12702. let b;
  12703. let temp;
  12704. for (let index = 0; index < times; index++) {
  12705. a = Math.floor(Math.random() * length);
  12706. b = Math.floor(Math.random() * length);
  12707. temp = arr[a];
  12708. arr[a] = arr[b];
  12709. arr[b] = temp;
  12710. }
  12711. }
  12712. getGameIconUrl(id) {
  12713. return "ui://game/" + id;
  12714. }
  12715. getComponentUrl(id) {
  12716. return "ui://game/" + id;
  12717. }
  12718. getAnimation() {
  12719. }
  12720. judgeSkillType(type = SkillType.highSpace) {
  12721. if (this.gameMode == GameMode.classic)
  12722. return;
  12723. let gameMgr = this.gameMgr;
  12724. if (gameMgr.selfTurn) {
  12725. if (gameMgr.selfCurSkill == type) {
  12726. return true;
  12727. }
  12728. }
  12729. else {
  12730. if (gameMgr.aiCurSkill == type) {
  12731. return true;
  12732. }
  12733. }
  12734. }
  12735. ballColliHole(collider) {
  12736. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12737. xGame.common.gameMgr.isFirstInGame = false;
  12738. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12739. }
  12740. collider.owner.mySrc.checkWrongBall();
  12741. }
  12742. getArrMaxEle(arr) {
  12743. let max = -Infinity;
  12744. for (let index = 0; index < arr.length; index++) {
  12745. max = Math.max(arr[index], max);
  12746. }
  12747. return max;
  12748. }
  12749. getArrMinEle(arr) {
  12750. let min = Infinity;
  12751. for (let index = 0; index < arr.length; index++) {
  12752. min = Math.min(arr[index], min);
  12753. }
  12754. return min;
  12755. }
  12756. playRandomMutiBallBigSkillSound() {
  12757. if (Math.random() <= 0.5)
  12758. return;
  12759. let rand = this.randomNum(1, 6);
  12760. let str = "ganfa0" + rand;
  12761. xGame.soundMgr.playSound(str);
  12762. }
  12763. showOneCamera(type) {
  12764. let object = xGame.common.d3World.cameraObj;
  12765. for (const key in object) {
  12766. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12767. object[key].init();
  12768. object[key].owner.active = key == type;
  12769. }
  12770. }
  12771. }
  12772. checkBallOverBorder(x, y) {
  12773. let radius = 17;
  12774. let condition = this._checkBorder(x + radius, y) ||
  12775. this._checkBorder(x - radius, y) ||
  12776. this._checkBorder(x, y + radius) ||
  12777. this._checkBorder(x, y - radius);
  12778. if (condition) {
  12779. return true;
  12780. }
  12781. }
  12782. _checkBorder(x, y) {
  12783. let borderRect = this.d2World.borderRect;
  12784. let xOffest = 20;
  12785. let yOffest = 20;
  12786. if (y <= borderRect.y - yOffest) {
  12787. return true;
  12788. }
  12789. if (y >= borderRect.y + borderRect.height + yOffest) {
  12790. return true;
  12791. }
  12792. if (x <= borderRect.x - xOffest) {
  12793. return true;
  12794. }
  12795. if (x >= borderRect.x + borderRect.width + xOffest) {
  12796. return true;
  12797. }
  12798. }
  12799. initWeight(cfg) {
  12800. let allCfgData = { data: {}, allWeightNum: 0 };
  12801. let weightCfg = allCfgData.data;
  12802. let weight = 0;
  12803. for (const key in cfg) {
  12804. weightCfg[key] = {};
  12805. weightCfg[key].id = cfg[key].id;
  12806. weightCfg[key].minWeight = weight;
  12807. weight += cfg[key].weight;
  12808. weightCfg[key].maxWeight = weight;
  12809. }
  12810. allCfgData.allWeightNum = weight;
  12811. return allCfgData;
  12812. }
  12813. getRandomWeightData(cfg) {
  12814. let weightCfg = cfg.data;
  12815. let allWeightNum = cfg.allWeightNum;
  12816. let rand = Math.floor(Math.random() * allWeightNum);
  12817. for (const key in weightCfg) {
  12818. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12819. return weightCfg[key];
  12820. }
  12821. }
  12822. return weightCfg[1];
  12823. }
  12824. showGirlTalkPop(wordsIndex, node, msgNode) {
  12825. node.visible = true;
  12826. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12827. node.t0.play(Laya.Handler.create(this, () => {
  12828. node.visible = false;
  12829. }));
  12830. }
  12831. stopGirlPop(node) {
  12832. node.t0.stop();
  12833. node.visible = false;
  12834. }
  12835. createHead(loader, url, size = 107) {
  12836. if (Laya.Browser.name == "Browser") {
  12837. loader.url = url;
  12838. return;
  12839. }
  12840. else {
  12841. console.log('zh:url=', url);
  12842. loader.url = url;
  12843. }
  12844. }
  12845. addTestCoin(num) {
  12846. DataMgr.setCoin(num);
  12847. }
  12848. addTestDiamond(num) {
  12849. DataMgr.setDiamond(num);
  12850. }
  12851. addTestSkill() {
  12852. DataMgr.setBigSkill(0, 99);
  12853. DataMgr.setBigSkill(1, 99);
  12854. DataMgr.setBigSkill(2, 99);
  12855. }
  12856. playClassicEmotion(number, x, y) {
  12857. if (this.gameMode == GameMode.bigMove)
  12858. return;
  12859. let randIndex = this.randomNum(0, 2);
  12860. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12861. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12862. if (this.gameMgr.selfTurn) {
  12863. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12864. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12865. }
  12866. else {
  12867. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12868. }
  12869. else {
  12870. if (number == this.gameMgr.blackNum) {
  12871. if (this.gameMgr.selfBallArr.length == 0) {
  12872. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12873. }
  12874. else {
  12875. }
  12876. }
  12877. else {
  12878. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12879. }
  12880. }
  12881. }
  12882. }
  12883. else {
  12884. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12885. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12886. }
  12887. else {
  12888. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12889. }
  12890. else {
  12891. if (number == this.gameMgr.blackNum) {
  12892. if (this.gameMgr.aiBallArr.length == 0) {
  12893. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12894. }
  12895. else {
  12896. }
  12897. }
  12898. else {
  12899. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12900. }
  12901. }
  12902. }
  12903. }
  12904. }
  12905. playHappySound(number) {
  12906. if (this.gameMode != GameMode.classic)
  12907. return;
  12908. if (number == 8)
  12909. return;
  12910. let play = false;
  12911. if (this.gameMgr.selfTurn) {
  12912. if (this.gameMgr.ensureBallType) {
  12913. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12914. play = true;
  12915. }
  12916. }
  12917. else {
  12918. play = true;
  12919. }
  12920. }
  12921. else {
  12922. if (this.gameMgr.ensureBallType) {
  12923. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12924. play = true;
  12925. }
  12926. }
  12927. else {
  12928. play = true;
  12929. }
  12930. }
  12931. if (play)
  12932. xGame.soundMgr.playSound("applause");
  12933. }
  12934. destroyClassicEmotion() {
  12935. if (this.gameMode == GameMode.bigMove)
  12936. return;
  12937. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12938. parent.destroyChildren();
  12939. }
  12940. playAwardSpine(x, y) {
  12941. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12942. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12943. this.awardSpine.play(data, 0, false, parent);
  12944. }
  12945. destroyAwardSpine() {
  12946. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12947. parent.destroyChildren();
  12948. }
  12949. isBlock(bx, by, hx, hy, except = null) {
  12950. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12951. let balls = xGame.common.d2World.ballArr;
  12952. let outArr = [];
  12953. for (let index = 0; index < balls.length; index++) {
  12954. let obj = balls[index];
  12955. if (obj.number == 0)
  12956. continue;
  12957. if (obj == except)
  12958. continue;
  12959. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12960. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12961. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12962. if (num >= 1)
  12963. num = 1;
  12964. if (num < 0)
  12965. continue;
  12966. let gap = Math.sin(Math.acos(num)) * dis;
  12967. if (gap < this.ballSize) {
  12968. outArr.push({
  12969. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12970. disHon: Math.cos(Math.acos(num)) * dis,
  12971. disVer: Math.sin(Math.acos(num)) * dis,
  12972. src: balls[index],
  12973. dir: this.tempDir1
  12974. });
  12975. }
  12976. }
  12977. if (outArr.length > 0) {
  12978. outArr.sort((a, b) => { return a.dis - b.dis; });
  12979. return outArr[0];
  12980. }
  12981. }
  12982. AngleBetween(vector1, vector2) {
  12983. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12984. return rad * (180 / Math.PI);
  12985. }
  12986. getSecretaryScale() {
  12987. if (this.secretary.spineName == "mishu") {
  12988. return 1.28;
  12989. }
  12990. else {
  12991. return 1.024;
  12992. }
  12993. }
  12994. signAwardContainsRod(arr) {
  12995. let temp;
  12996. for (let index = 0; index < arr.length; index++) {
  12997. temp = arr[index].split('-')[0];
  12998. if (parseInt(temp) > 2) {
  12999. return true;
  13000. }
  13001. }
  13002. }
  13003. judgeSameDay() {
  13004. let lastTime = DataMgr.getSignTime();
  13005. let curTime = new Date().getTime();
  13006. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  13007. return true;
  13008. }
  13009. return false;
  13010. }
  13011. getAward(arr, callback) {
  13012. let showTriple = arr[0].type <= 2;
  13013. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  13014. let temp;
  13015. for (let index = 0; index < arr.length; index++) {
  13016. temp = arr[index];
  13017. switch (temp.type) {
  13018. case 1:
  13019. this.playObjFlyAnim(temp.num, temp.type);
  13020. break;
  13021. case 2:
  13022. this.playObjFlyAnim(temp.num, temp.type);
  13023. break;
  13024. case 3:
  13025. case 4:
  13026. case 5:
  13027. case 6:
  13028. DataMgr.setBallRod(temp.type - 2, 1);
  13029. DataMgr.setCurBallRod(temp.type - 2);
  13030. break;
  13031. default:
  13032. break;
  13033. }
  13034. }
  13035. callback && callback(watchVideo);
  13036. });
  13037. }
  13038. getMoneyNode() {
  13039. let moneyNode;
  13040. let sign = xGame.uiMgr.getUI(UISign);
  13041. let draw = xGame.uiMgr.getUI(UIDraw);
  13042. let end = xGame.uiMgr.getUI(UIGameEnd);
  13043. let skill = xGame.uiMgr.getUI(UISkill);
  13044. if (sign && !sign.isHide)
  13045. moneyNode = sign.ui.moneyNode;
  13046. if (draw && !draw.isHide)
  13047. moneyNode = draw.ui.moneyNode;
  13048. if (end && !end.isHide)
  13049. moneyNode = end.ui.moneyNode;
  13050. if (skill && !skill.isHide)
  13051. moneyNode = skill.ui.moneyNode;
  13052. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  13053. let main = xGame.uiMgr.getUI(UIMain);
  13054. if (condition1 && main && !main.isHide) {
  13055. moneyNode = main.ui.moneyNode;
  13056. }
  13057. return moneyNode;
  13058. }
  13059. playObjFlyAnim(num, type, callback = null) {
  13060. this.stPos.x = Laya.stage.width / 2;
  13061. this.stPos.y = Laya.stage.height / 2;
  13062. let moneyNode = this.getMoneyNode();
  13063. switch (type) {
  13064. case Prop.diamond:
  13065. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  13066. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  13067. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  13068. this.edPos.x /= 2;
  13069. this.edPos.y /= 2;
  13070. break;
  13071. case Prop.coin:
  13072. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  13073. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13074. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13075. this.edPos.x /= 2;
  13076. this.edPos.y /= 2;
  13077. break;
  13078. default:
  13079. break;
  13080. }
  13081. xGame.soundMgr.playSound("coinbag");
  13082. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13083. switch (type) {
  13084. case Prop.diamond:
  13085. DataMgr.setDiamond(num);
  13086. break;
  13087. case Prop.coin:
  13088. DataMgr.setCoin(num);
  13089. break;
  13090. default:
  13091. break;
  13092. }
  13093. callback && callback();
  13094. });
  13095. }
  13096. autoPopUIView() {
  13097. let arr = [];
  13098. let sign = this.judgeSameDay() ? false : true;
  13099. if (sign)
  13100. arr.push("sign");
  13101. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13102. if (draw)
  13103. arr.push("draw");
  13104. if (arr.length <= 0)
  13105. return;
  13106. let str = this.getRandArrEle(arr);
  13107. switch (str) {
  13108. case "sign":
  13109. xGame.uiMgr.Show(UISign);
  13110. break;
  13111. case "draw":
  13112. xGame.uiMgr.Show(UIDraw);
  13113. break;
  13114. default:
  13115. break;
  13116. }
  13117. }
  13118. getMSTime(time) {
  13119. let min = Math.floor(time / 60);
  13120. let sec = Math.floor((time - min * 60));
  13121. if (sec < 10)
  13122. sec = "0" + sec;
  13123. if (min < 10)
  13124. min = "0" + min;
  13125. return `${min}:${sec}`;
  13126. }
  13127. testPower() {
  13128. DataMgr.setPower(0, false);
  13129. }
  13130. getAllStarNum() {
  13131. let data = DataMgr.getPlaceBallLevelList();
  13132. let out = 0;
  13133. for (let index = 0; index < data.length; index++) {
  13134. out += data[index].star;
  13135. }
  13136. return out;
  13137. }
  13138. recoverCameraView() {
  13139. Laya.timer.once(900, this, () => {
  13140. xGame.common.showOneCamera("mainCamera");
  13141. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13142. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13143. xGame.common.gameUI.ui.border.alpha = 0;
  13144. if (Laya.physicsTimer.scale < 1) {
  13145. Laya.physicsTimer.scale = 1;
  13146. }
  13147. }
  13148. });
  13149. }
  13150. getClassicLevel() {
  13151. let successTimes = DataMgr.getClassicTimes();
  13152. let needKey = "";
  13153. let lastKey = "";
  13154. let cfg = cfgTable.classictimesData;
  13155. let data;
  13156. for (const key in cfg) {
  13157. data = cfg[key];
  13158. if (successTimes <= data.times) {
  13159. needKey = key;
  13160. }
  13161. lastKey = key;
  13162. }
  13163. if (needKey == "")
  13164. needKey = lastKey;
  13165. return cfg[needKey];
  13166. }
  13167. }
  13168. Common._instance = null;
  13169. class ui_Component92 extends fgui.GComponent {
  13170. static createInstance() {
  13171. return (fgui.UIPackage.createObject("game", "Component92"));
  13172. }
  13173. onConstruct() {
  13174. this.n0 = (this.getChild("n0"));
  13175. }
  13176. }
  13177. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13178. class ui_Component129 extends fgui.GProgressBar {
  13179. static createInstance() {
  13180. return (fgui.UIPackage.createObject("game", "Component129"));
  13181. }
  13182. onConstruct() {
  13183. this.bar_v = (this.getChild("bar_v"));
  13184. this.n84 = (this.getChild("n84"));
  13185. }
  13186. }
  13187. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13188. class ui_Component130 extends fgui.GComponent {
  13189. static createInstance() {
  13190. return (fgui.UIPackage.createObject("game", "Component130"));
  13191. }
  13192. onConstruct() {
  13193. this.ani = (this.getChild("ani"));
  13194. this.t0 = this.getTransition("t0");
  13195. }
  13196. }
  13197. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13198. class ui_powerEft extends fgui.GComponent {
  13199. static createInstance() {
  13200. return (fgui.UIPackage.createObject("game", "powerEft"));
  13201. }
  13202. onConstruct() {
  13203. this.ani = (this.getChild("ani"));
  13204. this.n88 = (this.getChild("n88"));
  13205. this.n89 = (this.getChild("n89"));
  13206. }
  13207. }
  13208. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13209. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13210. static createInstance() {
  13211. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13212. }
  13213. onConstruct() {
  13214. this.c1 = this.getController("c1");
  13215. this.n2 = (this.getChild("n2"));
  13216. this.n22 = (this.getChild("n22"));
  13217. this.n23 = (this.getChild("n23"));
  13218. this.n15 = (this.getChild("n15"));
  13219. this.challenge = (this.getChild("challenge"));
  13220. this.n17 = (this.getChild("n17"));
  13221. this.n3 = (this.getChild("n3"));
  13222. this.starNode = (this.getChild("starNode"));
  13223. this.levelTxt = (this.getChild("levelTxt"));
  13224. this.n14 = (this.getChild("n14"));
  13225. this.n19 = (this.getChild("n19"));
  13226. this.n20 = (this.getChild("n20"));
  13227. this.n21 = (this.getChild("n21"));
  13228. this.special = (this.getChild("special"));
  13229. }
  13230. }
  13231. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13232. class ui_Component79 extends fgui.GComponent {
  13233. static createInstance() {
  13234. return (fgui.UIPackage.createObject("game", "Component79"));
  13235. }
  13236. onConstruct() {
  13237. this.c1 = this.getController("c1");
  13238. this.n7 = (this.getChild("n7"));
  13239. this.n8 = (this.getChild("n8"));
  13240. this.n9 = (this.getChild("n9"));
  13241. this.n10 = (this.getChild("n10"));
  13242. this.n11 = (this.getChild("n11"));
  13243. this.n12 = (this.getChild("n12"));
  13244. }
  13245. }
  13246. ui_Component79.URL = "ui://isxx5ak7avag477";
  13247. class ui_Component80 extends fgui.GComponent {
  13248. static createInstance() {
  13249. return (fgui.UIPackage.createObject("game", "Component80"));
  13250. }
  13251. onConstruct() {
  13252. this.n0 = (this.getChild("n0"));
  13253. this.n1 = (this.getChild("n1"));
  13254. this.myList = (this.getChild("myList"));
  13255. this.guide2 = (this.getChild("guide2"));
  13256. this.yd = (this.getChild("yd"));
  13257. this.yd_zzq_btn = (this.getChild("yd_zzq_btn"));
  13258. this.n_yd = (this.getChild("n_yd"));
  13259. this.t0 = this.getTransition("t0");
  13260. }
  13261. }
  13262. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13263. class ui_SignNormal extends fgui.GComponent {
  13264. static createInstance() {
  13265. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13266. }
  13267. onConstruct() {
  13268. this.c1 = this.getController("c1");
  13269. this.n7 = (this.getChild("n7"));
  13270. this.n15 = (this.getChild("n15"));
  13271. this.titleTxt = (this.getChild("titleTxt"));
  13272. this.n8 = (this.getChild("n8"));
  13273. this.myIcon = (this.getChild("myIcon"));
  13274. this.numTxt = (this.getChild("numTxt"));
  13275. this.n12 = (this.getChild("n12"));
  13276. this.n13 = (this.getChild("n13"));
  13277. this.n17 = (this.getChild("n17"));
  13278. this.n14 = (this.getChild("n14"));
  13279. }
  13280. }
  13281. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13282. class ui_Button_reg extends fgui.GButton {
  13283. static createInstance() {
  13284. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13285. }
  13286. onConstruct() {
  13287. this.button = this.getController("button");
  13288. this.n6 = (this.getChild("n6"));
  13289. }
  13290. }
  13291. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13292. class ui_screenNode extends fgui.GComponent {
  13293. static createInstance() {
  13294. return (fgui.UIPackage.createObject("game", "screenNode"));
  13295. }
  13296. onConstruct() {
  13297. this.n9 = (this.getChild("n9"));
  13298. this.screenImg = (this.getChild("screenImg"));
  13299. }
  13300. }
  13301. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13302. class ui_GetAwrad_com1 extends fgui.GComponent {
  13303. static createInstance() {
  13304. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13305. }
  13306. onConstruct() {
  13307. this.n38 = (this.getChild("n38"));
  13308. this.n39 = (this.getChild("n39"));
  13309. this.n40 = (this.getChild("n40"));
  13310. this.t0 = this.getTransition("t0");
  13311. this.t1 = this.getTransition("t1");
  13312. }
  13313. }
  13314. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13315. class ui_GetAwrad_com2 extends fgui.GComponent {
  13316. static createInstance() {
  13317. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13318. }
  13319. onConstruct() {
  13320. this.n39 = (this.getChild("n39"));
  13321. this.n40 = (this.getChild("n40"));
  13322. this.t0 = this.getTransition("t0");
  13323. }
  13324. }
  13325. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13326. class ui_Component128 extends fgui.GComponent {
  13327. static createInstance() {
  13328. return (fgui.UIPackage.createObject("game", "Component128"));
  13329. }
  13330. onConstruct() {
  13331. this.n38 = (this.getChild("n38"));
  13332. this.n40 = (this.getChild("n40"));
  13333. }
  13334. }
  13335. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13336. class ui_Component100_1 extends fgui.GComponent {
  13337. static createInstance() {
  13338. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13339. }
  13340. onConstruct() {
  13341. this.myNode = (this.getChild("myNode"));
  13342. this.t0 = this.getTransition("t0");
  13343. }
  13344. }
  13345. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13346. class ui_Component142 extends fgui.GComponent {
  13347. static createInstance() {
  13348. return (fgui.UIPackage.createObject("game", "Component142"));
  13349. }
  13350. onConstruct() {
  13351. this.n41 = (this.getChild("n41"));
  13352. this.n42 = (this.getChild("n42"));
  13353. }
  13354. }
  13355. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13356. class ui_main_guang extends fgui.GComponent {
  13357. static createInstance() {
  13358. return (fgui.UIPackage.createObject("game", "main_guang"));
  13359. }
  13360. onConstruct() {
  13361. this.n1 = (this.getChild("n1"));
  13362. this.n2 = (this.getChild("n2"));
  13363. this.n3 = (this.getChild("n3"));
  13364. this.n4 = (this.getChild("n4"));
  13365. this.n5 = (this.getChild("n5"));
  13366. this.n6 = (this.getChild("n6"));
  13367. this.n8 = (this.getChild("n8"));
  13368. this.t0 = this.getTransition("t0");
  13369. }
  13370. }
  13371. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13372. class ui_try_com1 extends fgui.GComponent {
  13373. static createInstance() {
  13374. return (fgui.UIPackage.createObject("game", "try_com1"));
  13375. }
  13376. onConstruct() {
  13377. this.c1 = this.getController("c1");
  13378. this.n0 = (this.getChild("n0"));
  13379. this.n2 = (this.getChild("n2"));
  13380. this.cancelBtn = (this.getChild("cancelBtn"));
  13381. this.videoBtn = (this.getChild("videoBtn"));
  13382. this.n9 = (this.getChild("n9"));
  13383. this.n24 = (this.getChild("n24"));
  13384. this.titleTxt = (this.getChild("titleTxt"));
  13385. this.n32 = (this.getChild("n32"));
  13386. this.n29 = (this.getChild("n29"));
  13387. this.n36 = (this.getChild("n36"));
  13388. this.txtTime = (this.getChild("txtTime"));
  13389. this.t0 = this.getTransition("t0");
  13390. }
  13391. }
  13392. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13393. class ui_try_com2 extends fgui.GComponent {
  13394. static createInstance() {
  13395. return (fgui.UIPackage.createObject("game", "try_com2"));
  13396. }
  13397. onConstruct() {
  13398. this.skillicon = (this.getChild("skillicon"));
  13399. this.n35 = (this.getChild("n35"));
  13400. this.n31 = (this.getChild("n31"));
  13401. this.n32 = (this.getChild("n32"));
  13402. this.n33 = (this.getChild("n33"));
  13403. this.n34 = (this.getChild("n34"));
  13404. }
  13405. }
  13406. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13407. class ui_try_com3 extends fgui.GComponent {
  13408. static createInstance() {
  13409. return (fgui.UIPackage.createObject("game", "try_com3"));
  13410. }
  13411. onConstruct() {
  13412. this.n33 = (this.getChild("n33"));
  13413. this.n34 = (this.getChild("n34"));
  13414. this.n35 = (this.getChild("n35"));
  13415. this.t0 = this.getTransition("t0");
  13416. }
  13417. }
  13418. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13419. class ui_huihe1 extends fgui.GComponent {
  13420. static createInstance() {
  13421. return (fgui.UIPackage.createObject("game", "huihe1"));
  13422. }
  13423. onConstruct() {
  13424. this.n0 = (this.getChild("n0"));
  13425. this.n1 = (this.getChild("n1"));
  13426. this.t0 = this.getTransition("t0");
  13427. }
  13428. }
  13429. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13430. class ui_huihe2 extends fgui.GComponent {
  13431. static createInstance() {
  13432. return (fgui.UIPackage.createObject("game", "huihe2"));
  13433. }
  13434. onConstruct() {
  13435. this.n0 = (this.getChild("n0"));
  13436. this.n1 = (this.getChild("n1"));
  13437. this.t0 = this.getTransition("t0");
  13438. }
  13439. }
  13440. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13441. class ui_Component143 extends fgui.GComponent {
  13442. static createInstance() {
  13443. return (fgui.UIPackage.createObject("game", "Component143"));
  13444. }
  13445. onConstruct() {
  13446. this.n3 = (this.getChild("n3"));
  13447. this.n4 = (this.getChild("n4"));
  13448. this.n5 = (this.getChild("n5"));
  13449. this.n6 = (this.getChild("n6"));
  13450. this.n7 = (this.getChild("n7"));
  13451. this.n8 = (this.getChild("n8"));
  13452. this.n9 = (this.getChild("n9"));
  13453. this.n10 = (this.getChild("n10"));
  13454. this.t0 = this.getTransition("t0");
  13455. }
  13456. }
  13457. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13458. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13459. static createInstance() {
  13460. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13461. }
  13462. onConstruct() {
  13463. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13464. }
  13465. }
  13466. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13467. class ui_dh_jingbi2 extends fgui.GComponent {
  13468. static createInstance() {
  13469. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13470. }
  13471. onConstruct() {
  13472. this.n0 = (this.getChild("n0"));
  13473. this.n1 = (this.getChild("n1"));
  13474. this.n2 = (this.getChild("n2"));
  13475. this.n3 = (this.getChild("n3"));
  13476. this.n4 = (this.getChild("n4"));
  13477. this.n5 = (this.getChild("n5"));
  13478. this.n6 = (this.getChild("n6"));
  13479. this.n8 = (this.getChild("n8"));
  13480. this.n10 = (this.getChild("n10"));
  13481. this.t0 = this.getTransition("t0");
  13482. }
  13483. }
  13484. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13485. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13486. static createInstance() {
  13487. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13488. }
  13489. onConstruct() {
  13490. this.n1 = (this.getChild("n1"));
  13491. this.n4 = (this.getChild("n4"));
  13492. this.t0 = this.getTransition("t0");
  13493. }
  13494. }
  13495. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13496. class ui_dh_jingbi3 extends fgui.GComponent {
  13497. static createInstance() {
  13498. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13499. }
  13500. onConstruct() {
  13501. this.n0 = (this.getChild("n0"));
  13502. this.n1 = (this.getChild("n1"));
  13503. this.n2 = (this.getChild("n2"));
  13504. this.n3 = (this.getChild("n3"));
  13505. this.n4 = (this.getChild("n4"));
  13506. this.n5 = (this.getChild("n5"));
  13507. this.n6 = (this.getChild("n6"));
  13508. this.n8 = (this.getChild("n8"));
  13509. this.n10 = (this.getChild("n10"));
  13510. this.t0 = this.getTransition("t0");
  13511. }
  13512. }
  13513. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13514. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13515. static createInstance() {
  13516. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13517. }
  13518. onConstruct() {
  13519. this.n3 = (this.getChild("n3"));
  13520. this.n1 = (this.getChild("n1"));
  13521. this.t0 = this.getTransition("t0");
  13522. }
  13523. }
  13524. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13525. class ui_hb_jinbi1 extends fgui.GButton {
  13526. static createInstance() {
  13527. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13528. }
  13529. onConstruct() {
  13530. this.n20 = (this.getChild("n20"));
  13531. this.n25 = (this.getChild("n25"));
  13532. this.coinTxt = (this.getChild("coinTxt"));
  13533. this.n28 = (this.getChild("n28"));
  13534. this.n32 = (this.getChild("n32"));
  13535. this.n38 = (this.getChild("n38"));
  13536. this.n45 = (this.getChild("n45"));
  13537. this.getTips = (this.getChild("getTips"));
  13538. this.n39 = (this.getChild("n39"));
  13539. this.diamondTxt = (this.getChild("diamondTxt"));
  13540. this.n41 = (this.getChild("n41"));
  13541. this.n42 = (this.getChild("n42"));
  13542. this.n46 = (this.getChild("n46"));
  13543. this.n47 = (this.getChild("n47"));
  13544. this.n48 = (this.getChild("n48"));
  13545. this.t0 = this.getTransition("t0");
  13546. }
  13547. }
  13548. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13549. class ui_hb_jinbi2 extends fgui.GButton {
  13550. static createInstance() {
  13551. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13552. }
  13553. onConstruct() {
  13554. this.n20 = (this.getChild("n20"));
  13555. this.n25 = (this.getChild("n25"));
  13556. this.coinTxt = (this.getChild("coinTxt"));
  13557. this.n28 = (this.getChild("n28"));
  13558. this.n32 = (this.getChild("n32"));
  13559. this.n38 = (this.getChild("n38"));
  13560. this.n39 = (this.getChild("n39"));
  13561. this.diamondTxt = (this.getChild("diamondTxt"));
  13562. this.n41 = (this.getChild("n41"));
  13563. this.n42 = (this.getChild("n42"));
  13564. this.n43 = (this.getChild("n43"));
  13565. this.n44 = (this.getChild("n44"));
  13566. this.n45 = (this.getChild("n45"));
  13567. this.t0 = this.getTransition("t0");
  13568. }
  13569. }
  13570. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13571. class ui_hb_jinbi3 extends fgui.GButton {
  13572. static createInstance() {
  13573. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13574. }
  13575. onConstruct() {
  13576. this.n20 = (this.getChild("n20"));
  13577. this.n25 = (this.getChild("n25"));
  13578. this.coinTxt = (this.getChild("coinTxt"));
  13579. this.n28 = (this.getChild("n28"));
  13580. this.n32 = (this.getChild("n32"));
  13581. this.n38 = (this.getChild("n38"));
  13582. this.n39 = (this.getChild("n39"));
  13583. this.diamondTxt = (this.getChild("diamondTxt"));
  13584. this.n41 = (this.getChild("n41"));
  13585. this.n42 = (this.getChild("n42"));
  13586. this.n43 = (this.getChild("n43"));
  13587. this.n44 = (this.getChild("n44"));
  13588. this.n45 = (this.getChild("n45"));
  13589. this.t0 = this.getTransition("t0");
  13590. }
  13591. }
  13592. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13593. class ui_Component104 extends fgui.GComponent {
  13594. static createInstance() {
  13595. return (fgui.UIPackage.createObject("game", "Component104"));
  13596. }
  13597. onConstruct() {
  13598. this.c1 = this.getController("c1");
  13599. this.n12 = (this.getChild("n12"));
  13600. this.coinBtn = (this.getChild("coinBtn"));
  13601. this.diamondBtn = (this.getChild("diamondBtn"));
  13602. this.node3 = (this.getChild("node3"));
  13603. this.node4 = (this.getChild("node4"));
  13604. this.node5 = (this.getChild("node5"));
  13605. this.node1 = (this.getChild("node1"));
  13606. this.node2 = (this.getChild("node2"));
  13607. this.node6 = (this.getChild("node6"));
  13608. this.t0 = this.getTransition("t0");
  13609. }
  13610. }
  13611. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13612. class ui_Component105 extends fgui.GButton {
  13613. static createInstance() {
  13614. return (fgui.UIPackage.createObject("game", "Component105"));
  13615. }
  13616. onConstruct() {
  13617. this.c1 = this.getController("c1");
  13618. this.n49 = (this.getChild("n49"));
  13619. this.n18 = (this.getChild("n18"));
  13620. this.n46 = (this.getChild("n46"));
  13621. this.n48 = (this.getChild("n48"));
  13622. }
  13623. }
  13624. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13625. class ui_Component106 extends fgui.GButton {
  13626. static createInstance() {
  13627. return (fgui.UIPackage.createObject("game", "Component106"));
  13628. }
  13629. onConstruct() {
  13630. this.c1 = this.getController("c1");
  13631. this.n49 = (this.getChild("n49"));
  13632. this.n18 = (this.getChild("n18"));
  13633. this.n46 = (this.getChild("n46"));
  13634. this.n48 = (this.getChild("n48"));
  13635. }
  13636. }
  13637. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13638. class ui_hb_zs1 extends fgui.GButton {
  13639. static createInstance() {
  13640. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13641. }
  13642. onConstruct() {
  13643. this.c1 = this.getController("c1");
  13644. this.n20 = (this.getChild("n20"));
  13645. this.n21 = (this.getChild("n21"));
  13646. this.n26 = (this.getChild("n26"));
  13647. this.n27 = (this.getChild("n27"));
  13648. this.shareTxt = (this.getChild("shareTxt"));
  13649. this.n32 = (this.getChild("n32"));
  13650. this.n38 = (this.getChild("n38"));
  13651. this.n39 = (this.getChild("n39"));
  13652. this.n44 = (this.getChild("n44"));
  13653. this.diamondTxt = (this.getChild("diamondTxt"));
  13654. this.n41 = (this.getChild("n41"));
  13655. this.n45 = (this.getChild("n45"));
  13656. this.n47 = (this.getChild("n47"));
  13657. this.n48 = (this.getChild("n48"));
  13658. this.randTxt = (this.getChild("randTxt"));
  13659. this.n50 = (this.getChild("n50"));
  13660. this.t0 = this.getTransition("t0");
  13661. }
  13662. }
  13663. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13664. class ui_dh_zs1 extends fgui.GComponent {
  13665. static createInstance() {
  13666. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13667. }
  13668. onConstruct() {
  13669. this.n10 = (this.getChild("n10"));
  13670. this.n9 = (this.getChild("n9"));
  13671. this.n1 = (this.getChild("n1"));
  13672. this.n2 = (this.getChild("n2"));
  13673. this.n3 = (this.getChild("n3"));
  13674. this.n4 = (this.getChild("n4"));
  13675. this.n5 = (this.getChild("n5"));
  13676. this.n6 = (this.getChild("n6"));
  13677. this.n8 = (this.getChild("n8"));
  13678. this.n11 = (this.getChild("n11"));
  13679. this.t0 = this.getTransition("t0");
  13680. }
  13681. }
  13682. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13683. class ui_dh_zs1_1 extends fgui.GComponent {
  13684. static createInstance() {
  13685. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13686. }
  13687. onConstruct() {
  13688. this.n3 = (this.getChild("n3"));
  13689. this.n1 = (this.getChild("n1"));
  13690. this.t0 = this.getTransition("t0");
  13691. }
  13692. }
  13693. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13694. class ui_hb_zs2 extends fgui.GButton {
  13695. static createInstance() {
  13696. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13697. }
  13698. onConstruct() {
  13699. this.n20 = (this.getChild("n20"));
  13700. this.n21 = (this.getChild("n21"));
  13701. this.n26 = (this.getChild("n26"));
  13702. this.n27 = (this.getChild("n27"));
  13703. this.n32 = (this.getChild("n32"));
  13704. this.n38 = (this.getChild("n38"));
  13705. this.n39 = (this.getChild("n39"));
  13706. this.n44 = (this.getChild("n44"));
  13707. this.diamondTxt = (this.getChild("diamondTxt"));
  13708. this.n41 = (this.getChild("n41"));
  13709. this.n45 = (this.getChild("n45"));
  13710. this.t0 = this.getTransition("t0");
  13711. }
  13712. }
  13713. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13714. class ui_hb_zs3 extends fgui.GButton {
  13715. static createInstance() {
  13716. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13717. }
  13718. onConstruct() {
  13719. this.n20 = (this.getChild("n20"));
  13720. this.n21 = (this.getChild("n21"));
  13721. this.n26 = (this.getChild("n26"));
  13722. this.n27 = (this.getChild("n27"));
  13723. this.n32 = (this.getChild("n32"));
  13724. this.n38 = (this.getChild("n38"));
  13725. this.n47 = (this.getChild("n47"));
  13726. this.t0 = this.getTransition("t0");
  13727. }
  13728. }
  13729. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13730. class ui_dh_zs2 extends fgui.GComponent {
  13731. static createInstance() {
  13732. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13733. }
  13734. onConstruct() {
  13735. this.n10 = (this.getChild("n10"));
  13736. this.n9 = (this.getChild("n9"));
  13737. this.n1 = (this.getChild("n1"));
  13738. this.n2 = (this.getChild("n2"));
  13739. this.n3 = (this.getChild("n3"));
  13740. this.n4 = (this.getChild("n4"));
  13741. this.n5 = (this.getChild("n5"));
  13742. this.n6 = (this.getChild("n6"));
  13743. this.n8 = (this.getChild("n8"));
  13744. this.n11 = (this.getChild("n11"));
  13745. this.t0 = this.getTransition("t0");
  13746. }
  13747. }
  13748. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13749. class ui_dh_zs2_1 extends fgui.GComponent {
  13750. static createInstance() {
  13751. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13752. }
  13753. onConstruct() {
  13754. this.n3 = (this.getChild("n3"));
  13755. this.n1 = (this.getChild("n1"));
  13756. this.t0 = this.getTransition("t0");
  13757. }
  13758. }
  13759. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13760. class ui_dh_zs3 extends fgui.GComponent {
  13761. static createInstance() {
  13762. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13763. }
  13764. onConstruct() {
  13765. this.n10 = (this.getChild("n10"));
  13766. this.n9 = (this.getChild("n9"));
  13767. this.n1 = (this.getChild("n1"));
  13768. this.n2 = (this.getChild("n2"));
  13769. this.n3 = (this.getChild("n3"));
  13770. this.n4 = (this.getChild("n4"));
  13771. this.n5 = (this.getChild("n5"));
  13772. this.n6 = (this.getChild("n6"));
  13773. this.n8 = (this.getChild("n8"));
  13774. this.n11 = (this.getChild("n11"));
  13775. this.t0 = this.getTransition("t0");
  13776. }
  13777. }
  13778. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13779. class ui_dh_zs3_1 extends fgui.GComponent {
  13780. static createInstance() {
  13781. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13782. }
  13783. onConstruct() {
  13784. this.n3 = (this.getChild("n3"));
  13785. this.n1 = (this.getChild("n1"));
  13786. this.t0 = this.getTransition("t0");
  13787. }
  13788. }
  13789. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13790. class ui_Component107 extends fgui.GComponent {
  13791. static createInstance() {
  13792. return (fgui.UIPackage.createObject("game", "Component107"));
  13793. }
  13794. onConstruct() {
  13795. this.n18 = (this.getChild("n18"));
  13796. this.n19 = (this.getChild("n19"));
  13797. this.n20 = (this.getChild("n20"));
  13798. this.n21 = (this.getChild("n21"));
  13799. this.n22 = (this.getChild("n22"));
  13800. this.levelTxt = (this.getChild("levelTxt"));
  13801. this.t0 = this.getTransition("t0");
  13802. }
  13803. }
  13804. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13805. class ui_box_com1 extends fgui.GComponent {
  13806. static createInstance() {
  13807. return (fgui.UIPackage.createObject("game", "box_com1"));
  13808. }
  13809. onConstruct() {
  13810. this.n14 = (this.getChild("n14"));
  13811. this.n6 = (this.getChild("n6"));
  13812. this.t0 = this.getTransition("t0");
  13813. }
  13814. }
  13815. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13816. class ui_box_com2 extends fgui.GProgressBar {
  13817. static createInstance() {
  13818. return (fgui.UIPackage.createObject("game", "box_com2"));
  13819. }
  13820. onConstruct() {
  13821. this.bg0 = (this.getChild("bg0"));
  13822. this.bg = (this.getChild("bg"));
  13823. this.bar = (this.getChild("bar"));
  13824. this.n7 = (this.getChild("n7"));
  13825. this.n8 = (this.getChild("n8"));
  13826. this.n10 = (this.getChild("n10"));
  13827. this.n11 = (this.getChild("n11"));
  13828. this.n12 = (this.getChild("n12"));
  13829. }
  13830. }
  13831. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13832. class ui_box_com4 extends fgui.GComponent {
  13833. static createInstance() {
  13834. return (fgui.UIPackage.createObject("game", "box_com4"));
  13835. }
  13836. onConstruct() {
  13837. this.n8 = (this.getChild("n8"));
  13838. this.t0 = this.getTransition("t0");
  13839. }
  13840. }
  13841. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13842. class ui_box_com3 extends fgui.GComponent {
  13843. static createInstance() {
  13844. return (fgui.UIPackage.createObject("game", "box_com3"));
  13845. }
  13846. onConstruct() {
  13847. this.n2 = (this.getChild("n2"));
  13848. this.n3 = (this.getChild("n3"));
  13849. this.n4 = (this.getChild("n4"));
  13850. this.n5 = (this.getChild("n5"));
  13851. this.t0 = this.getTransition("t0");
  13852. this.t1 = this.getTransition("t1");
  13853. }
  13854. }
  13855. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13856. class ui_Component97 extends fgui.GComponent {
  13857. static createInstance() {
  13858. return (fgui.UIPackage.createObject("game", "Component97"));
  13859. }
  13860. onConstruct() {
  13861. this.c1 = this.getController("c1");
  13862. this.n46 = (this.getChild("n46"));
  13863. this.diamondNode = (this.getChild("diamondNode"));
  13864. this.coinNode = (this.getChild("coinNode"));
  13865. this.t0 = this.getTransition("t0");
  13866. }
  13867. }
  13868. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13869. class ui_Component98 extends fgui.GButton {
  13870. static createInstance() {
  13871. return (fgui.UIPackage.createObject("game", "Component98"));
  13872. }
  13873. onConstruct() {
  13874. this.n8 = (this.getChild("n8"));
  13875. this.n40 = (this.getChild("n40"));
  13876. }
  13877. }
  13878. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13879. class ui_Component28_11 extends fgui.GButton {
  13880. static createInstance() {
  13881. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13882. }
  13883. onConstruct() {
  13884. this.c1 = this.getController("c1");
  13885. this.n12 = (this.getChild("n12"));
  13886. this.n17 = (this.getChild("n17"));
  13887. this.n13 = (this.getChild("n13"));
  13888. this.diamondTxt = (this.getChild("diamondTxt"));
  13889. this.n15 = (this.getChild("n15"));
  13890. this.n16 = (this.getChild("n16"));
  13891. }
  13892. }
  13893. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13894. class ui_Component58_11 extends fgui.GComponent {
  13895. static createInstance() {
  13896. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13897. }
  13898. onConstruct() {
  13899. this.c1 = this.getController("c1");
  13900. this.n23 = (this.getChild("n23"));
  13901. this.n41 = (this.getChild("n41"));
  13902. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13903. this.n_daoju = (this.getChild("n_daoju"));
  13904. this.myList = (this.getChild("myList"));
  13905. this.djList = (this.getChild("djList"));
  13906. this.t0 = this.getTransition("t0");
  13907. }
  13908. }
  13909. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13910. class ui_Component100 extends fgui.GComponent {
  13911. static createInstance() {
  13912. return (fgui.UIPackage.createObject("game", "Component100"));
  13913. }
  13914. onConstruct() {
  13915. this.c1 = this.getController("c1");
  13916. this.n75 = (this.getChild("n75"));
  13917. this.n76 = (this.getChild("n76"));
  13918. this.n80 = (this.getChild("n80"));
  13919. this.txt = (this.getChild("txt"));
  13920. this.spineRoot = (this.getChild("spineRoot"));
  13921. }
  13922. }
  13923. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13924. class ui_Component101 extends fgui.GComponent {
  13925. static createInstance() {
  13926. return (fgui.UIPackage.createObject("game", "Component101"));
  13927. }
  13928. onConstruct() {
  13929. this.c1 = this.getController("c1");
  13930. this.n36 = (this.getChild("n36"));
  13931. this.n35 = (this.getChild("n35"));
  13932. this.n33 = (this.getChild("n33"));
  13933. this.n34 = (this.getChild("n34"));
  13934. }
  13935. }
  13936. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13937. class ui_Component53 extends fgui.GComponent {
  13938. static createInstance() {
  13939. return (fgui.UIPackage.createObject("game", "Component53"));
  13940. }
  13941. onConstruct() {
  13942. this.n0 = (this.getChild("n0"));
  13943. this.n1 = (this.getChild("n1"));
  13944. this.n2 = (this.getChild("n2"));
  13945. this.n3 = (this.getChild("n3"));
  13946. this.n4 = (this.getChild("n4"));
  13947. this.n5 = (this.getChild("n5"));
  13948. this.n6 = (this.getChild("n6"));
  13949. this.n7 = (this.getChild("n7"));
  13950. this.n8 = (this.getChild("n8"));
  13951. this.n9 = (this.getChild("n9"));
  13952. this.n10 = (this.getChild("n10"));
  13953. this.n11 = (this.getChild("n11"));
  13954. this.n12 = (this.getChild("n12"));
  13955. this.n13 = (this.getChild("n13"));
  13956. this.n14 = (this.getChild("n14"));
  13957. this.n15 = (this.getChild("n15"));
  13958. this.n16 = (this.getChild("n16"));
  13959. this.n19 = (this.getChild("n19"));
  13960. this.n20 = (this.getChild("n20"));
  13961. this.n21 = (this.getChild("n21"));
  13962. this.n22 = (this.getChild("n22"));
  13963. this.n23 = (this.getChild("n23"));
  13964. this.n24 = (this.getChild("n24"));
  13965. this.n25 = (this.getChild("n25"));
  13966. this.n26 = (this.getChild("n26"));
  13967. this.n27 = (this.getChild("n27"));
  13968. this.n28 = (this.getChild("n28"));
  13969. this.n29 = (this.getChild("n29"));
  13970. this.n30 = (this.getChild("n30"));
  13971. this.n31 = (this.getChild("n31"));
  13972. this.n32 = (this.getChild("n32"));
  13973. this.n33 = (this.getChild("n33"));
  13974. this.n34 = (this.getChild("n34"));
  13975. this.n35 = (this.getChild("n35"));
  13976. this.t0 = this.getTransition("t0");
  13977. }
  13978. }
  13979. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13980. class ui_Component58 extends fgui.GComponent {
  13981. static createInstance() {
  13982. return (fgui.UIPackage.createObject("game", "Component58"));
  13983. }
  13984. onConstruct() {
  13985. this.n23 = (this.getChild("n23"));
  13986. this.n41 = (this.getChild("n41"));
  13987. this.n8 = (this.getChild("n8"));
  13988. this.skillList = (this.getChild("skillList"));
  13989. this.t0 = this.getTransition("t0");
  13990. }
  13991. }
  13992. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13993. class ui_Component59 extends fgui.GComponent {
  13994. static createInstance() {
  13995. return (fgui.UIPackage.createObject("game", "Component59"));
  13996. }
  13997. onConstruct() {
  13998. this.n3 = (this.getChild("n3"));
  13999. this.msgTxt = (this.getChild("msgTxt"));
  14000. this.t0 = this.getTransition("t0");
  14001. }
  14002. }
  14003. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  14004. class ui_Component_lc2 extends fgui.GComponent {
  14005. static createInstance() {
  14006. return (fgui.UIPackage.createObject("game", "Component_lc2"));
  14007. }
  14008. onConstruct() {
  14009. this.n0 = (this.getChild("n0"));
  14010. this.n1_bai = (this.getChild("n1_bai"));
  14011. }
  14012. }
  14013. ui_Component_lc2.URL = "ui://isxx5ak7ggd1v5ay";
  14014. class ui_Component_shou2 extends fgui.GComponent {
  14015. static createInstance() {
  14016. return (fgui.UIPackage.createObject("game", "Component_shou2"));
  14017. }
  14018. onConstruct() {
  14019. this.n57 = (this.getChild("n57"));
  14020. this.n54 = (this.getChild("n54"));
  14021. this.n55 = (this.getChild("n55"));
  14022. this.n56 = (this.getChild("n56"));
  14023. this.t1 = this.getTransition("t1");
  14024. }
  14025. }
  14026. ui_Component_shou2.URL = "ui://isxx5ak7ggd1v5b0";
  14027. class ui_RulerNode extends fgui.GComponent {
  14028. static createInstance() {
  14029. return (fgui.UIPackage.createObject("game", "RulerNode"));
  14030. }
  14031. onConstruct() {
  14032. this.n6 = (this.getChild("n6"));
  14033. this.n4 = (this.getChild("n4"));
  14034. this.img1 = (this.getChild("img1"));
  14035. this.img2 = (this.getChild("img2"));
  14036. }
  14037. }
  14038. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  14039. class ui_Component108 extends fgui.GComponent {
  14040. static createInstance() {
  14041. return (fgui.UIPackage.createObject("game", "Component108"));
  14042. }
  14043. onConstruct() {
  14044. this.n19 = (this.getChild("n19"));
  14045. this.t0 = this.getTransition("t0");
  14046. }
  14047. }
  14048. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  14049. class ui_Component63 extends fgui.GComponent {
  14050. static createInstance() {
  14051. return (fgui.UIPackage.createObject("game", "Component63"));
  14052. }
  14053. onConstruct() {
  14054. this.n66 = (this.getChild("n66"));
  14055. this.n56 = (this.getChild("n56"));
  14056. this.n63 = (this.getChild("n63"));
  14057. this.n65 = (this.getChild("n65"));
  14058. this.t0 = this.getTransition("t0");
  14059. }
  14060. }
  14061. ui_Component63.URL = "ui://isxx5ak7h657452";
  14062. class ui_topNode extends fgui.GComponent {
  14063. static createInstance() {
  14064. return (fgui.UIPackage.createObject("game", "topNode"));
  14065. }
  14066. onConstruct() {
  14067. this.selfProgress = (this.getChild("selfProgress"));
  14068. this.aiProgress = (this.getChild("aiProgress"));
  14069. this.selfKuang = (this.getChild("selfKuang"));
  14070. this.aiKuang = (this.getChild("aiKuang"));
  14071. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  14072. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  14073. this.n33 = (this.getChild("n33"));
  14074. this.n34 = (this.getChild("n34"));
  14075. this.selfNameTxt = (this.getChild("selfNameTxt"));
  14076. this.aiNameTxt = (this.getChild("aiNameTxt"));
  14077. this.selfBallList = (this.getChild("selfBallList"));
  14078. this.aiBallList = (this.getChild("aiBallList"));
  14079. this.middleNode = (this.getChild("middleNode"));
  14080. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  14081. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  14082. this.scoreNode = (this.getChild("scoreNode"));
  14083. this.selfTips = (this.getChild("selfTips"));
  14084. this.aiTips = (this.getChild("aiTips"));
  14085. }
  14086. }
  14087. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  14088. class ui_selfProgress extends fgui.GProgressBar {
  14089. static createInstance() {
  14090. return (fgui.UIPackage.createObject("game", "selfProgress"));
  14091. }
  14092. onConstruct() {
  14093. this.n3 = (this.getChild("n3"));
  14094. this.bar = (this.getChild("bar"));
  14095. }
  14096. }
  14097. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14098. class ui_aiProgress extends fgui.GProgressBar {
  14099. static createInstance() {
  14100. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14101. }
  14102. onConstruct() {
  14103. this.n3 = (this.getChild("n3"));
  14104. this.bar = (this.getChild("bar"));
  14105. }
  14106. }
  14107. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14108. class ui_ballDisplay extends fgui.GComponent {
  14109. static createInstance() {
  14110. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14111. }
  14112. onConstruct() {
  14113. this.myImg = (this.getChild("myImg"));
  14114. }
  14115. }
  14116. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14117. class ui_moveNode extends fgui.GComponent {
  14118. static createInstance() {
  14119. return (fgui.UIPackage.createObject("game", "moveNode"));
  14120. }
  14121. onConstruct() {
  14122. this.n8 = (this.getChild("n8"));
  14123. this.finger = (this.getChild("finger"));
  14124. }
  14125. }
  14126. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14127. class ui_cancelBtn extends fgui.GButton {
  14128. static createInstance() {
  14129. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14130. }
  14131. onConstruct() {
  14132. this.c1 = this.getController("c1");
  14133. this.n0 = (this.getChild("n0"));
  14134. this.n1 = (this.getChild("n1"));
  14135. }
  14136. }
  14137. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14138. class ui_shareBtn extends fgui.GButton {
  14139. static createInstance() {
  14140. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14141. }
  14142. onConstruct() {
  14143. this.c1 = this.getController("c1");
  14144. this.n2 = (this.getChild("n2"));
  14145. this.n1 = (this.getChild("n1"));
  14146. this.n3 = (this.getChild("n3"));
  14147. this.n4 = (this.getChild("n4"));
  14148. this.n5 = (this.getChild("n5"));
  14149. this.n6 = (this.getChild("n6"));
  14150. }
  14151. }
  14152. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14153. class ui_share2Btn extends fgui.GButton {
  14154. static createInstance() {
  14155. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14156. }
  14157. onConstruct() {
  14158. this.n3 = (this.getChild("n3"));
  14159. }
  14160. }
  14161. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14162. class ui_rodMethodNode extends fgui.GComponent {
  14163. static createInstance() {
  14164. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14165. }
  14166. onConstruct() {
  14167. this.bg = (this.getChild("bg"));
  14168. this.dot = (this.getChild("dot"));
  14169. }
  14170. }
  14171. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14172. class ui_sureBtn extends fgui.GButton {
  14173. static createInstance() {
  14174. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14175. }
  14176. onConstruct() {
  14177. this.n2 = (this.getChild("n2"));
  14178. this.n1 = (this.getChild("n1"));
  14179. }
  14180. }
  14181. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14182. class ui_Component18 extends fgui.GComponent {
  14183. static createInstance() {
  14184. return (fgui.UIPackage.createObject("game", "Component18"));
  14185. }
  14186. onConstruct() {
  14187. this.c1 = this.getController("c1");
  14188. this.nameTxt = (this.getChild("nameTxt"));
  14189. this.headImg = (this.getChild("headImg"));
  14190. this.n24 = (this.getChild("n24"));
  14191. this.skillImg = (this.getChild("skillImg"));
  14192. this.skillTxt = (this.getChild("skillTxt"));
  14193. }
  14194. }
  14195. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14196. class ui_Component45 extends fgui.GComponent {
  14197. static createInstance() {
  14198. return (fgui.UIPackage.createObject("game", "Component45"));
  14199. }
  14200. onConstruct() {
  14201. this.c1 = this.getController("c1");
  14202. this.n40 = (this.getChild("n40"));
  14203. this.n41 = (this.getChild("n41"));
  14204. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14205. this.n42 = (this.getChild("n42"));
  14206. this.awardTxt = (this.getChild("awardTxt"));
  14207. this.n44 = (this.getChild("n44"));
  14208. this.t0 = this.getTransition("t0");
  14209. }
  14210. }
  14211. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14212. class ui_emotionDisplay extends fgui.GButton {
  14213. static createInstance() {
  14214. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14215. }
  14216. onConstruct() {
  14217. this.myIcon = (this.getChild("myIcon"));
  14218. }
  14219. }
  14220. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14221. class ui_Component49 extends fgui.GButton {
  14222. static createInstance() {
  14223. return (fgui.UIPackage.createObject("game", "Component49"));
  14224. }
  14225. onConstruct() {
  14226. this.n69 = (this.getChild("n69"));
  14227. this.n56 = (this.getChild("n56"));
  14228. }
  14229. }
  14230. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14231. class ui_Component50 extends fgui.GButton {
  14232. static createInstance() {
  14233. return (fgui.UIPackage.createObject("game", "Component50"));
  14234. }
  14235. onConstruct() {
  14236. this.n54 = (this.getChild("n54"));
  14237. this.n65 = (this.getChild("n65"));
  14238. }
  14239. }
  14240. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14241. class ui_Component51 extends fgui.GButton {
  14242. static createInstance() {
  14243. return (fgui.UIPackage.createObject("game", "Component51"));
  14244. }
  14245. onConstruct() {
  14246. this.c1 = this.getController("c1");
  14247. this.n51 = (this.getChild("n51"));
  14248. this.n54 = (this.getChild("n54"));
  14249. }
  14250. }
  14251. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14252. class ui_Button5 extends fgui.GButton {
  14253. static createInstance() {
  14254. return (fgui.UIPackage.createObject("game", "Button5"));
  14255. }
  14256. onConstruct() {
  14257. this.c1 = this.getController("c1");
  14258. this.n0 = (this.getChild("n0"));
  14259. this.n2 = (this.getChild("n2"));
  14260. }
  14261. }
  14262. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14263. class ui_Component124 extends fgui.GComponent {
  14264. static createInstance() {
  14265. return (fgui.UIPackage.createObject("game", "Component124"));
  14266. }
  14267. onConstruct() {
  14268. this.n22 = (this.getChild("n22"));
  14269. this.shareNode = (this.getChild("shareNode"));
  14270. }
  14271. }
  14272. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14273. class ui_Component125 extends fgui.GComponent {
  14274. static createInstance() {
  14275. return (fgui.UIPackage.createObject("game", "Component125"));
  14276. }
  14277. onConstruct() {
  14278. this.n29 = (this.getChild("n29"));
  14279. this.coinTxt = (this.getChild("coinTxt"));
  14280. }
  14281. }
  14282. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14283. class ui_Component52 extends fgui.GButton {
  14284. static createInstance() {
  14285. return (fgui.UIPackage.createObject("game", "Component52"));
  14286. }
  14287. onConstruct() {
  14288. this.n35 = (this.getChild("n35"));
  14289. this.n36 = (this.getChild("n36"));
  14290. }
  14291. }
  14292. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14293. class ui_Component_denglu extends fgui.GComponent {
  14294. static createInstance() {
  14295. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14296. }
  14297. onConstruct() {
  14298. this.c1 = this.getController("c1");
  14299. this.n102 = (this.getChild("n102"));
  14300. this.n103 = (this.getChild("n103"));
  14301. }
  14302. }
  14303. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14304. class ui_UIFuli1 extends fgui.GComponent {
  14305. static createInstance() {
  14306. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  14307. }
  14308. onConstruct() {
  14309. this.n1 = (this.getChild("n1"));
  14310. this.n2 = (this.getChild("n2"));
  14311. }
  14312. }
  14313. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  14314. class ui_Component_fl_1 extends fgui.GComponent {
  14315. static createInstance() {
  14316. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14317. }
  14318. onConstruct() {
  14319. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14320. this.txt_price = (this.getChild("txt_price"));
  14321. this.n_no = (this.getChild("n_no"));
  14322. this.n_buy = (this.getChild("n_buy"));
  14323. }
  14324. }
  14325. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14326. class ui_Component_fl_2 extends fgui.GComponent {
  14327. static createInstance() {
  14328. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14329. }
  14330. onConstruct() {
  14331. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14332. this.txt_price = (this.getChild("txt_price"));
  14333. this.n_no = (this.getChild("n_no"));
  14334. this.n_buy = (this.getChild("n_buy"));
  14335. }
  14336. }
  14337. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14338. class ui_UIFuli2 extends fgui.GComponent {
  14339. static createInstance() {
  14340. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  14341. }
  14342. onConstruct() {
  14343. this.n1 = (this.getChild("n1"));
  14344. this.n2 = (this.getChild("n2"));
  14345. }
  14346. }
  14347. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  14348. class ui_drawBtn extends fgui.GButton {
  14349. static createInstance() {
  14350. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14351. }
  14352. onConstruct() {
  14353. this.c1 = this.getController("c1");
  14354. this.n2 = (this.getChild("n2"));
  14355. this.n1 = (this.getChild("n1"));
  14356. this.n5 = (this.getChild("n5"));
  14357. }
  14358. }
  14359. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14360. class ui_Component43 extends fgui.GButton {
  14361. static createInstance() {
  14362. return (fgui.UIPackage.createObject("game", "Component43"));
  14363. }
  14364. onConstruct() {
  14365. this.n49 = (this.getChild("n49"));
  14366. }
  14367. }
  14368. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14369. class ui_wordsDisplay extends fgui.GComponent {
  14370. static createInstance() {
  14371. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14372. }
  14373. onConstruct() {
  14374. this.txt = (this.getChild("txt"));
  14375. this.n63 = (this.getChild("n63"));
  14376. }
  14377. }
  14378. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14379. class ui_Component_phb extends fgui.GComponent {
  14380. static createInstance() {
  14381. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14382. }
  14383. onConstruct() {
  14384. this.n3 = (this.getChild("n3"));
  14385. this.n4 = (this.getChild("n4"));
  14386. }
  14387. }
  14388. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14389. class ui_Component3 extends fgui.GComponent {
  14390. static createInstance() {
  14391. return (fgui.UIPackage.createObject("game", "Component3"));
  14392. }
  14393. onConstruct() {
  14394. this.n26 = (this.getChild("n26"));
  14395. this.n24 = (this.getChild("n24"));
  14396. this.nameTxt = (this.getChild("nameTxt"));
  14397. this.headRoot = (this.getChild("headRoot"));
  14398. }
  14399. }
  14400. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14401. class ui_Component4 extends fgui.GComponent {
  14402. static createInstance() {
  14403. return (fgui.UIPackage.createObject("game", "Component4"));
  14404. }
  14405. onConstruct() {
  14406. this.headImg = (this.getChild("headImg"));
  14407. }
  14408. }
  14409. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14410. class ui_Component7 extends fgui.GButton {
  14411. static createInstance() {
  14412. return (fgui.UIPackage.createObject("game", "Component7"));
  14413. }
  14414. onConstruct() {
  14415. this.n17 = (this.getChild("n17"));
  14416. }
  14417. }
  14418. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14419. class ui_Component8 extends fgui.GButton {
  14420. static createInstance() {
  14421. return (fgui.UIPackage.createObject("game", "Component8"));
  14422. }
  14423. onConstruct() {
  14424. this.n19 = (this.getChild("n19"));
  14425. }
  14426. }
  14427. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14428. class ui_Component10 extends fgui.GButton {
  14429. static createInstance() {
  14430. return (fgui.UIPackage.createObject("game", "Component10"));
  14431. }
  14432. onConstruct() {
  14433. this.c1 = this.getController("c1");
  14434. this.n40 = (this.getChild("n40"));
  14435. }
  14436. }
  14437. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14438. class ui_Component11 extends fgui.GButton {
  14439. static createInstance() {
  14440. return (fgui.UIPackage.createObject("game", "Component11"));
  14441. }
  14442. onConstruct() {
  14443. this.n34 = (this.getChild("n34"));
  14444. }
  14445. }
  14446. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14447. class ui_Component12 extends fgui.GButton {
  14448. static createInstance() {
  14449. return (fgui.UIPackage.createObject("game", "Component12"));
  14450. }
  14451. onConstruct() {
  14452. this.n35 = (this.getChild("n35"));
  14453. }
  14454. }
  14455. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14456. class ui_Component13 extends fgui.GButton {
  14457. static createInstance() {
  14458. return (fgui.UIPackage.createObject("game", "Component13"));
  14459. }
  14460. onConstruct() {
  14461. this.n27 = (this.getChild("n27"));
  14462. this.n36 = (this.getChild("n36"));
  14463. }
  14464. }
  14465. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14466. class ui_dh_js_tuowei extends fgui.GComponent {
  14467. static createInstance() {
  14468. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14469. }
  14470. onConstruct() {
  14471. this.n19 = (this.getChild("n19"));
  14472. this.n18 = (this.getChild("n18"));
  14473. this.n0 = (this.getChild("n0"));
  14474. this.n3 = (this.getChild("n3"));
  14475. this.n4 = (this.getChild("n4"));
  14476. this.n5 = (this.getChild("n5"));
  14477. this.n6 = (this.getChild("n6"));
  14478. this.n8 = (this.getChild("n8"));
  14479. this.n9 = (this.getChild("n9"));
  14480. this.n10 = (this.getChild("n10"));
  14481. this.n11 = (this.getChild("n11"));
  14482. this.n12 = (this.getChild("n12"));
  14483. this.n13 = (this.getChild("n13"));
  14484. this.n14 = (this.getChild("n14"));
  14485. this.n15 = (this.getChild("n15"));
  14486. this.n20 = (this.getChild("n20"));
  14487. this.t0 = this.getTransition("t0");
  14488. this.t1 = this.getTransition("t1");
  14489. }
  14490. }
  14491. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14492. class ui_dh_js_tw_g extends fgui.GComponent {
  14493. static createInstance() {
  14494. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14495. }
  14496. onConstruct() {
  14497. this.n0 = (this.getChild("n0"));
  14498. this.n1 = (this.getChild("n1"));
  14499. this.t0 = this.getTransition("t0");
  14500. }
  14501. }
  14502. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14503. class ui_dh_js_xingxing extends fgui.GComponent {
  14504. static createInstance() {
  14505. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14506. }
  14507. onConstruct() {
  14508. this.n1 = (this.getChild("n1"));
  14509. this.n2 = (this.getChild("n2"));
  14510. this.n3 = (this.getChild("n3"));
  14511. this.n4 = (this.getChild("n4"));
  14512. this.n0 = (this.getChild("n0"));
  14513. this.t2 = this.getTransition("t2");
  14514. this.t1 = this.getTransition("t1");
  14515. }
  14516. }
  14517. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14518. class ui_dh_zy_jiazai extends fgui.GComponent {
  14519. static createInstance() {
  14520. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14521. }
  14522. onConstruct() {
  14523. this.c1 = this.getController("c1");
  14524. this.n0 = (this.getChild("n0"));
  14525. this.n1 = (this.getChild("n1"));
  14526. this.n2 = (this.getChild("n2"));
  14527. this.n4 = (this.getChild("n4"));
  14528. this.n5 = (this.getChild("n5"));
  14529. this.n6 = (this.getChild("n6"));
  14530. this.n8 = (this.getChild("n8"));
  14531. this.n7 = (this.getChild("n7"));
  14532. this.t0 = this.getTransition("t0");
  14533. }
  14534. }
  14535. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14536. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14537. static createInstance() {
  14538. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14539. }
  14540. onConstruct() {
  14541. this.c1 = this.getController("c1");
  14542. this.n3 = (this.getChild("n3"));
  14543. this.n5 = (this.getChild("n5"));
  14544. this.n4 = (this.getChild("n4"));
  14545. this.n0 = (this.getChild("n0"));
  14546. this.n1 = (this.getChild("n1"));
  14547. this.n2 = (this.getChild("n2"));
  14548. }
  14549. }
  14550. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14551. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14552. static createInstance() {
  14553. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14554. }
  14555. onConstruct() {
  14556. this.n19 = (this.getChild("n19"));
  14557. this.n21 = (this.getChild("n21"));
  14558. this.n0 = (this.getChild("n0"));
  14559. this.n3 = (this.getChild("n3"));
  14560. this.n4 = (this.getChild("n4"));
  14561. this.n5 = (this.getChild("n5"));
  14562. this.n6 = (this.getChild("n6"));
  14563. this.n8 = (this.getChild("n8"));
  14564. this.n9 = (this.getChild("n9"));
  14565. this.n10 = (this.getChild("n10"));
  14566. this.n11 = (this.getChild("n11"));
  14567. this.n12 = (this.getChild("n12"));
  14568. this.n13 = (this.getChild("n13"));
  14569. this.n14 = (this.getChild("n14"));
  14570. this.n15 = (this.getChild("n15"));
  14571. this.n23 = (this.getChild("n23"));
  14572. this.t0 = this.getTransition("t0");
  14573. this.t1 = this.getTransition("t1");
  14574. }
  14575. }
  14576. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14577. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14578. static createInstance() {
  14579. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14580. }
  14581. onConstruct() {
  14582. this.n1 = (this.getChild("n1"));
  14583. this.n2 = (this.getChild("n2"));
  14584. this.t0 = this.getTransition("t0");
  14585. }
  14586. }
  14587. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14588. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14589. static createInstance() {
  14590. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14591. }
  14592. onConstruct() {
  14593. this.n4 = (this.getChild("n4"));
  14594. this.n2 = (this.getChild("n2"));
  14595. this.n3 = (this.getChild("n3"));
  14596. this.idle = this.getTransition("idle");
  14597. this.attack = this.getTransition("attack");
  14598. }
  14599. }
  14600. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14601. class ui_special extends fgui.GComponent {
  14602. static createInstance() {
  14603. return (fgui.UIPackage.createObject("game", "special"));
  14604. }
  14605. onConstruct() {
  14606. this.n18 = (this.getChild("n18"));
  14607. this.n19 = (this.getChild("n19"));
  14608. this.n20 = (this.getChild("n20"));
  14609. this.n21 = (this.getChild("n21"));
  14610. this.n22 = (this.getChild("n22"));
  14611. this.levelTxt = (this.getChild("levelTxt"));
  14612. this.n24 = (this.getChild("n24"));
  14613. this.n25 = (this.getChild("n25"));
  14614. this.t0 = this.getTransition("t0");
  14615. }
  14616. }
  14617. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14618. class ui_Component145 extends fgui.GComponent {
  14619. static createInstance() {
  14620. return (fgui.UIPackage.createObject("game", "Component145"));
  14621. }
  14622. onConstruct() {
  14623. this.guanyuNode = (this.getChild("guanyuNode"));
  14624. }
  14625. }
  14626. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14627. class ui_longBtn extends fgui.GButton {
  14628. static createInstance() {
  14629. return (fgui.UIPackage.createObject("game", "longBtn"));
  14630. }
  14631. onConstruct() {
  14632. this.c1 = this.getController("c1");
  14633. this.n2 = (this.getChild("n2"));
  14634. this.n1 = (this.getChild("n1"));
  14635. this.n4 = (this.getChild("n4"));
  14636. }
  14637. }
  14638. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14639. class ui_Component146 extends fgui.GComponent {
  14640. static createInstance() {
  14641. return (fgui.UIPackage.createObject("game", "Component146"));
  14642. }
  14643. onConstruct() {
  14644. this.n89 = (this.getChild("n89"));
  14645. this.n90 = (this.getChild("n90"));
  14646. this.guideBtn = (this.getChild("guideBtn"));
  14647. }
  14648. }
  14649. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14650. class ui_Component146_11 extends fgui.GComponent {
  14651. static createInstance() {
  14652. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14653. }
  14654. onConstruct() {
  14655. this.n89 = (this.getChild("n89"));
  14656. this.n90 = (this.getChild("n90"));
  14657. this.guideBtn = (this.getChild("guideBtn"));
  14658. }
  14659. }
  14660. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14661. class ui_Component111_1 extends fgui.GComponent {
  14662. static createInstance() {
  14663. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14664. }
  14665. onConstruct() {
  14666. this.n68 = (this.getChild("n68"));
  14667. this.myMask = (this.getChild("myMask"));
  14668. }
  14669. }
  14670. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14671. class ui_Component64_1 extends fgui.GComponent {
  14672. static createInstance() {
  14673. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14674. }
  14675. onConstruct() {
  14676. this.n57 = (this.getChild("n57"));
  14677. this.n54 = (this.getChild("n54"));
  14678. this.n55 = (this.getChild("n55"));
  14679. this.n56 = (this.getChild("n56"));
  14680. this.t1 = this.getTransition("t1");
  14681. }
  14682. }
  14683. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14684. class ui_ModeSelection_com123 extends fgui.GComponent {
  14685. static createInstance() {
  14686. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14687. }
  14688. onConstruct() {
  14689. this.type1 = (this.getChild("type1"));
  14690. this.type2 = (this.getChild("type2"));
  14691. this.type3 = (this.getChild("type3"));
  14692. this.n38 = (this.getChild("n38"));
  14693. this.t0 = this.getTransition("t0");
  14694. }
  14695. }
  14696. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14697. class ui_Component132_2 extends fgui.GComponent {
  14698. static createInstance() {
  14699. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14700. }
  14701. onConstruct() {
  14702. this.n25 = (this.getChild("n25"));
  14703. this.n26 = (this.getChild("n26"));
  14704. this.n27 = (this.getChild("n27"));
  14705. this.t0 = this.getTransition("t0");
  14706. }
  14707. }
  14708. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14709. class ui_UIPower$1 extends fgui.GComponent {
  14710. static createInstance() {
  14711. return (fgui.UIPackage.createObject("game", "UIPower"));
  14712. }
  14713. onConstruct() {
  14714. this.n11 = (this.getChild("n11"));
  14715. this.myNode = (this.getChild("myNode"));
  14716. this.t0 = this.getTransition("t0");
  14717. }
  14718. }
  14719. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14720. class ui_Component133 extends fgui.GComponent {
  14721. static createInstance() {
  14722. return (fgui.UIPackage.createObject("game", "Component133"));
  14723. }
  14724. onConstruct() {
  14725. this.n29 = (this.getChild("n29"));
  14726. this.n30 = (this.getChild("n30"));
  14727. }
  14728. }
  14729. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14730. class ui_Component134 extends fgui.GComponent {
  14731. static createInstance() {
  14732. return (fgui.UIPackage.createObject("game", "Component134"));
  14733. }
  14734. onConstruct() {
  14735. this.n30 = (this.getChild("n30"));
  14736. this.n31 = (this.getChild("n31"));
  14737. this.t0 = this.getTransition("t0");
  14738. }
  14739. }
  14740. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14741. class ui_Component135 extends fgui.GComponent {
  14742. static createInstance() {
  14743. return (fgui.UIPackage.createObject("game", "Component135"));
  14744. }
  14745. onConstruct() {
  14746. this.n30 = (this.getChild("n30"));
  14747. this.t0 = this.getTransition("t0");
  14748. }
  14749. }
  14750. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14751. class ui_Component137 extends fgui.GComponent {
  14752. static createInstance() {
  14753. return (fgui.UIPackage.createObject("game", "Component137"));
  14754. }
  14755. onConstruct() {
  14756. this.n28 = (this.getChild("n28"));
  14757. this.n29 = (this.getChild("n29"));
  14758. this.n30 = (this.getChild("n30"));
  14759. this.n32 = (this.getChild("n32"));
  14760. }
  14761. }
  14762. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14763. class ui_dh_zuanshi extends fgui.GButton {
  14764. static createInstance() {
  14765. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14766. }
  14767. onConstruct() {
  14768. this.n1 = (this.getChild("n1"));
  14769. this.n2 = (this.getChild("n2"));
  14770. this.n0 = (this.getChild("n0"));
  14771. this.n3 = (this.getChild("n3"));
  14772. this.n4 = (this.getChild("n4"));
  14773. }
  14774. }
  14775. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14776. class ui_Component138 extends fgui.GComponent {
  14777. static createInstance() {
  14778. return (fgui.UIPackage.createObject("game", "Component138"));
  14779. }
  14780. onConstruct() {
  14781. this.n1 = (this.getChild("n1"));
  14782. this.n2 = (this.getChild("n2"));
  14783. this.t0 = this.getTransition("t0");
  14784. }
  14785. }
  14786. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14787. class ui_Component139 extends fgui.GComponent {
  14788. static createInstance() {
  14789. return (fgui.UIPackage.createObject("game", "Component139"));
  14790. }
  14791. onConstruct() {
  14792. this.n0 = (this.getChild("n0"));
  14793. this.t0 = this.getTransition("t0");
  14794. }
  14795. }
  14796. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14797. class ui_Component140 extends fgui.GComponent {
  14798. static createInstance() {
  14799. return (fgui.UIPackage.createObject("game", "Component140"));
  14800. }
  14801. onConstruct() {
  14802. this.n2 = (this.getChild("n2"));
  14803. this.n3 = (this.getChild("n3"));
  14804. this.t0 = this.getTransition("t0");
  14805. }
  14806. }
  14807. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14808. class ui_Component141 extends fgui.GComponent {
  14809. static createInstance() {
  14810. return (fgui.UIPackage.createObject("game", "Component141"));
  14811. }
  14812. onConstruct() {
  14813. this.n0 = (this.getChild("n0"));
  14814. this.t0 = this.getTransition("t0");
  14815. }
  14816. }
  14817. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14818. class ui_powerNode extends fgui.GProgressBar {
  14819. static createInstance() {
  14820. return (fgui.UIPackage.createObject("game", "powerNode"));
  14821. }
  14822. onConstruct() {
  14823. this.n2 = (this.getChild("n2"));
  14824. this.bar_v = (this.getChild("bar_v"));
  14825. this.showImg = (this.getChild("showImg"));
  14826. this.n12 = (this.getChild("n12"));
  14827. }
  14828. }
  14829. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14830. class ui_dh_jingbi1 extends fgui.GComponent {
  14831. static createInstance() {
  14832. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14833. }
  14834. onConstruct() {
  14835. this.n0 = (this.getChild("n0"));
  14836. this.n1 = (this.getChild("n1"));
  14837. this.n2 = (this.getChild("n2"));
  14838. this.n3 = (this.getChild("n3"));
  14839. this.n4 = (this.getChild("n4"));
  14840. this.n5 = (this.getChild("n5"));
  14841. this.n6 = (this.getChild("n6"));
  14842. this.n8 = (this.getChild("n8"));
  14843. this.t0 = this.getTransition("t0");
  14844. }
  14845. }
  14846. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14847. class ui_Component94 extends fgui.GButton {
  14848. static createInstance() {
  14849. return (fgui.UIPackage.createObject("game", "Component94"));
  14850. }
  14851. onConstruct() {
  14852. this.n77 = (this.getChild("n77"));
  14853. }
  14854. }
  14855. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14856. class ui_Component95 extends fgui.GButton {
  14857. static createInstance() {
  14858. return (fgui.UIPackage.createObject("game", "Component95"));
  14859. }
  14860. onConstruct() {
  14861. this.n77 = (this.getChild("n77"));
  14862. }
  14863. }
  14864. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14865. class ui_Component126 extends fgui.GComponent {
  14866. static createInstance() {
  14867. return (fgui.UIPackage.createObject("game", "Component126"));
  14868. }
  14869. onConstruct() {
  14870. this.c1 = this.getController("c1");
  14871. this.normalBtn = (this.getChild("normalBtn"));
  14872. this.tripleBtn = (this.getChild("tripleBtn"));
  14873. }
  14874. }
  14875. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14876. class ui_Component60 extends fgui.GComponent {
  14877. static createInstance() {
  14878. return (fgui.UIPackage.createObject("game", "Component60"));
  14879. }
  14880. onConstruct() {
  14881. this.c1 = this.getController("c1");
  14882. this.n48 = (this.getChild("n48"));
  14883. this.womanTxt = (this.getChild("womanTxt"));
  14884. this.t0 = this.getTransition("t0");
  14885. }
  14886. }
  14887. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14888. class ui_Button_h extends fgui.GButton {
  14889. static createInstance() {
  14890. return (fgui.UIPackage.createObject("game", "Button_h"));
  14891. }
  14892. onConstruct() {
  14893. this.button = this.getController("button");
  14894. this.n0 = (this.getChild("n0"));
  14895. }
  14896. }
  14897. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14898. class ui_Button_lv extends fgui.GButton {
  14899. static createInstance() {
  14900. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14901. }
  14902. onConstruct() {
  14903. this.button = this.getController("button");
  14904. this.n0 = (this.getChild("n0"));
  14905. }
  14906. }
  14907. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14908. class ui_Component98_3 extends fgui.GButton {
  14909. static createInstance() {
  14910. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14911. }
  14912. onConstruct() {
  14913. this.c1 = this.getController("c1");
  14914. this.n8 = (this.getChild("n8"));
  14915. this.n41 = (this.getChild("n41"));
  14916. this.n40 = (this.getChild("n40"));
  14917. }
  14918. }
  14919. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14920. class ui_ModeSelection_com1 extends fgui.GButton {
  14921. static createInstance() {
  14922. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14923. }
  14924. onConstruct() {
  14925. this.n34 = (this.getChild("n34"));
  14926. this.n36 = (this.getChild("n36"));
  14927. this.n22 = (this.getChild("n22"));
  14928. this.n20 = (this.getChild("n20"));
  14929. this.n23 = (this.getChild("n23"));
  14930. this.n24 = (this.getChild("n24"));
  14931. this.n26 = (this.getChild("n26"));
  14932. this.n33 = (this.getChild("n33"));
  14933. this.coinImg = (this.getChild("coinImg"));
  14934. this.need = (this.getChild("need"));
  14935. this.n35 = (this.getChild("n35"));
  14936. this.n29 = (this.getChild("n29"));
  14937. this.tipsTxt = (this.getChild("tipsTxt"));
  14938. this.n30 = (this.getChild("n30"));
  14939. this.peopleTxt = (this.getChild("peopleTxt"));
  14940. this.t0 = this.getTransition("t0");
  14941. }
  14942. }
  14943. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14944. class ui_ModeSelection_com2 extends fgui.GButton {
  14945. static createInstance() {
  14946. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14947. }
  14948. onConstruct() {
  14949. this.n36 = (this.getChild("n36"));
  14950. this.n34 = (this.getChild("n34"));
  14951. this.n22 = (this.getChild("n22"));
  14952. this.n20 = (this.getChild("n20"));
  14953. this.n23 = (this.getChild("n23"));
  14954. this.n24 = (this.getChild("n24"));
  14955. this.n26 = (this.getChild("n26"));
  14956. this.n33 = (this.getChild("n33"));
  14957. this.coinImg = (this.getChild("coinImg"));
  14958. this.need = (this.getChild("need"));
  14959. this.n35 = (this.getChild("n35"));
  14960. this.n29 = (this.getChild("n29"));
  14961. this.tipsTxt = (this.getChild("tipsTxt"));
  14962. this.n30 = (this.getChild("n30"));
  14963. this.peopleTxt = (this.getChild("peopleTxt"));
  14964. this.t0 = this.getTransition("t0");
  14965. }
  14966. }
  14967. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14968. class ui_ModeSelection_com3 extends fgui.GButton {
  14969. static createInstance() {
  14970. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14971. }
  14972. onConstruct() {
  14973. this.n34 = (this.getChild("n34"));
  14974. this.n36 = (this.getChild("n36"));
  14975. this.n22 = (this.getChild("n22"));
  14976. this.n20 = (this.getChild("n20"));
  14977. this.n23 = (this.getChild("n23"));
  14978. this.n24 = (this.getChild("n24"));
  14979. this.n26 = (this.getChild("n26"));
  14980. this.n33 = (this.getChild("n33"));
  14981. this.coinImg = (this.getChild("coinImg"));
  14982. this.need = (this.getChild("need"));
  14983. this.n35 = (this.getChild("n35"));
  14984. this.n29 = (this.getChild("n29"));
  14985. this.tipsTxt = (this.getChild("tipsTxt"));
  14986. this.n30 = (this.getChild("n30"));
  14987. this.peopleTxt = (this.getChild("peopleTxt"));
  14988. this.t0 = this.getTransition("t0");
  14989. }
  14990. }
  14991. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14992. class ui_Invitation_com1 extends fgui.GComponent {
  14993. static createInstance() {
  14994. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14995. }
  14996. onConstruct() {
  14997. this.n14 = (this.getChild("n14"));
  14998. this.n13 = (this.getChild("n13"));
  14999. this.n3 = (this.getChild("n3"));
  15000. this.n1 = (this.getChild("n1"));
  15001. this.n6 = (this.getChild("n6"));
  15002. this.n7 = (this.getChild("n7"));
  15003. this.enterBtn = (this.getChild("enterBtn"));
  15004. this.n11 = (this.getChild("n11"));
  15005. this.n12 = (this.getChild("n12"));
  15006. this.n15 = (this.getChild("n15"));
  15007. this.t0 = this.getTransition("t0");
  15008. this.t1 = this.getTransition("t1");
  15009. }
  15010. }
  15011. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  15012. class ui_Component87_1 extends fgui.GComponent {
  15013. static createInstance() {
  15014. return (fgui.UIPackage.createObject("game", "Component87_1"));
  15015. }
  15016. onConstruct() {
  15017. this.n74 = (this.getChild("n74"));
  15018. this.n73 = (this.getChild("n73"));
  15019. this.ballTxt = (this.getChild("ballTxt"));
  15020. this.n76 = (this.getChild("n76"));
  15021. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15022. this.levelTxt = (this.getChild("levelTxt"));
  15023. this.n87 = (this.getChild("n87"));
  15024. this.n84 = (this.getChild("n84"));
  15025. this.hpTxt = (this.getChild("hpTxt"));
  15026. this.n89 = (this.getChild("n89"));
  15027. this.tipsTxt = (this.getChild("tipsTxt"));
  15028. }
  15029. }
  15030. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  15031. class ui_Component_lc3 extends fgui.GComponent {
  15032. static createInstance() {
  15033. return (fgui.UIPackage.createObject("game", "Component_lc3"));
  15034. }
  15035. onConstruct() {
  15036. this.n0 = (this.getChild("n0"));
  15037. this.n2 = (this.getChild("n2"));
  15038. this.n1_bai = (this.getChild("n1_bai"));
  15039. }
  15040. }
  15041. ui_Component_lc3.URL = "ui://isxx5ak7lvbnv5b1";
  15042. class ui_Component_shou3 extends fgui.GComponent {
  15043. static createInstance() {
  15044. return (fgui.UIPackage.createObject("game", "Component_shou3"));
  15045. }
  15046. onConstruct() {
  15047. this.n57 = (this.getChild("n57"));
  15048. this.n54 = (this.getChild("n54"));
  15049. this.n55 = (this.getChild("n55"));
  15050. this.n56 = (this.getChild("n56"));
  15051. this.t1 = this.getTransition("t1");
  15052. }
  15053. }
  15054. ui_Component_shou3.URL = "ui://isxx5ak7lvbnv5b2";
  15055. class ui_sqg1 extends fgui.GComponent {
  15056. static createInstance() {
  15057. return (fgui.UIPackage.createObject("game", "sqg1"));
  15058. }
  15059. onConstruct() {
  15060. this.n1 = (this.getChild("n1"));
  15061. this.n0 = (this.getChild("n0"));
  15062. }
  15063. }
  15064. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  15065. class ui_sqg2 extends fgui.GComponent {
  15066. static createInstance() {
  15067. return (fgui.UIPackage.createObject("game", "sqg2"));
  15068. }
  15069. onConstruct() {
  15070. this.n1 = (this.getChild("n1"));
  15071. this.n0 = (this.getChild("n0"));
  15072. }
  15073. }
  15074. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  15075. class ui_sqg3 extends fgui.GComponent {
  15076. static createInstance() {
  15077. return (fgui.UIPackage.createObject("game", "sqg3"));
  15078. }
  15079. onConstruct() {
  15080. this.n1 = (this.getChild("n1"));
  15081. this.n0 = (this.getChild("n0"));
  15082. }
  15083. }
  15084. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  15085. class ui_sqg4 extends fgui.GComponent {
  15086. static createInstance() {
  15087. return (fgui.UIPackage.createObject("game", "sqg4"));
  15088. }
  15089. onConstruct() {
  15090. this.n1 = (this.getChild("n1"));
  15091. this.n0 = (this.getChild("n0"));
  15092. }
  15093. }
  15094. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  15095. class ui_Component36 extends fgui.GButton {
  15096. static createInstance() {
  15097. return (fgui.UIPackage.createObject("game", "Component36"));
  15098. }
  15099. onConstruct() {
  15100. this.c1 = this.getController("c1");
  15101. this.n53 = (this.getChild("n53"));
  15102. this.n56 = (this.getChild("n56"));
  15103. }
  15104. }
  15105. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  15106. class ui_Component37 extends fgui.GButton {
  15107. static createInstance() {
  15108. return (fgui.UIPackage.createObject("game", "Component37"));
  15109. }
  15110. onConstruct() {
  15111. this.c1 = this.getController("c1");
  15112. this.n52 = (this.getChild("n52"));
  15113. this.n54 = (this.getChild("n54"));
  15114. }
  15115. }
  15116. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  15117. class ui_UISetting extends fgui.GComponent {
  15118. static createInstance() {
  15119. return (fgui.UIPackage.createObject("game", "UISetting"));
  15120. }
  15121. onConstruct() {
  15122. this.c1 = this.getController("c1");
  15123. this.n4 = (this.getChild("n4"));
  15124. this.soundBtn = (this.getChild("soundBtn"));
  15125. this.shakeBtn = (this.getChild("shakeBtn"));
  15126. this.clickNode = (this.getChild("clickNode"));
  15127. this.xyBtn = (this.getChild("xyBtn"));
  15128. }
  15129. }
  15130. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15131. class ui_Component39 extends fgui.GComponent {
  15132. static createInstance() {
  15133. return (fgui.UIPackage.createObject("game", "Component39"));
  15134. }
  15135. onConstruct() {
  15136. this.n5 = (this.getChild("n5"));
  15137. this.n6 = (this.getChild("n6"));
  15138. this.n7 = (this.getChild("n7"));
  15139. this.t0 = this.getTransition("t0");
  15140. }
  15141. }
  15142. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15143. class ui_Component40 extends fgui.GButton {
  15144. static createInstance() {
  15145. return (fgui.UIPackage.createObject("game", "Component40"));
  15146. }
  15147. onConstruct() {
  15148. this.n46 = (this.getChild("n46"));
  15149. this.n47 = (this.getChild("n47"));
  15150. }
  15151. }
  15152. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15153. class ui_Component41 extends fgui.GComponent {
  15154. static createInstance() {
  15155. return (fgui.UIPackage.createObject("game", "Component41"));
  15156. }
  15157. onConstruct() {
  15158. this.c1 = this.getController("c1");
  15159. this.n0 = (this.getChild("n0"));
  15160. this.titleTxt = (this.getChild("titleTxt"));
  15161. this.n2 = (this.getChild("n2"));
  15162. this.msgTips = (this.getChild("msgTips"));
  15163. this.numTxt = (this.getChild("numTxt"));
  15164. this.n18 = (this.getChild("n18"));
  15165. this.cancelBtn = (this.getChild("cancelBtn"));
  15166. this.videoBtn = (this.getChild("videoBtn"));
  15167. this.n10 = (this.getChild("n10"));
  15168. }
  15169. }
  15170. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15171. class ui_Component42 extends fgui.GComponent {
  15172. static createInstance() {
  15173. return (fgui.UIPackage.createObject("game", "Component42"));
  15174. }
  15175. onConstruct() {
  15176. this.c1 = this.getController("c1");
  15177. this.n1 = (this.getChild("n1"));
  15178. this.n2 = (this.getChild("n2"));
  15179. this.n3 = (this.getChild("n3"));
  15180. this.tipsTxt = (this.getChild("tipsTxt"));
  15181. this.cancelBtn = (this.getChild("cancelBtn"));
  15182. this.sureBtn = (this.getChild("sureBtn"));
  15183. this.n11 = (this.getChild("n11"));
  15184. this.n13 = (this.getChild("n13"));
  15185. this.n14 = (this.getChild("n14"));
  15186. this.womanTxt = (this.getChild("womanTxt"));
  15187. this.t0 = this.getTransition("t0");
  15188. }
  15189. }
  15190. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15191. class ui_dh_js_shengli extends fgui.GComponent {
  15192. static createInstance() {
  15193. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15194. }
  15195. onConstruct() {
  15196. this.n3 = (this.getChild("n3"));
  15197. this.n4 = (this.getChild("n4"));
  15198. this.n1 = (this.getChild("n1"));
  15199. this.n2 = (this.getChild("n2"));
  15200. this.n5 = (this.getChild("n5"));
  15201. this.n6 = (this.getChild("n6"));
  15202. this.n7 = (this.getChild("n7"));
  15203. this.n8 = (this.getChild("n8"));
  15204. this.attack = this.getTransition("attack");
  15205. this.idle = this.getTransition("idle");
  15206. }
  15207. }
  15208. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15209. class ui_dh_js_shengli_g extends fgui.GComponent {
  15210. static createInstance() {
  15211. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15212. }
  15213. onConstruct() {
  15214. this.n3 = (this.getChild("n3"));
  15215. this.n1 = (this.getChild("n1"));
  15216. this.t0 = this.getTransition("t0");
  15217. }
  15218. }
  15219. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15220. class ui_dh_js_shibai extends fgui.GComponent {
  15221. static createInstance() {
  15222. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15223. }
  15224. onConstruct() {
  15225. this.n0 = (this.getChild("n0"));
  15226. this.n1 = (this.getChild("n1"));
  15227. this.n2 = (this.getChild("n2"));
  15228. this.n3 = (this.getChild("n3"));
  15229. this.idle = this.getTransition("idle");
  15230. this.attack = this.getTransition("attack");
  15231. }
  15232. }
  15233. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15234. class ui_dh_zy_ganfa extends fgui.GButton {
  15235. static createInstance() {
  15236. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15237. }
  15238. onConstruct() {
  15239. this.n0 = (this.getChild("n0"));
  15240. }
  15241. }
  15242. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15243. class ui_dh_zy_sc_guang extends fgui.GButton {
  15244. static createInstance() {
  15245. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15246. }
  15247. onConstruct() {
  15248. this.n0 = (this.getChild("n0"));
  15249. this.n2 = (this.getChild("n2"));
  15250. }
  15251. }
  15252. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15253. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15254. static createInstance() {
  15255. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15256. }
  15257. onConstruct() {
  15258. this.n0 = (this.getChild("n0"));
  15259. this.n3 = (this.getChild("n3"));
  15260. }
  15261. }
  15262. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15263. class ui_dh_zy_wanfa extends fgui.GButton {
  15264. static createInstance() {
  15265. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15266. }
  15267. onConstruct() {
  15268. this.n0 = (this.getChild("n0"));
  15269. }
  15270. }
  15271. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15272. class ui_Button_login extends fgui.GButton {
  15273. static createInstance() {
  15274. return (fgui.UIPackage.createObject("game", "Button_login"));
  15275. }
  15276. onConstruct() {
  15277. this.button = this.getController("button");
  15278. this.n5 = (this.getChild("n5"));
  15279. }
  15280. }
  15281. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15282. class ui_Component53_1 extends fgui.GComponent {
  15283. static createInstance() {
  15284. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15285. }
  15286. onConstruct() {
  15287. this.n0 = (this.getChild("n0"));
  15288. this.n1 = (this.getChild("n1"));
  15289. this.n2 = (this.getChild("n2"));
  15290. this.n3 = (this.getChild("n3"));
  15291. this.n4 = (this.getChild("n4"));
  15292. this.n5 = (this.getChild("n5"));
  15293. this.n6 = (this.getChild("n6"));
  15294. this.n7 = (this.getChild("n7"));
  15295. this.n8 = (this.getChild("n8"));
  15296. this.n9 = (this.getChild("n9"));
  15297. this.n10 = (this.getChild("n10"));
  15298. this.n11 = (this.getChild("n11"));
  15299. this.n12 = (this.getChild("n12"));
  15300. this.n13 = (this.getChild("n13"));
  15301. this.n14 = (this.getChild("n14"));
  15302. this.n15 = (this.getChild("n15"));
  15303. this.n16 = (this.getChild("n16"));
  15304. this.n19 = (this.getChild("n19"));
  15305. this.n20 = (this.getChild("n20"));
  15306. this.n21 = (this.getChild("n21"));
  15307. this.n22 = (this.getChild("n22"));
  15308. this.n23 = (this.getChild("n23"));
  15309. this.n24 = (this.getChild("n24"));
  15310. this.n25 = (this.getChild("n25"));
  15311. this.n26 = (this.getChild("n26"));
  15312. this.n27 = (this.getChild("n27"));
  15313. this.n28 = (this.getChild("n28"));
  15314. this.n29 = (this.getChild("n29"));
  15315. this.n30 = (this.getChild("n30"));
  15316. this.n31 = (this.getChild("n31"));
  15317. this.n32 = (this.getChild("n32"));
  15318. this.n33 = (this.getChild("n33"));
  15319. this.n34 = (this.getChild("n34"));
  15320. this.n35 = (this.getChild("n35"));
  15321. this.t0 = this.getTransition("t0");
  15322. }
  15323. }
  15324. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15325. class ui_Component30 extends fgui.GComponent {
  15326. static createInstance() {
  15327. return (fgui.UIPackage.createObject("game", "Component30"));
  15328. }
  15329. onConstruct() {
  15330. this.c1 = this.getController("c1");
  15331. this.n46 = (this.getChild("n46"));
  15332. this.n47 = (this.getChild("n47"));
  15333. this.numTxt = (this.getChild("numTxt"));
  15334. this.n50 = (this.getChild("n50"));
  15335. this.n53 = (this.getChild("n53"));
  15336. this.n54 = (this.getChild("n54"));
  15337. this.n55 = (this.getChild("n55"));
  15338. this.n56 = (this.getChild("n56"));
  15339. }
  15340. }
  15341. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15342. class ui_Component30_1 extends fgui.GComponent {
  15343. static createInstance() {
  15344. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15345. }
  15346. onConstruct() {
  15347. this.c1 = this.getController("c1");
  15348. this.n46 = (this.getChild("n46"));
  15349. this.n47 = (this.getChild("n47"));
  15350. this.numTxt = (this.getChild("numTxt"));
  15351. this.n50 = (this.getChild("n50"));
  15352. this.n51 = (this.getChild("n51"));
  15353. this.n52 = (this.getChild("n52"));
  15354. this.n53 = (this.getChild("n53"));
  15355. this.n54 = (this.getChild("n54"));
  15356. }
  15357. }
  15358. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15359. class ui_Component31 extends fgui.GComponent {
  15360. static createInstance() {
  15361. return (fgui.UIPackage.createObject("game", "Component31"));
  15362. }
  15363. onConstruct() {
  15364. this.n55 = (this.getChild("n55"));
  15365. this.n54 = (this.getChild("n54"));
  15366. this.conditionTxt = (this.getChild("conditionTxt"));
  15367. this.n57 = (this.getChild("n57"));
  15368. this.t0 = this.getTransition("t0");
  15369. }
  15370. }
  15371. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15372. class ui_Component32 extends fgui.GComponent {
  15373. static createInstance() {
  15374. return (fgui.UIPackage.createObject("game", "Component32"));
  15375. }
  15376. onConstruct() {
  15377. this.n5 = (this.getChild("n5"));
  15378. this.n6 = (this.getChild("n6"));
  15379. this.n7 = (this.getChild("n7"));
  15380. this.t0 = this.getTransition("t0");
  15381. }
  15382. }
  15383. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15384. class ui_AwardItem extends fgui.GComponent {
  15385. static createInstance() {
  15386. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15387. }
  15388. onConstruct() {
  15389. this.n9 = (this.getChild("n9"));
  15390. this.myIcon = (this.getChild("myIcon"));
  15391. this.numTxt = (this.getChild("numTxt"));
  15392. this.nameTxt = (this.getChild("nameTxt"));
  15393. this.n16 = (this.getChild("n16"));
  15394. this.n17 = (this.getChild("n17"));
  15395. }
  15396. }
  15397. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15398. class ui_ranking_com1 extends fgui.GButton {
  15399. static createInstance() {
  15400. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15401. }
  15402. onConstruct() {
  15403. this.c1 = this.getController("c1");
  15404. this.n49 = (this.getChild("n49"));
  15405. this.n18 = (this.getChild("n18"));
  15406. this.n46 = (this.getChild("n46"));
  15407. this.n48 = (this.getChild("n48"));
  15408. this.n50 = (this.getChild("n50"));
  15409. }
  15410. }
  15411. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15412. class ui_ranking_com2 extends fgui.GButton {
  15413. static createInstance() {
  15414. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15415. }
  15416. onConstruct() {
  15417. this.c1 = this.getController("c1");
  15418. this.n49 = (this.getChild("n49"));
  15419. this.n18 = (this.getChild("n18"));
  15420. this.n46 = (this.getChild("n46"));
  15421. this.n48 = (this.getChild("n48"));
  15422. this.n50 = (this.getChild("n50"));
  15423. }
  15424. }
  15425. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15426. class ui_ranking_com3 extends fgui.GComponent {
  15427. static createInstance() {
  15428. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15429. }
  15430. onConstruct() {
  15431. this.n17 = (this.getChild("n17"));
  15432. this.myIcon = (this.getChild("myIcon"));
  15433. }
  15434. }
  15435. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15436. class ui_ranking_com4 extends fgui.GComponent {
  15437. static createInstance() {
  15438. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15439. }
  15440. onConstruct() {
  15441. this.n16 = (this.getChild("n16"));
  15442. this.head = (this.getChild("head"));
  15443. }
  15444. }
  15445. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15446. class ui_ranking_com5 extends fgui.GComponent {
  15447. static createInstance() {
  15448. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15449. }
  15450. onConstruct() {
  15451. this.c1 = this.getController("c1");
  15452. this.c2 = this.getController("c2");
  15453. this.n2 = (this.getChild("n2"));
  15454. this.n3 = (this.getChild("n3"));
  15455. this.levelBtn = (this.getChild("levelBtn"));
  15456. this.starBtn = (this.getChild("starBtn"));
  15457. this.n23 = (this.getChild("n23"));
  15458. this.n24 = (this.getChild("n24"));
  15459. this.n25 = (this.getChild("n25"));
  15460. this.myList = (this.getChild("myList"));
  15461. this.selfNode = (this.getChild("selfNode"));
  15462. this.n9 = (this.getChild("n9"));
  15463. this.n12 = (this.getChild("n12"));
  15464. this.n13 = (this.getChild("n13"));
  15465. this.n14 = (this.getChild("n14"));
  15466. this.n39 = (this.getChild("n39"));
  15467. this.n41 = (this.getChild("n41"));
  15468. this.n42 = (this.getChild("n42"));
  15469. this.n45 = (this.getChild("n45"));
  15470. this.changeBtn = (this.getChild("changeBtn"));
  15471. this.closeBtn = (this.getChild("closeBtn"));
  15472. this.t0 = this.getTransition("t0");
  15473. }
  15474. }
  15475. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15476. class ui_RankItem extends fgui.GComponent {
  15477. static createInstance() {
  15478. return (fgui.UIPackage.createObject("game", "RankItem"));
  15479. }
  15480. onConstruct() {
  15481. this.n10 = (this.getChild("n10"));
  15482. this.n11 = (this.getChild("n11"));
  15483. this.rankTxt = (this.getChild("rankTxt"));
  15484. this.headNode = (this.getChild("headNode"));
  15485. this.nameTxt = (this.getChild("nameTxt"));
  15486. this.n19 = (this.getChild("n19"));
  15487. this.valueTxt = (this.getChild("valueTxt"));
  15488. this.img1 = (this.getChild("img1"));
  15489. this.img2 = (this.getChild("img2"));
  15490. this.img3 = (this.getChild("img3"));
  15491. }
  15492. }
  15493. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15494. class ui_ranking_com9 extends fgui.GComponent {
  15495. static createInstance() {
  15496. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15497. }
  15498. onConstruct() {
  15499. this.c1 = this.getController("c1");
  15500. this.n27 = (this.getChild("n27"));
  15501. this.n28 = (this.getChild("n28"));
  15502. this.headNode = (this.getChild("headNode"));
  15503. this.rankTxt = (this.getChild("rankTxt"));
  15504. this.nameTxt = (this.getChild("nameTxt"));
  15505. this.n34 = (this.getChild("n34"));
  15506. this.valueTxt = (this.getChild("valueTxt"));
  15507. this.n36 = (this.getChild("n36"));
  15508. this.n37 = (this.getChild("n37"));
  15509. this.n38 = (this.getChild("n38"));
  15510. this.n39 = (this.getChild("n39"));
  15511. this.n40 = (this.getChild("n40"));
  15512. }
  15513. }
  15514. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15515. class ui_ranking_com10 extends fgui.GComponent {
  15516. static createInstance() {
  15517. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15518. }
  15519. onConstruct() {
  15520. this.n23 = (this.getChild("n23"));
  15521. this.n24 = (this.getChild("n24"));
  15522. }
  15523. }
  15524. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15525. class ui_ranking_com11 extends fgui.GComponent {
  15526. static createInstance() {
  15527. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15528. }
  15529. onConstruct() {
  15530. this.n24 = (this.getChild("n24"));
  15531. this.n25 = (this.getChild("n25"));
  15532. this.t0 = this.getTransition("t0");
  15533. }
  15534. }
  15535. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15536. class ui_ranking_com13 extends fgui.GButton {
  15537. static createInstance() {
  15538. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15539. }
  15540. onConstruct() {
  15541. this.c1 = this.getController("c1");
  15542. this.n44 = (this.getChild("n44"));
  15543. this.n45 = (this.getChild("n45"));
  15544. this.n46 = (this.getChild("n46"));
  15545. }
  15546. }
  15547. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15548. class ui_Component122 extends fgui.GComponent {
  15549. static createInstance() {
  15550. return (fgui.UIPackage.createObject("game", "Component122"));
  15551. }
  15552. onConstruct() {
  15553. this.gameNode3 = (this.getChild("gameNode3"));
  15554. }
  15555. }
  15556. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15557. class ui_skillItem extends fgui.GComponent {
  15558. static createInstance() {
  15559. return (fgui.UIPackage.createObject("game", "skillItem"));
  15560. }
  15561. onConstruct() {
  15562. this.c1 = this.getController("c1");
  15563. this.n31 = (this.getChild("n31"));
  15564. this.n6 = (this.getChild("n6"));
  15565. this.skillImg = (this.getChild("skillImg"));
  15566. this.nameTxt = (this.getChild("nameTxt"));
  15567. this.levelTxt = (this.getChild("levelTxt"));
  15568. this.n28 = (this.getChild("n28"));
  15569. this.describeTxt = (this.getChild("describeTxt"));
  15570. this.n32 = (this.getChild("n32"));
  15571. this.mutiBtn = (this.getChild("mutiBtn"));
  15572. this.tryNode = (this.getChild("tryNode"));
  15573. this.normalBtn = (this.getChild("normalBtn"));
  15574. this.startBtn = (this.getChild("startBtn"));
  15575. this.n42 = (this.getChild("n42"));
  15576. this.n43 = (this.getChild("n43"));
  15577. this.n44 = (this.getChild("n44"));
  15578. }
  15579. }
  15580. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15581. class ui_Component26 extends fgui.GButton {
  15582. static createInstance() {
  15583. return (fgui.UIPackage.createObject("game", "Component26"));
  15584. }
  15585. onConstruct() {
  15586. this.n11 = (this.getChild("n11"));
  15587. this.n30 = (this.getChild("n30"));
  15588. this.n34 = (this.getChild("n34"));
  15589. }
  15590. }
  15591. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15592. class ui_Component28 extends fgui.GButton {
  15593. static createInstance() {
  15594. return (fgui.UIPackage.createObject("game", "Component28"));
  15595. }
  15596. onConstruct() {
  15597. this.n12 = (this.getChild("n12"));
  15598. this.n31 = (this.getChild("n31"));
  15599. this.curTxt = (this.getChild("curTxt"));
  15600. this.n33 = (this.getChild("n33"));
  15601. }
  15602. }
  15603. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15604. class ui_Component1302 extends fgui.GComponent {
  15605. static createInstance() {
  15606. return (fgui.UIPackage.createObject("game", "Component1302"));
  15607. }
  15608. onConstruct() {
  15609. this.n2 = (this.getChild("n2"));
  15610. this.n3 = (this.getChild("n3"));
  15611. }
  15612. }
  15613. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15614. class ui_Component113 extends fgui.GComponent {
  15615. static createInstance() {
  15616. return (fgui.UIPackage.createObject("game", "Component113"));
  15617. }
  15618. onConstruct() {
  15619. this.n85 = (this.getChild("n85"));
  15620. this.n86 = (this.getChild("n86"));
  15621. this.n77 = (this.getChild("n77"));
  15622. this.n79 = (this.getChild("n79"));
  15623. this.n80 = (this.getChild("n80"));
  15624. this.n81 = (this.getChild("n81"));
  15625. this.n82 = (this.getChild("n82"));
  15626. this.n84 = (this.getChild("n84"));
  15627. this.n87 = (this.getChild("n87"));
  15628. this.t0 = this.getTransition("t0");
  15629. }
  15630. }
  15631. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15632. class ui_Component114 extends fgui.GComponent {
  15633. static createInstance() {
  15634. return (fgui.UIPackage.createObject("game", "Component114"));
  15635. }
  15636. onConstruct() {
  15637. this.n77 = (this.getChild("n77"));
  15638. this.t0 = this.getTransition("t0");
  15639. }
  15640. }
  15641. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15642. class ui_Component115 extends fgui.GComponent {
  15643. static createInstance() {
  15644. return (fgui.UIPackage.createObject("game", "Component115"));
  15645. }
  15646. onConstruct() {
  15647. this.n83 = (this.getChild("n83"));
  15648. this.fingerNode = (this.getChild("fingerNode"));
  15649. this.n84 = (this.getChild("n84"));
  15650. }
  15651. }
  15652. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15653. class ui_Component117 extends fgui.GComponent {
  15654. static createInstance() {
  15655. return (fgui.UIPackage.createObject("game", "Component117"));
  15656. }
  15657. onConstruct() {
  15658. this.n87 = (this.getChild("n87"));
  15659. this.n88 = (this.getChild("n88"));
  15660. this.n84 = (this.getChild("n84"));
  15661. this.n85 = (this.getChild("n85"));
  15662. this.n86 = (this.getChild("n86"));
  15663. this.t0 = this.getTransition("t0");
  15664. }
  15665. }
  15666. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15667. class ui_Component98_1 extends fgui.GButton {
  15668. static createInstance() {
  15669. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15670. }
  15671. onConstruct() {
  15672. this.c1 = this.getController("c1");
  15673. this.n8 = (this.getChild("n8"));
  15674. this.n41 = (this.getChild("n41"));
  15675. this.n40 = (this.getChild("n40"));
  15676. }
  15677. }
  15678. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15679. class ui_Component61 extends fgui.GComponent {
  15680. static createInstance() {
  15681. return (fgui.UIPackage.createObject("game", "Component61"));
  15682. }
  15683. onConstruct() {
  15684. this.n14 = (this.getChild("n14"));
  15685. this.n6 = (this.getChild("n6"));
  15686. this.t0 = this.getTransition("t0");
  15687. }
  15688. }
  15689. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15690. class ui_Component62 extends fgui.GComponent {
  15691. static createInstance() {
  15692. return (fgui.UIPackage.createObject("game", "Component62"));
  15693. }
  15694. onConstruct() {
  15695. this.n66 = (this.getChild("n66"));
  15696. this.n56 = (this.getChild("n56"));
  15697. this.n63 = (this.getChild("n63"));
  15698. this.n65 = (this.getChild("n65"));
  15699. this.t0 = this.getTransition("t0");
  15700. }
  15701. }
  15702. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15703. class ui_d3Root extends fgui.GComponent {
  15704. static createInstance() {
  15705. return (fgui.UIPackage.createObject("game", "d3Root"));
  15706. }
  15707. onConstruct() {
  15708. }
  15709. }
  15710. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15711. class ui_d2Root extends fgui.GComponent {
  15712. static createInstance() {
  15713. return (fgui.UIPackage.createObject("game", "d2Root"));
  15714. }
  15715. onConstruct() {
  15716. }
  15717. }
  15718. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15719. class ui_ballNode extends fgui.GComponent {
  15720. static createInstance() {
  15721. return (fgui.UIPackage.createObject("game", "ballNode"));
  15722. }
  15723. onConstruct() {
  15724. }
  15725. }
  15726. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15727. class ui_border extends fgui.GComponent {
  15728. static createInstance() {
  15729. return (fgui.UIPackage.createObject("game", "border"));
  15730. }
  15731. onConstruct() {
  15732. this.bar1 = (this.getChild("bar1"));
  15733. this.bar2 = (this.getChild("bar2"));
  15734. this.bar3 = (this.getChild("bar3"));
  15735. this.bar4 = (this.getChild("bar4"));
  15736. this.bar5 = (this.getChild("bar5"));
  15737. this.bar6 = (this.getChild("bar6"));
  15738. this.circle1 = (this.getChild("circle1"));
  15739. this.circle2 = (this.getChild("circle2"));
  15740. this.circle3 = (this.getChild("circle3"));
  15741. this.circle4 = (this.getChild("circle4"));
  15742. this.circle5 = (this.getChild("circle5"));
  15743. this.circle6 = (this.getChild("circle6"));
  15744. this.n28 = (this.getChild("n28"));
  15745. }
  15746. }
  15747. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15748. class ui_btn_buy extends fgui.GButton {
  15749. static createInstance() {
  15750. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15751. }
  15752. onConstruct() {
  15753. this.button = this.getController("button");
  15754. this.n0 = (this.getChild("n0"));
  15755. this.n1 = (this.getChild("n1"));
  15756. this.n2 = (this.getChild("n2"));
  15757. }
  15758. }
  15759. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15760. class ui_Component41_2 extends fgui.GComponent {
  15761. static createInstance() {
  15762. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15763. }
  15764. onConstruct() {
  15765. this.c1 = this.getController("c1");
  15766. this.n0 = (this.getChild("n0"));
  15767. this.n2 = (this.getChild("n2"));
  15768. this.n19 = (this.getChild("n19"));
  15769. this.cancelBtn = (this.getChild("cancelBtn"));
  15770. this.videoBtn = (this.getChild("videoBtn"));
  15771. this.n9 = (this.getChild("n9"));
  15772. this.n22 = (this.getChild("n22"));
  15773. this.tipsTxt = (this.getChild("tipsTxt"));
  15774. this.n23 = (this.getChild("n23"));
  15775. this.n24 = (this.getChild("n24"));
  15776. this.n26 = (this.getChild("n26"));
  15777. this.n27 = (this.getChild("n27"));
  15778. this.titleTxt = (this.getChild("titleTxt"));
  15779. }
  15780. }
  15781. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15782. class ui_Component41_1 extends fgui.GComponent {
  15783. static createInstance() {
  15784. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15785. }
  15786. onConstruct() {
  15787. this.c1 = this.getController("c1");
  15788. this.n0 = (this.getChild("n0"));
  15789. this.n2 = (this.getChild("n2"));
  15790. this.cancelBtn = (this.getChild("cancelBtn"));
  15791. this.videoBtn = (this.getChild("videoBtn"));
  15792. this.n27 = (this.getChild("n27"));
  15793. this.n30 = (this.getChild("n30"));
  15794. this.n31 = (this.getChild("n31"));
  15795. this.n32 = (this.getChild("n32"));
  15796. this.n33 = (this.getChild("n33"));
  15797. this.n34 = (this.getChild("n34"));
  15798. this.n35 = (this.getChild("n35"));
  15799. this.n36 = (this.getChild("n36"));
  15800. this.n1 = (this.getChild("n1"));
  15801. this.n37 = (this.getChild("n37"));
  15802. this.t0 = this.getTransition("t0");
  15803. this.t1 = this.getTransition("t1");
  15804. this.t2 = this.getTransition("t2");
  15805. this.t3 = this.getTransition("t3");
  15806. }
  15807. }
  15808. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15809. class ui_againBtn extends fgui.GButton {
  15810. static createInstance() {
  15811. return (fgui.UIPackage.createObject("game", "againBtn"));
  15812. }
  15813. onConstruct() {
  15814. this.n2 = (this.getChild("n2"));
  15815. this.n1 = (this.getChild("n1"));
  15816. this.n5 = (this.getChild("n5"));
  15817. }
  15818. }
  15819. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15820. class ui_Component118 extends fgui.GButton {
  15821. static createInstance() {
  15822. return (fgui.UIPackage.createObject("game", "Component118"));
  15823. }
  15824. onConstruct() {
  15825. this.c1 = this.getController("c1");
  15826. this.n14 = (this.getChild("n14"));
  15827. this.n9 = (this.getChild("n9"));
  15828. this.n10 = (this.getChild("n10"));
  15829. this.diamondTxt = (this.getChild("diamondTxt"));
  15830. this.n13 = (this.getChild("n13"));
  15831. this.n15 = (this.getChild("n15"));
  15832. }
  15833. }
  15834. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15835. class ui_Component119 extends fgui.GComponent {
  15836. static createInstance() {
  15837. return (fgui.UIPackage.createObject("game", "Component119"));
  15838. }
  15839. onConstruct() {
  15840. this.n1 = (this.getChild("n1"));
  15841. this.n2 = (this.getChild("n2"));
  15842. this.n13 = (this.getChild("n13"));
  15843. this.n6 = (this.getChild("n6"));
  15844. this.screenNode = (this.getChild("screenNode"));
  15845. this.n15 = (this.getChild("n15"));
  15846. this.closeBtn = (this.getChild("closeBtn"));
  15847. this.share2Btn = (this.getChild("share2Btn"));
  15848. this.shareBtn = (this.getChild("shareBtn"));
  15849. this.tipsNode = (this.getChild("tipsNode"));
  15850. this.awardNode = (this.getChild("awardNode"));
  15851. }
  15852. }
  15853. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15854. class ui_Component_yd1 extends fgui.GComponent {
  15855. static createInstance() {
  15856. return (fgui.UIPackage.createObject("game", "Component_yd1"));
  15857. }
  15858. onConstruct() {
  15859. this.n83 = (this.getChild("n83"));
  15860. this.fingerNode = (this.getChild("fingerNode"));
  15861. this.n84 = (this.getChild("n84"));
  15862. }
  15863. }
  15864. ui_Component_yd1.URL = "ui://isxx5ak7uc2qv5b3";
  15865. class ui_Component_yd2 extends fgui.GComponent {
  15866. static createInstance() {
  15867. return (fgui.UIPackage.createObject("game", "Component_yd2"));
  15868. }
  15869. onConstruct() {
  15870. this.n85 = (this.getChild("n85"));
  15871. this.n86 = (this.getChild("n86"));
  15872. this.n77 = (this.getChild("n77"));
  15873. this.n79 = (this.getChild("n79"));
  15874. this.n80 = (this.getChild("n80"));
  15875. this.n81 = (this.getChild("n81"));
  15876. this.n82 = (this.getChild("n82"));
  15877. this.n84 = (this.getChild("n84"));
  15878. this.n87 = (this.getChild("n87"));
  15879. this.t0 = this.getTransition("t0");
  15880. }
  15881. }
  15882. ui_Component_yd2.URL = "ui://isxx5ak7uc2qv5b5";
  15883. class ui_Component_yd3 extends fgui.GComponent {
  15884. static createInstance() {
  15885. return (fgui.UIPackage.createObject("game", "Component_yd3"));
  15886. }
  15887. onConstruct() {
  15888. this.n87 = (this.getChild("n87"));
  15889. this.n88 = (this.getChild("n88"));
  15890. this.n84 = (this.getChild("n84"));
  15891. this.n85 = (this.getChild("n85"));
  15892. this.n86 = (this.getChild("n86"));
  15893. this.t0 = this.getTransition("t0");
  15894. }
  15895. }
  15896. ui_Component_yd3.URL = "ui://isxx5ak7uc2qv5b6";
  15897. class ui_daoJuDisplay extends fgui.GComponent {
  15898. static createInstance() {
  15899. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15900. }
  15901. onConstruct() {
  15902. this.n6 = (this.getChild("n6"));
  15903. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15904. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15905. this.btn_buy = (this.getChild("btn_buy"));
  15906. this.nameTxt = (this.getChild("nameTxt"));
  15907. this.zsImg = (this.getChild("zsImg"));
  15908. }
  15909. }
  15910. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15911. class ui_Component132_1 extends fgui.GComponent {
  15912. static createInstance() {
  15913. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15914. }
  15915. onConstruct() {
  15916. this.n25 = (this.getChild("n25"));
  15917. this.n26 = (this.getChild("n26"));
  15918. this.n27 = (this.getChild("n27"));
  15919. this.t0 = this.getTransition("t0");
  15920. }
  15921. }
  15922. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15923. class ui_Component_lc_challenge1 extends fgui.GComponent {
  15924. static createInstance() {
  15925. return (fgui.UIPackage.createObject("game", "Component_lc_challenge1"));
  15926. }
  15927. onConstruct() {
  15928. this.n0 = (this.getChild("n0"));
  15929. this.n1_bai = (this.getChild("n1_bai"));
  15930. }
  15931. }
  15932. ui_Component_lc_challenge1.URL = "ui://isxx5ak7um3xv5as";
  15933. class ui_Component_shou extends fgui.GComponent {
  15934. static createInstance() {
  15935. return (fgui.UIPackage.createObject("game", "Component_shou"));
  15936. }
  15937. onConstruct() {
  15938. this.n57 = (this.getChild("n57"));
  15939. this.n54 = (this.getChild("n54"));
  15940. this.n55 = (this.getChild("n55"));
  15941. this.n56 = (this.getChild("n56"));
  15942. this.t1 = this.getTransition("t1");
  15943. }
  15944. }
  15945. ui_Component_shou.URL = "ui://isxx5ak7um3xv5aw";
  15946. class ui_SecretaryDisplay extends fgui.GComponent {
  15947. static createInstance() {
  15948. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15949. }
  15950. onConstruct() {
  15951. this.n2 = (this.getChild("n2"));
  15952. this.levelTxt = (this.getChild("levelTxt"));
  15953. this.n4 = (this.getChild("n4"));
  15954. this.secretary = (this.getChild("secretary"));
  15955. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15956. this.n16 = (this.getChild("n16"));
  15957. this.n37 = (this.getChild("n37"));
  15958. this.n41 = (this.getChild("n41"));
  15959. this.n14 = (this.getChild("n14"));
  15960. this.n17 = (this.getChild("n17"));
  15961. this.heightTxt = (this.getChild("heightTxt"));
  15962. this.n46 = (this.getChild("n46"));
  15963. this.n36 = (this.getChild("n36"));
  15964. this.n38 = (this.getChild("n38"));
  15965. this.foodTxt = (this.getChild("foodTxt"));
  15966. this.n47 = (this.getChild("n47"));
  15967. this.n40 = (this.getChild("n40"));
  15968. this.n42 = (this.getChild("n42"));
  15969. this.historyTxt = (this.getChild("historyTxt"));
  15970. this.n48 = (this.getChild("n48"));
  15971. this.nameImg = (this.getChild("nameImg"));
  15972. this.n12 = (this.getChild("n12"));
  15973. this.n49 = (this.getChild("n49"));
  15974. this.t0 = this.getTransition("t0");
  15975. }
  15976. }
  15977. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15978. class ui_BallRodDisplay extends fgui.GComponent {
  15979. static createInstance() {
  15980. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15981. }
  15982. onConstruct() {
  15983. this.c1 = this.getController("c1");
  15984. this.n31 = (this.getChild("n31"));
  15985. this.n6 = (this.getChild("n6"));
  15986. this.nameTxt = (this.getChild("nameTxt"));
  15987. this.rodImg = (this.getChild("rodImg"));
  15988. this.eftRod = (this.getChild("eftRod"));
  15989. this.levelNode = (this.getChild("levelNode"));
  15990. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15991. }
  15992. }
  15993. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15994. class ui_Component111_11 extends fgui.GComponent {
  15995. static createInstance() {
  15996. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15997. }
  15998. onConstruct() {
  15999. this.n68 = (this.getChild("n68"));
  16000. this.n69 = (this.getChild("n69"));
  16001. }
  16002. }
  16003. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  16004. class ui_Component112 extends fgui.GComponent {
  16005. static createInstance() {
  16006. return (fgui.UIPackage.createObject("game", "Component112"));
  16007. }
  16008. onConstruct() {
  16009. this.n68 = (this.getChild("n68"));
  16010. this.n70 = (this.getChild("n70"));
  16011. this.myMask = (this.getChild("myMask"));
  16012. }
  16013. }
  16014. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  16015. class ui_Component111 extends fgui.GComponent {
  16016. static createInstance() {
  16017. return (fgui.UIPackage.createObject("game", "Component111"));
  16018. }
  16019. onConstruct() {
  16020. this.n68 = (this.getChild("n68"));
  16021. this.myMask = (this.getChild("myMask"));
  16022. }
  16023. }
  16024. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  16025. class ui_Component144 extends fgui.GButton {
  16026. static createInstance() {
  16027. return (fgui.UIPackage.createObject("game", "Component144"));
  16028. }
  16029. onConstruct() {
  16030. this.n8 = (this.getChild("n8"));
  16031. }
  16032. }
  16033. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  16034. class ui_Sign_com2 extends fgui.GComponent {
  16035. static createInstance() {
  16036. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  16037. }
  16038. onConstruct() {
  16039. this.n0 = (this.getChild("n0"));
  16040. this.n1 = (this.getChild("n1"));
  16041. this.t0 = this.getTransition("t0");
  16042. }
  16043. }
  16044. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  16045. class ui_Sign_guang extends fgui.GComponent {
  16046. static createInstance() {
  16047. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  16048. }
  16049. onConstruct() {
  16050. this.n1 = (this.getChild("n1"));
  16051. this.n2 = (this.getChild("n2"));
  16052. this.n3 = (this.getChild("n3"));
  16053. this.n4 = (this.getChild("n4"));
  16054. this.n5 = (this.getChild("n5"));
  16055. this.n6 = (this.getChild("n6"));
  16056. this.n8 = (this.getChild("n8"));
  16057. }
  16058. }
  16059. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  16060. class ui_SignMax extends fgui.GComponent {
  16061. static createInstance() {
  16062. return (fgui.UIPackage.createObject("game", "SignMax"));
  16063. }
  16064. onConstruct() {
  16065. this.c1 = this.getController("c1");
  16066. this.n7 = (this.getChild("n7"));
  16067. this.n15 = (this.getChild("n15"));
  16068. this.n8 = (this.getChild("n8"));
  16069. this.titleTxt = (this.getChild("titleTxt"));
  16070. this.myIcon1 = (this.getChild("myIcon1"));
  16071. this.numTxt1 = (this.getChild("numTxt1"));
  16072. this.myIcon2 = (this.getChild("myIcon2"));
  16073. this.n20 = (this.getChild("n20"));
  16074. this.n17 = (this.getChild("n17"));
  16075. this.numTxt2 = (this.getChild("numTxt2"));
  16076. this.n12 = (this.getChild("n12"));
  16077. this.n13 = (this.getChild("n13"));
  16078. this.n21 = (this.getChild("n21"));
  16079. this.n14 = (this.getChild("n14"));
  16080. }
  16081. }
  16082. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  16083. class ui_Sign_com2_1 extends fgui.GComponent {
  16084. static createInstance() {
  16085. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  16086. }
  16087. onConstruct() {
  16088. this.n0 = (this.getChild("n0"));
  16089. this.n1 = (this.getChild("n1"));
  16090. this.t0 = this.getTransition("t0");
  16091. }
  16092. }
  16093. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  16094. class ui_Sign_com5 extends fgui.GComponent {
  16095. static createInstance() {
  16096. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  16097. }
  16098. onConstruct() {
  16099. this.n3 = (this.getChild("n3"));
  16100. this.n29 = (this.getChild("n29"));
  16101. this.n4 = (this.getChild("n4"));
  16102. this.day1 = (this.getChild("day1"));
  16103. this.day2 = (this.getChild("day2"));
  16104. this.day3 = (this.getChild("day3"));
  16105. this.day4 = (this.getChild("day4"));
  16106. this.day5 = (this.getChild("day5"));
  16107. this.day6 = (this.getChild("day6"));
  16108. this.day7 = (this.getChild("day7"));
  16109. this.t0 = this.getTransition("t0");
  16110. }
  16111. }
  16112. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  16113. class ui_Sign_com8 extends fgui.GComponent {
  16114. static createInstance() {
  16115. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  16116. }
  16117. onConstruct() {
  16118. this.n48 = (this.getChild("n48"));
  16119. this.womanTxt = (this.getChild("womanTxt"));
  16120. this.t0 = this.getTransition("t0");
  16121. }
  16122. }
  16123. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  16124. class ui_Sign_com6 extends fgui.GComponent {
  16125. static createInstance() {
  16126. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  16127. }
  16128. onConstruct() {
  16129. this.n2 = (this.getChild("n2"));
  16130. this.n3 = (this.getChild("n3"));
  16131. this.t0 = this.getTransition("t0");
  16132. }
  16133. }
  16134. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  16135. class ui_Sign_com7 extends fgui.GComponent {
  16136. static createInstance() {
  16137. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  16138. }
  16139. onConstruct() {
  16140. this.n29 = (this.getChild("n29"));
  16141. this.n2 = (this.getChild("n2"));
  16142. }
  16143. }
  16144. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  16145. class ui_UITurntable_com1_2 extends fgui.GComponent {
  16146. static createInstance() {
  16147. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  16148. }
  16149. onConstruct() {
  16150. this.n5 = (this.getChild("n5"));
  16151. this.n4 = (this.getChild("n4"));
  16152. this.t0 = this.getTransition("t0");
  16153. }
  16154. }
  16155. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  16156. class ui_UITurntable_com2 extends fgui.GComponent {
  16157. static createInstance() {
  16158. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  16159. }
  16160. onConstruct() {
  16161. this.c1 = this.getController("c1");
  16162. this.n4 = (this.getChild("n4"));
  16163. this.n6 = (this.getChild("n6"));
  16164. this.n10 = (this.getChild("n10"));
  16165. this.n11 = (this.getChild("n11"));
  16166. this.n12 = (this.getChild("n12"));
  16167. this.n13 = (this.getChild("n13"));
  16168. this.n14 = (this.getChild("n14"));
  16169. this.n15 = (this.getChild("n15"));
  16170. this.n16 = (this.getChild("n16"));
  16171. this.n17 = (this.getChild("n17"));
  16172. this.n18 = (this.getChild("n18"));
  16173. this.n19 = (this.getChild("n19"));
  16174. this.n20 = (this.getChild("n20"));
  16175. this.n21 = (this.getChild("n21"));
  16176. this.n22 = (this.getChild("n22"));
  16177. this.n23 = (this.getChild("n23"));
  16178. this.n24 = (this.getChild("n24"));
  16179. this.n25 = (this.getChild("n25"));
  16180. this.n26 = (this.getChild("n26"));
  16181. this.n27 = (this.getChild("n27"));
  16182. this.n28 = (this.getChild("n28"));
  16183. this.n29 = (this.getChild("n29"));
  16184. this.n30 = (this.getChild("n30"));
  16185. this.n31 = (this.getChild("n31"));
  16186. this.n32 = (this.getChild("n32"));
  16187. this.n33 = (this.getChild("n33"));
  16188. }
  16189. }
  16190. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16191. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16192. static createInstance() {
  16193. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16194. }
  16195. onConstruct() {
  16196. this.n5 = (this.getChild("n5"));
  16197. this.n4 = (this.getChild("n4"));
  16198. this.t0 = this.getTransition("t0");
  16199. }
  16200. }
  16201. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16202. class ui_UITurntable_com5 extends fgui.GComponent {
  16203. static createInstance() {
  16204. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16205. }
  16206. onConstruct() {
  16207. this.flashNode = (this.getChild("flashNode"));
  16208. this.rotNode = (this.getChild("rotNode"));
  16209. this.n3 = (this.getChild("n3"));
  16210. this.n21 = (this.getChild("n21"));
  16211. this.t0 = this.getTransition("t0");
  16212. }
  16213. }
  16214. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16215. class ui_UITurntable_com7 extends fgui.GComponent {
  16216. static createInstance() {
  16217. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16218. }
  16219. onConstruct() {
  16220. this.n2 = (this.getChild("n2"));
  16221. this.n35 = (this.getChild("n35"));
  16222. this.img1 = (this.getChild("img1"));
  16223. this.img2 = (this.getChild("img2"));
  16224. this.img3 = (this.getChild("img3"));
  16225. this.img4 = (this.getChild("img4"));
  16226. this.img6 = (this.getChild("img6"));
  16227. this.img5 = (this.getChild("img5"));
  16228. this.txt1 = (this.getChild("txt1"));
  16229. this.txt2 = (this.getChild("txt2"));
  16230. this.txt3 = (this.getChild("txt3"));
  16231. this.txt4 = (this.getChild("txt4"));
  16232. this.txt5 = (this.getChild("txt5"));
  16233. this.txt6 = (this.getChild("txt6"));
  16234. }
  16235. }
  16236. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16237. class ui_UITurntable_com9 extends fgui.GComponent {
  16238. static createInstance() {
  16239. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16240. }
  16241. onConstruct() {
  16242. this.n38 = (this.getChild("n38"));
  16243. this.n39 = (this.getChild("n39"));
  16244. }
  16245. }
  16246. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16247. class ui_UITurntable_com10 extends fgui.GComponent {
  16248. static createInstance() {
  16249. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16250. }
  16251. onConstruct() {
  16252. this.n39 = (this.getChild("n39"));
  16253. this.n40 = (this.getChild("n40"));
  16254. this.t0 = this.getTransition("t0");
  16255. }
  16256. }
  16257. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16258. class ui_UITurntable_com11 extends fgui.GComponent {
  16259. static createInstance() {
  16260. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16261. }
  16262. onConstruct() {
  16263. this.n38 = (this.getChild("n38"));
  16264. this.n39 = (this.getChild("n39"));
  16265. this.n40 = (this.getChild("n40"));
  16266. this.t0 = this.getTransition("t0");
  16267. }
  16268. }
  16269. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16270. class ui_UITurntable_com12 extends fgui.GComponent {
  16271. static createInstance() {
  16272. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16273. }
  16274. onConstruct() {
  16275. this.n43 = (this.getChild("n43"));
  16276. this.barNode = (this.getChild("barNode"));
  16277. this.tipsTxt = (this.getChild("tipsTxt"));
  16278. this.n45 = (this.getChild("n45"));
  16279. this.boxBtn = (this.getChild("boxBtn"));
  16280. }
  16281. }
  16282. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16283. class ui_UITurntable_com1 extends fgui.GButton {
  16284. static createInstance() {
  16285. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16286. }
  16287. onConstruct() {
  16288. this.n41 = (this.getChild("n41"));
  16289. this.n42 = (this.getChild("n42"));
  16290. this.t0 = this.getTransition("t0");
  16291. }
  16292. }
  16293. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16294. class ui_UITurntable_com3 extends fgui.GComponent {
  16295. static createInstance() {
  16296. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16297. }
  16298. onConstruct() {
  16299. this.n48 = (this.getChild("n48"));
  16300. this.womanTxt = (this.getChild("womanTxt"));
  16301. this.t0 = this.getTransition("t0");
  16302. }
  16303. }
  16304. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16305. class ui_cancelBtn2 extends fgui.GButton {
  16306. static createInstance() {
  16307. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16308. }
  16309. onConstruct() {
  16310. this.c1 = this.getController("c1");
  16311. this.n0 = (this.getChild("n0"));
  16312. this.n1 = (this.getChild("n1"));
  16313. this.n2 = (this.getChild("n2"));
  16314. this.n3 = (this.getChild("n3"));
  16315. this.n4 = (this.getChild("n4"));
  16316. this.n5 = (this.getChild("n5"));
  16317. this.n6 = (this.getChild("n6"));
  16318. this.n7 = (this.getChild("n7"));
  16319. this.n8 = (this.getChild("n8"));
  16320. this.powerEft = (this.getChild("powerEft"));
  16321. }
  16322. }
  16323. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16324. class ui_shareBtn2 extends fgui.GButton {
  16325. static createInstance() {
  16326. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16327. }
  16328. onConstruct() {
  16329. this.c1 = this.getController("c1");
  16330. this.n2 = (this.getChild("n2"));
  16331. this.n24 = (this.getChild("n24"));
  16332. this.n1 = (this.getChild("n1"));
  16333. this.n3 = (this.getChild("n3"));
  16334. this.n23 = (this.getChild("n23"));
  16335. this.n4 = (this.getChild("n4"));
  16336. this.n5 = (this.getChild("n5"));
  16337. this.n6 = (this.getChild("n6"));
  16338. this.n20 = (this.getChild("n20"));
  16339. this.n21 = (this.getChild("n21"));
  16340. this.n22 = (this.getChild("n22"));
  16341. this.powerEft = (this.getChild("powerEft"));
  16342. }
  16343. }
  16344. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16345. class ui_UIMoney extends fgui.GComponent {
  16346. static createInstance() {
  16347. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16348. }
  16349. onConstruct() {
  16350. this.c1 = this.getController("c1");
  16351. this.n4 = (this.getChild("n4"));
  16352. this.coinImg = (this.getChild("coinImg"));
  16353. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16354. this.coinTxt = (this.getChild("coinTxt"));
  16355. this.n7 = (this.getChild("n7"));
  16356. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16357. this.diamondTxt = (this.getChild("diamondTxt"));
  16358. this.diamondImg = (this.getChild("diamondImg"));
  16359. this.n12 = (this.getChild("n12"));
  16360. this.powerImg = (this.getChild("powerImg"));
  16361. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16362. this.powerTxt = (this.getChild("powerTxt"));
  16363. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16364. }
  16365. }
  16366. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16367. class ui_backBtn extends fgui.GButton {
  16368. static createInstance() {
  16369. return (fgui.UIPackage.createObject("game", "backBtn"));
  16370. }
  16371. onConstruct() {
  16372. this.n0 = (this.getChild("n0"));
  16373. this.t0 = this.getTransition("t0");
  16374. this.t1 = this.getTransition("t1");
  16375. }
  16376. }
  16377. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16378. class ui_MoneyBtn extends fgui.GButton {
  16379. static createInstance() {
  16380. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16381. }
  16382. onConstruct() {
  16383. this.button = this.getController("button");
  16384. this.n0 = (this.getChild("n0"));
  16385. }
  16386. }
  16387. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16388. class ui_UIMoneyBtn extends fgui.GComponent {
  16389. static createInstance() {
  16390. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16391. }
  16392. onConstruct() {
  16393. this.n1 = (this.getChild("n1"));
  16394. this.closeBtn = (this.getChild("closeBtn"));
  16395. }
  16396. }
  16397. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16398. class ui_Component64 extends fgui.GComponent {
  16399. static createInstance() {
  16400. return (fgui.UIPackage.createObject("game", "Component64"));
  16401. }
  16402. onConstruct() {
  16403. this.n57 = (this.getChild("n57"));
  16404. this.n54 = (this.getChild("n54"));
  16405. this.n55 = (this.getChild("n55"));
  16406. this.n56 = (this.getChild("n56"));
  16407. this.t1 = this.getTransition("t1");
  16408. }
  16409. }
  16410. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16411. class ui_Component41_3 extends fgui.GComponent {
  16412. static createInstance() {
  16413. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16414. }
  16415. onConstruct() {
  16416. this.c1 = this.getController("c1");
  16417. this.n0 = (this.getChild("n0"));
  16418. this.n2 = (this.getChild("n2"));
  16419. this.cancelBtn = (this.getChild("cancelBtn"));
  16420. this.videoBtn = (this.getChild("videoBtn"));
  16421. this.n9 = (this.getChild("n9"));
  16422. this.n24 = (this.getChild("n24"));
  16423. this.n27 = (this.getChild("n27"));
  16424. this.titleTxt = (this.getChild("titleTxt"));
  16425. this.n28 = (this.getChild("n28"));
  16426. this.t0 = this.getTransition("t0");
  16427. }
  16428. }
  16429. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16430. class ui_dh_zs_4 extends fgui.GComponent {
  16431. static createInstance() {
  16432. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16433. }
  16434. onConstruct() {
  16435. this.n1 = (this.getChild("n1"));
  16436. this.n2 = (this.getChild("n2"));
  16437. this.n3 = (this.getChild("n3"));
  16438. this.n4 = (this.getChild("n4"));
  16439. this.n5 = (this.getChild("n5"));
  16440. this.n6 = (this.getChild("n6"));
  16441. this.n8 = (this.getChild("n8"));
  16442. this.t0 = this.getTransition("t0");
  16443. }
  16444. }
  16445. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16446. class ui_Component71_1 extends fgui.GButton {
  16447. static createInstance() {
  16448. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16449. }
  16450. onConstruct() {
  16451. this.n17 = (this.getChild("n17"));
  16452. this.t0 = this.getTransition("t0");
  16453. }
  16454. }
  16455. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16456. class ui_Component83 extends fgui.GComponent {
  16457. static createInstance() {
  16458. return (fgui.UIPackage.createObject("game", "Component83"));
  16459. }
  16460. onConstruct() {
  16461. this.c1 = this.getController("c1");
  16462. this.n17 = (this.getChild("n17"));
  16463. this.n19 = (this.getChild("n19"));
  16464. this.n20 = (this.getChild("n20"));
  16465. }
  16466. }
  16467. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16468. class ui_Component84 extends fgui.GComponent {
  16469. static createInstance() {
  16470. return (fgui.UIPackage.createObject("game", "Component84"));
  16471. }
  16472. onConstruct() {
  16473. this.c1 = this.getController("c1");
  16474. this.n4 = (this.getChild("n4"));
  16475. this.n22 = (this.getChild("n22"));
  16476. this.n23 = (this.getChild("n23"));
  16477. this.numTxt = (this.getChild("numTxt"));
  16478. this.n25 = (this.getChild("n25"));
  16479. this.n26 = (this.getChild("n26"));
  16480. }
  16481. }
  16482. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16483. class ui_Component84_1 extends fgui.GComponent {
  16484. static createInstance() {
  16485. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16486. }
  16487. onConstruct() {
  16488. this.c1 = this.getController("c1");
  16489. this.n4 = (this.getChild("n4"));
  16490. this.n22 = (this.getChild("n22"));
  16491. this.n23 = (this.getChild("n23"));
  16492. this.numTxt = (this.getChild("numTxt"));
  16493. this.n25 = (this.getChild("n25"));
  16494. this.n26 = (this.getChild("n26"));
  16495. }
  16496. }
  16497. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16498. class ui_Component85 extends fgui.GComponent {
  16499. static createInstance() {
  16500. return (fgui.UIPackage.createObject("game", "Component85"));
  16501. }
  16502. onConstruct() {
  16503. this.n1 = (this.getChild("n1"));
  16504. this.n6 = (this.getChild("n6"));
  16505. this.n2 = (this.getChild("n2"));
  16506. this.n3 = (this.getChild("n3"));
  16507. this.levelTxt = (this.getChild("levelTxt"));
  16508. this.n10 = (this.getChild("n10"));
  16509. this.n11 = (this.getChild("n11"));
  16510. this.n12 = (this.getChild("n12"));
  16511. this.n13 = (this.getChild("n13"));
  16512. this.n14 = (this.getChild("n14"));
  16513. this.modeNode = (this.getChild("modeNode"));
  16514. this.n18 = (this.getChild("n18"));
  16515. this.conditionTxt = (this.getChild("conditionTxt"));
  16516. this.diamondNode = (this.getChild("diamondNode"));
  16517. this.coinNode = (this.getChild("coinNode"));
  16518. this.startBtn = (this.getChild("startBtn"));
  16519. this.n28 = (this.getChild("n28"));
  16520. this.displayRoot = (this.getChild("displayRoot"));
  16521. this.n32 = (this.getChild("n32"));
  16522. this.n33 = (this.getChild("n33"));
  16523. this.n_yd_zzq_btn3 = (this.getChild("n_yd_zzq_btn3"));
  16524. this.n_yd_3 = (this.getChild("n_yd_3"));
  16525. this.t0 = this.getTransition("t0");
  16526. }
  16527. }
  16528. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16529. class ui_Component86 extends fgui.GButton {
  16530. static createInstance() {
  16531. return (fgui.UIPackage.createObject("game", "Component86"));
  16532. }
  16533. onConstruct() {
  16534. this.n15 = (this.getChild("n15"));
  16535. this.t0 = this.getTransition("t0");
  16536. }
  16537. }
  16538. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16539. class ui_Component87 extends fgui.GComponent {
  16540. static createInstance() {
  16541. return (fgui.UIPackage.createObject("game", "Component87"));
  16542. }
  16543. onConstruct() {
  16544. this.n66 = (this.getChild("n66"));
  16545. this.myProgress = (this.getChild("myProgress"));
  16546. this.starAni = (this.getChild("starAni"));
  16547. this.hpTxt = (this.getChild("hpTxt"));
  16548. this.n74 = (this.getChild("n74"));
  16549. this.n73 = (this.getChild("n73"));
  16550. this.ballTxt = (this.getChild("ballTxt"));
  16551. this.n76 = (this.getChild("n76"));
  16552. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16553. this.levelTxt = (this.getChild("levelTxt"));
  16554. this.star1 = (this.getChild("star1"));
  16555. this.star2 = (this.getChild("star2"));
  16556. this.star3 = (this.getChild("star3"));
  16557. }
  16558. }
  16559. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16560. class ui_Component88 extends fgui.GProgressBar {
  16561. static createInstance() {
  16562. return (fgui.UIPackage.createObject("game", "Component88"));
  16563. }
  16564. onConstruct() {
  16565. this.n68 = (this.getChild("n68"));
  16566. this.bar = (this.getChild("bar"));
  16567. }
  16568. }
  16569. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16570. class ui_Component89 extends fgui.GComponent {
  16571. static createInstance() {
  16572. return (fgui.UIPackage.createObject("game", "Component89"));
  16573. }
  16574. onConstruct() {
  16575. this.c1 = this.getController("c1");
  16576. this.n71 = (this.getChild("n71"));
  16577. this.n72 = (this.getChild("n72"));
  16578. }
  16579. }
  16580. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16581. class ui_Component90 extends fgui.GComponent {
  16582. static createInstance() {
  16583. return (fgui.UIPackage.createObject("game", "Component90"));
  16584. }
  16585. onConstruct() {
  16586. this.c1 = this.getController("c1");
  16587. this.n64 = (this.getChild("n64"));
  16588. this.n65 = (this.getChild("n65"));
  16589. this.n66 = (this.getChild("n66"));
  16590. this.t0 = this.getTransition("t0");
  16591. }
  16592. }
  16593. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16594. class ui_Component127 extends fgui.GButton {
  16595. static createInstance() {
  16596. return (fgui.UIPackage.createObject("game", "Component127"));
  16597. }
  16598. onConstruct() {
  16599. this.n5 = (this.getChild("n5"));
  16600. }
  16601. }
  16602. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16603. class gameBinder {
  16604. static bindAll() {
  16605. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16606. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16607. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16608. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16609. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16610. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16611. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16612. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16613. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16614. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16615. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16616. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16617. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16618. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16619. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16620. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16621. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16622. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16623. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16624. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16625. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16626. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16627. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16628. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16629. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16630. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16631. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16632. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16633. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16634. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16635. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16636. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16637. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16638. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16639. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16640. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16641. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16642. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16643. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16644. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16645. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16646. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16647. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16648. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16649. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16650. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16651. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16652. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16653. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16654. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16655. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16656. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16657. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16658. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16659. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16660. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16661. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16662. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16663. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16664. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16665. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16666. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16667. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16668. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16669. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16670. fgui.UIObjectFactory.setExtension(ui_Component_lc2.URL, ui_Component_lc2);
  16671. fgui.UIObjectFactory.setExtension(ui_Component_shou2.URL, ui_Component_shou2);
  16672. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16673. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16674. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16675. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16676. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16677. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16678. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16679. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16680. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16681. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16682. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16683. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16684. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16685. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16686. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16687. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16688. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16689. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16690. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16691. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16692. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16693. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16694. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16695. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16696. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16697. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16698. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16699. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16700. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16701. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16702. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16703. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16704. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16705. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16706. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16707. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16708. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16709. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16710. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16711. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16712. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16713. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16714. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16715. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16716. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16717. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16718. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16719. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16720. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16721. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16722. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16723. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16724. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16725. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16726. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16727. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16728. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16729. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16730. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16731. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16732. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16733. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16734. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16735. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16736. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16737. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16738. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16739. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16740. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16741. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16742. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16743. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16744. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16745. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16746. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16747. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16748. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16749. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16750. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16751. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16752. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16753. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16754. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16755. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16756. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16757. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16758. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16759. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16760. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16761. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16762. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16763. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16764. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16765. fgui.UIObjectFactory.setExtension(ui_Component_lc3.URL, ui_Component_lc3);
  16766. fgui.UIObjectFactory.setExtension(ui_Component_shou3.URL, ui_Component_shou3);
  16767. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16768. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16769. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16770. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16771. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16772. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16773. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16774. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16775. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16776. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16777. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16778. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16779. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16780. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16781. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16782. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16783. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16784. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16785. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16786. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16787. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16788. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16789. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16790. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16791. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16792. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16793. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16794. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16795. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16796. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16797. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16798. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16799. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16800. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16801. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16802. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16803. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16804. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16805. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16806. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16807. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16808. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16809. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16810. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16811. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16812. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16813. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16814. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16815. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16816. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16817. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16818. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16819. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16820. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16821. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16822. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16823. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16824. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16825. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16826. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16827. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16828. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16829. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16830. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16831. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16832. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16833. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16834. fgui.UIObjectFactory.setExtension(ui_Component_yd1.URL, ui_Component_yd1);
  16835. fgui.UIObjectFactory.setExtension(ui_Component_yd2.URL, ui_Component_yd2);
  16836. fgui.UIObjectFactory.setExtension(ui_Component_yd3.URL, ui_Component_yd3);
  16837. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16838. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16839. fgui.UIObjectFactory.setExtension(ui_Component_lc_challenge1.URL, ui_Component_lc_challenge1);
  16840. fgui.UIObjectFactory.setExtension(ui_Component_shou.URL, ui_Component_shou);
  16841. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16842. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16843. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16844. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16845. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16846. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16847. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16848. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16849. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16850. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16851. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16852. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16853. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16854. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16855. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16856. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16857. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16858. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16859. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16860. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16861. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16862. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16863. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16864. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16865. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16866. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16867. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16868. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16869. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16870. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16871. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16872. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16873. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16874. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16875. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16876. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16877. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16878. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16879. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16880. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16881. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16882. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16883. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16884. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16885. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16886. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16887. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16888. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16889. }
  16890. }
  16891. class ui_btn6 extends fgui.GButton {
  16892. static createInstance() {
  16893. return (fgui.UIPackage.createObject("loading", "btn6"));
  16894. }
  16895. onConstruct() {
  16896. this.n6 = (this.getChild("n6"));
  16897. this.n1 = (this.getChild("n1"));
  16898. }
  16899. }
  16900. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16901. class ui_xyItem extends fgui.GComponent {
  16902. static createInstance() {
  16903. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16904. }
  16905. onConstruct() {
  16906. this.xyItem = (this.getChild("xyItem"));
  16907. }
  16908. }
  16909. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16910. class ui_loadinfo extends fgui.GProgressBar {
  16911. static createInstance() {
  16912. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16913. }
  16914. onConstruct() {
  16915. this.bg = (this.getChild("bg"));
  16916. this.bar = (this.getChild("bar"));
  16917. this.title = (this.getChild("title"));
  16918. this.ani = (this.getChild("ani"));
  16919. }
  16920. }
  16921. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16922. class ui_xyNode extends fgui.GComponent {
  16923. static createInstance() {
  16924. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16925. }
  16926. onConstruct() {
  16927. this.n0 = (this.getChild("n0"));
  16928. this.btnYes = (this.getChild("btnYes"));
  16929. this.btnNo = (this.getChild("btnNo"));
  16930. this.btnKnown = (this.getChild("btnKnown"));
  16931. this.btnSure = (this.getChild("btnSure"));
  16932. this.txtWelcom = (this.getChild("txtWelcom"));
  16933. this.txtXy = (this.getChild("txtXy"));
  16934. this.n75 = (this.getChild("n75"));
  16935. this.btnXy1 = (this.getChild("btnXy1"));
  16936. this.btnXy3 = (this.getChild("btnXy3"));
  16937. this.btnXy2 = (this.getChild("btnXy2"));
  16938. this.n74 = (this.getChild("n74"));
  16939. this.xy1 = (this.getChild("xy1"));
  16940. this.txtTitle = (this.getChild("txtTitle"));
  16941. this.btnBack = (this.getChild("btnBack"));
  16942. this.xyList = (this.getChild("xyList"));
  16943. this.xy2 = (this.getChild("xy2"));
  16944. this.xyNode = (this.getChild("xyNode"));
  16945. }
  16946. }
  16947. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16948. class ui_ageNode extends fgui.GComponent {
  16949. static createInstance() {
  16950. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16951. }
  16952. onConstruct() {
  16953. this.n3 = (this.getChild("n3"));
  16954. this.n7 = (this.getChild("n7"));
  16955. this.n4 = (this.getChild("n4"));
  16956. this.btnAge = (this.getChild("btnAge"));
  16957. this.ageNode = (this.getChild("ageNode"));
  16958. }
  16959. }
  16960. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16961. class ui_rnNode extends fgui.GComponent {
  16962. static createInstance() {
  16963. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16964. }
  16965. onConstruct() {
  16966. this.n28 = (this.getChild("n28"));
  16967. this.n30 = (this.getChild("n30"));
  16968. this.n33 = (this.getChild("n33"));
  16969. this.rn1 = (this.getChild("rn1"));
  16970. this.n40 = (this.getChild("n40"));
  16971. this.n41 = (this.getChild("n41"));
  16972. this.rn3 = (this.getChild("rn3"));
  16973. this.n37 = (this.getChild("n37"));
  16974. this.n39 = (this.getChild("n39"));
  16975. this.rn2 = (this.getChild("rn2"));
  16976. this.n47 = (this.getChild("n47"));
  16977. this.n49 = (this.getChild("n49"));
  16978. this.n44 = (this.getChild("n44"));
  16979. this.inputCode = (this.getChild("inputCode"));
  16980. this.inputName = (this.getChild("inputName"));
  16981. this.n48 = (this.getChild("n48"));
  16982. this.n50 = (this.getChild("n50"));
  16983. this.rn4 = (this.getChild("rn4"));
  16984. this.btnCheck = (this.getChild("btnCheck"));
  16985. this.btnExit = (this.getChild("btnExit"));
  16986. this.btnDone = (this.getChild("btnDone"));
  16987. this.rnNode = (this.getChild("rnNode"));
  16988. }
  16989. }
  16990. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16991. class ui_tipNode extends fgui.GComponent {
  16992. static createInstance() {
  16993. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16994. }
  16995. onConstruct() {
  16996. this.bg = (this.getChild("bg"));
  16997. this.n55 = (this.getChild("n55"));
  16998. this.n56 = (this.getChild("n56"));
  16999. this.tipNode = (this.getChild("tipNode"));
  17000. }
  17001. }
  17002. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  17003. class ui_fcmNode extends fgui.GComponent {
  17004. static createInstance() {
  17005. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  17006. }
  17007. onConstruct() {
  17008. this.n63 = (this.getChild("n63"));
  17009. this.n62 = (this.getChild("n62"));
  17010. this.btnRn = (this.getChild("btnRn"));
  17011. this.n61 = (this.getChild("n61"));
  17012. this.n58 = (this.getChild("n58"));
  17013. this.fcmNode = (this.getChild("fcmNode"));
  17014. }
  17015. }
  17016. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  17017. class ui_msgNode extends fgui.GComponent {
  17018. static createInstance() {
  17019. return (fgui.UIPackage.createObject("loading", "msgNode"));
  17020. }
  17021. onConstruct() {
  17022. this.n69 = (this.getChild("n69"));
  17023. this.txtMsg = (this.getChild("txtMsg"));
  17024. this.msgNode = (this.getChild("msgNode"));
  17025. }
  17026. }
  17027. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  17028. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  17029. static createInstance() {
  17030. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  17031. }
  17032. onConstruct() {
  17033. this.n1 = (this.getChild("n1"));
  17034. this.n13 = (this.getChild("n13"));
  17035. this.n14 = (this.getChild("n14"));
  17036. this.n15 = (this.getChild("n15"));
  17037. this.n3 = (this.getChild("n3"));
  17038. this.n4 = (this.getChild("n4"));
  17039. this.n5 = (this.getChild("n5"));
  17040. this.n6 = (this.getChild("n6"));
  17041. this.n7 = (this.getChild("n7"));
  17042. this.n8 = (this.getChild("n8"));
  17043. this.n9 = (this.getChild("n9"));
  17044. this.n10 = (this.getChild("n10"));
  17045. this.n12 = (this.getChild("n12"));
  17046. this.n11 = (this.getChild("n11"));
  17047. this.n16 = (this.getChild("n16"));
  17048. this.n17 = (this.getChild("n17"));
  17049. this.n18 = (this.getChild("n18"));
  17050. this.n20 = (this.getChild("n20"));
  17051. this.n21 = (this.getChild("n21"));
  17052. this.t0 = this.getTransition("t0");
  17053. }
  17054. }
  17055. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  17056. class ui_btn5 extends fgui.GButton {
  17057. static createInstance() {
  17058. return (fgui.UIPackage.createObject("loading", "btn5"));
  17059. }
  17060. onConstruct() {
  17061. this.n9 = (this.getChild("n9"));
  17062. this.n1 = (this.getChild("n1"));
  17063. }
  17064. }
  17065. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  17066. class ui_UILoading extends fgui.GComponent {
  17067. static createInstance() {
  17068. return (fgui.UIPackage.createObject("loading", "UILoading"));
  17069. }
  17070. onConstruct() {
  17071. this.n12 = (this.getChild("n12"));
  17072. this.loadinfo = (this.getChild("loadinfo"));
  17073. this.n13 = (this.getChild("n13"));
  17074. this.txtLoad = (this.getChild("txtLoad"));
  17075. this.n18 = (this.getChild("n18"));
  17076. }
  17077. }
  17078. ui_UILoading.URL = "ui://37nctnhwphc33";
  17079. class ui_AgeItem extends fgui.GComponent {
  17080. static createInstance() {
  17081. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  17082. }
  17083. onConstruct() {
  17084. this.txtAge = (this.getChild("txtAge"));
  17085. }
  17086. }
  17087. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  17088. class ui_btn1 extends fgui.GButton {
  17089. static createInstance() {
  17090. return (fgui.UIPackage.createObject("loading", "btn1"));
  17091. }
  17092. onConstruct() {
  17093. this.n6 = (this.getChild("n6"));
  17094. this.n1 = (this.getChild("n1"));
  17095. }
  17096. }
  17097. ui_btn1.URL = "ui://37nctnhwxe622p";
  17098. class ui_btn3 extends fgui.GButton {
  17099. static createInstance() {
  17100. return (fgui.UIPackage.createObject("loading", "btn3"));
  17101. }
  17102. onConstruct() {
  17103. this.n9 = (this.getChild("n9"));
  17104. this.n1 = (this.getChild("n1"));
  17105. }
  17106. }
  17107. ui_btn3.URL = "ui://37nctnhwxe622s";
  17108. class ui_btn2 extends fgui.GButton {
  17109. static createInstance() {
  17110. return (fgui.UIPackage.createObject("loading", "btn2"));
  17111. }
  17112. onConstruct() {
  17113. this.n6 = (this.getChild("n6"));
  17114. this.n1 = (this.getChild("n1"));
  17115. }
  17116. }
  17117. ui_btn2.URL = "ui://37nctnhwxe622t";
  17118. class ui_btnBack extends fgui.GButton {
  17119. static createInstance() {
  17120. return (fgui.UIPackage.createObject("loading", "btnBack"));
  17121. }
  17122. onConstruct() {
  17123. this.n6 = (this.getChild("n6"));
  17124. this.n7 = (this.getChild("n7"));
  17125. }
  17126. }
  17127. ui_btnBack.URL = "ui://37nctnhwxe622u";
  17128. class ui_btnXy1 extends fgui.GButton {
  17129. static createInstance() {
  17130. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  17131. }
  17132. onConstruct() {
  17133. this.n1 = (this.getChild("n1"));
  17134. }
  17135. }
  17136. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  17137. class ui_btnXy2 extends fgui.GButton {
  17138. static createInstance() {
  17139. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  17140. }
  17141. onConstruct() {
  17142. this.n1 = (this.getChild("n1"));
  17143. }
  17144. }
  17145. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  17146. class ui_btnXy3 extends fgui.GButton {
  17147. static createInstance() {
  17148. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  17149. }
  17150. onConstruct() {
  17151. this.n1 = (this.getChild("n1"));
  17152. }
  17153. }
  17154. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  17155. class ui_btn4 extends fgui.GButton {
  17156. static createInstance() {
  17157. return (fgui.UIPackage.createObject("loading", "btn4"));
  17158. }
  17159. onConstruct() {
  17160. this.n9 = (this.getChild("n9"));
  17161. this.n1 = (this.getChild("n1"));
  17162. }
  17163. }
  17164. ui_btn4.URL = "ui://37nctnhwxe622z";
  17165. class loadingBinder {
  17166. static bindAll() {
  17167. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  17168. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  17169. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  17170. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  17171. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  17172. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  17173. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  17174. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  17175. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  17176. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  17177. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  17178. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  17179. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  17180. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  17181. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  17182. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  17183. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  17184. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  17185. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  17186. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  17187. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  17188. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  17189. }
  17190. }
  17191. class UIMgr {
  17192. constructor() {
  17193. this._stage = null;
  17194. this._uiList = [];
  17195. this._showList = [];
  17196. this._bindPkgList = [];
  17197. this.uiIndex = 0;
  17198. }
  17199. static get inst() {
  17200. if (UIMgr._inst == null) {
  17201. UIMgr._inst = new UIMgr();
  17202. }
  17203. return UIMgr._inst;
  17204. }
  17205. setStage(s) {
  17206. if (this._stage) {
  17207. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17208. return;
  17209. }
  17210. this._stage = s;
  17211. }
  17212. clearTempData() {
  17213. console.log('zh:clearTempData start');
  17214. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17215. console.log('zh:clearTempData end');
  17216. }
  17217. init() {
  17218. this.setStage(Laya.stage);
  17219. fairygui.UIConfig.defaultFont = "arial";
  17220. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17221. fairygui.UIConfig.packageFileExtension = "obj";
  17222. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17223. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17224. fairygui.GRoot.inst.width = Laya.stage.width;
  17225. fairygui.GRoot.inst.height = Laya.stage.height;
  17226. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17227. }
  17228. addAllUpdate() {
  17229. this.uiIndex = 0;
  17230. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17231. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17232. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17233. }
  17234. }
  17235. }
  17236. bindFUI(pkgname) {
  17237. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17238. return;
  17239. }
  17240. switch (pkgname) {
  17241. case fguiRes.loading:
  17242. fairygui.UIPackage.addPackage(pkgname);
  17243. loadingBinder.bindAll();
  17244. this._bindPkgList.push(pkgname);
  17245. break;
  17246. case fguiRes.game:
  17247. fairygui.UIPackage.addPackage(pkgname);
  17248. gameBinder.bindAll();
  17249. this._bindPkgList.push(pkgname);
  17250. break;
  17251. default:
  17252. break;
  17253. }
  17254. }
  17255. Show(cls, ...param) {
  17256. let nameStr = cls.uiName;
  17257. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17258. let temp = this._uiList[i];
  17259. let str = temp.className;
  17260. if (str == nameStr) {
  17261. if (temp.isMuti) {
  17262. if (temp.isHide) {
  17263. temp.show(...param);
  17264. this._uiList.splice(i, 1);
  17265. this._uiList.push(temp);
  17266. return temp;
  17267. }
  17268. }
  17269. else {
  17270. temp.show(...param);
  17271. this._uiList.splice(i, 1);
  17272. this._uiList.push(temp);
  17273. return temp;
  17274. }
  17275. }
  17276. }
  17277. let ui = new cls();
  17278. ui.className = nameStr;
  17279. this._showUI(ui, param);
  17280. return ui;
  17281. }
  17282. destroyUI(ui) {
  17283. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17284. let temp = this._uiList[i].className;
  17285. if (temp == ui.className) {
  17286. this._uiList.splice(i, 1);
  17287. break;
  17288. }
  17289. }
  17290. this.checkUIState();
  17291. }
  17292. _showUI(ui, param) {
  17293. this._uiList.push(ui);
  17294. ui.show(...param);
  17295. }
  17296. Hide(uiClass) {
  17297. let ui = this.getUI(uiClass);
  17298. if (ui && !ui.isHide) {
  17299. ui.hide();
  17300. }
  17301. }
  17302. getUI(ui) {
  17303. let nameStr = ui.uiName;
  17304. for (let index = 0; index < this._uiList.length; index++) {
  17305. let temp = this._uiList[index];
  17306. if (temp.className == nameStr) {
  17307. return temp;
  17308. }
  17309. }
  17310. return null;
  17311. }
  17312. isShow(cls) {
  17313. for (var i of this._uiList) {
  17314. if (i instanceof cls) {
  17315. return i.isShowing;
  17316. }
  17317. }
  17318. return false;
  17319. }
  17320. showUINum() {
  17321. let num = 0;
  17322. for (var i of this._uiList) {
  17323. if (i.isShowing) {
  17324. num++;
  17325. }
  17326. }
  17327. return num;
  17328. }
  17329. checkUIState() {
  17330. Laya.timer.clear(this, this._uiCheck);
  17331. Laya.timer.once(400, this, this._uiCheck);
  17332. }
  17333. _uiCheck() {
  17334. let showList = [];
  17335. for (var i of this._uiList) {
  17336. if (!i.isHide) {
  17337. showList.push(i);
  17338. }
  17339. }
  17340. for (let index = 0; index < showList.length; index++) {
  17341. if (index == showList.length - 1) {
  17342. showList[index].checkActive(true);
  17343. }
  17344. else {
  17345. showList[index].checkActive(false);
  17346. }
  17347. }
  17348. }
  17349. showTip(msg, time = 600, size = 30) {
  17350. }
  17351. }
  17352. class UIShowList {
  17353. }
  17354. class SoundMgr {
  17355. constructor() {
  17356. this.soundMax = 4;
  17357. this.isLoad = false;
  17358. this.soundMap = {};
  17359. this.isSound = true;
  17360. this.openShake = true;
  17361. SoundMgr._instance = this;
  17362. }
  17363. static getInstance() {
  17364. if (!this._instance) {
  17365. this._instance = new SoundMgr();
  17366. }
  17367. return this._instance;
  17368. }
  17369. init() {
  17370. console.log('zh:sm init 1');
  17371. Laya.SoundManager.autoReleaseSound = true;
  17372. Laya.SoundManager.autoStopMusic = true;
  17373. Laya.SoundManager.musicVolume = 0.3;
  17374. Laya.SoundManager.soundVolume = 0.5;
  17375. this.musicPlayed = false;
  17376. this.audioUrl = "asset/sound/ogg/";
  17377. console.log('zh:sm init 2');
  17378. console.log('zh:dev type ');
  17379. if (Laya.Browser.onAndroid) {
  17380. console.log('zh:dev type android');
  17381. this.audioUrl = "asset/sound/ogg/";
  17382. this.isLoad = true;
  17383. }
  17384. else {
  17385. console.log('zh:dev type not android');
  17386. this.audioUrl = "asset/sound/mp3/";
  17387. this.isLoad = true;
  17388. }
  17389. }
  17390. onSetting(isS) {
  17391. this.isSound = isS;
  17392. this.mute(!this.isSound);
  17393. }
  17394. clearCount() {
  17395. for (var key in this.soundMap) {
  17396. delete this.soundMap[key];
  17397. }
  17398. }
  17399. playMusic(path, loop = 0) {
  17400. console.log('zh:playMusic 1 PATH=' + path);
  17401. this.musicPath = path;
  17402. if (!this.isLoad) {
  17403. return;
  17404. }
  17405. if (!path || path == "") {
  17406. return;
  17407. }
  17408. if (!this.isSound) {
  17409. return;
  17410. }
  17411. this.musicPlayed = true;
  17412. let url = this.getUrl(path);
  17413. if (!Laya.Browser.onAndroid) {
  17414. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17415. this.play(url, loop);
  17416. }));
  17417. }
  17418. else {
  17419. this.play(url, loop);
  17420. }
  17421. }
  17422. play(url, loop) {
  17423. Laya.SoundManager.playMusic(url, loop);
  17424. }
  17425. getUrl(path) {
  17426. let url = this.audioUrl + path;
  17427. if (Laya.Browser.onAndroid) {
  17428. url += ".ogg";
  17429. }
  17430. else {
  17431. url += ".mp3";
  17432. }
  17433. return url;
  17434. }
  17435. pauseMusic(pause) {
  17436. if (pause) {
  17437. this.mute(true);
  17438. }
  17439. else if (this.isSound)
  17440. this.mute(false);
  17441. }
  17442. stopMusic() {
  17443. Laya.SoundManager.stopMusic();
  17444. if (Moyu.isNeedPlatAudio) {
  17445. Moyu.stopMusic();
  17446. }
  17447. }
  17448. mute(mute) {
  17449. if (Moyu.isNeedPlatAudio) {
  17450. Moyu.pauseMusic(mute);
  17451. }
  17452. else {
  17453. Laya.SoundManager.musicMuted = mute;
  17454. if (!mute && !this.musicPlayed && this.musicPath) {
  17455. this.playMusic(this.musicPath);
  17456. }
  17457. }
  17458. }
  17459. stopSound(path) {
  17460. let url = this.getUrl(path);
  17461. Laya.SoundManager.stopSound(url);
  17462. }
  17463. playSound(path, loop = 1, soundMax = this.soundMax) {
  17464. if (!this.isLoad)
  17465. return;
  17466. if (!this.isSound)
  17467. return;
  17468. if (!path || path == "")
  17469. return;
  17470. let url = this.getUrl(path);
  17471. if (Moyu.isNeedPlatAudio) {
  17472. Moyu.playSound(path, loop == 0);
  17473. }
  17474. else {
  17475. let count = 1;
  17476. if (this.soundMap[path])
  17477. count = this.soundMap[path] + 1;
  17478. if (count > soundMax)
  17479. return;
  17480. this.soundMap[path] = count;
  17481. Laya.SoundManager.playSound(url, loop);
  17482. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17483. }
  17484. }
  17485. removePath(path) {
  17486. if (this.soundMap[path]) {
  17487. let count = this.soundMap[path];
  17488. count--;
  17489. if (count < 1)
  17490. delete this.soundMap[path];
  17491. else
  17492. this.soundMap[path] = count;
  17493. }
  17494. }
  17495. playBtnSound() {
  17496. this.playSound("btn");
  17497. }
  17498. playGetSound() {
  17499. }
  17500. playCloseUISound() {
  17501. }
  17502. }
  17503. SoundMgr._instance = null;
  17504. var Handler$1 = Laya.Handler;
  17505. var EResType;
  17506. (function (EResType) {
  17507. EResType[EResType["none"] = 0] = "none";
  17508. EResType[EResType["nromal"] = 1] = "nromal";
  17509. EResType[EResType["td"] = 2] = "td";
  17510. EResType[EResType["sk"] = 3] = "sk";
  17511. })(EResType || (EResType = {}));
  17512. class CResLoader {
  17513. constructor(doneCall, proCall) {
  17514. this.completrCall = doneCall;
  17515. this.progressCall = proCall;
  17516. this.progressHander = new Handler$1(this, this.onProgress);
  17517. this.tdResMap = {};
  17518. }
  17519. load(resList) {
  17520. this.resCount = 0;
  17521. this.loadCount = 0;
  17522. for (let i = 0; i < resList.length; i++) {
  17523. let path = resList[i];
  17524. if (!path)
  17525. continue;
  17526. this.resCount++;
  17527. let type = this.getResType(path);
  17528. if (type == EResType.nromal)
  17529. this.loadNromal(path);
  17530. else if (type == EResType.td)
  17531. this.loadTd(path);
  17532. }
  17533. }
  17534. getRes(path) {
  17535. let type = this.getResType(path);
  17536. if (type == EResType.nromal)
  17537. return Laya.loader.getRes(path);
  17538. else if (type == EResType.td) {
  17539. let res = this.tdResMap[path];
  17540. if (res)
  17541. return res.clone();
  17542. return null;
  17543. }
  17544. }
  17545. destroy() {
  17546. this.progressHander.clear();
  17547. this.progressHander = null;
  17548. }
  17549. clearRes(path) {
  17550. let type = this.getResType(path);
  17551. if (type == EResType.nromal)
  17552. Laya.loader.clearRes(path);
  17553. else if (type == EResType.td) {
  17554. let obj = this.tdResMap[path];
  17555. if (obj)
  17556. obj.destroy();
  17557. delete this.tdResMap[path];
  17558. }
  17559. }
  17560. getResType(path) {
  17561. let exs = this.getExtension(path);
  17562. if (exs == "sk")
  17563. return EResType.sk;
  17564. if (exs == "ls" || exs == "lh" || exs == "lm")
  17565. return EResType.td;
  17566. else
  17567. return EResType.nromal;
  17568. }
  17569. getExtension(res) {
  17570. var index = res.lastIndexOf(".");
  17571. return res.substr(index + 1);
  17572. }
  17573. loadNromal(path) {
  17574. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17575. if (res) {
  17576. this.onLoad();
  17577. }
  17578. else
  17579. console.log("load res fail:" + path);
  17580. }), this.progressHander);
  17581. }
  17582. loadSk() {
  17583. }
  17584. loadTd(path) {
  17585. if (this.tdResMap[path]) {
  17586. this.onLoad();
  17587. return;
  17588. }
  17589. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17590. if (res) {
  17591. this.tdResMap[path] = res;
  17592. this.onLoad();
  17593. }
  17594. else
  17595. console.log("load res fail:" + path);
  17596. }));
  17597. }
  17598. onLoad() {
  17599. this.loadCount++;
  17600. this.onProgress(1);
  17601. if (this.loadCount >= this.resCount) {
  17602. this.completrCall.run();
  17603. }
  17604. }
  17605. onProgress(pro) {
  17606. let progress = (this.loadCount + pro) / this.resCount;
  17607. this.progressCall.runWith(progress);
  17608. }
  17609. }
  17610. var Handler$2 = Laya.Handler;
  17611. class ResInfo {
  17612. constructor() {
  17613. this.index = 0;
  17614. }
  17615. }
  17616. class ResMgr {
  17617. constructor() {
  17618. this.resList = [];
  17619. this.doneList = [];
  17620. this.resMap = {};
  17621. this.currentLoad = null;
  17622. this.completeHandler = new Handler$2(this, this.onComplete);
  17623. this.progressHandler = new Handler$2(this, this.onProgress);
  17624. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17625. }
  17626. static getInstance() {
  17627. if (ResMgr._instance == null) {
  17628. ResMgr._instance = new ResMgr();
  17629. }
  17630. return ResMgr._instance;
  17631. }
  17632. loadList(list, completeHandler, progressHandler) {
  17633. if (list.length < 1) {
  17634. completeHandler.run();
  17635. return;
  17636. }
  17637. let info = this.getResInfo();
  17638. info.resList = list;
  17639. info.completeHandler = completeHandler;
  17640. info.progressHandler = progressHandler;
  17641. this.resList.push(info);
  17642. this.startLoad();
  17643. }
  17644. loadFguiRes(list, completeHandler, progressHandler) {
  17645. Laya.loader.load(list, completeHandler, progressHandler);
  17646. }
  17647. loadAny(list, completeHandler, progressHandler) {
  17648. Laya.loader.load(list, completeHandler, progressHandler);
  17649. }
  17650. load(path, completeHandler, progressHandler) {
  17651. let count = this.resMap[path];
  17652. if (count && count > 0) {
  17653. if (completeHandler)
  17654. completeHandler.run();
  17655. }
  17656. else
  17657. this.loadList([path], completeHandler, progressHandler);
  17658. }
  17659. getRes(path) {
  17660. let res = this.resMap[path];
  17661. if (!res)
  17662. this.showLog("资源不存在:" + path);
  17663. else
  17664. return this.loader.getRes(path);
  17665. }
  17666. clearList(list, force = false) {
  17667. if (!list || list.length < 1)
  17668. return;
  17669. let cr = () => {
  17670. for (const k in list) {
  17671. let v = list[k];
  17672. if (!v)
  17673. continue;
  17674. if (force) {
  17675. this.loader.clearRes(v);
  17676. delete this.resMap[v];
  17677. }
  17678. else {
  17679. let count = this.resMap[v];
  17680. if (count && count > 1) {
  17681. count--;
  17682. this.resMap[v] = count;
  17683. }
  17684. else {
  17685. this.loader.clearRes(v);
  17686. delete this.resMap[v];
  17687. }
  17688. }
  17689. }
  17690. if (!window.hasOwnProperty("ks"))
  17691. Laya.Resource.destroyUnusedResources();
  17692. };
  17693. Laya.timer.clearAll(this);
  17694. Laya.timer.once(2000, this, cr);
  17695. }
  17696. clear3D() {
  17697. for (const k in this.loader.tdResMap) {
  17698. this.loader.clearRes(k);
  17699. if (this.resMap[k])
  17700. delete this.resMap[k];
  17701. }
  17702. if (!window.hasOwnProperty("ks"))
  17703. Laya.Resource.destroyUnusedResources();
  17704. }
  17705. clear(path, force = false) {
  17706. this.clearList([path], force);
  17707. }
  17708. getResInfo() {
  17709. if (this.doneList.length > 0)
  17710. return this.doneList.pop();
  17711. else
  17712. return new ResInfo();
  17713. }
  17714. startLoad() {
  17715. if (this.currentLoad)
  17716. return;
  17717. this.currentLoad = this.resList.pop();
  17718. if (this.currentLoad) {
  17719. this.loader.load(this.currentLoad.resList);
  17720. }
  17721. }
  17722. onComplete() {
  17723. if (!this.currentLoad)
  17724. return;
  17725. for (const k in this.currentLoad.resList) {
  17726. let v = this.currentLoad.resList[k];
  17727. let count = this.resMap[v];
  17728. if (count)
  17729. count++;
  17730. else
  17731. count = 1;
  17732. this.resMap[v] = count;
  17733. }
  17734. if (this.currentLoad.completeHandler)
  17735. this.currentLoad.completeHandler.run();
  17736. this.doneList.push(this.currentLoad);
  17737. this.currentLoad = null;
  17738. this.startLoad();
  17739. }
  17740. onProgress(pro) {
  17741. if (!this.currentLoad)
  17742. return;
  17743. if (this.currentLoad.progressHandler)
  17744. this.currentLoad.progressHandler.runWith(pro);
  17745. }
  17746. showLog(str, ...args) {
  17747. console.log("[ResLoader] " + str);
  17748. }
  17749. }
  17750. ResMgr._instance = null;
  17751. class EventMgr extends Laya.EventDispatcher {
  17752. }
  17753. let eventMgr = new EventMgr();
  17754. /*! *****************************************************************************
  17755. Copyright (c) Microsoft Corporation. All rights reserved.
  17756. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17757. this file except in compliance with the License. You may obtain a copy of the
  17758. License at http://www.apache.org/licenses/LICENSE-2.0
  17759. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17760. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17761. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17762. MERCHANTABLITY OR NON-INFRINGEMENT.
  17763. See the Apache Version 2.0 License for specific language governing permissions
  17764. and limitations under the License.
  17765. ***************************************************************************** */
  17766. /* global Reflect, Promise */
  17767. var extendStatics = function(d, b) {
  17768. extendStatics = Object.setPrototypeOf ||
  17769. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17770. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17771. return extendStatics(d, b);
  17772. };
  17773. function __extends(d, b) {
  17774. extendStatics(d, b);
  17775. function __() { this.constructor = d; }
  17776. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17777. }
  17778. var __assign = function() {
  17779. __assign = Object.assign || function __assign(t) {
  17780. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17781. s = arguments[i];
  17782. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17783. }
  17784. return t;
  17785. };
  17786. return __assign.apply(this, arguments);
  17787. };
  17788. function __rest(s, e) {
  17789. var t = {};
  17790. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17791. t[p] = s[p];
  17792. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17793. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17794. t[p[i]] = s[p[i]];
  17795. return t;
  17796. }
  17797. function __decorate(decorators, target, key, desc) {
  17798. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17799. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17800. 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;
  17801. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17802. }
  17803. function __param(paramIndex, decorator) {
  17804. return function (target, key) { decorator(target, key, paramIndex); }
  17805. }
  17806. function __metadata(metadataKey, metadataValue) {
  17807. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17808. }
  17809. function __awaiter(thisArg, _arguments, P, generator) {
  17810. return new (P || (P = Promise))(function (resolve, reject) {
  17811. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17812. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17813. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17814. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17815. });
  17816. }
  17817. function __generator(thisArg, body) {
  17818. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17819. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17820. function verb(n) { return function (v) { return step([n, v]); }; }
  17821. function step(op) {
  17822. if (f) throw new TypeError("Generator is already executing.");
  17823. while (_) try {
  17824. 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;
  17825. if (y = 0, t) op = [op[0] & 2, t.value];
  17826. switch (op[0]) {
  17827. case 0: case 1: t = op; break;
  17828. case 4: _.label++; return { value: op[1], done: false };
  17829. case 5: _.label++; y = op[1]; op = [0]; continue;
  17830. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17831. default:
  17832. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17833. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17834. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17835. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17836. if (t[2]) _.ops.pop();
  17837. _.trys.pop(); continue;
  17838. }
  17839. op = body.call(thisArg, _);
  17840. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17841. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17842. }
  17843. }
  17844. function __exportStar(m, exports) {
  17845. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17846. }
  17847. function __values(o) {
  17848. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17849. if (m) return m.call(o);
  17850. return {
  17851. next: function () {
  17852. if (o && i >= o.length) o = void 0;
  17853. return { value: o && o[i++], done: !o };
  17854. }
  17855. };
  17856. }
  17857. function __read(o, n) {
  17858. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17859. if (!m) return o;
  17860. var i = m.call(o), r, ar = [], e;
  17861. try {
  17862. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17863. }
  17864. catch (error) { e = { error: error }; }
  17865. finally {
  17866. try {
  17867. if (r && !r.done && (m = i["return"])) m.call(i);
  17868. }
  17869. finally { if (e) throw e.error; }
  17870. }
  17871. return ar;
  17872. }
  17873. function __spread() {
  17874. for (var ar = [], i = 0; i < arguments.length; i++)
  17875. ar = ar.concat(__read(arguments[i]));
  17876. return ar;
  17877. }
  17878. function __await(v) {
  17879. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17880. }
  17881. function __asyncGenerator(thisArg, _arguments, generator) {
  17882. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17883. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17884. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17885. 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); }); }; }
  17886. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17887. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17888. function fulfill(value) { resume("next", value); }
  17889. function reject(value) { resume("throw", value); }
  17890. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17891. }
  17892. function __asyncDelegator(o) {
  17893. var i, p;
  17894. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17895. 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; }
  17896. }
  17897. function __asyncValues(o) {
  17898. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17899. var m = o[Symbol.asyncIterator], i;
  17900. 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);
  17901. 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); }); }; }
  17902. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17903. }
  17904. function __makeTemplateObject(cooked, raw) {
  17905. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17906. return cooked;
  17907. };
  17908. function __importStar(mod) {
  17909. if (mod && mod.__esModule) return mod;
  17910. var result = {};
  17911. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17912. result.default = mod;
  17913. return result;
  17914. }
  17915. function __importDefault(mod) {
  17916. return (mod && mod.__esModule) ? mod : { default: mod };
  17917. }
  17918. class CustomAlert {
  17919. static show(title, content, buttons) {
  17920. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17921. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17922. return;
  17923. }
  17924. const bg = new Laya.Box();
  17925. bg.alpha = 0;
  17926. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17927. Laya.stage.addChild(bg);
  17928. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17929. const panel = new Laya.Box();
  17930. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17931. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17932. bg.addChild(panel);
  17933. const titleText = new Laya.Text();
  17934. titleText.text = title;
  17935. titleText.fontSize = 32;
  17936. titleText.color = "#333333";
  17937. titleText.bold = true;
  17938. titleText.pos(20, 20);
  17939. titleText.width = 360;
  17940. titleText.align = "center";
  17941. panel.addChild(titleText);
  17942. const contentText = new Laya.Text();
  17943. contentText.text = content;
  17944. contentText.fontSize = 21;
  17945. contentText.color = "#555555";
  17946. contentText.pos(20, 70);
  17947. contentText.width = 360;
  17948. contentText.wordWrap = true;
  17949. contentText.align = "center";
  17950. panel.addChild(contentText);
  17951. const buttonContainer = new Laya.Box();
  17952. buttonContainer.pos(20, 160);
  17953. panel.addChild(buttonContainer);
  17954. const btnWidth = 120;
  17955. const spacing = 30;
  17956. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17957. buttons.forEach((btn, index) => {
  17958. const button = new Laya.Button();
  17959. button.label = btn.label;
  17960. button.size(btnWidth, 40);
  17961. button.labelSize = 22;
  17962. button.pos(index * (btnWidth + spacing), 0);
  17963. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17964. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17965. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17966. button.alpha = 0.9;
  17967. });
  17968. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17969. button.alpha = 1;
  17970. });
  17971. button.on(Laya.Event.CLICK, this, () => {
  17972. btn.handler();
  17973. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17974. bg.removeSelf();
  17975. }));
  17976. });
  17977. buttonContainer.addChild(button);
  17978. });
  17979. buttonContainer.x = (panel.width - totalWidth) / 2;
  17980. }
  17981. }
  17982. class ConfigMgr {
  17983. constructor() {
  17984. this.httpReqCount = 4;
  17985. this.httpReqOkCount = 0;
  17986. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17987. try {
  17988. this.httpReqOkCount = 0;
  17989. let reqData = xGame.httpMgr.getReqData();
  17990. console.log('zh:第1个请求getClassicCfg');
  17991. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17992. this.classicCfg = classicCfg;
  17993. this.httpReqOkCount++;
  17994. console.log('zh:第2个请求getLevelCfg');
  17995. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17996. this.levelCfg = levelCfg;
  17997. this.httpReqOkCount++;
  17998. console.log('zh:第3个请求 getPlaceBallCfg');
  17999. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  18000. this.placeBallCfg = placeBallCfg;
  18001. this.httpReqOkCount++;
  18002. console.log('zh:第4个请求 npc');
  18003. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  18004. this.npcJson = npc.Data;
  18005. this.httpReqOkCount++;
  18006. console.log('zh:所有配置加载完成');
  18007. }
  18008. catch (error) {
  18009. console.error('zh:❌请求失败:', error);
  18010. Laya.timer.once(5000, this, () => {
  18011. let retryCount = 0;
  18012. const maxRetries = 3;
  18013. const tryFetchConfig = () => {
  18014. try {
  18015. xGame.cfgMgr.getConfigFromServer();
  18016. }
  18017. catch (error) {
  18018. if (retryCount < maxRetries) {
  18019. retryCount++;
  18020. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  18021. Laya.timer.once(5000, this, tryFetchConfig);
  18022. }
  18023. else {
  18024. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  18025. }
  18026. }
  18027. };
  18028. tryFetchConfig();
  18029. });
  18030. }
  18031. finally {
  18032. if (this.httpReqCount > this.httpReqOkCount) {
  18033. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  18034. label: "Okay", handler: () => {
  18035. JSBridgeUtils.instance.exitAndCloseGame();
  18036. }
  18037. }]);
  18038. }
  18039. }
  18040. });
  18041. this.sendPostAsync = (action, reqData) => {
  18042. return new Promise((resolve, reject) => {
  18043. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  18044. try {
  18045. let code = res.code;
  18046. if (code == 200) {
  18047. const parsedData = JSON.parse(res.msg);
  18048. resolve(parsedData);
  18049. }
  18050. else {
  18051. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  18052. reject(new Error(`Request failed with code: ${code}`));
  18053. }
  18054. }
  18055. catch (error) {
  18056. console.error(`ERROR=${error}`);
  18057. alert("Please check your network connection.");
  18058. reject(error);
  18059. }
  18060. finally {
  18061. console.log(`zh:${action}的请求处理完毕`);
  18062. }
  18063. });
  18064. });
  18065. };
  18066. }
  18067. static getInstance() {
  18068. if (!this._instance) {
  18069. this._instance = new ConfigMgr();
  18070. }
  18071. return this._instance;
  18072. }
  18073. init() {
  18074. this.getConfigFromServer();
  18075. }
  18076. test() {
  18077. let reqData = xGame.httpMgr.getReqData();
  18078. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  18079. console.log('zh:1s');
  18080. try {
  18081. let code = res.code;
  18082. let data = res.data;
  18083. if (code == 200) {
  18084. const parsedData = JSON.parse(data);
  18085. this.classicCfg = parsedData;
  18086. }
  18087. else {
  18088. console.log('zh:res = ' + JSON.stringify(res));
  18089. }
  18090. }
  18091. catch (error) {
  18092. console.log('error=' + error);
  18093. alert("Please check your network connection.");
  18094. }
  18095. finally {
  18096. console.log('zh:1');
  18097. }
  18098. });
  18099. }
  18100. getUserInfoByIndex(index) {
  18101. return this.npcJson[index];
  18102. }
  18103. getRandomUserInfo() {
  18104. let index = xGame.tools.random(0, this.npcJson.length);
  18105. let rs = this.npcJson[index];
  18106. return rs;
  18107. }
  18108. getMaxBigMoveLength() {
  18109. return Object.keys(this.levelCfg).length;
  18110. }
  18111. getBigMoveLevelByIndex(index) {
  18112. let cfg = this.levelCfg;
  18113. cfg = cfg[index];
  18114. return cfg;
  18115. }
  18116. getRandomClassicLevel() {
  18117. let cfg = this.classicCfg;
  18118. let num = Object.keys(cfg).length;
  18119. let rand = xGame.common.randomNum(1, num);
  18120. return cfg[rand];
  18121. }
  18122. getPlaceBallByLevel(level) {
  18123. return this.placeBallCfg[level];
  18124. }
  18125. getMaxPlaceBall() {
  18126. return Object.keys(this.placeBallCfg).length;
  18127. }
  18128. }
  18129. class PoolD3Mgr {
  18130. constructor() {
  18131. this.pool = {};
  18132. }
  18133. static get ins() {
  18134. return this._ins || (this._ins = new PoolD3Mgr);
  18135. }
  18136. createList(key, prefab, parent) {
  18137. if (!this.pool[key]) {
  18138. this.pool[key] = {};
  18139. this.pool[key].prefab = prefab;
  18140. this.pool[key].list = [];
  18141. this.pool[key].parent = parent;
  18142. }
  18143. }
  18144. getItem(key) {
  18145. if (!this.pool[key]) {
  18146. return;
  18147. }
  18148. let temp;
  18149. if (this.pool[key].list.length > 0) {
  18150. temp = this.pool[key].list.pop();
  18151. }
  18152. else {
  18153. temp = this.pool[key].prefab.clone();
  18154. if (this.pool[key].parent) {
  18155. this.pool[key].parent.addChild(temp);
  18156. }
  18157. }
  18158. temp.active = true;
  18159. return temp;
  18160. }
  18161. putItem(key, obj) {
  18162. if (!this.pool[key]) {
  18163. return;
  18164. }
  18165. obj.active = false;
  18166. this.pool[key].list.push(obj);
  18167. }
  18168. }
  18169. let context$1 = context;
  18170. let uiMgr = UIMgr.inst;
  18171. let soundMgr = SoundMgr.getInstance();
  18172. let resMgr = ResMgr.getInstance();
  18173. let httpMgr = HttpMgr.getInstance();
  18174. let common = Common.getInstance();
  18175. let cfgMgr = ConfigMgr.getInstance();
  18176. let poolD3Mgr = PoolD3Mgr.ins;
  18177. let d3TexUrl = "res/d3Res/";
  18178. let d3ModeUrl = "res/unityRes/";
  18179. function setStageSize(view) {
  18180. if (view.width) {
  18181. view.width = Laya.stage.width;
  18182. view.height = Laya.stage.height;
  18183. }
  18184. }
  18185. function filledBg(view) {
  18186. let wh = Laya.stage.height / Laya.stage.width;
  18187. if (wh > 16 / 9) {
  18188. view.height = Laya.stage.height;
  18189. view.width = Laya.stage.height / 1334 * 750;
  18190. }
  18191. else {
  18192. view.width = Laya.stage.width;
  18193. view.height = Laya.stage.width / 750 * 1334;
  18194. }
  18195. }
  18196. function setNotch(view) {
  18197. if (view.height) {
  18198. view.y += context$1.notchHeight;
  18199. }
  18200. }
  18201. function showTip(str) {
  18202. uiMgr.Show(UIMsg, str);
  18203. }
  18204. function log(...args) {
  18205. console.log(args);
  18206. }
  18207. let xGame = {
  18208. context: context$1,
  18209. eventMgr,
  18210. resMgr,
  18211. uiMgr,
  18212. soundMgr,
  18213. define,
  18214. tools,
  18215. httpMgr,
  18216. d3TexUrl,
  18217. d3ModeUrl,
  18218. common,
  18219. cfgMgr,
  18220. poolD3Mgr,
  18221. setStageSize,
  18222. filledBg,
  18223. setNotch,
  18224. showTip,
  18225. log,
  18226. };
  18227. window["xGame"] = xGame;
  18228. let dataName = 'tBall_';
  18229. class UserData {
  18230. constructor() {
  18231. this.userId = "";
  18232. this.isAgree = false;
  18233. this.coinNum = 0;
  18234. this.gemNum = 0;
  18235. this.sound = true;
  18236. this.vibration = true;
  18237. this.currentDate = 0;
  18238. this.createTime = 0;
  18239. this.awardTime = 0;
  18240. this.roleId = 1;
  18241. this.roleList = [];
  18242. this.roleAds = [];
  18243. this.dressId = 101;
  18244. this.itemId = 201;
  18245. this.bigSkills = [1, 1, 1, 1, 1];
  18246. this.coin = 4000;
  18247. this.diamond = 0;
  18248. this.skillSuccessTimes = 0;
  18249. this.skillGuide = 0;
  18250. this.lianXiGuide = 0;
  18251. this.skillAccTimes = 0;
  18252. this.placeBallData = [];
  18253. this.shareDiamondTimes = 0;
  18254. this.dailyVideoShareTimes = 0;
  18255. this.secretary = [1, 0];
  18256. this.curSecretary = 0;
  18257. this.ballRod = [1, 0, 0, 0, 0, 1];
  18258. this.curBallRod = 5;
  18259. this.signData = 0;
  18260. this.signTime = 0;
  18261. this.drawTimes = 0;
  18262. this.drawAwardTimes = 0;
  18263. this.dailyfreeDrawTimes = 1;
  18264. this.power = 5;
  18265. this.powerTime = 0;
  18266. this.challengeTimes = 0;
  18267. this.extraSign = 0;
  18268. this.classicTimes = 0;
  18269. this.guideHelpLine = 0;
  18270. this.newUser = true;
  18271. this.rootBallFoul = 0;
  18272. this.timeoutFoul = 0;
  18273. this.roleList = [1];
  18274. }
  18275. saveData() {
  18276. let data = {};
  18277. for (let k in this) {
  18278. data[k.toString()] = this[k];
  18279. }
  18280. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18281. }
  18282. getData() {
  18283. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18284. if (ld) {
  18285. let localData = JSON.parse(ld);
  18286. if (localData) {
  18287. for (let k in this) {
  18288. let key = k.toString();
  18289. let data = localData[key];
  18290. if (data != undefined) {
  18291. this[k] = data;
  18292. }
  18293. }
  18294. }
  18295. }
  18296. }
  18297. }
  18298. class ItemData {
  18299. constructor() {
  18300. this.itemList = {};
  18301. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18302. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18303. }
  18304. saveData() {
  18305. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18306. }
  18307. getData() {
  18308. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18309. if (ld) {
  18310. let localData = JSON.parse(ld);
  18311. if (localData) {
  18312. this.itemList = localData;
  18313. }
  18314. }
  18315. }
  18316. }
  18317. class GameData {
  18318. constructor() {
  18319. this.curLevel = 0;
  18320. this.gameType = 1;
  18321. this.signIdx = 0;
  18322. this.signMax = 0;
  18323. this.rotaryTime = 0;
  18324. this.rotaryCount = 0;
  18325. this.rotaryList = [];
  18326. this.diyCount = 3;
  18327. this.awardIdx = 0;
  18328. this.shareNum = 2;
  18329. this.rankWeek = 0;
  18330. this.rankScore = 0;
  18331. this.gameCount = 0;
  18332. this.trySkill = -1;
  18333. this.tryTime = 0;
  18334. }
  18335. saveData() {
  18336. let data = {};
  18337. for (let k in this) {
  18338. data[k.toString()] = this[k];
  18339. }
  18340. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18341. }
  18342. getData() {
  18343. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18344. if (ld) {
  18345. let localData = JSON.parse(ld);
  18346. if (localData) {
  18347. for (let k in this) {
  18348. let key = k.toString();
  18349. let data = localData[key];
  18350. if (data != undefined) {
  18351. this[k] = data;
  18352. }
  18353. }
  18354. }
  18355. }
  18356. }
  18357. }
  18358. class Diy2025GameData {
  18359. constructor() {
  18360. this.challengeMode_overLev = 0;
  18361. this.xszyForClassic = false;
  18362. this.xszyForChallenge = false;
  18363. }
  18364. saveData() {
  18365. let data = {};
  18366. for (let k in this) {
  18367. data[k.toString()] = this[k];
  18368. }
  18369. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18370. }
  18371. getData() {
  18372. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18373. if (ld) {
  18374. let localData = JSON.parse(ld);
  18375. if (localData) {
  18376. for (let k in this) {
  18377. let key = k.toString();
  18378. let data = localData[key];
  18379. if (data != undefined) {
  18380. this[k] = data;
  18381. }
  18382. }
  18383. }
  18384. }
  18385. }
  18386. }
  18387. class UIFuli1 extends UIBase {
  18388. constructor() {
  18389. super();
  18390. this.jiage = 4.99;
  18391. }
  18392. onConstructor() {
  18393. this.ui = ui_UIFuli1.createInstance();
  18394. this.contentPane = this.ui;
  18395. this.isEject = false;
  18396. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18397. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18398. }
  18399. show() {
  18400. super.show();
  18401. this.x = (Laya.stage.width - this.width) / 2;
  18402. this.y = (Laya.stage.height - this.height) / 2;
  18403. this.ui.n2.txt_price.text = "$" + this.jiage;
  18404. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  18405. this.setGlobalFont(this.ui);
  18406. }
  18407. closeSelf() {
  18408. DataMgr.loadUserSpOrderForAd();
  18409. this.hide();
  18410. }
  18411. gotoBuy() {
  18412. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18413. if (userInfo != null) {
  18414. let token = userInfo.token;
  18415. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  18416. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  18417. DataMgr.loadUserSpOrderForAd();
  18418. return;
  18419. }
  18420. else {
  18421. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18422. }
  18423. }
  18424. gotoBuy2() {
  18425. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18426. if (userInfo == null) {
  18427. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18428. return;
  18429. }
  18430. let reqData = xGame.httpMgr.getReqData();
  18431. let pd = JSON.parse(reqData);
  18432. pd.productId = 1;
  18433. reqData = JSON.stringify(pd);
  18434. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18435. try {
  18436. console.log('zh:buySp res = ' + JSON.stringify(res));
  18437. let code = res.code;
  18438. let msg = res.msg;
  18439. if (code == 401) {
  18440. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18441. alert(TIP_MSG_key.loginTimeOut);
  18442. xGame.uiMgr.Show(UIMsg, msg);
  18443. return;
  18444. }
  18445. if (code == 200) {
  18446. xGame.uiMgr.Show(UIMsg, msg);
  18447. DataMgr.loadUserSpOrderForAd();
  18448. DataMgr.getUserZiChanInfo(false);
  18449. this.closeSelf();
  18450. }
  18451. else {
  18452. xGame.uiMgr.Show(UIMsg, msg);
  18453. }
  18454. }
  18455. catch (error) {
  18456. console.log('error=' + error);
  18457. alert(error);
  18458. }
  18459. finally {
  18460. }
  18461. });
  18462. }
  18463. }
  18464. UIFuli1.uiName = "UIFuli1";
  18465. class UIFuli2 extends UIBase {
  18466. constructor() {
  18467. super();
  18468. this.jiage = 14.99;
  18469. }
  18470. onConstructor() {
  18471. this.ui = ui_UIFuli2.createInstance();
  18472. this.contentPane = this.ui;
  18473. this.isEject = false;
  18474. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18475. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18476. }
  18477. show() {
  18478. super.show();
  18479. this.x = (Laya.stage.width - this.width) / 2;
  18480. this.y = (Laya.stage.height - this.height) / 2;
  18481. this.ui.n2.txt_price.text = "$" + this.jiage;
  18482. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  18483. this.setGlobalFont(this.ui);
  18484. }
  18485. closeSelf() {
  18486. DataMgr.loadUserSpOrderForAd();
  18487. this.hide();
  18488. }
  18489. gotoBuy() {
  18490. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18491. if (userInfo != null) {
  18492. let token = userInfo.token;
  18493. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  18494. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  18495. DataMgr.loadUserSpOrderForAd();
  18496. return;
  18497. }
  18498. else {
  18499. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18500. }
  18501. }
  18502. gotoBuy1() {
  18503. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18504. if (userInfo == null) {
  18505. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18506. return;
  18507. }
  18508. let reqData = xGame.httpMgr.getReqData();
  18509. let pd = JSON.parse(reqData);
  18510. pd.productId = 2;
  18511. reqData = JSON.stringify(pd);
  18512. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18513. try {
  18514. console.log('zh:buySp res = ' + JSON.stringify(res));
  18515. let code = res.code;
  18516. let msg = res.msg;
  18517. if (code == 401) {
  18518. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18519. alert(TIP_MSG_key.loginTimeOut);
  18520. xGame.uiMgr.Show(UIMsg, msg);
  18521. return;
  18522. }
  18523. if (code == 200) {
  18524. xGame.uiMgr.Show(UIMsg, msg);
  18525. DataMgr.loadUserSpOrderForAd();
  18526. DataMgr.getUserZiChanInfo(false);
  18527. this.closeSelf();
  18528. }
  18529. else {
  18530. xGame.uiMgr.Show(UIMsg, msg);
  18531. }
  18532. }
  18533. catch (error) {
  18534. console.log('error=' + error);
  18535. alert(error);
  18536. }
  18537. finally {
  18538. }
  18539. });
  18540. }
  18541. }
  18542. UIFuli2.uiName = "UIFuli2";
  18543. class DataMgr {
  18544. static Init() {
  18545. this.userData = new UserData();
  18546. this.gameData = new GameData();
  18547. this.itemData = new ItemData();
  18548. this.diyGameData = new Diy2025GameData();
  18549. this.userData.getData();
  18550. this.gameData.getData();
  18551. this.itemData.getData();
  18552. this.diyGameData.getData();
  18553. this.roleId = this.userData.roleId;
  18554. this.resetUse();
  18555. }
  18556. static isNewDay() {
  18557. Moyu.isNewDay(this, (isnew) => {
  18558. xGame.common.isNewDay = isnew;
  18559. if (!isnew)
  18560. return;
  18561. DataMgr.setShareDiamondTimes(0, false);
  18562. DataMgr.setDailyVideoShareTimes(0, false);
  18563. DataMgr.setDailyfreeDrawTimes(1);
  18564. DataMgr.setExtraSign(0);
  18565. });
  18566. }
  18567. static deletData() {
  18568. Laya.LocalStorage.clear();
  18569. }
  18570. static upRankData() {
  18571. let num = xGame.common.getAllStarNum();
  18572. if (num > 0)
  18573. Moyu.upRankData(xGame.common.curRankID, num);
  18574. }
  18575. static addItem(id, count = 1) {
  18576. let v = this.itemData.itemList[id];
  18577. if (!v)
  18578. v = { id: id, count: count, adnum: 0, active: true };
  18579. else {
  18580. if (v.active) {
  18581. v.count += count;
  18582. }
  18583. else {
  18584. v.count = count;
  18585. v.active = true;
  18586. }
  18587. }
  18588. this.itemData.itemList[id] = v;
  18589. xGame.soundMgr.playGetSound();
  18590. this.saveItemData();
  18591. }
  18592. static hasItem(id) {
  18593. let v = this.itemData.itemList[id];
  18594. if (v && v.active)
  18595. return true;
  18596. return false;
  18597. }
  18598. static getItem(id) {
  18599. let v = this.itemData.itemList[id];
  18600. return v;
  18601. }
  18602. static getItemCount(id) {
  18603. let v = this.itemData.itemList[id];
  18604. if (v && v.active)
  18605. return v.count;
  18606. return 0;
  18607. }
  18608. static getItemAd(id) {
  18609. let v = this.itemData.itemList[id];
  18610. if (v) {
  18611. return v.adnum;
  18612. }
  18613. return 0;
  18614. }
  18615. static onItemAd(id, num = 1) {
  18616. let v = this.itemData.itemList[id];
  18617. if (!v)
  18618. v = { id: id, count: 1, adnum: num, active: false };
  18619. else
  18620. v.adnum += num;
  18621. this.itemData.itemList[id] = v;
  18622. this.saveItemData();
  18623. }
  18624. static costItem(id, count) {
  18625. let v = this.itemData.itemList[id];
  18626. if (v && v.active) {
  18627. if (v.count < count)
  18628. return false;
  18629. else {
  18630. v.count -= count;
  18631. this.itemData.itemList[id] = v;
  18632. return true;
  18633. }
  18634. }
  18635. return false;
  18636. }
  18637. static resetUse() {
  18638. this.dressId = this.userData.dressId;
  18639. this.itemId = this.userData.itemId;
  18640. }
  18641. static passLevel() {
  18642. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18643. this.gameData.curLevel++;
  18644. this.curLevel = this.gameData.curLevel;
  18645. this.saveGameData();
  18646. }
  18647. static useRole(id) {
  18648. this.roleId = id;
  18649. if (this.hasRole(id)) {
  18650. this.userData.roleId = id;
  18651. this.saveUserData();
  18652. }
  18653. }
  18654. static addRole(id) {
  18655. if (this.hasRole(id))
  18656. return;
  18657. this.userData.roleList.push(id);
  18658. this.saveUserData();
  18659. }
  18660. static hasRole(id) {
  18661. return this.userData.roleList.indexOf(id) >= 0;
  18662. }
  18663. static gemEnough(num) {
  18664. return this.userData.gemNum >= num;
  18665. }
  18666. static roleHasAd(id) {
  18667. let count = this.userData.roleAds[id];
  18668. if (count != undefined && count >= 0)
  18669. return true;
  18670. else
  18671. return false;
  18672. }
  18673. static saveUserData(time = 500, event, arg) {
  18674. if (this.userSaving)
  18675. return;
  18676. this.userSaving = true;
  18677. Laya.timer.once(time, this, () => {
  18678. this.userSaving = false;
  18679. this.userData.saveData();
  18680. if (event)
  18681. xGame.eventMgr.event(event, arg);
  18682. });
  18683. }
  18684. static updateUserNickName(loginUserName) {
  18685. let kyeStr = 'moyudata_180';
  18686. console.log('zh:################### kyeStr=' + kyeStr);
  18687. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18688. if (moyudata) {
  18689. const obj = JSON.parse(moyudata);
  18690. obj.nickName = loginUserName;
  18691. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18692. console.log('zh:################### updateUserNickName');
  18693. }
  18694. }
  18695. static saveGameData() {
  18696. if (this.gameSaving)
  18697. return;
  18698. this.gameSaving = true;
  18699. Laya.timer.once(1000, this, () => {
  18700. this.gameSaving = false;
  18701. this.gameData.saveData();
  18702. });
  18703. }
  18704. static saveItemData() {
  18705. let fun = () => {
  18706. this.itemData.saveData();
  18707. };
  18708. Laya.timer.clear(this, fun);
  18709. Laya.timer.once(500, this, fun);
  18710. }
  18711. static saveData() {
  18712. this.saveUserData();
  18713. this.saveGameData();
  18714. }
  18715. static getBigSkillList() {
  18716. return this.userData.bigSkills;
  18717. }
  18718. static getBigSkillByIndex(index) {
  18719. return this.userData.bigSkills[index];
  18720. }
  18721. static setBigSkill(index, val, addUp = true) {
  18722. if (addUp) {
  18723. this.userData.bigSkills[index] += val;
  18724. }
  18725. else {
  18726. this.userData.bigSkills[index] = val;
  18727. }
  18728. this.saveUserData();
  18729. console.log("zh:大技能更新");
  18730. this.updateUserInfo2Server("bigSkills");
  18731. }
  18732. static setBigSkillFormServer(jsonStr) {
  18733. console.log("zh:大技能 setBigSkillFormServer =" + jsonStr);
  18734. this.userData.bigSkills = JSON.parse(jsonStr);
  18735. this.saveUserData();
  18736. }
  18737. static coinEnough(need) {
  18738. if (typeof need != "number") {
  18739. console.error("金币格式错误");
  18740. return;
  18741. }
  18742. return this.userData.coin >= need;
  18743. }
  18744. static setCoin(val) {
  18745. if (typeof val != "number") {
  18746. return;
  18747. }
  18748. this.userData.coin += val;
  18749. this.saveUserData();
  18750. xGame.eventMgr.event(COIN_CHANGE);
  18751. this.updateUserInfo2Server("jb");
  18752. }
  18753. static setCoin2(val) {
  18754. if (typeof val != "number") {
  18755. return;
  18756. }
  18757. this.userData.coin = val;
  18758. this.saveUserData();
  18759. xGame.eventMgr.event(COIN_CHANGE);
  18760. }
  18761. static setCoinFormServer(val) {
  18762. if (typeof val != "number") {
  18763. return;
  18764. }
  18765. this.userData.coin = val;
  18766. this.saveUserData();
  18767. console.log('zh:通知更新金币变化' + val);
  18768. xGame.eventMgr.event(COIN_CHANGE);
  18769. }
  18770. static getCoin() {
  18771. return this.userData.coin;
  18772. }
  18773. static diamondEnough(need) {
  18774. if (typeof need != "number") {
  18775. console.error("金币格式错误");
  18776. return;
  18777. }
  18778. return this.userData.diamond >= need;
  18779. }
  18780. static setDiamond(val) {
  18781. if (typeof val != "number") {
  18782. return;
  18783. }
  18784. this.userData.diamond += val;
  18785. this.saveUserData();
  18786. xGame.eventMgr.event(DIAMOND_CHANGE);
  18787. this.updateUserInfo2Server("zs");
  18788. }
  18789. static setDiamond2(val) {
  18790. if (typeof val != "number") {
  18791. return;
  18792. }
  18793. this.userData.diamond = val;
  18794. this.saveUserData();
  18795. xGame.eventMgr.event(DIAMOND_CHANGE);
  18796. }
  18797. static setDiamondFormServer(val) {
  18798. if (typeof val != "number") {
  18799. return;
  18800. }
  18801. this.userData.diamond = val;
  18802. this.saveUserData();
  18803. console.log('zh:通知更新钻石变化' + val);
  18804. xGame.eventMgr.event(DIAMOND_CHANGE);
  18805. }
  18806. static getDiamond() {
  18807. return this.userData.diamond;
  18808. }
  18809. static getSkillSuccessTimes() {
  18810. return this.userData.skillSuccessTimes;
  18811. }
  18812. static setSkillSuccessTimes(val, addUp = true) {
  18813. if (addUp)
  18814. this.userData.skillSuccessTimes += val;
  18815. else
  18816. this.userData.skillSuccessTimes = val;
  18817. this.saveUserData();
  18818. }
  18819. static getSkillAccTimes() {
  18820. return this.userData.skillAccTimes;
  18821. }
  18822. static setSkillAccTimes(val) {
  18823. this.userData.skillAccTimes += val;
  18824. this.saveUserData();
  18825. }
  18826. static getSkillGuide() {
  18827. if (!xGame.common.openGuide) {
  18828. return 1;
  18829. }
  18830. return this.userData.skillGuide;
  18831. }
  18832. static setSkillGuide(val) {
  18833. this.userData.skillGuide = val;
  18834. this.saveUserData();
  18835. }
  18836. static setLianXiGuide(val) {
  18837. this.userData.lianXiGuide = val;
  18838. this.saveUserData();
  18839. }
  18840. static getLianXiGuide() {
  18841. return this.userData.lianXiGuide;
  18842. }
  18843. static getPlaceBallLevelList() {
  18844. return this.userData.placeBallData;
  18845. }
  18846. static setPlaceBallLevelList(objStr) {
  18847. if (objStr) {
  18848. let obj = JSON.parse(objStr);
  18849. this.userData.placeBallData = obj;
  18850. let cd = obj.length;
  18851. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18852. xGame.common.placeBallCurLevel = cd;
  18853. DataMgr.setChallengeMode_overLev(cd);
  18854. this.saveUserData();
  18855. }
  18856. else {
  18857. this.userData.placeBallData = [];
  18858. this.saveUserData();
  18859. }
  18860. }
  18861. static getPlaceBallLevel(level) {
  18862. let arr = this.userData.placeBallData;
  18863. let index = level - 1;
  18864. let out;
  18865. if (arr[index]) {
  18866. out = arr[index];
  18867. }
  18868. else {
  18869. let max = arr.length;
  18870. if (max == index) {
  18871. out = {
  18872. star: 0,
  18873. play: true,
  18874. isCur: true,
  18875. getAward: false
  18876. };
  18877. }
  18878. else {
  18879. out = {
  18880. star: 0,
  18881. play: false,
  18882. getAward: false
  18883. };
  18884. }
  18885. }
  18886. return out;
  18887. }
  18888. static setPlaceBallLevel(level, star) {
  18889. let arr = this.userData.placeBallData;
  18890. let index = level - 1;
  18891. if (arr[index]) {
  18892. arr[index].star = Math.max(arr[index].star, star);
  18893. }
  18894. else {
  18895. let max = arr.length;
  18896. if (max == index) {
  18897. arr.push({
  18898. star: star,
  18899. play: true,
  18900. getAward: false
  18901. });
  18902. }
  18903. else {
  18904. console.error("关卡存储出错");
  18905. }
  18906. }
  18907. this.saveUserData();
  18908. }
  18909. static setPlaceBallAward(level) {
  18910. let arr = this.userData.placeBallData;
  18911. let index = level - 1;
  18912. if (arr[index]) {
  18913. arr[index].getAward = true;
  18914. }
  18915. this.saveUserData();
  18916. }
  18917. static getShareDiamondTimes() {
  18918. return this.userData.shareDiamondTimes;
  18919. }
  18920. static setShareDiamondTimes(val, addUp = true) {
  18921. if (addUp) {
  18922. this.userData.shareDiamondTimes += val;
  18923. }
  18924. else {
  18925. this.userData.shareDiamondTimes = val;
  18926. }
  18927. this.saveUserData();
  18928. }
  18929. static getDailyVideoShareTimes() {
  18930. return this.userData.dailyVideoShareTimes;
  18931. }
  18932. static setDailyVideoShareTimes(val, addUp = true) {
  18933. if (addUp) {
  18934. this.userData.dailyVideoShareTimes += val;
  18935. }
  18936. else {
  18937. this.userData.dailyVideoShareTimes = val;
  18938. }
  18939. this.saveUserData();
  18940. }
  18941. static getSecretary(index) {
  18942. return this.userData.secretary[index];
  18943. }
  18944. static setSecretary(index, val) {
  18945. this.userData.secretary[index] = val;
  18946. this.saveUserData();
  18947. }
  18948. static getCurSecretary() {
  18949. return this.userData.curSecretary;
  18950. }
  18951. static setCurSecretary(index) {
  18952. this.userData.curSecretary = index;
  18953. this.saveUserData();
  18954. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18955. }
  18956. static getBallRod(index) {
  18957. return this.userData.ballRod[index];
  18958. }
  18959. static setBallRod(index, val) {
  18960. this.userData.ballRod[index] = val;
  18961. this.saveUserData();
  18962. }
  18963. static setBallRodFormServer(haveQiuGanJsonStr) {
  18964. if (!haveQiuGanJsonStr) {
  18965. console.log("setBallRodFormServer数据为空或未定义");
  18966. return;
  18967. }
  18968. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18969. const keys = Object.keys(haveQiuGanJsonObj);
  18970. keys.forEach(key => {
  18971. let v = haveQiuGanJsonObj[key];
  18972. let k = parseInt(key);
  18973. let idx = k - 1;
  18974. this.userData.ballRod[idx] = v;
  18975. });
  18976. }
  18977. static getCurBallRod() {
  18978. return this.userData.curBallRod;
  18979. }
  18980. static setCurBallRod(index) {
  18981. this.userData.curBallRod = index;
  18982. this.saveUserData();
  18983. }
  18984. static setSignData(val) {
  18985. this.userData.signData = val;
  18986. this.saveUserData();
  18987. }
  18988. static getSignData() {
  18989. return this.userData.signData;
  18990. }
  18991. static setSignTime(val) {
  18992. this.userData.signTime = val;
  18993. this.saveUserData();
  18994. }
  18995. static getSignTime() {
  18996. return this.userData.signTime;
  18997. }
  18998. static getDrawTimes() {
  18999. return this.userData.drawTimes;
  19000. }
  19001. static setDrawTimes(val, addUp = true) {
  19002. if (addUp) {
  19003. this.userData.drawTimes += val;
  19004. }
  19005. else {
  19006. this.userData.drawTimes = val;
  19007. }
  19008. this.saveUserData();
  19009. }
  19010. static getDrawAwardTimes() {
  19011. return this.userData.drawAwardTimes;
  19012. }
  19013. static setDrawAwardTimes(val) {
  19014. this.userData.drawAwardTimes = val;
  19015. this.saveUserData();
  19016. }
  19017. static getDailyfreeDrawTimes() {
  19018. return this.userData.dailyfreeDrawTimes;
  19019. }
  19020. static setDailyfreeDrawTimes(val) {
  19021. this.userData.dailyfreeDrawTimes = val;
  19022. this.saveUserData();
  19023. }
  19024. static setPower(val, addUp = true) {
  19025. if (addUp)
  19026. this.userData.power += val;
  19027. else
  19028. this.userData.power = val;
  19029. if (this.userData.power >= xGame.common.maxPower) {
  19030. this.userData.power = xGame.common.maxPower;
  19031. }
  19032. xGame.eventMgr.event(POWER_CHANGE, val);
  19033. this.saveUserData();
  19034. this.updateUserInfo2Server("power");
  19035. }
  19036. static getPower() {
  19037. return this.userData.power;
  19038. }
  19039. static setPowerTime(val) {
  19040. this.userData.powerTime = val;
  19041. this.saveUserData();
  19042. }
  19043. static getPowerTime() {
  19044. return this.userData.powerTime;
  19045. }
  19046. static powerEnough() {
  19047. return this.getPower() > 0;
  19048. }
  19049. static getChallengeTimes() {
  19050. return this.userData.challengeTimes;
  19051. }
  19052. static setChallengeTimes(val) {
  19053. this.userData.challengeTimes += val;
  19054. this.saveUserData();
  19055. }
  19056. static getExtraSign() {
  19057. return this.userData.extraSign;
  19058. }
  19059. static setExtraSign(val) {
  19060. this.userData.extraSign = val;
  19061. this.saveUserData();
  19062. }
  19063. static getClassicTimes() {
  19064. return this.userData.classicTimes;
  19065. }
  19066. static setClassicTimes() {
  19067. this.userData.classicTimes += 1;
  19068. this.saveUserData();
  19069. }
  19070. static getGuideHelpLine() {
  19071. return this.userData.guideHelpLine;
  19072. }
  19073. static setGuideHelpLine() {
  19074. this.userData.guideHelpLine = 1;
  19075. this.saveUserData();
  19076. }
  19077. static getNewUser() {
  19078. return this.userData.newUser;
  19079. }
  19080. static setNewUser() {
  19081. this.userData.newUser = false;
  19082. this.saveUserData();
  19083. }
  19084. static getRootBallFoul() {
  19085. return this.userData.rootBallFoul;
  19086. }
  19087. static setRootBallFoul() {
  19088. this.userData.rootBallFoul = 1;
  19089. this.saveUserData();
  19090. }
  19091. static getTimeoutFoul() {
  19092. return this.userData.timeoutFoul;
  19093. }
  19094. static setTimeoutFoul() {
  19095. this.userData.timeoutFoul = 1;
  19096. this.saveUserData();
  19097. }
  19098. static saveDiyGameData() {
  19099. if (this.diyGameSaving)
  19100. return;
  19101. this.diyGameSaving = true;
  19102. Laya.timer.once(500, this, () => {
  19103. this.diyGameSaving = false;
  19104. this.diyGameData.saveData();
  19105. });
  19106. }
  19107. static getChallengeMode_overLev() {
  19108. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  19109. return this.challengeMode_overLev;
  19110. }
  19111. static setChallengeMode_overLev(levNum) {
  19112. this.diyGameData.challengeMode_overLev = levNum;
  19113. this.saveDiyGameData();
  19114. }
  19115. static updateUserInfo2Server(type, count = 0) {
  19116. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19117. if (userInfoData == null) {
  19118. return;
  19119. }
  19120. let reqData = xGame.httpMgr.getReqData();
  19121. let rd = JSON.parse(reqData);
  19122. rd.dataType = type;
  19123. let dataValue = 0;
  19124. if (type == "zs") {
  19125. dataValue = this.getDiamond();
  19126. }
  19127. if (type == "jb") {
  19128. dataValue = this.getCoin();
  19129. }
  19130. if (type == "power") {
  19131. dataValue = this.getPower();
  19132. }
  19133. rd.dataValue = dataValue;
  19134. if (type == "bigSkills") {
  19135. let dataValueStr = this.userData.bigSkills;
  19136. let dvsJson = JSON.parse("[" + dataValueStr + "]");
  19137. rd.dataValueStr = JSON.stringify(dvsJson);
  19138. }
  19139. reqData = JSON.stringify(rd);
  19140. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  19141. try {
  19142. let code = res.code;
  19143. let data = res.data;
  19144. if (code == 401) {
  19145. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19146. console.log('zh:保存资产信息失败,请重新登录 ');
  19147. return;
  19148. }
  19149. if (code == 200) {
  19150. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  19151. }
  19152. else {
  19153. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  19154. }
  19155. }
  19156. catch (error) {
  19157. console.log('error=' + error);
  19158. alert("Please check your network connection.");
  19159. }
  19160. finally {
  19161. }
  19162. });
  19163. }
  19164. static getUserZiChanInfo(winTip = false) {
  19165. console.log('zh:getUserZCI');
  19166. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19167. console.log('zh:userInfoData=' + userInfoData);
  19168. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  19169. if (winTip) {
  19170. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19171. }
  19172. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19173. return;
  19174. }
  19175. let reqData = xGame.httpMgr.getReqData();
  19176. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  19177. try {
  19178. console.log('zh:buySp res = ' + JSON.stringify(res));
  19179. let code = res.code;
  19180. let msg = res.msg;
  19181. if (code == 401) {
  19182. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19183. if (winTip) {
  19184. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19185. }
  19186. return;
  19187. }
  19188. if (code == 200) {
  19189. let d = res.data;
  19190. let zuanShi = d.zuanShi;
  19191. let jinBi = d.jinBi;
  19192. let haveQiuGanJson = d.haveQiuGanJson;
  19193. let signData = d.signData;
  19194. let placeBallData = d.placeBallData;
  19195. let bigSkills = d.bigSkills;
  19196. DataMgr.setDiamondFormServer(zuanShi);
  19197. DataMgr.setCoinFormServer(jinBi);
  19198. DataMgr.setBallRodFormServer(haveQiuGanJson);
  19199. DataMgr.setPlaceBallLevelList(placeBallData);
  19200. if (signData && signData > 0) {
  19201. DataMgr.setSignData(signData);
  19202. }
  19203. DataMgr.setBigSkillFormServer(bigSkills);
  19204. }
  19205. else {
  19206. console.log("zh:更新用户资产信息error" + msg);
  19207. if (winTip) {
  19208. xGame.uiMgr.Show(UIMsg, msg);
  19209. }
  19210. }
  19211. }
  19212. catch (error) {
  19213. console.log('error=' + error);
  19214. if (winTip) {
  19215. alert(error);
  19216. }
  19217. }
  19218. finally {
  19219. console.log("zh:更新用户资产信息结束");
  19220. }
  19221. });
  19222. }
  19223. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  19224. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19225. console.log('zh:updateLocalUserData=' + userInfo);
  19226. if (userInfo != null) {
  19227. if (!userInfo.buySpids) {
  19228. userInfo.buySpids = { 1: false, 7: false };
  19229. }
  19230. else {
  19231. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  19232. }
  19233. userInfo.buySpids[spid] = isBuyOk;
  19234. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  19235. }
  19236. else {
  19237. }
  19238. }
  19239. static loadUserSpOrderForAd() {
  19240. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19241. if (userInfo == null) {
  19242. return;
  19243. }
  19244. console.log('zh:重新加载更新广告权利');
  19245. let reqData = xGame.httpMgr.getReqData();
  19246. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  19247. try {
  19248. console.log('zh:getOrderListForNoChongFuBuy res = ' + JSON.stringify(res));
  19249. let code = res.code;
  19250. let msg = res.msg;
  19251. if (code == 401) {
  19252. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19253. return;
  19254. }
  19255. if (code == 200) {
  19256. let data = res.data;
  19257. let buy_spid1 = false;
  19258. let buy_spid7 = false;
  19259. for (let index = 0; index < data.length; index++) {
  19260. let element = data[index];
  19261. console.log('zh:list element.spid = ' + element.spid);
  19262. if (element.spid == 1) {
  19263. buy_spid1 = true;
  19264. }
  19265. if (element.spid == 7) {
  19266. buy_spid7 = true;
  19267. }
  19268. }
  19269. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  19270. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  19271. }
  19272. else {
  19273. }
  19274. }
  19275. catch (error) {
  19276. console.log('error=' + error);
  19277. alert(error);
  19278. }
  19279. finally {
  19280. }
  19281. });
  19282. }
  19283. static checkForShowFuLi17AndAlert(alert_spid) {
  19284. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19285. if (userInfo == null) {
  19286. if (alert_spid === 1) {
  19287. xGame.uiMgr.Show(UIFuli1);
  19288. }
  19289. if (alert_spid === 7) {
  19290. xGame.uiMgr.Show(UIFuli2);
  19291. }
  19292. return;
  19293. }
  19294. console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
  19295. let reqData = xGame.httpMgr.getReqData();
  19296. let pd = JSON.parse(reqData);
  19297. pd.productId = alert_spid;
  19298. reqData = JSON.stringify(pd);
  19299. xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
  19300. try {
  19301. let code = res.code;
  19302. let msg = res.msg;
  19303. if (code == 401) {
  19304. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19305. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19306. return;
  19307. }
  19308. if (code == 200) {
  19309. let data = res.data;
  19310. let buyOkSpid = [];
  19311. for (let i = 0; i < data.length; i++) {
  19312. let item = data[i];
  19313. let temp_spid = item.spid;
  19314. DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
  19315. buyOkSpid.push(temp_spid);
  19316. }
  19317. let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
  19318. if (isBuyOk7) {
  19319. return;
  19320. }
  19321. let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
  19322. if (isBuyOk && alert_spid === 1) {
  19323. return;
  19324. }
  19325. else {
  19326. if (isBuyOk === false) {
  19327. if (alert_spid === 1) {
  19328. xGame.uiMgr.Show(UIFuli1);
  19329. }
  19330. if (alert_spid === 7) {
  19331. xGame.uiMgr.Show(UIFuli2);
  19332. }
  19333. }
  19334. else {
  19335. console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了');
  19336. }
  19337. }
  19338. }
  19339. else {
  19340. xGame.uiMgr.Show(UIMsg, msg);
  19341. }
  19342. }
  19343. catch (error) {
  19344. console.log('error=' + error);
  19345. alert(error);
  19346. }
  19347. finally {
  19348. }
  19349. });
  19350. }
  19351. }
  19352. DataMgr.isNewUser = false;
  19353. DataMgr.fristEnter = true;
  19354. DataMgr.levelType = 0;
  19355. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  19356. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  19357. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  19358. DataMgr.challengeMode_overLev = 0;
  19359. DataMgr.xszyForClassic = false;
  19360. DataMgr.xszyForChallenge = false;
  19361. DataMgr.awardId = 0;
  19362. DataMgr.awardCoin = 0;
  19363. DataMgr.sceneId = -1;
  19364. DataMgr.tryId = 0;
  19365. DataMgr.curLevel = 1;
  19366. DataMgr.vipLevel = 0;
  19367. DataMgr.maxLevel = 0;
  19368. DataMgr.awardRatio = 1;
  19369. DataMgr.gameList = [];
  19370. DataMgr.rankList = [];
  19371. DataMgr.recoverTime = 480000;
  19372. DataMgr.minScore = 0;
  19373. DataMgr.rankDis = 0;
  19374. DataMgr.userSaving = false;
  19375. DataMgr.gameSaving = false;
  19376. DataMgr.diyGameSaving = false;
  19377. class D3Tween extends Laya.Script3D {
  19378. constructor() {
  19379. super();
  19380. this.isInited = false;
  19381. }
  19382. ;
  19383. init() {
  19384. if (this.isInited)
  19385. return;
  19386. this.isInited = true;
  19387. this.gameObj = this.owner;
  19388. this.transform = this.gameObj.transform;
  19389. }
  19390. get rotX() {
  19391. return this.transform.localRotationEulerX;
  19392. }
  19393. set rotX(v) {
  19394. this.transform.localRotationEulerX = v;
  19395. }
  19396. get rotY() {
  19397. return this.transform.localRotationEulerY;
  19398. }
  19399. set rotY(v) {
  19400. this.transform.localRotationEulerY = v;
  19401. }
  19402. get rotZ() {
  19403. return this.transform.localRotationEulerZ;
  19404. }
  19405. set rotZ(v) {
  19406. this.transform.localRotationEulerZ = v;
  19407. }
  19408. get posX() {
  19409. return this.transform.localPositionX;
  19410. }
  19411. set posX(v) {
  19412. this.transform.localPositionX = v;
  19413. }
  19414. get posY() {
  19415. return this.transform.localPositionY;
  19416. }
  19417. set posY(v) {
  19418. this.transform.localPositionY = v;
  19419. }
  19420. get posZ() {
  19421. return this.transform.localPositionZ;
  19422. }
  19423. set posZ(v) {
  19424. this.transform.localPositionZ = v;
  19425. }
  19426. get rotation() {
  19427. return this.transform.localRotation;
  19428. }
  19429. set rotation(v) {
  19430. this.transform.localRotation = v;
  19431. }
  19432. }
  19433. class D2Hole extends Laya.Script {
  19434. constructor() { super(); }
  19435. onTriggerEnter(collider) {
  19436. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19437. return;
  19438. }
  19439. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19440. if (collider.owner["mySrc"].isRunSkillAni) {
  19441. return;
  19442. }
  19443. if (collider.owner["mySrc"].number != 0) {
  19444. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19445. }
  19446. xGame.common.ballColliHole(collider);
  19447. xGame.common.recoverCameraView();
  19448. }
  19449. }
  19450. }
  19451. class Table extends Laya.Script3D {
  19452. constructor() {
  19453. super();
  19454. this.isSetBorder = false;
  19455. this.inited = false;
  19456. }
  19457. ;
  19458. onAwake() {
  19459. this.init();
  19460. }
  19461. init() {
  19462. if (this.inited)
  19463. return;
  19464. this.inited = true;
  19465. this.gameObj = this.owner;
  19466. this.border = this.gameObj.getChildByName("border");
  19467. }
  19468. setBorderPos() {
  19469. if (this.isSetBorder)
  19470. return;
  19471. this.isSetBorder = true;
  19472. let ui = xGame.common.gameUI.ui;
  19473. let bar1 = this.border.getChildByName("bar1");
  19474. let bar2 = this.border.getChildByName("bar2");
  19475. let bar3 = this.border.getChildByName("bar3");
  19476. let bar4 = this.border.getChildByName("bar4");
  19477. let bar5 = this.border.getChildByName("bar5");
  19478. let bar6 = this.border.getChildByName("bar6");
  19479. this.setInfo(bar1, ui.border.bar1, "box");
  19480. this.setInfo(bar2, ui.border.bar2, "box");
  19481. this.setInfo(bar3, ui.border.bar3, "box");
  19482. this.setInfo(bar4, ui.border.bar4, "box");
  19483. this.setInfo(bar5, ui.border.bar5, "box");
  19484. this.setInfo(bar6, ui.border.bar6, "box");
  19485. let circle1 = this.border.getChildByName("circle1");
  19486. let circle2 = this.border.getChildByName("circle2");
  19487. let circle3 = this.border.getChildByName("circle3");
  19488. let circle4 = this.border.getChildByName("circle4");
  19489. let circle5 = this.border.getChildByName("circle5");
  19490. let circle6 = this.border.getChildByName("circle6");
  19491. this.setInfo(circle1, ui.border.circle1, "circle");
  19492. this.setInfo(circle2, ui.border.circle2, "circle");
  19493. this.setInfo(circle3, ui.border.circle3, "circle");
  19494. this.setInfo(circle4, ui.border.circle4, "circle");
  19495. this.setInfo(circle5, ui.border.circle5, "circle");
  19496. this.setInfo(circle6, ui.border.circle6, "circle");
  19497. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19498. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19499. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19500. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19501. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19502. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19503. let arr = xGame.common.gameMgr.holePosList;
  19504. xGame.common.gameMgr.posObj = {
  19505. "1": arr[0],
  19506. "3": arr[2],
  19507. "4": arr[3],
  19508. "6": arr[5]
  19509. };
  19510. }
  19511. initHolePos(x, y) {
  19512. if (x < 300)
  19513. x += 25;
  19514. else if (x > 1000)
  19515. x -= 25;
  19516. else if (y > 200)
  19517. y -= 10;
  19518. else
  19519. y += 10;
  19520. if (y < 200)
  19521. y += 30;
  19522. else if (y > 500)
  19523. y -= 30;
  19524. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19525. }
  19526. setInfo(d3Obj, d2Obj, type) {
  19527. let ui = xGame.common.gameUI.ui;
  19528. let sprite = new Laya.Sprite();
  19529. ui.border.displayObject.addChild(sprite);
  19530. let colli = xGame.common.getCollider(type);
  19531. sprite.addComponentIntance(colli);
  19532. let rigy = xGame.common.getRigbody();
  19533. rigy.type = "static";
  19534. sprite.addComponentIntance(rigy);
  19535. let d3Pos = d3Obj.transform.position;
  19536. xGame.common.pos3to2Convert(d3Pos);
  19537. let scaleX = d3Obj.transform.localScaleX;
  19538. let scaleZ = d3Obj.transform.localScaleZ;
  19539. let width = xGame.common.scale3to2Convert(scaleZ);
  19540. let height = xGame.common.scale3to2Convert(scaleX);
  19541. sprite.pivotX = width / 2;
  19542. sprite.pivotY = height / 2;
  19543. sprite.x = d3Pos.x;
  19544. sprite.y = d3Pos.y;
  19545. sprite.width = width;
  19546. sprite.height = height;
  19547. d2Obj.x = d3Pos.x;
  19548. d2Obj.y = d3Pos.y;
  19549. d2Obj.width = width;
  19550. d2Obj.height = height;
  19551. if (type == "box") {
  19552. colli.width = width;
  19553. colli.height = height;
  19554. colli.isSensor = false;
  19555. colli.label = "border";
  19556. }
  19557. else {
  19558. colli.radius = width / 2;
  19559. colli.isSensor = true;
  19560. colli.label = "hole";
  19561. sprite.addComponent(D2Hole);
  19562. }
  19563. }
  19564. }
  19565. class D3World extends Laya.Script3D {
  19566. constructor() {
  19567. super();
  19568. this.loadNum = 0;
  19569. this.setLoadNum = 7;
  19570. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19571. }
  19572. onAwake() {
  19573. }
  19574. loadScene() {
  19575. this.scene = this.owner;
  19576. let url = `res/unityRes/root.lh`;
  19577. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19578. this.scene.addChild(prefab);
  19579. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19580. this.putCameraInfo();
  19581. this.camera.enableHDR = false;
  19582. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19583. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19584. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19585. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19586. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19587. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19588. this.knife.active = false;
  19589. this.loadD3Obj();
  19590. }));
  19591. }
  19592. putCameraInfo() {
  19593. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19594. this.cameraObj = new cameraType();
  19595. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19596. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19597. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19598. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19599. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19600. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19601. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19602. this.visitAngleChild.init();
  19603. this.visitRootObj.posX = this.visitAngleChild.posX;
  19604. this.visitRootObj.posY = this.visitAngleChild.posY;
  19605. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19606. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19607. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19608. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19609. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19610. xGame.common.showOneCamera("mainCamera");
  19611. }
  19612. loadD3Obj() {
  19613. this.loadTable();
  19614. this.loadRoom();
  19615. this.loadInHoleParticial();
  19616. this.loadIceParticial();
  19617. this.loadHitParticial();
  19618. this.loadFireworksParticial();
  19619. this.loadBall();
  19620. }
  19621. loadInHoleParticial() {
  19622. this.loadD3Res("inHoleEft", "", (prefab) => {
  19623. prefab.addComponent(Partical);
  19624. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19625. });
  19626. }
  19627. loadIceParticial() {
  19628. this.loadD3Res("iceEft", "", (prefab) => {
  19629. prefab.addComponent(Partical);
  19630. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19631. });
  19632. }
  19633. loadHitParticial() {
  19634. this.loadD3Res("hitEft", "", (prefab) => {
  19635. prefab.addComponent(Partical);
  19636. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19637. });
  19638. }
  19639. loadFireworksParticial() {
  19640. this.loadD3Res("fireworksEft", "", (prefab) => {
  19641. prefab.addComponent(Partical);
  19642. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19643. });
  19644. }
  19645. loadBall(index = 1) {
  19646. this.loadD3Res("ball", index, (prefab) => {
  19647. this.ballPrefab = prefab;
  19648. this.ballPrefab.addComponent(Ball);
  19649. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19650. });
  19651. }
  19652. loadTable(index = 1) {
  19653. this.loadD3Res("table", index, (prefab) => {
  19654. this.tableSrc = prefab.addComponent(Table);
  19655. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19656. this.d3Hand.init();
  19657. this.tableRoot.addChild(prefab);
  19658. });
  19659. }
  19660. loadRoom(index = 1) {
  19661. this.loadD3Res("room", index, (prefab) => {
  19662. this.roomRoot.addChild(prefab);
  19663. });
  19664. }
  19665. loadD3Res(type, index, callback) {
  19666. let url = `res/unityRes/${type}${index}.lh`;
  19667. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19668. callback && callback(prefab);
  19669. this.checkResLoad();
  19670. }));
  19671. }
  19672. checkResLoad() {
  19673. this.loadNum++;
  19674. if (this.loadNum >= this.setLoadNum) {
  19675. xGame.eventMgr.event(D3RES_LOADED);
  19676. }
  19677. }
  19678. prePlayEft() {
  19679. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19680. eft.transform.localPositionX = 0;
  19681. eft.transform.localPositionY = -5;
  19682. eft.transform.localPositionZ = 0;
  19683. eft.active = true;
  19684. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19685. ice.transform.localPositionX = 0;
  19686. ice.transform.localPositionY = -5;
  19687. ice.transform.localPositionZ = 0;
  19688. ice.active = true;
  19689. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19690. hit.transform.localPositionX = 0;
  19691. hit.transform.localPositionY = -5;
  19692. hit.transform.localPositionZ = 0;
  19693. hit.active = true;
  19694. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19695. fireworks.transform.localPositionX = 0;
  19696. fireworks.transform.localPositionY = -5;
  19697. fireworks.transform.localPositionZ = 0;
  19698. fireworks.active = true;
  19699. }
  19700. }
  19701. class cameraType {
  19702. }
  19703. class MoyuMgr$1 {
  19704. static initMoyu() {
  19705. this.moyuView = new MoyuView$1();
  19706. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19707. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19708. this.moyuView.ui.displayObject.zOrder = 1000;
  19709. this.moyuView.init();
  19710. this.moyuView.showTip(true);
  19711. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19712. window['XApk'] = this;
  19713. }
  19714. static showAge(show) {
  19715. if (this.moyuView)
  19716. this.moyuView.showAge(show);
  19717. }
  19718. static onPlatMsg(idx) {
  19719. if (!MoyuMgr$1.moyuView)
  19720. return;
  19721. if (idx == '0') {
  19722. MoyuMgr$1.moyuView.showTip(false);
  19723. }
  19724. }
  19725. static showAgree(call) {
  19726. if (this.moyuView)
  19727. this.moyuView.showAgree(call);
  19728. else
  19729. call && call();
  19730. }
  19731. static showXy(type = 1) {
  19732. if (this.moyuView)
  19733. this.moyuView.showXy(type);
  19734. }
  19735. }
  19736. MoyuMgr$1.isAdvise = false;
  19737. class MoyuView$1 {
  19738. constructor() {
  19739. this.ysxyNum = 1;
  19740. this.ysJson = null;
  19741. this.ui = ui_UIMoyu.createInstance();
  19742. }
  19743. init() {
  19744. this.ui.mainBg.visible = false;
  19745. this.ui.xyNode.visible = false;
  19746. this.ui.ageNode.visible = false;
  19747. this.ui.tipNode.visible = false;
  19748. this.ui.rnNode.visible = false;
  19749. this.ui.fcmNode.visible = false;
  19750. this.ui.ageTip.visible = false;
  19751. this.ui.msgNode.visible = false;
  19752. this.ui.visible = false;
  19753. this.ui.xyNode.xyList.setVirtual();
  19754. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19755. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19756. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19757. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19758. this.ui.xyNode.btnKnown.visible = false;
  19759. this.ui.xyNode.xy1.visible = false;
  19760. this.ui.xyNode.xy2.visible = false;
  19761. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19762. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19763. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19764. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19765. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19766. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19767. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19768. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19769. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19770. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19771. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19772. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19773. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19774. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19775. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19776. this.ysxyNum = 2;
  19777. }
  19778. }
  19779. onClick(obj) {
  19780. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19781. switch (obj) {
  19782. case this.ui.ageTip:
  19783. if (Moyu.isTTApk) {
  19784. this.ui.ageNode.visible = true;
  19785. this.ui.mainBg.visible = true;
  19786. }
  19787. break;
  19788. case this.ui.tipNode:
  19789. this.showTip(false);
  19790. break;
  19791. case this.ui.ageNode.btnAge:
  19792. this.ui.ageNode.visible = false;
  19793. this.ui.mainBg.visible = false;
  19794. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19795. this.ui.visible = false;
  19796. break;
  19797. case this.ui.xyNode.btnXy3:
  19798. case this.ui.xyNode.btnXy1:
  19799. this.loadXy(1);
  19800. break;
  19801. case this.ui.xyNode.btnXy2:
  19802. this.loadXy(2);
  19803. break;
  19804. case this.ui.xyNode.btnBack:
  19805. this.ui.xyNode.xy1.visible = true;
  19806. this.ui.xyNode.xy2.visible = false;
  19807. break;
  19808. case this.ui.xyNode.btnKnown:
  19809. this.ui.xyNode.visible = false;
  19810. this.ui.mainBg.visible = false;
  19811. this.ui.visible = false;
  19812. break;
  19813. case this.ui.rnNode.btnCheck:
  19814. this.check();
  19815. break;
  19816. case this.ui.rnNode.btnExit:
  19817. case this.ui.xyNode.btnNo:
  19818. this.ysxyNum--;
  19819. if (this.ysxyNum > 0)
  19820. this.showMsg("Refuse to quit the game once again");
  19821. else {
  19822. Moyu.userAgree(false);
  19823. Moyu.exit();
  19824. }
  19825. break;
  19826. case this.ui.xyNode.btnSure:
  19827. case this.ui.xyNode.btnYes:
  19828. DataMgr.userData.isAgree = true;
  19829. DataMgr.saveUserData();
  19830. this.onAgree();
  19831. break;
  19832. case this.ui.rnNode.btnDone:
  19833. this.ui.rnNode.visible = false;
  19834. this.ui.visible = false;
  19835. break;
  19836. case this.ui.fcmNode.btnRn:
  19837. this.showRn();
  19838. break;
  19839. }
  19840. }
  19841. showTip(show) {
  19842. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19843. return;
  19844. if (show) {
  19845. MoyuMgr$1.isAdvise = true;
  19846. this.ui.visible = true;
  19847. this.ui.tipNode.visible = true;
  19848. this.ui.tipNode.alpha = 1;
  19849. Laya.timer.once(1000, this, this.showTip, [false]);
  19850. }
  19851. else {
  19852. this.ui.tipNode.alpha = 1;
  19853. this.ui.tipNode.visible = true;
  19854. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19855. this.ui.tipNode.visible = false;
  19856. MoyuMgr$1.isAdvise = false;
  19857. }), 1000);
  19858. }
  19859. }
  19860. showAge(show, px = 0, py = 0) {
  19861. if (Moyu.platType > 10 && !Moyu.isIos) {
  19862. this.ui.ageTip.x = px;
  19863. this.ui.ageTip.y = py;
  19864. this.ui.ageTip.visible = show;
  19865. if (show)
  19866. this.ui.visible = true;
  19867. }
  19868. }
  19869. showAgree(call) {
  19870. this.agreeCall = call;
  19871. this.onAgree();
  19872. return;
  19873. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19874. this.showXy(0);
  19875. }
  19876. else
  19877. this.onAgree();
  19878. }
  19879. onAgree() {
  19880. if (!this.ui.ageNode.visible)
  19881. this.ui.visible = false;
  19882. this.ui.xyNode.visible = false;
  19883. Moyu.userAgree(true);
  19884. this.showAge(false);
  19885. this.agreeCall && this.agreeCall();
  19886. this.showRn();
  19887. }
  19888. showMsg(txt) {
  19889. this.ui.msgNode.txtMsg.text = txt;
  19890. this.ui.msgNode.visible = true;
  19891. this.ui.msgNode.alpha = 1;
  19892. this.ui.visible = true;
  19893. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19894. this.ui.msgNode.visible = false;
  19895. }), 2500, true);
  19896. }
  19897. showRn() {
  19898. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19899. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19900. this.ui.rnNode.rn1.visible = true;
  19901. this.ui.rnNode.rn2.visible = false;
  19902. this.ui.rnNode.rn3.visible = false;
  19903. this.ui.rnNode.rn4.visible = false;
  19904. this.ui.rnNode.visible = true;
  19905. this.ui.mainBg.visible = true;
  19906. this.ui.rnNode.btnDone.visible = false;
  19907. this.ui.rnNode.btnExit.visible = true;
  19908. this.ui.rnNode.btnCheck.visible = true;
  19909. this.ui.fcmNode.visible = false;
  19910. this.ui.visible = true;
  19911. return;
  19912. }
  19913. }
  19914. this.showFcm();
  19915. }
  19916. showFcm() {
  19917. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19918. Moyu.initFCM(true);
  19919. if (Moyu.gameTime < 1)
  19920. this.fcmLoop();
  19921. else if (Moyu.gameTime < 999)
  19922. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19923. }
  19924. }
  19925. fcmLoop() {
  19926. if (Moyu.gameTime < 1) {
  19927. this.ui.rnNode.visible = false;
  19928. this.ui.fcmNode.visible = true;
  19929. this.ui.mainBg.visible = true;
  19930. this.ui.visible = true;
  19931. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19932. Laya.timer.clear(this.ui, this.fcmLoop);
  19933. }
  19934. }
  19935. check() {
  19936. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19937. this.ui.rnNode.rn1.visible = false;
  19938. this.ui.rnNode.rn2.visible = false;
  19939. this.ui.rnNode.rn4.visible = true;
  19940. }
  19941. else if (this.ui.rnNode.rn4.visible) {
  19942. let name = this.ui.rnNode.inputName.text;
  19943. let code = this.ui.rnNode.inputCode.text;
  19944. if (code && code.length == 18) {
  19945. this.ui.rnNode.rn1.visible = false;
  19946. this.ui.rnNode.rn4.visible = false;
  19947. Moyu.authenticate(name, code, (res) => {
  19948. this.ui.rnNode.rn2.visible = !res;
  19949. this.ui.rnNode.rn3.visible = res;
  19950. this.ui.rnNode.btnDone.visible = res;
  19951. this.ui.rnNode.btnExit.visible = !res;
  19952. this.ui.rnNode.btnCheck.visible = !res;
  19953. if (res)
  19954. this.showFcm();
  19955. });
  19956. }
  19957. else
  19958. this.showMsg("信息填写不完整");
  19959. }
  19960. }
  19961. loadXy(type = 0) {
  19962. this.ui.xyNode.xy1.visible = false;
  19963. this.ui.xyNode.xy2.visible = true;
  19964. this.ui.xyNode.xyList.scrollToView(0);
  19965. if (type == 1) {
  19966. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19967. }
  19968. else if (type == 2) {
  19969. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19970. }
  19971. }
  19972. showXy(type = 0) {
  19973. this.xyBtn();
  19974. if (type == 0) {
  19975. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19976. this.ui.xyNode.btnSure.visible = true;
  19977. }
  19978. else {
  19979. this.ui.xyNode.btnYes.visible = true;
  19980. this.ui.xyNode.btnNo.visible = true;
  19981. }
  19982. }
  19983. else {
  19984. this.ui.xyNode.btnKnown.visible = true;
  19985. this.ui.mainBg.visible = true;
  19986. }
  19987. this.ui.xyNode.xy1.visible = true;
  19988. this.ui.xyNode.xy2.visible = false;
  19989. this.ui.xyNode.visible = true;
  19990. this.ui.visible = true;
  19991. }
  19992. xyBtn() {
  19993. this.ui.xyNode.btnSure.visible = false;
  19994. this.ui.xyNode.btnYes.visible = false;
  19995. this.ui.xyNode.btnNo.visible = false;
  19996. this.ui.xyNode.btnKnown.visible = false;
  19997. {
  19998. this.ui.xyNode.btnXy3.visible = false;
  19999. this.ui.xyNode.btnXy2.visible = true;
  20000. this.ui.xyNode.btnXy1.visible = true;
  20001. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  20002. }
  20003. }
  20004. createXY(json) {
  20005. this.ysJson = json.content;
  20006. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  20007. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  20008. this.ui.xyNode.xy2.visible = true;
  20009. }
  20010. renderListItem(idx, cell) {
  20011. let xy = this.ysJson[idx];
  20012. cell.height = xy.line * 30;
  20013. cell.xyItem.text = xy.text;
  20014. }
  20015. onDestroy() {
  20016. this.agreeCall = null;
  20017. }
  20018. }
  20019. class UILoading extends UIBase {
  20020. constructor() {
  20021. super();
  20022. this.accTime = 0;
  20023. this.curNum = 0;
  20024. this.rate = 1;
  20025. this.loadSubOk = false;
  20026. this.loadResOK = false;
  20027. this.openLoading = true;
  20028. this.beginLoadRes = false;
  20029. this.finishD2 = false;
  20030. this.finishD3 = false;
  20031. }
  20032. onConstructor() {
  20033. this.ui = ui_UILoading.createInstance();
  20034. this.contentPane = this.ui;
  20035. this.isEject = false;
  20036. this._initUI();
  20037. this._addEvent();
  20038. }
  20039. _initUI() {
  20040. MoyuMgr$1.initMoyu();
  20041. }
  20042. _addEvent() {
  20043. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  20044. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  20045. }
  20046. show() {
  20047. super.show();
  20048. console.log('zh:加载分包资源');
  20049. loadSubRes(this.subResProgress.bind(this));
  20050. this.ui.txtLoad.text = "Loading...";
  20051. this.setGlobalFont(this.ui);
  20052. }
  20053. subResProgress(pro, finish) {
  20054. this.curNum = pro;
  20055. if (finish) {
  20056. this.curNum = 1;
  20057. this.loadSubOk = true;
  20058. }
  20059. }
  20060. laodD3Res() {
  20061. let scene3D = new Laya.Scene3D();
  20062. xGame.common.d3Scene = scene3D;
  20063. xGame.common.d3World = scene3D.addComponent(D3World);
  20064. xGame.common.d3World.loadScene();
  20065. }
  20066. loadD2Res() {
  20067. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  20068. this.finishD2 = true;
  20069. this.checkLoadAll();
  20070. this.curNum = 1;
  20071. }), Laya.Handler.create(this, (pro) => {
  20072. this.curNum = pro;
  20073. }, null, false));
  20074. }
  20075. d3ResFinish() {
  20076. this.finishD3 = true;
  20077. this.checkLoadAll();
  20078. }
  20079. checkLoadAll() {
  20080. if (this.finishD2 && this.finishD3) {
  20081. this.loadResOK = true;
  20082. }
  20083. }
  20084. loadRes() {
  20085. this.laodD3Res();
  20086. this.loadD2Res();
  20087. }
  20088. myUpdate(dt) {
  20089. if (!this.openLoading)
  20090. return;
  20091. this.accTime += dt * this.rate;
  20092. if (this.accTime >= this.curNum)
  20093. this.accTime = this.curNum;
  20094. this.ui.loadinfo.value = this.accTime * 100;
  20095. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  20096. if (!this.beginLoadRes) {
  20097. this.beginLoadRes = true;
  20098. this.ui.txtLoad.text = "Loading...";
  20099. this.curNum = 0;
  20100. this.accTime = 0;
  20101. this.loadRes();
  20102. }
  20103. if (this.loadResOK) {
  20104. this.openLoading = false;
  20105. Laya.timer.once(300, this, () => {
  20106. xGame.common.d3Scene.active = false;
  20107. MoyuMgr$1.showAgree(enterGame);
  20108. });
  20109. }
  20110. }
  20111. }
  20112. release() {
  20113. }
  20114. hide() {
  20115. super.hide();
  20116. this.release();
  20117. }
  20118. onClose() {
  20119. this.hide();
  20120. }
  20121. }
  20122. UILoading.uiName = "UILoading";
  20123. class UIRepentProp$1 extends UIBase {
  20124. constructor() {
  20125. super();
  20126. this.viewType = 0;
  20127. this.regretType = 0;
  20128. }
  20129. onConstructor() {
  20130. this.ui = ui_UIRepentProp.createInstance();
  20131. this.contentPane = this.ui;
  20132. this.isEject = false;
  20133. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  20134. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  20135. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  20136. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  20137. }
  20138. show(viewType, regretType, callback) {
  20139. PlatMgr.showInsert(true);
  20140. this.viewType = viewType;
  20141. this.regretType = regretType;
  20142. this.callback = callback;
  20143. super.show();
  20144. this.ui.t0.play();
  20145. this.ui.c1.selectedIndex = this.viewType;
  20146. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  20147. if (this.viewType == 0) {
  20148. let guide = DataMgr.getGuideHelpLine();
  20149. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  20150. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  20151. }
  20152. xGame.common.gameMgr.gamePause = true;
  20153. this.setGlobalFont(this.ui);
  20154. }
  20155. hideSelf() {
  20156. xGame.common.gameMgr.gamePause = false;
  20157. this.callback && this.callback(false);
  20158. this.hide();
  20159. }
  20160. videoRegret() {
  20161. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  20162. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  20163. }
  20164. else {
  20165. console.log('zh:AD 失败,直接发放奖励');
  20166. this.qjff_AD_for_UIrepentProp_videoRegret();
  20167. }
  20168. }
  20169. qjff_AD_for_UIrepentProp_videoRegret() {
  20170. this.callback && this.callback(true);
  20171. this.hideSelf();
  20172. }
  20173. videoAddHelpLine() {
  20174. let guide = DataMgr.getGuideHelpLine();
  20175. if (guide == 0) {
  20176. this.callback && this.callback(true);
  20177. this.hideSelf();
  20178. DataMgr.setGuideHelpLine();
  20179. xGame.common.gameUI.ui.guideNode.visible = false;
  20180. }
  20181. else {
  20182. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  20183. if (Laya.Browser.onAndroid) {
  20184. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20185. if (!boo) {
  20186. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20187. return;
  20188. }
  20189. }
  20190. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  20191. }
  20192. else {
  20193. console.log('zh:AD 失败,直接发放奖励');
  20194. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20195. }
  20196. }
  20197. }
  20198. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  20199. this.callback && this.callback(true);
  20200. this.hideSelf();
  20201. }
  20202. }
  20203. UIRepentProp$1.uiName = "UIRepentProp";
  20204. class UIRodMethod$1 extends UIBase {
  20205. constructor() {
  20206. super();
  20207. this.isPressd = false;
  20208. }
  20209. onConstructor() {
  20210. this.ui = ui_UIRodMethod.createInstance();
  20211. this.contentPane = this.ui;
  20212. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  20213. this.moveDir = new Laya.Vector2();
  20214. this.moveDest = new Laya.Vector2();
  20215. this.centerPos = new Laya.Vector2();
  20216. xGame.common.uiRodMethod = this;
  20217. }
  20218. show() {
  20219. super.show();
  20220. xGame.common.gameMgr.gamePause = true;
  20221. this.openPressDotEvent();
  20222. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  20223. this.centerPos.x = this.ui.white.x;
  20224. this.centerPos.y = this.ui.white.y;
  20225. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  20226. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  20227. this.setDot();
  20228. this.setGlobalFont(this.ui);
  20229. }
  20230. setDot() {
  20231. this.ui.dot.x = this.moveDest.x;
  20232. this.ui.dot.y = this.moveDest.y;
  20233. }
  20234. closeSelf() {
  20235. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  20236. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  20237. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  20238. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  20239. xGame.common.gameMgr.gamePause = false;
  20240. this.hide();
  20241. }
  20242. openPressDotEvent() {
  20243. this.closePressDotEvent();
  20244. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20245. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20246. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20247. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20248. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20249. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20250. }
  20251. closePressDotEvent() {
  20252. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20253. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20254. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20255. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20256. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20257. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20258. }
  20259. onDown(e) {
  20260. if (e.type == Laya.Event.MOUSE_DOWN)
  20261. this.isPressd = true;
  20262. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  20263. this.isPressd = false;
  20264. if (!this.isPressd)
  20265. return;
  20266. this.moveDest.x = e.stageX;
  20267. this.moveDest.y = e.stageY;
  20268. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  20269. if (dis > 6724) {
  20270. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  20271. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  20272. }
  20273. this.setDot();
  20274. }
  20275. resetRod() {
  20276. this.ui.dot.x = this.ui.white.x;
  20277. this.ui.dot.y = this.ui.white.y;
  20278. this.gameRod.dot.x = this.gameRod.bg.x;
  20279. this.gameRod.dot.y = this.gameRod.bg.y;
  20280. xGame.common.rodOffest.x = 0;
  20281. xGame.common.rodOffest.y = 0;
  20282. }
  20283. }
  20284. UIRodMethod$1.uiName = "UIRodMethod";
  20285. class UIMsg$1 extends UIBase {
  20286. constructor() {
  20287. super();
  20288. }
  20289. onConstructor() {
  20290. this.ui = ui_UIMsg.createInstance();
  20291. this.contentPane = this.ui;
  20292. this.isEject = false;
  20293. this.isMuti = true;
  20294. }
  20295. show(msg, callback) {
  20296. super.show();
  20297. this.ui.tipsNode.msgTxt.text = msg;
  20298. this.ui.alpha = 1;
  20299. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  20300. this.hide();
  20301. callback && callback();
  20302. }), 1000);
  20303. this.setGlobalFont(this.ui);
  20304. }
  20305. }
  20306. UIMsg$1.uiName = "UIMsg";
  20307. class UITips$1 extends UIBase {
  20308. constructor() {
  20309. super();
  20310. this.type = 0;
  20311. }
  20312. onConstructor() {
  20313. this.ui = ui_UITips.createInstance();
  20314. this.contentPane = this.ui;
  20315. this.isEject = false;
  20316. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  20317. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  20318. }
  20319. show(tipsTxt, womanTxt, type) {
  20320. super.show();
  20321. this.ui.t0.play();
  20322. this.ui.myNode.tipsTxt.text = tipsTxt;
  20323. this.ui.myNode.womanTxt.text = womanTxt;
  20324. PlatMgr.showInsert(true);
  20325. this.ui.myNode.c1.selectedIndex = type;
  20326. this.type = type;
  20327. switch (this.type) {
  20328. case TipsType.exitGame:
  20329. xGame.common.gameMgr.gamePause = true;
  20330. break;
  20331. case TipsType.foul:
  20332. Laya.timer.once(200, this, () => {
  20333. if (xGame.common.gameMgr) {
  20334. xGame.common.gameMgr.gamePause = true;
  20335. }
  20336. else {
  20337. console.log("zh:gameMgr is null");
  20338. }
  20339. });
  20340. break;
  20341. default:
  20342. break;
  20343. }
  20344. this.setGlobalFont(this.ui);
  20345. }
  20346. clickLeftBtn() {
  20347. this.hide();
  20348. xGame.common.gameMgr.gamePause = false;
  20349. switch (this.type) {
  20350. case TipsType.exitGame:
  20351. break;
  20352. case TipsType.foul:
  20353. break;
  20354. default:
  20355. break;
  20356. }
  20357. }
  20358. clickRightBtn() {
  20359. this.hide();
  20360. switch (this.type) {
  20361. case TipsType.exitGame:
  20362. xGame.eventMgr.event(RESET_GAME);
  20363. xGame.uiMgr.Show(UIMain$1);
  20364. Moyu.recordEnd(this, null);
  20365. xGame.common.longHelpLine = false;
  20366. break;
  20367. case TipsType.foul:
  20368. if (xGame.common.gameMgr) {
  20369. xGame.common.gameMgr.gamePause = false;
  20370. }
  20371. Laya.timer.clearAll(this);
  20372. break;
  20373. default:
  20374. break;
  20375. }
  20376. }
  20377. }
  20378. UITips$1.uiName = "UITips";
  20379. class UIGame$1 extends UIBase {
  20380. constructor() {
  20381. super();
  20382. this.powerNum = 0;
  20383. this.isD3Inited = false;
  20384. this.isPrePlay = false;
  20385. this.isMoveRod = false;
  20386. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  20387. this.rulerDis = 20;
  20388. this.rulerOffset = 0;
  20389. }
  20390. onConstructor() {
  20391. this.ui = ui_UIGame.createInstance();
  20392. this.contentPane = this.ui;
  20393. this.ui.x += xGame.common.sysOffestNum;
  20394. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  20395. this.isEject = false;
  20396. xGame.common.gameUI = this;
  20397. this.initSelf();
  20398. }
  20399. isTurnSelf() {
  20400. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  20401. return true;
  20402. }
  20403. }
  20404. initSelf() {
  20405. let topUI = this.ui.topNode;
  20406. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20407. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20408. this.barInfo = {};
  20409. this.barInfo.curY = 0;
  20410. this.barInfo.height = this.ui.powerNode.height;
  20411. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20412. this.barInfo.powerStartY = this.ui.powerNode.y;
  20413. xGame.common.aiPlayer = new AIPlayer();
  20414. xGame.common.gameMgr = new GameMgr();
  20415. xGame.common.skillMgr = new SkillMgr();
  20416. xGame.common.wordsMgr = new WordsMgr();
  20417. xGame.common.talkMgr = new TalkMgr();
  20418. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20419. });
  20420. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20421. });
  20422. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20423. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20424. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20425. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20426. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20427. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20428. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20429. }
  20430. getGanZiImg() {
  20431. let index = DataMgr.getCurBallRod();
  20432. let data = cfgTable.ballrodData[index + 1];
  20433. let gan_url = xGame.common.getGameIconUrl(data.img);
  20434. this.ui.powerNode.showImg.url = gan_url;
  20435. }
  20436. returnHome() {
  20437. let tips = "Are you sure to exit the game?";
  20438. let woman = "Boss, why don't you play for a while longer?";
  20439. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20440. }
  20441. addRodMethodClick() {
  20442. if (this.isTurnSelf()) {
  20443. xGame.uiMgr.Show(UIRodMethod$1);
  20444. }
  20445. }
  20446. clickHelpLineBtn(force = false) {
  20447. if (!this.isTurnSelf())
  20448. return;
  20449. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20450. if (success) {
  20451. xGame.common.longHelpLine = true;
  20452. xGame.common.d2World.getHelpLine();
  20453. Moyu.sendDataEvent("guideNum");
  20454. }
  20455. else {
  20456. }
  20457. });
  20458. }
  20459. renderSelfDisplayBalls(index, target) {
  20460. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20461. target.myImg.url = xGame.common.getGameIconUrl(str);
  20462. }
  20463. renderAIDisplayBalls(index, target) {
  20464. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20465. target.myImg.url = xGame.common.getGameIconUrl(str);
  20466. ;
  20467. }
  20468. updateMode() {
  20469. if (xGame.common.gameMode == GameMode.classic) {
  20470. this.ui.topNode.scoreNode.visible = false;
  20471. }
  20472. else if (xGame.common.gameMode == GameMode.bigMove) {
  20473. this.ui.topNode.scoreNode.visible = true;
  20474. }
  20475. }
  20476. show() {
  20477. super.show();
  20478. this.ui.alpha = 0;
  20479. this.updateSelf();
  20480. xGame.common.gameMgr.gamePause = false;
  20481. xGame.common.gameUI.ui.blackAni.visible = false;
  20482. xGame.common.gameUI.ui.whiteAni.visible = false;
  20483. this.ui.powerEft.visible = false;
  20484. this.ui.colorNode.visible = false;
  20485. this.updateHead();
  20486. let curUse = DataMgr.getCurBallRod();
  20487. this.getGanZiImg();
  20488. this.yinDaoForLianxi();
  20489. this.setGlobalFont(this.ui);
  20490. }
  20491. yinDaoForLianxi() {
  20492. let g = DataMgr.getSkillGuide();
  20493. if (g === 0) {
  20494. console.log('zh:默认的引导还没有完毕');
  20495. return;
  20496. }
  20497. let lianXiGuide = DataMgr.getLianXiGuide();
  20498. console.log('zh:lianXiGuide=', lianXiGuide);
  20499. if (lianXiGuide === 0) {
  20500. this.ui.n_lxms_yd1.visible = true;
  20501. console.log('zh:yinDaoForLianxi 111 set ok');
  20502. }
  20503. else {
  20504. this.ui.n_lxms_yd1.visible = false;
  20505. console.log('zh:无需引导11');
  20506. }
  20507. DataMgr.setLianXiGuide(0);
  20508. }
  20509. updateSelf() {
  20510. if (xGame.common.gameMode == GameMode.classic) {
  20511. this.ui.c1.selectedIndex = 0;
  20512. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20513. this.ui.topNode.middleNode.visible = true;
  20514. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20515. }
  20516. else if (xGame.common.gameMode == GameMode.bigMove) {
  20517. this.ui.c1.selectedIndex = 0;
  20518. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20519. this.ui.topNode.middleNode.visible = false;
  20520. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20521. let rand = xGame.common.randomNum(1, max);
  20522. let guide = DataMgr.getSkillGuide();
  20523. if (guide == 0)
  20524. rand = 1;
  20525. xGame.common.bigMoveLevelIndex = rand;
  20526. }
  20527. else if (xGame.common.gameMode == GameMode.placeBall) {
  20528. console.log('zh:练习模式...');
  20529. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20530. this.ui.c1.selectedIndex = 1 + data.type;
  20531. this.ui.alpha = 1;
  20532. this.startGame();
  20533. }
  20534. this.updateMode();
  20535. this.initD3world();
  20536. this.initD2world();
  20537. }
  20538. startGame() {
  20539. this.ui.snowNode.visible = Math.random() <= 0.1;
  20540. this.ui.d2Node.visible = false;
  20541. xGame.common.d3World.d3Hand.gameObj.active = false;
  20542. xGame.common.d3World.tableSrc.init();
  20543. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20544. this.cameraViewChange(() => {
  20545. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20546. switch (xGame.common.gameMode) {
  20547. case GameMode.classic:
  20548. xGame.common.d3World.d3Hand.gameObj.active = true;
  20549. this.playPutBallD3Ani();
  20550. break;
  20551. case GameMode.bigMove:
  20552. this.enterGame();
  20553. Laya.timer.once(500, this, () => {
  20554. this.ui.topNode.middleNode.visible = true;
  20555. this.ui.topNode.middleNode.t0.play();
  20556. });
  20557. break;
  20558. case GameMode.placeBall:
  20559. this.enterGame();
  20560. break;
  20561. default:
  20562. break;
  20563. }
  20564. });
  20565. PlatMgr.showBanner(false);
  20566. }
  20567. enterGame() {
  20568. this.ui.d2Node.visible = true;
  20569. xGame.common.d3World.d3Hand.gameObj.active = false;
  20570. xGame.common.showOneCamera("mainCamera");
  20571. Moyu.recordGame(30, true);
  20572. if (!this.isPrePlay) {
  20573. this.isPrePlay = true;
  20574. xGame.common.d3World.prePlayEft();
  20575. }
  20576. xGame.common.gameMgr.gameReady();
  20577. this.openAllEvent();
  20578. this.ui.snowNode.visible = false;
  20579. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20580. this.ui.helpBtn.visible = condition;
  20581. }
  20582. showHelpLineGuide() {
  20583. let longGuide = DataMgr.getGuideHelpLine();
  20584. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20585. this.ui.helpBtn.visible = true;
  20586. this.ui.guideNode.visible = true;
  20587. }
  20588. }
  20589. setTurnAlpha(alpha) {
  20590. this.ui.keduNode.alpha = alpha;
  20591. this.ui.ganNode.alpha = alpha;
  20592. this.ui.rodMethodNode.alpha = alpha;
  20593. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20594. }
  20595. cameraViewChange(callback) {
  20596. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20597. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20598. xGame.common.showOneCamera("visitAngle");
  20599. cameraSrc.localRotationEulerY = 180;
  20600. cameraSrc.localRotationEulerZ = 0;
  20601. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20602. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20603. callback && callback();
  20604. }));
  20605. }));
  20606. }
  20607. playPutBallD3Ani() {
  20608. xGame.common.showOneCamera("mainCamera");
  20609. let handSrc = xGame.common.d3World.d3Hand;
  20610. handSrc.gameObj.active = true;
  20611. handSrc.transform.localPositionZ = 3;
  20612. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20613. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20614. handSrc.gameObj.active = false;
  20615. this.enterGame();
  20616. }), 400);
  20617. }));
  20618. }
  20619. updateHead() {
  20620. let user = Moyu.getUserInfo();
  20621. this.ui.topNode.selfNameTxt.text = user.nickName;
  20622. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20623. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20624. if (DataMgr.getSkillGuide() < 1) {
  20625. this.ui.topNode.aiNameTxt.text = 'billiards';
  20626. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20627. }
  20628. else {
  20629. this.ui.topNode.aiNameTxt.text = aiData.name;
  20630. let randNo = Math.floor(Math.random() * 10) + 1;
  20631. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20632. }
  20633. }
  20634. initD2world() {
  20635. let node = this.ui.d2Root.displayObject;
  20636. let src = node.getComponent(D2World);
  20637. if (!src) {
  20638. xGame.common.d2World = node.addComponent(D2World);
  20639. }
  20640. xGame.common.d2World.initSelf();
  20641. }
  20642. initD3world() {
  20643. if (this.isD3Inited)
  20644. return;
  20645. this.isD3Inited = true;
  20646. let scene3D = xGame.common.d3Scene;
  20647. this.ui.d3Root.displayObject.addChild(scene3D);
  20648. scene3D.active = true;
  20649. xGame.common.d3World.tableSrc.setBorderPos();
  20650. }
  20651. onRootMove(e) {
  20652. let rootBall = xGame.common.d2World.rootBall;
  20653. this.ui.moveNode.x = e.x;
  20654. this.ui.moveNode.y = e.y;
  20655. rootBall.gameObj.x = e.x;
  20656. rootBall.gameObj.y = e.y;
  20657. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20658. }
  20659. aiRootMove(move) {
  20660. if (move)
  20661. this.hideBallUI();
  20662. else {
  20663. this.showBallUI();
  20664. xGame.common.d2World.getHelpLine();
  20665. }
  20666. }
  20667. aiForce(type, force = 0) {
  20668. this.pressTarget = PressType.powerNode;
  20669. if (type == 1)
  20670. this.onEventUp({ force: true });
  20671. else if (type == 2)
  20672. this.onEventMove({ stageY: force, force: true });
  20673. }
  20674. onEventPress(e) {
  20675. if (e.stopPropagation)
  20676. e.stopPropagation();
  20677. if (!this.isTurnSelf())
  20678. return;
  20679. let target = e.target;
  20680. switch (target) {
  20681. case this.ui.myPowerNode.displayObject:
  20682. this.pressTarget = PressType.powerNode;
  20683. this.barInfo.curY = e.stageY;
  20684. this.updateBarInfo();
  20685. break;
  20686. case this.ui.moveNode.displayObject:
  20687. this.pressTarget = PressType.moveNode;
  20688. this.hideBallUI();
  20689. this.eventObj.curX = this.ui.moveNode.x;
  20690. this.eventObj.curY = this.ui.moveNode.y;
  20691. this.ui.moveNode.finger.visible = false;
  20692. this.eventObj.lastX = e.stageX;
  20693. this.eventObj.lastY = e.stageY;
  20694. break;
  20695. case this.ui.rulerClickNode.displayObject:
  20696. this.pressTarget = PressType.rulerNode;
  20697. this.eventObj.lastY = e.stageY;
  20698. break;
  20699. case this.ui.d2Root.displayObject:
  20700. this.pressTarget = PressType.d2Root;
  20701. this.eventObj.lastX = e.stageX;
  20702. this.eventObj.lastY = e.stageY;
  20703. this.eventObj.starX = e.stageX;
  20704. this.eventObj.starY = e.stageY;
  20705. this.eventObj.curX = 0;
  20706. this.eventObj.curY = 0;
  20707. xGame.common.d2World.d2Gan.setGanLastInfo();
  20708. this.rulerOffset = 0;
  20709. break;
  20710. default:
  20711. break;
  20712. }
  20713. }
  20714. onEventMove(e) {
  20715. if (e.stopPropagation)
  20716. e.stopPropagation();
  20717. if (e && e.force) {
  20718. }
  20719. else {
  20720. if (!this.isTurnSelf())
  20721. return;
  20722. }
  20723. switch (this.pressTarget) {
  20724. case PressType.powerNode:
  20725. this.barInfo.curY = e.stageY;
  20726. this.updateBarInfo();
  20727. this.isMoveRod = true;
  20728. break;
  20729. case PressType.moveNode:
  20730. let rootBall = xGame.common.d2World.rootBall;
  20731. let radius = rootBall.gameObj.width / 2;
  20732. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20733. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20734. let border = xGame.common.d2World.borderRect;
  20735. if (curX <= border.x + radius)
  20736. curX = border.x + radius;
  20737. else if (curX >= border.x + border.width - radius)
  20738. curX = border.x + border.width - radius;
  20739. if (curY <= border.y + radius)
  20740. curY = border.y + radius;
  20741. else if (curY >= border.y + border.height - radius)
  20742. curY = border.y + border.height - radius;
  20743. if (xGame.common.gameMgr.isOpenBall) {
  20744. if (curX >= border.x + border.openBallW - radius)
  20745. curX = border.x + border.openBallW - radius;
  20746. }
  20747. this.ui.moveNode.x = curX;
  20748. this.ui.moveNode.y = curY;
  20749. rootBall.gameObj.x = curX;
  20750. rootBall.gameObj.y = curY;
  20751. rootBall.d3BallSrc.setTransPos(curX, curY);
  20752. this.isMoveRod = true;
  20753. break;
  20754. case PressType.rulerNode:
  20755. let yy = e.stageY - this.eventObj.lastY;
  20756. this.eventObj.lastY = e.stageY;
  20757. let ruler1 = this.ui.rulerNode.img1;
  20758. let ruler2 = this.ui.rulerNode.img2;
  20759. ruler1.y += yy;
  20760. ruler2.y += yy;
  20761. this.rulerOffset += yy;
  20762. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20763. this.rulerOffset = 0;
  20764. xGame.soundMgr.playSound("inch", 1, 10);
  20765. }
  20766. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20767. let h = ruler1.height;
  20768. this.checkGuide();
  20769. this.checkGuideForLxms();
  20770. this.isMoveRod = true;
  20771. if (ruler1.y >= h) {
  20772. ruler1.y = -h;
  20773. ruler2.y = 0;
  20774. return;
  20775. }
  20776. else if (ruler1.y <= -h) {
  20777. ruler1.y = h;
  20778. ruler2.y = 0;
  20779. return;
  20780. }
  20781. if (ruler2.y >= h) {
  20782. ruler2.y = -h;
  20783. ruler1.y = 0;
  20784. return;
  20785. }
  20786. else if (ruler2.y <= -h) {
  20787. ruler2.y = h;
  20788. ruler1.y = 0;
  20789. return;
  20790. }
  20791. break;
  20792. case PressType.d2Root:
  20793. this.eventObj.curX = e.stageX;
  20794. this.eventObj.curY = e.stageY;
  20795. let offset = this.checkRodMoveDir();
  20796. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20797. this.eventObj.lastX = e.stageX;
  20798. this.eventObj.lastY = e.stageY;
  20799. break;
  20800. default:
  20801. break;
  20802. }
  20803. }
  20804. onEventUp(e) {
  20805. if (e.stopPropagation)
  20806. e.stopPropagation();
  20807. if (e && e.force) {
  20808. }
  20809. else {
  20810. if (!this.isTurnSelf())
  20811. return;
  20812. }
  20813. switch (this.pressTarget) {
  20814. case PressType.powerNode:
  20815. this.ui.powerNode.value = 0;
  20816. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20817. this.ui.powerTxt.text = "";
  20818. if (this.powerNum > 0) {
  20819. xGame.eventMgr.event(BALL_SHOOT);
  20820. xGame.common.d2World.shoot(this.powerNum);
  20821. xGame.common.d2World.d2Gan.shoot();
  20822. xGame.common.d2World.d2HelpLine.shoot();
  20823. this.finishGuide();
  20824. this.finishGuideForLxms();
  20825. this.ui.powerEft.visible = false;
  20826. this.ui.colorNode.visible = false;
  20827. let ganStr = "";
  20828. if (this.powerNum <= 30) {
  20829. ganStr = "gan_30";
  20830. }
  20831. else if (this.powerNum <= 60) {
  20832. ganStr = "gan_50";
  20833. }
  20834. else {
  20835. ganStr = "gan_80";
  20836. }
  20837. xGame.soundMgr.playSound(ganStr);
  20838. }
  20839. break;
  20840. case PressType.moveNode:
  20841. let rootBall = xGame.common.d2World.rootBall;
  20842. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20843. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20844. let isIntersect = this.judgeBallIntersect();
  20845. if (isIntersect) {
  20846. this.ui.moveNode.x = lastX;
  20847. this.ui.moveNode.y = lastY;
  20848. rootBall.gameObj.x = lastX;
  20849. rootBall.gameObj.y = lastY;
  20850. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20851. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20852. }
  20853. else {
  20854. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20855. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20856. }
  20857. this.showBallUI();
  20858. this.ui.moveNode.finger.visible = true;
  20859. xGame.common.d2World.getHelpLine();
  20860. break;
  20861. case PressType.rulerNode:
  20862. break;
  20863. case PressType.d2Root:
  20864. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20865. if (dis <= 25) {
  20866. this.moveToClickDot(e);
  20867. }
  20868. break;
  20869. default:
  20870. break;
  20871. }
  20872. this.pressTarget = -1;
  20873. }
  20874. checkGuide() {
  20875. let guide = DataMgr.getSkillGuide();
  20876. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20877. xGame.common.guideStep++;
  20878. xGame.common.gameUI.ui.guide2.visible = false;
  20879. xGame.common.gameUI.ui.guide3.visible = true;
  20880. }
  20881. }
  20882. checkGuideForLxms() {
  20883. let guide = DataMgr.getLianXiGuide();
  20884. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 2) {
  20885. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  20886. xGame.common.gameUI.ui.n_lxms_yd3.visible = true;
  20887. xGame.common.guideStepForLianXi = 3;
  20888. }
  20889. }
  20890. finishGuide() {
  20891. let guide = DataMgr.getSkillGuide();
  20892. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20893. xGame.common.guideStep = 10;
  20894. this.closeAllGuide();
  20895. console.log('zh: 新手引导完毕');
  20896. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20897. }
  20898. }
  20899. finishGuideForLxms() {
  20900. let guide = DataMgr.getLianXiGuide();
  20901. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  20902. xGame.common.guideStepForLianXi = 3;
  20903. DataMgr.setLianXiGuide(1);
  20904. this.closeAllGuideForLxms();
  20905. console.log('zh: lxms新手引导完毕');
  20906. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20907. }
  20908. }
  20909. closeAllGuide() {
  20910. xGame.common.gameUI.ui.guide1.visible = false;
  20911. xGame.common.gameUI.ui.guide2.visible = false;
  20912. xGame.common.gameUI.ui.guide3.visible = false;
  20913. }
  20914. closeAllGuideForLxms() {
  20915. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  20916. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  20917. xGame.common.gameUI.ui.n_lxms_yd3.visible = false;
  20918. }
  20919. updateBarInfo() {
  20920. let star = this.ui.powerNode.y;
  20921. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20922. if (rate >= 1)
  20923. rate = 1;
  20924. if (rate <= 0)
  20925. rate = 0;
  20926. this.powerNum = Math.ceil(rate * 100);
  20927. this.ui.powerNode.value = this.powerNum;
  20928. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20929. this.ui.colorNode.value = this.powerNum;
  20930. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20931. this.ui.powerEft.visible = this.powerNum != 0;
  20932. this.ui.colorNode.visible = this.powerNum != 0;
  20933. this.ui.powerTxt.text = this.powerNum + "";
  20934. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20935. }
  20936. forceCancel() {
  20937. this.ui.powerNode.value = 0;
  20938. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20939. this.ui.powerTxt.text = "";
  20940. }
  20941. checkRodMoveDir() {
  20942. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20943. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20944. if (tempX >= 0 && tempY <= 0) {
  20945. return this.checkDir();
  20946. }
  20947. else if (tempX < 0 && tempY < 0) {
  20948. return this.checkDir(1, -1);
  20949. }
  20950. else if (tempX < 0 && tempY > 0) {
  20951. return this.checkDir(-1, -1);
  20952. }
  20953. else {
  20954. return this.checkDir(-1, 1);
  20955. }
  20956. }
  20957. checkDir(flagX = 1, flagY = 1) {
  20958. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20959. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20960. if (offsetY == 0) {
  20961. return offsetX * flagX;
  20962. }
  20963. if (offsetX == 0) {
  20964. return offsetY * flagY;
  20965. }
  20966. let angle = offsetY / offsetX;
  20967. if (Math.abs(angle) >= 1) {
  20968. return offsetY * flagY;
  20969. }
  20970. else {
  20971. return offsetX * flagX;
  20972. }
  20973. }
  20974. judgeBallIntersect() {
  20975. let rootBall = xGame.common.d2World.rootBall;
  20976. let ballArr = xGame.common.d2World.ballArr;
  20977. let radius = rootBall.gameObj.width / 2;
  20978. let temp;
  20979. let isIntersect = false;
  20980. for (let index = 0; index < ballArr.length; index++) {
  20981. temp = ballArr[index];
  20982. if (temp.number == rootBall.number)
  20983. continue;
  20984. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20985. if (isIntersect) {
  20986. break;
  20987. }
  20988. }
  20989. return isIntersect;
  20990. }
  20991. hideBallUI() {
  20992. let d2Gan = xGame.common.d2World.d2Gan;
  20993. if (!d2Gan.ui.isDisposed)
  20994. d2Gan.ui.visible = false;
  20995. let d2Help = xGame.common.d2World.d2HelpLine;
  20996. if (!d2Help.ui.isDisposed)
  20997. d2Help.ui.visible = false;
  20998. let rootBall = xGame.common.d2World.rootBall;
  20999. if (!rootBall.destroyed) {
  21000. rootBall.gameObj.active = false;
  21001. }
  21002. }
  21003. showBallUI() {
  21004. let d2Gan = xGame.common.d2World.d2Gan;
  21005. if (!d2Gan.ui.isDisposed)
  21006. d2Gan.ui.visible = true;
  21007. let d2Help = xGame.common.d2World.d2HelpLine;
  21008. if (!d2Help.ui.isDisposed)
  21009. d2Help.ui.visible = true;
  21010. let rootBall = xGame.common.d2World.rootBall;
  21011. if (!rootBall.destroyed) {
  21012. rootBall.gameObj.active = true;
  21013. }
  21014. }
  21015. moveToClickDot(e) {
  21016. if (!this.isMoveRod && !xGame.common.clickedBall) {
  21017. let root = xGame.common.d2World.rootBall.gameObj;
  21018. let xx = e.stageX - xGame.common.sysOffestNum;
  21019. let yy = e.stageY;
  21020. let x = xx - root.x;
  21021. let y = yy - root.y;
  21022. let angle = xGame.common.getfguiRotation(x, y);
  21023. xGame.common.d2World.d2Gan.ui.rotation = angle;
  21024. xGame.common.d2World.getHelpLine();
  21025. }
  21026. this.isMoveRod = false;
  21027. xGame.common.clickedBall = false;
  21028. }
  21029. openAllEvent() {
  21030. this.closeAllEvent();
  21031. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21032. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21033. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21034. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21035. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  21036. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  21037. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  21038. }
  21039. closeAllEvent() {
  21040. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21041. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21042. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21043. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21044. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  21045. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  21046. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  21047. }
  21048. resetGame() {
  21049. this.closeAllEvent();
  21050. this.hideBallUI();
  21051. xGame.common.gameMgr.gamePause = true;
  21052. }
  21053. }
  21054. UIGame$1.uiName = "UIGame";
  21055. class UIAddCoin$1 extends UIBase {
  21056. constructor() {
  21057. super();
  21058. this.coinNum = 2000;
  21059. }
  21060. onConstructor() {
  21061. this.ui = ui_UIAddCoin.createInstance();
  21062. this.contentPane = this.ui;
  21063. this.isEject = false;
  21064. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  21065. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  21066. }
  21067. show() {
  21068. super.show();
  21069. this.ui.t0.play();
  21070. this.setGlobalFont(this.ui);
  21071. }
  21072. videoAddCoin() {
  21073. console.log('zh:qjff_AD_for_UIAddCoin');
  21074. if (Laya.Browser.onAndroid) {
  21075. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21076. if (!boo) {
  21077. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21078. return;
  21079. }
  21080. }
  21081. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  21082. }
  21083. else {
  21084. console.log('zh:AD 失败,直接发放奖励');
  21085. this.qjff_AD_for_UIAddCoin();
  21086. }
  21087. }
  21088. qjff_AD_for_UIAddCoin() {
  21089. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  21090. this.hide();
  21091. }
  21092. }
  21093. UIAddCoin$1.uiName = "UIAddCoin";
  21094. class UIInvitation$1 extends UIBase {
  21095. constructor() {
  21096. super();
  21097. }
  21098. onConstructor() {
  21099. this.ui = ui_UIInvitation.createInstance();
  21100. this.contentPane = this.ui;
  21101. this.isEject = false;
  21102. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  21103. }
  21104. show() {
  21105. super.show();
  21106. this.setGlobalFont(this.ui);
  21107. }
  21108. enterGame() {
  21109. xGame.common.gameMode = GameMode.classic;
  21110. DataMgr.setChallengeTimes(1);
  21111. xGame.common.passAwardCoin = 2000;
  21112. let need = xGame.common.classicNiceNeddCoin;
  21113. if (DataMgr.coinEnough(need)) {
  21114. DataMgr.setCoin(-need);
  21115. xGame.eventMgr.event(RESTART_GAME, true);
  21116. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  21117. }
  21118. else {
  21119. xGame.eventMgr.event(RESTART_GAME, true);
  21120. }
  21121. this.hide();
  21122. }
  21123. hide() {
  21124. super.hide();
  21125. }
  21126. }
  21127. UIInvitation$1.uiName = "UIInvitation";
  21128. class UIPower$1 extends UIBase {
  21129. constructor() {
  21130. super();
  21131. }
  21132. onConstructor() {
  21133. this.ui = ui_UIPower.createInstance();
  21134. this.contentPane = this.ui;
  21135. this.isEject = false;
  21136. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  21137. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  21138. }
  21139. show() {
  21140. super.show();
  21141. this.ui.t0.play();
  21142. this.setGlobalFont(this.ui);
  21143. }
  21144. videoGetPower() {
  21145. console.log('zh:qjff_AD_for_uipower');
  21146. if (Laya.Browser.onAndroid) {
  21147. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21148. if (!boo) {
  21149. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21150. return;
  21151. }
  21152. }
  21153. if (Laya.Browser.onAndroid) {
  21154. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  21155. }
  21156. else {
  21157. console.log('zh:AD 失败,直接发放奖励');
  21158. this.qjff_AD_for_uipower();
  21159. }
  21160. }
  21161. else {
  21162. this.qjff_AD_for_uipower();
  21163. }
  21164. }
  21165. qjff_AD_for_uipower() {
  21166. DataMgr.setPower(xGame.common.videoPower, true);
  21167. xGame.eventMgr.event(POWER_TIME);
  21168. this.hide();
  21169. }
  21170. }
  21171. UIPower$1.uiName = "UIPower";
  21172. class UIGameEnd$1 extends UIBase {
  21173. constructor() {
  21174. super();
  21175. this.success = false;
  21176. this.awardCoinNum = 1000;
  21177. this.awardDiamondNum = 10;
  21178. }
  21179. onConstructor() {
  21180. this.ui = ui_UIGameEnd.createInstance();
  21181. this.contentPane = this.ui;
  21182. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  21183. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  21184. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  21185. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21186. this.ui.talkNode.visible = false;
  21187. if (Moyu.isKs)
  21188. this.ui.closeNode.closeBtn.x += 100;
  21189. }
  21190. updateType() {
  21191. switch (xGame.common.gameMode) {
  21192. case GameMode.classic:
  21193. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21194. this.ui.coinNode.visible = this.success;
  21195. if (!this.success) {
  21196. Laya.timer.once(500, this, () => {
  21197. xGame.uiMgr.Show(UIAddCoin$1);
  21198. });
  21199. }
  21200. else {
  21201. this.logEventForClassic_win();
  21202. }
  21203. this.logEventForClassic_complete();
  21204. this.ui.isGetAward.visible = false;
  21205. this.ui.leftBtn.c1.selectedIndex = 3;
  21206. this.ui.rightBtn.c1.selectedIndex = 0;
  21207. this.moneyNode.ui.c1.selectedIndex = 1;
  21208. break;
  21209. case GameMode.bigMove:
  21210. console.log('zh:招法模式 aaaaaa bigMove');
  21211. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21212. this.ui.coinNode.visible = this.success;
  21213. if (xGame.common.gameMode == GameMode.bigMove) {
  21214. if (this.success) {
  21215. DataMgr.setSkillSuccessTimes(1, true);
  21216. DataMgr.setSkillAccTimes(1);
  21217. }
  21218. else {
  21219. DataMgr.setSkillSuccessTimes(0, false);
  21220. }
  21221. }
  21222. this.logEventForRod_complete_N();
  21223. if (!this.success) {
  21224. Laya.timer.once(500, this, () => {
  21225. xGame.uiMgr.Show(UIAddCoin$1);
  21226. });
  21227. }
  21228. else {
  21229. this.logEventForRod_win();
  21230. }
  21231. this.ui.isGetAward.visible = false;
  21232. this.ui.leftBtn.c1.selectedIndex = 3;
  21233. this.ui.rightBtn.c1.selectedIndex = 0;
  21234. this.moneyNode.ui.c1.selectedIndex = 1;
  21235. break;
  21236. case GameMode.placeBall:
  21237. this.ui.coinNode.visible = false;
  21238. if (this.success) {
  21239. if (xGame.common.placeBallStarNum == 3) {
  21240. this.ui.c1.selectedIndex = 2;
  21241. }
  21242. else {
  21243. this.ui.c1.selectedIndex = 3;
  21244. }
  21245. let level = xGame.common.placeBallCurLevel;
  21246. if (level > 59) {
  21247. this.logEventForChallenge_level_complete(level);
  21248. }
  21249. else {
  21250. this.logEventForChallenge_level_N(level);
  21251. }
  21252. }
  21253. else {
  21254. this.ui.c1.selectedIndex = 4;
  21255. }
  21256. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  21257. if (cfg.type == PlaceBallType.challenge) {
  21258. this.ui.c1.selectedIndex = 2;
  21259. }
  21260. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  21261. this.updatePlaceBallBtn();
  21262. this.updatePlaceBallStarNum();
  21263. this.updatePlaceBallAwardState();
  21264. this.moneyNode.ui.c1.selectedIndex = 2;
  21265. this.moneyNode.checkPowerTime();
  21266. this.moneyNode.powerChange();
  21267. DataMgr.upRankData();
  21268. break;
  21269. default:
  21270. break;
  21271. }
  21272. }
  21273. logEventForRod_complete_N() {
  21274. let gfmsIdx = xGame.common.curPlayerSkillType;
  21275. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  21276. let gfmc = 'Skyfall Shot';
  21277. if (gfmsIdx == 0) {
  21278. gfmc = 'Skyfall Shot';
  21279. }
  21280. if (gfmsIdx == 1) {
  21281. gfmc = 'Surging break';
  21282. }
  21283. if (gfmsIdx == 2) {
  21284. gfmc = 'Frost Lock';
  21285. }
  21286. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21287. console.log('zh:logEventForRod_complete_N level = ' + level);
  21288. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21289. let jsonStr = {
  21290. "count": 0,
  21291. "name": gfmc
  21292. };
  21293. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21294. const d = LocalStorageManager.getItem(keyStr);
  21295. jsonStr.count = d.count + 1;
  21296. LocalStorageManager.setItem(keyStr, jsonStr);
  21297. }
  21298. else {
  21299. LocalStorageManager.setItem(keyStr, jsonStr);
  21300. }
  21301. const d2 = LocalStorageManager.getItem(keyStr);
  21302. let count = d2.count;
  21303. console.log('zh:logEventForRod_complete_N count = ' + count);
  21304. if (count % 5 == 0) {
  21305. const reqStr = JSON.stringify(jsonStr);
  21306. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  21307. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  21308. }
  21309. }
  21310. logEventForRod_win() {
  21311. console.log('zh:logEventForRod_win,胜利');
  21312. let gfmsIdx = xGame.common.curPlayerSkillType;
  21313. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  21314. let gfmc = 'Skyfall Shot';
  21315. if (gfmsIdx == 0) {
  21316. gfmc = 'Skyfall Shot';
  21317. }
  21318. if (gfmsIdx == 1) {
  21319. gfmc = 'Surging break';
  21320. }
  21321. if (gfmsIdx == 2) {
  21322. gfmc = 'Frost Lock';
  21323. }
  21324. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21325. console.log('zh:logEventForRod_win level = ' + level);
  21326. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  21327. let jsonStr = {
  21328. "count": 1,
  21329. "name": gfmc + ' Lev' + level
  21330. };
  21331. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21332. const d = LocalStorageManager.getItem(keyStr);
  21333. jsonStr.count = d.count + 1;
  21334. LocalStorageManager.setItem(keyStr, jsonStr);
  21335. }
  21336. else {
  21337. LocalStorageManager.setItem(keyStr, jsonStr);
  21338. }
  21339. const reqStr = JSON.stringify(jsonStr);
  21340. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  21341. }
  21342. logEventForClassic_win() {
  21343. console.log('zh:logEventForClassic_win,胜利');
  21344. let rtype = xGame.common.classicRoomType;
  21345. let msmc = '';
  21346. if (rtype == 1) {
  21347. msmc = 'beginner';
  21348. }
  21349. if (rtype == 2) {
  21350. msmc = 'expert';
  21351. }
  21352. if (rtype == 3) {
  21353. msmc = 'master';
  21354. }
  21355. let keyStr = 'sjmd_classic_win_' + rtype;
  21356. let jsonStr = {
  21357. "difficulty": msmc,
  21358. "classic_count": 1,
  21359. "difficulty_count": 1
  21360. };
  21361. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21362. const d = LocalStorageManager.getItem(keyStr);
  21363. jsonStr.classic_count = d.classic_count + 1;
  21364. jsonStr.difficulty_count = d.difficulty_count + 1;
  21365. LocalStorageManager.setItem(keyStr, jsonStr);
  21366. }
  21367. else {
  21368. LocalStorageManager.setItem(keyStr, jsonStr);
  21369. }
  21370. const reqStr = JSON.stringify(jsonStr);
  21371. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  21372. }
  21373. logEventForClassic_complete() {
  21374. console.log('zh:logEventForClassic_complete,胜利');
  21375. let rtype = xGame.common.classicRoomType;
  21376. let msmc = '';
  21377. if (rtype == 1) {
  21378. msmc = 'beginner';
  21379. }
  21380. if (rtype == 2) {
  21381. msmc = 'expert';
  21382. }
  21383. if (rtype == 3) {
  21384. msmc = 'master';
  21385. }
  21386. let keyStr = 'sjmd_classic_complete_' + rtype;
  21387. let jsonStr = {
  21388. "msmc": msmc,
  21389. "count": 0
  21390. };
  21391. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21392. const d = LocalStorageManager.getItem(keyStr);
  21393. jsonStr.count = d.count + 1;
  21394. LocalStorageManager.setItem(keyStr, jsonStr);
  21395. }
  21396. else {
  21397. LocalStorageManager.setItem(keyStr, jsonStr);
  21398. }
  21399. if (jsonStr.count % 5 == 0) {
  21400. const reqStr = JSON.stringify(jsonStr);
  21401. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  21402. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  21403. }
  21404. }
  21405. updatePlaceBallBtn() {
  21406. this.ui.leftBtn.c1.selectedIndex = 5;
  21407. if (this.success) {
  21408. this.ui.rightBtn.c1.selectedIndex = 14;
  21409. }
  21410. else {
  21411. if (xGame.common.placeBallStarNum == 3) {
  21412. this.ui.rightBtn.c1.selectedIndex = 14;
  21413. }
  21414. else {
  21415. this.ui.rightBtn.c1.selectedIndex = 1;
  21416. }
  21417. }
  21418. }
  21419. updatePlaceBallStarNum() {
  21420. let starNum = xGame.common.placeBallStarNum;
  21421. if (starNum == 0)
  21422. this.ui.starNumNode.c1.selectedIndex = 3;
  21423. else {
  21424. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  21425. }
  21426. }
  21427. updatePlaceBallAwardState() {
  21428. let level = xGame.common.placeBallCurLevel;
  21429. let starNum = xGame.common.placeBallStarNum;
  21430. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21431. let data = cfgTable.placeballData[level].award;
  21432. let cfg = cfgTable.placeballData[level];
  21433. this.awardDiamondNum = data[1];
  21434. this.awardCoinNum = data[0];
  21435. if (cfg.type == PlaceBallType.challenge) {
  21436. this.awardDiamondNum = 0;
  21437. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21438. }
  21439. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  21440. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  21441. if (cfg.type == PlaceBallType.challenge) {
  21442. this.ui.awardNode.coinNode.visible = true;
  21443. }
  21444. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  21445. this.ui.awardNode.diamondNode.x = 265;
  21446. this.ui.awardNode.coinNode.x = 354;
  21447. }
  21448. else {
  21449. this.ui.awardNode.diamondNode.x = 291;
  21450. this.ui.awardNode.coinNode.x = 291;
  21451. }
  21452. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  21453. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  21454. if (this.awardCoinNum == 0) {
  21455. this.ui.awardNode.coinNode.numTxt.text = "";
  21456. }
  21457. if (getAward) {
  21458. this.ui.isGetAward.visible = true;
  21459. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21460. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21461. }
  21462. else {
  21463. this.ui.isGetAward.visible = false;
  21464. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21465. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21466. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21467. }
  21468. else {
  21469. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21470. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21471. }
  21472. }
  21473. }
  21474. show(success) {
  21475. super.show();
  21476. xGame.eventMgr.event(RESET_GAME);
  21477. this.success = success;
  21478. Laya.timer.clearAll(this);
  21479. this.playSecretaryAni();
  21480. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21481. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21482. offsetTime = Math.floor(offsetTime / 1000);
  21483. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21484. this.updateType();
  21485. Laya.timer.once(200, this, () => {
  21486. this.addAward(() => {
  21487. this.updateType();
  21488. Laya.timer.once(500, this, () => {
  21489. this.showChallengeLevel();
  21490. });
  21491. });
  21492. });
  21493. if (this.success) {
  21494. JSBridgeUtils.instance.showInternAd('gameend_success');
  21495. console.log('zh:game end 成功');
  21496. xGame.soundMgr.playSound('slots_roll01');
  21497. xGame.soundMgr.playSound("s_win");
  21498. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21499. this.diyGameDataUtilForGameWin();
  21500. this.updateGamePlaceBallData2Server();
  21501. }
  21502. else {
  21503. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21504. console.log('zh:game end失败');
  21505. xGame.soundMgr.playSound('matchwin01');
  21506. xGame.soundMgr.playSound("s_lose");
  21507. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21508. }
  21509. console.log('zh:开始弹出福利框2个');
  21510. Laya.timer.once(1000, this, () => {
  21511. console.log('zh: 1秒后 showFuLiSp1');
  21512. DataMgr.checkForShowFuLi17AndAlert(1);
  21513. });
  21514. let challengeNum = DataMgr.getChallengeTimes();
  21515. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21516. DataMgr.setChallengeTimes(1);
  21517. }
  21518. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21519. DataMgr.setClassicTimes();
  21520. }
  21521. this.setGlobalFont(this.ui);
  21522. }
  21523. diyGameDataUtilForGameWin() {
  21524. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21525. switch (xGame.common.gameMode) {
  21526. case GameMode.classic:
  21527. console.log('zh:DiyGameDataUtilForGameWin 111');
  21528. case GameMode.bigMove:
  21529. console.log('zh:DiyGameDataUtilForGameWin 222');
  21530. this.restartGame();
  21531. break;
  21532. case GameMode.placeBall:
  21533. console.log('zh:DiyGameDataUtilForGameWin 333');
  21534. var level = xGame.common.placeBallCurLevel;
  21535. console.log('zh:练习模式 联系了多少LEV=' + level);
  21536. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21537. if (level > db_over_lev) {
  21538. DataMgr.setChallengeMode_overLev(level);
  21539. }
  21540. break;
  21541. default:
  21542. console.log('zh:DiyGameDataUtilForGameWin 444');
  21543. break;
  21544. }
  21545. }
  21546. updateGamePlaceBallData2Server() {
  21547. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21548. if (userInfo == null) {
  21549. return;
  21550. }
  21551. let pbdObj = DataMgr.getPlaceBallLevelList();
  21552. let reqData = xGame.httpMgr.getReqData();
  21553. let pd = JSON.parse(reqData);
  21554. pd.placeBallData = JSON.stringify(pbdObj);
  21555. reqData = JSON.stringify(pd);
  21556. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21557. try {
  21558. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21559. let code = res.code;
  21560. let msg = res.msg;
  21561. if (code == 401) {
  21562. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21563. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21564. return;
  21565. }
  21566. if (code == 200) {
  21567. let data = res.data;
  21568. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21569. }
  21570. else {
  21571. xGame.uiMgr.Show(UIMsg$1, msg);
  21572. }
  21573. }
  21574. catch (error) {
  21575. console.log('error=' + error);
  21576. alert(error);
  21577. }
  21578. finally {
  21579. }
  21580. });
  21581. }
  21582. showChallengeLevel() {
  21583. if (DataMgr.getChallengeTimes() != 0)
  21584. return;
  21585. let skill = DataMgr.getSkillAccTimes();
  21586. let put = DataMgr.getPlaceBallLevelList().length;
  21587. if (skill >= 3 || put >= 5) {
  21588. xGame.uiMgr.Show(UIInvitation$1);
  21589. this.hide();
  21590. }
  21591. }
  21592. addAward(callback) {
  21593. if (!this.success) {
  21594. callback && callback();
  21595. return;
  21596. }
  21597. switch (xGame.common.gameMode) {
  21598. case GameMode.classic:
  21599. this.awardCoinNum = xGame.common.passAwardCoin;
  21600. this.awardDiamondNum = 0;
  21601. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21602. break;
  21603. case GameMode.bigMove:
  21604. this.awardCoinNum = xGame.common.passAwardCoin;
  21605. this.awardDiamondNum = 0;
  21606. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21607. callback && callback();
  21608. break;
  21609. case GameMode.placeBall:
  21610. let level = xGame.common.placeBallCurLevel;
  21611. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21612. if (xGame.common.placeBallStarNum != 3) {
  21613. callback && callback();
  21614. return;
  21615. }
  21616. else {
  21617. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21618. if (getAward) {
  21619. callback && callback();
  21620. return;
  21621. }
  21622. }
  21623. let cfg = cfgTable.placeballData[level];
  21624. let data = cfgTable.placeballData[level].award;
  21625. this.awardCoinNum = data[0];
  21626. this.awardDiamondNum = data[1];
  21627. if (cfg.type == PlaceBallType.challenge) {
  21628. this.awardDiamondNum = 0;
  21629. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21630. }
  21631. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21632. let diamondAward;
  21633. if (this.awardDiamondNum > 0) {
  21634. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21635. xGame.common.getAward([diamondAward, coinAward], callback);
  21636. }
  21637. else {
  21638. xGame.common.getAward([coinAward], callback);
  21639. }
  21640. if (cfg.type == PlaceBallType.normal) {
  21641. DataMgr.setPlaceBallAward(level);
  21642. }
  21643. break;
  21644. default:
  21645. break;
  21646. }
  21647. }
  21648. playSecretaryAni_old() {
  21649. let parent = this.ui.secretary.displayObject;
  21650. parent.destroyChildren();
  21651. let xx = this.ui.secretary.width / 2;
  21652. let yy = this.ui.secretary.height;
  21653. let scale = xGame.common.getSecretaryScale();
  21654. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21655. if (this.success) {
  21656. let rand = Math.random() <= 0.5 ? 2 : 3;
  21657. xGame.common.secretary.play(data, rand, false, parent, () => {
  21658. xGame.common.secretary.play(data, 1, true, parent);
  21659. });
  21660. }
  21661. else {
  21662. xGame.common.secretary.play(data, 0, true, parent);
  21663. }
  21664. }
  21665. playSecretaryAni() {
  21666. let parent = this.ui.secretary.displayObject;
  21667. parent.destroyChildren();
  21668. let xx = this.ui.secretary.width / 2;
  21669. let yy = this.ui.secretary.height;
  21670. let scale = xGame.common.getSecretaryScale();
  21671. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21672. if (this.success) {
  21673. let rand = 0;
  21674. xGame.common.secretary.play(data, 0, true, parent);
  21675. }
  21676. else {
  21677. xGame.common.secretary.play(data, 0, true, parent);
  21678. }
  21679. }
  21680. restartGame() {
  21681. switch (xGame.common.gameMode) {
  21682. case GameMode.classic:
  21683. xGame.eventMgr.event(RESTART_GAME);
  21684. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21685. break;
  21686. case GameMode.bigMove:
  21687. this.hide();
  21688. xGame.eventMgr.event(RESTART_GAME);
  21689. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21690. break;
  21691. default:
  21692. break;
  21693. }
  21694. }
  21695. hide() {
  21696. super.hide();
  21697. xGame.common.stopGirlPop(this.ui.talkNode);
  21698. PlatMgr.showBanner(false);
  21699. }
  21700. returnHome() {
  21701. this.hide();
  21702. let showFailWords = !this.success;
  21703. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21704. }
  21705. clickLeftBtn() {
  21706. switch (xGame.common.gameMode) {
  21707. case GameMode.classic:
  21708. case GameMode.bigMove:
  21709. this.returnHome();
  21710. break;
  21711. case GameMode.placeBall:
  21712. let level = xGame.common.placeBallCurLevel;
  21713. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21714. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21715. break;
  21716. default:
  21717. break;
  21718. }
  21719. }
  21720. powerStartPlaceBallLevel(level, btn) {
  21721. if (DataMgr.powerEnough()) {
  21722. btn.touchable = false;
  21723. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21724. btn.touchable = true;
  21725. DataMgr.setPower(-1);
  21726. xGame.eventMgr.event(POWER_TIME);
  21727. this.startPlaceBallLevel(level);
  21728. this.logEventForChallenge_level_start(level);
  21729. }));
  21730. }
  21731. else {
  21732. xGame.uiMgr.Show(UIPower$1, 0);
  21733. }
  21734. }
  21735. clickRightBtn() {
  21736. switch (xGame.common.gameMode) {
  21737. case GameMode.classic:
  21738. console.log('zh:clickRightBtn 111');
  21739. case GameMode.bigMove:
  21740. console.log('zh:clickRightBtn 222');
  21741. this.restartGame();
  21742. break;
  21743. case GameMode.placeBall:
  21744. console.log('zh:clickRightBtn 333');
  21745. let level = xGame.common.placeBallCurLevel;
  21746. let data = DataMgr.getPlaceBallLevel(level);
  21747. let curPss = data.play && !data.isCur;
  21748. if (curPss) {
  21749. console.log('zh:clickRightBtn 333-111');
  21750. console.log('zh:当前LV=' + level);
  21751. if (level == 60) {
  21752. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21753. Laya.timer.once(3000, this, () => {
  21754. this.returnHome();
  21755. });
  21756. }
  21757. else {
  21758. let lev = level + 1;
  21759. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21760. }
  21761. }
  21762. else {
  21763. console.log('zh:clickRightBtn 333-000');
  21764. Moyu.sendDataEvent("placeBallNextLevel");
  21765. console.log('zh:qjff_AD_for_uiGameEnd');
  21766. if (Laya.Browser.onAndroid) {
  21767. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21768. if (!boo) {
  21769. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21770. return;
  21771. }
  21772. }
  21773. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21774. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21775. }
  21776. else {
  21777. console.log('zh:AD 失败,直接发放奖励');
  21778. this.qjff_AD_for_uiGameEnd(level);
  21779. }
  21780. }
  21781. break;
  21782. default:
  21783. console.log('zh:clickRightBtn 444');
  21784. break;
  21785. }
  21786. }
  21787. logEventForChallenge_level_start(level) {
  21788. let keyStr = 'sjmd_challenge_level_start';
  21789. let jsonStr = {
  21790. "count": 0,
  21791. "gold_balance ": DataMgr.getCoin(),
  21792. "level": level,
  21793. "diamond_balance ": DataMgr.getDiamond()
  21794. };
  21795. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21796. const d = LocalStorageManager.getItem(keyStr);
  21797. if (level > d.level) {
  21798. jsonStr.count = d.count + 1;
  21799. LocalStorageManager.setItem(keyStr, jsonStr);
  21800. }
  21801. else {
  21802. }
  21803. }
  21804. else {
  21805. LocalStorageManager.setItem(keyStr, jsonStr);
  21806. }
  21807. const reqStr = JSON.stringify(jsonStr);
  21808. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21809. }
  21810. qjff_AD_for_uiGameEnd(level) {
  21811. DataMgr.setPlaceBallLevel(level, 1);
  21812. this.startPlaceBallLevel(level + 1);
  21813. }
  21814. startPlaceBallLevel(level) {
  21815. xGame.common.gameMode = GameMode.placeBall;
  21816. xGame.common.placeBallCurLevel = level;
  21817. xGame.uiMgr.Show(UIGame$1);
  21818. this.hide();
  21819. }
  21820. logEventForChallenge_level_complete(level) {
  21821. let keyStr = 'sjmd_challenge_level_complete';
  21822. let jsonStr = {
  21823. "count": 1,
  21824. "gold_balance ": DataMgr.getCoin(),
  21825. "level": level,
  21826. "diamond_balance ": DataMgr.getDiamond()
  21827. };
  21828. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21829. const d = LocalStorageManager.getItem(keyStr);
  21830. jsonStr.count = d.count + 1;
  21831. LocalStorageManager.setItem(keyStr, jsonStr);
  21832. }
  21833. else {
  21834. LocalStorageManager.setItem(keyStr, jsonStr);
  21835. }
  21836. const reqStr = JSON.stringify(jsonStr);
  21837. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21838. }
  21839. logEventForChallenge_level_N(level) {
  21840. console.log('zh:logEventForChallenge_level_N ' + level);
  21841. let keyStr = 'sjmd_challenge_level_N';
  21842. if (LocalStorageManager.hasKey(keyStr)) {
  21843. let lev = LocalStorageManager.getItem(keyStr);
  21844. if (level > lev) {
  21845. LocalStorageManager.setItem(keyStr, level);
  21846. }
  21847. if ((level) % 5 == 0) {
  21848. console.log('zh:每5关上报1次');
  21849. let sjmc = 'challenge_level_' + level;
  21850. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21851. let sjmcForFirebase = 'challenge_level_' + level;
  21852. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21853. }
  21854. else {
  21855. console.log('zh:5 no 上报');
  21856. }
  21857. }
  21858. else {
  21859. LocalStorageManager.setItem(keyStr, level);
  21860. }
  21861. }
  21862. }
  21863. UIGameEnd$1.uiName = "UIGameEnd";
  21864. class ShowItem$1 {
  21865. constructor() {
  21866. this.ui = ui_ShowItem.createInstance();
  21867. }
  21868. destroySelf() {
  21869. if (!this.ui.isDisposed) {
  21870. this.ui.removeFromParent();
  21871. this.ui.dispose();
  21872. }
  21873. }
  21874. setParent(parent) {
  21875. parent.addChild(this.ui);
  21876. }
  21877. setPos(x, y) {
  21878. this.ui.x = x;
  21879. this.ui.y = y;
  21880. }
  21881. setUrl(index) {
  21882. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21883. }
  21884. }
  21885. class UILevelProp$1 extends UIBase {
  21886. constructor() {
  21887. super();
  21888. this.firstPos = 385;
  21889. this.secondPos = 467;
  21890. this.showItemArr = [];
  21891. }
  21892. onConstructor() {
  21893. this.ui = ui_UILevelProp.createInstance();
  21894. this.contentPane = this.ui;
  21895. this.isEject = false;
  21896. this.addUIClick(this.ui.closeBtn, this.hideWin);
  21897. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21898. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21899. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  21900. }
  21901. show(level) {
  21902. console.log('zh:show.');
  21903. super.show();
  21904. this.ui.t1.play();
  21905. this.level = level;
  21906. this.data = cfgTable.placeballData[this.level];
  21907. this.updateSelf();
  21908. this.showPreView();
  21909. this.moneyNode.ui.c1.selectedIndex = 2;
  21910. this.moneyNode.checkPowerTime();
  21911. this.moneyNode.powerChange();
  21912. this.yinDaoForLianxi();
  21913. this.setGlobalFont(this.ui);
  21914. }
  21915. yinDaoForLianxi() {
  21916. let lianXiGuide = DataMgr.getLianXiGuide();
  21917. console.log('zh:lianXiGuide=', lianXiGuide);
  21918. if (lianXiGuide === 0) {
  21919. this.ui.myNode.n_yd_3.visible = true;
  21920. console.log('zh:yinDaoForLianxi 333 set ok');
  21921. }
  21922. else {
  21923. this.ui.myNode.n_yd_3.visible = false;
  21924. console.log('zh:无需引导33');
  21925. }
  21926. }
  21927. showPreView() {
  21928. let item;
  21929. let data;
  21930. for (let index = 0; index < this.showItemArr.length; index++) {
  21931. item = this.showItemArr[index];
  21932. item.destroySelf();
  21933. }
  21934. this.showItemArr = [];
  21935. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21936. for (const key in cfgData) {
  21937. data = cfgData[key];
  21938. item = new ShowItem$1();
  21939. item.setParent(this.ui.myNode.displayRoot);
  21940. item.setPos(data.x, data.y);
  21941. item.setUrl(data.value);
  21942. this.showItemArr.push(item);
  21943. }
  21944. }
  21945. updateSelf() {
  21946. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21947. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21948. if (this.data.ball == -1) {
  21949. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21950. }
  21951. else {
  21952. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21953. }
  21954. let localData = DataMgr.getPlaceBallLevel(this.level);
  21955. let getAward = localData.getAward;
  21956. let cfg = cfgTable.placeballData[this.level];
  21957. let coin = this.data.award[0];
  21958. let diamond = this.data.award[1];
  21959. if (cfg.type == PlaceBallType.challenge) {
  21960. diamond = 0;
  21961. coin = 100;
  21962. }
  21963. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21964. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21965. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21966. if (cfg.type == PlaceBallType.challenge) {
  21967. this.ui.myNode.coinNode.numTxt.text = "";
  21968. }
  21969. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21970. if (coin > 0 && diamond > 0) {
  21971. this.ui.myNode.diamondNode.x = 385;
  21972. this.ui.myNode.coinNode.x = 467;
  21973. }
  21974. else {
  21975. this.ui.myNode.diamondNode.x = 385;
  21976. this.ui.myNode.coinNode.x = 385;
  21977. }
  21978. if (!getAward) {
  21979. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21980. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21981. }
  21982. else {
  21983. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21984. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21985. }
  21986. }
  21987. startGame() {
  21988. console.log("zh:startGame");
  21989. if (DataMgr.powerEnough()) {
  21990. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21991. this.ui.myNode.startBtn.touchable = false;
  21992. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21993. console.log('zh:startGame dh ');
  21994. this.ui.myNode.startBtn.touchable = true;
  21995. DataMgr.setPower(-1);
  21996. xGame.eventMgr.event(POWER_TIME);
  21997. xGame.common.gameMode = GameMode.placeBall;
  21998. xGame.common.placeBallCurLevel = this.level;
  21999. xGame.uiMgr.Show(UIGame$1);
  22000. xGame.uiMgr.Hide(UILevelDisplay$1);
  22001. xGame.uiMgr.Hide(UIMain$1);
  22002. this.logEventForChallenge_level_start(this.level);
  22003. this.hideWin();
  22004. }));
  22005. console.log('zh:eeeee');
  22006. }
  22007. else {
  22008. let guide = DataMgr.getLianXiGuide();
  22009. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  22010. console.log('zh:自动添加2点体力,以便于完成练习引导模式');
  22011. DataMgr.setPower(2);
  22012. }
  22013. console.log('zh:guide = ' + guide);
  22014. console.log('zh:xGame.common.gameMode = ' + xGame.common.gameMode);
  22015. console.log('zh:powerEnough不足=' + DataMgr.powerEnough());
  22016. xGame.uiMgr.Show(UIPower$1);
  22017. }
  22018. }
  22019. logEventForChallenge_level_start(level) {
  22020. let keyStr = 'sjmd_challenge_level_start';
  22021. let jsonStr = {
  22022. "count": 1,
  22023. "gold_balance ": DataMgr.getCoin(),
  22024. "level": level,
  22025. "diamond_balance ": DataMgr.getDiamond()
  22026. };
  22027. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22028. const d = LocalStorageManager.getItem(keyStr);
  22029. if (level > d.level) {
  22030. jsonStr.count = d.count + 1;
  22031. LocalStorageManager.setItem(keyStr, jsonStr);
  22032. }
  22033. else {
  22034. }
  22035. }
  22036. else {
  22037. LocalStorageManager.setItem(keyStr, jsonStr);
  22038. }
  22039. const reqStr = JSON.stringify(jsonStr);
  22040. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  22041. }
  22042. hideWin() {
  22043. super.hide();
  22044. if (this.ui.myNode.startBtn) {
  22045. this.ui.myNode.startBtn.touchable = true;
  22046. if (this.ui.myNode.startBtn.powerEft.t0) {
  22047. this.ui.myNode.startBtn.powerEft.t0.stop();
  22048. }
  22049. }
  22050. }
  22051. }
  22052. UILevelProp$1.uiName = "UILevelProp";
  22053. class PutBallLevelDisplay$1 {
  22054. constructor(ui, index) {
  22055. this.index = 0;
  22056. this.ui = ui;
  22057. this.index = index;
  22058. this.ui.onClick(this, this.clickSelf);
  22059. this.updateSelf();
  22060. this.ui.levelTxt.text = (this.index + 1) + "";
  22061. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  22062. this.ui.special.levelTxt.text = (this.index + 1) + "";
  22063. }
  22064. updateSelf() {
  22065. let level = this.index + 1;
  22066. this.data = DataMgr.getPlaceBallLevel(level);
  22067. this.ui.starNode.c1.selectedIndex = this.data.star;
  22068. let isChallenge = cfgTable.placeballData[level].type;
  22069. if (this.data.isCur) {
  22070. if (isChallenge) {
  22071. this.ui.c1.selectedIndex = 5;
  22072. }
  22073. else {
  22074. this.ui.c1.selectedIndex = 2;
  22075. }
  22076. }
  22077. else {
  22078. if (this.data.play) {
  22079. if (this.data.star == 3) {
  22080. this.ui.c1.selectedIndex = 0;
  22081. }
  22082. else {
  22083. this.ui.c1.selectedIndex = 1;
  22084. }
  22085. }
  22086. else {
  22087. if (isChallenge) {
  22088. this.ui.c1.selectedIndex = 4;
  22089. }
  22090. else {
  22091. this.ui.c1.selectedIndex = 3;
  22092. }
  22093. }
  22094. }
  22095. }
  22096. clickSelf() {
  22097. console.log("zh:lev clickSelf");
  22098. if (!this.data.play)
  22099. return;
  22100. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22101. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  22102. }
  22103. }
  22104. class UILevelDisplay$1 extends UIBase {
  22105. constructor() {
  22106. super();
  22107. }
  22108. onConstructor() {
  22109. this.ui = ui_UILevelDisplay.createInstance();
  22110. this.contentPane = this.ui;
  22111. this.isEject = false;
  22112. this.myList = this.ui.myNode.myList;
  22113. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  22114. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  22115. this.levelItemArr = [];
  22116. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  22117. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  22118. this.myList.numItems = levelNum;
  22119. }
  22120. levelItemRender(index, target) {
  22121. let item = new PutBallLevelDisplay$1(target, index);
  22122. this.levelItemArr.push(item);
  22123. }
  22124. show() {
  22125. super.show();
  22126. this.updateLevel();
  22127. this.scrollToPlace();
  22128. this.yinDaoForLianxi();
  22129. this.setGlobalFont(this.ui);
  22130. }
  22131. yinDaoForLianxi() {
  22132. let lianXiGuide = DataMgr.getLianXiGuide();
  22133. console.log('zh:lianXiGuide=', lianXiGuide);
  22134. if (lianXiGuide === 0) {
  22135. this.ui.myNode.n_yd.visible = true;
  22136. console.log('zh:yinDaoForLianxi 222 set ok');
  22137. }
  22138. else {
  22139. this.ui.myNode.n_yd.visible = false;
  22140. console.log('zh:无需引导');
  22141. }
  22142. }
  22143. showLevelTipWindows() {
  22144. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22145. xGame.uiMgr.Show(UILevelProp$1, 1);
  22146. }
  22147. updateLevel() {
  22148. let temp;
  22149. for (let index = 0; index < this.levelItemArr.length; index++) {
  22150. temp = this.levelItemArr[index];
  22151. temp.updateSelf();
  22152. }
  22153. }
  22154. scrollToPlace() {
  22155. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  22156. let passArr = DataMgr.getPlaceBallLevelList();
  22157. let offest = passArr.length;
  22158. if (offest >= maxNum - 1)
  22159. offest = maxNum - 1;
  22160. this.myList.scrollToView(offest, true, true);
  22161. }
  22162. hide() {
  22163. super.hide();
  22164. }
  22165. }
  22166. UILevelDisplay$1.uiName = "UILevelDisplay";
  22167. class UIMatching$1 extends UIBase {
  22168. constructor() {
  22169. super();
  22170. }
  22171. onConstructor() {
  22172. this.ui = ui_UIMatching.createInstance();
  22173. this.contentPane = this.ui;
  22174. this.isEject = false;
  22175. }
  22176. show(callback) {
  22177. super.show();
  22178. PlatMgr.showBanner(true);
  22179. this.callback = callback;
  22180. let user = Moyu.getUserInfo();
  22181. if (!this.selfPot) {
  22182. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  22183. }
  22184. if (!this.aiPot) {
  22185. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  22186. }
  22187. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  22188. this.ui.selfHead.nameTxt.text = user.nickName;
  22189. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  22190. this.ui.aiHead.nameTxt.text = "???";
  22191. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  22192. this.ui.selfHead.c1.selectedIndex = 0;
  22193. this.ui.aiHead.c1.selectedIndex = 0;
  22194. this.ui.selfHead.x = this.selfPot.x;
  22195. this.ui.selfHead.y = this.selfPot.y;
  22196. this.ui.aiHead.x = this.aiPot.x;
  22197. this.ui.aiHead.y = this.aiPot.y;
  22198. switch (xGame.common.gameMode) {
  22199. case GameMode.classic:
  22200. break;
  22201. case GameMode.bigMove:
  22202. this.initSkillData();
  22203. break;
  22204. default:
  22205. break;
  22206. }
  22207. this.ui.t1.play(Laya.Handler.create(this, () => {
  22208. this.ui.t2.play(Laya.Handler.create(this, () => {
  22209. switch (xGame.common.gameMode) {
  22210. case GameMode.classic:
  22211. this.waitingPeople();
  22212. break;
  22213. case GameMode.bigMove:
  22214. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  22215. break;
  22216. default:
  22217. break;
  22218. }
  22219. }));
  22220. }));
  22221. this.setGlobalFont(this.ui);
  22222. }
  22223. initSkillData() {
  22224. this.skillSelectData = [];
  22225. let skillUrl = xGame.common.skillIconList;
  22226. let skillName = xGame.common.skillNameList;
  22227. let skillLevel = DataMgr.getBigSkillList();
  22228. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  22229. for (let index = 0; index < 5; index++) {
  22230. let obj = {};
  22231. obj.skillImg = skillUrl[index];
  22232. obj.skillName = skillName[index];
  22233. obj.skillType = skillType[index];
  22234. obj.skillLevel = skillLevel[index];
  22235. this.skillSelectData.push(obj);
  22236. }
  22237. }
  22238. getAISkillLevel(myLevel) {
  22239. let video = xGame.common.upSkillLevel;
  22240. let aiLevel;
  22241. let temp;
  22242. if (video) {
  22243. temp = xGame.common.randomNum(-2, -1);
  22244. }
  22245. else {
  22246. if (myLevel <= 5) {
  22247. temp = xGame.common.randomNum(1, 3);
  22248. }
  22249. else if (myLevel <= 9) {
  22250. temp = xGame.common.randomNum(-2, 1);
  22251. }
  22252. else {
  22253. temp = xGame.common.randomNum(-4, 0);
  22254. }
  22255. }
  22256. aiLevel = temp + myLevel;
  22257. if (aiLevel <= 1)
  22258. aiLevel = 1;
  22259. if (aiLevel >= 10)
  22260. aiLevel = 10;
  22261. return aiLevel;
  22262. }
  22263. getAISkillType() {
  22264. return xGame.common.randomNum(1, 4);
  22265. let successTimes = DataMgr.getSkillSuccessTimes();
  22266. let info = cfgTable.aiskillData[successTimes];
  22267. if (!info) {
  22268. let max = Object.keys(cfgTable.aiskillData).length - 1;
  22269. info = cfgTable.aiskillData[max];
  22270. }
  22271. let dataArr = info.skillselect;
  22272. let myCfg = {};
  22273. for (let index = 0; index < dataArr.length; index++) {
  22274. let temp = dataArr[index].split('-');
  22275. myCfg[temp[0]] = {};
  22276. myCfg[temp[0]].id = parseInt(temp[0]);
  22277. myCfg[temp[0]].weight = parseInt(temp[1]);
  22278. }
  22279. let aiCfg = xGame.common.initWeight(myCfg);
  22280. let curData = xGame.common.getRandomWeightData(aiCfg);
  22281. return parseInt(curData.id);
  22282. }
  22283. getAISkillData(index) {
  22284. let myLevel = this.skillSelectData[index].skillLevel;
  22285. let aiLevel = this.getAISkillLevel(myLevel);
  22286. let aiType = this.getAISkillType() - 1;
  22287. return { aiLevel, aiType } = { aiLevel, aiType };
  22288. }
  22289. skillSelectFinish(index) {
  22290. let aiInfo = this.getAISkillData(index);
  22291. xGame.common.gameMgr.selfCurSkill = index;
  22292. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  22293. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  22294. this.ui.selfHead.c1.selectedIndex = 1;
  22295. this.ui.aiHead.c1.selectedIndex = 1;
  22296. let myData = this.skillSelectData[index];
  22297. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  22298. let guide = DataMgr.getSkillGuide();
  22299. if (guide == 0) {
  22300. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  22301. }
  22302. else {
  22303. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  22304. }
  22305. let aiData = this.skillSelectData[aiInfo.aiType];
  22306. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  22307. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  22308. this.waitingPeople();
  22309. }
  22310. waitingPeople() {
  22311. let time = xGame.common.randomNum(1000, 3000);
  22312. time += 1000;
  22313. Laya.timer.once(time, this, () => {
  22314. this.matchingSuccess();
  22315. });
  22316. }
  22317. matchingSuccess() {
  22318. let gameUI = xGame.common.gameUI;
  22319. let name = gameUI.ui.topNode.aiNameTxt.text;
  22320. let url = gameUI.ui.topNode.aiHeadLoader.url;
  22321. this.ui.aiHead.nameTxt.text = name;
  22322. this.ui.aiHead.headImg.url = url;
  22323. name = gameUI.ui.topNode.selfNameTxt.text;
  22324. url = gameUI.ui.topNode.selfHeadLoader.url;
  22325. this.ui.selfHead.nameTxt.text = name;
  22326. this.ui.selfHead.headImg.url = url;
  22327. this.ui.t3.play(Laya.Handler.create(this, () => {
  22328. this.callback && this.callback();
  22329. this.ui.t4.play(Laya.Handler.create(this, () => {
  22330. this.destroySelf();
  22331. }));
  22332. }));
  22333. }
  22334. destroySelf() {
  22335. this.callback = null;
  22336. this.skillSelectData = null;
  22337. this.selfPot = null;
  22338. this.aiPot = null;
  22339. if (!this.ui.isDisposed) {
  22340. this.ui.removeFromParent();
  22341. this.ui.dispose();
  22342. }
  22343. xGame.uiMgr.destroyUI(this);
  22344. }
  22345. }
  22346. UIMatching$1.uiName = "UIMatching";
  22347. class SkillDisplay$1 {
  22348. constructor(ui, data, uiIndex) {
  22349. this.starX = 0;
  22350. this.starY = 0;
  22351. this.index = 0;
  22352. this.ui = ui;
  22353. this.data = data;
  22354. this.index = uiIndex;
  22355. this.initSelf();
  22356. console.log('zh:SkillDisplay constructor this.skillData=', data);
  22357. }
  22358. initSelf() {
  22359. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  22360. this.ui.nameTxt.text = this.data.name;
  22361. this.ui.describeTxt.text = this.data.describe;
  22362. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  22363. this.ui.startBtn.onClick(this, this.startGame);
  22364. this.updateSelf();
  22365. }
  22366. updateSelf() {
  22367. this.checkTry();
  22368. let level = DataMgr.getBigSkillByIndex(this.index);
  22369. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  22370. }
  22371. checkTry() {
  22372. let index = this.index;
  22373. let level = DataMgr.getBigSkillByIndex(index);
  22374. if (level == null) {
  22375. DataMgr.setBigSkill(index, 1, false);
  22376. level = 1;
  22377. }
  22378. this.ui.levelTxt.text = "LV." + level;
  22379. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  22380. this.ui.tryNode.visible = true;
  22381. else
  22382. this.ui.tryNode.visible = false;
  22383. }
  22384. clickAddLevel() {
  22385. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22386. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  22387. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  22388. if (Laya.Browser.onAndroid) {
  22389. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  22390. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22391. }
  22392. else {
  22393. console.log('zh:AD 失败,直接发放奖励');
  22394. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22395. }
  22396. }
  22397. else {
  22398. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22399. }
  22400. }
  22401. qjff_AD_for_skilldisplay_clickAddLevel() {
  22402. DataMgr.setBigSkill(this.data.index, 1);
  22403. this.updateSelf();
  22404. xGame.common.upSkillLevel = true;
  22405. }
  22406. startGame() {
  22407. console.log('zh:rod skill startgame');
  22408. if (this.data.index == 3) {
  22409. alert('Coming soon!');
  22410. return;
  22411. }
  22412. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22413. let needCoin = xGame.common.bigMoveNeedCoin;
  22414. xGame.common.passAwardCoin = 2000;
  22415. let guide = DataMgr.getSkillGuide();
  22416. console.log('zh:startGame guide=' + guide);
  22417. xGame.common.temSelfLevel = 0;
  22418. if (guide == 0) {
  22419. needCoin = 0;
  22420. xGame.common.temSelfLevel = 100;
  22421. }
  22422. if (DataMgr.coinEnough(needCoin)) {
  22423. DataMgr.setCoin(-needCoin);
  22424. xGame.common.curPlayerSkillType = this.index;
  22425. if (guide == 0)
  22426. xGame.common.curPlayerSkillType = 0;
  22427. console.log('zh: skilldisplay 1');
  22428. xGame.uiMgr.Show(UIGame$1);
  22429. xGame.uiMgr.Hide(UIMain$1);
  22430. xGame.uiMgr.Show(UIMatching$1, () => {
  22431. xGame.common.gameUI.ui.alpha = 1;
  22432. xGame.common.gameUI.startGame();
  22433. xGame.uiMgr.Hide(UISkill$1);
  22434. });
  22435. this.logEventForRod_start();
  22436. }
  22437. else {
  22438. console.log('zh: skilldisplay 2');
  22439. xGame.uiMgr.Show(UIAddProp$1, 0);
  22440. Moyu.sendDataEvent("AddCoinVideo");
  22441. }
  22442. }
  22443. logEventForRod_start() {
  22444. let gfmsIdx = xGame.common.curPlayerSkillType;
  22445. console.log('zh:选择的技能=' + gfmsIdx);
  22446. let gfmc = 'Skyfall Shot';
  22447. if (gfmsIdx == 0) {
  22448. gfmc = 'Skyfall Shot';
  22449. }
  22450. if (gfmsIdx == 1) {
  22451. gfmc = 'Surging break';
  22452. }
  22453. if (gfmsIdx == 2) {
  22454. gfmc = 'Frost Lock';
  22455. }
  22456. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  22457. let jsonStr = {
  22458. "count": 0,
  22459. "name": gfmc
  22460. };
  22461. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22462. const d = LocalStorageManager.getItem(keyStr);
  22463. jsonStr.count = d.count + 1;
  22464. LocalStorageManager.setItem(keyStr, jsonStr);
  22465. }
  22466. else {
  22467. LocalStorageManager.setItem(keyStr, jsonStr);
  22468. }
  22469. const reqStr = JSON.stringify(jsonStr);
  22470. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  22471. }
  22472. }
  22473. class UISkill$1 extends UIBase {
  22474. constructor() {
  22475. super();
  22476. this.skillData = [];
  22477. }
  22478. onConstructor() {
  22479. this.ui = ui_UISkill.createInstance();
  22480. this.contentPane = this.ui;
  22481. this.isEject = false;
  22482. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22483. this.initSkillData();
  22484. console.log('zh:aaaaaa1111111111');
  22485. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  22486. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  22487. console.log('zh:aaaaaa22222222');
  22488. this.displayList = [];
  22489. this.ui.skillNode.skillList.numItems = 3;
  22490. this.addUIClick(this.ui, this.interuptSecretary);
  22491. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  22492. this.ui.talkNode.visible = false;
  22493. if (Moyu.isKs)
  22494. this.ui.closeNode.closeBtn.x += 100;
  22495. }
  22496. show() {
  22497. super.show();
  22498. this.playSecretaryIdle();
  22499. this.moneyNode.ui.c1.selectedIndex = 1;
  22500. Laya.timer.clearAll(this);
  22501. xGame.soundMgr.playSound("s_start");
  22502. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22503. let guide = DataMgr.getSkillGuide();
  22504. this.ui.guideNode.visible = guide == 0;
  22505. let item = this.getSkillItemByUIIndex(0);
  22506. if (guide == 0) {
  22507. item.ui.c1.selectedIndex = 1;
  22508. }
  22509. else {
  22510. item.ui.c1.selectedIndex = 0;
  22511. }
  22512. this.ui.guideNode.guideBtn.visible = guide == 0;
  22513. for (let index = 0; index < this.displayList.length; index++) {
  22514. this.displayList[index].checkTry();
  22515. }
  22516. this.setGlobalFont(this.ui);
  22517. }
  22518. getSkillItemByUIIndex(cur) {
  22519. for (let index = 0; index < this.displayList.length; index++) {
  22520. if (this.displayList[index].index == cur) {
  22521. return this.displayList[index];
  22522. }
  22523. }
  22524. }
  22525. enterGuideLevel() {
  22526. let item = this.getSkillItemByUIIndex(0);
  22527. item.startGame();
  22528. if (DataMgr.getNewUser())
  22529. Moyu.sendDataEvent("gameStart1");
  22530. }
  22531. initSkillData() {
  22532. this.skillData = [];
  22533. let nameList = xGame.common.skillNameList;
  22534. let iconList = xGame.common.skillIconList;
  22535. let describeList = [
  22536. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22537. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22538. "The power of frost descends—freezing the flow and taking full control of the game!"
  22539. ];
  22540. console.log('zh:initSkillData 111111111');
  22541. let data;
  22542. for (let index = 0; index < nameList.length; index++) {
  22543. data = {};
  22544. data.name = nameList[index];
  22545. data.icon = iconList[index];
  22546. data.describe = describeList[index];
  22547. data.index = index;
  22548. this.skillData.push(data);
  22549. }
  22550. }
  22551. updateSkillItem(index, target) {
  22552. if (this.displayList[index] == null) {
  22553. let uiIndex;
  22554. switch (index) {
  22555. case 0:
  22556. uiIndex = 1;
  22557. break;
  22558. case 1:
  22559. uiIndex = 0;
  22560. break;
  22561. case 2:
  22562. uiIndex = 2;
  22563. break;
  22564. case 3:
  22565. uiIndex = 3;
  22566. break;
  22567. default:
  22568. break;
  22569. }
  22570. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22571. this.displayList.push(temp);
  22572. }
  22573. }
  22574. playSecretaryIdle() {
  22575. let parent = this.ui.secretary.displayObject;
  22576. parent.destroyChildren();
  22577. let xx = this.ui.secretary.width / 2;
  22578. let yy = this.ui.secretary.height;
  22579. let scale = xGame.common.getSecretaryScale();
  22580. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22581. xGame.common.secretary.play(data, 0, true, parent);
  22582. }
  22583. returnUIMain() {
  22584. this.hide();
  22585. xGame.common.stopGirlPop(this.ui.talkNode);
  22586. xGame.uiMgr.Show(UIMain$1);
  22587. }
  22588. interuptSecretary() {
  22589. Laya.timer.clearAll(this);
  22590. this.playSecretaryRandomSound();
  22591. }
  22592. playSecretaryRandomSound() {
  22593. if (this.isHide)
  22594. return;
  22595. let time = xGame.common.randomNum(45000, 60000);
  22596. Laya.timer.once(time, this, () => {
  22597. if (this.isHide)
  22598. return;
  22599. let index = xGame.common.randomNum(4, 7);
  22600. xGame.soundMgr.playSound("s_main0" + index);
  22601. let words = 1;
  22602. switch (index) {
  22603. case 4:
  22604. words = 5;
  22605. break;
  22606. case 5:
  22607. words = 3;
  22608. break;
  22609. case 6:
  22610. words = 6;
  22611. break;
  22612. case 7:
  22613. words = 7;
  22614. break;
  22615. default:
  22616. break;
  22617. }
  22618. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22619. this.playSecretaryRandomSound();
  22620. });
  22621. }
  22622. }
  22623. UISkill$1.uiName = "UISkill";
  22624. class UIAddProp$1 extends UIBase {
  22625. constructor() {
  22626. super();
  22627. this.curType = "";
  22628. }
  22629. onConstructor() {
  22630. this.ui = ui_UIAddProp.createInstance();
  22631. this.contentPane = this.ui;
  22632. this.isEject = false;
  22633. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22634. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22635. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22636. this.updateUI();
  22637. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22638. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22639. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22640. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22641. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22642. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22643. }
  22644. show(type) {
  22645. super.show();
  22646. this.curType = type == 0 ? "coin" : "diamond";
  22647. this.switchBtn("");
  22648. this.ui.t0.play();
  22649. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22650. PlatMgr.showInsert(true);
  22651. this.setGlobalFont(this.ui);
  22652. }
  22653. closeSelf() {
  22654. this.hide();
  22655. }
  22656. updateUI() {
  22657. let data = cfgTable.moneyData;
  22658. let temp;
  22659. let obj;
  22660. for (const key in data) {
  22661. temp = data[key];
  22662. obj = this.ui.myNode["node" + key];
  22663. if (parseInt(key) <= 2) {
  22664. obj.diamondTxt.text = "+" + temp.num;
  22665. }
  22666. else {
  22667. obj.coinTxt.text = temp.num;
  22668. obj.diamondTxt.text = temp.get.split('_')[1];
  22669. }
  22670. }
  22671. this.updateDiamondShare();
  22672. }
  22673. updateDiamondShare() {
  22674. let data = DataMgr.getShareDiamondTimes();
  22675. if (data >= xGame.common.maxShareDiamondTimes) {
  22676. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22677. this.ui.myNode.node1.touchable = false;
  22678. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22679. }
  22680. else {
  22681. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22682. this.ui.myNode.node1.touchable = true;
  22683. }
  22684. }
  22685. switchBtn(type) {
  22686. if (type == "")
  22687. type = this.curType;
  22688. else {
  22689. if (this.curType == type) {
  22690. return;
  22691. }
  22692. else {
  22693. this.curType = type;
  22694. }
  22695. }
  22696. if (type == "coin") {
  22697. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22698. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22699. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22700. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22701. this.ui.myNode.c1.selectedIndex = 0;
  22702. }
  22703. else {
  22704. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22705. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22706. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22707. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22708. this.ui.myNode.c1.selectedIndex = 1;
  22709. }
  22710. }
  22711. convertCoin(index) {
  22712. let data = cfgTable.moneyData[index];
  22713. let coinNum = data.num;
  22714. let str = data.get.split('_')[1];
  22715. let needDiamond = parseInt(str);
  22716. if (DataMgr.diamondEnough(needDiamond)) {
  22717. DataMgr.setDiamond(-needDiamond);
  22718. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22719. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22720. }
  22721. else {
  22722. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22723. this.switchBtn("diamond");
  22724. }
  22725. }
  22726. videoGetDiamond() {
  22727. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22728. if (Laya.Browser.onAndroid) {
  22729. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22730. if (!boo) {
  22731. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22732. return;
  22733. }
  22734. }
  22735. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22736. }
  22737. else {
  22738. console.log('zh:AD 失败,直接发放奖励');
  22739. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22740. }
  22741. }
  22742. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22743. let num = cfgTable.moneyData[2].num;
  22744. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22745. this.closeSelf();
  22746. }
  22747. videoGetCoin() {
  22748. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22749. if (Laya.Browser.onAndroid) {
  22750. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22751. if (!boo) {
  22752. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22753. return;
  22754. }
  22755. }
  22756. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22757. }
  22758. else {
  22759. console.log('zh:AD 失败,直接发放奖励');
  22760. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22761. }
  22762. }
  22763. qjff_AD_for_uiAddProp_videoGetCoin() {
  22764. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22765. this.closeSelf();
  22766. }
  22767. shareGetDiamond() {
  22768. let times = DataMgr.getShareDiamondTimes();
  22769. if (times >= xGame.common.maxShareDiamondTimes) {
  22770. console.log('zh: 233333333333 maxShareDiamondTimes');
  22771. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22772. }
  22773. else {
  22774. console.log('zh:33333333333333ad');
  22775. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22776. if (Laya.Browser.onAndroid) {
  22777. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22778. if (!boo) {
  22779. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22780. return;
  22781. }
  22782. }
  22783. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22784. }
  22785. else {
  22786. console.log('zh:AD 失败,直接发放奖励');
  22787. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22788. }
  22789. }
  22790. }
  22791. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22792. let diamond = xGame.common.randomNum(50, 100);
  22793. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22794. DataMgr.setShareDiamondTimes(1);
  22795. this.updateDiamondShare();
  22796. }
  22797. openPutBallView() {
  22798. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22799. let skill = xGame.uiMgr.getUI(UISkill$1);
  22800. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22801. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22802. if (end && !end.isHide) {
  22803. xGame.uiMgr.Hide(UIGameEnd$1);
  22804. xGame.uiMgr.Show(UIMain$1);
  22805. }
  22806. if (skill && !skill.isHide)
  22807. xGame.uiMgr.Hide(UISkill$1);
  22808. if (uigame && !uigame.isHide)
  22809. xGame.uiMgr.Hide(UIGame$1);
  22810. if (level && !level.isHide) {
  22811. }
  22812. else {
  22813. xGame.uiMgr.Show(UILevelDisplay$1);
  22814. }
  22815. this.closeSelf();
  22816. }
  22817. }
  22818. UIAddProp$1.uiName = "UIAddProp";
  22819. class MoneyNode$1 {
  22820. constructor(ui) {
  22821. this.leftTime = 0;
  22822. this.ui = ui;
  22823. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22824. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22825. this.ui.addPowerBtn.onClick(this, this.addPower);
  22826. this.ui.c1.selectedIndex = 1;
  22827. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22828. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22829. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22830. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22831. this.coinChange();
  22832. this.diamondChange();
  22833. this.powerChange();
  22834. }
  22835. addPower() {
  22836. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22837. xGame.uiMgr.Show(UIPower$1);
  22838. }
  22839. powerChange() {
  22840. let powerNum = DataMgr.getPower();
  22841. this.ui.powerTxt.text = powerNum + "";
  22842. }
  22843. checkPowerTime() {
  22844. let cur = new Date().getTime();
  22845. let last = DataMgr.getPowerTime();
  22846. if (last == 0) {
  22847. last = cur;
  22848. DataMgr.setPowerTime(cur);
  22849. }
  22850. let power = DataMgr.getPower();
  22851. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22852. Laya.timer.clearAll(this);
  22853. if (power >= xGame.common.natureMaxPower) {
  22854. this.ui.powerTimeTxt.text = "";
  22855. DataMgr.setPowerTime(cur);
  22856. return;
  22857. }
  22858. if (power + offset >= xGame.common.natureMaxPower) {
  22859. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22860. this.ui.powerTimeTxt.text = "";
  22861. DataMgr.setPowerTime(cur);
  22862. }
  22863. else {
  22864. if (offset > 0) {
  22865. DataMgr.setPower(offset);
  22866. DataMgr.setPowerTime(cur);
  22867. }
  22868. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22869. this.leftTime = xGame.common.powerRecoverNum - time;
  22870. if (this.leftTime <= 0)
  22871. this.leftTime = 0;
  22872. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22873. Laya.timer.loop(1000, this, this.updatePowerTime);
  22874. }
  22875. }
  22876. updatePowerTime() {
  22877. this.leftTime -= 1;
  22878. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22879. if (this.leftTime <= 0) {
  22880. this.checkPowerTime();
  22881. }
  22882. }
  22883. coinChange() {
  22884. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22885. }
  22886. diamondChange() {
  22887. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22888. }
  22889. addCoin() {
  22890. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22891. Moyu.sendDataEvent("AddCoinBtn");
  22892. xGame.uiMgr.Show(UIAddProp$1, 0);
  22893. }
  22894. addDiamond() {
  22895. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22896. Moyu.sendDataEvent("AddDiamondBtn");
  22897. xGame.uiMgr.Show(UIAddProp$1, 1);
  22898. }
  22899. }
  22900. class SettingNode$1 {
  22901. constructor(ui) {
  22902. this.showSetting = false;
  22903. this.openSound = true;
  22904. this.openShake = true;
  22905. this.ui = ui;
  22906. this.ui.soundBtn.onClick(this, this.switchSound);
  22907. this.ui.shakeBtn.onClick(this, this.switchShake);
  22908. this.ui.xyBtn.onClick(this, this.onXy);
  22909. this.ui.clickNode.onClick(this, this.changeSetting);
  22910. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22911. this.ui.xyBtn.visible = false;
  22912. this.ui.shakeBtn.visible = false;
  22913. }
  22914. changeSetting() {
  22915. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22916. this.showSetting = !this.showSetting;
  22917. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22918. }
  22919. switchSound() {
  22920. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22921. this.openSound = !this.openSound;
  22922. Moyu.onSetting(this.openSound, this.openShake);
  22923. xGame.soundMgr.onSetting(this.openSound);
  22924. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22925. }
  22926. switchShake() {
  22927. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22928. this.openShake = !this.openShake;
  22929. Moyu.onSetting(this.openSound, this.openShake);
  22930. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22931. }
  22932. onXy() {
  22933. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22934. MoyuMgr$1.showXy(1);
  22935. }
  22936. }
  22937. class UIDraw$1 extends UIBase {
  22938. constructor() {
  22939. super();
  22940. this.curKey = 0;
  22941. }
  22942. onConstructor() {
  22943. this.ui = ui_UIDraw.createInstance();
  22944. this.contentPane = this.ui;
  22945. this.isEject = false;
  22946. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22947. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22948. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22949. this.initDraw();
  22950. this.initUI();
  22951. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22952. }
  22953. show() {
  22954. super.show();
  22955. this.ui.t0.play();
  22956. this.playSecretaryIdle();
  22957. this.updateDraw();
  22958. this.checkFree();
  22959. if (PlatMgr.bannerDelay > 0) {
  22960. this.ui.closeNode.closeBtn.visible = false;
  22961. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22962. this.ui.closeNode.closeBtn.visible = true;
  22963. });
  22964. }
  22965. PlatMgr.showRateBanner();
  22966. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22967. this.setGlobalFont(this.ui);
  22968. }
  22969. hide() {
  22970. Laya.timer.clearAll(this);
  22971. super.hide();
  22972. }
  22973. checkFree() {
  22974. let isFree = DataMgr.getDailyfreeDrawTimes();
  22975. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22976. }
  22977. initDraw() {
  22978. this.drawObj = [];
  22979. let data = cfgTable.drawData;
  22980. let temp;
  22981. let weight = 0;
  22982. for (const key in data) {
  22983. temp = data[key];
  22984. weight += temp.weight;
  22985. this.drawObj.push(weight);
  22986. }
  22987. this.allWeight = weight;
  22988. }
  22989. initUI() {
  22990. let data = cfgTable.drawData;
  22991. let temp;
  22992. let img;
  22993. let txt;
  22994. for (const key in data) {
  22995. temp = data[key];
  22996. img = this.ui.myNode.rotNode["img" + key];
  22997. txt = this.ui.myNode.rotNode["txt" + key];
  22998. img.url = xGame.common.getGameIconUrl(temp.icon);
  22999. txt.visible = true;
  23000. if (temp.award > 2) {
  23001. img.rotation = 0;
  23002. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  23003. }
  23004. else {
  23005. img.rotation = temp.rotation;
  23006. txt.text = temp.num;
  23007. }
  23008. }
  23009. }
  23010. getCurkey() {
  23011. let rand = Math.random() * this.allWeight;
  23012. let temp;
  23013. for (let index = 0; index < this.drawObj.length - 1; index++) {
  23014. temp = this.drawObj[index];
  23015. if (index == 0) {
  23016. if (rand < temp) {
  23017. return index + 1;
  23018. }
  23019. }
  23020. else {
  23021. if (rand >= temp && rand < this.drawObj[index + 1]) {
  23022. return index + 1;
  23023. }
  23024. }
  23025. }
  23026. return 2;
  23027. }
  23028. startDraw() {
  23029. console.log('zh:开始抽奖');
  23030. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  23031. if (freeTimes > 0) {
  23032. console.log('zh:freeTimes=' + freeTimes);
  23033. this.beginDraw();
  23034. DataMgr.setDailyfreeDrawTimes(0);
  23035. this.checkFree();
  23036. }
  23037. else {
  23038. if (Laya.Browser.onAndroid) {
  23039. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23040. if (!boo) {
  23041. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23042. return;
  23043. }
  23044. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  23045. }
  23046. else {
  23047. console.log('zh:AD 失败,直接发放奖励');
  23048. this.qjff_chouJiang();
  23049. }
  23050. }
  23051. else {
  23052. this.qjff_chouJiang();
  23053. }
  23054. }
  23055. }
  23056. qjff_chouJiang() {
  23057. this.beginDraw();
  23058. }
  23059. beginDraw() {
  23060. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  23061. this.ui.drawBtn.touchable = false;
  23062. this.curKey = this.getCurkey();
  23063. console.log("zh:当前key", this.curKey);
  23064. let cell = 60;
  23065. let lap = 3;
  23066. let angle = cell * (this.curKey - 1) + lap * 360;
  23067. let target = this.ui.myNode.rotNode;
  23068. target.rotation = 0;
  23069. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  23070. console.log("zh:旋转完成");
  23071. this.ui.drawBtn.touchable = true;
  23072. this.getAward();
  23073. }));
  23074. }
  23075. getAward() {
  23076. let data = cfgTable.drawData[this.curKey];
  23077. let temp = new AwardType();
  23078. temp.type = data.award;
  23079. temp.num = data.num;
  23080. xGame.common.getAward([temp], () => {
  23081. DataMgr.setDrawTimes(1);
  23082. this.updateDraw();
  23083. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  23084. });
  23085. }
  23086. updateDraw() {
  23087. let drawTimes = DataMgr.getDrawTimes();
  23088. let awardTimes = DataMgr.getDrawAwardTimes();
  23089. if (Math.floor(drawTimes / 3) > awardTimes) {
  23090. this.ui.extraNode.boxBtn.t0.play(null, -1);
  23091. this.ui.extraNode.boxBtn.touchable = true;
  23092. this.ui.extraNode.tipsTxt.text = "3/3";
  23093. this.ui.extraNode.barNode.width = 265;
  23094. this.getExtraAward();
  23095. }
  23096. else {
  23097. this.ui.extraNode.boxBtn.t0.stop();
  23098. this.ui.extraNode.boxBtn.touchable = false;
  23099. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  23100. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  23101. }
  23102. let data = cfgTable.drawData[1];
  23103. if (awardTimes == 0) {
  23104. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  23105. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  23106. this.ui.myNode.rotNode.img1.rotation = 0;
  23107. }
  23108. else {
  23109. let award = data.nextid;
  23110. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  23111. this.ui.myNode.rotNode.txt1.text = award[1];
  23112. this.ui.myNode.rotNode.img1.rotation = 0;
  23113. }
  23114. }
  23115. getExtraAward() {
  23116. let drawTimes = DataMgr.getDrawTimes();
  23117. let awardTimes = DataMgr.getDrawAwardTimes();
  23118. let data = cfgTable.drawData[1];
  23119. let award = new AwardType();
  23120. if (awardTimes == 0) {
  23121. award.num = data.num;
  23122. award.type = data.award;
  23123. xGame.common.getAward([award], () => {
  23124. let all = Math.floor(drawTimes / 3);
  23125. DataMgr.setDrawAwardTimes(all);
  23126. this.updateDraw();
  23127. });
  23128. }
  23129. else {
  23130. award.num = parseInt(data.nextid[1]);
  23131. award.type = parseInt(data.nextid[0]);
  23132. xGame.common.getAward([award], () => {
  23133. let all = Math.floor(drawTimes / 3);
  23134. DataMgr.setDrawAwardTimes(all);
  23135. this.updateDraw();
  23136. });
  23137. }
  23138. }
  23139. closeSelf() {
  23140. this.hide();
  23141. }
  23142. playSecretaryIdle() {
  23143. let parent = this.ui.secretary.displayObject;
  23144. parent.destroyChildren();
  23145. let xx = this.ui.secretary.width / 2;
  23146. let yy = this.ui.secretary.height;
  23147. let scale = xGame.common.getSecretaryScale();
  23148. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23149. xGame.common.secretary.play(data, 0, true, parent);
  23150. }
  23151. }
  23152. UIDraw$1.uiName = "UIDraw";
  23153. class UIRanking$1 extends UIBase {
  23154. constructor() {
  23155. super();
  23156. this.showSelf = true;
  23157. this.rankType = 1;
  23158. this.rankList = [];
  23159. this.topX = 10;
  23160. this.myIndex = this.topX + 1;
  23161. this.myStar = 0;
  23162. }
  23163. onConstructor() {
  23164. this.ui = ui_UIRanking.createInstance();
  23165. this.contentPane = this.ui;
  23166. this.isEject = false;
  23167. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  23168. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  23169. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  23170. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  23171. this.ui.myNode.myList.setVirtual();
  23172. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  23173. }
  23174. show() {
  23175. super.show();
  23176. this.getPaiHangBangDataFormJosnFile();
  23177. this.updateSelf();
  23178. let self = Moyu.getUserInfo();
  23179. if (!self.isAuth) {
  23180. Moyu.initUser(this, () => {
  23181. DataMgr.upRankData();
  23182. });
  23183. }
  23184. this.setGlobalFont(this.ui);
  23185. }
  23186. getPaiHangBangDataFormJosnFile() {
  23187. const rankingList = cfgTable.paiHangBangData.list;
  23188. this.updateItemData(rankingList);
  23189. }
  23190. updateSelfItem() {
  23191. console.log('zh:Moyu.platType =' + Moyu.platType);
  23192. let self = Moyu.getUserInfo();
  23193. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  23194. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  23195. if (this.myIndex > this.topX) {
  23196. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  23197. }
  23198. else {
  23199. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  23200. }
  23201. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  23202. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  23203. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  23204. }
  23205. updateItemData(data) {
  23206. this.myStar = xGame.common.getAllStarNum();
  23207. if (this.rankList.length < 2) {
  23208. this.rankList = data;
  23209. let self = Moyu.getUserInfo();
  23210. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  23211. self.headIcon = self.headIcon;
  23212. for (let i = 0; i < data.length; i++) {
  23213. let data = this.rankList[i];
  23214. if (data.userId == self.userId) {
  23215. this.rankList.splice(i, 1);
  23216. break;
  23217. }
  23218. }
  23219. for (let i = 0; i < data.length; i++) {
  23220. let data = this.rankList[i];
  23221. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  23222. this.myIndex = i + 1;
  23223. let user = { headIcon: self.headIcon, nickName: "myself" };
  23224. let ud = { user: user, data: {} };
  23225. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  23226. console.log('zh:Moyu.platType = ' + Moyu.platType);
  23227. if (Moyu.platType < 11) {
  23228. user.headIcon = self.headIcon;
  23229. user.nickName = self.nickName;
  23230. }
  23231. this.rankList.splice(i, 0, md);
  23232. break;
  23233. }
  23234. }
  23235. }
  23236. this.updateSelfItem();
  23237. this.ui.myNode.myList.numItems = this.rankList.length;
  23238. }
  23239. updateItemUI(index, obj) {
  23240. let data = this.rankList[index];
  23241. let userData = JSON.parse(data.userData).user;
  23242. obj.nameTxt.text = userData.nickName.toString();
  23243. obj.valueTxt.text = data.rankScore;
  23244. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  23245. obj.rankTxt.text = index + 1;
  23246. switch (index) {
  23247. case 0:
  23248. this.setImg(obj, 1, 0, 0);
  23249. obj.rankTxt.color = "#FFC047";
  23250. break;
  23251. case 1:
  23252. this.setImg(obj, 0, 1, 0);
  23253. obj.rankTxt.color = "#ACACAC";
  23254. break;
  23255. case 2:
  23256. this.setImg(obj, 0, 0, 1);
  23257. obj.rankTxt.color = "#D09672";
  23258. break;
  23259. default:
  23260. this.setImg(obj, 0, 0, 0);
  23261. obj.rankTxt.color = "#496FAB";
  23262. break;
  23263. }
  23264. }
  23265. setImg(obj, a, b, c) {
  23266. obj.img1.visible = a ? true : false;
  23267. obj.img2.visible = b ? true : false;
  23268. obj.img3.visible = c ? true : false;
  23269. }
  23270. changeList(type) {
  23271. this.rankType = type;
  23272. this.updateSelf();
  23273. }
  23274. changeSelfNode() {
  23275. this.showSelf = !this.showSelf;
  23276. this.updateSelf();
  23277. }
  23278. updateSelf() {
  23279. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  23280. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  23281. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23282. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  23283. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23284. }
  23285. }
  23286. UIRanking$1.uiName = "UIRanking";
  23287. class UISecretary$1 extends UIBase {
  23288. constructor() {
  23289. super();
  23290. this.curIndex = 1;
  23291. }
  23292. onConstructor() {
  23293. this.ui = ui_UISecretary.createInstance();
  23294. this.contentPane = this.ui;
  23295. this.isEject = false;
  23296. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23297. this.nodeObj = { left: null, right: null, cur: null };
  23298. this.nodeObj.cur = this.ui.myNode.gameNode3;
  23299. }
  23300. show() {
  23301. super.show();
  23302. this.ui.t0.play();
  23303. this.updateData();
  23304. this.setGlobalFont(this.ui);
  23305. }
  23306. addSecretarySpine(node, spineName) {
  23307. if (spineName == "mishu") {
  23308. if (this.secretarySpine1) {
  23309. node.displayObject.destroyChildren();
  23310. this.playWoman(this.secretarySpine1, node.displayObject);
  23311. }
  23312. else {
  23313. let spine1 = new SpineMgr("mishu", () => {
  23314. this.secretarySpine1 = spine1;
  23315. this.playWoman(this.secretarySpine1, node.displayObject);
  23316. });
  23317. }
  23318. }
  23319. else {
  23320. if (this.secretarySpine2) {
  23321. node.displayObject.destroyChildren();
  23322. this.playWoman(this.secretarySpine2, node.displayObject);
  23323. }
  23324. else {
  23325. let spine2 = new SpineMgr("xiaomishu2", () => {
  23326. this.secretarySpine2 = spine2;
  23327. this.playWoman(this.secretarySpine2, node.displayObject);
  23328. });
  23329. }
  23330. }
  23331. }
  23332. playWoman(node, parent) {
  23333. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  23334. let yy = this.ui.myNode.gameNode3.secretary.height;
  23335. let scale = 1.5;
  23336. if (node == this.secretarySpine2) {
  23337. scale = 1.2;
  23338. }
  23339. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23340. node.play(data, 0, true, parent);
  23341. }
  23342. turnLeft() {
  23343. this.curIndex--;
  23344. if (this.curIndex < 1) {
  23345. this.curIndex = 2;
  23346. }
  23347. let left = this.nodeObj.left;
  23348. let right = this.nodeObj.right;
  23349. let cur = this.nodeObj.cur;
  23350. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23351. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23352. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23353. this.updateData();
  23354. }));
  23355. this.ui.myNode.setChildIndex(right, 2);
  23356. this.nodeObj.left = cur;
  23357. this.nodeObj.right = left;
  23358. this.nodeObj.cur = right;
  23359. }
  23360. turnRight() {
  23361. this.curIndex++;
  23362. if (this.curIndex > 2) {
  23363. this.curIndex = 1;
  23364. }
  23365. let left = this.nodeObj.left;
  23366. let right = this.nodeObj.right;
  23367. let cur = this.nodeObj.cur;
  23368. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23369. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23370. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23371. this.updateData();
  23372. }));
  23373. this.ui.myNode.setChildIndex(left, 2);
  23374. this.nodeObj.left = right;
  23375. this.nodeObj.right = cur;
  23376. this.nodeObj.cur = left;
  23377. }
  23378. updateData() {
  23379. console.log('zh: updateData FFFFFFFFFF');
  23380. let data = cfgTable.secretaryshopData;
  23381. let children = this.ui.myNode._children;
  23382. let temp;
  23383. let curData;
  23384. for (let index = 0; index < children.length; index++) {
  23385. temp = children[index];
  23386. curData = data[1];
  23387. temp.heightTxt.text = curData.height;
  23388. temp.foodTxt.text = curData.food;
  23389. temp.historyTxt.text = curData.history;
  23390. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  23391. this.addSecretarySpine(temp.secretary, curData.spine);
  23392. let womanIndex = curData.id - 1;
  23393. let getWoman = DataMgr.getSecretary(womanIndex);
  23394. let curUse = DataMgr.getCurSecretary();
  23395. if (getWoman) {
  23396. if (curUse == womanIndex) {
  23397. temp.purchaseBtn.c1.selectedIndex = 1;
  23398. }
  23399. else {
  23400. temp.purchaseBtn.c1.selectedIndex = 2;
  23401. }
  23402. }
  23403. else {
  23404. temp.purchaseBtn.c1.selectedIndex = 0;
  23405. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  23406. }
  23407. temp.purchaseBtn.visible = false;
  23408. }
  23409. }
  23410. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  23411. console.log('zh: 点击了clickSecretary ');
  23412. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23413. if (getWoman) {
  23414. if (curUse != womanIndex) {
  23415. console.log();
  23416. DataMgr.setCurSecretary(womanIndex);
  23417. this.updateData();
  23418. }
  23419. }
  23420. else {
  23421. console.log('zh:点击购买了');
  23422. let need = needDiamond;
  23423. if (DataMgr.diamondEnough(need)) {
  23424. DataMgr.setDiamond(-need);
  23425. DataMgr.setSecretary(womanIndex, 1);
  23426. DataMgr.setCurSecretary(womanIndex);
  23427. this.updateData();
  23428. }
  23429. else {
  23430. xGame.uiMgr.Show(UIAddProp$1, 1);
  23431. }
  23432. }
  23433. }
  23434. closeSelf() {
  23435. this.hide();
  23436. }
  23437. }
  23438. UISecretary$1.uiName = "UISecretary";
  23439. class BallRodDisplay$1 {
  23440. constructor(ui, index) {
  23441. this.index = 0;
  23442. this.uiIndex = 0;
  23443. this.ui = ui;
  23444. this.index = index;
  23445. this.initData();
  23446. }
  23447. initData() {
  23448. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  23449. let data = cfgTable.ballrodData[this.index + 1];
  23450. this.ui.nameTxt.text = data.name;
  23451. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  23452. this.ui.levelNode.c1.selectedIndex = data.quality;
  23453. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  23454. if (data.spine) {
  23455. this.mySpine = new SpineMgr(data.spine, () => {
  23456. let xx = 150;
  23457. let yy = 70;
  23458. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  23459. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  23460. });
  23461. }
  23462. }
  23463. updateSelf() {
  23464. let get = DataMgr.getBallRod(this.index);
  23465. if (get == null)
  23466. get = 1;
  23467. let curUse = DataMgr.getCurBallRod();
  23468. if (get) {
  23469. if (curUse == this.index) {
  23470. this.ui.purchaseBtn.c1.selectedIndex = 0;
  23471. }
  23472. else {
  23473. this.ui.purchaseBtn.c1.selectedIndex = 1;
  23474. }
  23475. }
  23476. else {
  23477. this.ui.purchaseBtn.c1.selectedIndex = 2;
  23478. }
  23479. }
  23480. buyBallRod() {
  23481. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23482. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  23483. switch (selectedIndex) {
  23484. case 0:
  23485. break;
  23486. case 1:
  23487. console.log('zh:点击了 USE THIS');
  23488. DataMgr.setCurBallRod(this.index);
  23489. let curUse = DataMgr.getCurBallRod();
  23490. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  23491. let ui = xGame.uiMgr.getUI(UIShop$1);
  23492. ui.updateBallRod();
  23493. break;
  23494. case 2:
  23495. let data = cfgTable.ballrodData[this.index + 1];
  23496. let need = data.price;
  23497. if (DataMgr.diamondEnough(need)) {
  23498. this.buyQiuGan(data);
  23499. DataMgr.setDiamond(-need);
  23500. DataMgr.setBallRod(this.index, 1);
  23501. DataMgr.setCurBallRod(this.index);
  23502. let ui = xGame.uiMgr.getUI(UIShop$1);
  23503. ui.updateBallRod();
  23504. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  23505. }
  23506. else {
  23507. xGame.uiMgr.Show(UIAddProp$1, 1);
  23508. }
  23509. break;
  23510. default:
  23511. break;
  23512. }
  23513. }
  23514. buyQiuGan(qgItem) {
  23515. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  23516. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23517. if (userInfo == null) {
  23518. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23519. return;
  23520. }
  23521. let reqData = xGame.httpMgr.getReqData();
  23522. let pd = JSON.parse(reqData);
  23523. pd.qiuGanData = qgItem;
  23524. reqData = JSON.stringify(pd);
  23525. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23526. try {
  23527. console.log('zh:buySp res = ' + JSON.stringify(res));
  23528. let code = res.code;
  23529. let msg = res.msg;
  23530. if (code == 401) {
  23531. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23532. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23533. return;
  23534. }
  23535. if (code == 200) {
  23536. xGame.uiMgr.Show(UIMsg$1, msg);
  23537. DataMgr.getUserZiChanInfo(false);
  23538. }
  23539. else {
  23540. xGame.uiMgr.Show(UIMsg$1, msg);
  23541. }
  23542. }
  23543. catch (error) {
  23544. console.log('error=' + error);
  23545. alert(error);
  23546. }
  23547. finally {
  23548. }
  23549. });
  23550. }
  23551. logEventForGouMaiGan(qiuGanName) {
  23552. const ev = {
  23553. value: qiuGanName
  23554. };
  23555. const jsonStr = JSON.stringify(ev);
  23556. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23557. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23558. }
  23559. }
  23560. class DaoJuDisplay$1 {
  23561. constructor(ui, index) {
  23562. this.index = 0;
  23563. this.uiIndex = 0;
  23564. this.ggSpid = "";
  23565. this.spid = 0;
  23566. this.ui = ui;
  23567. this.index = index;
  23568. this.initData();
  23569. }
  23570. initData() {
  23571. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23572. let data = cfgTable.daoJuData[this.index + 1];
  23573. this.ui.nameTxt.text = data.spbt;
  23574. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23575. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23576. this.ggSpid = data.ggSpid;
  23577. this.spid = data.spid;
  23578. let baseUrl = "asset/sound/ogg/";
  23579. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23580. }
  23581. gotoBuy() {
  23582. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23583. if (userInfo != null) {
  23584. let token = userInfo.token;
  23585. let ggSpid = this.ggSpid;
  23586. let spid = this.spid;
  23587. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23588. console.log('zh:gotoBuy1 spid =' + spid);
  23589. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23590. return;
  23591. }
  23592. else {
  23593. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23594. }
  23595. }
  23596. gotoBuy1() {
  23597. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23598. let djItem = cfgTable.daoJuData[this.index + 1];
  23599. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23600. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23601. if (userInfo == null) {
  23602. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23603. return;
  23604. }
  23605. let reqData = xGame.httpMgr.getReqData();
  23606. let pd = JSON.parse(reqData);
  23607. pd.spItem = djItem;
  23608. reqData = JSON.stringify(pd);
  23609. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23610. try {
  23611. console.log('zh:buySp res = ' + JSON.stringify(res));
  23612. let code = res.code;
  23613. let msg = res.msg;
  23614. if (code == 401) {
  23615. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23616. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23617. return;
  23618. }
  23619. if (code == 200) {
  23620. xGame.uiMgr.Show(UIMsg$1, msg);
  23621. DataMgr.getUserZiChanInfo(false);
  23622. }
  23623. else {
  23624. xGame.uiMgr.Show(UIMsg$1, msg);
  23625. }
  23626. }
  23627. catch (error) {
  23628. console.log('error=' + error);
  23629. alert(error);
  23630. }
  23631. finally {
  23632. }
  23633. });
  23634. }
  23635. }
  23636. class UIShop$1 extends UIBase {
  23637. constructor() {
  23638. super();
  23639. this.itemNums = 0;
  23640. this.itemNumsForDj = 0;
  23641. this.curType = "";
  23642. }
  23643. onConstructor() {
  23644. this.ui = ui_UIShop.createInstance();
  23645. this.contentPane = this.ui;
  23646. this.isEject = false;
  23647. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23648. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23649. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23650. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23651. this.addUIClick(this.ui, this.interuptSecretary);
  23652. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23653. this.ballRodArr = [];
  23654. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23655. this.ui.myNode.myList.numItems = this.itemNums;
  23656. this.loadDjdata_old();
  23657. }
  23658. loadDjdata_old() {
  23659. let fff = cfgTable.daoJuData;
  23660. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23661. this.daoJuArr = [];
  23662. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23663. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23664. }
  23665. getProductList() {
  23666. let reqData = xGame.httpMgr.getReqData();
  23667. let pd = JSON.parse(reqData);
  23668. pd.splx = "Consumable";
  23669. reqData = JSON.stringify(pd);
  23670. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23671. try {
  23672. let code = res.code;
  23673. let msg = res.msg;
  23674. if (code == 401) {
  23675. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23676. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23677. return;
  23678. }
  23679. if (code == 200) {
  23680. let data = res.data;
  23681. for (let index = 0; index < data.length; index++) {
  23682. let element = data[index];
  23683. cfgTable.daoJuData[element.spid] = element;
  23684. }
  23685. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23686. }
  23687. else {
  23688. xGame.uiMgr.Show(UIMsg, msg);
  23689. }
  23690. }
  23691. catch (error) {
  23692. console.log('error=' + error);
  23693. alert(error);
  23694. }
  23695. finally {
  23696. }
  23697. });
  23698. }
  23699. show(type) {
  23700. super.show();
  23701. this.curType = type == 0 ? "qiugan" : "daoju";
  23702. this.switchBtn("");
  23703. this.playSecretaryIdle();
  23704. this.updateBallRod();
  23705. this.setGlobalFont(this.ui);
  23706. }
  23707. test123() {
  23708. console.log('zh:test123 ');
  23709. }
  23710. switchBtn(type) {
  23711. console.log('zh:1111切換 sel type=' + type);
  23712. if (type == "") {
  23713. type = this.curType;
  23714. }
  23715. else {
  23716. if (this.curType == type) {
  23717. return;
  23718. }
  23719. else {
  23720. this.curType = type;
  23721. }
  23722. }
  23723. if (type == "qiugan") {
  23724. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23725. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23726. this.ui.myNode.c1.selectedIndex = 0;
  23727. this.ui.myNode.myList.visible = true;
  23728. this.ui.myNode.djList.visible = false;
  23729. }
  23730. else {
  23731. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23732. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23733. this.ui.myNode.c1.selectedIndex = 1;
  23734. this.ui.myNode.myList.visible = false;
  23735. this.ui.myNode.djList.visible = true;
  23736. }
  23737. }
  23738. updateBallRod() {
  23739. for (let index = 0; index < this.ballRodArr.length; index++) {
  23740. this.ballRodArr[index].updateSelf();
  23741. }
  23742. }
  23743. renderBallRod(sort, obj) {
  23744. let index = this.getIndexBySort(sort + 1) - 1;
  23745. let ballRod = new BallRodDisplay$1(obj, index);
  23746. this.ballRodArr.push(ballRod);
  23747. }
  23748. renderDaoJu(idx, obj) {
  23749. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23750. let b = new DaoJuDisplay$1(obj, index);
  23751. this.daoJuArr.push(b);
  23752. }
  23753. getIndexBySort(sort) {
  23754. let object = cfgTable.ballrodData;
  23755. for (const key in object) {
  23756. if (object[key].sort == sort) {
  23757. return parseInt(key);
  23758. }
  23759. }
  23760. }
  23761. getIndexBySortForDj(idx) {
  23762. let object = cfgTable.daoJuData;
  23763. for (const key in object) {
  23764. if (object[key].idx == idx) {
  23765. return parseInt(key);
  23766. }
  23767. }
  23768. }
  23769. playSecretaryIdle() {
  23770. let parent = this.ui.secretary.displayObject;
  23771. parent.destroyChildren();
  23772. let xx = this.ui.secretary.width / 2;
  23773. let yy = this.ui.secretary.height;
  23774. let scale = xGame.common.getSecretaryScale();
  23775. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23776. xGame.common.secretary.play(data, 0, true, parent);
  23777. }
  23778. interuptSecretary() {
  23779. Laya.timer.clearAll(this);
  23780. this.playSecretaryRandomSound();
  23781. }
  23782. playSecretaryRandomSound() {
  23783. if (this.isHide)
  23784. return;
  23785. let time = xGame.common.randomNum(45000, 60000);
  23786. Laya.timer.once(time, this, () => {
  23787. if (this.isHide)
  23788. return;
  23789. let index = xGame.common.randomNum(4, 7);
  23790. xGame.soundMgr.playSound("s_main0" + index);
  23791. let words = 1;
  23792. switch (index) {
  23793. case 4:
  23794. words = 5;
  23795. break;
  23796. case 5:
  23797. words = 3;
  23798. break;
  23799. case 6:
  23800. words = 6;
  23801. break;
  23802. case 7:
  23803. words = 7;
  23804. break;
  23805. default:
  23806. break;
  23807. }
  23808. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23809. this.playSecretaryRandomSound();
  23810. });
  23811. }
  23812. closeSelf() {
  23813. this.hide();
  23814. }
  23815. }
  23816. UIShop$1.uiName = "UIShop";
  23817. class SignMax$1 {
  23818. constructor(ui) {
  23819. this.ui = ui;
  23820. }
  23821. updateSelf(index, sameDay, curDayIndex) {
  23822. let data = cfgTable.signData[index + 1];
  23823. this.ui.titleTxt.text = data.title;
  23824. let arr1 = data.award[0].split('-');
  23825. let arr2 = data.award[1].split('-');
  23826. let num1 = parseInt(arr1[1]);
  23827. let num2 = parseInt(arr2[1]);
  23828. this.ui.numTxt1.text = num1 + "";
  23829. this.ui.numTxt2.text = num2 + "";
  23830. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23831. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23832. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23833. this.ui.numTxt1.visible = false;
  23834. }
  23835. else {
  23836. this.ui.numTxt1.visible = true;
  23837. }
  23838. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23839. this.ui.numTxt2.visible = false;
  23840. }
  23841. else {
  23842. this.ui.numTxt2.visible = true;
  23843. }
  23844. if (index < curDayIndex) {
  23845. this.ui.c1.selectedIndex = 1;
  23846. }
  23847. else if (index == curDayIndex) {
  23848. if (sameDay) {
  23849. this.ui.c1.selectedIndex = 2;
  23850. }
  23851. else {
  23852. this.ui.c1.selectedIndex = 2;
  23853. }
  23854. }
  23855. else {
  23856. this.ui.c1.selectedIndex = 0;
  23857. }
  23858. }
  23859. }
  23860. class SignNormal$1 {
  23861. constructor(ui) {
  23862. this.ui = ui;
  23863. }
  23864. updateSelf(index, sameDay, curDayIndex) {
  23865. let data = cfgTable.signData[index + 1];
  23866. this.ui.titleTxt.text = data.title;
  23867. let arr = data.award[0].split('-');
  23868. let type = parseInt(arr[0]);
  23869. let num = parseInt(arr[1]);
  23870. this.ui.numTxt.text = num + "";
  23871. if (type > 2) {
  23872. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23873. this.ui.myIcon.rotation = 0;
  23874. }
  23875. else {
  23876. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23877. this.ui.myIcon.rotation = 0;
  23878. }
  23879. if (xGame.common.signAwardContainsRod(data.award)) {
  23880. this.ui.numTxt.visible = false;
  23881. }
  23882. else {
  23883. this.ui.numTxt.visible = true;
  23884. }
  23885. if (index < curDayIndex) {
  23886. this.ui.c1.selectedIndex = 1;
  23887. }
  23888. else if (index == curDayIndex) {
  23889. if (sameDay) {
  23890. this.ui.c1.selectedIndex = 2;
  23891. }
  23892. else {
  23893. this.ui.c1.selectedIndex = 2;
  23894. }
  23895. }
  23896. else {
  23897. this.ui.c1.selectedIndex = 0;
  23898. }
  23899. }
  23900. }
  23901. class UISign$1 extends UIBase {
  23902. constructor() {
  23903. super();
  23904. this.curDayIndex = 0;
  23905. this.starX = 0;
  23906. }
  23907. onConstructor() {
  23908. this.ui = ui_UISign.createInstance();
  23909. this.contentPane = this.ui;
  23910. this.isEject = false;
  23911. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23912. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23913. this.initSignItem();
  23914. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23915. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23916. }
  23917. show() {
  23918. super.show();
  23919. this.ui.t0.play();
  23920. this.playSecretaryIdle();
  23921. this.updateSign();
  23922. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23923. this.setGlobalFont(this.ui);
  23924. }
  23925. initSignItem() {
  23926. this.signArr = [];
  23927. for (let index = 0; index < 6; index++) {
  23928. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23929. this.signArr.push(temp);
  23930. }
  23931. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23932. if (Moyu.isKs)
  23933. this.ui.closeNode.closeBtn.x += 100;
  23934. }
  23935. updateSign() {
  23936. let sameDay = xGame.common.judgeSameDay();
  23937. let max = 7;
  23938. this.curDayIndex = DataMgr.getSignData();
  23939. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23940. this.curDayIndex = 0;
  23941. if (!sameDay) {
  23942. this.ui.normalBtn.visible = true;
  23943. this.ui.tipsNode.visible = false;
  23944. this.ui.againBtn.visible = false;
  23945. }
  23946. else {
  23947. this.ui.normalBtn.visible = false;
  23948. let again = DataMgr.getExtraSign();
  23949. let isCurrency = false;
  23950. let index = this.curDayIndex;
  23951. if (index == 0)
  23952. index = 7;
  23953. let award = cfgTable.signData[index].award;
  23954. let num = award[0].split("-")[0];
  23955. if (num == "1" || num == "2")
  23956. isCurrency = true;
  23957. let showAgain = again == 0 && isCurrency;
  23958. this.ui.againBtn.visible = showAgain;
  23959. this.ui.tipsNode.visible = !showAgain;
  23960. }
  23961. for (let index = 0; index < this.signArr.length; index++) {
  23962. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23963. }
  23964. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23965. }
  23966. playSecretaryIdle() {
  23967. let parent = this.ui.secretary.displayObject;
  23968. parent.destroyChildren();
  23969. let xx = this.ui.secretary.width / 2;
  23970. let yy = this.ui.secretary.height;
  23971. let scale = xGame.common.getSecretaryScale();
  23972. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23973. xGame.common.secretary.play(data, 0, true, parent);
  23974. }
  23975. closeSelf() {
  23976. this.hide();
  23977. }
  23978. normalGetAward() {
  23979. let sameDay = xGame.common.judgeSameDay();
  23980. if (!sameDay) {
  23981. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23982. let temp;
  23983. let type;
  23984. let num;
  23985. let arr = [];
  23986. for (let index = 0; index < award.length; index++) {
  23987. temp = award[index].split("-");
  23988. type = parseInt(temp[0]);
  23989. num = parseInt(temp[1]);
  23990. let awardType = new AwardType();
  23991. awardType.num = num;
  23992. awardType.type = type;
  23993. arr.push(awardType);
  23994. }
  23995. xGame.common.getAward(arr, (watchVideo) => {
  23996. this.curDayIndex++;
  23997. if (this.curDayIndex > 7)
  23998. this.curDayIndex = 0;
  23999. DataMgr.setSignData(this.curDayIndex);
  24000. this.updateSignData2Server(this.curDayIndex);
  24001. DataMgr.setSignTime(new Date().getTime());
  24002. if (watchVideo) {
  24003. DataMgr.setExtraSign(1);
  24004. Moyu.sendDataEvent("signIn1");
  24005. }
  24006. this.updateSign();
  24007. });
  24008. }
  24009. }
  24010. againGetAward() {
  24011. Moyu.sendDataEvent("signIn2");
  24012. console.log('zh:qjff_AD_for_uisign');
  24013. if (Laya.Browser.onAndroid) {
  24014. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24015. if (!boo) {
  24016. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24017. return;
  24018. }
  24019. }
  24020. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  24021. }
  24022. else {
  24023. console.log('zh:AD 失败,直接发放奖励');
  24024. this.qjff_AD_for_uisign();
  24025. }
  24026. }
  24027. qjff_AD_for_uisign() {
  24028. let index = this.curDayIndex;
  24029. if (index == 0)
  24030. index = 7;
  24031. let award = cfgTable.signData[index].award;
  24032. let temp;
  24033. let type;
  24034. let num;
  24035. for (let index = 0; index < award.length; index++) {
  24036. temp = award[index].split("-");
  24037. type = parseInt(temp[0]);
  24038. num = parseInt(temp[1]) * 3;
  24039. xGame.common.playObjFlyAnim(num, type);
  24040. }
  24041. DataMgr.setExtraSign(1);
  24042. this.updateSign();
  24043. }
  24044. updateSignData2Server(day) {
  24045. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24046. if (userInfo == null) {
  24047. return;
  24048. }
  24049. let reqData = xGame.httpMgr.getReqData();
  24050. let pd = JSON.parse(reqData);
  24051. pd.signData = day;
  24052. reqData = JSON.stringify(pd);
  24053. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  24054. try {
  24055. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  24056. let code = res.code;
  24057. let msg = res.msg;
  24058. if (code == 401) {
  24059. Laya.LocalStorage.removeItem(keyForLoginInfo);
  24060. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24061. return;
  24062. }
  24063. if (code == 200) {
  24064. let data = res.data;
  24065. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  24066. }
  24067. else {
  24068. xGame.uiMgr.Show(UIMsg$1, msg);
  24069. }
  24070. }
  24071. catch (error) {
  24072. console.log('error=' + error);
  24073. alert(error);
  24074. }
  24075. finally {
  24076. }
  24077. });
  24078. }
  24079. }
  24080. UISign$1.uiName = "UISign";
  24081. class UIModeSelection$1 extends UIBase {
  24082. constructor() {
  24083. super();
  24084. }
  24085. onConstructor() {
  24086. this.ui = ui_UIModeSelection.createInstance();
  24087. this.contentPane = this.ui;
  24088. this.isEject = false;
  24089. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  24090. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  24091. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  24092. this.addUIClick(this.ui.closeBtn, this.hide);
  24093. this.peopleArr = [65, 990, 580];
  24094. this.peopleOffest = [5, 10, 10];
  24095. }
  24096. show(callback) {
  24097. this.updateSelf();
  24098. super.show();
  24099. this.ui.t0.play();
  24100. this.callback = callback;
  24101. this.setGlobalFont(this.ui);
  24102. }
  24103. updateSelf() {
  24104. let cfg = cfgTable.modeselectData;
  24105. for (let index = 1; index <= 3; index++) {
  24106. let node = this.ui.myNode["type" + index];
  24107. node.need.text = cfg[index].need;
  24108. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  24109. node.peopleTxt.text = this.getRandPeople(index - 1);
  24110. }
  24111. }
  24112. enterGame(type) {
  24113. console.log('zh: 进入经典模式 type: ' + type);
  24114. xGame.common.classicRoomType = type;
  24115. let cfg = cfgTable.modeselectData[type];
  24116. let need = cfg.need;
  24117. xGame.common.passAwardCoin = cfg.award;
  24118. if (DataMgr.coinEnough(need)) {
  24119. DataMgr.setCoin(-need);
  24120. this.ui.myNode["type" + type].t0.play();
  24121. Laya.timer.once(200, this, () => {
  24122. this.callback && this.callback();
  24123. });
  24124. this.logEventForClassic_start();
  24125. }
  24126. else {
  24127. Moyu.sendDataEvent("AddCoinVideo");
  24128. xGame.uiMgr.Show(UIAddProp$1, 0);
  24129. }
  24130. }
  24131. getRandPeople(index) {
  24132. let rand = this.peopleOffest[index];
  24133. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  24134. }
  24135. logEventForClassic_start() {
  24136. let rtype = xGame.common.classicRoomType;
  24137. let msmc = '';
  24138. if (rtype == 1) {
  24139. msmc = 'beginner';
  24140. }
  24141. if (rtype == 2) {
  24142. msmc = 'expert';
  24143. }
  24144. if (rtype == 3) {
  24145. msmc = 'master';
  24146. }
  24147. let keyStr = 'sjmd_classic_start_' + rtype;
  24148. let jsonStr = {
  24149. "difficulty": msmc,
  24150. "classic_count": 1,
  24151. "difficulty_count": 1
  24152. };
  24153. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24154. const d = LocalStorageManager.getItem(keyStr);
  24155. jsonStr.classic_count = d.classic_count + 1;
  24156. jsonStr.difficulty_count = d.difficulty_count + 1;
  24157. LocalStorageManager.setItem(keyStr, jsonStr);
  24158. }
  24159. else {
  24160. LocalStorageManager.setItem(keyStr, jsonStr);
  24161. }
  24162. const reqStr = JSON.stringify(jsonStr);
  24163. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  24164. }
  24165. }
  24166. UIModeSelection$1.uiName = "UIModeSelection";
  24167. class UILogin$1 extends UIBase {
  24168. constructor() {
  24169. super();
  24170. this.fontStr = 'big-john-woff2-2';
  24171. try {
  24172. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24173. console.log("zh: constructor加载arial字体成功");
  24174. }
  24175. catch (error) {
  24176. console.log("zh: constructor加载arial字体失败");
  24177. }
  24178. }
  24179. onFontLoaded() {
  24180. try {
  24181. Laya.Text.defaultFont = this.fontStr;
  24182. this.ui.txt_ua.font = this.fontStr;
  24183. this.ui.txt_up.font = this.fontStr;
  24184. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24185. }
  24186. catch (error) {
  24187. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24188. }
  24189. }
  24190. onConstructor() {
  24191. this.ui = ui_UILogin.createInstance();
  24192. this.contentPane = this.ui;
  24193. this.isEject = false;
  24194. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24195. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  24196. this.addUIClick(this.ui.btn_login, this.userLogin);
  24197. }
  24198. show() {
  24199. super.show();
  24200. this.x = (Laya.stage.width - this.width) / 2;
  24201. this.y = (Laya.stage.height - this.height) / 2;
  24202. this.onFontLoaded();
  24203. }
  24204. closeSelf() {
  24205. this.hide();
  24206. }
  24207. userLogin() {
  24208. let ua = this.ui.txt_ua.text;
  24209. let up = this.ui.txt_up.text;
  24210. console.log('zh:ua font' + this.ui.txt_ua.font);
  24211. if (ua && up) {
  24212. let reqData = JSON.stringify({
  24213. username: ua.trim(),
  24214. password: up.trim(),
  24215. fromMark: 'app_game'
  24216. });
  24217. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  24218. try {
  24219. console.log('zh:res = ' + JSON.stringify(res));
  24220. let code = res.code;
  24221. let msg = res.msg;
  24222. if (code == 200) {
  24223. let keyStr = keyForLoginInfo;
  24224. let jsonStr = {
  24225. "username": res.username,
  24226. "token": res.token,
  24227. "buySpids": { 1: false, 7: false }
  24228. };
  24229. LocalStorageManager.setItem(keyStr, jsonStr);
  24230. let myu = Moyu.getUserInfo();
  24231. console.log('zh:myu = ' + JSON.stringify(myu));
  24232. DataMgr.updateUserNickName(res.username);
  24233. Moyu.updateUserInfo(res.username);
  24234. xGame.uiMgr.Show(UIMsg$1, msg);
  24235. DataMgr.loadUserSpOrderForAd();
  24236. DataMgr.getUserZiChanInfo(false);
  24237. xGame.eventMgr.event(LOGIN_IN);
  24238. this.closeSelf();
  24239. }
  24240. else {
  24241. xGame.uiMgr.Show(UIMsg$1, msg);
  24242. }
  24243. }
  24244. catch (error) {
  24245. console.log('error=' + error);
  24246. alert(error);
  24247. }
  24248. finally {
  24249. }
  24250. });
  24251. }
  24252. else {
  24253. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24254. }
  24255. }
  24256. gotoRegPage() {
  24257. this.closeSelf();
  24258. xGame.uiMgr.Show(UIReg$1);
  24259. }
  24260. }
  24261. UILogin$1.uiName = "UILogin";
  24262. class UIReg$1 extends UIBase {
  24263. constructor() {
  24264. super();
  24265. this.fontStr = 'big-john-woff2-2';
  24266. try {
  24267. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24268. console.log("zh: constructor加载arial字体成功");
  24269. }
  24270. catch (error) {
  24271. console.log("zh: constructor加载arial字体失败");
  24272. }
  24273. }
  24274. onFontLoaded() {
  24275. try {
  24276. Laya.Text.defaultFont = this.fontStr;
  24277. this.ui.txt_ua.font = this.fontStr;
  24278. this.ui.txt_up1.font = this.fontStr;
  24279. this.ui.txt_up2.font = this.fontStr;
  24280. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24281. }
  24282. catch (error) {
  24283. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24284. }
  24285. }
  24286. onConstructor() {
  24287. this.ui = ui_UIReg.createInstance();
  24288. this.contentPane = this.ui;
  24289. this.isEject = false;
  24290. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24291. this.addUIClick(this.ui.btn_reg, this.regUser);
  24292. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  24293. }
  24294. show() {
  24295. super.show();
  24296. this.x = (Laya.stage.width - this.width) / 2;
  24297. this.y = (Laya.stage.height - this.height) / 2;
  24298. this.onFontLoaded();
  24299. }
  24300. closeSelf() {
  24301. this.hide();
  24302. }
  24303. regUser() {
  24304. this.ui.lab_tip.visible = false;
  24305. let ua = this.ui.txt_ua.text;
  24306. let up1 = this.ui.txt_up1.text;
  24307. let up2 = this.ui.txt_up2.text;
  24308. if (ua && up1 && up2 && up1 == up2) {
  24309. let reqData = JSON.stringify({
  24310. username: ua.trim(),
  24311. password: up1.trim(),
  24312. fromMark: 'app_game'
  24313. });
  24314. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  24315. try {
  24316. console.log('zh:res = ' + JSON.stringify(res));
  24317. let code = res.code;
  24318. let msg = res.msg;
  24319. xGame.uiMgr.Show(UIMsg$1, msg);
  24320. if (code == 200) {
  24321. this.ui.lab_tip.color = "#FFFFFF";
  24322. xGame.uiMgr.Show(UIMsg$1, msg);
  24323. this.closeSelf();
  24324. }
  24325. else {
  24326. this.ui.lab_tip.color = "#FF0000";
  24327. xGame.uiMgr.Show(UIMsg$1, msg);
  24328. }
  24329. }
  24330. catch (error) {
  24331. console.log('error=' + error);
  24332. alert(error);
  24333. }
  24334. finally {
  24335. }
  24336. });
  24337. }
  24338. else {
  24339. if (up1 != up2) {
  24340. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  24341. }
  24342. else {
  24343. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24344. }
  24345. }
  24346. }
  24347. gotoLogin() {
  24348. this.closeSelf();
  24349. xGame.uiMgr.Show(UILogin$1);
  24350. }
  24351. }
  24352. UIReg$1.uiName = "UIReg";
  24353. class UITry$1 extends UIBase {
  24354. constructor() {
  24355. super();
  24356. this.closeTime = 0;
  24357. this.closeNum = 0;
  24358. this.skillUrl = xGame.common.skillIconList;
  24359. }
  24360. onConstructor() {
  24361. this.ui = ui_UITry.createInstance();
  24362. this.contentPane = this.ui;
  24363. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  24364. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  24365. }
  24366. show() {
  24367. super.show();
  24368. this.closeNum = 0;
  24369. this.closeTime = 15;
  24370. this.ui.t0.play();
  24371. PlatMgr.showRateBanner();
  24372. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24373. Laya.timer.loop(1000, this, this.updateTime);
  24374. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  24375. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  24376. xGame.common.gameMgr.gamePause = true;
  24377. this.setGlobalFont(this.ui);
  24378. }
  24379. updateTime() {
  24380. if (this.closeTime > 1) {
  24381. this.closeTime--;
  24382. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24383. }
  24384. else
  24385. this.hide();
  24386. }
  24387. hide() {
  24388. Laya.timer.clearAll(this);
  24389. Moyu.showBannerAd(false);
  24390. super.hide();
  24391. xGame.common.gameMgr.gamePause = false;
  24392. }
  24393. onTry() {
  24394. console.log('zh:qjff_AD_for_uitry');
  24395. if (Laya.Browser.onAndroid) {
  24396. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24397. if (!boo) {
  24398. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24399. return;
  24400. }
  24401. }
  24402. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  24403. }
  24404. else {
  24405. console.log('zh:AD 失败,直接发放奖励');
  24406. this.qjff_AD_for_uitry();
  24407. }
  24408. }
  24409. qjff_AD_for_uitry() {
  24410. let select = xGame.common.curPlayerSkillType;
  24411. DataMgr.gameData.trySkill = select;
  24412. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24413. DataMgr.saveGameData();
  24414. DataMgr.setBigSkill(select, 1);
  24415. xGame.showTip("Trial Successful");
  24416. this.hide();
  24417. }
  24418. onCancel() {
  24419. if (this.closeNum > 0) {
  24420. this.closeNum--;
  24421. if (this.closeNum < 2)
  24422. this.hide();
  24423. return;
  24424. }
  24425. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24426. this.onTry();
  24427. }
  24428. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24429. this.closeNum = 3;
  24430. }
  24431. else
  24432. this.hide();
  24433. }
  24434. }
  24435. UITry$1.uiName = "UITry";
  24436. class UIGetAward$1 extends UIBase {
  24437. constructor() {
  24438. super();
  24439. this.showTriple = true;
  24440. }
  24441. onConstructor() {
  24442. this.ui = ui_UIGetAward.createInstance();
  24443. this.contentPane = this.ui;
  24444. this.isEject = false;
  24445. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24446. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24447. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24448. }
  24449. show(arr, showTriple, callback) {
  24450. super.show();
  24451. this.ui.t0.play();
  24452. this.ui.eftNode.visible = true;
  24453. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24454. this.ui.eftNode.visible = false;
  24455. }), 1, 0, 0, 0.9);
  24456. this.awardArr = arr;
  24457. this.showTriple = showTriple;
  24458. this.callback = callback;
  24459. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24460. this.ui.myList.numItems = arr.length;
  24461. xGame.soundMgr.playSound("getaward");
  24462. this.setGlobalFont(this.ui);
  24463. }
  24464. updateSelf(index, obj) {
  24465. let temp = this.awardArr[index];
  24466. let icon = this.getIcon(temp.type);
  24467. let str = icon;
  24468. if (temp.type > 2) {
  24469. str = "s" + icon;
  24470. }
  24471. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24472. obj.myIcon.rotation = 0;
  24473. obj.numTxt.text = temp.num + "";
  24474. obj.numTxt.visible = temp.type > 2 ? false : true;
  24475. obj.nameTxt.text = this.getNameStr(temp.type);
  24476. }
  24477. renderItem(index, obj) {
  24478. this.updateSelf(index, obj);
  24479. }
  24480. tripleGetAward() {
  24481. console.log('zh:qjff_AD_for_uigetAward');
  24482. if (Laya.Browser.onAndroid) {
  24483. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24484. if (!boo) {
  24485. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24486. return;
  24487. }
  24488. }
  24489. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24490. }
  24491. else {
  24492. console.log('zh:AD 失败,直接发放奖励');
  24493. this.qjff_AD_for_uigetAward();
  24494. }
  24495. }
  24496. qjff_AD_for_uigetAward() {
  24497. this.getAward(3);
  24498. }
  24499. normalGetAward() {
  24500. if (PlatMgr.isMisVideo())
  24501. this.tripleGetAward();
  24502. else
  24503. this.getAward();
  24504. }
  24505. getAward(times = 1) {
  24506. this.hide();
  24507. for (let index = 0; index < this.awardArr.length; index++) {
  24508. this.awardArr[index].num *= times;
  24509. }
  24510. this.callback && this.callback(times != 1);
  24511. }
  24512. getIcon(type) {
  24513. switch (type) {
  24514. case Prop.diamond:
  24515. return "ty_zs";
  24516. case Prop.coin:
  24517. return "ty_jb";
  24518. case Prop.gan1:
  24519. return "qg1";
  24520. case Prop.gan2:
  24521. return "qg2";
  24522. case Prop.gan3:
  24523. return "qg3";
  24524. case Prop.gan4:
  24525. return "qg4";
  24526. default:
  24527. break;
  24528. }
  24529. }
  24530. getNameStr(type) {
  24531. switch (type) {
  24532. case Prop.diamond:
  24533. return "Diamond";
  24534. case Prop.coin:
  24535. return "Coins";
  24536. case Prop.gan1:
  24537. case Prop.gan2:
  24538. case Prop.gan3:
  24539. case Prop.gan4:
  24540. return cfgTable.ballrodData[type - 1].name;
  24541. default:
  24542. break;
  24543. }
  24544. }
  24545. }
  24546. UIGetAward$1.uiName = "UIGetAward";
  24547. class UIBox$1 extends UIBase {
  24548. constructor() {
  24549. super();
  24550. this.boxNum = 0;
  24551. this.boxMax = 10;
  24552. this.inAd = false;
  24553. this.isClose = false;
  24554. }
  24555. onConstructor() {
  24556. this.ui = ui_UIBox.createInstance();
  24557. this.contentPane = this.ui;
  24558. this.isEject = false;
  24559. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24560. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24561. Laya.timer.loop(1000, this, this.update);
  24562. }
  24563. update() {
  24564. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24565. this.boxNum -= 1;
  24566. this.upBar();
  24567. }
  24568. }
  24569. upBar() {
  24570. if (this.boxNum > this.boxMax)
  24571. this.boxNum = this.boxMax;
  24572. this.ui.bar.value = this.boxNum * 10;
  24573. }
  24574. show() {
  24575. super.show();
  24576. this.isClose = false;
  24577. this.boxNum = 0;
  24578. this.inAd = false;
  24579. this.upBar();
  24580. this.ui.t0.play();
  24581. this.ui.closeBtn.visible = false;
  24582. Laya.timer.once(3000, this, () => {
  24583. this.ui.closeBtn.visible = true;
  24584. this.ui.bar.alpha = 1;
  24585. });
  24586. Laya.timer.once(500, this, () => {
  24587. this.ui.t1.play();
  24588. });
  24589. this.setGlobalFont(this.ui);
  24590. }
  24591. hide() {
  24592. Laya.timer.clearAll(this);
  24593. Moyu.showBannerAd(false);
  24594. super.hide();
  24595. }
  24596. onOpenBox() {
  24597. this.boxNum++;
  24598. if (this.boxNum < this.boxMax) {
  24599. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24600. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24601. }
  24602. }
  24603. else if (this.boxNum == this.boxMax) {
  24604. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24605. this.ui.openBtn.c1.selectedIndex = 13;
  24606. this.inAd = true;
  24607. }
  24608. else
  24609. this.getAward();
  24610. }
  24611. else if (this.inAd) {
  24612. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24613. if (Laya.Browser.onAndroid) {
  24614. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24615. if (!boo) {
  24616. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24617. return;
  24618. }
  24619. }
  24620. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24621. }
  24622. else {
  24623. console.log('zh:AD 失败,直接发放奖励');
  24624. this.qjff_AD_for_UIBOX_onOpenBox();
  24625. }
  24626. }
  24627. this.upBar();
  24628. }
  24629. qjff_AD_for_UIBOX_onOpenBox() {
  24630. this.getAward();
  24631. }
  24632. onCloseBox() {
  24633. if (this.isClose)
  24634. this.hide();
  24635. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24636. this.isClose = true;
  24637. PlatMgr.showBanner(true, 0, 3000);
  24638. }
  24639. else
  24640. this.hide();
  24641. }
  24642. getAward() {
  24643. let str = "";
  24644. if (Math.random() < 0.5) {
  24645. let max = Moyu.isLegal ? 500 : 2500;
  24646. let num = xGame.tools.random(max, 500 + max);
  24647. DataMgr.setCoin(num);
  24648. str = "金币x" + num;
  24649. }
  24650. else {
  24651. let max = Moyu.isLegal ? 10 : 30;
  24652. let num = xGame.tools.random(max, 30 + max);
  24653. DataMgr.setDiamond(num);
  24654. str = "钻石x" + num;
  24655. }
  24656. xGame.showTip("恭喜获得-" + str);
  24657. this.hide();
  24658. }
  24659. }
  24660. UIBox$1.uiName = "UIBox";
  24661. class UIMain$1 extends UIBase {
  24662. constructor() {
  24663. super();
  24664. this.firstEnter = true;
  24665. this.moni_click_count = 0;
  24666. }
  24667. nativeCallJs(msg) {
  24668. let t = msg;
  24669. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24670. switch (t) {
  24671. case 'qjff_chouJiang':
  24672. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24673. dui.qjff_chouJiang();
  24674. break;
  24675. case 'qjff_AD_for_uisign':
  24676. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24677. dui2.qjff_AD_for_uisign();
  24678. break;
  24679. case 'qjff_AD_for_uitry':
  24680. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24681. dui3.qjff_AD_for_uitry();
  24682. break;
  24683. case 'qjff_AD_for_uipower':
  24684. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24685. dui4.qjff_AD_for_uipower();
  24686. break;
  24687. case 'qjff_AD_for_uigetAward':
  24688. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24689. dui5.qjff_AD_for_uigetAward();
  24690. break;
  24691. case 'qjff_AD_for_uiGameEnd':
  24692. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24693. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24694. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24695. break;
  24696. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24697. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24698. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24699. break;
  24700. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24701. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24702. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24703. break;
  24704. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24705. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24706. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24707. break;
  24708. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24709. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24710. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24711. break;
  24712. case 'qjff_AD_for_UIBOX_onOpenBox':
  24713. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24714. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24715. break;
  24716. case 'qjff_AD_for_UIAddCoin':
  24717. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24718. dui12.qjff_AD_for_UIAddCoin();
  24719. break;
  24720. case 'app_sign_for_buyProduct_onSuccess':
  24721. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24722. DataMgr.getUserZiChanInfo(false);
  24723. break;
  24724. case '222axxxxxx':
  24725. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24726. dui15.qjff_AD_for_uisign();
  24727. break;
  24728. case '333axsxxxxxx':
  24729. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24730. dui16.qjff_AD_for_uisign();
  24731. break;
  24732. default:
  24733. console.log('zh:未知的方法名字' + t);
  24734. break;
  24735. }
  24736. }
  24737. onConstructor() {
  24738. console.log('zh: UIMain onConstructor');
  24739. this.ui = ui_UIMain.createInstance();
  24740. this.contentPane = this.ui;
  24741. this.isEject = false;
  24742. this.addEvent();
  24743. this.addClickSpine();
  24744. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24745. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24746. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24747. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24748. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24749. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24750. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24751. let curUse = DataMgr.getCurSecretary();
  24752. this.changeSecretary(curUse);
  24753. this.ui.talkNode.visible = false;
  24754. let guide = DataMgr.getSkillGuide();
  24755. if (xGame.common.isNewDay && guide == 1) {
  24756. xGame.common.isNewDay = false;
  24757. xGame.soundMgr.playSound("s_main01");
  24758. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24759. console.log("zh:播放小秘书每天语音");
  24760. }
  24761. this.onGetUserInfo();
  24762. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24763. DataMgr.getUserZiChanInfo(false);
  24764. }
  24765. this.ui.n83.visible = false;
  24766. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24767. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24768. let ua = d.username;
  24769. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24770. }
  24771. this.c_btn_for_user();
  24772. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24773. }
  24774. Logout() {
  24775. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24776. LocalStorageManager.removeItem(keyForLoginInfo);
  24777. this.freshUser();
  24778. }
  24779. JSBridgeUtils.instance.loginOutForApp();
  24780. this.setUserDefaultNickname();
  24781. DataMgr.setCoin2(4000);
  24782. DataMgr.setDiamond2(0);
  24783. this.setDefaultQiuGanInfo();
  24784. DataMgr.setPlaceBallLevelList("");
  24785. DataMgr.setChallengeMode_overLev(1);
  24786. this.setDefaultSignData();
  24787. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  24788. }
  24789. setDefaultSignData() {
  24790. DataMgr.setSignData(1);
  24791. DataMgr.setSignTime(new Date().getTime());
  24792. }
  24793. setDefaultQiuGanInfo() {
  24794. DataMgr.setBallRod(0, 1);
  24795. DataMgr.setBallRod(1, 0);
  24796. DataMgr.setBallRod(2, 0);
  24797. DataMgr.setBallRod(3, 0);
  24798. DataMgr.setBallRod(4, 0);
  24799. DataMgr.setBallRod(5, 1);
  24800. }
  24801. setUserDefaultNickname() {
  24802. let defUsername = "player";
  24803. this.ui.headNode.nameTxt.text = defUsername;
  24804. DataMgr.updateUserNickName(defUsername);
  24805. Moyu.updateUserInfo(defUsername);
  24806. }
  24807. gotoLogin() {
  24808. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24809. xGame.uiMgr.Show(UILogin$1);
  24810. }
  24811. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24812. this.Logout();
  24813. }
  24814. }
  24815. gotoRegUser() {
  24816. xGame.uiMgr.Show(UIReg$1);
  24817. }
  24818. showFuLiSp1() {
  24819. console.log('zh:福利1');
  24820. DataMgr.checkForShowFuLi17AndAlert(1);
  24821. }
  24822. showFuLiSp7() {
  24823. console.log('zh:福利7');
  24824. DataMgr.checkForShowFuLi17AndAlert(7);
  24825. }
  24826. c_btn_for_user() {
  24827. this.ui.n_dengLu.c1.selectedIndex = 0;
  24828. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24829. this.ui.n_dengLu.c1.selectedIndex = 1;
  24830. }
  24831. else {
  24832. this.ui.n_dengLu.c1.selectedIndex = 0;
  24833. }
  24834. }
  24835. changeSecretary(curUse) {
  24836. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24837. xGame.common.secretary && xGame.common.secretary.dispose();
  24838. this.addSecretarySpine(name);
  24839. }
  24840. addSecretarySpine(name) {
  24841. let spine = new SpineMgr(name, () => {
  24842. this.playSecretaryIdle();
  24843. });
  24844. xGame.common.secretary = spine;
  24845. }
  24846. addClickSpine() {
  24847. let clickSpine = new SpineMgr("dianji", () => {
  24848. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24849. let parent = Laya.stage;
  24850. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24851. clickSpine.play(data, 0, false, parent, (spine) => {
  24852. spine.destroy(true);
  24853. });
  24854. });
  24855. });
  24856. }
  24857. addEvent() {
  24858. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24859. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24860. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24861. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24862. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24863. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24864. this.addUIClick(this.ui, this.interuptSecretary);
  24865. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24866. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24867. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24868. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24869. this.addUIClick(this.ui.signBtn, this.openSignView);
  24870. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24871. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24872. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  24873. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  24874. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24875. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24876. }
  24877. show(showFailWords) {
  24878. super.show();
  24879. DataMgr.loadUserSpOrderForAd();
  24880. this.moneyNode.ui.c1.selectedIndex = 1;
  24881. this.playSecretaryIdle();
  24882. xGame.soundMgr.playMusic("caromhall01", 0);
  24883. Laya.timer.clearAll(this);
  24884. this.playSecretaryRandomSound();
  24885. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24886. if (showFailWords) {
  24887. console.log('zh:uimain.ts ');
  24888. setTimeout(() => {
  24889. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24890. let words = -1;
  24891. if (str == "s_main02") {
  24892. words = 2;
  24893. }
  24894. else {
  24895. words = 3;
  24896. }
  24897. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24898. xGame.soundMgr.playSound(str);
  24899. }, 300);
  24900. }
  24901. this.showGuide();
  24902. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24903. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24904. let guide = DataMgr.getSkillGuide();
  24905. if (guide == 1) {
  24906. let randTime = xGame.common.randomNum(300, 800);
  24907. if (this.firstEnter) {
  24908. console.log("zh: firstEnter");
  24909. this.firstEnter = false;
  24910. randTime += 900;
  24911. }
  24912. else {
  24913. console.log("zh: no firstEnter");
  24914. }
  24915. Laya.timer.once(randTime, this, () => {
  24916. });
  24917. Laya.timer.once(1000, this, () => {
  24918. console.log('zh: 1秒后 showFuLiSp7');
  24919. this.showFuLiSp7();
  24920. });
  24921. this.showTipForGuest();
  24922. }
  24923. this.setGlobalFont(this.ui);
  24924. this.yinDaoForLianxi();
  24925. }
  24926. yinDaoForLianxi() {
  24927. let g = DataMgr.getSkillGuide();
  24928. if (g === 0) {
  24929. console.log('zh:默认的引导还没有完毕');
  24930. return;
  24931. }
  24932. let lianXiGuide = DataMgr.getLianXiGuide();
  24933. if (lianXiGuide == 0) {
  24934. let x = this.ui.placeBallBtn.x;
  24935. let y = this.ui.placeBallBtn.y;
  24936. this.ui.n_yd_challenge_1.visible = true;
  24937. this.ui.n_yd_challenge_1_hand.x = x + 150;
  24938. this.ui.n_yd_challenge_1_hand.y = y;
  24939. this.ui.n_yd_challenge_1_btn.x = x;
  24940. this.ui.n_yd_challenge_1_btn.y = y;
  24941. console.log('zh:yinDaoForLianxi set ok');
  24942. }
  24943. else {
  24944. this.ui.n_yd_challenge_1.visible = false;
  24945. }
  24946. }
  24947. showTipForGuest() {
  24948. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24949. if (userInfo == null) {
  24950. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  24951. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  24952. let woman = "this is an important notice.";
  24953. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  24954. return;
  24955. }
  24956. }
  24957. checkActive(show) {
  24958. }
  24959. showGuide() {
  24960. let guide = DataMgr.getSkillGuide();
  24961. this.ui.guideBtn.visible = guide == 0;
  24962. this.ui.enterGuide.visible = false;
  24963. this.ui.secretaryGuide.visible = guide == 0;
  24964. if (guide == 0) {
  24965. console.log("zh:显示引导");
  24966. xGame.soundMgr.playSound("s_guide");
  24967. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24968. }
  24969. else {
  24970. console.log("zh:不需要显示引导");
  24971. }
  24972. }
  24973. ensureSecretary() {
  24974. console.log('zh: ensureSecretary ');
  24975. this.ui.secretaryGuide.visible = false;
  24976. this.ui.enterGuide.visible = true;
  24977. this.ui.wordsNode.t0.play();
  24978. if (DataMgr.getNewUser())
  24979. Moyu.sendDataEvent("gameReady");
  24980. }
  24981. playSecretaryIdle() {
  24982. let parent = this.ui.secretary.displayObject;
  24983. parent.destroyChildren();
  24984. let xx = this.ui.secretary.width / 2;
  24985. let yy = this.ui.secretary.height;
  24986. let scale = xGame.common.getSecretaryScale();
  24987. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24988. xGame.common.secretary.play(data, 0, true, parent);
  24989. }
  24990. startGame(type) {
  24991. if (!this.isReadyForLoadNetSource()) {
  24992. return;
  24993. }
  24994. xGame.common.gameMode = type;
  24995. Moyu.sendDataEvent("PlayGame", { type: type });
  24996. let gm = xGame.common.gameMode;
  24997. console.log('zh:进入游戏gameMode =' + gm);
  24998. switch (gm) {
  24999. case GameMode.classic:
  25000. console.log('zh:进入经典模式111111111');
  25001. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  25002. let db_over_lev = DataMgr.getChallengeMode_overLev();
  25003. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  25004. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  25005. console.log('zh:判断是否可以玩该模式classic =NO');
  25006. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  25007. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25008. return;
  25009. }
  25010. else {
  25011. console.log('zh:可以玩该模式classic');
  25012. this.beginGame();
  25013. }
  25014. }
  25015. else {
  25016. console.log('zh:不需要判断是否可以玩该classic');
  25017. let challengeTimes = DataMgr.getChallengeTimes();
  25018. if (challengeTimes == 0) {
  25019. xGame.uiMgr.Show(UIInvitation$1);
  25020. }
  25021. else {
  25022. this.beginGame();
  25023. }
  25024. }
  25025. break;
  25026. case GameMode.bigMove:
  25027. console.info('zh:bigMove check 大招');
  25028. let guide = DataMgr.getSkillGuide();
  25029. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  25030. let db_over_lev = DataMgr.getChallengeMode_overLev();
  25031. console.log('zh:bigMove db_over_lev=', db_over_lev);
  25032. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  25033. console.log('zh:提示不可以玩');
  25034. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  25035. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25036. return;
  25037. }
  25038. else {
  25039. console.log('zh:可以玩该模式 bigMove');
  25040. this.beginGame();
  25041. if (DataMgr.getNewUser())
  25042. Moyu.sendDataEvent("gameStart0");
  25043. }
  25044. }
  25045. else {
  25046. this.beginGame();
  25047. if (DataMgr.getNewUser())
  25048. Moyu.sendDataEvent("gameStart0");
  25049. }
  25050. break;
  25051. default:
  25052. console.error('zh:未知错误!!!!');
  25053. break;
  25054. }
  25055. }
  25056. beginGame(isNice = false) {
  25057. console.log('zh:beginGame ');
  25058. let guide = DataMgr.getSkillGuide();
  25059. if (guide == 1) {
  25060. console.log('zh:非新手引导,showInternAd ');
  25061. JSBridgeUtils.instance.showInternAd('beginGame');
  25062. }
  25063. else {
  25064. console.log('zh:新手引导,不显示AD ');
  25065. }
  25066. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  25067. console.log('zh:beginGame 1');
  25068. if (xGame.common.gameMode == GameMode.classic) {
  25069. console.log('zh:beginGame 2');
  25070. if (isNice) {
  25071. console.log('zh:进入巅峰赛');
  25072. this.enterClassic();
  25073. }
  25074. else {
  25075. console.log('zh:beginGame 3-1');
  25076. xGame.uiMgr.Show(UIModeSelection$1, () => {
  25077. console.log('zh:beginGame 3-2');
  25078. this.enterClassic();
  25079. });
  25080. }
  25081. }
  25082. else if (xGame.common.gameMode == GameMode.bigMove) {
  25083. console.log('zh:beginGame 5');
  25084. this.ui.enterGuide.visible = false;
  25085. xGame.uiMgr.Show(UISkill$1);
  25086. }
  25087. }
  25088. enterClassic() {
  25089. console.log('zh:beginGame 7');
  25090. xGame.uiMgr.Show(UIGame$1);
  25091. xGame.uiMgr.Show(UIMatching$1, () => {
  25092. if (!this.isHide)
  25093. this.hide();
  25094. xGame.common.gameUI.ui.alpha = 1;
  25095. console.log('zh:beginGame 8');
  25096. xGame.common.gameUI.startGame();
  25097. xGame.uiMgr.Hide(UIGameEnd$1);
  25098. });
  25099. }
  25100. start_debug_for_moni_payOk() {
  25101. let ccc = this.moni_click_count + 1;
  25102. this.moni_click_count = ccc;
  25103. if (ccc % 5 == 0) {
  25104. console.log('zh:start_debug_for_moni_payOk');
  25105. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  25106. if (userInfo != null) {
  25107. let token = userInfo.token;
  25108. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  25109. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  25110. alert('模拟支付OK');
  25111. return;
  25112. }
  25113. else {
  25114. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  25115. }
  25116. }
  25117. }
  25118. startGlobal() {
  25119. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  25120. }
  25121. startWeekly() {
  25122. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  25123. }
  25124. zhouSaiMonth() {
  25125. console.log('zh: zhouSaiMonth 被调用');
  25126. }
  25127. isReadyForLoadNetSource() {
  25128. let reqCount = xGame.cfgMgr.httpReqCount;
  25129. let ok = xGame.cfgMgr.httpReqOkCount;
  25130. if (reqCount > ok) {
  25131. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  25132. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  25133. Laya.timer.once(5000, this, () => {
  25134. let retryCount = 0;
  25135. const maxRetries = 3;
  25136. const tryFetchConfig = () => {
  25137. try {
  25138. xGame.cfgMgr.getConfigFromServer();
  25139. }
  25140. catch (error) {
  25141. if (retryCount < maxRetries) {
  25142. retryCount++;
  25143. console.log(`🔄 第${retryCount}次重试获取配置...`);
  25144. Laya.timer.once(5000, this, tryFetchConfig);
  25145. }
  25146. else {
  25147. console.error("❌ 达到最大重试次数,配置获取失败");
  25148. }
  25149. }
  25150. };
  25151. tryFetchConfig();
  25152. });
  25153. return false;
  25154. }
  25155. return true;
  25156. }
  25157. startPlaceBall() {
  25158. if (!this.isReadyForLoadNetSource()) {
  25159. return;
  25160. }
  25161. xGame.uiMgr.Show(UILevelDisplay$1);
  25162. }
  25163. hide() {
  25164. console.log('zh:uimain hide ...');
  25165. super.hide();
  25166. xGame.common.stopGirlPop(this.ui.talkNode);
  25167. }
  25168. onGetUserInfo(force = false) {
  25169. if (Moyu.isWx) {
  25170. let info = Moyu.getSystemInfo();
  25171. if (info)
  25172. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  25173. }
  25174. else {
  25175. Moyu.initUser(this, this.freshUser, force);
  25176. }
  25177. this.freshUser();
  25178. console.log('zh:5秒后更新用户信息');
  25179. setTimeout(() => {
  25180. DataMgr.getUserZiChanInfo(true);
  25181. }, 5000);
  25182. }
  25183. event_login_in() {
  25184. console.log("zh:event_login_in被触发");
  25185. this.freshUser();
  25186. }
  25187. freshUser() {
  25188. let user = Moyu.getUserInfo();
  25189. if (!user.isAuth) {
  25190. user.headIcon = 'res/ty_touxiang.png';
  25191. }
  25192. else {
  25193. DataMgr.upRankData();
  25194. }
  25195. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  25196. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  25197. let keyStr = keyForLoginInfo;
  25198. if (LocalStorageManager.hasJosnKey(keyStr)) {
  25199. const d = LocalStorageManager.getItem(keyStr);
  25200. let ua = d.username;
  25201. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  25202. }
  25203. else {
  25204. }
  25205. this.c_btn_for_user();
  25206. }
  25207. interuptSecretary() {
  25208. Laya.timer.clearAll(this);
  25209. this.playSecretaryRandomSound();
  25210. }
  25211. playSecretaryRandomSound() {
  25212. if (this.isHide)
  25213. return;
  25214. let time = xGame.common.randomNum(45000, 60000);
  25215. Laya.timer.once(time, this, () => {
  25216. if (this.isHide)
  25217. return;
  25218. let index = xGame.common.randomNum(4, 7);
  25219. xGame.soundMgr.playSound("s_main0" + index);
  25220. let words = 1;
  25221. switch (index) {
  25222. case 4:
  25223. words = 5;
  25224. break;
  25225. case 5:
  25226. words = 3;
  25227. break;
  25228. case 6:
  25229. words = 6;
  25230. break;
  25231. case 7:
  25232. words = 7;
  25233. break;
  25234. default:
  25235. break;
  25236. }
  25237. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  25238. this.playSecretaryRandomSound();
  25239. });
  25240. }
  25241. openSecretaryView() {
  25242. xGame.uiMgr.Show(UISecretary$1);
  25243. Moyu.sendDataEvent("secretary");
  25244. }
  25245. openShopView() {
  25246. xGame.uiMgr.Show(UIShop$1, 1);
  25247. }
  25248. openShopView0() {
  25249. xGame.uiMgr.Show(UIShop$1, 0);
  25250. }
  25251. openSignView() {
  25252. xGame.uiMgr.Show(UISign$1);
  25253. }
  25254. openDrawView() {
  25255. xGame.uiMgr.Show(UIDraw$1);
  25256. }
  25257. openRanking() {
  25258. console.log('zh:phb openRanking');
  25259. xGame.uiMgr.Show(UIRanking$1);
  25260. Moyu.sendDataEvent("rankingList");
  25261. }
  25262. }
  25263. UIMain$1.uiName = "UIMain";
  25264. function InitShader() {
  25265. }
  25266. function appInit() {
  25267. xGame.context.init(getLoadingResList(), initCallback);
  25268. }
  25269. function getLoadingResList() {
  25270. return [
  25271. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  25272. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  25273. ];
  25274. }
  25275. function getGameResList() {
  25276. return [
  25277. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  25278. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  25279. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  25280. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  25281. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  25282. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  25283. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  25284. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  25285. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  25286. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  25287. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  25288. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  25289. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  25290. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  25291. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  25292. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  25293. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  25294. ];
  25295. }
  25296. function initCallback() {
  25297. window["DataMgr"] = DataMgr;
  25298. DataMgr.Init();
  25299. Moyu.init(getPlat(), this, () => {
  25300. DataMgr.isNewDay();
  25301. PlatMgr.initConfig();
  25302. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  25303. }, true);
  25304. console.log('zh:开始sm init1 start');
  25305. xGame.soundMgr.init();
  25306. console.log('zh:开始sm init1 end');
  25307. xGame.uiMgr.init();
  25308. xGame.uiMgr.clearTempData();
  25309. xGame.uiMgr.bindFUI(fguiRes.loading);
  25310. xGame.uiMgr.Show(UILoading);
  25311. }
  25312. function onFontLoaded() {
  25313. try {
  25314. Laya.Text.defaultFont = "arial";
  25315. console.log("zh: onFontLoaded 设置arial字体成功");
  25316. }
  25317. catch (error) {
  25318. console.log("zh: constructor onFontLoaded加载arial字体失败");
  25319. }
  25320. }
  25321. function loadSubRes(callback) {
  25322. var tab = ["asset", "res", "spine"];
  25323. let subDone = 0;
  25324. for (var i = 0; i < tab.length; i++) {
  25325. let sub = tab[i];
  25326. Moyu.loadSubRes(sub, (pro) => {
  25327. callback && callback(pro, false);
  25328. }).then(() => {
  25329. subDone++;
  25330. if (subDone >= tab.length)
  25331. callback && callback(1, true);
  25332. });
  25333. }
  25334. }
  25335. function enterGame() {
  25336. xGame.cfgMgr.init();
  25337. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  25338. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  25339. xGame.uiMgr.Hide(UILoading);
  25340. fgui.UIPackage.removePackage(fguiRes.loading);
  25341. xGame.uiMgr.bindFUI(fguiRes.game);
  25342. xGame.uiMgr.Show(UIMain$1);
  25343. if (DataMgr.getNewUser())
  25344. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  25345. }
  25346. function getPlat() {
  25347. let cfg = new MoyuCfg();
  25348. cfg.plat = MoyuPlat.web;
  25349. cfg.myId = 180;
  25350. cfg.myKey = '8848a885774230a4';
  25351. cfg.version = 0;
  25352. if (window.hasOwnProperty("gamebox")) {
  25353. cfg.plat = MoyuPlat.f399;
  25354. cfg.version = 0;
  25355. }
  25356. else if (window.hasOwnProperty("ks")) {
  25357. cfg.plat = MoyuPlat.ks;
  25358. cfg.version = 0;
  25359. cfg.ads.ksVideoId = '2300002254_01';
  25360. cfg.ads.ksInsertId = '2300002254_02';
  25361. }
  25362. else if (Laya.Browser.onTTMiniGame) {
  25363. cfg.plat = MoyuPlat.tt;
  25364. cfg.version = 0;
  25365. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  25366. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  25367. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  25368. }
  25369. else if (Laya.Browser.onMiniGame) {
  25370. cfg.plat = MoyuPlat.wx;
  25371. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  25372. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  25373. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  25374. }
  25375. else if (Laya.Browser.onQQMiniGame) {
  25376. cfg.plat = MoyuPlat.qq;
  25377. }
  25378. else if (Laya.Browser.onQGMiniGame) {
  25379. cfg.plat = MoyuPlat.op;
  25380. cfg.ads.opVideoId = '455502';
  25381. cfg.ads.opBannerId = '455507';
  25382. }
  25383. else if (Laya.Browser.onVVMiniGame) {
  25384. cfg.plat = MoyuPlat.vv;
  25385. cfg.version = 0;
  25386. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  25387. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  25388. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  25389. }
  25390. else if (Laya.Browser.onHWMiniGame) {
  25391. cfg.plat = MoyuPlat.hw;
  25392. }
  25393. else if (window["mz"]) {
  25394. cfg.plat = MoyuPlat.mz;
  25395. }
  25396. else {
  25397. let cfg = window['conchConfig'];
  25398. if (cfg) {
  25399. var os = cfg.getOS();
  25400. if (os == "Conch-ios") {
  25401. cfg.plat = MoyuPlat.ios;
  25402. }
  25403. else if (os == "Conch-android") {
  25404. }
  25405. }
  25406. }
  25407. return cfg;
  25408. }
  25409. class Main {
  25410. constructor() {
  25411. if (window["Laya3D"])
  25412. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25413. else {
  25414. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25415. this.initMain();
  25416. }
  25417. }
  25418. initMain() {
  25419. Laya["Physics"] && Laya["Physics"].enable();
  25420. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25421. Laya.stage.scaleMode = GameConfig.scaleMode;
  25422. Laya.stage.screenMode = GameConfig.screenMode;
  25423. Laya.stage.alignV = GameConfig.alignV;
  25424. Laya.stage.alignH = GameConfig.alignH;
  25425. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25426. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25427. Laya.enableDebugPanel();
  25428. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25429. Laya["PhysicsDebugDraw"].enable();
  25430. if (GameConfig.stat)
  25431. Laya.Stat.show();
  25432. Laya.alertGlobalError(true);
  25433. this.loadFont();
  25434. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25435. }
  25436. loadFont() {
  25437. try {
  25438. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25439. console.log("zh: constructor加载arial字体成功1");
  25440. }
  25441. catch (error) {
  25442. console.log("zh: constructor加载arial字体失败1");
  25443. }
  25444. }
  25445. onFontLoaded() {
  25446. try {
  25447. Laya.Text.defaultFont = "Arial";
  25448. console.log("zh: onFontLoaded 设置arial字体成功1");
  25449. }
  25450. catch (error) {
  25451. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25452. }
  25453. }
  25454. onVersionLoaded() {
  25455. appInit();
  25456. }
  25457. }
  25458. new Main();
  25459. }());
  25460. //# sourceMappingURL=bundle.js.map