bundle.js 997 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919
  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_lxms_1 = (this.getChild("n_yd_lxms_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. xGame.eventMgr.on("gameConfigReadyMark", this, this.event_gameConfigReadyMark);
  7624. let curUse = DataMgr.getCurSecretary();
  7625. this.changeSecretary(curUse);
  7626. this.ui.talkNode.visible = false;
  7627. let guide = DataMgr.getSkillGuide();
  7628. if (xGame.common.isNewDay && guide == 1) {
  7629. xGame.common.isNewDay = false;
  7630. xGame.soundMgr.playSound("s_main01");
  7631. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7632. console.log("zh:播放小秘书每天语音");
  7633. }
  7634. this.onGetUserInfo();
  7635. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7636. DataMgr.getUserZiChanInfo(false);
  7637. }
  7638. this.ui.n83.visible = false;
  7639. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7640. const d = LocalStorageManager.getItem(keyForLoginInfo);
  7641. let ua = d.username;
  7642. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  7643. }
  7644. this.c_btn_for_user();
  7645. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  7646. }
  7647. Logout() {
  7648. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7649. LocalStorageManager.removeItem(keyForLoginInfo);
  7650. this.freshUser();
  7651. }
  7652. JSBridgeUtils.instance.loginOutForApp();
  7653. this.setUserDefaultNickname();
  7654. DataMgr.setCoin2(4000);
  7655. DataMgr.setDiamond2(0);
  7656. this.setDefaultQiuGanInfo();
  7657. DataMgr.setPlaceBallLevelList("");
  7658. DataMgr.setChallengeMode_overLev(1);
  7659. this.setDefaultSignData();
  7660. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  7661. }
  7662. setDefaultSignData() {
  7663. DataMgr.setSignData(1);
  7664. DataMgr.setSignTime(new Date().getTime());
  7665. }
  7666. setDefaultQiuGanInfo() {
  7667. DataMgr.setBallRod(0, 1);
  7668. DataMgr.setBallRod(1, 0);
  7669. DataMgr.setBallRod(2, 0);
  7670. DataMgr.setBallRod(3, 0);
  7671. DataMgr.setBallRod(4, 0);
  7672. DataMgr.setBallRod(5, 1);
  7673. }
  7674. setUserDefaultNickname() {
  7675. let defUsername = "player";
  7676. this.ui.headNode.nameTxt.text = defUsername;
  7677. DataMgr.updateUserNickName(defUsername);
  7678. Moyu.updateUserInfo(defUsername);
  7679. }
  7680. gotoLogin() {
  7681. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  7682. xGame.uiMgr.Show(UILogin);
  7683. }
  7684. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  7685. this.Logout();
  7686. }
  7687. }
  7688. gotoRegUser() {
  7689. xGame.uiMgr.Show(UIReg);
  7690. }
  7691. showFuLiSp1() {
  7692. console.log('zh:福利1');
  7693. DataMgr.checkForShowFuLi17AndAlert(1);
  7694. }
  7695. showFuLiSp7() {
  7696. console.log('zh:福利7');
  7697. DataMgr.checkForShowFuLi17AndAlert(7);
  7698. }
  7699. c_btn_for_user() {
  7700. this.ui.n_dengLu.c1.selectedIndex = 0;
  7701. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  7702. this.ui.n_dengLu.c1.selectedIndex = 1;
  7703. }
  7704. else {
  7705. this.ui.n_dengLu.c1.selectedIndex = 0;
  7706. }
  7707. }
  7708. changeSecretary(curUse) {
  7709. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  7710. xGame.common.secretary && xGame.common.secretary.dispose();
  7711. this.addSecretarySpine(name);
  7712. }
  7713. addSecretarySpine(name) {
  7714. let spine = new SpineMgr(name, () => {
  7715. this.playSecretaryIdle();
  7716. });
  7717. xGame.common.secretary = spine;
  7718. }
  7719. addClickSpine() {
  7720. let clickSpine = new SpineMgr("dianji", () => {
  7721. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  7722. let parent = Laya.stage;
  7723. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  7724. clickSpine.play(data, 0, false, parent, (spine) => {
  7725. spine.destroy(true);
  7726. });
  7727. });
  7728. });
  7729. }
  7730. addEvent() {
  7731. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  7732. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  7733. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  7734. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  7735. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  7736. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  7737. this.addUIClick(this.ui, this.interuptSecretary);
  7738. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  7739. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  7740. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  7741. this.addUIClick(this.ui.shopBtn, this.openShopView);
  7742. this.addUIClick(this.ui.signBtn, this.openSignView);
  7743. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  7744. this.addUIClick(this.ui.rankBtn, this.openRanking);
  7745. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  7746. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  7747. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  7748. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  7749. }
  7750. show(showFailWords) {
  7751. super.show();
  7752. DataMgr.loadUserSpOrderForAd();
  7753. this.moneyNode.ui.c1.selectedIndex = 1;
  7754. this.playSecretaryIdle();
  7755. xGame.soundMgr.playMusic("caromhall01", 0);
  7756. Laya.timer.clearAll(this);
  7757. this.playSecretaryRandomSound();
  7758. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  7759. if (showFailWords) {
  7760. console.log('zh:uimain.ts ');
  7761. setTimeout(() => {
  7762. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  7763. let words = -1;
  7764. if (str == "s_main02") {
  7765. words = 2;
  7766. }
  7767. else {
  7768. words = 3;
  7769. }
  7770. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7771. xGame.soundMgr.playSound(str);
  7772. }, 300);
  7773. }
  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. }
  7797. event_gameConfigReadyMark() {
  7798. console.log('zh:事件触发,配置加载OK');
  7799. this.showGuideForLianxi();
  7800. }
  7801. showGuideForLianxi() {
  7802. let lianXiGuide = DataMgr.getLianXiGuide();
  7803. console.log('zh: AAAAA练习模式引导判断:lianXiGuide=' + lianXiGuide);
  7804. if (lianXiGuide == 0) {
  7805. let x = this.ui.placeBallBtn.x;
  7806. let y = this.ui.placeBallBtn.y;
  7807. this.ui.n_yd_lxms_1.visible = true;
  7808. this.ui.n_yd_challenge_1_hand.x = x + 150;
  7809. this.ui.n_yd_challenge_1_hand.y = y;
  7810. this.ui.n_yd_challenge_1_btn.x = x;
  7811. this.ui.n_yd_challenge_1_btn.y = y;
  7812. console.log('zh:yinDaoForLianxi set ok');
  7813. }
  7814. else {
  7815. this.ui.n_yd_lxms_1.visible = false;
  7816. }
  7817. }
  7818. showTipForGuest() {
  7819. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7820. if (userInfo == null) {
  7821. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  7822. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  7823. let woman = "this is an important notice.";
  7824. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  7825. return;
  7826. }
  7827. }
  7828. checkActive(show) {
  7829. }
  7830. showGuide() {
  7831. let guide = DataMgr.getSkillGuide();
  7832. this.ui.guideBtn.visible = guide == 0;
  7833. this.ui.enterGuide.visible = false;
  7834. this.ui.secretaryGuide.visible = guide == 0;
  7835. if (guide == 0) {
  7836. console.log("zh:显示引导");
  7837. xGame.soundMgr.playSound("s_guide");
  7838. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  7839. }
  7840. else {
  7841. console.log("zh:不需要显示引导");
  7842. }
  7843. }
  7844. ensureSecretary() {
  7845. console.log('zh: ensureSecretary ');
  7846. this.ui.secretaryGuide.visible = false;
  7847. this.ui.enterGuide.visible = true;
  7848. this.ui.wordsNode.t0.play();
  7849. if (DataMgr.getNewUser())
  7850. Moyu.sendDataEvent("gameReady");
  7851. }
  7852. playSecretaryIdle() {
  7853. let parent = this.ui.secretary.displayObject;
  7854. parent.destroyChildren();
  7855. let xx = this.ui.secretary.width / 2;
  7856. let yy = this.ui.secretary.height;
  7857. let scale = xGame.common.getSecretaryScale();
  7858. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  7859. xGame.common.secretary.play(data, 0, true, parent);
  7860. }
  7861. startGame(type) {
  7862. if (!this.isReadyForLoadNetSource()) {
  7863. return;
  7864. }
  7865. xGame.common.gameMode = type;
  7866. Moyu.sendDataEvent("PlayGame", { type: type });
  7867. let gm = xGame.common.gameMode;
  7868. console.log('zh:进入游戏gameMode =' + gm);
  7869. switch (gm) {
  7870. case GameMode.classic:
  7871. console.log('zh:进入经典模式111111111');
  7872. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  7873. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7874. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  7875. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  7876. console.log('zh:判断是否可以玩该模式classic =NO');
  7877. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  7878. xGame.uiMgr.Show(UIMsg, tipStr);
  7879. return;
  7880. }
  7881. else {
  7882. console.log('zh:可以玩该模式classic');
  7883. this.beginGame();
  7884. }
  7885. }
  7886. else {
  7887. console.log('zh:不需要判断是否可以玩该classic');
  7888. let challengeTimes = DataMgr.getChallengeTimes();
  7889. if (challengeTimes == 0) {
  7890. xGame.uiMgr.Show(UIInvitation);
  7891. }
  7892. else {
  7893. this.beginGame();
  7894. }
  7895. }
  7896. break;
  7897. case GameMode.bigMove:
  7898. console.info('zh:bigMove check 大招');
  7899. let guide = DataMgr.getSkillGuide();
  7900. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  7901. let db_over_lev = DataMgr.getChallengeMode_overLev();
  7902. console.log('zh:bigMove db_over_lev=', db_over_lev);
  7903. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  7904. console.log('zh:提示不可以玩');
  7905. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  7906. xGame.uiMgr.Show(UIMsg, tipStr);
  7907. return;
  7908. }
  7909. else {
  7910. console.log('zh:可以玩该模式 bigMove');
  7911. this.beginGame();
  7912. if (DataMgr.getNewUser())
  7913. Moyu.sendDataEvent("gameStart0");
  7914. }
  7915. }
  7916. else {
  7917. this.beginGame();
  7918. if (DataMgr.getNewUser())
  7919. Moyu.sendDataEvent("gameStart0");
  7920. }
  7921. break;
  7922. default:
  7923. console.error('zh:未知错误!!!!');
  7924. break;
  7925. }
  7926. }
  7927. beginGame(isNice = false) {
  7928. console.log('zh:beginGame ');
  7929. let guide = DataMgr.getSkillGuide();
  7930. if (guide == 1) {
  7931. console.log('zh:非新手引导,showInternAd ');
  7932. JSBridgeUtils.instance.showInternAd('beginGame');
  7933. }
  7934. else {
  7935. console.log('zh:新手引导,不显示AD ');
  7936. }
  7937. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  7938. console.log('zh:beginGame 1');
  7939. if (xGame.common.gameMode == GameMode.classic) {
  7940. console.log('zh:beginGame 2');
  7941. if (isNice) {
  7942. console.log('zh:进入巅峰赛');
  7943. this.enterClassic();
  7944. }
  7945. else {
  7946. console.log('zh:beginGame 3-1');
  7947. xGame.uiMgr.Show(UIModeSelection, () => {
  7948. console.log('zh:beginGame 3-2');
  7949. this.enterClassic();
  7950. });
  7951. }
  7952. }
  7953. else if (xGame.common.gameMode == GameMode.bigMove) {
  7954. console.log('zh:beginGame 5');
  7955. this.ui.enterGuide.visible = false;
  7956. xGame.uiMgr.Show(UISkill);
  7957. }
  7958. }
  7959. enterClassic() {
  7960. console.log('zh:beginGame 7');
  7961. xGame.uiMgr.Show(UIGame);
  7962. xGame.uiMgr.Show(UIMatching, () => {
  7963. if (!this.isHide)
  7964. this.hide();
  7965. xGame.common.gameUI.ui.alpha = 1;
  7966. console.log('zh:beginGame 8');
  7967. xGame.common.gameUI.startGame();
  7968. xGame.uiMgr.Hide(UIGameEnd);
  7969. });
  7970. }
  7971. start_debug_for_moni_payOk() {
  7972. let ccc = this.moni_click_count + 1;
  7973. this.moni_click_count = ccc;
  7974. if (ccc % 5 == 0) {
  7975. console.log('zh:start_debug_for_moni_payOk');
  7976. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  7977. if (userInfo != null) {
  7978. let token = userInfo.token;
  7979. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  7980. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  7981. alert('模拟支付OK');
  7982. return;
  7983. }
  7984. else {
  7985. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  7986. }
  7987. }
  7988. }
  7989. startGlobal() {
  7990. xGame.uiMgr.Show(UIMsg, "Coming Soon.");
  7991. }
  7992. startWeekly() {
  7993. xGame.uiMgr.Show(UIMsg, "Coming Soon");
  7994. }
  7995. zhouSaiMonth() {
  7996. console.log('zh: zhouSaiMonth 被调用');
  7997. }
  7998. isReadyForLoadNetSource() {
  7999. let reqCount = xGame.cfgMgr.httpReqCount;
  8000. let ok = xGame.cfgMgr.httpReqOkCount;
  8001. if (reqCount > ok) {
  8002. xGame.uiMgr.Show(UIMsg, "Network not ready. Try again later.");
  8003. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  8004. Laya.timer.once(5000, this, () => {
  8005. let retryCount = 0;
  8006. const maxRetries = 3;
  8007. const tryFetchConfig = () => {
  8008. try {
  8009. xGame.cfgMgr.getConfigFromServer();
  8010. }
  8011. catch (error) {
  8012. if (retryCount < maxRetries) {
  8013. retryCount++;
  8014. console.log(`🔄 第${retryCount}次重试获取配置...`);
  8015. Laya.timer.once(5000, this, tryFetchConfig);
  8016. }
  8017. else {
  8018. console.error("❌ 达到最大重试次数,配置获取失败");
  8019. }
  8020. }
  8021. };
  8022. tryFetchConfig();
  8023. });
  8024. return false;
  8025. }
  8026. return true;
  8027. }
  8028. startPlaceBall() {
  8029. if (!this.isReadyForLoadNetSource()) {
  8030. return;
  8031. }
  8032. xGame.uiMgr.Show(UILevelDisplay);
  8033. }
  8034. hide() {
  8035. console.log('zh:uimain hide ...');
  8036. super.hide();
  8037. xGame.common.stopGirlPop(this.ui.talkNode);
  8038. }
  8039. onGetUserInfo(force = false) {
  8040. if (Moyu.isWx) {
  8041. let info = Moyu.getSystemInfo();
  8042. if (info)
  8043. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  8044. }
  8045. else {
  8046. Moyu.initUser(this, this.freshUser, force);
  8047. }
  8048. this.freshUser();
  8049. console.log('zh:5秒后更新用户信息');
  8050. setTimeout(() => {
  8051. DataMgr.getUserZiChanInfo(true);
  8052. }, 5000);
  8053. }
  8054. event_login_in() {
  8055. console.log("zh:event_login_in被触发");
  8056. this.freshUser();
  8057. }
  8058. freshUser() {
  8059. let user = Moyu.getUserInfo();
  8060. if (!user.isAuth) {
  8061. user.headIcon = 'res/ty_touxiang.png';
  8062. }
  8063. else {
  8064. DataMgr.upRankData();
  8065. }
  8066. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  8067. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  8068. let keyStr = keyForLoginInfo;
  8069. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8070. const d = LocalStorageManager.getItem(keyStr);
  8071. let ua = d.username;
  8072. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  8073. }
  8074. else {
  8075. }
  8076. this.c_btn_for_user();
  8077. }
  8078. interuptSecretary() {
  8079. Laya.timer.clearAll(this);
  8080. this.playSecretaryRandomSound();
  8081. }
  8082. playSecretaryRandomSound() {
  8083. if (this.isHide)
  8084. return;
  8085. let time = xGame.common.randomNum(45000, 60000);
  8086. Laya.timer.once(time, this, () => {
  8087. if (this.isHide)
  8088. return;
  8089. let index = xGame.common.randomNum(4, 7);
  8090. xGame.soundMgr.playSound("s_main0" + index);
  8091. let words = 1;
  8092. switch (index) {
  8093. case 4:
  8094. words = 5;
  8095. break;
  8096. case 5:
  8097. words = 3;
  8098. break;
  8099. case 6:
  8100. words = 6;
  8101. break;
  8102. case 7:
  8103. words = 7;
  8104. break;
  8105. default:
  8106. break;
  8107. }
  8108. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8109. this.playSecretaryRandomSound();
  8110. });
  8111. }
  8112. openSecretaryView() {
  8113. xGame.uiMgr.Show(UISecretary);
  8114. Moyu.sendDataEvent("secretary");
  8115. }
  8116. openShopView() {
  8117. xGame.uiMgr.Show(UIShop, 1);
  8118. }
  8119. openShopView0() {
  8120. xGame.uiMgr.Show(UIShop, 0);
  8121. }
  8122. openSignView() {
  8123. xGame.uiMgr.Show(UISign);
  8124. }
  8125. openDrawView() {
  8126. xGame.uiMgr.Show(UIDraw);
  8127. }
  8128. openRanking() {
  8129. console.log('zh:phb openRanking');
  8130. xGame.uiMgr.Show(UIRanking);
  8131. Moyu.sendDataEvent("rankingList");
  8132. }
  8133. }
  8134. UIMain.uiName = "UIMain";
  8135. class UIGameEnd extends UIBase {
  8136. constructor() {
  8137. super();
  8138. this.success = false;
  8139. this.awardCoinNum = 1000;
  8140. this.awardDiamondNum = 10;
  8141. }
  8142. onConstructor() {
  8143. this.ui = ui_UIGameEnd.createInstance();
  8144. this.contentPane = this.ui;
  8145. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  8146. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  8147. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  8148. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  8149. this.ui.talkNode.visible = false;
  8150. if (Moyu.isKs)
  8151. this.ui.closeNode.closeBtn.x += 100;
  8152. }
  8153. updateType() {
  8154. switch (xGame.common.gameMode) {
  8155. case GameMode.classic:
  8156. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8157. this.ui.coinNode.visible = this.success;
  8158. if (!this.success) {
  8159. Laya.timer.once(500, this, () => {
  8160. xGame.uiMgr.Show(UIAddCoin);
  8161. });
  8162. }
  8163. else {
  8164. this.logEventForClassic_win();
  8165. }
  8166. this.logEventForClassic_complete();
  8167. this.ui.isGetAward.visible = false;
  8168. this.ui.leftBtn.c1.selectedIndex = 3;
  8169. this.ui.rightBtn.c1.selectedIndex = 0;
  8170. this.moneyNode.ui.c1.selectedIndex = 1;
  8171. break;
  8172. case GameMode.bigMove:
  8173. console.log('zh:招法模式 aaaaaa bigMove');
  8174. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  8175. this.ui.coinNode.visible = this.success;
  8176. if (xGame.common.gameMode == GameMode.bigMove) {
  8177. if (this.success) {
  8178. DataMgr.setSkillSuccessTimes(1, true);
  8179. DataMgr.setSkillAccTimes(1);
  8180. }
  8181. else {
  8182. DataMgr.setSkillSuccessTimes(0, false);
  8183. }
  8184. }
  8185. this.logEventForRod_complete_N();
  8186. if (!this.success) {
  8187. Laya.timer.once(500, this, () => {
  8188. xGame.uiMgr.Show(UIAddCoin);
  8189. });
  8190. }
  8191. else {
  8192. this.logEventForRod_win();
  8193. }
  8194. this.ui.isGetAward.visible = false;
  8195. this.ui.leftBtn.c1.selectedIndex = 3;
  8196. this.ui.rightBtn.c1.selectedIndex = 0;
  8197. this.moneyNode.ui.c1.selectedIndex = 1;
  8198. break;
  8199. case GameMode.placeBall:
  8200. this.ui.coinNode.visible = false;
  8201. if (this.success) {
  8202. if (xGame.common.placeBallStarNum == 3) {
  8203. this.ui.c1.selectedIndex = 2;
  8204. }
  8205. else {
  8206. this.ui.c1.selectedIndex = 3;
  8207. }
  8208. let level = xGame.common.placeBallCurLevel;
  8209. if (level > 59) {
  8210. this.logEventForChallenge_level_complete(level);
  8211. }
  8212. else {
  8213. this.logEventForChallenge_level_N(level);
  8214. }
  8215. }
  8216. else {
  8217. this.ui.c1.selectedIndex = 4;
  8218. }
  8219. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  8220. if (cfg.type == PlaceBallType.challenge) {
  8221. this.ui.c1.selectedIndex = 2;
  8222. }
  8223. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  8224. this.updatePlaceBallBtn();
  8225. this.updatePlaceBallStarNum();
  8226. this.updatePlaceBallAwardState();
  8227. this.moneyNode.ui.c1.selectedIndex = 2;
  8228. this.moneyNode.checkPowerTime();
  8229. this.moneyNode.powerChange();
  8230. DataMgr.upRankData();
  8231. break;
  8232. default:
  8233. break;
  8234. }
  8235. }
  8236. logEventForRod_complete_N() {
  8237. let gfmsIdx = xGame.common.curPlayerSkillType;
  8238. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  8239. let gfmc = 'Skyfall Shot';
  8240. if (gfmsIdx == 0) {
  8241. gfmc = 'Skyfall Shot';
  8242. }
  8243. if (gfmsIdx == 1) {
  8244. gfmc = 'Surging break';
  8245. }
  8246. if (gfmsIdx == 2) {
  8247. gfmc = 'Frost Lock';
  8248. }
  8249. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8250. console.log('zh:logEventForRod_complete_N level = ' + level);
  8251. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  8252. let jsonStr = {
  8253. "count": 0,
  8254. "name": gfmc
  8255. };
  8256. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8257. const d = LocalStorageManager.getItem(keyStr);
  8258. jsonStr.count = d.count + 1;
  8259. LocalStorageManager.setItem(keyStr, jsonStr);
  8260. }
  8261. else {
  8262. LocalStorageManager.setItem(keyStr, jsonStr);
  8263. }
  8264. const d2 = LocalStorageManager.getItem(keyStr);
  8265. let count = d2.count;
  8266. console.log('zh:logEventForRod_complete_N count = ' + count);
  8267. if (count % 5 == 0) {
  8268. const reqStr = JSON.stringify(jsonStr);
  8269. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  8270. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  8271. }
  8272. }
  8273. logEventForRod_win() {
  8274. console.log('zh:logEventForRod_win,胜利');
  8275. let gfmsIdx = xGame.common.curPlayerSkillType;
  8276. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  8277. let gfmc = 'Skyfall Shot';
  8278. if (gfmsIdx == 0) {
  8279. gfmc = 'Skyfall Shot';
  8280. }
  8281. if (gfmsIdx == 1) {
  8282. gfmc = 'Surging break';
  8283. }
  8284. if (gfmsIdx == 2) {
  8285. gfmc = 'Frost Lock';
  8286. }
  8287. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  8288. console.log('zh:logEventForRod_win level = ' + level);
  8289. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  8290. let jsonStr = {
  8291. "count": 1,
  8292. "name": gfmc + ' Lev' + level
  8293. };
  8294. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8295. const d = LocalStorageManager.getItem(keyStr);
  8296. jsonStr.count = d.count + 1;
  8297. LocalStorageManager.setItem(keyStr, jsonStr);
  8298. }
  8299. else {
  8300. LocalStorageManager.setItem(keyStr, jsonStr);
  8301. }
  8302. const reqStr = JSON.stringify(jsonStr);
  8303. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  8304. }
  8305. logEventForClassic_win() {
  8306. console.log('zh:logEventForClassic_win,胜利');
  8307. let rtype = xGame.common.classicRoomType;
  8308. let msmc = '';
  8309. if (rtype == 1) {
  8310. msmc = 'beginner';
  8311. }
  8312. if (rtype == 2) {
  8313. msmc = 'expert';
  8314. }
  8315. if (rtype == 3) {
  8316. msmc = 'master';
  8317. }
  8318. let keyStr = 'sjmd_classic_win_' + rtype;
  8319. let jsonStr = {
  8320. "difficulty": msmc,
  8321. "classic_count": 1,
  8322. "difficulty_count": 1
  8323. };
  8324. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8325. const d = LocalStorageManager.getItem(keyStr);
  8326. jsonStr.classic_count = d.classic_count + 1;
  8327. jsonStr.difficulty_count = d.difficulty_count + 1;
  8328. LocalStorageManager.setItem(keyStr, jsonStr);
  8329. }
  8330. else {
  8331. LocalStorageManager.setItem(keyStr, jsonStr);
  8332. }
  8333. const reqStr = JSON.stringify(jsonStr);
  8334. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  8335. }
  8336. logEventForClassic_complete() {
  8337. console.log('zh:logEventForClassic_complete,胜利');
  8338. let rtype = xGame.common.classicRoomType;
  8339. let msmc = '';
  8340. if (rtype == 1) {
  8341. msmc = 'beginner';
  8342. }
  8343. if (rtype == 2) {
  8344. msmc = 'expert';
  8345. }
  8346. if (rtype == 3) {
  8347. msmc = 'master';
  8348. }
  8349. let keyStr = 'sjmd_classic_complete_' + rtype;
  8350. let jsonStr = {
  8351. "msmc": msmc,
  8352. "count": 0
  8353. };
  8354. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8355. const d = LocalStorageManager.getItem(keyStr);
  8356. jsonStr.count = d.count + 1;
  8357. LocalStorageManager.setItem(keyStr, jsonStr);
  8358. }
  8359. else {
  8360. LocalStorageManager.setItem(keyStr, jsonStr);
  8361. }
  8362. if (jsonStr.count % 5 == 0) {
  8363. const reqStr = JSON.stringify(jsonStr);
  8364. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  8365. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  8366. }
  8367. }
  8368. updatePlaceBallBtn() {
  8369. this.ui.leftBtn.c1.selectedIndex = 5;
  8370. if (this.success) {
  8371. this.ui.rightBtn.c1.selectedIndex = 14;
  8372. }
  8373. else {
  8374. if (xGame.common.placeBallStarNum == 3) {
  8375. this.ui.rightBtn.c1.selectedIndex = 14;
  8376. }
  8377. else {
  8378. this.ui.rightBtn.c1.selectedIndex = 1;
  8379. }
  8380. }
  8381. }
  8382. updatePlaceBallStarNum() {
  8383. let starNum = xGame.common.placeBallStarNum;
  8384. if (starNum == 0)
  8385. this.ui.starNumNode.c1.selectedIndex = 3;
  8386. else {
  8387. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  8388. }
  8389. }
  8390. updatePlaceBallAwardState() {
  8391. let level = xGame.common.placeBallCurLevel;
  8392. let starNum = xGame.common.placeBallStarNum;
  8393. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8394. let data = cfgTable.placeballData[level].award;
  8395. let cfg = cfgTable.placeballData[level];
  8396. this.awardDiamondNum = data[1];
  8397. this.awardCoinNum = data[0];
  8398. if (cfg.type == PlaceBallType.challenge) {
  8399. this.awardDiamondNum = 0;
  8400. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8401. }
  8402. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  8403. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  8404. if (cfg.type == PlaceBallType.challenge) {
  8405. this.ui.awardNode.coinNode.visible = true;
  8406. }
  8407. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  8408. this.ui.awardNode.diamondNode.x = 265;
  8409. this.ui.awardNode.coinNode.x = 354;
  8410. }
  8411. else {
  8412. this.ui.awardNode.diamondNode.x = 291;
  8413. this.ui.awardNode.coinNode.x = 291;
  8414. }
  8415. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  8416. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  8417. if (this.awardCoinNum == 0) {
  8418. this.ui.awardNode.coinNode.numTxt.text = "";
  8419. }
  8420. if (getAward) {
  8421. this.ui.isGetAward.visible = true;
  8422. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  8423. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  8424. }
  8425. else {
  8426. this.ui.isGetAward.visible = false;
  8427. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  8428. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  8429. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  8430. }
  8431. else {
  8432. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  8433. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  8434. }
  8435. }
  8436. }
  8437. show(success) {
  8438. super.show();
  8439. xGame.eventMgr.event(RESET_GAME);
  8440. this.success = success;
  8441. Laya.timer.clearAll(this);
  8442. this.playSecretaryAni();
  8443. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  8444. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  8445. offsetTime = Math.floor(offsetTime / 1000);
  8446. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  8447. this.updateType();
  8448. Laya.timer.once(200, this, () => {
  8449. this.addAward(() => {
  8450. this.updateType();
  8451. Laya.timer.once(500, this, () => {
  8452. this.showChallengeLevel();
  8453. });
  8454. });
  8455. });
  8456. if (this.success) {
  8457. JSBridgeUtils.instance.showInternAd('gameend_success');
  8458. console.log('zh:game end 成功');
  8459. xGame.soundMgr.playSound('slots_roll01');
  8460. xGame.soundMgr.playSound("s_win");
  8461. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8462. this.diyGameDataUtilForGameWin();
  8463. this.updateGamePlaceBallData2Server();
  8464. }
  8465. else {
  8466. JSBridgeUtils.instance.showInternAd('gameend_faill');
  8467. console.log('zh:game end失败');
  8468. xGame.soundMgr.playSound('matchwin01');
  8469. xGame.soundMgr.playSound("s_lose");
  8470. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  8471. }
  8472. console.log('zh:开始弹出福利框2个');
  8473. Laya.timer.once(1000, this, () => {
  8474. console.log('zh: 1秒后 showFuLiSp1');
  8475. DataMgr.checkForShowFuLi17AndAlert(1);
  8476. });
  8477. let challengeNum = DataMgr.getChallengeTimes();
  8478. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  8479. DataMgr.setChallengeTimes(1);
  8480. }
  8481. if (this.success && xGame.common.gameMode == GameMode.classic) {
  8482. DataMgr.setClassicTimes();
  8483. }
  8484. this.setGlobalFont(this.ui);
  8485. }
  8486. diyGameDataUtilForGameWin() {
  8487. console.log('zh: DiyGameDataUtilForGameWin diy ');
  8488. switch (xGame.common.gameMode) {
  8489. case GameMode.classic:
  8490. console.log('zh:DiyGameDataUtilForGameWin 111');
  8491. case GameMode.bigMove:
  8492. console.log('zh:DiyGameDataUtilForGameWin 222');
  8493. this.restartGame();
  8494. break;
  8495. case GameMode.placeBall:
  8496. console.log('zh:DiyGameDataUtilForGameWin 333');
  8497. var level = xGame.common.placeBallCurLevel;
  8498. console.log('zh:练习模式 联系了多少LEV=' + level);
  8499. let db_over_lev = DataMgr.getChallengeMode_overLev();
  8500. if (level > db_over_lev) {
  8501. DataMgr.setChallengeMode_overLev(level);
  8502. }
  8503. break;
  8504. default:
  8505. console.log('zh:DiyGameDataUtilForGameWin 444');
  8506. break;
  8507. }
  8508. }
  8509. updateGamePlaceBallData2Server() {
  8510. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  8511. if (userInfo == null) {
  8512. return;
  8513. }
  8514. let pbdObj = DataMgr.getPlaceBallLevelList();
  8515. let reqData = xGame.httpMgr.getReqData();
  8516. let pd = JSON.parse(reqData);
  8517. pd.placeBallData = JSON.stringify(pbdObj);
  8518. reqData = JSON.stringify(pd);
  8519. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  8520. try {
  8521. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  8522. let code = res.code;
  8523. let msg = res.msg;
  8524. if (code == 401) {
  8525. Laya.LocalStorage.removeItem(keyForLoginInfo);
  8526. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  8527. return;
  8528. }
  8529. if (code == 200) {
  8530. let data = res.data;
  8531. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  8532. }
  8533. else {
  8534. xGame.uiMgr.Show(UIMsg, msg);
  8535. }
  8536. }
  8537. catch (error) {
  8538. console.log('error=' + error);
  8539. alert(error);
  8540. }
  8541. finally {
  8542. }
  8543. });
  8544. }
  8545. showChallengeLevel() {
  8546. if (DataMgr.getChallengeTimes() != 0)
  8547. return;
  8548. let skill = DataMgr.getSkillAccTimes();
  8549. let put = DataMgr.getPlaceBallLevelList().length;
  8550. if (skill >= 3 || put >= 5) {
  8551. xGame.uiMgr.Show(UIInvitation);
  8552. this.hide();
  8553. }
  8554. }
  8555. addAward(callback) {
  8556. if (!this.success) {
  8557. callback && callback();
  8558. return;
  8559. }
  8560. switch (xGame.common.gameMode) {
  8561. case GameMode.classic:
  8562. this.awardCoinNum = xGame.common.passAwardCoin;
  8563. this.awardDiamondNum = 0;
  8564. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8565. break;
  8566. case GameMode.bigMove:
  8567. this.awardCoinNum = xGame.common.passAwardCoin;
  8568. this.awardDiamondNum = 0;
  8569. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  8570. callback && callback();
  8571. break;
  8572. case GameMode.placeBall:
  8573. let level = xGame.common.placeBallCurLevel;
  8574. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  8575. if (xGame.common.placeBallStarNum != 3) {
  8576. callback && callback();
  8577. return;
  8578. }
  8579. else {
  8580. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  8581. if (getAward) {
  8582. callback && callback();
  8583. return;
  8584. }
  8585. }
  8586. let cfg = cfgTable.placeballData[level];
  8587. let data = cfgTable.placeballData[level].award;
  8588. this.awardCoinNum = data[0];
  8589. this.awardDiamondNum = data[1];
  8590. if (cfg.type == PlaceBallType.challenge) {
  8591. this.awardDiamondNum = 0;
  8592. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  8593. }
  8594. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  8595. let diamondAward;
  8596. if (this.awardDiamondNum > 0) {
  8597. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  8598. xGame.common.getAward([diamondAward, coinAward], callback);
  8599. }
  8600. else {
  8601. xGame.common.getAward([coinAward], callback);
  8602. }
  8603. if (cfg.type == PlaceBallType.normal) {
  8604. DataMgr.setPlaceBallAward(level);
  8605. }
  8606. break;
  8607. default:
  8608. break;
  8609. }
  8610. }
  8611. playSecretaryAni_old() {
  8612. let parent = this.ui.secretary.displayObject;
  8613. parent.destroyChildren();
  8614. let xx = this.ui.secretary.width / 2;
  8615. let yy = this.ui.secretary.height;
  8616. let scale = xGame.common.getSecretaryScale();
  8617. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8618. if (this.success) {
  8619. let rand = Math.random() <= 0.5 ? 2 : 3;
  8620. xGame.common.secretary.play(data, rand, false, parent, () => {
  8621. xGame.common.secretary.play(data, 1, true, parent);
  8622. });
  8623. }
  8624. else {
  8625. xGame.common.secretary.play(data, 0, true, parent);
  8626. }
  8627. }
  8628. playSecretaryAni() {
  8629. let parent = this.ui.secretary.displayObject;
  8630. parent.destroyChildren();
  8631. let xx = this.ui.secretary.width / 2;
  8632. let yy = this.ui.secretary.height;
  8633. let scale = xGame.common.getSecretaryScale();
  8634. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  8635. if (this.success) {
  8636. let rand = 0;
  8637. xGame.common.secretary.play(data, 0, true, parent);
  8638. }
  8639. else {
  8640. xGame.common.secretary.play(data, 0, true, parent);
  8641. }
  8642. }
  8643. restartGame() {
  8644. switch (xGame.common.gameMode) {
  8645. case GameMode.classic:
  8646. xGame.eventMgr.event(RESTART_GAME);
  8647. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8648. break;
  8649. case GameMode.bigMove:
  8650. this.hide();
  8651. xGame.eventMgr.event(RESTART_GAME);
  8652. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8653. break;
  8654. default:
  8655. break;
  8656. }
  8657. }
  8658. hide() {
  8659. super.hide();
  8660. xGame.common.stopGirlPop(this.ui.talkNode);
  8661. PlatMgr.showBanner(false);
  8662. }
  8663. returnHome() {
  8664. this.hide();
  8665. let showFailWords = !this.success;
  8666. xGame.uiMgr.Show(UIMain, showFailWords);
  8667. }
  8668. clickLeftBtn() {
  8669. switch (xGame.common.gameMode) {
  8670. case GameMode.classic:
  8671. case GameMode.bigMove:
  8672. this.returnHome();
  8673. break;
  8674. case GameMode.placeBall:
  8675. let level = xGame.common.placeBallCurLevel;
  8676. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  8677. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  8678. break;
  8679. default:
  8680. break;
  8681. }
  8682. }
  8683. powerStartPlaceBallLevel(level, btn) {
  8684. if (DataMgr.powerEnough()) {
  8685. btn.touchable = false;
  8686. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  8687. btn.touchable = true;
  8688. DataMgr.setPower(-1);
  8689. xGame.eventMgr.event(POWER_TIME);
  8690. this.startPlaceBallLevel(level);
  8691. this.logEventForChallenge_level_start(level);
  8692. }));
  8693. }
  8694. else {
  8695. xGame.uiMgr.Show(UIPower, 0);
  8696. }
  8697. }
  8698. clickRightBtn() {
  8699. switch (xGame.common.gameMode) {
  8700. case GameMode.classic:
  8701. console.log('zh:clickRightBtn 111');
  8702. case GameMode.bigMove:
  8703. console.log('zh:clickRightBtn 222');
  8704. this.restartGame();
  8705. break;
  8706. case GameMode.placeBall:
  8707. console.log('zh:clickRightBtn 333');
  8708. let level = xGame.common.placeBallCurLevel;
  8709. let data = DataMgr.getPlaceBallLevel(level);
  8710. let curPss = data.play && !data.isCur;
  8711. if (curPss) {
  8712. console.log('zh:clickRightBtn 333-111');
  8713. console.log('zh:当前LV=' + level);
  8714. if (level == 60) {
  8715. xGame.uiMgr.Show(UIMsg, "Congratulations on passing all levels.");
  8716. Laya.timer.once(3000, this, () => {
  8717. this.returnHome();
  8718. });
  8719. }
  8720. else {
  8721. let lev = level + 1;
  8722. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  8723. }
  8724. }
  8725. else {
  8726. console.log('zh:clickRightBtn 333-000');
  8727. Moyu.sendDataEvent("placeBallNextLevel");
  8728. console.log('zh:qjff_AD_for_uiGameEnd');
  8729. if (Laya.Browser.onAndroid) {
  8730. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  8731. if (!boo) {
  8732. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  8733. return;
  8734. }
  8735. }
  8736. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  8737. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  8738. }
  8739. else {
  8740. console.log('zh:AD 失败,直接发放奖励');
  8741. this.qjff_AD_for_uiGameEnd(level);
  8742. }
  8743. }
  8744. break;
  8745. default:
  8746. console.log('zh:clickRightBtn 444');
  8747. break;
  8748. }
  8749. }
  8750. logEventForChallenge_level_start(level) {
  8751. let keyStr = 'sjmd_challenge_level_start';
  8752. let jsonStr = {
  8753. "count": 0,
  8754. "gold_balance ": DataMgr.getCoin(),
  8755. "level": level,
  8756. "diamond_balance ": DataMgr.getDiamond()
  8757. };
  8758. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8759. const d = LocalStorageManager.getItem(keyStr);
  8760. if (level > d.level) {
  8761. jsonStr.count = d.count + 1;
  8762. LocalStorageManager.setItem(keyStr, jsonStr);
  8763. }
  8764. else {
  8765. }
  8766. }
  8767. else {
  8768. LocalStorageManager.setItem(keyStr, jsonStr);
  8769. }
  8770. const reqStr = JSON.stringify(jsonStr);
  8771. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  8772. }
  8773. qjff_AD_for_uiGameEnd(level) {
  8774. DataMgr.setPlaceBallLevel(level, 1);
  8775. this.startPlaceBallLevel(level + 1);
  8776. }
  8777. startPlaceBallLevel(level) {
  8778. xGame.common.gameMode = GameMode.placeBall;
  8779. xGame.common.placeBallCurLevel = level;
  8780. xGame.uiMgr.Show(UIGame);
  8781. this.hide();
  8782. }
  8783. logEventForChallenge_level_complete(level) {
  8784. let keyStr = 'sjmd_challenge_level_complete';
  8785. let jsonStr = {
  8786. "count": 1,
  8787. "gold_balance ": DataMgr.getCoin(),
  8788. "level": level,
  8789. "diamond_balance ": DataMgr.getDiamond()
  8790. };
  8791. if (LocalStorageManager.hasJosnKey(keyStr)) {
  8792. const d = LocalStorageManager.getItem(keyStr);
  8793. jsonStr.count = d.count + 1;
  8794. LocalStorageManager.setItem(keyStr, jsonStr);
  8795. }
  8796. else {
  8797. LocalStorageManager.setItem(keyStr, jsonStr);
  8798. }
  8799. const reqStr = JSON.stringify(jsonStr);
  8800. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  8801. }
  8802. logEventForChallenge_level_N(level) {
  8803. console.log('zh:logEventForChallenge_level_N ' + level);
  8804. let keyStr = 'sjmd_challenge_level_N';
  8805. if (LocalStorageManager.hasKey(keyStr)) {
  8806. let lev = LocalStorageManager.getItem(keyStr);
  8807. if (level > lev) {
  8808. LocalStorageManager.setItem(keyStr, level);
  8809. }
  8810. if ((level) % 5 == 0) {
  8811. console.log('zh:每5关上报1次');
  8812. let sjmc = 'challenge_level_' + level;
  8813. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  8814. let sjmcForFirebase = 'challenge_level_' + level;
  8815. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  8816. }
  8817. else {
  8818. console.log('zh:5 no 上报');
  8819. }
  8820. }
  8821. else {
  8822. LocalStorageManager.setItem(keyStr, level);
  8823. }
  8824. }
  8825. }
  8826. UIGameEnd.uiName = "UIGameEnd";
  8827. class ui_UIVideoShare extends fgui.GComponent {
  8828. static createInstance() {
  8829. return (fgui.UIPackage.createObject("game", "UIVideoShare"));
  8830. }
  8831. onConstruct() {
  8832. this.n10 = (this.getChild("n10"));
  8833. this.myNode = (this.getChild("myNode"));
  8834. this.t0 = this.getTransition("t0");
  8835. }
  8836. }
  8837. ui_UIVideoShare.URL = "ui://isxx5ak7hkrz3tj";
  8838. class UIVideoShare extends UIBase {
  8839. constructor() {
  8840. super();
  8841. this.success = false;
  8842. this.awardNum = 0;
  8843. this.isShared = true;
  8844. }
  8845. onConstructor() {
  8846. this.ui = ui_UIVideoShare.createInstance();
  8847. this.contentPane = this.ui;
  8848. this.isEject = false;
  8849. this.addUIClick(this.ui.myNode.closeBtn, this.hideSelf);
  8850. this.addUIClick(this.ui.myNode.shareBtn, this.videoShare);
  8851. this.addUIClick(this.ui.myNode.share2Btn, this.shareGame);
  8852. this.addUIClick(this.ui.myNode.tipsNode.shareNode, this.checkForceShare);
  8853. }
  8854. show(success) {
  8855. super.show();
  8856. this.ui.myNode.screenNode.screenImg.displayObject.texture = xGame.common.screenImg;
  8857. this.ui.myNode.screenNode.screenImg.displayObject.scaleY = -1;
  8858. this.ui.myNode.screenNode.screenImg.displayObject.y = this.ui.myNode.screenNode.screenImg.y + this.ui.myNode.screenNode.screenImg.height * 0.5;
  8859. this.success = success;
  8860. let time = xGame.common.randomNum(600, 1500);
  8861. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  8862. if (success)
  8863. xGame.soundMgr.playSound("applause");
  8864. this.ui.t0.play();
  8865. this.checkShareState();
  8866. let times = DataMgr.getDailyVideoShareTimes();
  8867. this.awardNum = times == 0 ? 2000 : 200;
  8868. this.ui.myNode.awardNode.coinTxt.text = "x" + this.awardNum + "";
  8869. this.setGlobalFont(this.ui);
  8870. }
  8871. checkShareState() {
  8872. if (PlatMgr.forceShare == 0) {
  8873. this.ui.myNode.closeBtn.visible = true;
  8874. this.ui.myNode.tipsNode.visible = false;
  8875. this.ui.myNode.closeBtn.x = 90;
  8876. this.ui.myNode.shareBtn.x = 342;
  8877. }
  8878. else if (PlatMgr.forceShare == 1) {
  8879. this.ui.myNode.closeBtn.visible = false;
  8880. this.ui.myNode.tipsNode.visible = true;
  8881. this.ui.myNode.shareBtn.x = 218;
  8882. this.isShared = true;
  8883. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8884. }
  8885. }
  8886. checkForceShare() {
  8887. this.isShared = !this.isShared;
  8888. this.ui.myNode.tipsNode.shareNode.c1.selectedIndex = this.isShared ? 0 : 1;
  8889. }
  8890. videoShare() {
  8891. if (PlatMgr.forceShare == 1) {
  8892. if (this.isShared) {
  8893. this.shareGame();
  8894. }
  8895. else {
  8896. this.hideSelf();
  8897. }
  8898. }
  8899. else {
  8900. this.shareGame();
  8901. }
  8902. }
  8903. shareGame() {
  8904. Moyu.sendDataEvent("VideoShare");
  8905. if (Moyu.canShare() > 100) {
  8906. Moyu.shareGame((success) => {
  8907. if (success) {
  8908. DataMgr.setDailyVideoShareTimes(1);
  8909. DataMgr.setCoin(this.awardNum);
  8910. }
  8911. this.hideSelf();
  8912. }, this);
  8913. }
  8914. else {
  8915. xGame.uiMgr.Show(UIMsg, "录屏时间不足,分享失败");
  8916. this.hideSelf();
  8917. }
  8918. }
  8919. hideSelf() {
  8920. this.hide();
  8921. xGame.uiMgr.Show(UIGameEnd, this.success);
  8922. if (xGame.common.screenImg && !xGame.common.screenImg.destroyed) {
  8923. xGame.common.screenImg.destroy();
  8924. xGame.common.screenImg = null;
  8925. }
  8926. }
  8927. }
  8928. UIVideoShare.uiName = "UIVideoShare";
  8929. class GameMgr {
  8930. constructor() {
  8931. this.selfCamp = "";
  8932. this.selfFoulNum = 0;
  8933. this.selfBallArr = [];
  8934. this.selfTimer = 0;
  8935. this.selfScore = 0;
  8936. this.aiCamp = "";
  8937. this.aiFoulNum = 0;
  8938. this.aiBallArr = [];
  8939. this.aiTimer = 0;
  8940. this.aiScore = 0;
  8941. this.aiSkillLevelNum = 1;
  8942. this.targertScore = 0;
  8943. this.setTime = 30;
  8944. this.selfTurnRate = 0.5;
  8945. this.accTime = 0;
  8946. this.curFoul = "";
  8947. this.maxFoulTimes = 3;
  8948. this.isFirstInGame = true;
  8949. this.firstColliObj = null;
  8950. this.inHoleBalls = [];
  8951. this.blackNum = 8;
  8952. this.success = false;
  8953. this.holePosList = [];
  8954. this.posObj = {};
  8955. this._selfTurn = false;
  8956. this.lastRootBallPos = new Laya.Vector2(311, 430);
  8957. this.ensureBallType = false;
  8958. this.isOpenBall = true;
  8959. this.finishOneShoot = true;
  8960. this.isEnd = false;
  8961. this.isChangeTurn = false;
  8962. this.isInterrupt = false;
  8963. this.aiPlayedBreakArmy = false;
  8964. this.isTouchedBall = false;
  8965. this.finishBalls = 0;
  8966. this.needBalls = 0;
  8967. this.allBallNum = 0;
  8968. this.placeBallPosData = {};
  8969. this.curHP = 0;
  8970. this.showLongView = false;
  8971. this.firstShoot = true;
  8972. this._gamePause = false;
  8973. this.trunCount = 0;
  8974. this.isBlackInHole = false;
  8975. this.isEnter = true;
  8976. xGame.eventMgr.offAll(ALL_BALL_STOP);
  8977. xGame.eventMgr.on(ALL_BALL_STOP, this, this.gameRun);
  8978. xGame.eventMgr.off(BALL_SHOOT, this, this.ballShoot);
  8979. xGame.eventMgr.on(BALL_SHOOT, this, this.ballShoot);
  8980. xGame.eventMgr.off(FIRST_BALL_HOLE, this, this.ensureCamp);
  8981. xGame.eventMgr.on(FIRST_BALL_HOLE, this, this.ensureCamp);
  8982. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  8983. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  8984. }
  8985. get gamePause() {
  8986. return this._gamePause;
  8987. }
  8988. set gamePause(v) {
  8989. if (v) {
  8990. Laya.physicsTimer.pause();
  8991. }
  8992. else {
  8993. Laya.physicsTimer.resume();
  8994. }
  8995. this._gamePause = v;
  8996. }
  8997. get selfTurn() {
  8998. return this._selfTurn;
  8999. }
  9000. set selfTurn(val) {
  9001. this.trunCount++;
  9002. this._selfTurn = val;
  9003. if (val) {
  9004. xGame.common.d2World.d2Gan.ui.self.visible = true;
  9005. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9006. }
  9007. else {
  9008. xGame.common.d2World.d2Gan.ui.self.visible = false;
  9009. xGame.common.d2World.d2Gan.ui.ai.visible = true;
  9010. if (this.trunCount > 1)
  9011. PlatMgr.openBox();
  9012. }
  9013. }
  9014. resetGame() {
  9015. this.inHoleBalls = [];
  9016. this.isFirstInGame = true;
  9017. this.firstColliObj = null;
  9018. this.aiCamp = "";
  9019. this.selfCamp = "";
  9020. this.aiFoulNum = 0;
  9021. this.selfFoulNum = 0;
  9022. this.selfBallArr = [];
  9023. this.aiBallArr = [];
  9024. this.gamePause = false;
  9025. this.ensureBallType = false;
  9026. this.isInterrupt = false;
  9027. this.updateLeftBall();
  9028. this.clearTime();
  9029. this.aiPlayedBreakArmy = false;
  9030. this.isBlackInHole = false;
  9031. this.placeBallPosData = {};
  9032. if (xGame.common.d3World.knifeRoot) {
  9033. xGame.common.d3World.knifeRoot.destroyChildren();
  9034. }
  9035. }
  9036. gameReady() {
  9037. this.trunCount = 0;
  9038. this.firstColliObj = null;
  9039. this.isFirstInGame = true;
  9040. this.selfTurn = Math.random() <= this.selfTurnRate;
  9041. let challengeNum = DataMgr.getChallengeTimes();
  9042. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  9043. this.selfTurn = true;
  9044. }
  9045. if (xGame.common.gameMode == GameMode.placeBall)
  9046. this.selfTurn = true;
  9047. if (xGame.common.gameMode == GameMode.bigMove && !DataMgr.getSkillGuide()) {
  9048. this.selfTurn = true;
  9049. }
  9050. xGame.common.gameUI.setTurnAlpha(this.selfTurn);
  9051. this.checkGuide();
  9052. this.checkGuideForPlaceBall();
  9053. if (xGame.common.uiRodMethod)
  9054. xGame.common.uiRodMethod.resetRod();
  9055. xGame.common.d2World.getHelpLine();
  9056. this.isOpenBall = true;
  9057. this.isTouchedBall = false;
  9058. xGame.common.aiPlayer.stopRun();
  9059. this.setTime = 30;
  9060. let ui = xGame.common.gameUI.ui;
  9061. switch (xGame.common.gameMode) {
  9062. case GameMode.classic:
  9063. xGame.common.aiPlayer.init();
  9064. this.blackNum = 8;
  9065. this.placeRootBall();
  9066. this.peoplePlay(9, 10);
  9067. ui.wordsBtn.visible = true;
  9068. ui.aiWordsBtn.visible = true;
  9069. xGame.common.talkMgr.changeAIState(true);
  9070. DataMgr.gameData.gameCount++;
  9071. DataMgr.saveGameData();
  9072. break;
  9073. case GameMode.bigMove:
  9074. this.blackNum = -1;
  9075. this.selfScore = 0;
  9076. this.aiScore = 0;
  9077. xGame.common.aiPlayer.init();
  9078. this.targertScore = cfgTable.bigmoveData[xGame.common.bigMoveLevelIndex].target;
  9079. this.updateSelfScore();
  9080. this.updateAIScore();
  9081. this.updateTargetSroce();
  9082. this.placeRootBall();
  9083. this.peoplePlay(9, 10);
  9084. ui.wordsBtn.visible = true;
  9085. ui.aiWordsBtn.visible = true;
  9086. xGame.common.talkMgr.changeAIState(true);
  9087. if (DataMgr.getSkillGuide() < 1)
  9088. DataMgr.gameData.gameCount = 0;
  9089. else {
  9090. DataMgr.gameData.gameCount++;
  9091. DataMgr.saveGameData();
  9092. PlatMgr.openTry();
  9093. }
  9094. if (xGame.common.d3World.knifeRoot) {
  9095. xGame.common.d3World.knifeRoot.destroyChildren();
  9096. }
  9097. break;
  9098. case GameMode.placeBall:
  9099. this.blackNum = -1;
  9100. this.selfTurn = true;
  9101. this.setTime = 10000;
  9102. this.placeBallData = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  9103. this.curHP = this.placeBallData.hp;
  9104. if (this.placeBallData.ball == -1)
  9105. this.needBalls = xGame.common.d2World.ballArr.length - 1;
  9106. else
  9107. this.needBalls = this.placeBallData.ball;
  9108. console.log("需要的进球数目", this.needBalls);
  9109. this.allBallNum = xGame.common.d2World.ballArr.length - 1;
  9110. this.finishBalls = 0;
  9111. this.placeBallPosData = {};
  9112. this.updatePlaceBallPos();
  9113. this.updatePlaceBallState();
  9114. this.finishOneShoot = true;
  9115. xGame.common.gameUI.ui.moveNode.visible = false;
  9116. this.isOpenBall = false;
  9117. xGame.common.d2World.d2Gan.ui.ai.visible = false;
  9118. ui.wordsBtn.visible = false;
  9119. ui.aiWordsBtn.visible = false;
  9120. xGame.common.talkMgr.changeAIState(false);
  9121. Laya.timer.frameOnce(xGame.tools.random(2000, 5100), this, () => {
  9122. PlatMgr.openBox();
  9123. });
  9124. break;
  9125. default:
  9126. break;
  9127. }
  9128. this.showLongView = false;
  9129. xGame.common.wordsMgr.comboTimes = 1;
  9130. let guide = DataMgr.getSkillGuide();
  9131. if (guide)
  9132. xGame.eventMgr.event(WAIT_SHOOT);
  9133. xGame.common.upSkillLevel = false;
  9134. xGame.common.gameStartTime = new Date().getTime();
  9135. this.firstShoot = true;
  9136. }
  9137. checkGuide() {
  9138. console.log('zh: 检查引导123');
  9139. let guide = DataMgr.getSkillGuide();
  9140. let gameUI = xGame.common.gameUI.ui;
  9141. gameUI.guide1.visible = false;
  9142. gameUI.guide2.visible = false;
  9143. gameUI.guide3.visible = false;
  9144. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  9145. this.selfTurn = true;
  9146. }
  9147. else {
  9148. return;
  9149. }
  9150. let oneBall = this.getOneBall();
  9151. gameUI.guide1.visible = true;
  9152. gameUI.guide1.fingerNode.x = oneBall.gameObj.x;
  9153. gameUI.guide1.fingerNode.y = oneBall.gameObj.y;
  9154. }
  9155. checkGuideForPlaceBall() {
  9156. console.log('zh: 检查引导123 checkGuideForPlaceBall');
  9157. let gameUI = xGame.common.gameUI.ui;
  9158. let guide = DataMgr.getLianXiGuide();
  9159. console.log('zh:checkGuideForPlaceBall =', guide);
  9160. console.log('zh:xGame.common.gameMode=' + xGame.common.gameMode);
  9161. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  9162. gameUI.n_lxms_yd1.visible = true;
  9163. }
  9164. else {
  9165. gameUI.n_lxms_yd1.visible = false;
  9166. return;
  9167. }
  9168. let oneBall = this.getOneBallForPlaceBall();
  9169. gameUI.n_lxms_yd1.visible = true;
  9170. gameUI.n_lxms_yd1.fingerNode.x = oneBall.gameObj.x + 30;
  9171. gameUI.n_lxms_yd1.fingerNode.y = oneBall.gameObj.y;
  9172. }
  9173. getOneBall() {
  9174. let arr = xGame.common.d2World.ballArr;
  9175. for (let index = 0; index < arr.length; index++) {
  9176. if (arr[index].number == 0)
  9177. continue;
  9178. return arr[index];
  9179. }
  9180. }
  9181. getOneBallForPlaceBall() {
  9182. let arr = xGame.common.d2World.ballArr;
  9183. return arr[2];
  9184. }
  9185. updateSelfScore() {
  9186. let ui = xGame.common.gameUI.ui.topNode;
  9187. ui.selfScoreTxt.text = this.selfScore + "";
  9188. }
  9189. updateAIScore() {
  9190. let ui = xGame.common.gameUI.ui.topNode;
  9191. ui.aiScoreTxt.text = this.aiScore + "";
  9192. }
  9193. updateTargetSroce() {
  9194. let ui = xGame.common.gameUI.ui.topNode;
  9195. ui.middleNode.targetScoreTxt.text = this.targertScore + "";
  9196. }
  9197. updateLeftBall() {
  9198. let topUI = xGame.common.gameUI.ui.topNode;
  9199. topUI.selfBallList.numItems = this.selfBallArr.length;
  9200. topUI.aiBallList.numItems = this.aiBallArr.length;
  9201. }
  9202. ballShoot() {
  9203. this.clearTime();
  9204. this.finishOneShoot = false;
  9205. xGame.common.gameUI.ui.moveNode.visible = false;
  9206. if (xGame.common.gameUI.ui.guideNode.visible) {
  9207. xGame.common.gameUI.ui.guideNode.visible = false;
  9208. }
  9209. if (this.firstShoot) {
  9210. this.firstShoot = false;
  9211. Moyu.sendDataEvent(`gameType${xGame.common.gameMode}`);
  9212. }
  9213. }
  9214. ensureCamp(number) {
  9215. this.ensureBallType = true;
  9216. this.isOpenBall = false;
  9217. if (xGame.common.gameMode != GameMode.classic)
  9218. return;
  9219. let full = [1, 2, 3, 4, 5, 6, 7];
  9220. let flower = [9, 10, 11, 12, 13, 14, 15];
  9221. let sayWords = "";
  9222. if (this.selfTurn) {
  9223. if (number <= 7) {
  9224. this.selfCamp = ballCamp.full;
  9225. this.selfBallArr = full;
  9226. this.aiCamp = ballCamp.flower;
  9227. this.aiBallArr = flower;
  9228. sayWords = cfgTable.wordsData[3].msg;
  9229. }
  9230. else {
  9231. this.selfCamp = ballCamp.flower;
  9232. this.selfBallArr = flower;
  9233. this.aiCamp = ballCamp.full;
  9234. this.aiBallArr = full;
  9235. sayWords = cfgTable.wordsData[4].msg;
  9236. }
  9237. }
  9238. else {
  9239. if (number <= 7) {
  9240. this.selfCamp = ballCamp.flower;
  9241. this.selfBallArr = flower;
  9242. this.aiCamp = ballCamp.full;
  9243. this.aiBallArr = full;
  9244. sayWords = cfgTable.wordsData[2].msg;
  9245. }
  9246. else {
  9247. this.selfCamp = ballCamp.full;
  9248. this.selfBallArr = full;
  9249. this.aiCamp = ballCamp.flower;
  9250. this.aiBallArr = flower;
  9251. sayWords = cfgTable.wordsData[1].msg;
  9252. }
  9253. }
  9254. this.updateLeftBall();
  9255. xGame.uiMgr.Show(UIMsg, sayWords);
  9256. }
  9257. updatePlaceBallState() {
  9258. let ui = xGame.common.gameUI.ui;
  9259. switch (this.placeBallData.type) {
  9260. case PlaceBallType.normal:
  9261. let normal = ui.placeNormalNode;
  9262. normal.hpTxt.text = this.curHP + "";
  9263. this.updatePlaceBallStar(normal);
  9264. normal.ballTxt.text = this.finishBalls + "/" + this.needBalls;
  9265. normal.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9266. break;
  9267. case PlaceBallType.challenge:
  9268. let challenge = ui.placeChallengeNode;
  9269. challenge.hpTxt.text = "Shots:" + this.curHP;
  9270. challenge.ballTxt.text = this.finishBalls + "/" + this.allBallNum;
  9271. challenge.levelTxt.text = `Level ${xGame.common.placeBallCurLevel}`;
  9272. challenge.tipsTxt.text = `Pocket ${this.needBalls} balls `;
  9273. break;
  9274. default:
  9275. break;
  9276. }
  9277. }
  9278. playSubHpAni() {
  9279. let ui = xGame.common.gameUI.ui;
  9280. switch (this.placeBallData.type) {
  9281. case PlaceBallType.normal:
  9282. let normal = ui.placeNormalNode;
  9283. normal.hpTxt.visible = false;
  9284. normal.starAni.c1.selectedIndex = 1;
  9285. normal.starAni.t0.play(Laya.Handler.create(this, () => {
  9286. normal.hpTxt.visible = true;
  9287. normal.starAni.c1.selectedIndex = 0;
  9288. }));
  9289. break;
  9290. default:
  9291. break;
  9292. }
  9293. }
  9294. getEndStarNum() {
  9295. let num;
  9296. let level = xGame.common.placeBallCurLevel;
  9297. if (this.curHP == this.placeBallData.hp) {
  9298. num = 3;
  9299. }
  9300. else if (this.curHP <= 1) {
  9301. num = 1;
  9302. }
  9303. else {
  9304. num = 2;
  9305. }
  9306. if (!this.success) {
  9307. num = 0;
  9308. }
  9309. else {
  9310. DataMgr.setPlaceBallLevel(level, num);
  9311. }
  9312. let myType = cfgTable.placeballData[level].type;
  9313. if (this.success && myType == 1) {
  9314. num = 3;
  9315. }
  9316. xGame.common.placeBallStarNum = num;
  9317. }
  9318. updatePlaceBallStar(node) {
  9319. let star = 0;
  9320. if (this.curHP == this.placeBallData.hp) {
  9321. star = 3;
  9322. }
  9323. else if (this.curHP >= 2) {
  9324. star = 2;
  9325. }
  9326. else if (this.curHP == 1) {
  9327. star = 1;
  9328. }
  9329. else {
  9330. star = 0;
  9331. }
  9332. let temp;
  9333. for (let index = 1; index <= 3; index++) {
  9334. temp = node["star" + index];
  9335. temp.c1.selectedIndex = star >= index ? 1 : 0;
  9336. }
  9337. node.myProgress.value = (star / 3) * 100;
  9338. }
  9339. openRegretView(isFoul, GoalNum, challenge = false) {
  9340. let regretType = -1;
  9341. if (isFoul) {
  9342. regretType = 1;
  9343. }
  9344. else {
  9345. if (GoalNum <= 0) {
  9346. regretType = 0;
  9347. }
  9348. }
  9349. if (challenge) {
  9350. regretType = 1;
  9351. }
  9352. if (regretType != -1) {
  9353. xGame.uiMgr.Show(UIRepentProp, 1, regretType, (success) => {
  9354. if (success) {
  9355. this.curHP++;
  9356. this.updatePlaceBallState();
  9357. this.setPlaceBallAllPos();
  9358. xGame.common.gameUI.ui.moveNode.visible = false;
  9359. }
  9360. else {
  9361. if (this.curHP <= 0) {
  9362. this.success = false;
  9363. this.gameEnd();
  9364. }
  9365. this.playSubHpAni();
  9366. }
  9367. this.updatePlaceBallState();
  9368. this.updatePlaceBallPos();
  9369. });
  9370. }
  9371. }
  9372. setPlaceBallAllPos() {
  9373. let allBall = xGame.common.d2World.ballArr;
  9374. let cfgArr = this.placeBallPosData;
  9375. let temp;
  9376. let obj;
  9377. for (let index = 0; index < allBall.length; index++) {
  9378. temp = allBall[index];
  9379. if (temp.destroyed)
  9380. continue;
  9381. obj = cfgArr[temp.myUNID];
  9382. if (obj && obj.src && !obj.src.destroyed) {
  9383. temp.gameObj.x = obj.posX;
  9384. temp.gameObj.y = obj.posY;
  9385. temp.d3BallSrc.setTransPos(obj.posX, obj.posY);
  9386. }
  9387. }
  9388. xGame.common.d2World.getHelpLine();
  9389. }
  9390. updatePlaceBallPos() {
  9391. let arr = xGame.common.d2World.ballArr;
  9392. let temp;
  9393. for (let index = 0; index < arr.length; index++) {
  9394. temp = arr[index];
  9395. if (!this.placeBallPosData[temp.myUNID]) {
  9396. this.placeBallPosData[temp.myUNID] = {
  9397. src: temp,
  9398. posX: temp.gameObj.x,
  9399. posY: temp.gameObj.y
  9400. };
  9401. }
  9402. else {
  9403. this.placeBallPosData[temp.myUNID].posX = temp.gameObj.x;
  9404. this.placeBallPosData[temp.myUNID].posY = temp.gameObj.y;
  9405. }
  9406. }
  9407. let check;
  9408. for (const key in this.placeBallPosData) {
  9409. check = this.placeBallPosData[key];
  9410. if (check.src.destroyed) {
  9411. delete this.placeBallPosData[key];
  9412. }
  9413. }
  9414. }
  9415. gameRun(type) {
  9416. if (this.gamePause)
  9417. return;
  9418. this.curFoul = this.getFoulType();
  9419. if (type) {
  9420. xGame.common.d2World.d2Gan.shoot();
  9421. xGame.common.gameUI.forceCancel();
  9422. this.curFoul = type;
  9423. }
  9424. this.isEnd = false;
  9425. this.isChangeTurn = true;
  9426. if (xGame.common.gameMode == GameMode.classic) {
  9427. this.judgeClassic(this.curFoul);
  9428. this.checkClassicWords(() => {
  9429. xGame.common.destroyClassicEmotion();
  9430. if (this.isEnd) {
  9431. if (this.isBlackInHole) {
  9432. xGame.common.gameUI.ui.blackAni.visible = true;
  9433. xGame.common.gameUI.ui.blackAni.t0.play(Laya.Handler.create(this, () => {
  9434. xGame.common.gameUI.ui.blackAni.visible = false;
  9435. this.gameEnd();
  9436. }));
  9437. }
  9438. else {
  9439. this.gameEnd();
  9440. }
  9441. }
  9442. else {
  9443. this.waitShoot();
  9444. xGame.eventMgr.event(WAIT_SHOOT);
  9445. }
  9446. });
  9447. }
  9448. else if (xGame.common.gameMode == GameMode.bigMove) {
  9449. xGame.common.aiPlayer.stopRun();
  9450. let scoreArr = this.getScore(this.curFoul);
  9451. if (this.judgeScoreEnd(scoreArr[0], scoreArr[1])) {
  9452. this.isEnd = true;
  9453. }
  9454. this.checkBigSkillWords(() => {
  9455. if (this.isEnd) {
  9456. this.gameEnd();
  9457. }
  9458. else {
  9459. this.waitShoot();
  9460. xGame.eventMgr.event(WAIT_SHOOT);
  9461. }
  9462. });
  9463. }
  9464. else if (xGame.common.gameMode == GameMode.placeBall) {
  9465. xGame.common.destroyAwardSpine();
  9466. let isFoul = this.curFoul == FoulType.rootHole;
  9467. let GoalNum = this.inHoleBalls.length;
  9468. if (this.inHoleBalls.indexOf(0) > -1)
  9469. GoalNum -= 1;
  9470. if (isFoul) {
  9471. this.placeRootBall();
  9472. }
  9473. console.log("neeballs", this.needBalls);
  9474. console.log("当前完成的goalNum", GoalNum);
  9475. this.finishBalls += GoalNum;
  9476. console.log("当前完成的finishballs", this.finishBalls);
  9477. let need = this.needBalls;
  9478. if (this.placeBallData.type == PlaceBallType.challenge) {
  9479. need += 100;
  9480. }
  9481. if (this.finishBalls >= need) {
  9482. this.success = true;
  9483. this.gameEnd();
  9484. }
  9485. else {
  9486. switch (this.placeBallData.type) {
  9487. case PlaceBallType.normal:
  9488. if (!isFoul && GoalNum > 0) {
  9489. this.updatePlaceBallPos();
  9490. this.updatePlaceBallState();
  9491. }
  9492. else {
  9493. this.curHP--;
  9494. this.openRegretView(isFoul, GoalNum);
  9495. }
  9496. this.waitShoot();
  9497. xGame.eventMgr.event(WAIT_SHOOT);
  9498. break;
  9499. case PlaceBallType.challenge:
  9500. this.curHP--;
  9501. this.updatePlaceBallState();
  9502. if (isFoul) {
  9503. this.openRegretView(isFoul, GoalNum, true);
  9504. }
  9505. else {
  9506. this.updatePlaceBallPos();
  9507. if (this.curHP <= 0) {
  9508. this.success = true;
  9509. this.gameEnd();
  9510. }
  9511. }
  9512. this.waitShoot();
  9513. xGame.eventMgr.event(WAIT_SHOOT);
  9514. break;
  9515. default:
  9516. break;
  9517. }
  9518. }
  9519. }
  9520. }
  9521. checkClassicWords(callback) {
  9522. xGame.common.wordsMgr.setClassicCombo(this.isChangeTurn);
  9523. let condition = !this.isChangeTurn && (this.curFoul == "" || this.curFoul == FoulType.wrongTouch);
  9524. let type = this.getClassicWordsType();
  9525. if (condition && type != -1) {
  9526. let str = Math.random() <= 0.5 ? "hint01" : "hint02";
  9527. xGame.soundMgr.playSound(str);
  9528. xGame.common.wordsMgr.playClassicWords(type, callback);
  9529. }
  9530. else {
  9531. Laya.timer.once(300, this, () => {
  9532. callback && callback();
  9533. });
  9534. }
  9535. }
  9536. getClassicWordsType() {
  9537. let d2world = xGame.common.d2World;
  9538. let type = -1;
  9539. if (!this.isInterrupt && this.judgeNormalSuccess()) {
  9540. type = ClassicWordsType.perfectShow;
  9541. return type;
  9542. }
  9543. if (this.inHoleBalls.length == 1 && d2world.targetBall && this.inHoleBalls[0] == d2world.targetBall.number && d2world.isOnSameLine) {
  9544. type = ClassicWordsType.directShoot;
  9545. return type;
  9546. }
  9547. if (this.inHoleBalls.length > 0 && (d2world.targetBall == null || this.inHoleBalls.indexOf(d2world.targetBall.number) <= -1)) {
  9548. type = ClassicWordsType.anotherShoot;
  9549. return type;
  9550. }
  9551. if (d2world.powerPercent == 100 && this.inHoleBalls.length > 0) {
  9552. type = ClassicWordsType.bigPower;
  9553. return type;
  9554. }
  9555. let minSpeed = 1;
  9556. if (this.inHoleBalls.length == 1 && xGame.common.d2World.inHolesSpeed[0] <= minSpeed) {
  9557. type = ClassicWordsType.hardShoot;
  9558. return type;
  9559. }
  9560. if (this.inHoleBalls.length > 0) {
  9561. type = ClassicWordsType.directShoot;
  9562. return type;
  9563. }
  9564. return type;
  9565. }
  9566. checkBigSkillWords(callback) {
  9567. if (this.curFoul == FoulType.timeOut) {
  9568. callback && callback();
  9569. }
  9570. else {
  9571. let playSkill = false;
  9572. if (this.selfTurn) {
  9573. playSkill = true;
  9574. }
  9575. else {
  9576. if (!this.aiPlayedBreakArmy) {
  9577. this.aiPlayedBreakArmy = true;
  9578. playSkill = true;
  9579. }
  9580. if (this.aiCurSkill != SkillType.breakArmy) {
  9581. playSkill = true;
  9582. }
  9583. }
  9584. if (xGame.common.skillMgr.playedLastSkill) {
  9585. xGame.common.skillMgr.playedLastSkill = false;
  9586. playSkill = false;
  9587. }
  9588. if (playSkill) {
  9589. xGame.common.skillMgr.runBigSkill((extraScore) => {
  9590. let selfExtra = 0;
  9591. let aiExtra = 0;
  9592. if (this.selfTurn)
  9593. selfExtra += extraScore;
  9594. else
  9595. aiExtra += extraScore;
  9596. if (this.judgeScoreEnd(selfExtra, aiExtra)) {
  9597. this.isEnd = true;
  9598. }
  9599. this.playBigSkillTimes(callback);
  9600. });
  9601. }
  9602. else {
  9603. this.playBigSkillTimes(callback);
  9604. }
  9605. }
  9606. }
  9607. playBigSkillTimes(callback) {
  9608. let length = this.inHoleBalls.length;
  9609. if (this.inHoleBalls.indexOf(0) > -1) {
  9610. length = this.inHoleBalls.length - 1;
  9611. }
  9612. if (length <= 0) {
  9613. callback && callback();
  9614. return;
  9615. }
  9616. xGame.common.wordsMgr.playBigSkillTimes(length, () => {
  9617. callback && callback();
  9618. });
  9619. }
  9620. playSkillTips() {
  9621. let levelNum = 0;
  9622. let curType;
  9623. if (this.selfTurn) {
  9624. levelNum = DataMgr.getBigSkillByIndex(this.selfCurSkill);
  9625. curType = this.selfCurSkill;
  9626. if (curType == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  9627. levelNum += 5;
  9628. }
  9629. }
  9630. else {
  9631. levelNum = this.aiSkillLevelNum;
  9632. curType = this.aiCurSkill;
  9633. }
  9634. let str = ``;
  9635. switch (curType) {
  9636. case SkillType.highSpace:
  9637. str = `An extra ${xGame.common.extraMoveNum} balls were moved`;
  9638. break;
  9639. case SkillType.breakArmy:
  9640. str = `You pocketed ${levelNum} extra balls`;
  9641. break;
  9642. case SkillType.ice:
  9643. str = `${levelNum * 2} extra balls were frozen`;
  9644. break;
  9645. case SkillType.fireworks:
  9646. str = `${levelNum} extra balls exploded `;
  9647. break;
  9648. case SkillType.GuanYu:
  9649. str = `There were ${xGame.common.extraMoveNum} displacement movements`;
  9650. break;
  9651. default:
  9652. break;
  9653. }
  9654. xGame.uiMgr.Show(UIMsg, str);
  9655. }
  9656. getFoulType() {
  9657. let foulType = "";
  9658. if (this.firstColliObj == null) {
  9659. if (this.inHoleBalls.length == 1 && this.inHoleBalls[0] == 0) {
  9660. return FoulType.rootHole;
  9661. }
  9662. return FoulType.notTouch;
  9663. }
  9664. else {
  9665. if (this.selfTurn) {
  9666. if (this.selfBallArr.length > 0) {
  9667. if (this.selfBallArr.indexOf(this.firstColliObj) <= -1) {
  9668. foulType = FoulType.wrongTouch;
  9669. }
  9670. }
  9671. else {
  9672. if (this.ensureBallType) {
  9673. }
  9674. else {
  9675. if (this.firstColliObj == this.blackNum) {
  9676. foulType = FoulType.wrongTouch;
  9677. }
  9678. }
  9679. }
  9680. }
  9681. else {
  9682. if (this.aiBallArr.length > 0) {
  9683. if (this.aiBallArr.indexOf(this.firstColliObj) <= -1) {
  9684. foulType = FoulType.wrongTouch;
  9685. }
  9686. }
  9687. else {
  9688. if (this.ensureBallType) {
  9689. }
  9690. else {
  9691. if (this.firstColliObj == this.blackNum) {
  9692. foulType = FoulType.wrongTouch;
  9693. }
  9694. }
  9695. }
  9696. }
  9697. if (this.inHoleBalls.length <= 0) {
  9698. return foulType;
  9699. }
  9700. let temp;
  9701. if (this.inHoleBalls.indexOf(0) > -1) {
  9702. foulType = FoulType.rootHole;
  9703. }
  9704. else {
  9705. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9706. temp = this.inHoleBalls[index];
  9707. if (this.selfTurn) {
  9708. if (this.aiBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9709. foulType = FoulType.wrongHole;
  9710. break;
  9711. }
  9712. }
  9713. else {
  9714. if (this.selfBallArr.indexOf(temp) > -1 && !this.isOpenBall) {
  9715. foulType = FoulType.wrongHole;
  9716. break;
  9717. }
  9718. }
  9719. }
  9720. }
  9721. let foo;
  9722. for (let index = 0; index < this.inHoleBalls.length; index++) {
  9723. temp = this.inHoleBalls[index];
  9724. foo = this.selfBallArr.indexOf(temp);
  9725. if (foo > -1) {
  9726. this.selfBallArr.splice(foo, 1);
  9727. }
  9728. foo = this.aiBallArr.indexOf(temp);
  9729. if (foo > -1) {
  9730. this.aiBallArr.splice(foo, 1);
  9731. }
  9732. }
  9733. this.updateLeftBall();
  9734. }
  9735. return foulType;
  9736. }
  9737. judgeGameEndByBlack(arr) {
  9738. if (this.selfTurn) {
  9739. if (this.selfBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9740. this.selfFoulNum = this.maxFoulTimes;
  9741. return true;
  9742. }
  9743. }
  9744. else {
  9745. if (this.aiBallArr.length > 0 && arr.indexOf(this.blackNum) > -1) {
  9746. this.aiFoulNum = this.maxFoulTimes;
  9747. return true;
  9748. }
  9749. }
  9750. }
  9751. judgeClassic(type) {
  9752. this.isBlackInHole = this.judgeGameEndByBlack(this.inHoleBalls);
  9753. xGame.common.aiPlayer.stopRun();
  9754. if (this.judgeNormalSuccess()) {
  9755. this.isEnd = true;
  9756. return;
  9757. }
  9758. let isFoul = (type == FoulType.timeOut || type == FoulType.rootHole);
  9759. if (this.selfTurn) {
  9760. if (isFoul) {
  9761. this.selfFoulNum++;
  9762. }
  9763. if (this.selfFoulNum >= this.maxFoulTimes) {
  9764. this.success = false;
  9765. this.isEnd = true;
  9766. return;
  9767. }
  9768. }
  9769. else {
  9770. if (isFoul)
  9771. this.aiFoulNum++;
  9772. if (this.aiFoulNum >= this.maxFoulTimes) {
  9773. this.success = true;
  9774. this.isEnd = true;
  9775. return;
  9776. }
  9777. }
  9778. if ((type == "" || type == FoulType.wrongTouch) && this.inHoleBalls.length > 0) {
  9779. this.isChangeTurn = false;
  9780. }
  9781. else {
  9782. this.isInterrupt = true;
  9783. }
  9784. }
  9785. waitShoot() {
  9786. if (xGame.common.gameMode == GameMode.classic) {
  9787. switch (this.curFoul) {
  9788. case FoulType.timeOut:
  9789. case FoulType.rootHole:
  9790. this.selfTurn = !this.selfTurn;
  9791. this.peoplePlay(5, 6, true);
  9792. break;
  9793. case FoulType.notTouch:
  9794. this.selfTurn = !this.selfTurn;
  9795. this.peoplePlay(7, 7);
  9796. break;
  9797. case FoulType.wrongHole:
  9798. this.selfTurn = !this.selfTurn;
  9799. this.peoplePlay(11, 11);
  9800. break;
  9801. default:
  9802. if (this.inHoleBalls.length > 0) {
  9803. this.peoplePlay(0, 0, false, false);
  9804. }
  9805. else {
  9806. this.selfTurn = !this.selfTurn;
  9807. this.peoplePlay(7, 7);
  9808. }
  9809. break;
  9810. }
  9811. }
  9812. else if (xGame.common.gameMode == GameMode.bigMove) {
  9813. if (this.curFoul == FoulType.timeOut) {
  9814. this.selfTurn = !this.selfTurn;
  9815. this.peoplePlay(14, 15);
  9816. this.placeRootBall();
  9817. }
  9818. else {
  9819. this.selfTurn = !this.selfTurn;
  9820. if (this.curFoul == FoulType.rootHole) {
  9821. this.peoplePlay(12, 13);
  9822. this.placeRootBall();
  9823. }
  9824. else {
  9825. this.peoplePlay(0, 0, false, false);
  9826. }
  9827. }
  9828. }
  9829. else if (xGame.common.gameMode == GameMode.placeBall) {
  9830. this.finishOneShoot = true;
  9831. }
  9832. this.gameResult();
  9833. }
  9834. gameResult() {
  9835. this.firstColliObj = null;
  9836. this.inHoleBalls = [];
  9837. let curX = xGame.common.d2World.rootBall.gameObj.x;
  9838. let curY = xGame.common.d2World.rootBall.gameObj.y;
  9839. xGame.common.gameMgr.lastRootBallPos.setValue(curX, curY);
  9840. if (xGame.common.uiRodMethod)
  9841. xGame.common.uiRodMethod.resetRod();
  9842. xGame.common.d2World.rootBall.showSelf();
  9843. this.clearIceSkill();
  9844. if (this.selfTurn) {
  9845. PlatMgr.gameInsert();
  9846. }
  9847. xGame.common.d3World.knifeRoot.destroyChildren();
  9848. if (this.selfTurn) {
  9849. xGame.common.gameUI.showHelpLineGuide();
  9850. xGame.common.gameUI.setTurnAlpha(true);
  9851. }
  9852. else {
  9853. xGame.common.gameUI.setTurnAlpha(false);
  9854. }
  9855. }
  9856. getScore(type) {
  9857. let selfAdd = 0;
  9858. let aiAdd = 0;
  9859. if (type == FoulType.timeOut) {
  9860. if (this.selfTurn)
  9861. aiAdd += 3;
  9862. else
  9863. selfAdd += 3;
  9864. }
  9865. else {
  9866. if (this.inHoleBalls.length > 0) {
  9867. if (this.selfTurn) {
  9868. if (type == FoulType.rootHole) {
  9869. aiAdd += 3;
  9870. if (this.inHoleBalls.length - 1 > 0) {
  9871. selfAdd += this.inHoleBalls.length - 1;
  9872. }
  9873. }
  9874. else {
  9875. selfAdd += this.inHoleBalls.length;
  9876. }
  9877. }
  9878. else {
  9879. if (type == FoulType.rootHole) {
  9880. selfAdd += 3;
  9881. if (this.inHoleBalls.length - 1 > 0) {
  9882. aiAdd += this.inHoleBalls.length - 1;
  9883. }
  9884. }
  9885. else {
  9886. aiAdd += this.inHoleBalls.length;
  9887. }
  9888. }
  9889. }
  9890. }
  9891. return [selfAdd, aiAdd];
  9892. }
  9893. judgeScoreEnd(selfAdd, aiAdd) {
  9894. this.selfScore += selfAdd;
  9895. this.aiScore += aiAdd;
  9896. this.updateAIScore();
  9897. this.updateSelfScore();
  9898. if (this.selfScore >= this.targertScore) {
  9899. this.success = true;
  9900. return true;
  9901. }
  9902. if (this.aiScore >= this.targertScore) {
  9903. this.success = false;
  9904. return true;
  9905. }
  9906. let ballArr = xGame.common.d2World.ballArr;
  9907. if (ballArr.length == 1 && ballArr[0].number == 0) {
  9908. if (this.selfScore > this.aiScore) {
  9909. this.success = true;
  9910. return true;
  9911. }
  9912. else if (this.selfScore < this.aiScore) {
  9913. this.success = false;
  9914. return true;
  9915. }
  9916. else {
  9917. if (this.selfTurn) {
  9918. this.success = false;
  9919. }
  9920. else {
  9921. this.success = true;
  9922. }
  9923. return true;
  9924. }
  9925. }
  9926. }
  9927. clearIceSkill() {
  9928. let arr = xGame.common.d2World.ballArr;
  9929. let temp;
  9930. if (this.selfTurn) {
  9931. if (this.selfCurSkill == SkillType.ice) {
  9932. for (let index = 0; index < arr.length; index++) {
  9933. temp = arr[index];
  9934. if (temp.ballFunc == "ice") {
  9935. temp.setBallFunc("normal", "self");
  9936. }
  9937. }
  9938. }
  9939. }
  9940. else {
  9941. if (this.aiCurSkill == SkillType.ice) {
  9942. for (let index = 0; index < arr.length; index++) {
  9943. temp = arr[index];
  9944. if (temp.ballFunc == "ice") {
  9945. temp.setBallFunc("normal", "ai");
  9946. }
  9947. }
  9948. }
  9949. }
  9950. }
  9951. judgeNormalSuccess() {
  9952. if (this.selfTurn) {
  9953. if (this.selfBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9954. this.success = true;
  9955. return true;
  9956. }
  9957. }
  9958. else {
  9959. if (this.aiBallArr.length <= 0 && this.inHoleBalls.indexOf(this.blackNum) > -1) {
  9960. this.success = false;
  9961. return true;
  9962. }
  9963. }
  9964. }
  9965. gameEnd() {
  9966. if (Moyu.isTT) {
  9967. xGame.common.screenImg = getScreenImg();
  9968. }
  9969. console.log("游戏结束", this.success);
  9970. xGame.common.aiPlayer.stopRun();
  9971. if (xGame.common.gameMode == GameMode.placeBall) {
  9972. this.getEndStarNum();
  9973. this.updatePlaceBallState();
  9974. }
  9975. this.isEnter = false;
  9976. Moyu.recordEnd(this, () => {
  9977. if (this.isEnter)
  9978. return;
  9979. this.isEnter = true;
  9980. console.log("进入录结束回调");
  9981. this.enterNext();
  9982. });
  9983. Laya.timer.once(1000, this, () => {
  9984. if (this.isEnter)
  9985. return;
  9986. this.isEnter = true;
  9987. this.enterNext();
  9988. });
  9989. xGame.common.longHelpLine = false;
  9990. }
  9991. enterNext() {
  9992. Laya.timer.clearAll(this);
  9993. if (Moyu.canShare() > 100 || Moyu.isKs) {
  9994. xGame.uiMgr.Show(UIVideoShare, this.success);
  9995. }
  9996. else {
  9997. xGame.uiMgr.Show(UIGameEnd, this.success);
  9998. }
  9999. }
  10000. aiLeave() {
  10001. let ui = xGame.common.gameUI.ui;
  10002. ui.topNode.aiNameTxt.text = "offline";
  10003. }
  10004. aiGameEnd(suc) {
  10005. this.success = suc;
  10006. xGame.common.aiPlayer.stopRun();
  10007. if (this.success) {
  10008. xGame.uiMgr.Show(UIMsg, "The opponent has fled");
  10009. Laya.timer.once(1000, this, () => {
  10010. this.clearTime();
  10011. this.gameEnd();
  10012. });
  10013. }
  10014. }
  10015. openTimer() {
  10016. let src = xGame.common.gameUI;
  10017. if (this.selfTurn) {
  10018. src.ui.topNode.selfProgress.visible = true;
  10019. src.ui.topNode.aiProgress.visible = false;
  10020. this.curTimer = src.ui.topNode.selfProgress;
  10021. }
  10022. else {
  10023. src.ui.topNode.selfProgress.visible = false;
  10024. src.ui.topNode.aiProgress.visible = true;
  10025. this.curTimer = src.ui.topNode.aiProgress;
  10026. }
  10027. this.accTime = 0;
  10028. Laya.timer.clearAll(this);
  10029. Laya.timer.loop(20, this, this.updateTime, [0.02]);
  10030. this.curTimer.value = 100;
  10031. }
  10032. updateTime(dt) {
  10033. if (this.gamePause)
  10034. return;
  10035. this.accTime += dt;
  10036. this.curTimer.value = 100 * (this.setTime - this.accTime) / this.setTime;
  10037. if (this.accTime >= this.setTime) {
  10038. this.clearTime();
  10039. console.log("时钟进入了gameRun");
  10040. this.gameRun(FoulType.timeOut);
  10041. }
  10042. }
  10043. clearTime() {
  10044. let src = xGame.common.gameUI;
  10045. src.ui.topNode.selfProgress.visible = false;
  10046. src.ui.topNode.aiProgress.visible = false;
  10047. Laya.timer.clearAll(this);
  10048. }
  10049. peoplePlay(selfIndex, aiIndex, Foul = false, sayWords = true) {
  10050. let ui = xGame.common.gameUI.ui;
  10051. let selfMsg, aiMsg;
  10052. if (sayWords) {
  10053. selfMsg = cfgTable.wordsData[selfIndex].msg;
  10054. aiMsg = cfgTable.wordsData[aiIndex].msg;
  10055. if (Foul) {
  10056. selfMsg = selfMsg.replace("$", this.aiFoulNum + "");
  10057. aiMsg = aiMsg.replace("$", this.selfFoulNum + "");
  10058. this.placeRootBall();
  10059. if (!this.selfTurn && xGame.common.gameMode == GameMode.classic) {
  10060. if (this.curFoul == FoulType.rootHole) {
  10061. if (!DataMgr.getRootBallFoul()) {
  10062. DataMgr.setRootBallFoul();
  10063. aiMsg = "";
  10064. let tips = "The cue ball (white ball) has been pocketed. Three fouls have been committed—you lose this game";
  10065. let woman = "Boss, pay attention next time~";
  10066. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10067. }
  10068. }
  10069. else if (this.curFoul == FoulType.timeOut) {
  10070. if (!DataMgr.getTimeoutFoul()) {
  10071. DataMgr.setTimeoutFoul();
  10072. aiMsg = "";
  10073. let tips = "Game timeout, 3 fouls, this game failed.";
  10074. let woman = "Boss, pay attention to the timeline~";
  10075. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  10076. }
  10077. }
  10078. }
  10079. }
  10080. }
  10081. if (this.selfTurn) {
  10082. if (sayWords) {
  10083. xGame.uiMgr.Show(UIMsg, selfMsg, () => {
  10084. ui.selfTurn.visible = true;
  10085. ui.aiTurn.visible = false;
  10086. ui.selfTurn.t0.play();
  10087. Moyu.vibration();
  10088. });
  10089. }
  10090. }
  10091. else {
  10092. let aiNum = xGame.tools.random(1, 11);
  10093. let challengeNum = DataMgr.getChallengeTimes();
  10094. let delay = false;
  10095. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  10096. aiNum = 9;
  10097. if (this.aiBallArr.length <= 2 && this.ensureBallType) {
  10098. aiNum = 3;
  10099. if (challengeNum == 3) {
  10100. if (!this.showLongView) {
  10101. this.showLongView = true;
  10102. delay = true;
  10103. }
  10104. }
  10105. }
  10106. }
  10107. if (delay) {
  10108. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  10109. if (success) {
  10110. xGame.common.longHelpLine = true;
  10111. xGame.common.d2World.getHelpLine();
  10112. }
  10113. else {
  10114. aiNum = 10;
  10115. }
  10116. xGame.common.aiPlayer.setAiLevel(aiNum);
  10117. if (sayWords) {
  10118. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10119. xGame.common.aiPlayer.runAI();
  10120. ui.selfTurn.visible = false;
  10121. ui.aiTurn.visible = true;
  10122. ui.aiTurn.t0.play();
  10123. });
  10124. }
  10125. else {
  10126. xGame.common.aiPlayer.runAI();
  10127. }
  10128. this.openTimer();
  10129. this.finishOneShoot = true;
  10130. if (this.selfTurn) {
  10131. ui.topNode.selfKuang.visible = true;
  10132. ui.topNode.aiKuang.visible = false;
  10133. ui.topNode.selfTips.visible = true;
  10134. ui.topNode.aiTips.visible = false;
  10135. }
  10136. else {
  10137. ui.topNode.selfKuang.visible = false;
  10138. ui.topNode.aiKuang.visible = true;
  10139. ui.topNode.selfTips.visible = false;
  10140. ui.topNode.aiTips.visible = true;
  10141. }
  10142. });
  10143. return;
  10144. }
  10145. if (xGame.common.gameMode == GameMode.classic) {
  10146. let cfg = cfgTable.modeselectData[xGame.common.classicRoomType];
  10147. if (cfg) {
  10148. let aiLevel = xGame.common.randomNum(cfg.aiLevel[0], cfg.aiLevel[1]);
  10149. aiNum = aiLevel;
  10150. }
  10151. }
  10152. xGame.common.aiPlayer.setAiLevel(aiNum);
  10153. if (sayWords) {
  10154. xGame.uiMgr.Show(UIMsg, aiMsg, () => {
  10155. xGame.common.aiPlayer.runAI();
  10156. ui.selfTurn.visible = false;
  10157. ui.aiTurn.visible = true;
  10158. ui.aiTurn.t0.play();
  10159. });
  10160. }
  10161. else {
  10162. xGame.common.aiPlayer.runAI();
  10163. }
  10164. }
  10165. this.openTimer();
  10166. this.finishOneShoot = true;
  10167. if (this.selfTurn) {
  10168. ui.topNode.selfKuang.visible = true;
  10169. ui.topNode.aiKuang.visible = false;
  10170. ui.topNode.selfTips.visible = true;
  10171. ui.topNode.aiTips.visible = false;
  10172. }
  10173. else {
  10174. ui.topNode.selfKuang.visible = false;
  10175. ui.topNode.aiKuang.visible = true;
  10176. ui.topNode.selfTips.visible = false;
  10177. ui.topNode.aiTips.visible = true;
  10178. }
  10179. }
  10180. placeRootBall() {
  10181. let rootBall = xGame.common.d2World.rootBall;
  10182. if (!rootBall)
  10183. return;
  10184. rootBall.gameObj.x = this.lastRootBallPos.x;
  10185. rootBall.gameObj.y = this.lastRootBallPos.y;
  10186. rootBall.d3BallSrc.setTransPos(this.lastRootBallPos.x, this.lastRootBallPos.y);
  10187. let moveNode = xGame.common.gameUI.ui.moveNode;
  10188. moveNode.visible = true;
  10189. moveNode.x = this.lastRootBallPos.x;
  10190. moveNode.y = this.lastRootBallPos.y;
  10191. if (!this.selfTurn) {
  10192. xGame.common.aiPlayer.resetRoot();
  10193. }
  10194. }
  10195. }
  10196. class ui_guanyuAni extends fgui.GComponent {
  10197. static createInstance() {
  10198. return (fgui.UIPackage.createObject("game", "guanyuAni"));
  10199. }
  10200. onConstruct() {
  10201. this.n0 = (this.getChild("n0"));
  10202. }
  10203. }
  10204. ui_guanyuAni.URL = "ui://isxx5ak7jaakv55u";
  10205. class UIFireworks extends UIBase {
  10206. constructor() {
  10207. super();
  10208. }
  10209. onConstructor() {
  10210. this.isEject = false;
  10211. }
  10212. show(callback) {
  10213. super.show();
  10214. }
  10215. }
  10216. UIFireworks.uiName = "UIFireworks";
  10217. class ui_UIGuanYu extends fgui.GComponent {
  10218. static createInstance() {
  10219. return (fgui.UIPackage.createObject("game", "UIGuanYu"));
  10220. }
  10221. onConstruct() {
  10222. this.n2 = (this.getChild("n2"));
  10223. this.n1 = (this.getChild("n1"));
  10224. this.n3 = (this.getChild("n3"));
  10225. this.n4 = (this.getChild("n4"));
  10226. this.n5 = (this.getChild("n5"));
  10227. this.n6 = (this.getChild("n6"));
  10228. this.n8 = (this.getChild("n8"));
  10229. this.n7 = (this.getChild("n7"));
  10230. this.t0 = this.getTransition("t0");
  10231. }
  10232. }
  10233. ui_UIGuanYu.URL = "ui://isxx5ak7dt0av4yc";
  10234. class UIGuanYu extends UIBase {
  10235. constructor() {
  10236. super();
  10237. }
  10238. onConstructor() {
  10239. this.ui = ui_UIGuanYu.createInstance();
  10240. this.contentPane = this.ui;
  10241. this.isEject = false;
  10242. }
  10243. show(callback) {
  10244. super.show();
  10245. this.ui.t0.play(Laya.Handler.create(this, () => {
  10246. callback && callback();
  10247. this.hide();
  10248. }));
  10249. this.setGlobalFont(this.ui);
  10250. }
  10251. }
  10252. UIGuanYu.uiName = "UIGuanYu";
  10253. class SkillMgr {
  10254. constructor() {
  10255. this.leveNum = 0;
  10256. this.extraScore = 0;
  10257. this.selfTurn = false;
  10258. this.playedLastSkill = false;
  10259. this.tweenArr = [];
  10260. this._finishNum = 0;
  10261. this._curFinish = 0;
  10262. this._rootX = 0;
  10263. this._rootY = 0;
  10264. this.knifeTimes = 0;
  10265. this.knifeV2 = new Laya.Vector2();
  10266. this.knifeV3 = new Laya.Vector3();
  10267. this.rtStarX = 0;
  10268. this.rtStarY = 0;
  10269. this.addBigSkillSpine();
  10270. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10271. }
  10272. addBigSkillSpine() {
  10273. this.skillSpine2 = new SpineMgr("yxz_dazhao", () => {
  10274. console.log("extra2 success");
  10275. });
  10276. }
  10277. runBigSkill(callback) {
  10278. this.tweenArr = [];
  10279. this.callback = callback;
  10280. this.judgeSkill();
  10281. this.leveNum = DataMgr.getBigSkillByIndex(this.curSkill);
  10282. let guide = DataMgr.getSkillGuide();
  10283. if (!xGame.common.gameMgr.selfTurn) {
  10284. this.leveNum = xGame.common.gameMgr.aiSkillLevelNum;
  10285. }
  10286. else {
  10287. if (xGame.common.temSelfLevel != 0) {
  10288. this.leveNum = xGame.common.temSelfLevel;
  10289. }
  10290. if (this.curSkill == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime) {
  10291. this.leveNum += 5;
  10292. }
  10293. }
  10294. if (guide == 0) {
  10295. DataMgr.setSkillGuide(1);
  10296. if (DataMgr.getNewUser()) {
  10297. Moyu.sendDataEvent("gameFirstPlay");
  10298. DataMgr.setNewUser();
  10299. }
  10300. }
  10301. this.playSpineAni(() => {
  10302. switch (this.curSkill) {
  10303. case SkillType.highSpace:
  10304. this.runHighSpace();
  10305. break;
  10306. case SkillType.breakArmy:
  10307. this.runBreakArmy();
  10308. break;
  10309. case SkillType.ice:
  10310. this.runIce();
  10311. break;
  10312. case SkillType.fireworks:
  10313. this.runFireworks();
  10314. break;
  10315. case SkillType.GuanYu:
  10316. this.runGuanYu();
  10317. break;
  10318. default:
  10319. break;
  10320. }
  10321. });
  10322. }
  10323. judgeSkill() {
  10324. let typeArr = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  10325. let gameMgr = xGame.common.gameMgr;
  10326. let type;
  10327. for (let index = 0; index < typeArr.length; index++) {
  10328. type = typeArr[index];
  10329. if (gameMgr.selfTurn) {
  10330. if (gameMgr.selfCurSkill == type) {
  10331. this.selfTurn = true;
  10332. this.curSkill = type;
  10333. return;
  10334. }
  10335. }
  10336. else {
  10337. if (gameMgr.aiCurSkill == type) {
  10338. this.selfTurn = false;
  10339. this.curSkill = type;
  10340. return;
  10341. }
  10342. }
  10343. }
  10344. }
  10345. playSpineAni(callback) {
  10346. let data = { x: 0, y: 0, scaleX: 1.2, scaleY: 1.2 };
  10347. let parent = xGame.common.gameUI.ui.bigSkillNode.displayObject;
  10348. parent.destroyChildren();
  10349. let aniIndex = 0;
  10350. let skillSpine;
  10351. switch (this.curSkill) {
  10352. case SkillType.highSpace:
  10353. aniIndex = 1;
  10354. xGame.soundMgr.playSound("skill01");
  10355. skillSpine = this.skillSpine2;
  10356. data.scaleX = 0.5;
  10357. data.scaleY = 0.5;
  10358. skillSpine.play(data, 1, false, parent, () => {
  10359. callback && callback();
  10360. });
  10361. break;
  10362. case SkillType.breakArmy:
  10363. aniIndex = 2;
  10364. xGame.soundMgr.playSound("skill02");
  10365. skillSpine = this.skillSpine2;
  10366. data.scaleX = 0.5;
  10367. data.scaleY = 0.5;
  10368. skillSpine.play(data, 2, false, parent, () => {
  10369. callback && callback();
  10370. });
  10371. break;
  10372. case SkillType.ice:
  10373. aniIndex = 0;
  10374. xGame.soundMgr.playSound("skill03");
  10375. skillSpine = this.skillSpine2;
  10376. data.scaleX = 0.5;
  10377. data.scaleY = 0.5;
  10378. skillSpine.play(data, 0, false, parent, () => {
  10379. callback && callback();
  10380. });
  10381. break;
  10382. case SkillType.fireworks:
  10383. xGame.soundMgr.playSound("skill_04_01");
  10384. xGame.soundMgr.playSound("skill04");
  10385. xGame.uiMgr.Show(UIFireworks, callback);
  10386. break;
  10387. case SkillType.GuanYu:
  10388. xGame.soundMgr.playSound("skill05_1");
  10389. xGame.soundMgr.playSound("skill05");
  10390. xGame.uiMgr.Show(UIGuanYu, callback);
  10391. break;
  10392. default:
  10393. break;
  10394. }
  10395. }
  10396. getAllBallArr() {
  10397. let arr = xGame.common.d2World.ballArr;
  10398. let outArr = [];
  10399. for (let index = 0; index < arr.length; index++) {
  10400. if (arr[index] instanceof D2RootBallSrc)
  10401. continue;
  10402. if (arr[index].ballFunc == "ice")
  10403. continue;
  10404. if (arr[index].destroyed)
  10405. continue;
  10406. outArr.push(arr[index]);
  10407. }
  10408. return outArr;
  10409. }
  10410. getOneArr(deletObj) {
  10411. let allArr = this.getAllBallArr();
  10412. let temp;
  10413. for (let index = 0; index < allArr.length; index++) {
  10414. temp = allArr[index];
  10415. if (temp.id == deletObj.id) {
  10416. allArr.splice(index, 1);
  10417. break;
  10418. }
  10419. }
  10420. return allArr;
  10421. }
  10422. getNearBallBag(ball) {
  10423. let ui = xGame.common.gameUI.ui;
  10424. let circleArr = [];
  10425. for (let index = 1; index <= 6; index++) {
  10426. circleArr.push(ui.border["circle" + index]);
  10427. }
  10428. let outIndex = 0;
  10429. let temp;
  10430. let min = Math.pow(circleArr[0].x - ball.gameObj.x, 2) + Math.pow(circleArr[0].y - ball.gameObj.y, 2);
  10431. ;
  10432. let dis = 0;
  10433. for (let index = 1; index < circleArr.length; index++) {
  10434. temp = circleArr[index];
  10435. dis = Math.pow(temp.x - ball.gameObj.x, 2) + Math.pow(temp.y - ball.gameObj.y, 2);
  10436. if (dis < min) {
  10437. min = dis;
  10438. outIndex = index;
  10439. }
  10440. }
  10441. return [circleArr[outIndex], outIndex];
  10442. }
  10443. ballFlyToBag(ballArr, time = 300) {
  10444. let temp;
  10445. let hole;
  10446. this._finishNum = ballArr.length;
  10447. this._curFinish = 0;
  10448. let holeObj = {};
  10449. let holeCfg = {
  10450. "1": 0,
  10451. "2": 0,
  10452. "3": 0,
  10453. "4": 0,
  10454. "5": 0,
  10455. "6": 0
  10456. };
  10457. for (let index = 0; index < ballArr.length; index++) {
  10458. temp = ballArr[index];
  10459. temp.outColli.isSensor = true;
  10460. temp.innerColli.isSensor = true;
  10461. temp.isRunSkillAni = true;
  10462. let holeArr = this.getNearBallBag(temp);
  10463. hole = holeArr[0];
  10464. holeObj[index] = holeArr[1];
  10465. temp.d3BallSrc.scaleXYZ = 0.5;
  10466. this.tweenArr.push(temp.d3BallSrc, temp);
  10467. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 1 }, time, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10468. Laya.Tween.to(temp.d3BallSrc, { scaleXYZ: 0.5 }, time, Laya.Ease.sineIn);
  10469. }));
  10470. Laya.Tween.to(temp, { myX: hole.x, myY: hole.y }, (time * 2 + 10), null, Laya.Handler.create(this, () => {
  10471. let mIndex = holeObj[this._curFinish];
  10472. let isDone = holeCfg[mIndex];
  10473. if (isDone) {
  10474. ballArr[this._curFinish].checkWrongBall(false);
  10475. }
  10476. else {
  10477. holeCfg[mIndex] = 1;
  10478. ballArr[this._curFinish].checkWrongBall();
  10479. }
  10480. this._curFinish++;
  10481. if (this._curFinish >= this._finishNum) {
  10482. if (this.curSkill == SkillType.highSpace) {
  10483. }
  10484. else if (this.curSkill == SkillType.breakArmy) {
  10485. let rootBall = xGame.common.d2World.rootBall;
  10486. rootBall.gameObj.x = this._rootX;
  10487. rootBall.gameObj.y = this._rootY;
  10488. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10489. xGame.common.d2World.d2Gan.ui.visible = true;
  10490. xGame.common.d2World.d2HelpLine.ui.visible = true;
  10491. xGame.common.d2World.getHelpLine();
  10492. this.callback && this.callback(this.extraScore);
  10493. }
  10494. }
  10495. }));
  10496. }
  10497. }
  10498. runHighSpace() {
  10499. let rootBall = xGame.common.d2World.rootBall;
  10500. rootBall.showSelf();
  10501. let d3Src = rootBall.d3BallSrc;
  10502. let allArr = this.getAllBallArr();
  10503. if (allArr.length <= 0) {
  10504. this.callback && this.callback(0);
  10505. return;
  10506. }
  10507. let selectBall = xGame.common.d2World.targetBall;
  10508. let wrong = selectBall && selectBall.destroyed;
  10509. if (!selectBall || wrong || selectBall.ballFunc == "ice") {
  10510. selectBall = xGame.common.getRandArrEle(allArr);
  10511. }
  10512. let targetD3Src = selectBall.d3BallSrc;
  10513. xGame.common.d2World.d2Gan.ui.visible = false;
  10514. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10515. d3Src.scaleXYZ = 0.5;
  10516. this.tweenArr.push(d3Src);
  10517. Laya.Tween.to(d3Src, { scaleXYZ: 1, posX: targetD3Src.posX, posZ: targetD3Src.posZ }, 1000, Laya.Ease.sineOut, Laya.Handler.create(this, () => {
  10518. Laya.Tween.to(d3Src, { scaleXYZ: 0.5 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10519. let hitEft = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  10520. hitEft.transform.localPositionX = d3Src.transform.localPositionX;
  10521. hitEft.transform.localPositionY = d3Src.transform.localPositionY;
  10522. hitEft.transform.localPositionZ = d3Src.transform.localPositionZ;
  10523. let outArr = [selectBall];
  10524. let other = this.leveNum - 1;
  10525. if (other > 0) {
  10526. let nearArr = this.getOneArr(selectBall);
  10527. if (nearArr.length > 0) {
  10528. xGame.common.botherArr(nearArr);
  10529. if (other >= nearArr.length)
  10530. other = nearArr.length;
  10531. for (let index = 0; index < other; index++) {
  10532. outArr.push(nearArr[index]);
  10533. }
  10534. }
  10535. }
  10536. xGame.common.extraMoveNum = other + 1;
  10537. this.extraScore = other + 1;
  10538. this._rootX = selectBall.gameObj.x;
  10539. this._rootY = selectBall.gameObj.y;
  10540. rootBall.gameObj.x = this._rootX;
  10541. rootBall.gameObj.y = this._rootY;
  10542. rootBall.d3BallSrc.setTransPos(this._rootX, this._rootY);
  10543. Laya.Tween.clearAll(d3Src);
  10544. this.addRandomForce(outArr);
  10545. }));
  10546. }));
  10547. }
  10548. addRandomForce(outArr) {
  10549. if (outArr.length > 0) {
  10550. xGame.common.d2World.openCheckStill = true;
  10551. this.playedLastSkill = true;
  10552. }
  10553. let temp;
  10554. for (let index = 0; index < outArr.length; index++) {
  10555. let angle = xGame.common.randomNum(0, 360);
  10556. let linearPercent = xGame.common.randomNum(65, 100);
  10557. temp = outArr[index];
  10558. this.setLinearSpeed(angle, temp.rigy, linearPercent);
  10559. }
  10560. }
  10561. setLinearSpeed(angle, rigy, linearPercent) {
  10562. let sin = Math.sin(angle * Math.PI / 180);
  10563. let cos = Math.cos(angle * Math.PI / 180);
  10564. let maxSpeed = 4;
  10565. let speed = new Laya.Vector2();
  10566. speed.x = maxSpeed * linearPercent * sin;
  10567. speed.y = -maxSpeed * linearPercent * cos;
  10568. rigy.applyLinearImpulseToCenter(speed);
  10569. }
  10570. runBreakArmy() {
  10571. xGame.common.d2World.d2Gan.ui.visible = false;
  10572. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10573. let gameUI = xGame.common.gameUI.ui;
  10574. gameUI.skillRod.visible = true;
  10575. gameUI.skillRod.rotation = 110;
  10576. let outArr = this.getAllBallArr();
  10577. if (outArr.length <= 0) {
  10578. gameUI.skillRod.visible = false;
  10579. this.callback && this.callback(0);
  10580. return;
  10581. }
  10582. xGame.common.botherArr(outArr);
  10583. if (this.leveNum >= outArr.length)
  10584. this.leveNum = outArr.length;
  10585. let deleteNum = outArr.length - this.leveNum;
  10586. outArr.splice(0, deleteNum);
  10587. this.extraScore = this.leveNum;
  10588. let potX = gameUI.skillRod.x;
  10589. let potY = gameUI.skillRod.y;
  10590. this._rootX = xGame.common.d2World.rootBall.gameObj.x;
  10591. this._rootY = xGame.common.d2World.rootBall.gameObj.y;
  10592. let disArr = [];
  10593. for (let index = 0; index < outArr.length; index++) {
  10594. let obj = outArr[index];
  10595. let dis = Math.pow(obj.gameObj.x - potX, 2) + Math.pow(obj.gameObj.y - potY, 2);
  10596. dis = Math.pow(dis, 0.5);
  10597. disArr.push(dis);
  10598. }
  10599. this.tweenArr.push(gameUI.skillRod);
  10600. Laya.Tween.to(gameUI.skillRod, { rotation: 20 }, 800, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  10601. })).update = Laya.Handler.create(this, (e, t, c) => {
  10602. let angle = gameUI.skillRod.rotation;
  10603. let xx;
  10604. let yy;
  10605. let temp;
  10606. for (let index = 0; index < outArr.length; index++) {
  10607. temp = outArr[index];
  10608. xx = potX + disArr[index] * Math.sin(angle * Math.PI / 180);
  10609. yy = potY - disArr[index] * Math.cos(angle * Math.PI / 180);
  10610. yy -= 20;
  10611. temp.gameObj.x = xx;
  10612. temp.gameObj.y = yy;
  10613. temp.d3BallSrc.setTransPos(xx, yy);
  10614. }
  10615. if (angle <= 60) {
  10616. Laya.Tween.clearAll(gameUI.skillRod);
  10617. this.ballFlyToBag(outArr, 150);
  10618. gameUI.skillRod.visible = false;
  10619. }
  10620. }, null, false);
  10621. }
  10622. runIce() {
  10623. let ballArr = xGame.common.d2World.ballArr;
  10624. this.leveNum *= 2;
  10625. if (this.leveNum >= ballArr.length - 1)
  10626. this.leveNum = ballArr.length - 1;
  10627. let tempArr = [];
  10628. let outArr = [];
  10629. for (let index = 0; index < ballArr.length; index++) {
  10630. if (ballArr[index] instanceof D2RootBallSrc)
  10631. continue;
  10632. tempArr.push(ballArr[index]);
  10633. }
  10634. if (tempArr.length <= 0) {
  10635. this.callback && this.callback(0);
  10636. return;
  10637. }
  10638. xGame.common.botherArr(tempArr);
  10639. for (let index = 0; index < this.leveNum; index++) {
  10640. outArr.push(tempArr[index]);
  10641. }
  10642. this.extraScore = this.leveNum;
  10643. let temp;
  10644. for (let index = 0; index < outArr.length; index++) {
  10645. temp = outArr[index];
  10646. temp.d3BallSrc.playIceEft();
  10647. }
  10648. Laya.timer.once(2000, this, () => {
  10649. for (let index = 0; index < outArr.length; index++) {
  10650. temp = outArr[index];
  10651. let str = xGame.common.gameMgr.selfTurn ? "self" : "ai";
  10652. temp.setBallFunc("ice", str);
  10653. }
  10654. this.callback && this.callback(0);
  10655. });
  10656. }
  10657. runFireworks() {
  10658. let allArr = this.getAllBallArr();
  10659. if (allArr.length <= 0) {
  10660. this.callback && this.callback(0);
  10661. return;
  10662. }
  10663. xGame.common.d2World.d2Gan.ui.visible = false;
  10664. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10665. let outArr = [];
  10666. let other = this.leveNum;
  10667. if (other > 0) {
  10668. if (allArr.length > 0) {
  10669. xGame.common.botherArr(allArr);
  10670. if (other >= allArr.length)
  10671. other = allArr.length;
  10672. for (let index = 0; index < other; index++) {
  10673. outArr.push(allArr[index]);
  10674. }
  10675. }
  10676. }
  10677. xGame.common.extraMoveNum = other;
  10678. this.extraScore = other;
  10679. this.addRandmomFireworks(outArr);
  10680. }
  10681. addRandmomFireworks(outArr) {
  10682. Laya.timer.once(1100, this, () => {
  10683. if (outArr.length > 0) {
  10684. xGame.common.d2World.openCheckStill = true;
  10685. this.playedLastSkill = true;
  10686. }
  10687. });
  10688. xGame.soundMgr.playSound("skill_04_02");
  10689. let temp;
  10690. let delay = -200;
  10691. for (let index = 0; index < outArr.length; index++) {
  10692. temp = outArr[index];
  10693. delay += 200;
  10694. temp.d3BallSrc.runFireworks(temp, delay, (obj) => {
  10695. let angle = xGame.common.randomNum(0, 360);
  10696. angle = this.getFireworksAngle(obj);
  10697. let linearPercent = xGame.common.randomNum(45, 80);
  10698. if (!obj.destroyed)
  10699. this.setLinearSpeed(angle, obj.rigy, linearPercent);
  10700. });
  10701. }
  10702. }
  10703. getFireworksAngle(obj) {
  10704. let rootBall = xGame.common.d2World.rootBall;
  10705. return xGame.common.getfguiRotation(obj.gameObj.x - rootBall.gameObj.x, obj.gameObj.y - rootBall.gameObj.y);
  10706. }
  10707. resetGame() {
  10708. Laya.timer.clearAll(this);
  10709. if (this.tweenArr) {
  10710. for (let index = 0; index < this.tweenArr.length; index++) {
  10711. Laya.Tween.clearAll(this.tweenArr[index]);
  10712. }
  10713. }
  10714. this.tweenArr = null;
  10715. }
  10716. runGuanYu() {
  10717. xGame.common.d2World.d2Gan.ui.visible = false;
  10718. xGame.common.d2World.d2HelpLine.ui.visible = false;
  10719. let rootBall = xGame.common.d2World.rootBall;
  10720. if (rootBall.isInHole) {
  10721. rootBall.gameObj.x = xGame.common.gameMgr.lastRootBallPos.x;
  10722. rootBall.gameObj.y = xGame.common.gameMgr.lastRootBallPos.y;
  10723. rootBall.d3BallSrc.setTransPos(rootBall.gameObj.x, rootBall.gameObj.y);
  10724. rootBall.showSelf();
  10725. }
  10726. this.rtStarX = rootBall.gameObj.x;
  10727. this.rtStarY = rootBall.gameObj.y;
  10728. this.knifeTimes = 0;
  10729. this.playedLastSkill = true;
  10730. rootBall.forceRun = true;
  10731. rootBall.rigy.type = "static";
  10732. xGame.common.d2World.openCheckStill = true;
  10733. this.guanyuRandomKnife();
  10734. }
  10735. guanyuRandomKnife() {
  10736. let rootBall = xGame.common.d2World.rootBall;
  10737. let dir = this.getRandDir();
  10738. let angle = xGame.common.getfguiRotation(dir.x, dir.y);
  10739. console.log("当前angle", angle);
  10740. this.cloneKnife(rootBall.gameObj.x, rootBall.gameObj.y, 180 - angle);
  10741. this.cloneGuanYuEft(rootBall.gameObj.x, rootBall.gameObj.y, angle);
  10742. let dis = 324;
  10743. let disX = this.rtStarX + dis * Math.sin(angle * Math.PI / 180);
  10744. let disY = this.rtStarY + dis * -Math.cos(angle * Math.PI / 180);
  10745. Laya.Tween.to(rootBall.gameObj, { x: disX, y: disY }, 150, null, Laya.Handler.create(this, () => {
  10746. this.rtStarX = rootBall.gameObj.x;
  10747. this.rtStarY = rootBall.gameObj.y;
  10748. this.knifeTimes++;
  10749. let skillLevel;
  10750. if (xGame.common.gameMgr.selfTurn) {
  10751. skillLevel = DataMgr.getBigSkillByIndex(4);
  10752. }
  10753. else {
  10754. skillLevel = xGame.common.gameMgr.aiSkillLevelNum;
  10755. }
  10756. if (!skillLevel)
  10757. skillLevel = 1;
  10758. skillLevel += 2;
  10759. if (this.knifeTimes < skillLevel) {
  10760. Laya.timer.once(400, this, () => {
  10761. this.guanyuRandomKnife();
  10762. });
  10763. }
  10764. else {
  10765. rootBall.forceRun = false;
  10766. rootBall.rigy.type = "dynamic";
  10767. xGame.common.extraMoveNum = skillLevel;
  10768. }
  10769. }));
  10770. }
  10771. getRandDir() {
  10772. let rootBall = xGame.common.d2World.rootBall;
  10773. let allBall = this.getAllBallArr();
  10774. let target = xGame.common.getRandArrEle(allBall);
  10775. this.knifeV2.setValue(target.gameObj.x - rootBall.gameObj.x, target.gameObj.y - rootBall.gameObj.y);
  10776. return this.knifeV2;
  10777. }
  10778. cloneKnife(x, y, rotation) {
  10779. let parent = xGame.common.d3World.knifeRoot;
  10780. let prefab = xGame.common.d3World.knife;
  10781. let clone = prefab.clone();
  10782. parent.addChild(clone);
  10783. xGame.common.pos2to3Convert(x, y, this.knifeV3);
  10784. clone.transform.localPositionX = this.knifeV3.x;
  10785. clone.transform.localPositionY = 0;
  10786. clone.transform.localPositionZ = this.knifeV3.z;
  10787. clone.transform.localRotationEulerX = 0;
  10788. clone.transform.localRotationEulerY = rotation;
  10789. clone.transform.localRotationEulerZ = 0;
  10790. clone.active = true;
  10791. return clone;
  10792. }
  10793. cloneGuanYuEft(x, y, angle) {
  10794. return;
  10795. let parent = xGame.common.gameUI.ui.guanyuNode;
  10796. let eft = new ui_guanyuAni();
  10797. eft.parent = parent;
  10798. eft.x = x;
  10799. eft.y = y;
  10800. eft.rotation = angle;
  10801. }
  10802. }
  10803. class ui_UIWordsList extends fgui.GComponent {
  10804. static createInstance() {
  10805. return (fgui.UIPackage.createObject("game", "UIWordsList"));
  10806. }
  10807. onConstruct() {
  10808. this.c1 = this.getController("c1");
  10809. this.n74 = (this.getChild("n74"));
  10810. this.clickNode = (this.getChild("clickNode"));
  10811. this.myNode = (this.getChild("myNode"));
  10812. this.n68 = (this.getChild("n68"));
  10813. this.n66 = (this.getChild("n66"));
  10814. this.n55 = (this.getChild("n55"));
  10815. this.wordsBtn = (this.getChild("wordsBtn"));
  10816. this.emotionBtn = (this.getChild("emotionBtn"));
  10817. this.mybggg = (this.getChild("mybggg"));
  10818. this.wordsList = (this.getChild("wordsList"));
  10819. this.emotionList = (this.getChild("emotionList"));
  10820. this.myRoot = (this.getChild("myRoot"));
  10821. }
  10822. }
  10823. ui_UIWordsList.URL = "ui://isxx5ak7i4k243i";
  10824. class EmotionDisplay {
  10825. constructor(index, ui) {
  10826. this.ui = ui;
  10827. this.index = index;
  10828. this.ui.onClick(this, this.clickSelf);
  10829. this.updateSelf();
  10830. }
  10831. updateSelf() {
  10832. let data = cfgTable.emotionData[this.index + 1];
  10833. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon);
  10834. }
  10835. clickSelf() {
  10836. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10837. xGame.common.talkMgr.showSelfEmotion(this.index + 1);
  10838. xGame.common.talkMgr.closeTalkView();
  10839. }
  10840. }
  10841. class WordsDisplay {
  10842. constructor(index, ui) {
  10843. this.ui = ui;
  10844. this.index = index;
  10845. this.ui.onClick(this, this.clickSelf);
  10846. this.updateSelf();
  10847. }
  10848. updateSelf() {
  10849. let data = cfgTable.talkwordsData[this.index + 1];
  10850. this.ui.txt.text = data.msg;
  10851. }
  10852. clickSelf() {
  10853. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10854. xGame.common.talkMgr.showSelfTalk(this.index + 1);
  10855. xGame.common.talkMgr.closeTalkView();
  10856. }
  10857. }
  10858. class UIWordsList extends UIBase {
  10859. constructor() {
  10860. super();
  10861. }
  10862. onConstructor() {
  10863. this.ui = ui_UIWordsList.createInstance();
  10864. this.contentPane = this.ui;
  10865. this.isEject = false;
  10866. this.addUIClick(this.ui.wordsBtn, this.openTalkList);
  10867. this.addUIClick(this.ui.emotionBtn, this.openEmotionList);
  10868. this.addUIClick(this.ui.clickNode, this.hide);
  10869. this.initTalkList();
  10870. this.initEmotionList();
  10871. }
  10872. show() {
  10873. super.show();
  10874. this.setGlobalFont(this.ui);
  10875. }
  10876. initTalkList() {
  10877. this.ui.wordsList.itemRenderer = Laya.Handler.create(this, this.renderTalkItem, null, false);
  10878. let data = cfgTable.talkwordsData;
  10879. let length = Object.keys(data).length;
  10880. this.ui.wordsList.numItems = length;
  10881. }
  10882. initEmotionList() {
  10883. this.ui.emotionList.itemRenderer = Laya.Handler.create(this, this.renderEmotionItem, null, false);
  10884. let data = cfgTable.emotionData;
  10885. let length = Object.keys(data).length;
  10886. this.ui.emotionList.numItems = length;
  10887. }
  10888. renderTalkItem(index, obj) {
  10889. let temp = new WordsDisplay(index, obj);
  10890. }
  10891. renderEmotionItem(index, obj) {
  10892. let temp = new EmotionDisplay(index, obj);
  10893. }
  10894. openTalkList() {
  10895. this.ui.c1.selectedIndex = 0;
  10896. }
  10897. openEmotionList() {
  10898. this.ui.c1.selectedIndex = 1;
  10899. }
  10900. }
  10901. UIWordsList.uiName = "UIWordsList";
  10902. class TalkMgr {
  10903. constructor() {
  10904. this.aiSpeak = true;
  10905. this.emotionList = [];
  10906. this.talkList = [];
  10907. this.addEvent();
  10908. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  10909. this.emotionList = [];
  10910. this.talkList = [];
  10911. for (let k in cfgTable.emotionData) {
  10912. this.emotionList.push(cfgTable.emotionData[k].id);
  10913. }
  10914. for (let k in cfgTable.talkwordsData) {
  10915. this.talkList.push(cfgTable.talkwordsData[k].id);
  10916. }
  10917. }
  10918. addEvent() {
  10919. let ui = xGame.common.gameUI.ui;
  10920. ui.wordsBtn.visible = true;
  10921. ui.wordsBtn.onClick(this, this.openTalkView);
  10922. ui.aiWordsBtn.visible = true;
  10923. ui.aiWordsBtn.onClick(this, this.clickAIState);
  10924. }
  10925. openTalkView() {
  10926. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10927. xGame.uiMgr.Show(UIWordsList);
  10928. }
  10929. closeTalkView() {
  10930. xGame.uiMgr.Hide(UIWordsList);
  10931. }
  10932. clickAIState() {
  10933. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  10934. this.aiSpeak = !this.aiSpeak;
  10935. this.changeAIState(this.aiSpeak);
  10936. }
  10937. changeAIState(speak) {
  10938. this.aiSpeak = speak;
  10939. let btn = xGame.common.gameUI.ui.aiWordsBtn;
  10940. if (speak) {
  10941. btn.c1.selectedIndex = 0;
  10942. }
  10943. else {
  10944. btn.c1.selectedIndex = 1;
  10945. }
  10946. }
  10947. showSelfTalk(wordsId) {
  10948. let ui = xGame.common.gameUI.ui;
  10949. ui.selfTalk.visible = true;
  10950. ui.selfTalk.myNode.c1.selectedIndex = 1;
  10951. ui.selfTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10952. ui.selfTalk.t0.play();
  10953. }
  10954. showSelfEmotion(emotionId) {
  10955. let ui = xGame.common.gameUI.ui;
  10956. ui.selfTalk.visible = true;
  10957. ui.selfTalk.myNode.c1.selectedIndex = 0;
  10958. this.selfSpine && this.selfSpine.dispose();
  10959. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  10960. let spineData = cfgTable.emotionData[emotionId].spine;
  10961. this.selfSpine = new SpineMgr(spineData, () => {
  10962. let xx = ui.selfTalk.myNode.spineRoot.width / 2 - 2;
  10963. let yy = ui.selfTalk.myNode.spineRoot.height / 2;
  10964. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  10965. this.selfSpine.play(data, 0, false, ui.selfTalk.myNode.spineRoot.displayObject);
  10966. });
  10967. ui.selfTalk.t0.play();
  10968. }
  10969. showAITalk(wordsId) {
  10970. if (!this.aiSpeak)
  10971. return;
  10972. if (DataMgr.gameData.gameCount < 2)
  10973. return;
  10974. if (wordsId < 1)
  10975. wordsId = this.getRandTalk();
  10976. let ui = xGame.common.gameUI.ui;
  10977. ui.aiTalk.visible = true;
  10978. ui.aiTalk.myNode.c1.selectedIndex = 1;
  10979. ui.aiTalk.myNode.txt.text = cfgTable.talkwordsData[wordsId].msg;
  10980. ui.aiTalk.t0.play();
  10981. }
  10982. getRandTalk() {
  10983. let rand = xGame.tools.random(0, this.talkList.length);
  10984. return this.emotionList[rand];
  10985. }
  10986. getRandEmotion() {
  10987. let rand = xGame.tools.random(0, this.emotionList.length);
  10988. return this.emotionList[rand];
  10989. }
  10990. showAIEmotion(emotionId) {
  10991. if (!this.aiSpeak)
  10992. return;
  10993. if (DataMgr.gameData.gameCount < 2)
  10994. return;
  10995. if (emotionId < 1)
  10996. emotionId = this.getRandEmotion();
  10997. let ui = xGame.common.gameUI.ui;
  10998. ui.aiTalk.visible = true;
  10999. ui.aiTalk.myNode.c1.selectedIndex = 0;
  11000. this.aiSpine && this.aiSpine.dispose();
  11001. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11002. let spineData = cfgTable.emotionData[emotionId].spine;
  11003. this.aiSpine = new SpineMgr(spineData, () => {
  11004. let xx = ui.aiTalk.myNode.spineRoot.width / 2 - 2;
  11005. let yy = ui.aiTalk.myNode.spineRoot.height / 2;
  11006. let data = { x: xx, y: yy, scaleX: 0.35, scaleY: 0.35 };
  11007. this.aiSpine.play(data, 0, false, ui.aiTalk.myNode.spineRoot.displayObject);
  11008. });
  11009. ui.aiTalk.t0.play();
  11010. }
  11011. resetGame() {
  11012. let ui = xGame.common.gameUI.ui;
  11013. ui.aiTalk.visible = false;
  11014. ui.selfTalk.visible = false;
  11015. this.aiSpine && this.aiSpine.dispose();
  11016. this.selfSpine && this.selfSpine.dispose();
  11017. ui.aiTalk.myNode.spineRoot && ui.aiTalk.myNode.spineRoot.displayObject.destroyChildren();
  11018. ui.selfTalk.myNode.spineRoot && ui.selfTalk.myNode.spineRoot.displayObject.destroyChildren();
  11019. this.closeTalkView();
  11020. }
  11021. }
  11022. class WordsMgr {
  11023. constructor() {
  11024. this.comboTimes = 1;
  11025. this.skillTimes = 0;
  11026. this.wordsSpine = new SpineMgr("yxz_jingqiu");
  11027. this.comboSpine = new SpineMgr("yxz_liangan");
  11028. this.skillSpine = new SpineMgr("yiganxqiu");
  11029. this.scoreSpine = new SpineMgr("defen");
  11030. }
  11031. setClassicCombo(isInterrupt) {
  11032. if (isInterrupt) {
  11033. this.comboTimes = 0;
  11034. }
  11035. }
  11036. playClassicWords(type, callback) {
  11037. this.callback = callback;
  11038. let aniIndex = type;
  11039. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11040. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11041. let mySpine = this.wordsSpine.play(data, aniIndex, false, parent, () => {
  11042. mySpine.destroy(true);
  11043. this.playClassicTimes();
  11044. });
  11045. }
  11046. playClassicTimes() {
  11047. this.comboTimes++;
  11048. if (this.comboTimes <= 1) {
  11049. this.callback && this.callback();
  11050. }
  11051. else {
  11052. let aniIndex = this.comboTimes - 1;
  11053. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11054. let parent = xGame.common.gameUI.ui.classicWorldsNode.displayObject;
  11055. let mySpine = this.comboSpine.play(data, aniIndex, false, parent, () => {
  11056. mySpine.destroy(true);
  11057. this.callback && this.callback();
  11058. });
  11059. }
  11060. }
  11061. playBigSkillTimes(times, callback) {
  11062. if (times <= 0) {
  11063. callback && callback();
  11064. return;
  11065. }
  11066. this.callback = callback;
  11067. let pre = "sz_0";
  11068. let aniIndex = 0;
  11069. this.getWordsImg(times, pre, () => {
  11070. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11071. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11072. let mySpine = this.skillSpine.createSpine(data, parent, 1);
  11073. let r1 = ``;
  11074. let r2 = ``;
  11075. if (times <= 9) {
  11076. r1 = `res/d2Res/${pre}${times}.png`;
  11077. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11078. aniIndex = 0;
  11079. }
  11080. else {
  11081. r1 = `res/d2Res/${pre}${times % 10}.png`;
  11082. r2 = `res/d2Res/${pre}${Math.floor(times / 10)}.png`;
  11083. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r1));
  11084. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r2));
  11085. aniIndex = 1;
  11086. }
  11087. this.skillSpine.play(data, aniIndex, false, parent, () => {
  11088. mySpine.destroy(true);
  11089. xGame.common.gameMgr.playSkillTips();
  11090. this.playScore(times);
  11091. xGame.common.playRandomMutiBallBigSkillSound();
  11092. }, mySpine);
  11093. });
  11094. }
  11095. playScore(score) {
  11096. let pre = "sz_";
  11097. let aniIndex = 0;
  11098. this.getWordsImg(score, pre, () => {
  11099. let data = { x: 0, y: 0, scaleX: 1, scaleY: 1 };
  11100. let parent = xGame.common.gameUI.ui.bigMoveWorldsNode.displayObject;
  11101. let mySpine = this.scoreSpine.createSpine(data, parent, 1);
  11102. let r1 = ``;
  11103. let r2 = ``;
  11104. if (score <= 9) {
  11105. r1 = `res/d2Res/${pre}${score}.png`;
  11106. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11107. aniIndex = 0;
  11108. }
  11109. else {
  11110. r1 = `res/d2Res/${pre}${score % 10}.png`;
  11111. r2 = `res/d2Res/${pre}${Math.floor(score / 10)}.png`;
  11112. mySpine.setSlotSkin("sz_6", Laya.loader.getRes(r1));
  11113. mySpine.setSlotSkin("sz_7", Laya.loader.getRes(r2));
  11114. aniIndex = 1;
  11115. }
  11116. this.scoreSpine.play(data, aniIndex, false, parent, () => {
  11117. mySpine.destroy(true);
  11118. this.callback && this.callback();
  11119. }, mySpine);
  11120. });
  11121. }
  11122. getWordsImg(number, pre = "", callback) {
  11123. let arr = [];
  11124. if (number <= 9) {
  11125. arr.push({ url: `res/d2Res/${pre + number}.png`, type: Laya.Loader.IMAGE });
  11126. }
  11127. else {
  11128. 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 });
  11129. }
  11130. Laya.loader.load(arr, Laya.Handler.create(this, () => {
  11131. callback && callback();
  11132. }));
  11133. }
  11134. }
  11135. class ui_UIRodMethod extends fgui.GComponent {
  11136. static createInstance() {
  11137. return (fgui.UIPackage.createObject("game", "UIRodMethod"));
  11138. }
  11139. onConstruct() {
  11140. this.n24 = (this.getChild("n24"));
  11141. this.white = (this.getChild("white"));
  11142. this.dot = (this.getChild("dot"));
  11143. this.sureBtn = (this.getChild("sureBtn"));
  11144. this.n20 = (this.getChild("n20"));
  11145. this.n21 = (this.getChild("n21"));
  11146. this.n22 = (this.getChild("n22"));
  11147. this.n23 = (this.getChild("n23"));
  11148. this.n5 = (this.getChild("n5"));
  11149. this.n14 = (this.getChild("n14"));
  11150. this.t0 = this.getTransition("t0");
  11151. }
  11152. }
  11153. ui_UIRodMethod.URL = "ui://isxx5ak7hkrz3tv";
  11154. class UIRodMethod extends UIBase {
  11155. constructor() {
  11156. super();
  11157. this.isPressd = false;
  11158. }
  11159. onConstructor() {
  11160. this.ui = ui_UIRodMethod.createInstance();
  11161. this.contentPane = this.ui;
  11162. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  11163. this.moveDir = new Laya.Vector2();
  11164. this.moveDest = new Laya.Vector2();
  11165. this.centerPos = new Laya.Vector2();
  11166. xGame.common.uiRodMethod = this;
  11167. }
  11168. show() {
  11169. super.show();
  11170. xGame.common.gameMgr.gamePause = true;
  11171. this.openPressDotEvent();
  11172. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  11173. this.centerPos.x = this.ui.white.x;
  11174. this.centerPos.y = this.ui.white.y;
  11175. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  11176. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  11177. this.setDot();
  11178. this.setGlobalFont(this.ui);
  11179. }
  11180. setDot() {
  11181. this.ui.dot.x = this.moveDest.x;
  11182. this.ui.dot.y = this.moveDest.y;
  11183. }
  11184. closeSelf() {
  11185. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  11186. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  11187. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  11188. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  11189. xGame.common.gameMgr.gamePause = false;
  11190. this.hide();
  11191. }
  11192. openPressDotEvent() {
  11193. this.closePressDotEvent();
  11194. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11195. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11196. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11197. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11198. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  11199. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11200. }
  11201. closePressDotEvent() {
  11202. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11203. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  11204. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11205. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11206. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  11207. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  11208. }
  11209. onDown(e) {
  11210. if (e.type == Laya.Event.MOUSE_DOWN)
  11211. this.isPressd = true;
  11212. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  11213. this.isPressd = false;
  11214. if (!this.isPressd)
  11215. return;
  11216. this.moveDest.x = e.stageX;
  11217. this.moveDest.y = e.stageY;
  11218. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  11219. if (dis > 6724) {
  11220. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  11221. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  11222. }
  11223. this.setDot();
  11224. }
  11225. resetRod() {
  11226. this.ui.dot.x = this.ui.white.x;
  11227. this.ui.dot.y = this.ui.white.y;
  11228. this.gameRod.dot.x = this.gameRod.bg.x;
  11229. this.gameRod.dot.y = this.gameRod.bg.y;
  11230. xGame.common.rodOffest.x = 0;
  11231. xGame.common.rodOffest.y = 0;
  11232. }
  11233. }
  11234. UIRodMethod.uiName = "UIRodMethod";
  11235. class UIGame extends UIBase {
  11236. constructor() {
  11237. super();
  11238. this.powerNum = 0;
  11239. this.isD3Inited = false;
  11240. this.isPrePlay = false;
  11241. this.isMoveRod = false;
  11242. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  11243. this.rulerDis = 20;
  11244. this.rulerOffset = 0;
  11245. }
  11246. onConstructor() {
  11247. this.ui = ui_UIGame.createInstance();
  11248. this.contentPane = this.ui;
  11249. this.ui.x += xGame.common.sysOffestNum;
  11250. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  11251. this.isEject = false;
  11252. xGame.common.gameUI = this;
  11253. this.initSelf();
  11254. }
  11255. isTurnSelf() {
  11256. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  11257. return true;
  11258. }
  11259. }
  11260. initSelf() {
  11261. let topUI = this.ui.topNode;
  11262. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  11263. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  11264. this.barInfo = {};
  11265. this.barInfo.curY = 0;
  11266. this.barInfo.height = this.ui.powerNode.height;
  11267. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  11268. this.barInfo.powerStartY = this.ui.powerNode.y;
  11269. xGame.common.aiPlayer = new AIPlayer();
  11270. xGame.common.gameMgr = new GameMgr();
  11271. xGame.common.skillMgr = new SkillMgr();
  11272. xGame.common.wordsMgr = new WordsMgr();
  11273. xGame.common.talkMgr = new TalkMgr();
  11274. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  11275. });
  11276. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  11277. });
  11278. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  11279. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  11280. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  11281. this.addUIClick(this.ui.returnBtn, this.returnHome);
  11282. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  11283. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  11284. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  11285. }
  11286. getGanZiImg() {
  11287. let index = DataMgr.getCurBallRod();
  11288. let data = cfgTable.ballrodData[index + 1];
  11289. let gan_url = xGame.common.getGameIconUrl(data.img);
  11290. this.ui.powerNode.showImg.url = gan_url;
  11291. }
  11292. returnHome() {
  11293. let tips = "Are you sure to exit the game?";
  11294. let woman = "Boss, why don't you play for a while longer?";
  11295. xGame.uiMgr.Show(UITips, tips, woman, TipsType.exitGame);
  11296. }
  11297. addRodMethodClick() {
  11298. if (this.isTurnSelf()) {
  11299. xGame.uiMgr.Show(UIRodMethod);
  11300. }
  11301. }
  11302. clickHelpLineBtn(force = false) {
  11303. if (!this.isTurnSelf())
  11304. return;
  11305. xGame.uiMgr.Show(UIRepentProp, 0, 0, (success) => {
  11306. if (success) {
  11307. xGame.common.longHelpLine = true;
  11308. xGame.common.d2World.getHelpLine();
  11309. Moyu.sendDataEvent("guideNum");
  11310. }
  11311. else {
  11312. }
  11313. });
  11314. }
  11315. renderSelfDisplayBalls(index, target) {
  11316. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  11317. target.myImg.url = xGame.common.getGameIconUrl(str);
  11318. }
  11319. renderAIDisplayBalls(index, target) {
  11320. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  11321. target.myImg.url = xGame.common.getGameIconUrl(str);
  11322. ;
  11323. }
  11324. updateMode() {
  11325. if (xGame.common.gameMode == GameMode.classic) {
  11326. this.ui.topNode.scoreNode.visible = false;
  11327. }
  11328. else if (xGame.common.gameMode == GameMode.bigMove) {
  11329. this.ui.topNode.scoreNode.visible = true;
  11330. }
  11331. }
  11332. show() {
  11333. super.show();
  11334. this.ui.alpha = 0;
  11335. this.updateSelf();
  11336. xGame.common.gameMgr.gamePause = false;
  11337. xGame.common.gameUI.ui.blackAni.visible = false;
  11338. xGame.common.gameUI.ui.whiteAni.visible = false;
  11339. this.ui.powerEft.visible = false;
  11340. this.ui.colorNode.visible = false;
  11341. this.updateHead();
  11342. let curUse = DataMgr.getCurBallRod();
  11343. this.getGanZiImg();
  11344. this.yinDaoForLianxi();
  11345. this.setGlobalFont(this.ui);
  11346. }
  11347. yinDaoForLianxi() {
  11348. let g = DataMgr.getSkillGuide();
  11349. if (g === 0) {
  11350. console.log('zh:默认的引导还没有完毕');
  11351. return;
  11352. }
  11353. let lianXiGuide = DataMgr.getLianXiGuide();
  11354. console.log('zh:lianXiGuide=', lianXiGuide);
  11355. if (lianXiGuide === 0) {
  11356. this.ui.n_lxms_yd1.visible = true;
  11357. console.log('zh:yinDaoForLianxi 111 set ok');
  11358. }
  11359. else {
  11360. this.ui.n_lxms_yd1.visible = false;
  11361. console.log('zh:无需引导11');
  11362. }
  11363. }
  11364. updateSelf() {
  11365. if (xGame.common.gameMode == GameMode.classic) {
  11366. this.ui.c1.selectedIndex = 0;
  11367. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  11368. this.ui.topNode.middleNode.visible = true;
  11369. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  11370. }
  11371. else if (xGame.common.gameMode == GameMode.bigMove) {
  11372. this.ui.c1.selectedIndex = 0;
  11373. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  11374. this.ui.topNode.middleNode.visible = false;
  11375. let max = xGame.cfgMgr.getMaxBigMoveLength();
  11376. let rand = xGame.common.randomNum(1, max);
  11377. let guide = DataMgr.getSkillGuide();
  11378. if (guide == 0)
  11379. rand = 1;
  11380. xGame.common.bigMoveLevelIndex = rand;
  11381. }
  11382. else if (xGame.common.gameMode == GameMode.placeBall) {
  11383. console.log('zh:练习模式...');
  11384. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  11385. this.ui.c1.selectedIndex = 1 + data.type;
  11386. this.ui.alpha = 1;
  11387. this.startGame();
  11388. }
  11389. this.updateMode();
  11390. this.initD3world();
  11391. this.initD2world();
  11392. }
  11393. startGame() {
  11394. this.ui.snowNode.visible = Math.random() <= 0.1;
  11395. this.ui.d2Node.visible = false;
  11396. xGame.common.d3World.d3Hand.gameObj.active = false;
  11397. xGame.common.d3World.tableSrc.init();
  11398. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11399. this.cameraViewChange(() => {
  11400. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  11401. switch (xGame.common.gameMode) {
  11402. case GameMode.classic:
  11403. xGame.common.d3World.d3Hand.gameObj.active = true;
  11404. this.playPutBallD3Ani();
  11405. break;
  11406. case GameMode.bigMove:
  11407. this.enterGame();
  11408. Laya.timer.once(500, this, () => {
  11409. this.ui.topNode.middleNode.visible = true;
  11410. this.ui.topNode.middleNode.t0.play();
  11411. });
  11412. break;
  11413. case GameMode.placeBall:
  11414. this.enterGame();
  11415. break;
  11416. default:
  11417. break;
  11418. }
  11419. });
  11420. PlatMgr.showBanner(false);
  11421. }
  11422. enterGame() {
  11423. this.ui.d2Node.visible = true;
  11424. xGame.common.d3World.d3Hand.gameObj.active = false;
  11425. xGame.common.showOneCamera("mainCamera");
  11426. Moyu.recordGame(30, true);
  11427. if (!this.isPrePlay) {
  11428. this.isPrePlay = true;
  11429. xGame.common.d3World.prePlayEft();
  11430. }
  11431. xGame.common.gameMgr.gameReady();
  11432. this.openAllEvent();
  11433. this.ui.snowNode.visible = false;
  11434. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  11435. this.ui.helpBtn.visible = condition;
  11436. }
  11437. showHelpLineGuide() {
  11438. let longGuide = DataMgr.getGuideHelpLine();
  11439. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  11440. this.ui.helpBtn.visible = true;
  11441. this.ui.guideNode.visible = true;
  11442. }
  11443. }
  11444. setTurnAlpha(alpha) {
  11445. this.ui.keduNode.alpha = alpha;
  11446. this.ui.ganNode.alpha = alpha;
  11447. this.ui.rodMethodNode.alpha = alpha;
  11448. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  11449. }
  11450. cameraViewChange(callback) {
  11451. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  11452. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  11453. xGame.common.showOneCamera("visitAngle");
  11454. cameraSrc.localRotationEulerY = 180;
  11455. cameraSrc.localRotationEulerZ = 0;
  11456. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  11457. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  11458. callback && callback();
  11459. }));
  11460. }));
  11461. }
  11462. playPutBallD3Ani() {
  11463. xGame.common.showOneCamera("mainCamera");
  11464. let handSrc = xGame.common.d3World.d3Hand;
  11465. handSrc.gameObj.active = true;
  11466. handSrc.transform.localPositionZ = 3;
  11467. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  11468. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  11469. handSrc.gameObj.active = false;
  11470. this.enterGame();
  11471. }), 400);
  11472. }));
  11473. }
  11474. updateHead() {
  11475. let user = Moyu.getUserInfo();
  11476. this.ui.topNode.selfNameTxt.text = user.nickName;
  11477. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  11478. let aiData = xGame.cfgMgr.getRandomUserInfo();
  11479. if (DataMgr.getSkillGuide() < 1) {
  11480. this.ui.topNode.aiNameTxt.text = 'billiards';
  11481. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  11482. }
  11483. else {
  11484. this.ui.topNode.aiNameTxt.text = aiData.name;
  11485. let randNo = Math.floor(Math.random() * 10) + 1;
  11486. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  11487. }
  11488. }
  11489. initD2world() {
  11490. let node = this.ui.d2Root.displayObject;
  11491. let src = node.getComponent(D2World);
  11492. if (!src) {
  11493. xGame.common.d2World = node.addComponent(D2World);
  11494. }
  11495. xGame.common.d2World.initSelf();
  11496. }
  11497. initD3world() {
  11498. if (this.isD3Inited)
  11499. return;
  11500. this.isD3Inited = true;
  11501. let scene3D = xGame.common.d3Scene;
  11502. this.ui.d3Root.displayObject.addChild(scene3D);
  11503. scene3D.active = true;
  11504. xGame.common.d3World.tableSrc.setBorderPos();
  11505. }
  11506. onRootMove(e) {
  11507. let rootBall = xGame.common.d2World.rootBall;
  11508. this.ui.moveNode.x = e.x;
  11509. this.ui.moveNode.y = e.y;
  11510. rootBall.gameObj.x = e.x;
  11511. rootBall.gameObj.y = e.y;
  11512. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  11513. }
  11514. aiRootMove(move) {
  11515. if (move)
  11516. this.hideBallUI();
  11517. else {
  11518. this.showBallUI();
  11519. xGame.common.d2World.getHelpLine();
  11520. }
  11521. }
  11522. aiForce(type, force = 0) {
  11523. this.pressTarget = PressType.powerNode;
  11524. if (type == 1)
  11525. this.onEventUp({ force: true });
  11526. else if (type == 2)
  11527. this.onEventMove({ stageY: force, force: true });
  11528. }
  11529. onEventPress(e) {
  11530. if (e.stopPropagation)
  11531. e.stopPropagation();
  11532. if (!this.isTurnSelf())
  11533. return;
  11534. let target = e.target;
  11535. switch (target) {
  11536. case this.ui.myPowerNode.displayObject:
  11537. this.pressTarget = PressType.powerNode;
  11538. this.barInfo.curY = e.stageY;
  11539. this.updateBarInfo();
  11540. break;
  11541. case this.ui.moveNode.displayObject:
  11542. this.pressTarget = PressType.moveNode;
  11543. this.hideBallUI();
  11544. this.eventObj.curX = this.ui.moveNode.x;
  11545. this.eventObj.curY = this.ui.moveNode.y;
  11546. this.ui.moveNode.finger.visible = false;
  11547. this.eventObj.lastX = e.stageX;
  11548. this.eventObj.lastY = e.stageY;
  11549. break;
  11550. case this.ui.rulerClickNode.displayObject:
  11551. this.pressTarget = PressType.rulerNode;
  11552. this.eventObj.lastY = e.stageY;
  11553. break;
  11554. case this.ui.d2Root.displayObject:
  11555. this.pressTarget = PressType.d2Root;
  11556. this.eventObj.lastX = e.stageX;
  11557. this.eventObj.lastY = e.stageY;
  11558. this.eventObj.starX = e.stageX;
  11559. this.eventObj.starY = e.stageY;
  11560. this.eventObj.curX = 0;
  11561. this.eventObj.curY = 0;
  11562. xGame.common.d2World.d2Gan.setGanLastInfo();
  11563. this.rulerOffset = 0;
  11564. break;
  11565. default:
  11566. break;
  11567. }
  11568. }
  11569. onEventMove(e) {
  11570. if (e.stopPropagation)
  11571. e.stopPropagation();
  11572. if (e && e.force) {
  11573. }
  11574. else {
  11575. if (!this.isTurnSelf())
  11576. return;
  11577. }
  11578. switch (this.pressTarget) {
  11579. case PressType.powerNode:
  11580. this.barInfo.curY = e.stageY;
  11581. this.updateBarInfo();
  11582. this.isMoveRod = true;
  11583. break;
  11584. case PressType.moveNode:
  11585. let rootBall = xGame.common.d2World.rootBall;
  11586. let radius = rootBall.gameObj.width / 2;
  11587. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  11588. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  11589. let border = xGame.common.d2World.borderRect;
  11590. if (curX <= border.x + radius)
  11591. curX = border.x + radius;
  11592. else if (curX >= border.x + border.width - radius)
  11593. curX = border.x + border.width - radius;
  11594. if (curY <= border.y + radius)
  11595. curY = border.y + radius;
  11596. else if (curY >= border.y + border.height - radius)
  11597. curY = border.y + border.height - radius;
  11598. if (xGame.common.gameMgr.isOpenBall) {
  11599. if (curX >= border.x + border.openBallW - radius)
  11600. curX = border.x + border.openBallW - radius;
  11601. }
  11602. this.ui.moveNode.x = curX;
  11603. this.ui.moveNode.y = curY;
  11604. rootBall.gameObj.x = curX;
  11605. rootBall.gameObj.y = curY;
  11606. rootBall.d3BallSrc.setTransPos(curX, curY);
  11607. this.isMoveRod = true;
  11608. break;
  11609. case PressType.rulerNode:
  11610. let yy = e.stageY - this.eventObj.lastY;
  11611. this.eventObj.lastY = e.stageY;
  11612. let ruler1 = this.ui.rulerNode.img1;
  11613. let ruler2 = this.ui.rulerNode.img2;
  11614. ruler1.y += yy;
  11615. ruler2.y += yy;
  11616. this.rulerOffset += yy;
  11617. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  11618. this.rulerOffset = 0;
  11619. xGame.soundMgr.playSound("inch", 1, 10);
  11620. }
  11621. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  11622. let h = ruler1.height;
  11623. this.checkGuide();
  11624. this.checkGuideForLxms();
  11625. this.isMoveRod = true;
  11626. if (ruler1.y >= h) {
  11627. ruler1.y = -h;
  11628. ruler2.y = 0;
  11629. return;
  11630. }
  11631. else if (ruler1.y <= -h) {
  11632. ruler1.y = h;
  11633. ruler2.y = 0;
  11634. return;
  11635. }
  11636. if (ruler2.y >= h) {
  11637. ruler2.y = -h;
  11638. ruler1.y = 0;
  11639. return;
  11640. }
  11641. else if (ruler2.y <= -h) {
  11642. ruler2.y = h;
  11643. ruler1.y = 0;
  11644. return;
  11645. }
  11646. break;
  11647. case PressType.d2Root:
  11648. this.eventObj.curX = e.stageX;
  11649. this.eventObj.curY = e.stageY;
  11650. let offset = this.checkRodMoveDir();
  11651. xGame.common.d2World.d2Gan.rotateSelf(offset);
  11652. this.eventObj.lastX = e.stageX;
  11653. this.eventObj.lastY = e.stageY;
  11654. break;
  11655. default:
  11656. break;
  11657. }
  11658. }
  11659. onEventUp(e) {
  11660. if (e.stopPropagation)
  11661. e.stopPropagation();
  11662. if (e && e.force) {
  11663. }
  11664. else {
  11665. if (!this.isTurnSelf())
  11666. return;
  11667. }
  11668. switch (this.pressTarget) {
  11669. case PressType.powerNode:
  11670. this.ui.powerNode.value = 0;
  11671. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11672. this.ui.powerTxt.text = "";
  11673. if (this.powerNum > 0) {
  11674. xGame.eventMgr.event(BALL_SHOOT);
  11675. xGame.common.d2World.shoot(this.powerNum);
  11676. xGame.common.d2World.d2Gan.shoot();
  11677. xGame.common.d2World.d2HelpLine.shoot();
  11678. this.finishGuide();
  11679. this.finishGuideForLxms();
  11680. this.ui.powerEft.visible = false;
  11681. this.ui.colorNode.visible = false;
  11682. let ganStr = "";
  11683. if (this.powerNum <= 30) {
  11684. ganStr = "gan_30";
  11685. }
  11686. else if (this.powerNum <= 60) {
  11687. ganStr = "gan_50";
  11688. }
  11689. else {
  11690. ganStr = "gan_80";
  11691. }
  11692. xGame.soundMgr.playSound(ganStr);
  11693. }
  11694. break;
  11695. case PressType.moveNode:
  11696. let rootBall = xGame.common.d2World.rootBall;
  11697. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  11698. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  11699. let isIntersect = this.judgeBallIntersect();
  11700. if (isIntersect) {
  11701. this.ui.moveNode.x = lastX;
  11702. this.ui.moveNode.y = lastY;
  11703. rootBall.gameObj.x = lastX;
  11704. rootBall.gameObj.y = lastY;
  11705. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  11706. xGame.uiMgr.Show(UIMsg, "Incorrect placement position");
  11707. }
  11708. else {
  11709. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  11710. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  11711. }
  11712. this.showBallUI();
  11713. this.ui.moveNode.finger.visible = true;
  11714. xGame.common.d2World.getHelpLine();
  11715. break;
  11716. case PressType.rulerNode:
  11717. break;
  11718. case PressType.d2Root:
  11719. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  11720. if (dis <= 25) {
  11721. this.moveToClickDot(e);
  11722. }
  11723. break;
  11724. default:
  11725. break;
  11726. }
  11727. this.pressTarget = -1;
  11728. }
  11729. checkGuide() {
  11730. let guide = DataMgr.getSkillGuide();
  11731. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  11732. xGame.common.guideStep++;
  11733. xGame.common.gameUI.ui.guide2.visible = false;
  11734. xGame.common.gameUI.ui.guide3.visible = true;
  11735. }
  11736. }
  11737. checkGuideForLxms() {
  11738. let guide = DataMgr.getLianXiGuide();
  11739. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 2) {
  11740. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  11741. xGame.common.gameUI.ui.n_lxms_yd3.visible = true;
  11742. xGame.common.guideStepForLianXi = 3;
  11743. }
  11744. }
  11745. finishGuide() {
  11746. let guide = DataMgr.getSkillGuide();
  11747. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  11748. xGame.common.guideStep = 10;
  11749. this.closeAllGuide();
  11750. console.log('zh: 新手引导完毕');
  11751. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11752. }
  11753. }
  11754. finishGuideForLxms() {
  11755. let guide = DataMgr.getLianXiGuide();
  11756. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  11757. xGame.common.guideStepForLianXi = 3;
  11758. DataMgr.setLianXiGuide(1);
  11759. this.closeAllGuideForLxms();
  11760. console.log('zh: lxms新手引导完毕');
  11761. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  11762. }
  11763. }
  11764. closeAllGuide() {
  11765. xGame.common.gameUI.ui.guide1.visible = false;
  11766. xGame.common.gameUI.ui.guide2.visible = false;
  11767. xGame.common.gameUI.ui.guide3.visible = false;
  11768. }
  11769. closeAllGuideForLxms() {
  11770. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  11771. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  11772. xGame.common.gameUI.ui.n_lxms_yd3.visible = false;
  11773. }
  11774. updateBarInfo() {
  11775. let star = this.ui.powerNode.y;
  11776. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  11777. if (rate >= 1)
  11778. rate = 1;
  11779. if (rate <= 0)
  11780. rate = 0;
  11781. this.powerNum = Math.ceil(rate * 100);
  11782. this.ui.powerNode.value = this.powerNum;
  11783. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  11784. this.ui.colorNode.value = this.powerNum;
  11785. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  11786. this.ui.powerEft.visible = this.powerNum != 0;
  11787. this.ui.colorNode.visible = this.powerNum != 0;
  11788. this.ui.powerTxt.text = this.powerNum + "";
  11789. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  11790. }
  11791. forceCancel() {
  11792. this.ui.powerNode.value = 0;
  11793. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  11794. this.ui.powerTxt.text = "";
  11795. }
  11796. checkRodMoveDir() {
  11797. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  11798. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  11799. if (tempX >= 0 && tempY <= 0) {
  11800. return this.checkDir();
  11801. }
  11802. else if (tempX < 0 && tempY < 0) {
  11803. return this.checkDir(1, -1);
  11804. }
  11805. else if (tempX < 0 && tempY > 0) {
  11806. return this.checkDir(-1, -1);
  11807. }
  11808. else {
  11809. return this.checkDir(-1, 1);
  11810. }
  11811. }
  11812. checkDir(flagX = 1, flagY = 1) {
  11813. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  11814. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  11815. if (offsetY == 0) {
  11816. return offsetX * flagX;
  11817. }
  11818. if (offsetX == 0) {
  11819. return offsetY * flagY;
  11820. }
  11821. let angle = offsetY / offsetX;
  11822. if (Math.abs(angle) >= 1) {
  11823. return offsetY * flagY;
  11824. }
  11825. else {
  11826. return offsetX * flagX;
  11827. }
  11828. }
  11829. judgeBallIntersect() {
  11830. let rootBall = xGame.common.d2World.rootBall;
  11831. let ballArr = xGame.common.d2World.ballArr;
  11832. let radius = rootBall.gameObj.width / 2;
  11833. let temp;
  11834. let isIntersect = false;
  11835. for (let index = 0; index < ballArr.length; index++) {
  11836. temp = ballArr[index];
  11837. if (temp.number == rootBall.number)
  11838. continue;
  11839. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  11840. if (isIntersect) {
  11841. break;
  11842. }
  11843. }
  11844. return isIntersect;
  11845. }
  11846. hideBallUI() {
  11847. let d2Gan = xGame.common.d2World.d2Gan;
  11848. if (!d2Gan.ui.isDisposed)
  11849. d2Gan.ui.visible = false;
  11850. let d2Help = xGame.common.d2World.d2HelpLine;
  11851. if (!d2Help.ui.isDisposed)
  11852. d2Help.ui.visible = false;
  11853. let rootBall = xGame.common.d2World.rootBall;
  11854. if (!rootBall.destroyed) {
  11855. rootBall.gameObj.active = false;
  11856. }
  11857. }
  11858. showBallUI() {
  11859. let d2Gan = xGame.common.d2World.d2Gan;
  11860. if (!d2Gan.ui.isDisposed)
  11861. d2Gan.ui.visible = true;
  11862. let d2Help = xGame.common.d2World.d2HelpLine;
  11863. if (!d2Help.ui.isDisposed)
  11864. d2Help.ui.visible = true;
  11865. let rootBall = xGame.common.d2World.rootBall;
  11866. if (!rootBall.destroyed) {
  11867. rootBall.gameObj.active = true;
  11868. }
  11869. }
  11870. moveToClickDot(e) {
  11871. if (!this.isMoveRod && !xGame.common.clickedBall) {
  11872. let root = xGame.common.d2World.rootBall.gameObj;
  11873. let xx = e.stageX - xGame.common.sysOffestNum;
  11874. let yy = e.stageY;
  11875. let x = xx - root.x;
  11876. let y = yy - root.y;
  11877. let angle = xGame.common.getfguiRotation(x, y);
  11878. xGame.common.d2World.d2Gan.ui.rotation = angle;
  11879. xGame.common.d2World.getHelpLine();
  11880. }
  11881. this.isMoveRod = false;
  11882. xGame.common.clickedBall = false;
  11883. }
  11884. openAllEvent() {
  11885. this.closeAllEvent();
  11886. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11887. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11888. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11889. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11890. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11891. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11892. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11893. }
  11894. closeAllEvent() {
  11895. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11896. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11897. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11898. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  11899. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  11900. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  11901. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  11902. }
  11903. resetGame() {
  11904. this.closeAllEvent();
  11905. this.hideBallUI();
  11906. xGame.common.gameMgr.gamePause = true;
  11907. }
  11908. }
  11909. UIGame.uiName = "UIGame";
  11910. class UIAddProp extends UIBase {
  11911. constructor() {
  11912. super();
  11913. this.curType = "";
  11914. }
  11915. onConstructor() {
  11916. this.ui = ui_UIAddProp.createInstance();
  11917. this.contentPane = this.ui;
  11918. this.isEject = false;
  11919. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  11920. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  11921. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  11922. this.updateUI();
  11923. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  11924. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  11925. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  11926. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  11927. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  11928. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  11929. }
  11930. show(type) {
  11931. super.show();
  11932. this.curType = type == 0 ? "coin" : "diamond";
  11933. this.switchBtn("");
  11934. this.ui.t0.play();
  11935. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  11936. PlatMgr.showInsert(true);
  11937. this.setGlobalFont(this.ui);
  11938. }
  11939. closeSelf() {
  11940. this.hide();
  11941. }
  11942. updateUI() {
  11943. let data = cfgTable.moneyData;
  11944. let temp;
  11945. let obj;
  11946. for (const key in data) {
  11947. temp = data[key];
  11948. obj = this.ui.myNode["node" + key];
  11949. if (parseInt(key) <= 2) {
  11950. obj.diamondTxt.text = "+" + temp.num;
  11951. }
  11952. else {
  11953. obj.coinTxt.text = temp.num;
  11954. obj.diamondTxt.text = temp.get.split('_')[1];
  11955. }
  11956. }
  11957. this.updateDiamondShare();
  11958. }
  11959. updateDiamondShare() {
  11960. let data = DataMgr.getShareDiamondTimes();
  11961. if (data >= xGame.common.maxShareDiamondTimes) {
  11962. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  11963. this.ui.myNode.node1.touchable = false;
  11964. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  11965. }
  11966. else {
  11967. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  11968. this.ui.myNode.node1.touchable = true;
  11969. }
  11970. }
  11971. switchBtn(type) {
  11972. if (type == "")
  11973. type = this.curType;
  11974. else {
  11975. if (this.curType == type) {
  11976. return;
  11977. }
  11978. else {
  11979. this.curType = type;
  11980. }
  11981. }
  11982. if (type == "coin") {
  11983. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  11984. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  11985. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  11986. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  11987. this.ui.myNode.c1.selectedIndex = 0;
  11988. }
  11989. else {
  11990. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  11991. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  11992. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  11993. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  11994. this.ui.myNode.c1.selectedIndex = 1;
  11995. }
  11996. }
  11997. convertCoin(index) {
  11998. let data = cfgTable.moneyData[index];
  11999. let coinNum = data.num;
  12000. let str = data.get.split('_')[1];
  12001. let needDiamond = parseInt(str);
  12002. if (DataMgr.diamondEnough(needDiamond)) {
  12003. DataMgr.setDiamond(-needDiamond);
  12004. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  12005. xGame.uiMgr.Show(UIMsg, "Exchange successful!");
  12006. }
  12007. else {
  12008. xGame.uiMgr.Show(UIMsg, "Diamond shortage");
  12009. this.switchBtn("diamond");
  12010. }
  12011. }
  12012. videoGetDiamond() {
  12013. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  12014. if (Laya.Browser.onAndroid) {
  12015. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12016. if (!boo) {
  12017. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12018. return;
  12019. }
  12020. }
  12021. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  12022. }
  12023. else {
  12024. console.log('zh:AD 失败,直接发放奖励');
  12025. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  12026. }
  12027. }
  12028. qjff_AD_for_uiAddProp_videoGetDiamond() {
  12029. let num = cfgTable.moneyData[2].num;
  12030. xGame.common.playObjFlyAnim(num, Prop.diamond);
  12031. this.closeSelf();
  12032. }
  12033. videoGetCoin() {
  12034. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  12035. if (Laya.Browser.onAndroid) {
  12036. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12037. if (!boo) {
  12038. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12039. return;
  12040. }
  12041. }
  12042. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  12043. }
  12044. else {
  12045. console.log('zh:AD 失败,直接发放奖励');
  12046. this.qjff_AD_for_uiAddProp_videoGetCoin();
  12047. }
  12048. }
  12049. qjff_AD_for_uiAddProp_videoGetCoin() {
  12050. xGame.common.playObjFlyAnim(2000, Prop.coin);
  12051. this.closeSelf();
  12052. }
  12053. shareGetDiamond() {
  12054. let times = DataMgr.getShareDiamondTimes();
  12055. if (times >= xGame.common.maxShareDiamondTimes) {
  12056. console.log('zh: 233333333333 maxShareDiamondTimes');
  12057. xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
  12058. }
  12059. else {
  12060. console.log('zh:33333333333333ad');
  12061. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  12062. if (Laya.Browser.onAndroid) {
  12063. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12064. if (!boo) {
  12065. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12066. return;
  12067. }
  12068. }
  12069. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  12070. }
  12071. else {
  12072. console.log('zh:AD 失败,直接发放奖励');
  12073. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  12074. }
  12075. }
  12076. }
  12077. qjff_AD_for_uiAddProp_shareGetDiamond() {
  12078. let diamond = xGame.common.randomNum(50, 100);
  12079. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  12080. DataMgr.setShareDiamondTimes(1);
  12081. this.updateDiamondShare();
  12082. }
  12083. openPutBallView() {
  12084. let end = xGame.uiMgr.getUI(UIGameEnd);
  12085. let skill = xGame.uiMgr.getUI(UISkill);
  12086. let level = xGame.uiMgr.getUI(UILevelDisplay);
  12087. let uigame = xGame.uiMgr.getUI(UIGame);
  12088. if (end && !end.isHide) {
  12089. xGame.uiMgr.Hide(UIGameEnd);
  12090. xGame.uiMgr.Show(UIMain);
  12091. }
  12092. if (skill && !skill.isHide)
  12093. xGame.uiMgr.Hide(UISkill);
  12094. if (uigame && !uigame.isHide)
  12095. xGame.uiMgr.Hide(UIGame);
  12096. if (level && !level.isHide) {
  12097. }
  12098. else {
  12099. xGame.uiMgr.Show(UILevelDisplay);
  12100. }
  12101. this.closeSelf();
  12102. }
  12103. }
  12104. UIAddProp.uiName = "UIAddProp";
  12105. class MoneyNode {
  12106. constructor(ui) {
  12107. this.leftTime = 0;
  12108. this.ui = ui;
  12109. this.ui.addCoinBtn.onClick(this, this.addCoin);
  12110. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  12111. this.ui.addPowerBtn.onClick(this, this.addPower);
  12112. this.ui.c1.selectedIndex = 1;
  12113. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  12114. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  12115. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  12116. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  12117. this.coinChange();
  12118. this.diamondChange();
  12119. this.powerChange();
  12120. }
  12121. addPower() {
  12122. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12123. xGame.uiMgr.Show(UIPower);
  12124. }
  12125. powerChange() {
  12126. let powerNum = DataMgr.getPower();
  12127. this.ui.powerTxt.text = powerNum + "";
  12128. }
  12129. checkPowerTime() {
  12130. let cur = new Date().getTime();
  12131. let last = DataMgr.getPowerTime();
  12132. if (last == 0) {
  12133. last = cur;
  12134. DataMgr.setPowerTime(cur);
  12135. }
  12136. let power = DataMgr.getPower();
  12137. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  12138. Laya.timer.clearAll(this);
  12139. if (power >= xGame.common.natureMaxPower) {
  12140. this.ui.powerTimeTxt.text = "";
  12141. DataMgr.setPowerTime(cur);
  12142. return;
  12143. }
  12144. if (power + offset >= xGame.common.natureMaxPower) {
  12145. DataMgr.setPower(xGame.common.natureMaxPower, false);
  12146. this.ui.powerTimeTxt.text = "";
  12147. DataMgr.setPowerTime(cur);
  12148. }
  12149. else {
  12150. if (offset > 0) {
  12151. DataMgr.setPower(offset);
  12152. DataMgr.setPowerTime(cur);
  12153. }
  12154. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  12155. this.leftTime = xGame.common.powerRecoverNum - time;
  12156. if (this.leftTime <= 0)
  12157. this.leftTime = 0;
  12158. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12159. Laya.timer.loop(1000, this, this.updatePowerTime);
  12160. }
  12161. }
  12162. updatePowerTime() {
  12163. this.leftTime -= 1;
  12164. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  12165. if (this.leftTime <= 0) {
  12166. this.checkPowerTime();
  12167. }
  12168. }
  12169. coinChange() {
  12170. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  12171. }
  12172. diamondChange() {
  12173. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  12174. }
  12175. addCoin() {
  12176. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12177. Moyu.sendDataEvent("AddCoinBtn");
  12178. xGame.uiMgr.Show(UIAddProp, 0);
  12179. }
  12180. addDiamond() {
  12181. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  12182. Moyu.sendDataEvent("AddDiamondBtn");
  12183. xGame.uiMgr.Show(UIAddProp, 1);
  12184. }
  12185. }
  12186. class UIDraw extends UIBase {
  12187. constructor() {
  12188. super();
  12189. this.curKey = 0;
  12190. }
  12191. onConstructor() {
  12192. this.ui = ui_UIDraw.createInstance();
  12193. this.contentPane = this.ui;
  12194. this.isEject = false;
  12195. this.moneyNode = new MoneyNode(this.ui.moneyNode);
  12196. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  12197. this.addUIClick(this.ui.drawBtn, this.startDraw);
  12198. this.initDraw();
  12199. this.initUI();
  12200. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12201. }
  12202. show() {
  12203. super.show();
  12204. this.ui.t0.play();
  12205. this.playSecretaryIdle();
  12206. this.updateDraw();
  12207. this.checkFree();
  12208. if (PlatMgr.bannerDelay > 0) {
  12209. this.ui.closeNode.closeBtn.visible = false;
  12210. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  12211. this.ui.closeNode.closeBtn.visible = true;
  12212. });
  12213. }
  12214. PlatMgr.showRateBanner();
  12215. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  12216. this.setGlobalFont(this.ui);
  12217. }
  12218. hide() {
  12219. Laya.timer.clearAll(this);
  12220. super.hide();
  12221. }
  12222. checkFree() {
  12223. let isFree = DataMgr.getDailyfreeDrawTimes();
  12224. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  12225. }
  12226. initDraw() {
  12227. this.drawObj = [];
  12228. let data = cfgTable.drawData;
  12229. let temp;
  12230. let weight = 0;
  12231. for (const key in data) {
  12232. temp = data[key];
  12233. weight += temp.weight;
  12234. this.drawObj.push(weight);
  12235. }
  12236. this.allWeight = weight;
  12237. }
  12238. initUI() {
  12239. let data = cfgTable.drawData;
  12240. let temp;
  12241. let img;
  12242. let txt;
  12243. for (const key in data) {
  12244. temp = data[key];
  12245. img = this.ui.myNode.rotNode["img" + key];
  12246. txt = this.ui.myNode.rotNode["txt" + key];
  12247. img.url = xGame.common.getGameIconUrl(temp.icon);
  12248. txt.visible = true;
  12249. if (temp.award > 2) {
  12250. img.rotation = 0;
  12251. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  12252. }
  12253. else {
  12254. img.rotation = temp.rotation;
  12255. txt.text = temp.num;
  12256. }
  12257. }
  12258. }
  12259. getCurkey() {
  12260. let rand = Math.random() * this.allWeight;
  12261. let temp;
  12262. for (let index = 0; index < this.drawObj.length - 1; index++) {
  12263. temp = this.drawObj[index];
  12264. if (index == 0) {
  12265. if (rand < temp) {
  12266. return index + 1;
  12267. }
  12268. }
  12269. else {
  12270. if (rand >= temp && rand < this.drawObj[index + 1]) {
  12271. return index + 1;
  12272. }
  12273. }
  12274. }
  12275. return 2;
  12276. }
  12277. startDraw() {
  12278. console.log('zh:开始抽奖');
  12279. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  12280. if (freeTimes > 0) {
  12281. console.log('zh:freeTimes=' + freeTimes);
  12282. this.beginDraw();
  12283. DataMgr.setDailyfreeDrawTimes(0);
  12284. this.checkFree();
  12285. }
  12286. else {
  12287. if (Laya.Browser.onAndroid) {
  12288. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  12289. if (!boo) {
  12290. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  12291. return;
  12292. }
  12293. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  12294. }
  12295. else {
  12296. console.log('zh:AD 失败,直接发放奖励');
  12297. this.qjff_chouJiang();
  12298. }
  12299. }
  12300. else {
  12301. this.qjff_chouJiang();
  12302. }
  12303. }
  12304. }
  12305. qjff_chouJiang() {
  12306. this.beginDraw();
  12307. }
  12308. beginDraw() {
  12309. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  12310. this.ui.drawBtn.touchable = false;
  12311. this.curKey = this.getCurkey();
  12312. console.log("zh:当前key", this.curKey);
  12313. let cell = 60;
  12314. let lap = 3;
  12315. let angle = cell * (this.curKey - 1) + lap * 360;
  12316. let target = this.ui.myNode.rotNode;
  12317. target.rotation = 0;
  12318. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  12319. console.log("zh:旋转完成");
  12320. this.ui.drawBtn.touchable = true;
  12321. this.getAward();
  12322. }));
  12323. }
  12324. getAward() {
  12325. let data = cfgTable.drawData[this.curKey];
  12326. let temp = new AwardType();
  12327. temp.type = data.award;
  12328. temp.num = data.num;
  12329. xGame.common.getAward([temp], () => {
  12330. DataMgr.setDrawTimes(1);
  12331. this.updateDraw();
  12332. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  12333. });
  12334. }
  12335. updateDraw() {
  12336. let drawTimes = DataMgr.getDrawTimes();
  12337. let awardTimes = DataMgr.getDrawAwardTimes();
  12338. if (Math.floor(drawTimes / 3) > awardTimes) {
  12339. this.ui.extraNode.boxBtn.t0.play(null, -1);
  12340. this.ui.extraNode.boxBtn.touchable = true;
  12341. this.ui.extraNode.tipsTxt.text = "3/3";
  12342. this.ui.extraNode.barNode.width = 265;
  12343. this.getExtraAward();
  12344. }
  12345. else {
  12346. this.ui.extraNode.boxBtn.t0.stop();
  12347. this.ui.extraNode.boxBtn.touchable = false;
  12348. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  12349. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  12350. }
  12351. let data = cfgTable.drawData[1];
  12352. if (awardTimes == 0) {
  12353. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  12354. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  12355. this.ui.myNode.rotNode.img1.rotation = 0;
  12356. }
  12357. else {
  12358. let award = data.nextid;
  12359. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  12360. this.ui.myNode.rotNode.txt1.text = award[1];
  12361. this.ui.myNode.rotNode.img1.rotation = 0;
  12362. }
  12363. }
  12364. getExtraAward() {
  12365. let drawTimes = DataMgr.getDrawTimes();
  12366. let awardTimes = DataMgr.getDrawAwardTimes();
  12367. let data = cfgTable.drawData[1];
  12368. let award = new AwardType();
  12369. if (awardTimes == 0) {
  12370. award.num = data.num;
  12371. award.type = data.award;
  12372. xGame.common.getAward([award], () => {
  12373. let all = Math.floor(drawTimes / 3);
  12374. DataMgr.setDrawAwardTimes(all);
  12375. this.updateDraw();
  12376. });
  12377. }
  12378. else {
  12379. award.num = parseInt(data.nextid[1]);
  12380. award.type = parseInt(data.nextid[0]);
  12381. xGame.common.getAward([award], () => {
  12382. let all = Math.floor(drawTimes / 3);
  12383. DataMgr.setDrawAwardTimes(all);
  12384. this.updateDraw();
  12385. });
  12386. }
  12387. }
  12388. closeSelf() {
  12389. this.hide();
  12390. }
  12391. playSecretaryIdle() {
  12392. let parent = this.ui.secretary.displayObject;
  12393. parent.destroyChildren();
  12394. let xx = this.ui.secretary.width / 2;
  12395. let yy = this.ui.secretary.height;
  12396. let scale = xGame.common.getSecretaryScale();
  12397. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  12398. xGame.common.secretary.play(data, 0, true, parent);
  12399. }
  12400. }
  12401. UIDraw.uiName = "UIDraw";
  12402. class ui_UIFlyEft extends fgui.GComponent {
  12403. static createInstance() {
  12404. return (fgui.UIPackage.createObject("game", "UIFlyEft"));
  12405. }
  12406. onConstruct() {
  12407. this.n0 = (this.getChild("n0"));
  12408. this.n1 = (this.getChild("n1"));
  12409. this.n2 = (this.getChild("n2"));
  12410. this.n3 = (this.getChild("n3"));
  12411. this.n4 = (this.getChild("n4"));
  12412. this.n5 = (this.getChild("n5"));
  12413. this.n6 = (this.getChild("n6"));
  12414. this.n7 = (this.getChild("n7"));
  12415. this.iconNode = (this.getChild("iconNode"));
  12416. this.txt = (this.getChild("txt"));
  12417. this.txtNode = (this.getChild("txtNode"));
  12418. }
  12419. }
  12420. ui_UIFlyEft.URL = "ui://isxx5ak7lj6tv4mf";
  12421. class UIFlyEft extends UIBase {
  12422. constructor() {
  12423. super();
  12424. this.max = 8;
  12425. this.delay = 0;
  12426. }
  12427. onConstructor() {
  12428. this.ui = ui_UIFlyEft.createInstance();
  12429. this.contentPane = this.ui;
  12430. this.isEject = false;
  12431. this.isMuti = true;
  12432. this.ui.x += xGame.common.sysOffestNum;
  12433. }
  12434. getArrPos() {
  12435. if (this.iconPos && this.iconPos.length > 0)
  12436. return;
  12437. this.iconPos = [];
  12438. let temp;
  12439. for (let index = 0; index < this.max; index++) {
  12440. temp = this.ui["n" + index];
  12441. this.iconPos.push([temp.x, temp.y]);
  12442. }
  12443. }
  12444. show(stPos, edPos, num, type, callback) {
  12445. super.show();
  12446. this.parent.setChildIndex(this, this.parent.numChildren - 1);
  12447. this.getArrPos();
  12448. this.updateUI(type);
  12449. this.updatePos();
  12450. this.runFly(edPos, callback);
  12451. this.runWorlds(stPos, num);
  12452. this.setGlobalFont(this.ui);
  12453. }
  12454. updateUI(type) {
  12455. let temp;
  12456. let str;
  12457. for (let index = 0; index < this.max; index++) {
  12458. temp = this.ui["n" + index];
  12459. str = this.getIconStr(type);
  12460. temp.url = xGame.common.getGameIconUrl(str);
  12461. }
  12462. }
  12463. getIconStr(type) {
  12464. switch (type) {
  12465. case Prop.diamond:
  12466. return "ty_zs";
  12467. case Prop.coin:
  12468. return "ty_jb";
  12469. default:
  12470. break;
  12471. }
  12472. }
  12473. updatePos() {
  12474. let temp;
  12475. for (let index = 0; index < this.max; index++) {
  12476. temp = this.ui["n" + index];
  12477. temp.x = this.iconPos[index][0];
  12478. temp.y = this.iconPos[index][1];
  12479. }
  12480. }
  12481. runFly(endPos, callback) {
  12482. let all = 0;
  12483. let temp;
  12484. for (let index = 0; index < this.max; index++) {
  12485. temp = this.ui["n" + index];
  12486. temp.visible = true;
  12487. Laya.Tween.to(temp, { x: endPos.x, y: endPos.y }, 600, Laya.Ease.cubicInOut, Laya.Handler.create(this, () => {
  12488. temp.visible = false;
  12489. all++;
  12490. if (all >= this.max) {
  12491. callback && callback();
  12492. }
  12493. }), 20 * index);
  12494. }
  12495. }
  12496. runWorlds(stPos, num) {
  12497. let str = "+" + num;
  12498. this.ui.txt.text = str;
  12499. let starX = stPos.x;
  12500. let starY = stPos.y + 50;
  12501. this.ui.txt.x = starX;
  12502. this.ui.txt.y = starY;
  12503. this.ui.txt.visible = true;
  12504. this.ui.txt.alpha = 1;
  12505. Laya.Tween.to(this.ui.txt, { x: starX, y: starY - 30 }, 500, null, Laya.Handler.create(this, () => {
  12506. Laya.Tween.to(this.ui.txt, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  12507. this.ui.txt.visible = false;
  12508. this.hide();
  12509. }));
  12510. }));
  12511. }
  12512. }
  12513. UIFlyEft.uiName = "UIFlyEft";
  12514. class Common {
  12515. constructor() {
  12516. this.convertNum = 0.025;
  12517. this.VectorUp = new Laya.Vector3(0, 1, 0);
  12518. this.scaleV3One = new Laya.Vector3();
  12519. this.scaleV3Two = new Laya.Vector3();
  12520. this.posV4 = new Laya.Vector4();
  12521. this.showDebug = false;
  12522. this.openGuide = true;
  12523. this.rodOffest = new Laya.Vector2(0, 0);
  12524. this.rodAngle = 0;
  12525. this.gameMode = GameMode.classic;
  12526. this.bigMoveLevelIndex = 1;
  12527. this.bigMoveNeedCoin = 1000;
  12528. this.classicNiceNeddCoin = 1000;
  12529. this.passAwardCoin = 2000;
  12530. this.classicRoomType = 1;
  12531. this.maxPower = 20;
  12532. this.natureMaxPower = 5;
  12533. this.videoPower = 2;
  12534. this.powerRecoverNum = 900;
  12535. this.curPlayerSkillType = 0;
  12536. this.isNewDay = false;
  12537. this.clickedBall = false;
  12538. this.placeBallCurLevel = 0;
  12539. this.placeBallStarNum = 0;
  12540. this.longHelpLine = false;
  12541. this.maxShareDiamondTimes = 3;
  12542. this.guideStep = 0;
  12543. this.guideStepForLianXi = 0;
  12544. this.temSelfLevel = 0;
  12545. this.extraMoveNum = 0;
  12546. this.curRankID = 0;
  12547. this.rankID = {
  12548. normalStar: 12000,
  12549. wxStar: 12001
  12550. };
  12551. this.skillNameList = ["Skyfall Shot", "Surging Break", "Frost Lock"];
  12552. this.skillIconList = ["gf_jn1", "gf_jn2", "gf_jn4"];
  12553. this.btnClickStr = "buttonclick";
  12554. this.maxSkillLevel = 10;
  12555. this.upSkillLevel = false;
  12556. this.gameStartTime = 0;
  12557. this._sysOffestNum = 0;
  12558. this.angleV2 = new Laya.Vector2();
  12559. this.rootV = new Laya.Vector2(0, 1);
  12560. this.tempDir1 = new Laya.Vector2();
  12561. this.tempDir2 = new Laya.Vector2();
  12562. this.ballSize = 33;
  12563. this.stPos = new Laya.Point();
  12564. this.edPos = new Laya.Point();
  12565. Common._instance = this;
  12566. window["common"] = this;
  12567. }
  12568. static getInstance() {
  12569. if (!this._instance) {
  12570. this._instance = new Common();
  12571. }
  12572. return this._instance;
  12573. }
  12574. get sysOffestNum() {
  12575. if (this._sysOffestNum == 0) {
  12576. this._sysOffestNum = (Laya.stage.width - 1334) / 2;
  12577. }
  12578. return this._sysOffestNum;
  12579. }
  12580. testShader() {
  12581. let test = new LightShader();
  12582. test.texture = "res/d3Res/ballTexture/ball1.png";
  12583. Laya.stage.addChild(test);
  12584. }
  12585. playScale(node) {
  12586. Laya.Tween.to(node, { scaleX: 1.1, scaleY: 1.1 }, 100, null, Laya.Handler.create(this, () => {
  12587. Laya.Tween.to(node, { scaleX: 1, scaleY: 1 }, 100, null, Laya.Handler.create(this, () => {
  12588. }));
  12589. }));
  12590. }
  12591. setGroup(colli, ...group) {
  12592. let out = 0;
  12593. for (let index = 0; index < group.length; index++) {
  12594. if (index == 0) {
  12595. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12596. }
  12597. else {
  12598. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12599. }
  12600. }
  12601. colli.collisionGroup = out;
  12602. }
  12603. setCanGroupWith(colli, ...group) {
  12604. let out = 0;
  12605. for (let index = 0; index < group.length; index++) {
  12606. if (index == 0) {
  12607. out = Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12608. }
  12609. else {
  12610. out = out | Laya.Physics3DUtils[`COLLISIONFILTERGROUP_CUSTOMFILTER${group[index]}`];
  12611. }
  12612. }
  12613. colli.canCollideWith = out;
  12614. }
  12615. loadPrefab(name, callback) {
  12616. Laya.loader.create(`prefab/${name}.json`, Laya.Handler.create(this, (obj) => {
  12617. let prefab = new Laya.Prefab();
  12618. prefab.json = obj;
  12619. let img = Laya.Pool.getItemByCreateFun(name, prefab.create, prefab);
  12620. callback && callback(img);
  12621. }));
  12622. }
  12623. pos2to3Convert(x, y, d3Pos) {
  12624. x = x + this.sysOffestNum;
  12625. d3Pos.setValue(x, y, 0);
  12626. let success = this.d3World.camera.convertScreenCoordToOrthographicCoord(d3Pos, d3Pos);
  12627. if (success) {
  12628. }
  12629. else {
  12630. console.error("转换出错了。。。。。。。。");
  12631. }
  12632. }
  12633. scale2to3Convert(num) {
  12634. this.scaleV3One.setValue(0, 0, 0);
  12635. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3One, this.scaleV3One);
  12636. this.scaleV3Two.setValue(0, num, 0);
  12637. this.d3World.camera.convertScreenCoordToOrthographicCoord(this.scaleV3Two, this.scaleV3Two);
  12638. let outNum = Math.abs(this.scaleV3One.x - this.scaleV3Two.x);
  12639. return outNum;
  12640. }
  12641. pos3to2Convert(d3Pos) {
  12642. this.d3World.camera.viewport.project(d3Pos, this.d3World.camera.projectionViewMatrix, this.posV4);
  12643. d3Pos.x = this.posV4.x / Laya.stage.clientScaleX;
  12644. d3Pos.y = this.posV4.y / Laya.stage.clientScaleY;
  12645. d3Pos.x -= this.sysOffestNum;
  12646. }
  12647. scale3to2Convert(num) {
  12648. let scale = this.scale2to3Convert(1);
  12649. let d2Out = num / scale;
  12650. return d2Out;
  12651. }
  12652. getCollider(type, restitution = 0.9, density = 10) {
  12653. let colli;
  12654. if (type == "box")
  12655. colli = new Laya.BoxCollider();
  12656. else
  12657. colli = new Laya.CircleCollider();
  12658. colli.friction = 0;
  12659. colli.restitution = restitution;
  12660. colli.density = density;
  12661. return colli;
  12662. }
  12663. getRigbody() {
  12664. let rigy = new Laya.RigidBody();
  12665. rigy.bullet = true;
  12666. rigy.allowRotation = false;
  12667. rigy.allowSleep = false;
  12668. rigy.gravityScale = 0;
  12669. return rigy;
  12670. }
  12671. getfguiRotation(x, y) {
  12672. this.angleV2.setValue(x, y);
  12673. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12674. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12675. if ((this.angleV2.x >= 0 && this.angleV2.y >= 0) || (this.angleV2.x >= 0 && this.angleV2.y < 0)) {
  12676. angle = -angle;
  12677. }
  12678. return 180 + angle;
  12679. }
  12680. getAngle(x, y) {
  12681. this.angleV2.setValue(x, y);
  12682. Laya.Vector2.normalize(this.angleV2, this.angleV2);
  12683. let angle = Math.acos(Laya.Vector2.dot(this.rootV, this.angleV2)) * 180 / Math.PI;
  12684. return angle;
  12685. }
  12686. randomNum(a, b) {
  12687. return a + Math.floor((b - a + 1) * Math.random());
  12688. }
  12689. getRandArrEle(arr) {
  12690. return arr[Math.floor(arr.length * Math.random())];
  12691. }
  12692. getSign(val) {
  12693. return val >= 0 ? 1 : -1;
  12694. }
  12695. botherArr(arr) {
  12696. let times = arr.length + 2;
  12697. let length = arr.length;
  12698. let a;
  12699. let b;
  12700. let temp;
  12701. for (let index = 0; index < times; index++) {
  12702. a = Math.floor(Math.random() * length);
  12703. b = Math.floor(Math.random() * length);
  12704. temp = arr[a];
  12705. arr[a] = arr[b];
  12706. arr[b] = temp;
  12707. }
  12708. }
  12709. getGameIconUrl(id) {
  12710. return "ui://game/" + id;
  12711. }
  12712. getComponentUrl(id) {
  12713. return "ui://game/" + id;
  12714. }
  12715. getAnimation() {
  12716. }
  12717. judgeSkillType(type = SkillType.highSpace) {
  12718. if (this.gameMode == GameMode.classic)
  12719. return;
  12720. let gameMgr = this.gameMgr;
  12721. if (gameMgr.selfTurn) {
  12722. if (gameMgr.selfCurSkill == type) {
  12723. return true;
  12724. }
  12725. }
  12726. else {
  12727. if (gameMgr.aiCurSkill == type) {
  12728. return true;
  12729. }
  12730. }
  12731. }
  12732. ballColliHole(collider) {
  12733. if (xGame.common.gameMgr.isFirstInGame && collider.owner["mySrc"].number != 0) {
  12734. xGame.common.gameMgr.isFirstInGame = false;
  12735. xGame.eventMgr.event(FIRST_BALL_HOLE, collider.owner["mySrc"].number);
  12736. }
  12737. collider.owner.mySrc.checkWrongBall();
  12738. }
  12739. getArrMaxEle(arr) {
  12740. let max = -Infinity;
  12741. for (let index = 0; index < arr.length; index++) {
  12742. max = Math.max(arr[index], max);
  12743. }
  12744. return max;
  12745. }
  12746. getArrMinEle(arr) {
  12747. let min = Infinity;
  12748. for (let index = 0; index < arr.length; index++) {
  12749. min = Math.min(arr[index], min);
  12750. }
  12751. return min;
  12752. }
  12753. playRandomMutiBallBigSkillSound() {
  12754. if (Math.random() <= 0.5)
  12755. return;
  12756. let rand = this.randomNum(1, 6);
  12757. let str = "ganfa0" + rand;
  12758. xGame.soundMgr.playSound(str);
  12759. }
  12760. showOneCamera(type) {
  12761. let object = xGame.common.d3World.cameraObj;
  12762. for (const key in object) {
  12763. if (Object.prototype.hasOwnProperty.call(object, key)) {
  12764. object[key].init();
  12765. object[key].owner.active = key == type;
  12766. }
  12767. }
  12768. }
  12769. checkBallOverBorder(x, y) {
  12770. let radius = 17;
  12771. let condition = this._checkBorder(x + radius, y) ||
  12772. this._checkBorder(x - radius, y) ||
  12773. this._checkBorder(x, y + radius) ||
  12774. this._checkBorder(x, y - radius);
  12775. if (condition) {
  12776. return true;
  12777. }
  12778. }
  12779. _checkBorder(x, y) {
  12780. let borderRect = this.d2World.borderRect;
  12781. let xOffest = 20;
  12782. let yOffest = 20;
  12783. if (y <= borderRect.y - yOffest) {
  12784. return true;
  12785. }
  12786. if (y >= borderRect.y + borderRect.height + yOffest) {
  12787. return true;
  12788. }
  12789. if (x <= borderRect.x - xOffest) {
  12790. return true;
  12791. }
  12792. if (x >= borderRect.x + borderRect.width + xOffest) {
  12793. return true;
  12794. }
  12795. }
  12796. initWeight(cfg) {
  12797. let allCfgData = { data: {}, allWeightNum: 0 };
  12798. let weightCfg = allCfgData.data;
  12799. let weight = 0;
  12800. for (const key in cfg) {
  12801. weightCfg[key] = {};
  12802. weightCfg[key].id = cfg[key].id;
  12803. weightCfg[key].minWeight = weight;
  12804. weight += cfg[key].weight;
  12805. weightCfg[key].maxWeight = weight;
  12806. }
  12807. allCfgData.allWeightNum = weight;
  12808. return allCfgData;
  12809. }
  12810. getRandomWeightData(cfg) {
  12811. let weightCfg = cfg.data;
  12812. let allWeightNum = cfg.allWeightNum;
  12813. let rand = Math.floor(Math.random() * allWeightNum);
  12814. for (const key in weightCfg) {
  12815. if (rand > weightCfg[key].minWeight && rand <= weightCfg[key].maxWeight) {
  12816. return weightCfg[key];
  12817. }
  12818. }
  12819. return weightCfg[1];
  12820. }
  12821. showGirlTalkPop(wordsIndex, node, msgNode) {
  12822. node.visible = true;
  12823. msgNode.text = cfgTable.secretaryData[wordsIndex].msg;
  12824. node.t0.play(Laya.Handler.create(this, () => {
  12825. node.visible = false;
  12826. }));
  12827. }
  12828. stopGirlPop(node) {
  12829. node.t0.stop();
  12830. node.visible = false;
  12831. }
  12832. createHead(loader, url, size = 107) {
  12833. if (Laya.Browser.name == "Browser") {
  12834. loader.url = url;
  12835. return;
  12836. }
  12837. else {
  12838. console.log('zh:url=', url);
  12839. loader.url = url;
  12840. }
  12841. }
  12842. addTestCoin(num) {
  12843. DataMgr.setCoin(num);
  12844. }
  12845. addTestDiamond(num) {
  12846. DataMgr.setDiamond(num);
  12847. }
  12848. addTestSkill() {
  12849. DataMgr.setBigSkill(0, 99);
  12850. DataMgr.setBigSkill(1, 99);
  12851. DataMgr.setBigSkill(2, 99);
  12852. }
  12853. playClassicEmotion(number, x, y) {
  12854. if (this.gameMode == GameMode.bigMove)
  12855. return;
  12856. let randIndex = this.randomNum(0, 2);
  12857. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12858. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12859. if (this.gameMgr.selfTurn) {
  12860. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12861. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12862. }
  12863. else {
  12864. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12865. }
  12866. else {
  12867. if (number == this.gameMgr.blackNum) {
  12868. if (this.gameMgr.selfBallArr.length == 0) {
  12869. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12870. }
  12871. else {
  12872. }
  12873. }
  12874. else {
  12875. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12876. }
  12877. }
  12878. }
  12879. }
  12880. else {
  12881. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12882. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12883. }
  12884. else {
  12885. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12886. }
  12887. else {
  12888. if (number == this.gameMgr.blackNum) {
  12889. if (this.gameMgr.aiBallArr.length == 0) {
  12890. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12891. }
  12892. else {
  12893. }
  12894. }
  12895. else {
  12896. this.classicEmotionSpine.play(data, randIndex, false, parent);
  12897. }
  12898. }
  12899. }
  12900. }
  12901. }
  12902. playHappySound(number) {
  12903. if (this.gameMode != GameMode.classic)
  12904. return;
  12905. if (number == 8)
  12906. return;
  12907. let play = false;
  12908. if (this.gameMgr.selfTurn) {
  12909. if (this.gameMgr.ensureBallType) {
  12910. if (this.gameMgr.selfBallArr.indexOf(number) > -1) {
  12911. play = true;
  12912. }
  12913. }
  12914. else {
  12915. play = true;
  12916. }
  12917. }
  12918. else {
  12919. if (this.gameMgr.ensureBallType) {
  12920. if (this.gameMgr.aiBallArr.indexOf(number) > -1) {
  12921. play = true;
  12922. }
  12923. }
  12924. else {
  12925. play = true;
  12926. }
  12927. }
  12928. if (play)
  12929. xGame.soundMgr.playSound("applause");
  12930. }
  12931. destroyClassicEmotion() {
  12932. if (this.gameMode == GameMode.bigMove)
  12933. return;
  12934. let parent = this.gameUI.ui.classicEmotionSpineNode.displayObject;
  12935. parent.destroyChildren();
  12936. }
  12937. playAwardSpine(x, y) {
  12938. let data = { x: x, y: y, scaleX: 1, scaleY: 1 };
  12939. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12940. this.awardSpine.play(data, 0, false, parent);
  12941. }
  12942. destroyAwardSpine() {
  12943. let parent = this.gameUI.ui.awardSpineNode.displayObject;
  12944. parent.destroyChildren();
  12945. }
  12946. isBlock(bx, by, hx, hy, except = null) {
  12947. this.tempDir1 = xGame.tools.getV2Dir(bx, by, hx, hy, this.tempDir1);
  12948. let balls = xGame.common.d2World.ballArr;
  12949. let outArr = [];
  12950. for (let index = 0; index < balls.length; index++) {
  12951. let obj = balls[index];
  12952. if (obj.number == 0)
  12953. continue;
  12954. if (obj == except)
  12955. continue;
  12956. let dis = xGame.tools.getDistance(obj.gameObj.x, obj.gameObj.y, bx, by);
  12957. this.tempDir2 = xGame.tools.getV2Dir(bx, by, obj.gameObj.x, obj.gameObj.y, this.tempDir2);
  12958. let num = Laya.Vector2.dot(this.tempDir1, this.tempDir2);
  12959. if (num >= 1)
  12960. num = 1;
  12961. if (num < 0)
  12962. continue;
  12963. let gap = Math.sin(Math.acos(num)) * dis;
  12964. if (gap < this.ballSize) {
  12965. outArr.push({
  12966. dis: xGame.tools.getDis(bx, by, obj.gameObj.x, obj.gameObj.y),
  12967. disHon: Math.cos(Math.acos(num)) * dis,
  12968. disVer: Math.sin(Math.acos(num)) * dis,
  12969. src: balls[index],
  12970. dir: this.tempDir1
  12971. });
  12972. }
  12973. }
  12974. if (outArr.length > 0) {
  12975. outArr.sort((a, b) => { return a.dis - b.dis; });
  12976. return outArr[0];
  12977. }
  12978. }
  12979. AngleBetween(vector1, vector2) {
  12980. let rad = Math.acos(Laya.Vector2.dot(vector1, vector2));
  12981. return rad * (180 / Math.PI);
  12982. }
  12983. getSecretaryScale() {
  12984. if (this.secretary.spineName == "mishu") {
  12985. return 1.28;
  12986. }
  12987. else {
  12988. return 1.024;
  12989. }
  12990. }
  12991. signAwardContainsRod(arr) {
  12992. let temp;
  12993. for (let index = 0; index < arr.length; index++) {
  12994. temp = arr[index].split('-')[0];
  12995. if (parseInt(temp) > 2) {
  12996. return true;
  12997. }
  12998. }
  12999. }
  13000. judgeSameDay() {
  13001. let lastTime = DataMgr.getSignTime();
  13002. let curTime = new Date().getTime();
  13003. if (new Date(lastTime).toDateString() === new Date(curTime).toDateString()) {
  13004. return true;
  13005. }
  13006. return false;
  13007. }
  13008. getAward(arr, callback) {
  13009. let showTriple = arr[0].type <= 2;
  13010. xGame.uiMgr.Show(UIGetAward, arr, showTriple, (watchVideo) => {
  13011. let temp;
  13012. for (let index = 0; index < arr.length; index++) {
  13013. temp = arr[index];
  13014. switch (temp.type) {
  13015. case 1:
  13016. this.playObjFlyAnim(temp.num, temp.type);
  13017. break;
  13018. case 2:
  13019. this.playObjFlyAnim(temp.num, temp.type);
  13020. break;
  13021. case 3:
  13022. case 4:
  13023. case 5:
  13024. case 6:
  13025. DataMgr.setBallRod(temp.type - 2, 1);
  13026. DataMgr.setCurBallRod(temp.type - 2);
  13027. break;
  13028. default:
  13029. break;
  13030. }
  13031. }
  13032. callback && callback(watchVideo);
  13033. });
  13034. }
  13035. getMoneyNode() {
  13036. let moneyNode;
  13037. let sign = xGame.uiMgr.getUI(UISign);
  13038. let draw = xGame.uiMgr.getUI(UIDraw);
  13039. let end = xGame.uiMgr.getUI(UIGameEnd);
  13040. let skill = xGame.uiMgr.getUI(UISkill);
  13041. if (sign && !sign.isHide)
  13042. moneyNode = sign.ui.moneyNode;
  13043. if (draw && !draw.isHide)
  13044. moneyNode = draw.ui.moneyNode;
  13045. if (end && !end.isHide)
  13046. moneyNode = end.ui.moneyNode;
  13047. if (skill && !skill.isHide)
  13048. moneyNode = skill.ui.moneyNode;
  13049. let condition1 = (!sign || sign.isHide) && (!draw || draw.isHide) && (!skill || skill.isHide);
  13050. let main = xGame.uiMgr.getUI(UIMain);
  13051. if (condition1 && main && !main.isHide) {
  13052. moneyNode = main.ui.moneyNode;
  13053. }
  13054. return moneyNode;
  13055. }
  13056. playObjFlyAnim(num, type, callback = null) {
  13057. this.stPos.x = Laya.stage.width / 2;
  13058. this.stPos.y = Laya.stage.height / 2;
  13059. let moneyNode = this.getMoneyNode();
  13060. switch (type) {
  13061. case Prop.diamond:
  13062. this.edPos.x = moneyNode.x + moneyNode.diamondImg.x;
  13063. this.edPos.y = moneyNode.y + moneyNode.diamondImg.y;
  13064. moneyNode.diamondImg.displayObject.localToGlobal(this.edPos);
  13065. this.edPos.x /= 2;
  13066. this.edPos.y /= 2;
  13067. break;
  13068. case Prop.coin:
  13069. this.edPos.x = moneyNode.x + moneyNode.coinImg.x;
  13070. this.edPos.y = moneyNode.y + moneyNode.coinImg.y;
  13071. moneyNode.coinImg.displayObject.localToGlobal(this.edPos);
  13072. this.edPos.x /= 2;
  13073. this.edPos.y /= 2;
  13074. break;
  13075. default:
  13076. break;
  13077. }
  13078. xGame.soundMgr.playSound("coinbag");
  13079. xGame.uiMgr.Show(UIFlyEft, this.stPos, this.edPos, num, type, () => {
  13080. switch (type) {
  13081. case Prop.diamond:
  13082. DataMgr.setDiamond(num);
  13083. break;
  13084. case Prop.coin:
  13085. DataMgr.setCoin(num);
  13086. break;
  13087. default:
  13088. break;
  13089. }
  13090. callback && callback();
  13091. });
  13092. }
  13093. autoPopUIView() {
  13094. let arr = [];
  13095. let sign = this.judgeSameDay() ? false : true;
  13096. if (sign)
  13097. arr.push("sign");
  13098. let draw = DataMgr.getDailyfreeDrawTimes() > 0;
  13099. if (draw)
  13100. arr.push("draw");
  13101. if (arr.length <= 0)
  13102. return;
  13103. let str = this.getRandArrEle(arr);
  13104. switch (str) {
  13105. case "sign":
  13106. xGame.uiMgr.Show(UISign);
  13107. break;
  13108. case "draw":
  13109. xGame.uiMgr.Show(UIDraw);
  13110. break;
  13111. default:
  13112. break;
  13113. }
  13114. }
  13115. getMSTime(time) {
  13116. let min = Math.floor(time / 60);
  13117. let sec = Math.floor((time - min * 60));
  13118. if (sec < 10)
  13119. sec = "0" + sec;
  13120. if (min < 10)
  13121. min = "0" + min;
  13122. return `${min}:${sec}`;
  13123. }
  13124. testPower() {
  13125. DataMgr.setPower(0, false);
  13126. }
  13127. getAllStarNum() {
  13128. let data = DataMgr.getPlaceBallLevelList();
  13129. let out = 0;
  13130. for (let index = 0; index < data.length; index++) {
  13131. out += data[index].star;
  13132. }
  13133. return out;
  13134. }
  13135. recoverCameraView() {
  13136. Laya.timer.once(900, this, () => {
  13137. xGame.common.showOneCamera("mainCamera");
  13138. if (xGame.common.gameUI.ui.d2Node.alpha == 0) {
  13139. xGame.common.gameUI.ui.d2Node.alpha = 1;
  13140. xGame.common.gameUI.ui.border.alpha = 0;
  13141. if (Laya.physicsTimer.scale < 1) {
  13142. Laya.physicsTimer.scale = 1;
  13143. }
  13144. }
  13145. });
  13146. }
  13147. getClassicLevel() {
  13148. let successTimes = DataMgr.getClassicTimes();
  13149. let needKey = "";
  13150. let lastKey = "";
  13151. let cfg = cfgTable.classictimesData;
  13152. let data;
  13153. for (const key in cfg) {
  13154. data = cfg[key];
  13155. if (successTimes <= data.times) {
  13156. needKey = key;
  13157. }
  13158. lastKey = key;
  13159. }
  13160. if (needKey == "")
  13161. needKey = lastKey;
  13162. return cfg[needKey];
  13163. }
  13164. }
  13165. Common._instance = null;
  13166. class ui_Component92 extends fgui.GComponent {
  13167. static createInstance() {
  13168. return (fgui.UIPackage.createObject("game", "Component92"));
  13169. }
  13170. onConstruct() {
  13171. this.n0 = (this.getChild("n0"));
  13172. }
  13173. }
  13174. ui_Component92.URL = "ui://isxx5ak710hfv49p";
  13175. class ui_Component129 extends fgui.GProgressBar {
  13176. static createInstance() {
  13177. return (fgui.UIPackage.createObject("game", "Component129"));
  13178. }
  13179. onConstruct() {
  13180. this.bar_v = (this.getChild("bar_v"));
  13181. this.n84 = (this.getChild("n84"));
  13182. }
  13183. }
  13184. ui_Component129.URL = "ui://isxx5ak7748uv4mp";
  13185. class ui_Component130 extends fgui.GComponent {
  13186. static createInstance() {
  13187. return (fgui.UIPackage.createObject("game", "Component130"));
  13188. }
  13189. onConstruct() {
  13190. this.ani = (this.getChild("ani"));
  13191. this.t0 = this.getTransition("t0");
  13192. }
  13193. }
  13194. ui_Component130.URL = "ui://isxx5ak7748uv4mq";
  13195. class ui_powerEft extends fgui.GComponent {
  13196. static createInstance() {
  13197. return (fgui.UIPackage.createObject("game", "powerEft"));
  13198. }
  13199. onConstruct() {
  13200. this.ani = (this.getChild("ani"));
  13201. this.n88 = (this.getChild("n88"));
  13202. this.n89 = (this.getChild("n89"));
  13203. }
  13204. }
  13205. ui_powerEft.URL = "ui://isxx5ak79u9xv4mr";
  13206. class ui_PutBallLevelDisplay extends fgui.GComponent {
  13207. static createInstance() {
  13208. return (fgui.UIPackage.createObject("game", "PutBallLevelDisplay"));
  13209. }
  13210. onConstruct() {
  13211. this.c1 = this.getController("c1");
  13212. this.n2 = (this.getChild("n2"));
  13213. this.n22 = (this.getChild("n22"));
  13214. this.n23 = (this.getChild("n23"));
  13215. this.n15 = (this.getChild("n15"));
  13216. this.challenge = (this.getChild("challenge"));
  13217. this.n17 = (this.getChild("n17"));
  13218. this.n3 = (this.getChild("n3"));
  13219. this.starNode = (this.getChild("starNode"));
  13220. this.levelTxt = (this.getChild("levelTxt"));
  13221. this.n14 = (this.getChild("n14"));
  13222. this.n19 = (this.getChild("n19"));
  13223. this.n20 = (this.getChild("n20"));
  13224. this.n21 = (this.getChild("n21"));
  13225. this.special = (this.getChild("special"));
  13226. }
  13227. }
  13228. ui_PutBallLevelDisplay.URL = "ui://isxx5ak7avag476";
  13229. class ui_Component79 extends fgui.GComponent {
  13230. static createInstance() {
  13231. return (fgui.UIPackage.createObject("game", "Component79"));
  13232. }
  13233. onConstruct() {
  13234. this.c1 = this.getController("c1");
  13235. this.n7 = (this.getChild("n7"));
  13236. this.n8 = (this.getChild("n8"));
  13237. this.n9 = (this.getChild("n9"));
  13238. this.n10 = (this.getChild("n10"));
  13239. this.n11 = (this.getChild("n11"));
  13240. this.n12 = (this.getChild("n12"));
  13241. }
  13242. }
  13243. ui_Component79.URL = "ui://isxx5ak7avag477";
  13244. class ui_Component80 extends fgui.GComponent {
  13245. static createInstance() {
  13246. return (fgui.UIPackage.createObject("game", "Component80"));
  13247. }
  13248. onConstruct() {
  13249. this.n0 = (this.getChild("n0"));
  13250. this.n1 = (this.getChild("n1"));
  13251. this.myList = (this.getChild("myList"));
  13252. this.guide2 = (this.getChild("guide2"));
  13253. this.yd = (this.getChild("yd"));
  13254. this.yd_zzq_btn = (this.getChild("yd_zzq_btn"));
  13255. this.n_yd = (this.getChild("n_yd"));
  13256. this.t0 = this.getTransition("t0");
  13257. }
  13258. }
  13259. ui_Component80.URL = "ui://isxx5ak7avag47b";
  13260. class ui_SignNormal extends fgui.GComponent {
  13261. static createInstance() {
  13262. return (fgui.UIPackage.createObject("game", "SignNormal"));
  13263. }
  13264. onConstruct() {
  13265. this.c1 = this.getController("c1");
  13266. this.n7 = (this.getChild("n7"));
  13267. this.n15 = (this.getChild("n15"));
  13268. this.titleTxt = (this.getChild("titleTxt"));
  13269. this.n8 = (this.getChild("n8"));
  13270. this.myIcon = (this.getChild("myIcon"));
  13271. this.numTxt = (this.getChild("numTxt"));
  13272. this.n12 = (this.getChild("n12"));
  13273. this.n13 = (this.getChild("n13"));
  13274. this.n17 = (this.getChild("n17"));
  13275. this.n14 = (this.getChild("n14"));
  13276. }
  13277. }
  13278. ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
  13279. class ui_Button_reg extends fgui.GButton {
  13280. static createInstance() {
  13281. return (fgui.UIPackage.createObject("game", "Button_reg"));
  13282. }
  13283. onConstruct() {
  13284. this.button = this.getController("button");
  13285. this.n6 = (this.getChild("n6"));
  13286. }
  13287. }
  13288. ui_Button_reg.URL = "ui://isxx5ak7bobav57y";
  13289. class ui_screenNode extends fgui.GComponent {
  13290. static createInstance() {
  13291. return (fgui.UIPackage.createObject("game", "screenNode"));
  13292. }
  13293. onConstruct() {
  13294. this.n9 = (this.getChild("n9"));
  13295. this.screenImg = (this.getChild("screenImg"));
  13296. }
  13297. }
  13298. ui_screenNode.URL = "ui://isxx5ak7brgy3ux";
  13299. class ui_GetAwrad_com1 extends fgui.GComponent {
  13300. static createInstance() {
  13301. return (fgui.UIPackage.createObject("game", "GetAwrad_com1"));
  13302. }
  13303. onConstruct() {
  13304. this.n38 = (this.getChild("n38"));
  13305. this.n39 = (this.getChild("n39"));
  13306. this.n40 = (this.getChild("n40"));
  13307. this.t0 = this.getTransition("t0");
  13308. this.t1 = this.getTransition("t1");
  13309. }
  13310. }
  13311. ui_GetAwrad_com1.URL = "ui://isxx5ak7brwtv4mh";
  13312. class ui_GetAwrad_com2 extends fgui.GComponent {
  13313. static createInstance() {
  13314. return (fgui.UIPackage.createObject("game", "GetAwrad_com2"));
  13315. }
  13316. onConstruct() {
  13317. this.n39 = (this.getChild("n39"));
  13318. this.n40 = (this.getChild("n40"));
  13319. this.t0 = this.getTransition("t0");
  13320. }
  13321. }
  13322. ui_GetAwrad_com2.URL = "ui://isxx5ak7brwtv4mj";
  13323. class ui_Component128 extends fgui.GComponent {
  13324. static createInstance() {
  13325. return (fgui.UIPackage.createObject("game", "Component128"));
  13326. }
  13327. onConstruct() {
  13328. this.n38 = (this.getChild("n38"));
  13329. this.n40 = (this.getChild("n40"));
  13330. }
  13331. }
  13332. ui_Component128.URL = "ui://isxx5ak7brwtv4mk";
  13333. class ui_Component100_1 extends fgui.GComponent {
  13334. static createInstance() {
  13335. return (fgui.UIPackage.createObject("game", "Component100_1"));
  13336. }
  13337. onConstruct() {
  13338. this.myNode = (this.getChild("myNode"));
  13339. this.t0 = this.getTransition("t0");
  13340. }
  13341. }
  13342. ui_Component100_1.URL = "ui://isxx5ak7brwtv4ml";
  13343. class ui_Component142 extends fgui.GComponent {
  13344. static createInstance() {
  13345. return (fgui.UIPackage.createObject("game", "Component142"));
  13346. }
  13347. onConstruct() {
  13348. this.n41 = (this.getChild("n41"));
  13349. this.n42 = (this.getChild("n42"));
  13350. }
  13351. }
  13352. ui_Component142.URL = "ui://isxx5ak7c50vv4y6";
  13353. class ui_main_guang extends fgui.GComponent {
  13354. static createInstance() {
  13355. return (fgui.UIPackage.createObject("game", "main_guang"));
  13356. }
  13357. onConstruct() {
  13358. this.n1 = (this.getChild("n1"));
  13359. this.n2 = (this.getChild("n2"));
  13360. this.n3 = (this.getChild("n3"));
  13361. this.n4 = (this.getChild("n4"));
  13362. this.n5 = (this.getChild("n5"));
  13363. this.n6 = (this.getChild("n6"));
  13364. this.n8 = (this.getChild("n8"));
  13365. this.t0 = this.getTransition("t0");
  13366. }
  13367. }
  13368. ui_main_guang.URL = "ui://isxx5ak7cj92v4o3";
  13369. class ui_try_com1 extends fgui.GComponent {
  13370. static createInstance() {
  13371. return (fgui.UIPackage.createObject("game", "try_com1"));
  13372. }
  13373. onConstruct() {
  13374. this.c1 = this.getController("c1");
  13375. this.n0 = (this.getChild("n0"));
  13376. this.n2 = (this.getChild("n2"));
  13377. this.cancelBtn = (this.getChild("cancelBtn"));
  13378. this.videoBtn = (this.getChild("videoBtn"));
  13379. this.n9 = (this.getChild("n9"));
  13380. this.n24 = (this.getChild("n24"));
  13381. this.titleTxt = (this.getChild("titleTxt"));
  13382. this.n32 = (this.getChild("n32"));
  13383. this.n29 = (this.getChild("n29"));
  13384. this.n36 = (this.getChild("n36"));
  13385. this.txtTime = (this.getChild("txtTime"));
  13386. this.t0 = this.getTransition("t0");
  13387. }
  13388. }
  13389. ui_try_com1.URL = "ui://isxx5ak7cj92v4o5";
  13390. class ui_try_com2 extends fgui.GComponent {
  13391. static createInstance() {
  13392. return (fgui.UIPackage.createObject("game", "try_com2"));
  13393. }
  13394. onConstruct() {
  13395. this.skillicon = (this.getChild("skillicon"));
  13396. this.n35 = (this.getChild("n35"));
  13397. this.n31 = (this.getChild("n31"));
  13398. this.n32 = (this.getChild("n32"));
  13399. this.n33 = (this.getChild("n33"));
  13400. this.n34 = (this.getChild("n34"));
  13401. }
  13402. }
  13403. ui_try_com2.URL = "ui://isxx5ak7cj92v4o6";
  13404. class ui_try_com3 extends fgui.GComponent {
  13405. static createInstance() {
  13406. return (fgui.UIPackage.createObject("game", "try_com3"));
  13407. }
  13408. onConstruct() {
  13409. this.n33 = (this.getChild("n33"));
  13410. this.n34 = (this.getChild("n34"));
  13411. this.n35 = (this.getChild("n35"));
  13412. this.t0 = this.getTransition("t0");
  13413. }
  13414. }
  13415. ui_try_com3.URL = "ui://isxx5ak7cj92v4o9";
  13416. class ui_huihe1 extends fgui.GComponent {
  13417. static createInstance() {
  13418. return (fgui.UIPackage.createObject("game", "huihe1"));
  13419. }
  13420. onConstruct() {
  13421. this.n0 = (this.getChild("n0"));
  13422. this.n1 = (this.getChild("n1"));
  13423. this.t0 = this.getTransition("t0");
  13424. }
  13425. }
  13426. ui_huihe1.URL = "ui://isxx5ak7d1pb47h";
  13427. class ui_huihe2 extends fgui.GComponent {
  13428. static createInstance() {
  13429. return (fgui.UIPackage.createObject("game", "huihe2"));
  13430. }
  13431. onConstruct() {
  13432. this.n0 = (this.getChild("n0"));
  13433. this.n1 = (this.getChild("n1"));
  13434. this.t0 = this.getTransition("t0");
  13435. }
  13436. }
  13437. ui_huihe2.URL = "ui://isxx5ak7d1pb47k";
  13438. class ui_Component143 extends fgui.GComponent {
  13439. static createInstance() {
  13440. return (fgui.UIPackage.createObject("game", "Component143"));
  13441. }
  13442. onConstruct() {
  13443. this.n3 = (this.getChild("n3"));
  13444. this.n4 = (this.getChild("n4"));
  13445. this.n5 = (this.getChild("n5"));
  13446. this.n6 = (this.getChild("n6"));
  13447. this.n7 = (this.getChild("n7"));
  13448. this.n8 = (this.getChild("n8"));
  13449. this.n9 = (this.getChild("n9"));
  13450. this.n10 = (this.getChild("n10"));
  13451. this.t0 = this.getTransition("t0");
  13452. }
  13453. }
  13454. ui_Component143.URL = "ui://isxx5ak7dt0av4yn";
  13455. class ui_Component1_debug_pay_ok extends fgui.GComponent {
  13456. static createInstance() {
  13457. return (fgui.UIPackage.createObject("game", "Component1_debug_pay_ok"));
  13458. }
  13459. onConstruct() {
  13460. this.n_moni_pay_ok = (this.getChild("n_moni_pay_ok"));
  13461. }
  13462. }
  13463. ui_Component1_debug_pay_ok.URL = "ui://isxx5ak7e1lxv59z";
  13464. class ui_dh_jingbi2 extends fgui.GComponent {
  13465. static createInstance() {
  13466. return (fgui.UIPackage.createObject("game", "dh_jingbi2"));
  13467. }
  13468. onConstruct() {
  13469. this.n0 = (this.getChild("n0"));
  13470. this.n1 = (this.getChild("n1"));
  13471. this.n2 = (this.getChild("n2"));
  13472. this.n3 = (this.getChild("n3"));
  13473. this.n4 = (this.getChild("n4"));
  13474. this.n5 = (this.getChild("n5"));
  13475. this.n6 = (this.getChild("n6"));
  13476. this.n8 = (this.getChild("n8"));
  13477. this.n10 = (this.getChild("n10"));
  13478. this.t0 = this.getTransition("t0");
  13479. }
  13480. }
  13481. ui_dh_jingbi2.URL = "ui://isxx5ak7ehtov4g0";
  13482. class ui_dh_jingbi2_1 extends fgui.GComponent {
  13483. static createInstance() {
  13484. return (fgui.UIPackage.createObject("game", "dh_jingbi2_1"));
  13485. }
  13486. onConstruct() {
  13487. this.n1 = (this.getChild("n1"));
  13488. this.n4 = (this.getChild("n4"));
  13489. this.t0 = this.getTransition("t0");
  13490. }
  13491. }
  13492. ui_dh_jingbi2_1.URL = "ui://isxx5ak7ehtov4g1";
  13493. class ui_dh_jingbi3 extends fgui.GComponent {
  13494. static createInstance() {
  13495. return (fgui.UIPackage.createObject("game", "dh_jingbi3"));
  13496. }
  13497. onConstruct() {
  13498. this.n0 = (this.getChild("n0"));
  13499. this.n1 = (this.getChild("n1"));
  13500. this.n2 = (this.getChild("n2"));
  13501. this.n3 = (this.getChild("n3"));
  13502. this.n4 = (this.getChild("n4"));
  13503. this.n5 = (this.getChild("n5"));
  13504. this.n6 = (this.getChild("n6"));
  13505. this.n8 = (this.getChild("n8"));
  13506. this.n10 = (this.getChild("n10"));
  13507. this.t0 = this.getTransition("t0");
  13508. }
  13509. }
  13510. ui_dh_jingbi3.URL = "ui://isxx5ak7ehtov4g2";
  13511. class ui_dh_jingbi3_1 extends fgui.GComponent {
  13512. static createInstance() {
  13513. return (fgui.UIPackage.createObject("game", "dh_jingbi3_1"));
  13514. }
  13515. onConstruct() {
  13516. this.n3 = (this.getChild("n3"));
  13517. this.n1 = (this.getChild("n1"));
  13518. this.t0 = this.getTransition("t0");
  13519. }
  13520. }
  13521. ui_dh_jingbi3_1.URL = "ui://isxx5ak7ehtov4g3";
  13522. class ui_hb_jinbi1 extends fgui.GButton {
  13523. static createInstance() {
  13524. return (fgui.UIPackage.createObject("game", "hb_jinbi1"));
  13525. }
  13526. onConstruct() {
  13527. this.n20 = (this.getChild("n20"));
  13528. this.n25 = (this.getChild("n25"));
  13529. this.coinTxt = (this.getChild("coinTxt"));
  13530. this.n28 = (this.getChild("n28"));
  13531. this.n32 = (this.getChild("n32"));
  13532. this.n38 = (this.getChild("n38"));
  13533. this.n45 = (this.getChild("n45"));
  13534. this.getTips = (this.getChild("getTips"));
  13535. this.n39 = (this.getChild("n39"));
  13536. this.diamondTxt = (this.getChild("diamondTxt"));
  13537. this.n41 = (this.getChild("n41"));
  13538. this.n42 = (this.getChild("n42"));
  13539. this.n46 = (this.getChild("n46"));
  13540. this.n47 = (this.getChild("n47"));
  13541. this.n48 = (this.getChild("n48"));
  13542. this.t0 = this.getTransition("t0");
  13543. }
  13544. }
  13545. ui_hb_jinbi1.URL = "ui://isxx5ak7ehtov4gd";
  13546. class ui_hb_jinbi2 extends fgui.GButton {
  13547. static createInstance() {
  13548. return (fgui.UIPackage.createObject("game", "hb_jinbi2"));
  13549. }
  13550. onConstruct() {
  13551. this.n20 = (this.getChild("n20"));
  13552. this.n25 = (this.getChild("n25"));
  13553. this.coinTxt = (this.getChild("coinTxt"));
  13554. this.n28 = (this.getChild("n28"));
  13555. this.n32 = (this.getChild("n32"));
  13556. this.n38 = (this.getChild("n38"));
  13557. this.n39 = (this.getChild("n39"));
  13558. this.diamondTxt = (this.getChild("diamondTxt"));
  13559. this.n41 = (this.getChild("n41"));
  13560. this.n42 = (this.getChild("n42"));
  13561. this.n43 = (this.getChild("n43"));
  13562. this.n44 = (this.getChild("n44"));
  13563. this.n45 = (this.getChild("n45"));
  13564. this.t0 = this.getTransition("t0");
  13565. }
  13566. }
  13567. ui_hb_jinbi2.URL = "ui://isxx5ak7ehtov4ge";
  13568. class ui_hb_jinbi3 extends fgui.GButton {
  13569. static createInstance() {
  13570. return (fgui.UIPackage.createObject("game", "hb_jinbi3"));
  13571. }
  13572. onConstruct() {
  13573. this.n20 = (this.getChild("n20"));
  13574. this.n25 = (this.getChild("n25"));
  13575. this.coinTxt = (this.getChild("coinTxt"));
  13576. this.n28 = (this.getChild("n28"));
  13577. this.n32 = (this.getChild("n32"));
  13578. this.n38 = (this.getChild("n38"));
  13579. this.n39 = (this.getChild("n39"));
  13580. this.diamondTxt = (this.getChild("diamondTxt"));
  13581. this.n41 = (this.getChild("n41"));
  13582. this.n42 = (this.getChild("n42"));
  13583. this.n43 = (this.getChild("n43"));
  13584. this.n44 = (this.getChild("n44"));
  13585. this.n45 = (this.getChild("n45"));
  13586. this.t0 = this.getTransition("t0");
  13587. }
  13588. }
  13589. ui_hb_jinbi3.URL = "ui://isxx5ak7ehtov4gf";
  13590. class ui_Component104 extends fgui.GComponent {
  13591. static createInstance() {
  13592. return (fgui.UIPackage.createObject("game", "Component104"));
  13593. }
  13594. onConstruct() {
  13595. this.c1 = this.getController("c1");
  13596. this.n12 = (this.getChild("n12"));
  13597. this.coinBtn = (this.getChild("coinBtn"));
  13598. this.diamondBtn = (this.getChild("diamondBtn"));
  13599. this.node3 = (this.getChild("node3"));
  13600. this.node4 = (this.getChild("node4"));
  13601. this.node5 = (this.getChild("node5"));
  13602. this.node1 = (this.getChild("node1"));
  13603. this.node2 = (this.getChild("node2"));
  13604. this.node6 = (this.getChild("node6"));
  13605. this.t0 = this.getTransition("t0");
  13606. }
  13607. }
  13608. ui_Component104.URL = "ui://isxx5ak7ehtov4gg";
  13609. class ui_Component105 extends fgui.GButton {
  13610. static createInstance() {
  13611. return (fgui.UIPackage.createObject("game", "Component105"));
  13612. }
  13613. onConstruct() {
  13614. this.c1 = this.getController("c1");
  13615. this.n49 = (this.getChild("n49"));
  13616. this.n18 = (this.getChild("n18"));
  13617. this.n46 = (this.getChild("n46"));
  13618. this.n48 = (this.getChild("n48"));
  13619. }
  13620. }
  13621. ui_Component105.URL = "ui://isxx5ak7ehtov4gh";
  13622. class ui_Component106 extends fgui.GButton {
  13623. static createInstance() {
  13624. return (fgui.UIPackage.createObject("game", "Component106"));
  13625. }
  13626. onConstruct() {
  13627. this.c1 = this.getController("c1");
  13628. this.n49 = (this.getChild("n49"));
  13629. this.n18 = (this.getChild("n18"));
  13630. this.n46 = (this.getChild("n46"));
  13631. this.n48 = (this.getChild("n48"));
  13632. }
  13633. }
  13634. ui_Component106.URL = "ui://isxx5ak7ehtov4gj";
  13635. class ui_hb_zs1 extends fgui.GButton {
  13636. static createInstance() {
  13637. return (fgui.UIPackage.createObject("game", "hb_zs1"));
  13638. }
  13639. onConstruct() {
  13640. this.c1 = this.getController("c1");
  13641. this.n20 = (this.getChild("n20"));
  13642. this.n21 = (this.getChild("n21"));
  13643. this.n26 = (this.getChild("n26"));
  13644. this.n27 = (this.getChild("n27"));
  13645. this.shareTxt = (this.getChild("shareTxt"));
  13646. this.n32 = (this.getChild("n32"));
  13647. this.n38 = (this.getChild("n38"));
  13648. this.n39 = (this.getChild("n39"));
  13649. this.n44 = (this.getChild("n44"));
  13650. this.diamondTxt = (this.getChild("diamondTxt"));
  13651. this.n41 = (this.getChild("n41"));
  13652. this.n45 = (this.getChild("n45"));
  13653. this.n47 = (this.getChild("n47"));
  13654. this.n48 = (this.getChild("n48"));
  13655. this.randTxt = (this.getChild("randTxt"));
  13656. this.n50 = (this.getChild("n50"));
  13657. this.t0 = this.getTransition("t0");
  13658. }
  13659. }
  13660. ui_hb_zs1.URL = "ui://isxx5ak7ehtov4gk";
  13661. class ui_dh_zs1 extends fgui.GComponent {
  13662. static createInstance() {
  13663. return (fgui.UIPackage.createObject("game", "dh_zs1"));
  13664. }
  13665. onConstruct() {
  13666. this.n10 = (this.getChild("n10"));
  13667. this.n9 = (this.getChild("n9"));
  13668. this.n1 = (this.getChild("n1"));
  13669. this.n2 = (this.getChild("n2"));
  13670. this.n3 = (this.getChild("n3"));
  13671. this.n4 = (this.getChild("n4"));
  13672. this.n5 = (this.getChild("n5"));
  13673. this.n6 = (this.getChild("n6"));
  13674. this.n8 = (this.getChild("n8"));
  13675. this.n11 = (this.getChild("n11"));
  13676. this.t0 = this.getTransition("t0");
  13677. }
  13678. }
  13679. ui_dh_zs1.URL = "ui://isxx5ak7ehtov4gm";
  13680. class ui_dh_zs1_1 extends fgui.GComponent {
  13681. static createInstance() {
  13682. return (fgui.UIPackage.createObject("game", "dh_zs1_1"));
  13683. }
  13684. onConstruct() {
  13685. this.n3 = (this.getChild("n3"));
  13686. this.n1 = (this.getChild("n1"));
  13687. this.t0 = this.getTransition("t0");
  13688. }
  13689. }
  13690. ui_dh_zs1_1.URL = "ui://isxx5ak7ehtov4gn";
  13691. class ui_hb_zs2 extends fgui.GButton {
  13692. static createInstance() {
  13693. return (fgui.UIPackage.createObject("game", "hb_zs2"));
  13694. }
  13695. onConstruct() {
  13696. this.n20 = (this.getChild("n20"));
  13697. this.n21 = (this.getChild("n21"));
  13698. this.n26 = (this.getChild("n26"));
  13699. this.n27 = (this.getChild("n27"));
  13700. this.n32 = (this.getChild("n32"));
  13701. this.n38 = (this.getChild("n38"));
  13702. this.n39 = (this.getChild("n39"));
  13703. this.n44 = (this.getChild("n44"));
  13704. this.diamondTxt = (this.getChild("diamondTxt"));
  13705. this.n41 = (this.getChild("n41"));
  13706. this.n45 = (this.getChild("n45"));
  13707. this.t0 = this.getTransition("t0");
  13708. }
  13709. }
  13710. ui_hb_zs2.URL = "ui://isxx5ak7ehtov4gu";
  13711. class ui_hb_zs3 extends fgui.GButton {
  13712. static createInstance() {
  13713. return (fgui.UIPackage.createObject("game", "hb_zs3"));
  13714. }
  13715. onConstruct() {
  13716. this.n20 = (this.getChild("n20"));
  13717. this.n21 = (this.getChild("n21"));
  13718. this.n26 = (this.getChild("n26"));
  13719. this.n27 = (this.getChild("n27"));
  13720. this.n32 = (this.getChild("n32"));
  13721. this.n38 = (this.getChild("n38"));
  13722. this.n47 = (this.getChild("n47"));
  13723. this.t0 = this.getTransition("t0");
  13724. }
  13725. }
  13726. ui_hb_zs3.URL = "ui://isxx5ak7ehtov4gv";
  13727. class ui_dh_zs2 extends fgui.GComponent {
  13728. static createInstance() {
  13729. return (fgui.UIPackage.createObject("game", "dh_zs2"));
  13730. }
  13731. onConstruct() {
  13732. this.n10 = (this.getChild("n10"));
  13733. this.n9 = (this.getChild("n9"));
  13734. this.n1 = (this.getChild("n1"));
  13735. this.n2 = (this.getChild("n2"));
  13736. this.n3 = (this.getChild("n3"));
  13737. this.n4 = (this.getChild("n4"));
  13738. this.n5 = (this.getChild("n5"));
  13739. this.n6 = (this.getChild("n6"));
  13740. this.n8 = (this.getChild("n8"));
  13741. this.n11 = (this.getChild("n11"));
  13742. this.t0 = this.getTransition("t0");
  13743. }
  13744. }
  13745. ui_dh_zs2.URL = "ui://isxx5ak7ehtov4gw";
  13746. class ui_dh_zs2_1 extends fgui.GComponent {
  13747. static createInstance() {
  13748. return (fgui.UIPackage.createObject("game", "dh_zs2_1"));
  13749. }
  13750. onConstruct() {
  13751. this.n3 = (this.getChild("n3"));
  13752. this.n1 = (this.getChild("n1"));
  13753. this.t0 = this.getTransition("t0");
  13754. }
  13755. }
  13756. ui_dh_zs2_1.URL = "ui://isxx5ak7ehtov4gx";
  13757. class ui_dh_zs3 extends fgui.GComponent {
  13758. static createInstance() {
  13759. return (fgui.UIPackage.createObject("game", "dh_zs3"));
  13760. }
  13761. onConstruct() {
  13762. this.n10 = (this.getChild("n10"));
  13763. this.n9 = (this.getChild("n9"));
  13764. this.n1 = (this.getChild("n1"));
  13765. this.n2 = (this.getChild("n2"));
  13766. this.n3 = (this.getChild("n3"));
  13767. this.n4 = (this.getChild("n4"));
  13768. this.n5 = (this.getChild("n5"));
  13769. this.n6 = (this.getChild("n6"));
  13770. this.n8 = (this.getChild("n8"));
  13771. this.n11 = (this.getChild("n11"));
  13772. this.t0 = this.getTransition("t0");
  13773. }
  13774. }
  13775. ui_dh_zs3.URL = "ui://isxx5ak7ehtov4gy";
  13776. class ui_dh_zs3_1 extends fgui.GComponent {
  13777. static createInstance() {
  13778. return (fgui.UIPackage.createObject("game", "dh_zs3_1"));
  13779. }
  13780. onConstruct() {
  13781. this.n3 = (this.getChild("n3"));
  13782. this.n1 = (this.getChild("n1"));
  13783. this.t0 = this.getTransition("t0");
  13784. }
  13785. }
  13786. ui_dh_zs3_1.URL = "ui://isxx5ak7ehtov4gz";
  13787. class ui_Component107 extends fgui.GComponent {
  13788. static createInstance() {
  13789. return (fgui.UIPackage.createObject("game", "Component107"));
  13790. }
  13791. onConstruct() {
  13792. this.n18 = (this.getChild("n18"));
  13793. this.n19 = (this.getChild("n19"));
  13794. this.n20 = (this.getChild("n20"));
  13795. this.n21 = (this.getChild("n21"));
  13796. this.n22 = (this.getChild("n22"));
  13797. this.levelTxt = (this.getChild("levelTxt"));
  13798. this.t0 = this.getTransition("t0");
  13799. }
  13800. }
  13801. ui_Component107.URL = "ui://isxx5ak7ehtov4h0";
  13802. class ui_box_com1 extends fgui.GComponent {
  13803. static createInstance() {
  13804. return (fgui.UIPackage.createObject("game", "box_com1"));
  13805. }
  13806. onConstruct() {
  13807. this.n14 = (this.getChild("n14"));
  13808. this.n6 = (this.getChild("n6"));
  13809. this.t0 = this.getTransition("t0");
  13810. }
  13811. }
  13812. ui_box_com1.URL = "ui://isxx5ak7erstv4nl";
  13813. class ui_box_com2 extends fgui.GProgressBar {
  13814. static createInstance() {
  13815. return (fgui.UIPackage.createObject("game", "box_com2"));
  13816. }
  13817. onConstruct() {
  13818. this.bg0 = (this.getChild("bg0"));
  13819. this.bg = (this.getChild("bg"));
  13820. this.bar = (this.getChild("bar"));
  13821. this.n7 = (this.getChild("n7"));
  13822. this.n8 = (this.getChild("n8"));
  13823. this.n10 = (this.getChild("n10"));
  13824. this.n11 = (this.getChild("n11"));
  13825. this.n12 = (this.getChild("n12"));
  13826. }
  13827. }
  13828. ui_box_com2.URL = "ui://isxx5ak7erstv4nt";
  13829. class ui_box_com4 extends fgui.GComponent {
  13830. static createInstance() {
  13831. return (fgui.UIPackage.createObject("game", "box_com4"));
  13832. }
  13833. onConstruct() {
  13834. this.n8 = (this.getChild("n8"));
  13835. this.t0 = this.getTransition("t0");
  13836. }
  13837. }
  13838. ui_box_com4.URL = "ui://isxx5ak7erstv4nx";
  13839. class ui_box_com3 extends fgui.GComponent {
  13840. static createInstance() {
  13841. return (fgui.UIPackage.createObject("game", "box_com3"));
  13842. }
  13843. onConstruct() {
  13844. this.n2 = (this.getChild("n2"));
  13845. this.n3 = (this.getChild("n3"));
  13846. this.n4 = (this.getChild("n4"));
  13847. this.n5 = (this.getChild("n5"));
  13848. this.t0 = this.getTransition("t0");
  13849. this.t1 = this.getTransition("t1");
  13850. }
  13851. }
  13852. ui_box_com3.URL = "ui://isxx5ak7erstv4ny";
  13853. class ui_Component97 extends fgui.GComponent {
  13854. static createInstance() {
  13855. return (fgui.UIPackage.createObject("game", "Component97"));
  13856. }
  13857. onConstruct() {
  13858. this.c1 = this.getController("c1");
  13859. this.n46 = (this.getChild("n46"));
  13860. this.diamondNode = (this.getChild("diamondNode"));
  13861. this.coinNode = (this.getChild("coinNode"));
  13862. this.t0 = this.getTransition("t0");
  13863. }
  13864. }
  13865. ui_Component97.URL = "ui://isxx5ak7g1giv4eb";
  13866. class ui_Component98 extends fgui.GButton {
  13867. static createInstance() {
  13868. return (fgui.UIPackage.createObject("game", "Component98"));
  13869. }
  13870. onConstruct() {
  13871. this.n8 = (this.getChild("n8"));
  13872. this.n40 = (this.getChild("n40"));
  13873. }
  13874. }
  13875. ui_Component98.URL = "ui://isxx5ak7g1giv4ed";
  13876. class ui_Component28_11 extends fgui.GButton {
  13877. static createInstance() {
  13878. return (fgui.UIPackage.createObject("game", "Component28_11"));
  13879. }
  13880. onConstruct() {
  13881. this.c1 = this.getController("c1");
  13882. this.n12 = (this.getChild("n12"));
  13883. this.n17 = (this.getChild("n17"));
  13884. this.n13 = (this.getChild("n13"));
  13885. this.diamondTxt = (this.getChild("diamondTxt"));
  13886. this.n15 = (this.getChild("n15"));
  13887. this.n16 = (this.getChild("n16"));
  13888. }
  13889. }
  13890. ui_Component28_11.URL = "ui://isxx5ak7g1giv4eh";
  13891. class ui_Component58_11 extends fgui.GComponent {
  13892. static createInstance() {
  13893. return (fgui.UIPackage.createObject("game", "Component58_11"));
  13894. }
  13895. onConstruct() {
  13896. this.c1 = this.getController("c1");
  13897. this.n23 = (this.getChild("n23"));
  13898. this.n41 = (this.getChild("n41"));
  13899. this.n_qiuGan = (this.getChild("n_qiuGan"));
  13900. this.n_daoju = (this.getChild("n_daoju"));
  13901. this.myList = (this.getChild("myList"));
  13902. this.djList = (this.getChild("djList"));
  13903. this.t0 = this.getTransition("t0");
  13904. }
  13905. }
  13906. ui_Component58_11.URL = "ui://isxx5ak7g1giv4el";
  13907. class ui_Component100 extends fgui.GComponent {
  13908. static createInstance() {
  13909. return (fgui.UIPackage.createObject("game", "Component100"));
  13910. }
  13911. onConstruct() {
  13912. this.c1 = this.getController("c1");
  13913. this.n75 = (this.getChild("n75"));
  13914. this.n76 = (this.getChild("n76"));
  13915. this.n80 = (this.getChild("n80"));
  13916. this.txt = (this.getChild("txt"));
  13917. this.spineRoot = (this.getChild("spineRoot"));
  13918. }
  13919. }
  13920. ui_Component100.URL = "ui://isxx5ak7g1giv4ex";
  13921. class ui_Component101 extends fgui.GComponent {
  13922. static createInstance() {
  13923. return (fgui.UIPackage.createObject("game", "Component101"));
  13924. }
  13925. onConstruct() {
  13926. this.c1 = this.getController("c1");
  13927. this.n36 = (this.getChild("n36"));
  13928. this.n35 = (this.getChild("n35"));
  13929. this.n33 = (this.getChild("n33"));
  13930. this.n34 = (this.getChild("n34"));
  13931. }
  13932. }
  13933. ui_Component101.URL = "ui://isxx5ak7g1giv4ey";
  13934. class ui_Component53 extends fgui.GComponent {
  13935. static createInstance() {
  13936. return (fgui.UIPackage.createObject("game", "Component53"));
  13937. }
  13938. onConstruct() {
  13939. this.n0 = (this.getChild("n0"));
  13940. this.n1 = (this.getChild("n1"));
  13941. this.n2 = (this.getChild("n2"));
  13942. this.n3 = (this.getChild("n3"));
  13943. this.n4 = (this.getChild("n4"));
  13944. this.n5 = (this.getChild("n5"));
  13945. this.n6 = (this.getChild("n6"));
  13946. this.n7 = (this.getChild("n7"));
  13947. this.n8 = (this.getChild("n8"));
  13948. this.n9 = (this.getChild("n9"));
  13949. this.n10 = (this.getChild("n10"));
  13950. this.n11 = (this.getChild("n11"));
  13951. this.n12 = (this.getChild("n12"));
  13952. this.n13 = (this.getChild("n13"));
  13953. this.n14 = (this.getChild("n14"));
  13954. this.n15 = (this.getChild("n15"));
  13955. this.n16 = (this.getChild("n16"));
  13956. this.n19 = (this.getChild("n19"));
  13957. this.n20 = (this.getChild("n20"));
  13958. this.n21 = (this.getChild("n21"));
  13959. this.n22 = (this.getChild("n22"));
  13960. this.n23 = (this.getChild("n23"));
  13961. this.n24 = (this.getChild("n24"));
  13962. this.n25 = (this.getChild("n25"));
  13963. this.n26 = (this.getChild("n26"));
  13964. this.n27 = (this.getChild("n27"));
  13965. this.n28 = (this.getChild("n28"));
  13966. this.n29 = (this.getChild("n29"));
  13967. this.n30 = (this.getChild("n30"));
  13968. this.n31 = (this.getChild("n31"));
  13969. this.n32 = (this.getChild("n32"));
  13970. this.n33 = (this.getChild("n33"));
  13971. this.n34 = (this.getChild("n34"));
  13972. this.n35 = (this.getChild("n35"));
  13973. this.t0 = this.getTransition("t0");
  13974. }
  13975. }
  13976. ui_Component53.URL = "ui://isxx5ak7g1ie43u";
  13977. class ui_Component58 extends fgui.GComponent {
  13978. static createInstance() {
  13979. return (fgui.UIPackage.createObject("game", "Component58"));
  13980. }
  13981. onConstruct() {
  13982. this.n23 = (this.getChild("n23"));
  13983. this.n41 = (this.getChild("n41"));
  13984. this.n8 = (this.getChild("n8"));
  13985. this.skillList = (this.getChild("skillList"));
  13986. this.t0 = this.getTransition("t0");
  13987. }
  13988. }
  13989. ui_Component58.URL = "ui://isxx5ak7gg0z445";
  13990. class ui_Component59 extends fgui.GComponent {
  13991. static createInstance() {
  13992. return (fgui.UIPackage.createObject("game", "Component59"));
  13993. }
  13994. onConstruct() {
  13995. this.n3 = (this.getChild("n3"));
  13996. this.msgTxt = (this.getChild("msgTxt"));
  13997. this.t0 = this.getTransition("t0");
  13998. }
  13999. }
  14000. ui_Component59.URL = "ui://isxx5ak7gg0z446";
  14001. class ui_Component_lc2 extends fgui.GComponent {
  14002. static createInstance() {
  14003. return (fgui.UIPackage.createObject("game", "Component_lc2"));
  14004. }
  14005. onConstruct() {
  14006. this.n0 = (this.getChild("n0"));
  14007. this.n1_bai = (this.getChild("n1_bai"));
  14008. }
  14009. }
  14010. ui_Component_lc2.URL = "ui://isxx5ak7ggd1v5ay";
  14011. class ui_Component_shou2 extends fgui.GComponent {
  14012. static createInstance() {
  14013. return (fgui.UIPackage.createObject("game", "Component_shou2"));
  14014. }
  14015. onConstruct() {
  14016. this.n57 = (this.getChild("n57"));
  14017. this.n54 = (this.getChild("n54"));
  14018. this.n55 = (this.getChild("n55"));
  14019. this.n56 = (this.getChild("n56"));
  14020. this.t1 = this.getTransition("t1");
  14021. }
  14022. }
  14023. ui_Component_shou2.URL = "ui://isxx5ak7ggd1v5b0";
  14024. class ui_RulerNode extends fgui.GComponent {
  14025. static createInstance() {
  14026. return (fgui.UIPackage.createObject("game", "RulerNode"));
  14027. }
  14028. onConstruct() {
  14029. this.n6 = (this.getChild("n6"));
  14030. this.n4 = (this.getChild("n4"));
  14031. this.img1 = (this.getChild("img1"));
  14032. this.img2 = (this.getChild("img2"));
  14033. }
  14034. }
  14035. ui_RulerNode.URL = "ui://isxx5ak7ghnw3x8";
  14036. class ui_Component108 extends fgui.GComponent {
  14037. static createInstance() {
  14038. return (fgui.UIPackage.createObject("game", "Component108"));
  14039. }
  14040. onConstruct() {
  14041. this.n19 = (this.getChild("n19"));
  14042. this.t0 = this.getTransition("t0");
  14043. }
  14044. }
  14045. ui_Component108.URL = "ui://isxx5ak7gpvxv4ha";
  14046. class ui_Component63 extends fgui.GComponent {
  14047. static createInstance() {
  14048. return (fgui.UIPackage.createObject("game", "Component63"));
  14049. }
  14050. onConstruct() {
  14051. this.n66 = (this.getChild("n66"));
  14052. this.n56 = (this.getChild("n56"));
  14053. this.n63 = (this.getChild("n63"));
  14054. this.n65 = (this.getChild("n65"));
  14055. this.t0 = this.getTransition("t0");
  14056. }
  14057. }
  14058. ui_Component63.URL = "ui://isxx5ak7h657452";
  14059. class ui_topNode extends fgui.GComponent {
  14060. static createInstance() {
  14061. return (fgui.UIPackage.createObject("game", "topNode"));
  14062. }
  14063. onConstruct() {
  14064. this.selfProgress = (this.getChild("selfProgress"));
  14065. this.aiProgress = (this.getChild("aiProgress"));
  14066. this.selfKuang = (this.getChild("selfKuang"));
  14067. this.aiKuang = (this.getChild("aiKuang"));
  14068. this.selfHeadLoader = (this.getChild("selfHeadLoader"));
  14069. this.aiHeadLoader = (this.getChild("aiHeadLoader"));
  14070. this.n33 = (this.getChild("n33"));
  14071. this.n34 = (this.getChild("n34"));
  14072. this.selfNameTxt = (this.getChild("selfNameTxt"));
  14073. this.aiNameTxt = (this.getChild("aiNameTxt"));
  14074. this.selfBallList = (this.getChild("selfBallList"));
  14075. this.aiBallList = (this.getChild("aiBallList"));
  14076. this.middleNode = (this.getChild("middleNode"));
  14077. this.selfScoreTxt = (this.getChild("selfScoreTxt"));
  14078. this.aiScoreTxt = (this.getChild("aiScoreTxt"));
  14079. this.scoreNode = (this.getChild("scoreNode"));
  14080. this.selfTips = (this.getChild("selfTips"));
  14081. this.aiTips = (this.getChild("aiTips"));
  14082. }
  14083. }
  14084. ui_topNode.URL = "ui://isxx5ak7hkrz3qu";
  14085. class ui_selfProgress extends fgui.GProgressBar {
  14086. static createInstance() {
  14087. return (fgui.UIPackage.createObject("game", "selfProgress"));
  14088. }
  14089. onConstruct() {
  14090. this.n3 = (this.getChild("n3"));
  14091. this.bar = (this.getChild("bar"));
  14092. }
  14093. }
  14094. ui_selfProgress.URL = "ui://isxx5ak7hkrz3sf";
  14095. class ui_aiProgress extends fgui.GProgressBar {
  14096. static createInstance() {
  14097. return (fgui.UIPackage.createObject("game", "aiProgress"));
  14098. }
  14099. onConstruct() {
  14100. this.n3 = (this.getChild("n3"));
  14101. this.bar = (this.getChild("bar"));
  14102. }
  14103. }
  14104. ui_aiProgress.URL = "ui://isxx5ak7hkrz3sh";
  14105. class ui_ballDisplay extends fgui.GComponent {
  14106. static createInstance() {
  14107. return (fgui.UIPackage.createObject("game", "ballDisplay"));
  14108. }
  14109. onConstruct() {
  14110. this.myImg = (this.getChild("myImg"));
  14111. }
  14112. }
  14113. ui_ballDisplay.URL = "ui://isxx5ak7hkrz3sk";
  14114. class ui_moveNode extends fgui.GComponent {
  14115. static createInstance() {
  14116. return (fgui.UIPackage.createObject("game", "moveNode"));
  14117. }
  14118. onConstruct() {
  14119. this.n8 = (this.getChild("n8"));
  14120. this.finger = (this.getChild("finger"));
  14121. }
  14122. }
  14123. ui_moveNode.URL = "ui://isxx5ak7hkrz3t9";
  14124. class ui_cancelBtn extends fgui.GButton {
  14125. static createInstance() {
  14126. return (fgui.UIPackage.createObject("game", "cancelBtn"));
  14127. }
  14128. onConstruct() {
  14129. this.c1 = this.getController("c1");
  14130. this.n0 = (this.getChild("n0"));
  14131. this.n1 = (this.getChild("n1"));
  14132. }
  14133. }
  14134. ui_cancelBtn.URL = "ui://isxx5ak7hkrz3tm";
  14135. class ui_shareBtn extends fgui.GButton {
  14136. static createInstance() {
  14137. return (fgui.UIPackage.createObject("game", "shareBtn"));
  14138. }
  14139. onConstruct() {
  14140. this.c1 = this.getController("c1");
  14141. this.n2 = (this.getChild("n2"));
  14142. this.n1 = (this.getChild("n1"));
  14143. this.n3 = (this.getChild("n3"));
  14144. this.n4 = (this.getChild("n4"));
  14145. this.n5 = (this.getChild("n5"));
  14146. this.n6 = (this.getChild("n6"));
  14147. }
  14148. }
  14149. ui_shareBtn.URL = "ui://isxx5ak7hkrz3tn";
  14150. class ui_share2Btn extends fgui.GButton {
  14151. static createInstance() {
  14152. return (fgui.UIPackage.createObject("game", "share2Btn"));
  14153. }
  14154. onConstruct() {
  14155. this.n3 = (this.getChild("n3"));
  14156. }
  14157. }
  14158. ui_share2Btn.URL = "ui://isxx5ak7hkrz3tr";
  14159. class ui_rodMethodNode extends fgui.GComponent {
  14160. static createInstance() {
  14161. return (fgui.UIPackage.createObject("game", "rodMethodNode"));
  14162. }
  14163. onConstruct() {
  14164. this.bg = (this.getChild("bg"));
  14165. this.dot = (this.getChild("dot"));
  14166. }
  14167. }
  14168. ui_rodMethodNode.URL = "ui://isxx5ak7hkrz3u1";
  14169. class ui_sureBtn extends fgui.GButton {
  14170. static createInstance() {
  14171. return (fgui.UIPackage.createObject("game", "sureBtn"));
  14172. }
  14173. onConstruct() {
  14174. this.n2 = (this.getChild("n2"));
  14175. this.n1 = (this.getChild("n1"));
  14176. }
  14177. }
  14178. ui_sureBtn.URL = "ui://isxx5ak7hkrz3u2";
  14179. class ui_Component18 extends fgui.GComponent {
  14180. static createInstance() {
  14181. return (fgui.UIPackage.createObject("game", "Component18"));
  14182. }
  14183. onConstruct() {
  14184. this.c1 = this.getController("c1");
  14185. this.nameTxt = (this.getChild("nameTxt"));
  14186. this.headImg = (this.getChild("headImg"));
  14187. this.n24 = (this.getChild("n24"));
  14188. this.skillImg = (this.getChild("skillImg"));
  14189. this.skillTxt = (this.getChild("skillTxt"));
  14190. }
  14191. }
  14192. ui_Component18.URL = "ui://isxx5ak7hxtr3yv";
  14193. class ui_Component45 extends fgui.GComponent {
  14194. static createInstance() {
  14195. return (fgui.UIPackage.createObject("game", "Component45"));
  14196. }
  14197. onConstruct() {
  14198. this.c1 = this.getController("c1");
  14199. this.n40 = (this.getChild("n40"));
  14200. this.n41 = (this.getChild("n41"));
  14201. this.targetScoreTxt = (this.getChild("targetScoreTxt"));
  14202. this.n42 = (this.getChild("n42"));
  14203. this.awardTxt = (this.getChild("awardTxt"));
  14204. this.n44 = (this.getChild("n44"));
  14205. this.t0 = this.getTransition("t0");
  14206. }
  14207. }
  14208. ui_Component45.URL = "ui://isxx5ak7i4k2438";
  14209. class ui_emotionDisplay extends fgui.GButton {
  14210. static createInstance() {
  14211. return (fgui.UIPackage.createObject("game", "emotionDisplay"));
  14212. }
  14213. onConstruct() {
  14214. this.myIcon = (this.getChild("myIcon"));
  14215. }
  14216. }
  14217. ui_emotionDisplay.URL = "ui://isxx5ak7i4k243h";
  14218. class ui_Component49 extends fgui.GButton {
  14219. static createInstance() {
  14220. return (fgui.UIPackage.createObject("game", "Component49"));
  14221. }
  14222. onConstruct() {
  14223. this.n69 = (this.getChild("n69"));
  14224. this.n56 = (this.getChild("n56"));
  14225. }
  14226. }
  14227. ui_Component49.URL = "ui://isxx5ak7i4k243n";
  14228. class ui_Component50 extends fgui.GButton {
  14229. static createInstance() {
  14230. return (fgui.UIPackage.createObject("game", "Component50"));
  14231. }
  14232. onConstruct() {
  14233. this.n54 = (this.getChild("n54"));
  14234. this.n65 = (this.getChild("n65"));
  14235. }
  14236. }
  14237. ui_Component50.URL = "ui://isxx5ak7i4k243o";
  14238. class ui_Component51 extends fgui.GButton {
  14239. static createInstance() {
  14240. return (fgui.UIPackage.createObject("game", "Component51"));
  14241. }
  14242. onConstruct() {
  14243. this.c1 = this.getController("c1");
  14244. this.n51 = (this.getChild("n51"));
  14245. this.n54 = (this.getChild("n54"));
  14246. }
  14247. }
  14248. ui_Component51.URL = "ui://isxx5ak7i4k243p";
  14249. class ui_Button5 extends fgui.GButton {
  14250. static createInstance() {
  14251. return (fgui.UIPackage.createObject("game", "Button5"));
  14252. }
  14253. onConstruct() {
  14254. this.c1 = this.getController("c1");
  14255. this.n0 = (this.getChild("n0"));
  14256. this.n2 = (this.getChild("n2"));
  14257. }
  14258. }
  14259. ui_Button5.URL = "ui://isxx5ak7i7rdv4jg";
  14260. class ui_Component124 extends fgui.GComponent {
  14261. static createInstance() {
  14262. return (fgui.UIPackage.createObject("game", "Component124"));
  14263. }
  14264. onConstruct() {
  14265. this.n22 = (this.getChild("n22"));
  14266. this.shareNode = (this.getChild("shareNode"));
  14267. }
  14268. }
  14269. ui_Component124.URL = "ui://isxx5ak7i7rdv4jh";
  14270. class ui_Component125 extends fgui.GComponent {
  14271. static createInstance() {
  14272. return (fgui.UIPackage.createObject("game", "Component125"));
  14273. }
  14274. onConstruct() {
  14275. this.n29 = (this.getChild("n29"));
  14276. this.coinTxt = (this.getChild("coinTxt"));
  14277. }
  14278. }
  14279. ui_Component125.URL = "ui://isxx5ak7i7rdv4ji";
  14280. class ui_Component52 extends fgui.GButton {
  14281. static createInstance() {
  14282. return (fgui.UIPackage.createObject("game", "Component52"));
  14283. }
  14284. onConstruct() {
  14285. this.n35 = (this.getChild("n35"));
  14286. this.n36 = (this.getChild("n36"));
  14287. }
  14288. }
  14289. ui_Component52.URL = "ui://isxx5ak7ihpy43t";
  14290. class ui_Component_denglu extends fgui.GComponent {
  14291. static createInstance() {
  14292. return (fgui.UIPackage.createObject("game", "Component_denglu"));
  14293. }
  14294. onConstruct() {
  14295. this.c1 = this.getController("c1");
  14296. this.n102 = (this.getChild("n102"));
  14297. this.n103 = (this.getChild("n103"));
  14298. }
  14299. }
  14300. ui_Component_denglu.URL = "ui://isxx5ak7ijwrv5a0";
  14301. class ui_UIFuli1 extends fgui.GComponent {
  14302. static createInstance() {
  14303. return (fgui.UIPackage.createObject("game", "UIFuli1"));
  14304. }
  14305. onConstruct() {
  14306. this.n1 = (this.getChild("n1"));
  14307. this.n2 = (this.getChild("n2"));
  14308. }
  14309. }
  14310. ui_UIFuli1.URL = "ui://isxx5ak7im8nv59g";
  14311. class ui_Component_fl_1 extends fgui.GComponent {
  14312. static createInstance() {
  14313. return (fgui.UIPackage.createObject("game", "Component_fl_1"));
  14314. }
  14315. onConstruct() {
  14316. this.n_zzq_fl1 = (this.getChild("n_zzq_fl1"));
  14317. this.txt_price = (this.getChild("txt_price"));
  14318. this.n_no = (this.getChild("n_no"));
  14319. this.n_buy = (this.getChild("n_buy"));
  14320. }
  14321. }
  14322. ui_Component_fl_1.URL = "ui://isxx5ak7im8nv59h";
  14323. class ui_Component_fl_2 extends fgui.GComponent {
  14324. static createInstance() {
  14325. return (fgui.UIPackage.createObject("game", "Component_fl_2"));
  14326. }
  14327. onConstruct() {
  14328. this.n_zzq_fl2 = (this.getChild("n_zzq_fl2"));
  14329. this.txt_price = (this.getChild("txt_price"));
  14330. this.n_no = (this.getChild("n_no"));
  14331. this.n_buy = (this.getChild("n_buy"));
  14332. }
  14333. }
  14334. ui_Component_fl_2.URL = "ui://isxx5ak7im8nv59n";
  14335. class ui_UIFuli2 extends fgui.GComponent {
  14336. static createInstance() {
  14337. return (fgui.UIPackage.createObject("game", "UIFuli2"));
  14338. }
  14339. onConstruct() {
  14340. this.n1 = (this.getChild("n1"));
  14341. this.n2 = (this.getChild("n2"));
  14342. }
  14343. }
  14344. ui_UIFuli2.URL = "ui://isxx5ak7im8nv59o";
  14345. class ui_drawBtn extends fgui.GButton {
  14346. static createInstance() {
  14347. return (fgui.UIPackage.createObject("game", "drawBtn"));
  14348. }
  14349. onConstruct() {
  14350. this.c1 = this.getController("c1");
  14351. this.n2 = (this.getChild("n2"));
  14352. this.n1 = (this.getChild("n1"));
  14353. this.n5 = (this.getChild("n5"));
  14354. }
  14355. }
  14356. ui_drawBtn.URL = "ui://isxx5ak7iqrhv4mt";
  14357. class ui_Component43 extends fgui.GButton {
  14358. static createInstance() {
  14359. return (fgui.UIPackage.createObject("game", "Component43"));
  14360. }
  14361. onConstruct() {
  14362. this.n49 = (this.getChild("n49"));
  14363. }
  14364. }
  14365. ui_Component43.URL = "ui://isxx5ak7iveg434";
  14366. class ui_wordsDisplay extends fgui.GComponent {
  14367. static createInstance() {
  14368. return (fgui.UIPackage.createObject("game", "wordsDisplay"));
  14369. }
  14370. onConstruct() {
  14371. this.txt = (this.getChild("txt"));
  14372. this.n63 = (this.getChild("n63"));
  14373. }
  14374. }
  14375. ui_wordsDisplay.URL = "ui://isxx5ak7iveg436";
  14376. class ui_Component_phb extends fgui.GComponent {
  14377. static createInstance() {
  14378. return (fgui.UIPackage.createObject("game", "Component_phb"));
  14379. }
  14380. onConstruct() {
  14381. this.n3 = (this.getChild("n3"));
  14382. this.n4 = (this.getChild("n4"));
  14383. }
  14384. }
  14385. ui_Component_phb.URL = "ui://isxx5ak7ixgmv57c";
  14386. class ui_Component3 extends fgui.GComponent {
  14387. static createInstance() {
  14388. return (fgui.UIPackage.createObject("game", "Component3"));
  14389. }
  14390. onConstruct() {
  14391. this.n26 = (this.getChild("n26"));
  14392. this.n24 = (this.getChild("n24"));
  14393. this.nameTxt = (this.getChild("nameTxt"));
  14394. this.headRoot = (this.getChild("headRoot"));
  14395. }
  14396. }
  14397. ui_Component3.URL = "ui://isxx5ak7ixm43xh";
  14398. class ui_Component4 extends fgui.GComponent {
  14399. static createInstance() {
  14400. return (fgui.UIPackage.createObject("game", "Component4"));
  14401. }
  14402. onConstruct() {
  14403. this.headImg = (this.getChild("headImg"));
  14404. }
  14405. }
  14406. ui_Component4.URL = "ui://isxx5ak7ixm43xi";
  14407. class ui_Component7 extends fgui.GButton {
  14408. static createInstance() {
  14409. return (fgui.UIPackage.createObject("game", "Component7"));
  14410. }
  14411. onConstruct() {
  14412. this.n17 = (this.getChild("n17"));
  14413. }
  14414. }
  14415. ui_Component7.URL = "ui://isxx5ak7ixm43xq";
  14416. class ui_Component8 extends fgui.GButton {
  14417. static createInstance() {
  14418. return (fgui.UIPackage.createObject("game", "Component8"));
  14419. }
  14420. onConstruct() {
  14421. this.n19 = (this.getChild("n19"));
  14422. }
  14423. }
  14424. ui_Component8.URL = "ui://isxx5ak7ixm43xr";
  14425. class ui_Component10 extends fgui.GButton {
  14426. static createInstance() {
  14427. return (fgui.UIPackage.createObject("game", "Component10"));
  14428. }
  14429. onConstruct() {
  14430. this.c1 = this.getController("c1");
  14431. this.n40 = (this.getChild("n40"));
  14432. }
  14433. }
  14434. ui_Component10.URL = "ui://isxx5ak7ixm43xt";
  14435. class ui_Component11 extends fgui.GButton {
  14436. static createInstance() {
  14437. return (fgui.UIPackage.createObject("game", "Component11"));
  14438. }
  14439. onConstruct() {
  14440. this.n34 = (this.getChild("n34"));
  14441. }
  14442. }
  14443. ui_Component11.URL = "ui://isxx5ak7ixm43xu";
  14444. class ui_Component12 extends fgui.GButton {
  14445. static createInstance() {
  14446. return (fgui.UIPackage.createObject("game", "Component12"));
  14447. }
  14448. onConstruct() {
  14449. this.n35 = (this.getChild("n35"));
  14450. }
  14451. }
  14452. ui_Component12.URL = "ui://isxx5ak7ixm43xv";
  14453. class ui_Component13 extends fgui.GButton {
  14454. static createInstance() {
  14455. return (fgui.UIPackage.createObject("game", "Component13"));
  14456. }
  14457. onConstruct() {
  14458. this.n27 = (this.getChild("n27"));
  14459. this.n36 = (this.getChild("n36"));
  14460. }
  14461. }
  14462. ui_Component13.URL = "ui://isxx5ak7ixm43xw";
  14463. class ui_dh_js_tuowei extends fgui.GComponent {
  14464. static createInstance() {
  14465. return (fgui.UIPackage.createObject("game", "dh_js_tuowei"));
  14466. }
  14467. onConstruct() {
  14468. this.n19 = (this.getChild("n19"));
  14469. this.n18 = (this.getChild("n18"));
  14470. this.n0 = (this.getChild("n0"));
  14471. this.n3 = (this.getChild("n3"));
  14472. this.n4 = (this.getChild("n4"));
  14473. this.n5 = (this.getChild("n5"));
  14474. this.n6 = (this.getChild("n6"));
  14475. this.n8 = (this.getChild("n8"));
  14476. this.n9 = (this.getChild("n9"));
  14477. this.n10 = (this.getChild("n10"));
  14478. this.n11 = (this.getChild("n11"));
  14479. this.n12 = (this.getChild("n12"));
  14480. this.n13 = (this.getChild("n13"));
  14481. this.n14 = (this.getChild("n14"));
  14482. this.n15 = (this.getChild("n15"));
  14483. this.n20 = (this.getChild("n20"));
  14484. this.t0 = this.getTransition("t0");
  14485. this.t1 = this.getTransition("t1");
  14486. }
  14487. }
  14488. ui_dh_js_tuowei.URL = "ui://isxx5ak7j69a40n";
  14489. class ui_dh_js_tw_g extends fgui.GComponent {
  14490. static createInstance() {
  14491. return (fgui.UIPackage.createObject("game", "dh_js_tw_g"));
  14492. }
  14493. onConstruct() {
  14494. this.n0 = (this.getChild("n0"));
  14495. this.n1 = (this.getChild("n1"));
  14496. this.t0 = this.getTransition("t0");
  14497. }
  14498. }
  14499. ui_dh_js_tw_g.URL = "ui://isxx5ak7j69a40o";
  14500. class ui_dh_js_xingxing extends fgui.GComponent {
  14501. static createInstance() {
  14502. return (fgui.UIPackage.createObject("game", "dh_js_xingxing"));
  14503. }
  14504. onConstruct() {
  14505. this.n1 = (this.getChild("n1"));
  14506. this.n2 = (this.getChild("n2"));
  14507. this.n3 = (this.getChild("n3"));
  14508. this.n4 = (this.getChild("n4"));
  14509. this.n0 = (this.getChild("n0"));
  14510. this.t2 = this.getTransition("t2");
  14511. this.t1 = this.getTransition("t1");
  14512. }
  14513. }
  14514. ui_dh_js_xingxing.URL = "ui://isxx5ak7j69a40p";
  14515. class ui_dh_zy_jiazai extends fgui.GComponent {
  14516. static createInstance() {
  14517. return (fgui.UIPackage.createObject("game", "dh_zy_jiazai"));
  14518. }
  14519. onConstruct() {
  14520. this.c1 = this.getController("c1");
  14521. this.n0 = (this.getChild("n0"));
  14522. this.n1 = (this.getChild("n1"));
  14523. this.n2 = (this.getChild("n2"));
  14524. this.n4 = (this.getChild("n4"));
  14525. this.n5 = (this.getChild("n5"));
  14526. this.n6 = (this.getChild("n6"));
  14527. this.n8 = (this.getChild("n8"));
  14528. this.n7 = (this.getChild("n7"));
  14529. this.t0 = this.getTransition("t0");
  14530. }
  14531. }
  14532. ui_dh_zy_jiazai.URL = "ui://isxx5ak7j69a40q";
  14533. class ui_dh_js_xingxing2 extends fgui.GComponent {
  14534. static createInstance() {
  14535. return (fgui.UIPackage.createObject("game", "dh_js_xingxing2"));
  14536. }
  14537. onConstruct() {
  14538. this.c1 = this.getController("c1");
  14539. this.n3 = (this.getChild("n3"));
  14540. this.n5 = (this.getChild("n5"));
  14541. this.n4 = (this.getChild("n4"));
  14542. this.n0 = (this.getChild("n0"));
  14543. this.n1 = (this.getChild("n1"));
  14544. this.n2 = (this.getChild("n2"));
  14545. }
  14546. }
  14547. ui_dh_js_xingxing2.URL = "ui://isxx5ak7j69a40r";
  14548. class ui_dh_js_tuowei2 extends fgui.GComponent {
  14549. static createInstance() {
  14550. return (fgui.UIPackage.createObject("game", "dh_js_tuowei2"));
  14551. }
  14552. onConstruct() {
  14553. this.n19 = (this.getChild("n19"));
  14554. this.n21 = (this.getChild("n21"));
  14555. this.n0 = (this.getChild("n0"));
  14556. this.n3 = (this.getChild("n3"));
  14557. this.n4 = (this.getChild("n4"));
  14558. this.n5 = (this.getChild("n5"));
  14559. this.n6 = (this.getChild("n6"));
  14560. this.n8 = (this.getChild("n8"));
  14561. this.n9 = (this.getChild("n9"));
  14562. this.n10 = (this.getChild("n10"));
  14563. this.n11 = (this.getChild("n11"));
  14564. this.n12 = (this.getChild("n12"));
  14565. this.n13 = (this.getChild("n13"));
  14566. this.n14 = (this.getChild("n14"));
  14567. this.n15 = (this.getChild("n15"));
  14568. this.n23 = (this.getChild("n23"));
  14569. this.t0 = this.getTransition("t0");
  14570. this.t1 = this.getTransition("t1");
  14571. }
  14572. }
  14573. ui_dh_js_tuowei2.URL = "ui://isxx5ak7j69a40s";
  14574. class ui_dh_js_tw_g_1 extends fgui.GComponent {
  14575. static createInstance() {
  14576. return (fgui.UIPackage.createObject("game", "dh_js_tw_g_1"));
  14577. }
  14578. onConstruct() {
  14579. this.n1 = (this.getChild("n1"));
  14580. this.n2 = (this.getChild("n2"));
  14581. this.t0 = this.getTransition("t0");
  14582. }
  14583. }
  14584. ui_dh_js_tw_g_1.URL = "ui://isxx5ak7j69a40t";
  14585. class ui_dh_js_shibai_1 extends fgui.GComponent {
  14586. static createInstance() {
  14587. return (fgui.UIPackage.createObject("game", "dh_js_shibai_1"));
  14588. }
  14589. onConstruct() {
  14590. this.n4 = (this.getChild("n4"));
  14591. this.n2 = (this.getChild("n2"));
  14592. this.n3 = (this.getChild("n3"));
  14593. this.idle = this.getTransition("idle");
  14594. this.attack = this.getTransition("attack");
  14595. }
  14596. }
  14597. ui_dh_js_shibai_1.URL = "ui://isxx5ak7j69a40w";
  14598. class ui_special extends fgui.GComponent {
  14599. static createInstance() {
  14600. return (fgui.UIPackage.createObject("game", "special"));
  14601. }
  14602. onConstruct() {
  14603. this.n18 = (this.getChild("n18"));
  14604. this.n19 = (this.getChild("n19"));
  14605. this.n20 = (this.getChild("n20"));
  14606. this.n21 = (this.getChild("n21"));
  14607. this.n22 = (this.getChild("n22"));
  14608. this.levelTxt = (this.getChild("levelTxt"));
  14609. this.n24 = (this.getChild("n24"));
  14610. this.n25 = (this.getChild("n25"));
  14611. this.t0 = this.getTransition("t0");
  14612. }
  14613. }
  14614. ui_special.URL = "ui://isxx5ak7j979v4i6";
  14615. class ui_Component145 extends fgui.GComponent {
  14616. static createInstance() {
  14617. return (fgui.UIPackage.createObject("game", "Component145"));
  14618. }
  14619. onConstruct() {
  14620. this.guanyuNode = (this.getChild("guanyuNode"));
  14621. }
  14622. }
  14623. ui_Component145.URL = "ui://isxx5ak7jaakv51f";
  14624. class ui_longBtn extends fgui.GButton {
  14625. static createInstance() {
  14626. return (fgui.UIPackage.createObject("game", "longBtn"));
  14627. }
  14628. onConstruct() {
  14629. this.c1 = this.getController("c1");
  14630. this.n2 = (this.getChild("n2"));
  14631. this.n1 = (this.getChild("n1"));
  14632. this.n4 = (this.getChild("n4"));
  14633. }
  14634. }
  14635. ui_longBtn.URL = "ui://isxx5ak7jaakv55v";
  14636. class ui_Component146 extends fgui.GComponent {
  14637. static createInstance() {
  14638. return (fgui.UIPackage.createObject("game", "Component146"));
  14639. }
  14640. onConstruct() {
  14641. this.n89 = (this.getChild("n89"));
  14642. this.n90 = (this.getChild("n90"));
  14643. this.guideBtn = (this.getChild("guideBtn"));
  14644. }
  14645. }
  14646. ui_Component146.URL = "ui://isxx5ak7jaakv55w";
  14647. class ui_Component146_11 extends fgui.GComponent {
  14648. static createInstance() {
  14649. return (fgui.UIPackage.createObject("game", "Component146_11"));
  14650. }
  14651. onConstruct() {
  14652. this.n89 = (this.getChild("n89"));
  14653. this.n90 = (this.getChild("n90"));
  14654. this.guideBtn = (this.getChild("guideBtn"));
  14655. }
  14656. }
  14657. ui_Component146_11.URL = "ui://isxx5ak7jaakv55x";
  14658. class ui_Component111_1 extends fgui.GComponent {
  14659. static createInstance() {
  14660. return (fgui.UIPackage.createObject("game", "Component111_1"));
  14661. }
  14662. onConstruct() {
  14663. this.n68 = (this.getChild("n68"));
  14664. this.myMask = (this.getChild("myMask"));
  14665. }
  14666. }
  14667. ui_Component111_1.URL = "ui://isxx5ak7jaakv55y";
  14668. class ui_Component64_1 extends fgui.GComponent {
  14669. static createInstance() {
  14670. return (fgui.UIPackage.createObject("game", "Component64_1"));
  14671. }
  14672. onConstruct() {
  14673. this.n57 = (this.getChild("n57"));
  14674. this.n54 = (this.getChild("n54"));
  14675. this.n55 = (this.getChild("n55"));
  14676. this.n56 = (this.getChild("n56"));
  14677. this.t1 = this.getTransition("t1");
  14678. }
  14679. }
  14680. ui_Component64_1.URL = "ui://isxx5ak7jaakv55z";
  14681. class ui_ModeSelection_com123 extends fgui.GComponent {
  14682. static createInstance() {
  14683. return (fgui.UIPackage.createObject("game", "ModeSelection_com123"));
  14684. }
  14685. onConstruct() {
  14686. this.type1 = (this.getChild("type1"));
  14687. this.type2 = (this.getChild("type2"));
  14688. this.type3 = (this.getChild("type3"));
  14689. this.n38 = (this.getChild("n38"));
  14690. this.t0 = this.getTransition("t0");
  14691. }
  14692. }
  14693. ui_ModeSelection_com123.URL = "ui://isxx5ak7jaakv561";
  14694. class ui_Component132_2 extends fgui.GComponent {
  14695. static createInstance() {
  14696. return (fgui.UIPackage.createObject("game", "Component132_2"));
  14697. }
  14698. onConstruct() {
  14699. this.n25 = (this.getChild("n25"));
  14700. this.n26 = (this.getChild("n26"));
  14701. this.n27 = (this.getChild("n27"));
  14702. this.t0 = this.getTransition("t0");
  14703. }
  14704. }
  14705. ui_Component132_2.URL = "ui://isxx5ak7jpszv4mw";
  14706. class ui_UIPower$1 extends fgui.GComponent {
  14707. static createInstance() {
  14708. return (fgui.UIPackage.createObject("game", "UIPower"));
  14709. }
  14710. onConstruct() {
  14711. this.n11 = (this.getChild("n11"));
  14712. this.myNode = (this.getChild("myNode"));
  14713. this.t0 = this.getTransition("t0");
  14714. }
  14715. }
  14716. ui_UIPower$1.URL = "ui://isxx5ak7jpszv4n1";
  14717. class ui_Component133 extends fgui.GComponent {
  14718. static createInstance() {
  14719. return (fgui.UIPackage.createObject("game", "Component133"));
  14720. }
  14721. onConstruct() {
  14722. this.n29 = (this.getChild("n29"));
  14723. this.n30 = (this.getChild("n30"));
  14724. }
  14725. }
  14726. ui_Component133.URL = "ui://isxx5ak7jpszv4n3";
  14727. class ui_Component134 extends fgui.GComponent {
  14728. static createInstance() {
  14729. return (fgui.UIPackage.createObject("game", "Component134"));
  14730. }
  14731. onConstruct() {
  14732. this.n30 = (this.getChild("n30"));
  14733. this.n31 = (this.getChild("n31"));
  14734. this.t0 = this.getTransition("t0");
  14735. }
  14736. }
  14737. ui_Component134.URL = "ui://isxx5ak7jpszv4n4";
  14738. class ui_Component135 extends fgui.GComponent {
  14739. static createInstance() {
  14740. return (fgui.UIPackage.createObject("game", "Component135"));
  14741. }
  14742. onConstruct() {
  14743. this.n30 = (this.getChild("n30"));
  14744. this.t0 = this.getTransition("t0");
  14745. }
  14746. }
  14747. ui_Component135.URL = "ui://isxx5ak7jpszv4n6";
  14748. class ui_Component137 extends fgui.GComponent {
  14749. static createInstance() {
  14750. return (fgui.UIPackage.createObject("game", "Component137"));
  14751. }
  14752. onConstruct() {
  14753. this.n28 = (this.getChild("n28"));
  14754. this.n29 = (this.getChild("n29"));
  14755. this.n30 = (this.getChild("n30"));
  14756. this.n32 = (this.getChild("n32"));
  14757. }
  14758. }
  14759. ui_Component137.URL = "ui://isxx5ak7jpszv4n8";
  14760. class ui_dh_zuanshi extends fgui.GButton {
  14761. static createInstance() {
  14762. return (fgui.UIPackage.createObject("game", "dh_zuanshi"));
  14763. }
  14764. onConstruct() {
  14765. this.n1 = (this.getChild("n1"));
  14766. this.n2 = (this.getChild("n2"));
  14767. this.n0 = (this.getChild("n0"));
  14768. this.n3 = (this.getChild("n3"));
  14769. this.n4 = (this.getChild("n4"));
  14770. }
  14771. }
  14772. ui_dh_zuanshi.URL = "ui://isxx5ak7jpszv4n9";
  14773. class ui_Component138 extends fgui.GComponent {
  14774. static createInstance() {
  14775. return (fgui.UIPackage.createObject("game", "Component138"));
  14776. }
  14777. onConstruct() {
  14778. this.n1 = (this.getChild("n1"));
  14779. this.n2 = (this.getChild("n2"));
  14780. this.t0 = this.getTransition("t0");
  14781. }
  14782. }
  14783. ui_Component138.URL = "ui://isxx5ak7jpszv4nf";
  14784. class ui_Component139 extends fgui.GComponent {
  14785. static createInstance() {
  14786. return (fgui.UIPackage.createObject("game", "Component139"));
  14787. }
  14788. onConstruct() {
  14789. this.n0 = (this.getChild("n0"));
  14790. this.t0 = this.getTransition("t0");
  14791. }
  14792. }
  14793. ui_Component139.URL = "ui://isxx5ak7jpszv4ng";
  14794. class ui_Component140 extends fgui.GComponent {
  14795. static createInstance() {
  14796. return (fgui.UIPackage.createObject("game", "Component140"));
  14797. }
  14798. onConstruct() {
  14799. this.n2 = (this.getChild("n2"));
  14800. this.n3 = (this.getChild("n3"));
  14801. this.t0 = this.getTransition("t0");
  14802. }
  14803. }
  14804. ui_Component140.URL = "ui://isxx5ak7jpszv4nh";
  14805. class ui_Component141 extends fgui.GComponent {
  14806. static createInstance() {
  14807. return (fgui.UIPackage.createObject("game", "Component141"));
  14808. }
  14809. onConstruct() {
  14810. this.n0 = (this.getChild("n0"));
  14811. this.t0 = this.getTransition("t0");
  14812. }
  14813. }
  14814. ui_Component141.URL = "ui://isxx5ak7jpszv4ni";
  14815. class ui_powerNode extends fgui.GProgressBar {
  14816. static createInstance() {
  14817. return (fgui.UIPackage.createObject("game", "powerNode"));
  14818. }
  14819. onConstruct() {
  14820. this.n2 = (this.getChild("n2"));
  14821. this.bar_v = (this.getChild("bar_v"));
  14822. this.showImg = (this.getChild("showImg"));
  14823. this.n12 = (this.getChild("n12"));
  14824. }
  14825. }
  14826. ui_powerNode.URL = "ui://isxx5ak7kt443qh";
  14827. class ui_dh_jingbi1 extends fgui.GComponent {
  14828. static createInstance() {
  14829. return (fgui.UIPackage.createObject("game", "dh_jingbi1"));
  14830. }
  14831. onConstruct() {
  14832. this.n0 = (this.getChild("n0"));
  14833. this.n1 = (this.getChild("n1"));
  14834. this.n2 = (this.getChild("n2"));
  14835. this.n3 = (this.getChild("n3"));
  14836. this.n4 = (this.getChild("n4"));
  14837. this.n5 = (this.getChild("n5"));
  14838. this.n6 = (this.getChild("n6"));
  14839. this.n8 = (this.getChild("n8"));
  14840. this.t0 = this.getTransition("t0");
  14841. }
  14842. }
  14843. ui_dh_jingbi1.URL = "ui://isxx5ak7kys749e";
  14844. class ui_Component94 extends fgui.GButton {
  14845. static createInstance() {
  14846. return (fgui.UIPackage.createObject("game", "Component94"));
  14847. }
  14848. onConstruct() {
  14849. this.n77 = (this.getChild("n77"));
  14850. }
  14851. }
  14852. ui_Component94.URL = "ui://isxx5ak7l1574b6";
  14853. class ui_Component95 extends fgui.GButton {
  14854. static createInstance() {
  14855. return (fgui.UIPackage.createObject("game", "Component95"));
  14856. }
  14857. onConstruct() {
  14858. this.n77 = (this.getChild("n77"));
  14859. }
  14860. }
  14861. ui_Component95.URL = "ui://isxx5ak7l1574b7";
  14862. class ui_Component126 extends fgui.GComponent {
  14863. static createInstance() {
  14864. return (fgui.UIPackage.createObject("game", "Component126"));
  14865. }
  14866. onConstruct() {
  14867. this.c1 = this.getController("c1");
  14868. this.normalBtn = (this.getChild("normalBtn"));
  14869. this.tripleBtn = (this.getChild("tripleBtn"));
  14870. }
  14871. }
  14872. ui_Component126.URL = "ui://isxx5ak7lhrrv4lg";
  14873. class ui_Component60 extends fgui.GComponent {
  14874. static createInstance() {
  14875. return (fgui.UIPackage.createObject("game", "Component60"));
  14876. }
  14877. onConstruct() {
  14878. this.c1 = this.getController("c1");
  14879. this.n48 = (this.getChild("n48"));
  14880. this.womanTxt = (this.getChild("womanTxt"));
  14881. this.t0 = this.getTransition("t0");
  14882. }
  14883. }
  14884. ui_Component60.URL = "ui://isxx5ak7llhd44g";
  14885. class ui_Button_h extends fgui.GButton {
  14886. static createInstance() {
  14887. return (fgui.UIPackage.createObject("game", "Button_h"));
  14888. }
  14889. onConstruct() {
  14890. this.button = this.getController("button");
  14891. this.n0 = (this.getChild("n0"));
  14892. }
  14893. }
  14894. ui_Button_h.URL = "ui://isxx5ak7loypv59r";
  14895. class ui_Button_lv extends fgui.GButton {
  14896. static createInstance() {
  14897. return (fgui.UIPackage.createObject("game", "Button_lv"));
  14898. }
  14899. onConstruct() {
  14900. this.button = this.getController("button");
  14901. this.n0 = (this.getChild("n0"));
  14902. }
  14903. }
  14904. ui_Button_lv.URL = "ui://isxx5ak7loypv59s";
  14905. class ui_Component98_3 extends fgui.GButton {
  14906. static createInstance() {
  14907. return (fgui.UIPackage.createObject("game", "Component98_3"));
  14908. }
  14909. onConstruct() {
  14910. this.c1 = this.getController("c1");
  14911. this.n8 = (this.getChild("n8"));
  14912. this.n41 = (this.getChild("n41"));
  14913. this.n40 = (this.getChild("n40"));
  14914. }
  14915. }
  14916. ui_Component98_3.URL = "ui://isxx5ak7lp3lv4j2";
  14917. class ui_ModeSelection_com1 extends fgui.GButton {
  14918. static createInstance() {
  14919. return (fgui.UIPackage.createObject("game", "ModeSelection_com1"));
  14920. }
  14921. onConstruct() {
  14922. this.n34 = (this.getChild("n34"));
  14923. this.n36 = (this.getChild("n36"));
  14924. this.n22 = (this.getChild("n22"));
  14925. this.n20 = (this.getChild("n20"));
  14926. this.n23 = (this.getChild("n23"));
  14927. this.n24 = (this.getChild("n24"));
  14928. this.n26 = (this.getChild("n26"));
  14929. this.n33 = (this.getChild("n33"));
  14930. this.coinImg = (this.getChild("coinImg"));
  14931. this.need = (this.getChild("need"));
  14932. this.n35 = (this.getChild("n35"));
  14933. this.n29 = (this.getChild("n29"));
  14934. this.tipsTxt = (this.getChild("tipsTxt"));
  14935. this.n30 = (this.getChild("n30"));
  14936. this.peopleTxt = (this.getChild("peopleTxt"));
  14937. this.t0 = this.getTransition("t0");
  14938. }
  14939. }
  14940. ui_ModeSelection_com1.URL = "ui://isxx5ak7lrxgv50m";
  14941. class ui_ModeSelection_com2 extends fgui.GButton {
  14942. static createInstance() {
  14943. return (fgui.UIPackage.createObject("game", "ModeSelection_com2"));
  14944. }
  14945. onConstruct() {
  14946. this.n36 = (this.getChild("n36"));
  14947. this.n34 = (this.getChild("n34"));
  14948. this.n22 = (this.getChild("n22"));
  14949. this.n20 = (this.getChild("n20"));
  14950. this.n23 = (this.getChild("n23"));
  14951. this.n24 = (this.getChild("n24"));
  14952. this.n26 = (this.getChild("n26"));
  14953. this.n33 = (this.getChild("n33"));
  14954. this.coinImg = (this.getChild("coinImg"));
  14955. this.need = (this.getChild("need"));
  14956. this.n35 = (this.getChild("n35"));
  14957. this.n29 = (this.getChild("n29"));
  14958. this.tipsTxt = (this.getChild("tipsTxt"));
  14959. this.n30 = (this.getChild("n30"));
  14960. this.peopleTxt = (this.getChild("peopleTxt"));
  14961. this.t0 = this.getTransition("t0");
  14962. }
  14963. }
  14964. ui_ModeSelection_com2.URL = "ui://isxx5ak7lrxgv50n";
  14965. class ui_ModeSelection_com3 extends fgui.GButton {
  14966. static createInstance() {
  14967. return (fgui.UIPackage.createObject("game", "ModeSelection_com3"));
  14968. }
  14969. onConstruct() {
  14970. this.n34 = (this.getChild("n34"));
  14971. this.n36 = (this.getChild("n36"));
  14972. this.n22 = (this.getChild("n22"));
  14973. this.n20 = (this.getChild("n20"));
  14974. this.n23 = (this.getChild("n23"));
  14975. this.n24 = (this.getChild("n24"));
  14976. this.n26 = (this.getChild("n26"));
  14977. this.n33 = (this.getChild("n33"));
  14978. this.coinImg = (this.getChild("coinImg"));
  14979. this.need = (this.getChild("need"));
  14980. this.n35 = (this.getChild("n35"));
  14981. this.n29 = (this.getChild("n29"));
  14982. this.tipsTxt = (this.getChild("tipsTxt"));
  14983. this.n30 = (this.getChild("n30"));
  14984. this.peopleTxt = (this.getChild("peopleTxt"));
  14985. this.t0 = this.getTransition("t0");
  14986. }
  14987. }
  14988. ui_ModeSelection_com3.URL = "ui://isxx5ak7lrxgv50o";
  14989. class ui_Invitation_com1 extends fgui.GComponent {
  14990. static createInstance() {
  14991. return (fgui.UIPackage.createObject("game", "Invitation_com1"));
  14992. }
  14993. onConstruct() {
  14994. this.n14 = (this.getChild("n14"));
  14995. this.n13 = (this.getChild("n13"));
  14996. this.n3 = (this.getChild("n3"));
  14997. this.n1 = (this.getChild("n1"));
  14998. this.n6 = (this.getChild("n6"));
  14999. this.n7 = (this.getChild("n7"));
  15000. this.enterBtn = (this.getChild("enterBtn"));
  15001. this.n11 = (this.getChild("n11"));
  15002. this.n12 = (this.getChild("n12"));
  15003. this.n15 = (this.getChild("n15"));
  15004. this.t0 = this.getTransition("t0");
  15005. this.t1 = this.getTransition("t1");
  15006. }
  15007. }
  15008. ui_Invitation_com1.URL = "ui://isxx5ak7lrxgv513";
  15009. class ui_Component87_1 extends fgui.GComponent {
  15010. static createInstance() {
  15011. return (fgui.UIPackage.createObject("game", "Component87_1"));
  15012. }
  15013. onConstruct() {
  15014. this.n74 = (this.getChild("n74"));
  15015. this.n73 = (this.getChild("n73"));
  15016. this.ballTxt = (this.getChild("ballTxt"));
  15017. this.n76 = (this.getChild("n76"));
  15018. this.helpLineBtn = (this.getChild("helpLineBtn"));
  15019. this.levelTxt = (this.getChild("levelTxt"));
  15020. this.n87 = (this.getChild("n87"));
  15021. this.n84 = (this.getChild("n84"));
  15022. this.hpTxt = (this.getChild("hpTxt"));
  15023. this.n89 = (this.getChild("n89"));
  15024. this.tipsTxt = (this.getChild("tipsTxt"));
  15025. }
  15026. }
  15027. ui_Component87_1.URL = "ui://isxx5ak7luq648t";
  15028. class ui_Component_lc3 extends fgui.GComponent {
  15029. static createInstance() {
  15030. return (fgui.UIPackage.createObject("game", "Component_lc3"));
  15031. }
  15032. onConstruct() {
  15033. this.n0 = (this.getChild("n0"));
  15034. this.n2 = (this.getChild("n2"));
  15035. this.n1_bai = (this.getChild("n1_bai"));
  15036. }
  15037. }
  15038. ui_Component_lc3.URL = "ui://isxx5ak7lvbnv5b1";
  15039. class ui_Component_shou3 extends fgui.GComponent {
  15040. static createInstance() {
  15041. return (fgui.UIPackage.createObject("game", "Component_shou3"));
  15042. }
  15043. onConstruct() {
  15044. this.n57 = (this.getChild("n57"));
  15045. this.n54 = (this.getChild("n54"));
  15046. this.n55 = (this.getChild("n55"));
  15047. this.n56 = (this.getChild("n56"));
  15048. this.t1 = this.getTransition("t1");
  15049. }
  15050. }
  15051. ui_Component_shou3.URL = "ui://isxx5ak7lvbnv5b2";
  15052. class ui_sqg1 extends fgui.GComponent {
  15053. static createInstance() {
  15054. return (fgui.UIPackage.createObject("game", "sqg1"));
  15055. }
  15056. onConstruct() {
  15057. this.n1 = (this.getChild("n1"));
  15058. this.n0 = (this.getChild("n0"));
  15059. }
  15060. }
  15061. ui_sqg1.URL = "ui://isxx5ak7mif8v4ma";
  15062. class ui_sqg2 extends fgui.GComponent {
  15063. static createInstance() {
  15064. return (fgui.UIPackage.createObject("game", "sqg2"));
  15065. }
  15066. onConstruct() {
  15067. this.n1 = (this.getChild("n1"));
  15068. this.n0 = (this.getChild("n0"));
  15069. }
  15070. }
  15071. ui_sqg2.URL = "ui://isxx5ak7mif8v4mb";
  15072. class ui_sqg3 extends fgui.GComponent {
  15073. static createInstance() {
  15074. return (fgui.UIPackage.createObject("game", "sqg3"));
  15075. }
  15076. onConstruct() {
  15077. this.n1 = (this.getChild("n1"));
  15078. this.n0 = (this.getChild("n0"));
  15079. }
  15080. }
  15081. ui_sqg3.URL = "ui://isxx5ak7mif8v4mc";
  15082. class ui_sqg4 extends fgui.GComponent {
  15083. static createInstance() {
  15084. return (fgui.UIPackage.createObject("game", "sqg4"));
  15085. }
  15086. onConstruct() {
  15087. this.n1 = (this.getChild("n1"));
  15088. this.n0 = (this.getChild("n0"));
  15089. }
  15090. }
  15091. ui_sqg4.URL = "ui://isxx5ak7mif8v4md";
  15092. class ui_Component36 extends fgui.GButton {
  15093. static createInstance() {
  15094. return (fgui.UIPackage.createObject("game", "Component36"));
  15095. }
  15096. onConstruct() {
  15097. this.c1 = this.getController("c1");
  15098. this.n53 = (this.getChild("n53"));
  15099. this.n56 = (this.getChild("n56"));
  15100. }
  15101. }
  15102. ui_Component36.URL = "ui://isxx5ak7mnrs42r";
  15103. class ui_Component37 extends fgui.GButton {
  15104. static createInstance() {
  15105. return (fgui.UIPackage.createObject("game", "Component37"));
  15106. }
  15107. onConstruct() {
  15108. this.c1 = this.getController("c1");
  15109. this.n52 = (this.getChild("n52"));
  15110. this.n54 = (this.getChild("n54"));
  15111. }
  15112. }
  15113. ui_Component37.URL = "ui://isxx5ak7mnrs42s";
  15114. class ui_UISetting extends fgui.GComponent {
  15115. static createInstance() {
  15116. return (fgui.UIPackage.createObject("game", "UISetting"));
  15117. }
  15118. onConstruct() {
  15119. this.c1 = this.getController("c1");
  15120. this.n4 = (this.getChild("n4"));
  15121. this.soundBtn = (this.getChild("soundBtn"));
  15122. this.shakeBtn = (this.getChild("shakeBtn"));
  15123. this.clickNode = (this.getChild("clickNode"));
  15124. this.xyBtn = (this.getChild("xyBtn"));
  15125. }
  15126. }
  15127. ui_UISetting.URL = "ui://isxx5ak7mnrs42t";
  15128. class ui_Component39 extends fgui.GComponent {
  15129. static createInstance() {
  15130. return (fgui.UIPackage.createObject("game", "Component39"));
  15131. }
  15132. onConstruct() {
  15133. this.n5 = (this.getChild("n5"));
  15134. this.n6 = (this.getChild("n6"));
  15135. this.n7 = (this.getChild("n7"));
  15136. this.t0 = this.getTransition("t0");
  15137. }
  15138. }
  15139. ui_Component39.URL = "ui://isxx5ak7mnrs42v";
  15140. class ui_Component40 extends fgui.GButton {
  15141. static createInstance() {
  15142. return (fgui.UIPackage.createObject("game", "Component40"));
  15143. }
  15144. onConstruct() {
  15145. this.n46 = (this.getChild("n46"));
  15146. this.n47 = (this.getChild("n47"));
  15147. }
  15148. }
  15149. ui_Component40.URL = "ui://isxx5ak7mnrs42y";
  15150. class ui_Component41 extends fgui.GComponent {
  15151. static createInstance() {
  15152. return (fgui.UIPackage.createObject("game", "Component41"));
  15153. }
  15154. onConstruct() {
  15155. this.c1 = this.getController("c1");
  15156. this.n0 = (this.getChild("n0"));
  15157. this.titleTxt = (this.getChild("titleTxt"));
  15158. this.n2 = (this.getChild("n2"));
  15159. this.msgTips = (this.getChild("msgTips"));
  15160. this.numTxt = (this.getChild("numTxt"));
  15161. this.n18 = (this.getChild("n18"));
  15162. this.cancelBtn = (this.getChild("cancelBtn"));
  15163. this.videoBtn = (this.getChild("videoBtn"));
  15164. this.n10 = (this.getChild("n10"));
  15165. }
  15166. }
  15167. ui_Component41.URL = "ui://isxx5ak7mnrs430";
  15168. class ui_Component42 extends fgui.GComponent {
  15169. static createInstance() {
  15170. return (fgui.UIPackage.createObject("game", "Component42"));
  15171. }
  15172. onConstruct() {
  15173. this.c1 = this.getController("c1");
  15174. this.n1 = (this.getChild("n1"));
  15175. this.n2 = (this.getChild("n2"));
  15176. this.n3 = (this.getChild("n3"));
  15177. this.tipsTxt = (this.getChild("tipsTxt"));
  15178. this.cancelBtn = (this.getChild("cancelBtn"));
  15179. this.sureBtn = (this.getChild("sureBtn"));
  15180. this.n11 = (this.getChild("n11"));
  15181. this.n13 = (this.getChild("n13"));
  15182. this.n14 = (this.getChild("n14"));
  15183. this.womanTxt = (this.getChild("womanTxt"));
  15184. this.t0 = this.getTransition("t0");
  15185. }
  15186. }
  15187. ui_Component42.URL = "ui://isxx5ak7mnrs431";
  15188. class ui_dh_js_shengli extends fgui.GComponent {
  15189. static createInstance() {
  15190. return (fgui.UIPackage.createObject("game", "dh_js_shengli"));
  15191. }
  15192. onConstruct() {
  15193. this.n3 = (this.getChild("n3"));
  15194. this.n4 = (this.getChild("n4"));
  15195. this.n1 = (this.getChild("n1"));
  15196. this.n2 = (this.getChild("n2"));
  15197. this.n5 = (this.getChild("n5"));
  15198. this.n6 = (this.getChild("n6"));
  15199. this.n7 = (this.getChild("n7"));
  15200. this.n8 = (this.getChild("n8"));
  15201. this.attack = this.getTransition("attack");
  15202. this.idle = this.getTransition("idle");
  15203. }
  15204. }
  15205. ui_dh_js_shengli.URL = "ui://isxx5ak7n43d3v0";
  15206. class ui_dh_js_shengli_g extends fgui.GComponent {
  15207. static createInstance() {
  15208. return (fgui.UIPackage.createObject("game", "dh_js_shengli_g"));
  15209. }
  15210. onConstruct() {
  15211. this.n3 = (this.getChild("n3"));
  15212. this.n1 = (this.getChild("n1"));
  15213. this.t0 = this.getTransition("t0");
  15214. }
  15215. }
  15216. ui_dh_js_shengli_g.URL = "ui://isxx5ak7n43d3v1";
  15217. class ui_dh_js_shibai extends fgui.GComponent {
  15218. static createInstance() {
  15219. return (fgui.UIPackage.createObject("game", "dh_js_shibai"));
  15220. }
  15221. onConstruct() {
  15222. this.n0 = (this.getChild("n0"));
  15223. this.n1 = (this.getChild("n1"));
  15224. this.n2 = (this.getChild("n2"));
  15225. this.n3 = (this.getChild("n3"));
  15226. this.idle = this.getTransition("idle");
  15227. this.attack = this.getTransition("attack");
  15228. }
  15229. }
  15230. ui_dh_js_shibai.URL = "ui://isxx5ak7n43d3v2";
  15231. class ui_dh_zy_ganfa extends fgui.GButton {
  15232. static createInstance() {
  15233. return (fgui.UIPackage.createObject("game", "dh_zy_ganfa"));
  15234. }
  15235. onConstruct() {
  15236. this.n0 = (this.getChild("n0"));
  15237. }
  15238. }
  15239. ui_dh_zy_ganfa.URL = "ui://isxx5ak7n43d3vl";
  15240. class ui_dh_zy_sc_guang extends fgui.GButton {
  15241. static createInstance() {
  15242. return (fgui.UIPackage.createObject("game", "dh_zy_sc_guang"));
  15243. }
  15244. onConstruct() {
  15245. this.n0 = (this.getChild("n0"));
  15246. this.n2 = (this.getChild("n2"));
  15247. }
  15248. }
  15249. ui_dh_zy_sc_guang.URL = "ui://isxx5ak7n43d3vn";
  15250. class ui_dh_zy_shangcheng extends fgui.GComponent {
  15251. static createInstance() {
  15252. return (fgui.UIPackage.createObject("game", "dh_zy_shangcheng"));
  15253. }
  15254. onConstruct() {
  15255. this.n0 = (this.getChild("n0"));
  15256. this.n3 = (this.getChild("n3"));
  15257. }
  15258. }
  15259. ui_dh_zy_shangcheng.URL = "ui://isxx5ak7n43d3vo";
  15260. class ui_dh_zy_wanfa extends fgui.GButton {
  15261. static createInstance() {
  15262. return (fgui.UIPackage.createObject("game", "dh_zy_wanfa"));
  15263. }
  15264. onConstruct() {
  15265. this.n0 = (this.getChild("n0"));
  15266. }
  15267. }
  15268. ui_dh_zy_wanfa.URL = "ui://isxx5ak7n43d3vp";
  15269. class ui_Button_login extends fgui.GButton {
  15270. static createInstance() {
  15271. return (fgui.UIPackage.createObject("game", "Button_login"));
  15272. }
  15273. onConstruct() {
  15274. this.button = this.getController("button");
  15275. this.n5 = (this.getChild("n5"));
  15276. }
  15277. }
  15278. ui_Button_login.URL = "ui://isxx5ak7nnz5v587";
  15279. class ui_Component53_1 extends fgui.GComponent {
  15280. static createInstance() {
  15281. return (fgui.UIPackage.createObject("game", "Component53_1"));
  15282. }
  15283. onConstruct() {
  15284. this.n0 = (this.getChild("n0"));
  15285. this.n1 = (this.getChild("n1"));
  15286. this.n2 = (this.getChild("n2"));
  15287. this.n3 = (this.getChild("n3"));
  15288. this.n4 = (this.getChild("n4"));
  15289. this.n5 = (this.getChild("n5"));
  15290. this.n6 = (this.getChild("n6"));
  15291. this.n7 = (this.getChild("n7"));
  15292. this.n8 = (this.getChild("n8"));
  15293. this.n9 = (this.getChild("n9"));
  15294. this.n10 = (this.getChild("n10"));
  15295. this.n11 = (this.getChild("n11"));
  15296. this.n12 = (this.getChild("n12"));
  15297. this.n13 = (this.getChild("n13"));
  15298. this.n14 = (this.getChild("n14"));
  15299. this.n15 = (this.getChild("n15"));
  15300. this.n16 = (this.getChild("n16"));
  15301. this.n19 = (this.getChild("n19"));
  15302. this.n20 = (this.getChild("n20"));
  15303. this.n21 = (this.getChild("n21"));
  15304. this.n22 = (this.getChild("n22"));
  15305. this.n23 = (this.getChild("n23"));
  15306. this.n24 = (this.getChild("n24"));
  15307. this.n25 = (this.getChild("n25"));
  15308. this.n26 = (this.getChild("n26"));
  15309. this.n27 = (this.getChild("n27"));
  15310. this.n28 = (this.getChild("n28"));
  15311. this.n29 = (this.getChild("n29"));
  15312. this.n30 = (this.getChild("n30"));
  15313. this.n31 = (this.getChild("n31"));
  15314. this.n32 = (this.getChild("n32"));
  15315. this.n33 = (this.getChild("n33"));
  15316. this.n34 = (this.getChild("n34"));
  15317. this.n35 = (this.getChild("n35"));
  15318. this.t0 = this.getTransition("t0");
  15319. }
  15320. }
  15321. ui_Component53_1.URL = "ui://isxx5ak7nqgqv4y4";
  15322. class ui_Component30 extends fgui.GComponent {
  15323. static createInstance() {
  15324. return (fgui.UIPackage.createObject("game", "Component30"));
  15325. }
  15326. onConstruct() {
  15327. this.c1 = this.getController("c1");
  15328. this.n46 = (this.getChild("n46"));
  15329. this.n47 = (this.getChild("n47"));
  15330. this.numTxt = (this.getChild("numTxt"));
  15331. this.n50 = (this.getChild("n50"));
  15332. this.n53 = (this.getChild("n53"));
  15333. this.n54 = (this.getChild("n54"));
  15334. this.n55 = (this.getChild("n55"));
  15335. this.n56 = (this.getChild("n56"));
  15336. }
  15337. }
  15338. ui_Component30.URL = "ui://isxx5ak7p4tr41y";
  15339. class ui_Component30_1 extends fgui.GComponent {
  15340. static createInstance() {
  15341. return (fgui.UIPackage.createObject("game", "Component30_1"));
  15342. }
  15343. onConstruct() {
  15344. this.c1 = this.getController("c1");
  15345. this.n46 = (this.getChild("n46"));
  15346. this.n47 = (this.getChild("n47"));
  15347. this.numTxt = (this.getChild("numTxt"));
  15348. this.n50 = (this.getChild("n50"));
  15349. this.n51 = (this.getChild("n51"));
  15350. this.n52 = (this.getChild("n52"));
  15351. this.n53 = (this.getChild("n53"));
  15352. this.n54 = (this.getChild("n54"));
  15353. }
  15354. }
  15355. ui_Component30_1.URL = "ui://isxx5ak7p4tr41z";
  15356. class ui_Component31 extends fgui.GComponent {
  15357. static createInstance() {
  15358. return (fgui.UIPackage.createObject("game", "Component31"));
  15359. }
  15360. onConstruct() {
  15361. this.n55 = (this.getChild("n55"));
  15362. this.n54 = (this.getChild("n54"));
  15363. this.conditionTxt = (this.getChild("conditionTxt"));
  15364. this.n57 = (this.getChild("n57"));
  15365. this.t0 = this.getTransition("t0");
  15366. }
  15367. }
  15368. ui_Component31.URL = "ui://isxx5ak7p4tr423";
  15369. class ui_Component32 extends fgui.GComponent {
  15370. static createInstance() {
  15371. return (fgui.UIPackage.createObject("game", "Component32"));
  15372. }
  15373. onConstruct() {
  15374. this.n5 = (this.getChild("n5"));
  15375. this.n6 = (this.getChild("n6"));
  15376. this.n7 = (this.getChild("n7"));
  15377. this.t0 = this.getTransition("t0");
  15378. }
  15379. }
  15380. ui_Component32.URL = "ui://isxx5ak7p4tr42f";
  15381. class ui_AwardItem extends fgui.GComponent {
  15382. static createInstance() {
  15383. return (fgui.UIPackage.createObject("game", "AwardItem"));
  15384. }
  15385. onConstruct() {
  15386. this.n9 = (this.getChild("n9"));
  15387. this.myIcon = (this.getChild("myIcon"));
  15388. this.numTxt = (this.getChild("numTxt"));
  15389. this.nameTxt = (this.getChild("nameTxt"));
  15390. this.n16 = (this.getChild("n16"));
  15391. this.n17 = (this.getChild("n17"));
  15392. }
  15393. }
  15394. ui_AwardItem.URL = "ui://isxx5ak7p4tr42h";
  15395. class ui_ranking_com1 extends fgui.GButton {
  15396. static createInstance() {
  15397. return (fgui.UIPackage.createObject("game", "ranking_com1"));
  15398. }
  15399. onConstruct() {
  15400. this.c1 = this.getController("c1");
  15401. this.n49 = (this.getChild("n49"));
  15402. this.n18 = (this.getChild("n18"));
  15403. this.n46 = (this.getChild("n46"));
  15404. this.n48 = (this.getChild("n48"));
  15405. this.n50 = (this.getChild("n50"));
  15406. }
  15407. }
  15408. ui_ranking_com1.URL = "ui://isxx5ak7p7rrv4pr";
  15409. class ui_ranking_com2 extends fgui.GButton {
  15410. static createInstance() {
  15411. return (fgui.UIPackage.createObject("game", "ranking_com2"));
  15412. }
  15413. onConstruct() {
  15414. this.c1 = this.getController("c1");
  15415. this.n49 = (this.getChild("n49"));
  15416. this.n18 = (this.getChild("n18"));
  15417. this.n46 = (this.getChild("n46"));
  15418. this.n48 = (this.getChild("n48"));
  15419. this.n50 = (this.getChild("n50"));
  15420. }
  15421. }
  15422. ui_ranking_com2.URL = "ui://isxx5ak7p7rrv4ps";
  15423. class ui_ranking_com3 extends fgui.GComponent {
  15424. static createInstance() {
  15425. return (fgui.UIPackage.createObject("game", "ranking_com3"));
  15426. }
  15427. onConstruct() {
  15428. this.n17 = (this.getChild("n17"));
  15429. this.myIcon = (this.getChild("myIcon"));
  15430. }
  15431. }
  15432. ui_ranking_com3.URL = "ui://isxx5ak7p7rrv4pw";
  15433. class ui_ranking_com4 extends fgui.GComponent {
  15434. static createInstance() {
  15435. return (fgui.UIPackage.createObject("game", "ranking_com4"));
  15436. }
  15437. onConstruct() {
  15438. this.n16 = (this.getChild("n16"));
  15439. this.head = (this.getChild("head"));
  15440. }
  15441. }
  15442. ui_ranking_com4.URL = "ui://isxx5ak7p7rrv4px";
  15443. class ui_ranking_com5 extends fgui.GComponent {
  15444. static createInstance() {
  15445. return (fgui.UIPackage.createObject("game", "ranking_com5"));
  15446. }
  15447. onConstruct() {
  15448. this.c1 = this.getController("c1");
  15449. this.c2 = this.getController("c2");
  15450. this.n2 = (this.getChild("n2"));
  15451. this.n3 = (this.getChild("n3"));
  15452. this.levelBtn = (this.getChild("levelBtn"));
  15453. this.starBtn = (this.getChild("starBtn"));
  15454. this.n23 = (this.getChild("n23"));
  15455. this.n24 = (this.getChild("n24"));
  15456. this.n25 = (this.getChild("n25"));
  15457. this.myList = (this.getChild("myList"));
  15458. this.selfNode = (this.getChild("selfNode"));
  15459. this.n9 = (this.getChild("n9"));
  15460. this.n12 = (this.getChild("n12"));
  15461. this.n13 = (this.getChild("n13"));
  15462. this.n14 = (this.getChild("n14"));
  15463. this.n39 = (this.getChild("n39"));
  15464. this.n41 = (this.getChild("n41"));
  15465. this.n42 = (this.getChild("n42"));
  15466. this.n45 = (this.getChild("n45"));
  15467. this.changeBtn = (this.getChild("changeBtn"));
  15468. this.closeBtn = (this.getChild("closeBtn"));
  15469. this.t0 = this.getTransition("t0");
  15470. }
  15471. }
  15472. ui_ranking_com5.URL = "ui://isxx5ak7p7rrv4pz";
  15473. class ui_RankItem extends fgui.GComponent {
  15474. static createInstance() {
  15475. return (fgui.UIPackage.createObject("game", "RankItem"));
  15476. }
  15477. onConstruct() {
  15478. this.n10 = (this.getChild("n10"));
  15479. this.n11 = (this.getChild("n11"));
  15480. this.rankTxt = (this.getChild("rankTxt"));
  15481. this.headNode = (this.getChild("headNode"));
  15482. this.nameTxt = (this.getChild("nameTxt"));
  15483. this.n19 = (this.getChild("n19"));
  15484. this.valueTxt = (this.getChild("valueTxt"));
  15485. this.img1 = (this.getChild("img1"));
  15486. this.img2 = (this.getChild("img2"));
  15487. this.img3 = (this.getChild("img3"));
  15488. }
  15489. }
  15490. ui_RankItem.URL = "ui://isxx5ak7p7rrv4q1";
  15491. class ui_ranking_com9 extends fgui.GComponent {
  15492. static createInstance() {
  15493. return (fgui.UIPackage.createObject("game", "ranking_com9"));
  15494. }
  15495. onConstruct() {
  15496. this.c1 = this.getController("c1");
  15497. this.n27 = (this.getChild("n27"));
  15498. this.n28 = (this.getChild("n28"));
  15499. this.headNode = (this.getChild("headNode"));
  15500. this.rankTxt = (this.getChild("rankTxt"));
  15501. this.nameTxt = (this.getChild("nameTxt"));
  15502. this.n34 = (this.getChild("n34"));
  15503. this.valueTxt = (this.getChild("valueTxt"));
  15504. this.n36 = (this.getChild("n36"));
  15505. this.n37 = (this.getChild("n37"));
  15506. this.n38 = (this.getChild("n38"));
  15507. this.n39 = (this.getChild("n39"));
  15508. this.n40 = (this.getChild("n40"));
  15509. }
  15510. }
  15511. ui_ranking_com9.URL = "ui://isxx5ak7p7rrv4q3";
  15512. class ui_ranking_com10 extends fgui.GComponent {
  15513. static createInstance() {
  15514. return (fgui.UIPackage.createObject("game", "ranking_com10"));
  15515. }
  15516. onConstruct() {
  15517. this.n23 = (this.getChild("n23"));
  15518. this.n24 = (this.getChild("n24"));
  15519. }
  15520. }
  15521. ui_ranking_com10.URL = "ui://isxx5ak7p7rrv4q4";
  15522. class ui_ranking_com11 extends fgui.GComponent {
  15523. static createInstance() {
  15524. return (fgui.UIPackage.createObject("game", "ranking_com11"));
  15525. }
  15526. onConstruct() {
  15527. this.n24 = (this.getChild("n24"));
  15528. this.n25 = (this.getChild("n25"));
  15529. this.t0 = this.getTransition("t0");
  15530. }
  15531. }
  15532. ui_ranking_com11.URL = "ui://isxx5ak7p7rrv4q5";
  15533. class ui_ranking_com13 extends fgui.GButton {
  15534. static createInstance() {
  15535. return (fgui.UIPackage.createObject("game", "ranking_com13"));
  15536. }
  15537. onConstruct() {
  15538. this.c1 = this.getController("c1");
  15539. this.n44 = (this.getChild("n44"));
  15540. this.n45 = (this.getChild("n45"));
  15541. this.n46 = (this.getChild("n46"));
  15542. }
  15543. }
  15544. ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
  15545. class ui_Component122 extends fgui.GComponent {
  15546. static createInstance() {
  15547. return (fgui.UIPackage.createObject("game", "Component122"));
  15548. }
  15549. onConstruct() {
  15550. this.gameNode3 = (this.getChild("gameNode3"));
  15551. }
  15552. }
  15553. ui_Component122.URL = "ui://isxx5ak7pf2sv4ic";
  15554. class ui_skillItem extends fgui.GComponent {
  15555. static createInstance() {
  15556. return (fgui.UIPackage.createObject("game", "skillItem"));
  15557. }
  15558. onConstruct() {
  15559. this.c1 = this.getController("c1");
  15560. this.n31 = (this.getChild("n31"));
  15561. this.n6 = (this.getChild("n6"));
  15562. this.skillImg = (this.getChild("skillImg"));
  15563. this.nameTxt = (this.getChild("nameTxt"));
  15564. this.levelTxt = (this.getChild("levelTxt"));
  15565. this.n28 = (this.getChild("n28"));
  15566. this.describeTxt = (this.getChild("describeTxt"));
  15567. this.n32 = (this.getChild("n32"));
  15568. this.mutiBtn = (this.getChild("mutiBtn"));
  15569. this.tryNode = (this.getChild("tryNode"));
  15570. this.normalBtn = (this.getChild("normalBtn"));
  15571. this.startBtn = (this.getChild("startBtn"));
  15572. this.n42 = (this.getChild("n42"));
  15573. this.n43 = (this.getChild("n43"));
  15574. this.n44 = (this.getChild("n44"));
  15575. }
  15576. }
  15577. ui_skillItem.URL = "ui://isxx5ak7qlo041q";
  15578. class ui_Component26 extends fgui.GButton {
  15579. static createInstance() {
  15580. return (fgui.UIPackage.createObject("game", "Component26"));
  15581. }
  15582. onConstruct() {
  15583. this.n11 = (this.getChild("n11"));
  15584. this.n30 = (this.getChild("n30"));
  15585. this.n34 = (this.getChild("n34"));
  15586. }
  15587. }
  15588. ui_Component26.URL = "ui://isxx5ak7qlo041r";
  15589. class ui_Component28 extends fgui.GButton {
  15590. static createInstance() {
  15591. return (fgui.UIPackage.createObject("game", "Component28"));
  15592. }
  15593. onConstruct() {
  15594. this.n12 = (this.getChild("n12"));
  15595. this.n31 = (this.getChild("n31"));
  15596. this.curTxt = (this.getChild("curTxt"));
  15597. this.n33 = (this.getChild("n33"));
  15598. }
  15599. }
  15600. ui_Component28.URL = "ui://isxx5ak7qlo041t";
  15601. class ui_Component1302 extends fgui.GComponent {
  15602. static createInstance() {
  15603. return (fgui.UIPackage.createObject("game", "Component1302"));
  15604. }
  15605. onConstruct() {
  15606. this.n2 = (this.getChild("n2"));
  15607. this.n3 = (this.getChild("n3"));
  15608. }
  15609. }
  15610. ui_Component1302.URL = "ui://isxx5ak7r4l5v577";
  15611. class ui_Component113 extends fgui.GComponent {
  15612. static createInstance() {
  15613. return (fgui.UIPackage.createObject("game", "Component113"));
  15614. }
  15615. onConstruct() {
  15616. this.n85 = (this.getChild("n85"));
  15617. this.n86 = (this.getChild("n86"));
  15618. this.n77 = (this.getChild("n77"));
  15619. this.n79 = (this.getChild("n79"));
  15620. this.n80 = (this.getChild("n80"));
  15621. this.n81 = (this.getChild("n81"));
  15622. this.n82 = (this.getChild("n82"));
  15623. this.n84 = (this.getChild("n84"));
  15624. this.n87 = (this.getChild("n87"));
  15625. this.t0 = this.getTransition("t0");
  15626. }
  15627. }
  15628. ui_Component113.URL = "ui://isxx5ak7r5f8v4hv";
  15629. class ui_Component114 extends fgui.GComponent {
  15630. static createInstance() {
  15631. return (fgui.UIPackage.createObject("game", "Component114"));
  15632. }
  15633. onConstruct() {
  15634. this.n77 = (this.getChild("n77"));
  15635. this.t0 = this.getTransition("t0");
  15636. }
  15637. }
  15638. ui_Component114.URL = "ui://isxx5ak7r5f8v4hw";
  15639. class ui_Component115 extends fgui.GComponent {
  15640. static createInstance() {
  15641. return (fgui.UIPackage.createObject("game", "Component115"));
  15642. }
  15643. onConstruct() {
  15644. this.n83 = (this.getChild("n83"));
  15645. this.fingerNode = (this.getChild("fingerNode"));
  15646. this.n84 = (this.getChild("n84"));
  15647. }
  15648. }
  15649. ui_Component115.URL = "ui://isxx5ak7r5f8v4hx";
  15650. class ui_Component117 extends fgui.GComponent {
  15651. static createInstance() {
  15652. return (fgui.UIPackage.createObject("game", "Component117"));
  15653. }
  15654. onConstruct() {
  15655. this.n87 = (this.getChild("n87"));
  15656. this.n88 = (this.getChild("n88"));
  15657. this.n84 = (this.getChild("n84"));
  15658. this.n85 = (this.getChild("n85"));
  15659. this.n86 = (this.getChild("n86"));
  15660. this.t0 = this.getTransition("t0");
  15661. }
  15662. }
  15663. ui_Component117.URL = "ui://isxx5ak7r5f8v4hz";
  15664. class ui_Component98_1 extends fgui.GButton {
  15665. static createInstance() {
  15666. return (fgui.UIPackage.createObject("game", "Component98_1"));
  15667. }
  15668. onConstruct() {
  15669. this.c1 = this.getController("c1");
  15670. this.n8 = (this.getChild("n8"));
  15671. this.n41 = (this.getChild("n41"));
  15672. this.n40 = (this.getChild("n40"));
  15673. }
  15674. }
  15675. ui_Component98_1.URL = "ui://isxx5ak7s46iv4f0";
  15676. class ui_Component61 extends fgui.GComponent {
  15677. static createInstance() {
  15678. return (fgui.UIPackage.createObject("game", "Component61"));
  15679. }
  15680. onConstruct() {
  15681. this.n14 = (this.getChild("n14"));
  15682. this.n6 = (this.getChild("n6"));
  15683. this.t0 = this.getTransition("t0");
  15684. }
  15685. }
  15686. ui_Component61.URL = "ui://isxx5ak7s8sz44h";
  15687. class ui_Component62 extends fgui.GComponent {
  15688. static createInstance() {
  15689. return (fgui.UIPackage.createObject("game", "Component62"));
  15690. }
  15691. onConstruct() {
  15692. this.n66 = (this.getChild("n66"));
  15693. this.n56 = (this.getChild("n56"));
  15694. this.n63 = (this.getChild("n63"));
  15695. this.n65 = (this.getChild("n65"));
  15696. this.t0 = this.getTransition("t0");
  15697. }
  15698. }
  15699. ui_Component62.URL = "ui://isxx5ak7s8sz44u";
  15700. class ui_d3Root extends fgui.GComponent {
  15701. static createInstance() {
  15702. return (fgui.UIPackage.createObject("game", "d3Root"));
  15703. }
  15704. onConstruct() {
  15705. }
  15706. }
  15707. ui_d3Root.URL = "ui://isxx5ak7sdh33ql";
  15708. class ui_d2Root extends fgui.GComponent {
  15709. static createInstance() {
  15710. return (fgui.UIPackage.createObject("game", "d2Root"));
  15711. }
  15712. onConstruct() {
  15713. }
  15714. }
  15715. ui_d2Root.URL = "ui://isxx5ak7sdh33qm";
  15716. class ui_ballNode extends fgui.GComponent {
  15717. static createInstance() {
  15718. return (fgui.UIPackage.createObject("game", "ballNode"));
  15719. }
  15720. onConstruct() {
  15721. }
  15722. }
  15723. ui_ballNode.URL = "ui://isxx5ak7sdh33qn";
  15724. class ui_border extends fgui.GComponent {
  15725. static createInstance() {
  15726. return (fgui.UIPackage.createObject("game", "border"));
  15727. }
  15728. onConstruct() {
  15729. this.bar1 = (this.getChild("bar1"));
  15730. this.bar2 = (this.getChild("bar2"));
  15731. this.bar3 = (this.getChild("bar3"));
  15732. this.bar4 = (this.getChild("bar4"));
  15733. this.bar5 = (this.getChild("bar5"));
  15734. this.bar6 = (this.getChild("bar6"));
  15735. this.circle1 = (this.getChild("circle1"));
  15736. this.circle2 = (this.getChild("circle2"));
  15737. this.circle3 = (this.getChild("circle3"));
  15738. this.circle4 = (this.getChild("circle4"));
  15739. this.circle5 = (this.getChild("circle5"));
  15740. this.circle6 = (this.getChild("circle6"));
  15741. this.n28 = (this.getChild("n28"));
  15742. }
  15743. }
  15744. ui_border.URL = "ui://isxx5ak7sdh33qq";
  15745. class ui_btn_buy extends fgui.GButton {
  15746. static createInstance() {
  15747. return (fgui.UIPackage.createObject("game", "btn_buy"));
  15748. }
  15749. onConstruct() {
  15750. this.button = this.getController("button");
  15751. this.n0 = (this.getChild("n0"));
  15752. this.n1 = (this.getChild("n1"));
  15753. this.n2 = (this.getChild("n2"));
  15754. }
  15755. }
  15756. ui_btn_buy.URL = "ui://isxx5ak7so7lv596";
  15757. class ui_Component41_2 extends fgui.GComponent {
  15758. static createInstance() {
  15759. return (fgui.UIPackage.createObject("game", "Component41_2"));
  15760. }
  15761. onConstruct() {
  15762. this.c1 = this.getController("c1");
  15763. this.n0 = (this.getChild("n0"));
  15764. this.n2 = (this.getChild("n2"));
  15765. this.n19 = (this.getChild("n19"));
  15766. this.cancelBtn = (this.getChild("cancelBtn"));
  15767. this.videoBtn = (this.getChild("videoBtn"));
  15768. this.n9 = (this.getChild("n9"));
  15769. this.n22 = (this.getChild("n22"));
  15770. this.tipsTxt = (this.getChild("tipsTxt"));
  15771. this.n23 = (this.getChild("n23"));
  15772. this.n24 = (this.getChild("n24"));
  15773. this.n26 = (this.getChild("n26"));
  15774. this.n27 = (this.getChild("n27"));
  15775. this.titleTxt = (this.getChild("titleTxt"));
  15776. }
  15777. }
  15778. ui_Component41_2.URL = "ui://isxx5ak7trk948w";
  15779. class ui_Component41_1 extends fgui.GComponent {
  15780. static createInstance() {
  15781. return (fgui.UIPackage.createObject("game", "Component41_1"));
  15782. }
  15783. onConstruct() {
  15784. this.c1 = this.getController("c1");
  15785. this.n0 = (this.getChild("n0"));
  15786. this.n2 = (this.getChild("n2"));
  15787. this.cancelBtn = (this.getChild("cancelBtn"));
  15788. this.videoBtn = (this.getChild("videoBtn"));
  15789. this.n27 = (this.getChild("n27"));
  15790. this.n30 = (this.getChild("n30"));
  15791. this.n31 = (this.getChild("n31"));
  15792. this.n32 = (this.getChild("n32"));
  15793. this.n33 = (this.getChild("n33"));
  15794. this.n34 = (this.getChild("n34"));
  15795. this.n35 = (this.getChild("n35"));
  15796. this.n36 = (this.getChild("n36"));
  15797. this.n1 = (this.getChild("n1"));
  15798. this.n37 = (this.getChild("n37"));
  15799. this.t0 = this.getTransition("t0");
  15800. this.t1 = this.getTransition("t1");
  15801. this.t2 = this.getTransition("t2");
  15802. this.t3 = this.getTransition("t3");
  15803. }
  15804. }
  15805. ui_Component41_1.URL = "ui://isxx5ak7trk9491";
  15806. class ui_againBtn extends fgui.GButton {
  15807. static createInstance() {
  15808. return (fgui.UIPackage.createObject("game", "againBtn"));
  15809. }
  15810. onConstruct() {
  15811. this.n2 = (this.getChild("n2"));
  15812. this.n1 = (this.getChild("n1"));
  15813. this.n5 = (this.getChild("n5"));
  15814. }
  15815. }
  15816. ui_againBtn.URL = "ui://isxx5ak7u58xv509";
  15817. class ui_Component118 extends fgui.GButton {
  15818. static createInstance() {
  15819. return (fgui.UIPackage.createObject("game", "Component118"));
  15820. }
  15821. onConstruct() {
  15822. this.c1 = this.getController("c1");
  15823. this.n14 = (this.getChild("n14"));
  15824. this.n9 = (this.getChild("n9"));
  15825. this.n10 = (this.getChild("n10"));
  15826. this.diamondTxt = (this.getChild("diamondTxt"));
  15827. this.n13 = (this.getChild("n13"));
  15828. this.n15 = (this.getChild("n15"));
  15829. }
  15830. }
  15831. ui_Component118.URL = "ui://isxx5ak7u8eiv4i2";
  15832. class ui_Component119 extends fgui.GComponent {
  15833. static createInstance() {
  15834. return (fgui.UIPackage.createObject("game", "Component119"));
  15835. }
  15836. onConstruct() {
  15837. this.n1 = (this.getChild("n1"));
  15838. this.n2 = (this.getChild("n2"));
  15839. this.n13 = (this.getChild("n13"));
  15840. this.n6 = (this.getChild("n6"));
  15841. this.screenNode = (this.getChild("screenNode"));
  15842. this.n15 = (this.getChild("n15"));
  15843. this.closeBtn = (this.getChild("closeBtn"));
  15844. this.share2Btn = (this.getChild("share2Btn"));
  15845. this.shareBtn = (this.getChild("shareBtn"));
  15846. this.tipsNode = (this.getChild("tipsNode"));
  15847. this.awardNode = (this.getChild("awardNode"));
  15848. }
  15849. }
  15850. ui_Component119.URL = "ui://isxx5ak7u8eiv4i3";
  15851. class ui_Component_yd1 extends fgui.GComponent {
  15852. static createInstance() {
  15853. return (fgui.UIPackage.createObject("game", "Component_yd1"));
  15854. }
  15855. onConstruct() {
  15856. this.n83 = (this.getChild("n83"));
  15857. this.fingerNode = (this.getChild("fingerNode"));
  15858. this.n84 = (this.getChild("n84"));
  15859. }
  15860. }
  15861. ui_Component_yd1.URL = "ui://isxx5ak7uc2qv5b3";
  15862. class ui_Component_yd2 extends fgui.GComponent {
  15863. static createInstance() {
  15864. return (fgui.UIPackage.createObject("game", "Component_yd2"));
  15865. }
  15866. onConstruct() {
  15867. this.n85 = (this.getChild("n85"));
  15868. this.n86 = (this.getChild("n86"));
  15869. this.n77 = (this.getChild("n77"));
  15870. this.n79 = (this.getChild("n79"));
  15871. this.n80 = (this.getChild("n80"));
  15872. this.n81 = (this.getChild("n81"));
  15873. this.n82 = (this.getChild("n82"));
  15874. this.n84 = (this.getChild("n84"));
  15875. this.n87 = (this.getChild("n87"));
  15876. this.t0 = this.getTransition("t0");
  15877. }
  15878. }
  15879. ui_Component_yd2.URL = "ui://isxx5ak7uc2qv5b5";
  15880. class ui_Component_yd3 extends fgui.GComponent {
  15881. static createInstance() {
  15882. return (fgui.UIPackage.createObject("game", "Component_yd3"));
  15883. }
  15884. onConstruct() {
  15885. this.n87 = (this.getChild("n87"));
  15886. this.n88 = (this.getChild("n88"));
  15887. this.n84 = (this.getChild("n84"));
  15888. this.n85 = (this.getChild("n85"));
  15889. this.n86 = (this.getChild("n86"));
  15890. this.t0 = this.getTransition("t0");
  15891. }
  15892. }
  15893. ui_Component_yd3.URL = "ui://isxx5ak7uc2qv5b6";
  15894. class ui_daoJuDisplay extends fgui.GComponent {
  15895. static createInstance() {
  15896. return (fgui.UIPackage.createObject("game", "daoJuDisplay"));
  15897. }
  15898. onConstruct() {
  15899. this.n6 = (this.getChild("n6"));
  15900. this.n_jiaGe = (this.getChild("n_jiaGe"));
  15901. this.n_zuanShi = (this.getChild("n_zuanShi"));
  15902. this.btn_buy = (this.getChild("btn_buy"));
  15903. this.nameTxt = (this.getChild("nameTxt"));
  15904. this.zsImg = (this.getChild("zsImg"));
  15905. }
  15906. }
  15907. ui_daoJuDisplay.URL = "ui://isxx5ak7uel8v58m";
  15908. class ui_Component132_1 extends fgui.GComponent {
  15909. static createInstance() {
  15910. return (fgui.UIPackage.createObject("game", "Component132_1"));
  15911. }
  15912. onConstruct() {
  15913. this.n25 = (this.getChild("n25"));
  15914. this.n26 = (this.getChild("n26"));
  15915. this.n27 = (this.getChild("n27"));
  15916. this.t0 = this.getTransition("t0");
  15917. }
  15918. }
  15919. ui_Component132_1.URL = "ui://isxx5ak7uih8v568";
  15920. class ui_Component_lc_challenge1 extends fgui.GComponent {
  15921. static createInstance() {
  15922. return (fgui.UIPackage.createObject("game", "Component_lc_challenge1"));
  15923. }
  15924. onConstruct() {
  15925. this.n0 = (this.getChild("n0"));
  15926. this.n1_bai = (this.getChild("n1_bai"));
  15927. }
  15928. }
  15929. ui_Component_lc_challenge1.URL = "ui://isxx5ak7um3xv5as";
  15930. class ui_Component_shou extends fgui.GComponent {
  15931. static createInstance() {
  15932. return (fgui.UIPackage.createObject("game", "Component_shou"));
  15933. }
  15934. onConstruct() {
  15935. this.n57 = (this.getChild("n57"));
  15936. this.n54 = (this.getChild("n54"));
  15937. this.n55 = (this.getChild("n55"));
  15938. this.n56 = (this.getChild("n56"));
  15939. this.t1 = this.getTransition("t1");
  15940. }
  15941. }
  15942. ui_Component_shou.URL = "ui://isxx5ak7um3xv5aw";
  15943. class ui_SecretaryDisplay extends fgui.GComponent {
  15944. static createInstance() {
  15945. return (fgui.UIPackage.createObject("game", "SecretaryDisplay"));
  15946. }
  15947. onConstruct() {
  15948. this.n2 = (this.getChild("n2"));
  15949. this.levelTxt = (this.getChild("levelTxt"));
  15950. this.n4 = (this.getChild("n4"));
  15951. this.secretary = (this.getChild("secretary"));
  15952. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15953. this.n16 = (this.getChild("n16"));
  15954. this.n37 = (this.getChild("n37"));
  15955. this.n41 = (this.getChild("n41"));
  15956. this.n14 = (this.getChild("n14"));
  15957. this.n17 = (this.getChild("n17"));
  15958. this.heightTxt = (this.getChild("heightTxt"));
  15959. this.n46 = (this.getChild("n46"));
  15960. this.n36 = (this.getChild("n36"));
  15961. this.n38 = (this.getChild("n38"));
  15962. this.foodTxt = (this.getChild("foodTxt"));
  15963. this.n47 = (this.getChild("n47"));
  15964. this.n40 = (this.getChild("n40"));
  15965. this.n42 = (this.getChild("n42"));
  15966. this.historyTxt = (this.getChild("historyTxt"));
  15967. this.n48 = (this.getChild("n48"));
  15968. this.nameImg = (this.getChild("nameImg"));
  15969. this.n12 = (this.getChild("n12"));
  15970. this.n49 = (this.getChild("n49"));
  15971. this.t0 = this.getTransition("t0");
  15972. }
  15973. }
  15974. ui_SecretaryDisplay.URL = "ui://isxx5ak7uqohv4lo";
  15975. class ui_BallRodDisplay extends fgui.GComponent {
  15976. static createInstance() {
  15977. return (fgui.UIPackage.createObject("game", "BallRodDisplay"));
  15978. }
  15979. onConstruct() {
  15980. this.c1 = this.getController("c1");
  15981. this.n31 = (this.getChild("n31"));
  15982. this.n6 = (this.getChild("n6"));
  15983. this.nameTxt = (this.getChild("nameTxt"));
  15984. this.rodImg = (this.getChild("rodImg"));
  15985. this.eftRod = (this.getChild("eftRod"));
  15986. this.levelNode = (this.getChild("levelNode"));
  15987. this.purchaseBtn = (this.getChild("purchaseBtn"));
  15988. }
  15989. }
  15990. ui_BallRodDisplay.URL = "ui://isxx5ak7uqohv4lr";
  15991. class ui_Component111_11 extends fgui.GComponent {
  15992. static createInstance() {
  15993. return (fgui.UIPackage.createObject("game", "Component111_11"));
  15994. }
  15995. onConstruct() {
  15996. this.n68 = (this.getChild("n68"));
  15997. this.n69 = (this.getChild("n69"));
  15998. }
  15999. }
  16000. ui_Component111_11.URL = "ui://isxx5ak7vhzhv4hk";
  16001. class ui_Component112 extends fgui.GComponent {
  16002. static createInstance() {
  16003. return (fgui.UIPackage.createObject("game", "Component112"));
  16004. }
  16005. onConstruct() {
  16006. this.n68 = (this.getChild("n68"));
  16007. this.myMask = (this.getChild("myMask"));
  16008. }
  16009. }
  16010. ui_Component112.URL = "ui://isxx5ak7vhzhv4ho";
  16011. class ui_Component111 extends fgui.GComponent {
  16012. static createInstance() {
  16013. return (fgui.UIPackage.createObject("game", "Component111"));
  16014. }
  16015. onConstruct() {
  16016. this.n68 = (this.getChild("n68"));
  16017. this.myMask = (this.getChild("myMask"));
  16018. }
  16019. }
  16020. ui_Component111.URL = "ui://isxx5ak7vhzhv4hq";
  16021. class ui_Component144 extends fgui.GButton {
  16022. static createInstance() {
  16023. return (fgui.UIPackage.createObject("game", "Component144"));
  16024. }
  16025. onConstruct() {
  16026. this.n8 = (this.getChild("n8"));
  16027. }
  16028. }
  16029. ui_Component144.URL = "ui://isxx5ak7vv6av515";
  16030. class ui_Sign_com2 extends fgui.GComponent {
  16031. static createInstance() {
  16032. return (fgui.UIPackage.createObject("game", "Sign_com2"));
  16033. }
  16034. onConstruct() {
  16035. this.n0 = (this.getChild("n0"));
  16036. this.n1 = (this.getChild("n1"));
  16037. this.t0 = this.getTransition("t0");
  16038. }
  16039. }
  16040. ui_Sign_com2.URL = "ui://isxx5ak7wcn5v4k1";
  16041. class ui_Sign_guang extends fgui.GComponent {
  16042. static createInstance() {
  16043. return (fgui.UIPackage.createObject("game", "Sign_guang"));
  16044. }
  16045. onConstruct() {
  16046. this.n1 = (this.getChild("n1"));
  16047. this.n2 = (this.getChild("n2"));
  16048. this.n3 = (this.getChild("n3"));
  16049. this.n4 = (this.getChild("n4"));
  16050. this.n5 = (this.getChild("n5"));
  16051. this.n6 = (this.getChild("n6"));
  16052. this.n8 = (this.getChild("n8"));
  16053. }
  16054. }
  16055. ui_Sign_guang.URL = "ui://isxx5ak7wcn5v4k4";
  16056. class ui_SignMax extends fgui.GComponent {
  16057. static createInstance() {
  16058. return (fgui.UIPackage.createObject("game", "SignMax"));
  16059. }
  16060. onConstruct() {
  16061. this.c1 = this.getController("c1");
  16062. this.n7 = (this.getChild("n7"));
  16063. this.n15 = (this.getChild("n15"));
  16064. this.n8 = (this.getChild("n8"));
  16065. this.titleTxt = (this.getChild("titleTxt"));
  16066. this.myIcon1 = (this.getChild("myIcon1"));
  16067. this.numTxt1 = (this.getChild("numTxt1"));
  16068. this.myIcon2 = (this.getChild("myIcon2"));
  16069. this.n20 = (this.getChild("n20"));
  16070. this.n17 = (this.getChild("n17"));
  16071. this.numTxt2 = (this.getChild("numTxt2"));
  16072. this.n12 = (this.getChild("n12"));
  16073. this.n13 = (this.getChild("n13"));
  16074. this.n21 = (this.getChild("n21"));
  16075. this.n14 = (this.getChild("n14"));
  16076. }
  16077. }
  16078. ui_SignMax.URL = "ui://isxx5ak7wcn5v4k6";
  16079. class ui_Sign_com2_1 extends fgui.GComponent {
  16080. static createInstance() {
  16081. return (fgui.UIPackage.createObject("game", "Sign_com2_1"));
  16082. }
  16083. onConstruct() {
  16084. this.n0 = (this.getChild("n0"));
  16085. this.n1 = (this.getChild("n1"));
  16086. this.t0 = this.getTransition("t0");
  16087. }
  16088. }
  16089. ui_Sign_com2_1.URL = "ui://isxx5ak7wcn5v4k7";
  16090. class ui_Sign_com5 extends fgui.GComponent {
  16091. static createInstance() {
  16092. return (fgui.UIPackage.createObject("game", "Sign_com5"));
  16093. }
  16094. onConstruct() {
  16095. this.n3 = (this.getChild("n3"));
  16096. this.n29 = (this.getChild("n29"));
  16097. this.n4 = (this.getChild("n4"));
  16098. this.day1 = (this.getChild("day1"));
  16099. this.day2 = (this.getChild("day2"));
  16100. this.day3 = (this.getChild("day3"));
  16101. this.day4 = (this.getChild("day4"));
  16102. this.day5 = (this.getChild("day5"));
  16103. this.day6 = (this.getChild("day6"));
  16104. this.day7 = (this.getChild("day7"));
  16105. this.t0 = this.getTransition("t0");
  16106. }
  16107. }
  16108. ui_Sign_com5.URL = "ui://isxx5ak7wcn5v4k9";
  16109. class ui_Sign_com8 extends fgui.GComponent {
  16110. static createInstance() {
  16111. return (fgui.UIPackage.createObject("game", "Sign_com8"));
  16112. }
  16113. onConstruct() {
  16114. this.n48 = (this.getChild("n48"));
  16115. this.womanTxt = (this.getChild("womanTxt"));
  16116. this.t0 = this.getTransition("t0");
  16117. }
  16118. }
  16119. ui_Sign_com8.URL = "ui://isxx5ak7wcn5v4ka";
  16120. class ui_Sign_com6 extends fgui.GComponent {
  16121. static createInstance() {
  16122. return (fgui.UIPackage.createObject("game", "Sign_com6"));
  16123. }
  16124. onConstruct() {
  16125. this.n2 = (this.getChild("n2"));
  16126. this.n3 = (this.getChild("n3"));
  16127. this.t0 = this.getTransition("t0");
  16128. }
  16129. }
  16130. ui_Sign_com6.URL = "ui://isxx5ak7wcn5v4kb";
  16131. class ui_Sign_com7 extends fgui.GComponent {
  16132. static createInstance() {
  16133. return (fgui.UIPackage.createObject("game", "Sign_com7"));
  16134. }
  16135. onConstruct() {
  16136. this.n29 = (this.getChild("n29"));
  16137. this.n2 = (this.getChild("n2"));
  16138. }
  16139. }
  16140. ui_Sign_com7.URL = "ui://isxx5ak7wcn5v4kd";
  16141. class ui_UITurntable_com1_2 extends fgui.GComponent {
  16142. static createInstance() {
  16143. return (fgui.UIPackage.createObject("game", "UITurntable_com1_2"));
  16144. }
  16145. onConstruct() {
  16146. this.n5 = (this.getChild("n5"));
  16147. this.n4 = (this.getChild("n4"));
  16148. this.t0 = this.getTransition("t0");
  16149. }
  16150. }
  16151. ui_UITurntable_com1_2.URL = "ui://isxx5ak7wcn5v4kr";
  16152. class ui_UITurntable_com2 extends fgui.GComponent {
  16153. static createInstance() {
  16154. return (fgui.UIPackage.createObject("game", "UITurntable_com2"));
  16155. }
  16156. onConstruct() {
  16157. this.c1 = this.getController("c1");
  16158. this.n4 = (this.getChild("n4"));
  16159. this.n6 = (this.getChild("n6"));
  16160. this.n10 = (this.getChild("n10"));
  16161. this.n11 = (this.getChild("n11"));
  16162. this.n12 = (this.getChild("n12"));
  16163. this.n13 = (this.getChild("n13"));
  16164. this.n14 = (this.getChild("n14"));
  16165. this.n15 = (this.getChild("n15"));
  16166. this.n16 = (this.getChild("n16"));
  16167. this.n17 = (this.getChild("n17"));
  16168. this.n18 = (this.getChild("n18"));
  16169. this.n19 = (this.getChild("n19"));
  16170. this.n20 = (this.getChild("n20"));
  16171. this.n21 = (this.getChild("n21"));
  16172. this.n22 = (this.getChild("n22"));
  16173. this.n23 = (this.getChild("n23"));
  16174. this.n24 = (this.getChild("n24"));
  16175. this.n25 = (this.getChild("n25"));
  16176. this.n26 = (this.getChild("n26"));
  16177. this.n27 = (this.getChild("n27"));
  16178. this.n28 = (this.getChild("n28"));
  16179. this.n29 = (this.getChild("n29"));
  16180. this.n30 = (this.getChild("n30"));
  16181. this.n31 = (this.getChild("n31"));
  16182. this.n32 = (this.getChild("n32"));
  16183. this.n33 = (this.getChild("n33"));
  16184. }
  16185. }
  16186. ui_UITurntable_com2.URL = "ui://isxx5ak7wcn5v4ks";
  16187. class ui_UITurntable_com1_1 extends fgui.GComponent {
  16188. static createInstance() {
  16189. return (fgui.UIPackage.createObject("game", "UITurntable_com1_1"));
  16190. }
  16191. onConstruct() {
  16192. this.n5 = (this.getChild("n5"));
  16193. this.n4 = (this.getChild("n4"));
  16194. this.t0 = this.getTransition("t0");
  16195. }
  16196. }
  16197. ui_UITurntable_com1_1.URL = "ui://isxx5ak7wcn5v4kt";
  16198. class ui_UITurntable_com5 extends fgui.GComponent {
  16199. static createInstance() {
  16200. return (fgui.UIPackage.createObject("game", "UITurntable_com5"));
  16201. }
  16202. onConstruct() {
  16203. this.flashNode = (this.getChild("flashNode"));
  16204. this.rotNode = (this.getChild("rotNode"));
  16205. this.n3 = (this.getChild("n3"));
  16206. this.n21 = (this.getChild("n21"));
  16207. this.t0 = this.getTransition("t0");
  16208. }
  16209. }
  16210. ui_UITurntable_com5.URL = "ui://isxx5ak7wcn5v4kz";
  16211. class ui_UITurntable_com7 extends fgui.GComponent {
  16212. static createInstance() {
  16213. return (fgui.UIPackage.createObject("game", "UITurntable_com7"));
  16214. }
  16215. onConstruct() {
  16216. this.n2 = (this.getChild("n2"));
  16217. this.n35 = (this.getChild("n35"));
  16218. this.img1 = (this.getChild("img1"));
  16219. this.img2 = (this.getChild("img2"));
  16220. this.img3 = (this.getChild("img3"));
  16221. this.img4 = (this.getChild("img4"));
  16222. this.img6 = (this.getChild("img6"));
  16223. this.img5 = (this.getChild("img5"));
  16224. this.txt1 = (this.getChild("txt1"));
  16225. this.txt2 = (this.getChild("txt2"));
  16226. this.txt3 = (this.getChild("txt3"));
  16227. this.txt4 = (this.getChild("txt4"));
  16228. this.txt5 = (this.getChild("txt5"));
  16229. this.txt6 = (this.getChild("txt6"));
  16230. }
  16231. }
  16232. ui_UITurntable_com7.URL = "ui://isxx5ak7wcn5v4l1";
  16233. class ui_UITurntable_com9 extends fgui.GComponent {
  16234. static createInstance() {
  16235. return (fgui.UIPackage.createObject("game", "UITurntable_com9"));
  16236. }
  16237. onConstruct() {
  16238. this.n38 = (this.getChild("n38"));
  16239. this.n39 = (this.getChild("n39"));
  16240. }
  16241. }
  16242. ui_UITurntable_com9.URL = "ui://isxx5ak7wcn5v4l8";
  16243. class ui_UITurntable_com10 extends fgui.GComponent {
  16244. static createInstance() {
  16245. return (fgui.UIPackage.createObject("game", "UITurntable_com10"));
  16246. }
  16247. onConstruct() {
  16248. this.n39 = (this.getChild("n39"));
  16249. this.n40 = (this.getChild("n40"));
  16250. this.t0 = this.getTransition("t0");
  16251. }
  16252. }
  16253. ui_UITurntable_com10.URL = "ui://isxx5ak7wcn5v4l9";
  16254. class ui_UITurntable_com11 extends fgui.GComponent {
  16255. static createInstance() {
  16256. return (fgui.UIPackage.createObject("game", "UITurntable_com11"));
  16257. }
  16258. onConstruct() {
  16259. this.n38 = (this.getChild("n38"));
  16260. this.n39 = (this.getChild("n39"));
  16261. this.n40 = (this.getChild("n40"));
  16262. this.t0 = this.getTransition("t0");
  16263. }
  16264. }
  16265. ui_UITurntable_com11.URL = "ui://isxx5ak7wcn5v4la";
  16266. class ui_UITurntable_com12 extends fgui.GComponent {
  16267. static createInstance() {
  16268. return (fgui.UIPackage.createObject("game", "UITurntable_com12"));
  16269. }
  16270. onConstruct() {
  16271. this.n43 = (this.getChild("n43"));
  16272. this.barNode = (this.getChild("barNode"));
  16273. this.tipsTxt = (this.getChild("tipsTxt"));
  16274. this.n45 = (this.getChild("n45"));
  16275. this.boxBtn = (this.getChild("boxBtn"));
  16276. }
  16277. }
  16278. ui_UITurntable_com12.URL = "ui://isxx5ak7wcn5v4lb";
  16279. class ui_UITurntable_com1 extends fgui.GButton {
  16280. static createInstance() {
  16281. return (fgui.UIPackage.createObject("game", "UITurntable_com1"));
  16282. }
  16283. onConstruct() {
  16284. this.n41 = (this.getChild("n41"));
  16285. this.n42 = (this.getChild("n42"));
  16286. this.t0 = this.getTransition("t0");
  16287. }
  16288. }
  16289. ui_UITurntable_com1.URL = "ui://isxx5ak7wcn5v4lc";
  16290. class ui_UITurntable_com3 extends fgui.GComponent {
  16291. static createInstance() {
  16292. return (fgui.UIPackage.createObject("game", "UITurntable_com3"));
  16293. }
  16294. onConstruct() {
  16295. this.n48 = (this.getChild("n48"));
  16296. this.womanTxt = (this.getChild("womanTxt"));
  16297. this.t0 = this.getTransition("t0");
  16298. }
  16299. }
  16300. ui_UITurntable_com3.URL = "ui://isxx5ak7wcn5v4ld";
  16301. class ui_cancelBtn2 extends fgui.GButton {
  16302. static createInstance() {
  16303. return (fgui.UIPackage.createObject("game", "cancelBtn2"));
  16304. }
  16305. onConstruct() {
  16306. this.c1 = this.getController("c1");
  16307. this.n0 = (this.getChild("n0"));
  16308. this.n1 = (this.getChild("n1"));
  16309. this.n2 = (this.getChild("n2"));
  16310. this.n3 = (this.getChild("n3"));
  16311. this.n4 = (this.getChild("n4"));
  16312. this.n5 = (this.getChild("n5"));
  16313. this.n6 = (this.getChild("n6"));
  16314. this.n7 = (this.getChild("n7"));
  16315. this.n8 = (this.getChild("n8"));
  16316. this.powerEft = (this.getChild("powerEft"));
  16317. }
  16318. }
  16319. ui_cancelBtn2.URL = "ui://isxx5ak7wehi3ue";
  16320. class ui_shareBtn2 extends fgui.GButton {
  16321. static createInstance() {
  16322. return (fgui.UIPackage.createObject("game", "shareBtn2"));
  16323. }
  16324. onConstruct() {
  16325. this.c1 = this.getController("c1");
  16326. this.n2 = (this.getChild("n2"));
  16327. this.n24 = (this.getChild("n24"));
  16328. this.n1 = (this.getChild("n1"));
  16329. this.n3 = (this.getChild("n3"));
  16330. this.n23 = (this.getChild("n23"));
  16331. this.n4 = (this.getChild("n4"));
  16332. this.n5 = (this.getChild("n5"));
  16333. this.n6 = (this.getChild("n6"));
  16334. this.n20 = (this.getChild("n20"));
  16335. this.n21 = (this.getChild("n21"));
  16336. this.n22 = (this.getChild("n22"));
  16337. this.powerEft = (this.getChild("powerEft"));
  16338. }
  16339. }
  16340. ui_shareBtn2.URL = "ui://isxx5ak7wehi3uf";
  16341. class ui_UIMoney extends fgui.GComponent {
  16342. static createInstance() {
  16343. return (fgui.UIPackage.createObject("game", "UIMoney"));
  16344. }
  16345. onConstruct() {
  16346. this.c1 = this.getController("c1");
  16347. this.n4 = (this.getChild("n4"));
  16348. this.coinImg = (this.getChild("coinImg"));
  16349. this.addCoinBtn = (this.getChild("addCoinBtn"));
  16350. this.coinTxt = (this.getChild("coinTxt"));
  16351. this.n7 = (this.getChild("n7"));
  16352. this.addDiamondBtn = (this.getChild("addDiamondBtn"));
  16353. this.diamondTxt = (this.getChild("diamondTxt"));
  16354. this.diamondImg = (this.getChild("diamondImg"));
  16355. this.n12 = (this.getChild("n12"));
  16356. this.powerImg = (this.getChild("powerImg"));
  16357. this.addPowerBtn = (this.getChild("addPowerBtn"));
  16358. this.powerTxt = (this.getChild("powerTxt"));
  16359. this.powerTimeTxt = (this.getChild("powerTimeTxt"));
  16360. }
  16361. }
  16362. ui_UIMoney.URL = "ui://isxx5ak7wehi3ug";
  16363. class ui_backBtn extends fgui.GButton {
  16364. static createInstance() {
  16365. return (fgui.UIPackage.createObject("game", "backBtn"));
  16366. }
  16367. onConstruct() {
  16368. this.n0 = (this.getChild("n0"));
  16369. this.t0 = this.getTransition("t0");
  16370. this.t1 = this.getTransition("t1");
  16371. }
  16372. }
  16373. ui_backBtn.URL = "ui://isxx5ak7wehi3ul";
  16374. class ui_MoneyBtn extends fgui.GButton {
  16375. static createInstance() {
  16376. return (fgui.UIPackage.createObject("game", "MoneyBtn"));
  16377. }
  16378. onConstruct() {
  16379. this.button = this.getController("button");
  16380. this.n0 = (this.getChild("n0"));
  16381. }
  16382. }
  16383. ui_MoneyBtn.URL = "ui://isxx5ak7wehi3un";
  16384. class ui_UIMoneyBtn extends fgui.GComponent {
  16385. static createInstance() {
  16386. return (fgui.UIPackage.createObject("game", "UIMoneyBtn"));
  16387. }
  16388. onConstruct() {
  16389. this.n1 = (this.getChild("n1"));
  16390. this.closeBtn = (this.getChild("closeBtn"));
  16391. }
  16392. }
  16393. ui_UIMoneyBtn.URL = "ui://isxx5ak7wehi3up";
  16394. class ui_Component64 extends fgui.GComponent {
  16395. static createInstance() {
  16396. return (fgui.UIPackage.createObject("game", "Component64"));
  16397. }
  16398. onConstruct() {
  16399. this.n57 = (this.getChild("n57"));
  16400. this.n54 = (this.getChild("n54"));
  16401. this.n55 = (this.getChild("n55"));
  16402. this.n56 = (this.getChild("n56"));
  16403. this.t1 = this.getTransition("t1");
  16404. }
  16405. }
  16406. ui_Component64.URL = "ui://isxx5ak7wp26456";
  16407. class ui_Component41_3 extends fgui.GComponent {
  16408. static createInstance() {
  16409. return (fgui.UIPackage.createObject("game", "Component41_3"));
  16410. }
  16411. onConstruct() {
  16412. this.c1 = this.getController("c1");
  16413. this.n0 = (this.getChild("n0"));
  16414. this.n2 = (this.getChild("n2"));
  16415. this.cancelBtn = (this.getChild("cancelBtn"));
  16416. this.videoBtn = (this.getChild("videoBtn"));
  16417. this.n9 = (this.getChild("n9"));
  16418. this.n24 = (this.getChild("n24"));
  16419. this.n27 = (this.getChild("n27"));
  16420. this.titleTxt = (this.getChild("titleTxt"));
  16421. this.n28 = (this.getChild("n28"));
  16422. this.t0 = this.getTransition("t0");
  16423. }
  16424. }
  16425. ui_Component41_3.URL = "ui://isxx5ak7wyzsv4o1";
  16426. class ui_dh_zs_4 extends fgui.GComponent {
  16427. static createInstance() {
  16428. return (fgui.UIPackage.createObject("game", "dh_zs_4"));
  16429. }
  16430. onConstruct() {
  16431. this.n1 = (this.getChild("n1"));
  16432. this.n2 = (this.getChild("n2"));
  16433. this.n3 = (this.getChild("n3"));
  16434. this.n4 = (this.getChild("n4"));
  16435. this.n5 = (this.getChild("n5"));
  16436. this.n6 = (this.getChild("n6"));
  16437. this.n8 = (this.getChild("n8"));
  16438. this.t0 = this.getTransition("t0");
  16439. }
  16440. }
  16441. ui_dh_zs_4.URL = "ui://isxx5ak7wyzsv4o2";
  16442. class ui_Component71_1 extends fgui.GButton {
  16443. static createInstance() {
  16444. return (fgui.UIPackage.createObject("game", "Component71_1"));
  16445. }
  16446. onConstruct() {
  16447. this.n17 = (this.getChild("n17"));
  16448. this.t0 = this.getTransition("t0");
  16449. }
  16450. }
  16451. ui_Component71_1.URL = "ui://isxx5ak7xs1r47w";
  16452. class ui_Component83 extends fgui.GComponent {
  16453. static createInstance() {
  16454. return (fgui.UIPackage.createObject("game", "Component83"));
  16455. }
  16456. onConstruct() {
  16457. this.c1 = this.getController("c1");
  16458. this.n17 = (this.getChild("n17"));
  16459. this.n19 = (this.getChild("n19"));
  16460. this.n20 = (this.getChild("n20"));
  16461. }
  16462. }
  16463. ui_Component83.URL = "ui://isxx5ak7xs1r47z";
  16464. class ui_Component84 extends fgui.GComponent {
  16465. static createInstance() {
  16466. return (fgui.UIPackage.createObject("game", "Component84"));
  16467. }
  16468. onConstruct() {
  16469. this.c1 = this.getController("c1");
  16470. this.n4 = (this.getChild("n4"));
  16471. this.n22 = (this.getChild("n22"));
  16472. this.n23 = (this.getChild("n23"));
  16473. this.numTxt = (this.getChild("numTxt"));
  16474. this.n25 = (this.getChild("n25"));
  16475. this.n26 = (this.getChild("n26"));
  16476. }
  16477. }
  16478. ui_Component84.URL = "ui://isxx5ak7xs1r480";
  16479. class ui_Component84_1 extends fgui.GComponent {
  16480. static createInstance() {
  16481. return (fgui.UIPackage.createObject("game", "Component84_1"));
  16482. }
  16483. onConstruct() {
  16484. this.c1 = this.getController("c1");
  16485. this.n4 = (this.getChild("n4"));
  16486. this.n22 = (this.getChild("n22"));
  16487. this.n23 = (this.getChild("n23"));
  16488. this.numTxt = (this.getChild("numTxt"));
  16489. this.n25 = (this.getChild("n25"));
  16490. this.n26 = (this.getChild("n26"));
  16491. }
  16492. }
  16493. ui_Component84_1.URL = "ui://isxx5ak7xs1r481";
  16494. class ui_Component85 extends fgui.GComponent {
  16495. static createInstance() {
  16496. return (fgui.UIPackage.createObject("game", "Component85"));
  16497. }
  16498. onConstruct() {
  16499. this.n1 = (this.getChild("n1"));
  16500. this.n6 = (this.getChild("n6"));
  16501. this.n2 = (this.getChild("n2"));
  16502. this.n3 = (this.getChild("n3"));
  16503. this.levelTxt = (this.getChild("levelTxt"));
  16504. this.n10 = (this.getChild("n10"));
  16505. this.n11 = (this.getChild("n11"));
  16506. this.n12 = (this.getChild("n12"));
  16507. this.n13 = (this.getChild("n13"));
  16508. this.n14 = (this.getChild("n14"));
  16509. this.modeNode = (this.getChild("modeNode"));
  16510. this.n18 = (this.getChild("n18"));
  16511. this.conditionTxt = (this.getChild("conditionTxt"));
  16512. this.diamondNode = (this.getChild("diamondNode"));
  16513. this.coinNode = (this.getChild("coinNode"));
  16514. this.startBtn = (this.getChild("startBtn"));
  16515. this.n28 = (this.getChild("n28"));
  16516. this.displayRoot = (this.getChild("displayRoot"));
  16517. this.n32 = (this.getChild("n32"));
  16518. this.n33 = (this.getChild("n33"));
  16519. this.n_yd_zzq_btn3 = (this.getChild("n_yd_zzq_btn3"));
  16520. this.n_yd_3 = (this.getChild("n_yd_3"));
  16521. this.t0 = this.getTransition("t0");
  16522. }
  16523. }
  16524. ui_Component85.URL = "ui://isxx5ak7xs1r482";
  16525. class ui_Component86 extends fgui.GButton {
  16526. static createInstance() {
  16527. return (fgui.UIPackage.createObject("game", "Component86"));
  16528. }
  16529. onConstruct() {
  16530. this.n15 = (this.getChild("n15"));
  16531. this.t0 = this.getTransition("t0");
  16532. }
  16533. }
  16534. ui_Component86.URL = "ui://isxx5ak7xs1r483";
  16535. class ui_Component87 extends fgui.GComponent {
  16536. static createInstance() {
  16537. return (fgui.UIPackage.createObject("game", "Component87"));
  16538. }
  16539. onConstruct() {
  16540. this.n66 = (this.getChild("n66"));
  16541. this.myProgress = (this.getChild("myProgress"));
  16542. this.starAni = (this.getChild("starAni"));
  16543. this.hpTxt = (this.getChild("hpTxt"));
  16544. this.n74 = (this.getChild("n74"));
  16545. this.n73 = (this.getChild("n73"));
  16546. this.ballTxt = (this.getChild("ballTxt"));
  16547. this.n76 = (this.getChild("n76"));
  16548. this.helpLineBtn = (this.getChild("helpLineBtn"));
  16549. this.levelTxt = (this.getChild("levelTxt"));
  16550. this.star1 = (this.getChild("star1"));
  16551. this.star2 = (this.getChild("star2"));
  16552. this.star3 = (this.getChild("star3"));
  16553. }
  16554. }
  16555. ui_Component87.URL = "ui://isxx5ak7xs1r48m";
  16556. class ui_Component88 extends fgui.GProgressBar {
  16557. static createInstance() {
  16558. return (fgui.UIPackage.createObject("game", "Component88"));
  16559. }
  16560. onConstruct() {
  16561. this.n68 = (this.getChild("n68"));
  16562. this.bar = (this.getChild("bar"));
  16563. }
  16564. }
  16565. ui_Component88.URL = "ui://isxx5ak7xs1r48n";
  16566. class ui_Component89 extends fgui.GComponent {
  16567. static createInstance() {
  16568. return (fgui.UIPackage.createObject("game", "Component89"));
  16569. }
  16570. onConstruct() {
  16571. this.c1 = this.getController("c1");
  16572. this.n71 = (this.getChild("n71"));
  16573. this.n72 = (this.getChild("n72"));
  16574. }
  16575. }
  16576. ui_Component89.URL = "ui://isxx5ak7xs1r48o";
  16577. class ui_Component90 extends fgui.GComponent {
  16578. static createInstance() {
  16579. return (fgui.UIPackage.createObject("game", "Component90"));
  16580. }
  16581. onConstruct() {
  16582. this.c1 = this.getController("c1");
  16583. this.n64 = (this.getChild("n64"));
  16584. this.n65 = (this.getChild("n65"));
  16585. this.n66 = (this.getChild("n66"));
  16586. this.t0 = this.getTransition("t0");
  16587. }
  16588. }
  16589. ui_Component90.URL = "ui://isxx5ak7xs1r48p";
  16590. class ui_Component127 extends fgui.GButton {
  16591. static createInstance() {
  16592. return (fgui.UIPackage.createObject("game", "Component127"));
  16593. }
  16594. onConstruct() {
  16595. this.n5 = (this.getChild("n5"));
  16596. }
  16597. }
  16598. ui_Component127.URL = "ui://isxx5ak7yjr4v4m6";
  16599. class gameBinder {
  16600. static bindAll() {
  16601. fgui.UIObjectFactory.setExtension(ui_ShowItem.URL, ui_ShowItem);
  16602. fgui.UIObjectFactory.setExtension(ui_Component92.URL, ui_Component92);
  16603. fgui.UIObjectFactory.setExtension(ui_Component129.URL, ui_Component129);
  16604. fgui.UIObjectFactory.setExtension(ui_Component130.URL, ui_Component130);
  16605. fgui.UIObjectFactory.setExtension(ui_powerEft.URL, ui_powerEft);
  16606. fgui.UIObjectFactory.setExtension(ui_UILevelDisplay.URL, ui_UILevelDisplay);
  16607. fgui.UIObjectFactory.setExtension(ui_PutBallLevelDisplay.URL, ui_PutBallLevelDisplay);
  16608. fgui.UIObjectFactory.setExtension(ui_Component79.URL, ui_Component79);
  16609. fgui.UIObjectFactory.setExtension(ui_Component80.URL, ui_Component80);
  16610. fgui.UIObjectFactory.setExtension(ui_UISign.URL, ui_UISign);
  16611. fgui.UIObjectFactory.setExtension(ui_SignNormal.URL, ui_SignNormal);
  16612. fgui.UIObjectFactory.setExtension(ui_UILogin.URL, ui_UILogin);
  16613. fgui.UIObjectFactory.setExtension(ui_UIReg.URL, ui_UIReg);
  16614. fgui.UIObjectFactory.setExtension(ui_Button_reg.URL, ui_Button_reg);
  16615. fgui.UIObjectFactory.setExtension(ui_screenNode.URL, ui_screenNode);
  16616. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com1.URL, ui_GetAwrad_com1);
  16617. fgui.UIObjectFactory.setExtension(ui_GetAwrad_com2.URL, ui_GetAwrad_com2);
  16618. fgui.UIObjectFactory.setExtension(ui_Component128.URL, ui_Component128);
  16619. fgui.UIObjectFactory.setExtension(ui_Component100_1.URL, ui_Component100_1);
  16620. fgui.UIObjectFactory.setExtension(ui_Component142.URL, ui_Component142);
  16621. fgui.UIObjectFactory.setExtension(ui_main_guang.URL, ui_main_guang);
  16622. fgui.UIObjectFactory.setExtension(ui_UITry.URL, ui_UITry);
  16623. fgui.UIObjectFactory.setExtension(ui_try_com1.URL, ui_try_com1);
  16624. fgui.UIObjectFactory.setExtension(ui_try_com2.URL, ui_try_com2);
  16625. fgui.UIObjectFactory.setExtension(ui_try_com3.URL, ui_try_com3);
  16626. fgui.UIObjectFactory.setExtension(ui_huihe1.URL, ui_huihe1);
  16627. fgui.UIObjectFactory.setExtension(ui_huihe2.URL, ui_huihe2);
  16628. fgui.UIObjectFactory.setExtension(ui_UIGuanYu.URL, ui_UIGuanYu);
  16629. fgui.UIObjectFactory.setExtension(ui_Component143.URL, ui_Component143);
  16630. fgui.UIObjectFactory.setExtension(ui_Component1_debug_pay_ok.URL, ui_Component1_debug_pay_ok);
  16631. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2.URL, ui_dh_jingbi2);
  16632. fgui.UIObjectFactory.setExtension(ui_dh_jingbi2_1.URL, ui_dh_jingbi2_1);
  16633. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3.URL, ui_dh_jingbi3);
  16634. fgui.UIObjectFactory.setExtension(ui_dh_jingbi3_1.URL, ui_dh_jingbi3_1);
  16635. fgui.UIObjectFactory.setExtension(ui_hb_jinbi1.URL, ui_hb_jinbi1);
  16636. fgui.UIObjectFactory.setExtension(ui_hb_jinbi2.URL, ui_hb_jinbi2);
  16637. fgui.UIObjectFactory.setExtension(ui_hb_jinbi3.URL, ui_hb_jinbi3);
  16638. fgui.UIObjectFactory.setExtension(ui_Component104.URL, ui_Component104);
  16639. fgui.UIObjectFactory.setExtension(ui_Component105.URL, ui_Component105);
  16640. fgui.UIObjectFactory.setExtension(ui_Component106.URL, ui_Component106);
  16641. fgui.UIObjectFactory.setExtension(ui_hb_zs1.URL, ui_hb_zs1);
  16642. fgui.UIObjectFactory.setExtension(ui_dh_zs1.URL, ui_dh_zs1);
  16643. fgui.UIObjectFactory.setExtension(ui_dh_zs1_1.URL, ui_dh_zs1_1);
  16644. fgui.UIObjectFactory.setExtension(ui_hb_zs2.URL, ui_hb_zs2);
  16645. fgui.UIObjectFactory.setExtension(ui_hb_zs3.URL, ui_hb_zs3);
  16646. fgui.UIObjectFactory.setExtension(ui_dh_zs2.URL, ui_dh_zs2);
  16647. fgui.UIObjectFactory.setExtension(ui_dh_zs2_1.URL, ui_dh_zs2_1);
  16648. fgui.UIObjectFactory.setExtension(ui_dh_zs3.URL, ui_dh_zs3);
  16649. fgui.UIObjectFactory.setExtension(ui_dh_zs3_1.URL, ui_dh_zs3_1);
  16650. fgui.UIObjectFactory.setExtension(ui_Component107.URL, ui_Component107);
  16651. fgui.UIObjectFactory.setExtension(ui_box_com1.URL, ui_box_com1);
  16652. fgui.UIObjectFactory.setExtension(ui_UIBox.URL, ui_UIBox);
  16653. fgui.UIObjectFactory.setExtension(ui_box_com2.URL, ui_box_com2);
  16654. fgui.UIObjectFactory.setExtension(ui_box_com4.URL, ui_box_com4);
  16655. fgui.UIObjectFactory.setExtension(ui_box_com3.URL, ui_box_com3);
  16656. fgui.UIObjectFactory.setExtension(ui_Component97.URL, ui_Component97);
  16657. fgui.UIObjectFactory.setExtension(ui_Component98.URL, ui_Component98);
  16658. fgui.UIObjectFactory.setExtension(ui_Component28_11.URL, ui_Component28_11);
  16659. fgui.UIObjectFactory.setExtension(ui_Component58_11.URL, ui_Component58_11);
  16660. fgui.UIObjectFactory.setExtension(ui_UIShop.URL, ui_UIShop);
  16661. fgui.UIObjectFactory.setExtension(ui_Component100.URL, ui_Component100);
  16662. fgui.UIObjectFactory.setExtension(ui_Component101.URL, ui_Component101);
  16663. fgui.UIObjectFactory.setExtension(ui_Component53.URL, ui_Component53);
  16664. fgui.UIObjectFactory.setExtension(ui_Component58.URL, ui_Component58);
  16665. fgui.UIObjectFactory.setExtension(ui_Component59.URL, ui_Component59);
  16666. fgui.UIObjectFactory.setExtension(ui_Component_lc2.URL, ui_Component_lc2);
  16667. fgui.UIObjectFactory.setExtension(ui_Component_shou2.URL, ui_Component_shou2);
  16668. fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
  16669. fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
  16670. fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
  16671. fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
  16672. fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
  16673. fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
  16674. fgui.UIObjectFactory.setExtension(ui_aiProgress.URL, ui_aiProgress);
  16675. fgui.UIObjectFactory.setExtension(ui_ballDisplay.URL, ui_ballDisplay);
  16676. fgui.UIObjectFactory.setExtension(ui_moveNode.URL, ui_moveNode);
  16677. fgui.UIObjectFactory.setExtension(ui_UIVideoShare.URL, ui_UIVideoShare);
  16678. fgui.UIObjectFactory.setExtension(ui_cancelBtn.URL, ui_cancelBtn);
  16679. fgui.UIObjectFactory.setExtension(ui_shareBtn.URL, ui_shareBtn);
  16680. fgui.UIObjectFactory.setExtension(ui_share2Btn.URL, ui_share2Btn);
  16681. fgui.UIObjectFactory.setExtension(ui_UIRodMethod.URL, ui_UIRodMethod);
  16682. fgui.UIObjectFactory.setExtension(ui_rodMethodNode.URL, ui_rodMethodNode);
  16683. fgui.UIObjectFactory.setExtension(ui_sureBtn.URL, ui_sureBtn);
  16684. fgui.UIObjectFactory.setExtension(ui_UIGameEnd.URL, ui_UIGameEnd);
  16685. fgui.UIObjectFactory.setExtension(ui_Component18.URL, ui_Component18);
  16686. fgui.UIObjectFactory.setExtension(ui_Component45.URL, ui_Component45);
  16687. fgui.UIObjectFactory.setExtension(ui_emotionDisplay.URL, ui_emotionDisplay);
  16688. fgui.UIObjectFactory.setExtension(ui_UIWordsList.URL, ui_UIWordsList);
  16689. fgui.UIObjectFactory.setExtension(ui_Component49.URL, ui_Component49);
  16690. fgui.UIObjectFactory.setExtension(ui_Component50.URL, ui_Component50);
  16691. fgui.UIObjectFactory.setExtension(ui_Component51.URL, ui_Component51);
  16692. fgui.UIObjectFactory.setExtension(ui_Button5.URL, ui_Button5);
  16693. fgui.UIObjectFactory.setExtension(ui_Component124.URL, ui_Component124);
  16694. fgui.UIObjectFactory.setExtension(ui_Component125.URL, ui_Component125);
  16695. fgui.UIObjectFactory.setExtension(ui_Component52.URL, ui_Component52);
  16696. fgui.UIObjectFactory.setExtension(ui_Component_denglu.URL, ui_Component_denglu);
  16697. fgui.UIObjectFactory.setExtension(ui_UIFuli1.URL, ui_UIFuli1);
  16698. fgui.UIObjectFactory.setExtension(ui_Component_fl_1.URL, ui_Component_fl_1);
  16699. fgui.UIObjectFactory.setExtension(ui_Component_fl_2.URL, ui_Component_fl_2);
  16700. fgui.UIObjectFactory.setExtension(ui_UIFuli2.URL, ui_UIFuli2);
  16701. fgui.UIObjectFactory.setExtension(ui_drawBtn.URL, ui_drawBtn);
  16702. fgui.UIObjectFactory.setExtension(ui_Component43.URL, ui_Component43);
  16703. fgui.UIObjectFactory.setExtension(ui_wordsDisplay.URL, ui_wordsDisplay);
  16704. fgui.UIObjectFactory.setExtension(ui_Component_phb.URL, ui_Component_phb);
  16705. fgui.UIObjectFactory.setExtension(ui_Component3.URL, ui_Component3);
  16706. fgui.UIObjectFactory.setExtension(ui_Component4.URL, ui_Component4);
  16707. fgui.UIObjectFactory.setExtension(ui_Component7.URL, ui_Component7);
  16708. fgui.UIObjectFactory.setExtension(ui_Component8.URL, ui_Component8);
  16709. fgui.UIObjectFactory.setExtension(ui_Component10.URL, ui_Component10);
  16710. fgui.UIObjectFactory.setExtension(ui_Component11.URL, ui_Component11);
  16711. fgui.UIObjectFactory.setExtension(ui_Component12.URL, ui_Component12);
  16712. fgui.UIObjectFactory.setExtension(ui_Component13.URL, ui_Component13);
  16713. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei.URL, ui_dh_js_tuowei);
  16714. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g.URL, ui_dh_js_tw_g);
  16715. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing.URL, ui_dh_js_xingxing);
  16716. fgui.UIObjectFactory.setExtension(ui_dh_zy_jiazai.URL, ui_dh_zy_jiazai);
  16717. fgui.UIObjectFactory.setExtension(ui_dh_js_xingxing2.URL, ui_dh_js_xingxing2);
  16718. fgui.UIObjectFactory.setExtension(ui_dh_js_tuowei2.URL, ui_dh_js_tuowei2);
  16719. fgui.UIObjectFactory.setExtension(ui_dh_js_tw_g_1.URL, ui_dh_js_tw_g_1);
  16720. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai_1.URL, ui_dh_js_shibai_1);
  16721. fgui.UIObjectFactory.setExtension(ui_UISkill.URL, ui_UISkill);
  16722. fgui.UIObjectFactory.setExtension(ui_special.URL, ui_special);
  16723. fgui.UIObjectFactory.setExtension(ui_Component145.URL, ui_Component145);
  16724. fgui.UIObjectFactory.setExtension(ui_guanyuAni.URL, ui_guanyuAni);
  16725. fgui.UIObjectFactory.setExtension(ui_longBtn.URL, ui_longBtn);
  16726. fgui.UIObjectFactory.setExtension(ui_Component146.URL, ui_Component146);
  16727. fgui.UIObjectFactory.setExtension(ui_Component146_11.URL, ui_Component146_11);
  16728. fgui.UIObjectFactory.setExtension(ui_Component111_1.URL, ui_Component111_1);
  16729. fgui.UIObjectFactory.setExtension(ui_Component64_1.URL, ui_Component64_1);
  16730. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com123.URL, ui_ModeSelection_com123);
  16731. fgui.UIObjectFactory.setExtension(ui_Component132_2.URL, ui_Component132_2);
  16732. fgui.UIObjectFactory.setExtension(ui_UIPower$1.URL, ui_UIPower$1);
  16733. fgui.UIObjectFactory.setExtension(ui_Component133.URL, ui_Component133);
  16734. fgui.UIObjectFactory.setExtension(ui_Component134.URL, ui_Component134);
  16735. fgui.UIObjectFactory.setExtension(ui_Component135.URL, ui_Component135);
  16736. fgui.UIObjectFactory.setExtension(ui_Component137.URL, ui_Component137);
  16737. fgui.UIObjectFactory.setExtension(ui_dh_zuanshi.URL, ui_dh_zuanshi);
  16738. fgui.UIObjectFactory.setExtension(ui_Component138.URL, ui_Component138);
  16739. fgui.UIObjectFactory.setExtension(ui_Component139.URL, ui_Component139);
  16740. fgui.UIObjectFactory.setExtension(ui_Component140.URL, ui_Component140);
  16741. fgui.UIObjectFactory.setExtension(ui_Component141.URL, ui_Component141);
  16742. fgui.UIObjectFactory.setExtension(ui_UIMain.URL, ui_UIMain);
  16743. fgui.UIObjectFactory.setExtension(ui_UIGame.URL, ui_UIGame);
  16744. fgui.UIObjectFactory.setExtension(ui_powerNode.URL, ui_powerNode);
  16745. fgui.UIObjectFactory.setExtension(ui_D2Ball.URL, ui_D2Ball);
  16746. fgui.UIObjectFactory.setExtension(ui_dh_jingbi1.URL, ui_dh_jingbi1);
  16747. fgui.UIObjectFactory.setExtension(ui_Component94.URL, ui_Component94);
  16748. fgui.UIObjectFactory.setExtension(ui_Component95.URL, ui_Component95);
  16749. fgui.UIObjectFactory.setExtension(ui_Component126.URL, ui_Component126);
  16750. fgui.UIObjectFactory.setExtension(ui_UIFlyEft.URL, ui_UIFlyEft);
  16751. fgui.UIObjectFactory.setExtension(ui_Component60.URL, ui_Component60);
  16752. fgui.UIObjectFactory.setExtension(ui_Button_h.URL, ui_Button_h);
  16753. fgui.UIObjectFactory.setExtension(ui_Button_lv.URL, ui_Button_lv);
  16754. fgui.UIObjectFactory.setExtension(ui_Component98_3.URL, ui_Component98_3);
  16755. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com1.URL, ui_ModeSelection_com1);
  16756. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com2.URL, ui_ModeSelection_com2);
  16757. fgui.UIObjectFactory.setExtension(ui_ModeSelection_com3.URL, ui_ModeSelection_com3);
  16758. fgui.UIObjectFactory.setExtension(ui_UIInvitation.URL, ui_UIInvitation);
  16759. fgui.UIObjectFactory.setExtension(ui_Invitation_com1.URL, ui_Invitation_com1);
  16760. fgui.UIObjectFactory.setExtension(ui_Component87_1.URL, ui_Component87_1);
  16761. fgui.UIObjectFactory.setExtension(ui_Component_lc3.URL, ui_Component_lc3);
  16762. fgui.UIObjectFactory.setExtension(ui_Component_shou3.URL, ui_Component_shou3);
  16763. fgui.UIObjectFactory.setExtension(ui_sqg1.URL, ui_sqg1);
  16764. fgui.UIObjectFactory.setExtension(ui_sqg2.URL, ui_sqg2);
  16765. fgui.UIObjectFactory.setExtension(ui_sqg3.URL, ui_sqg3);
  16766. fgui.UIObjectFactory.setExtension(ui_sqg4.URL, ui_sqg4);
  16767. fgui.UIObjectFactory.setExtension(ui_Component36.URL, ui_Component36);
  16768. fgui.UIObjectFactory.setExtension(ui_Component37.URL, ui_Component37);
  16769. fgui.UIObjectFactory.setExtension(ui_UISetting.URL, ui_UISetting);
  16770. fgui.UIObjectFactory.setExtension(ui_Component39.URL, ui_Component39);
  16771. fgui.UIObjectFactory.setExtension(ui_Component40.URL, ui_Component40);
  16772. fgui.UIObjectFactory.setExtension(ui_UITips.URL, ui_UITips);
  16773. fgui.UIObjectFactory.setExtension(ui_Component41.URL, ui_Component41);
  16774. fgui.UIObjectFactory.setExtension(ui_Component42.URL, ui_Component42);
  16775. fgui.UIObjectFactory.setExtension(ui_UIMatching.URL, ui_UIMatching);
  16776. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli.URL, ui_dh_js_shengli);
  16777. fgui.UIObjectFactory.setExtension(ui_dh_js_shengli_g.URL, ui_dh_js_shengli_g);
  16778. fgui.UIObjectFactory.setExtension(ui_dh_js_shibai.URL, ui_dh_js_shibai);
  16779. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa.URL, ui_dh_zy_ganfa);
  16780. fgui.UIObjectFactory.setExtension(ui_dh_zy_sc_guang.URL, ui_dh_zy_sc_guang);
  16781. fgui.UIObjectFactory.setExtension(ui_dh_zy_shangcheng.URL, ui_dh_zy_shangcheng);
  16782. fgui.UIObjectFactory.setExtension(ui_dh_zy_wanfa.URL, ui_dh_zy_wanfa);
  16783. fgui.UIObjectFactory.setExtension(ui_Button_login.URL, ui_Button_login);
  16784. fgui.UIObjectFactory.setExtension(ui_Component53_1.URL, ui_Component53_1);
  16785. fgui.UIObjectFactory.setExtension(ui_Component30.URL, ui_Component30);
  16786. fgui.UIObjectFactory.setExtension(ui_Component30_1.URL, ui_Component30_1);
  16787. fgui.UIObjectFactory.setExtension(ui_Component31.URL, ui_Component31);
  16788. fgui.UIObjectFactory.setExtension(ui_UIGetAward.URL, ui_UIGetAward);
  16789. fgui.UIObjectFactory.setExtension(ui_Component32.URL, ui_Component32);
  16790. fgui.UIObjectFactory.setExtension(ui_AwardItem.URL, ui_AwardItem);
  16791. fgui.UIObjectFactory.setExtension(ui_UIAddProp.URL, ui_UIAddProp);
  16792. fgui.UIObjectFactory.setExtension(ui_UIRanking.URL, ui_UIRanking);
  16793. fgui.UIObjectFactory.setExtension(ui_ranking_com1.URL, ui_ranking_com1);
  16794. fgui.UIObjectFactory.setExtension(ui_ranking_com2.URL, ui_ranking_com2);
  16795. fgui.UIObjectFactory.setExtension(ui_ranking_com3.URL, ui_ranking_com3);
  16796. fgui.UIObjectFactory.setExtension(ui_ranking_com4.URL, ui_ranking_com4);
  16797. fgui.UIObjectFactory.setExtension(ui_ranking_com5.URL, ui_ranking_com5);
  16798. fgui.UIObjectFactory.setExtension(ui_RankItem.URL, ui_RankItem);
  16799. fgui.UIObjectFactory.setExtension(ui_ranking_com9.URL, ui_ranking_com9);
  16800. fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
  16801. fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
  16802. fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
  16803. fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
  16804. fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
  16805. fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
  16806. fgui.UIObjectFactory.setExtension(ui_Component28.URL, ui_Component28);
  16807. fgui.UIObjectFactory.setExtension(ui_Component1302.URL, ui_Component1302);
  16808. fgui.UIObjectFactory.setExtension(ui_Component113.URL, ui_Component113);
  16809. fgui.UIObjectFactory.setExtension(ui_Component114.URL, ui_Component114);
  16810. fgui.UIObjectFactory.setExtension(ui_Component115.URL, ui_Component115);
  16811. fgui.UIObjectFactory.setExtension(ui_Component117.URL, ui_Component117);
  16812. fgui.UIObjectFactory.setExtension(ui_UIModeSelection.URL, ui_UIModeSelection);
  16813. fgui.UIObjectFactory.setExtension(ui_Component98_1.URL, ui_Component98_1);
  16814. fgui.UIObjectFactory.setExtension(ui_UISecretary.URL, ui_UISecretary);
  16815. fgui.UIObjectFactory.setExtension(ui_Component61.URL, ui_Component61);
  16816. fgui.UIObjectFactory.setExtension(ui_Component62.URL, ui_Component62);
  16817. fgui.UIObjectFactory.setExtension(ui_d3Root.URL, ui_d3Root);
  16818. fgui.UIObjectFactory.setExtension(ui_d2Root.URL, ui_d2Root);
  16819. fgui.UIObjectFactory.setExtension(ui_ballNode.URL, ui_ballNode);
  16820. fgui.UIObjectFactory.setExtension(ui_D2Gan.URL, ui_D2Gan);
  16821. fgui.UIObjectFactory.setExtension(ui_border.URL, ui_border);
  16822. fgui.UIObjectFactory.setExtension(ui_HelpLine.URL, ui_HelpLine);
  16823. fgui.UIObjectFactory.setExtension(ui_btn_buy.URL, ui_btn_buy);
  16824. fgui.UIObjectFactory.setExtension(ui_UIRepentProp.URL, ui_UIRepentProp);
  16825. fgui.UIObjectFactory.setExtension(ui_Component41_2.URL, ui_Component41_2);
  16826. fgui.UIObjectFactory.setExtension(ui_Component41_1.URL, ui_Component41_1);
  16827. fgui.UIObjectFactory.setExtension(ui_againBtn.URL, ui_againBtn);
  16828. fgui.UIObjectFactory.setExtension(ui_Component118.URL, ui_Component118);
  16829. fgui.UIObjectFactory.setExtension(ui_Component119.URL, ui_Component119);
  16830. fgui.UIObjectFactory.setExtension(ui_Component_yd1.URL, ui_Component_yd1);
  16831. fgui.UIObjectFactory.setExtension(ui_Component_yd2.URL, ui_Component_yd2);
  16832. fgui.UIObjectFactory.setExtension(ui_Component_yd3.URL, ui_Component_yd3);
  16833. fgui.UIObjectFactory.setExtension(ui_daoJuDisplay.URL, ui_daoJuDisplay);
  16834. fgui.UIObjectFactory.setExtension(ui_Component132_1.URL, ui_Component132_1);
  16835. fgui.UIObjectFactory.setExtension(ui_Component_lc_challenge1.URL, ui_Component_lc_challenge1);
  16836. fgui.UIObjectFactory.setExtension(ui_Component_shou.URL, ui_Component_shou);
  16837. fgui.UIObjectFactory.setExtension(ui_SecretaryDisplay.URL, ui_SecretaryDisplay);
  16838. fgui.UIObjectFactory.setExtension(ui_BallRodDisplay.URL, ui_BallRodDisplay);
  16839. fgui.UIObjectFactory.setExtension(ui_UIAddCoin.URL, ui_UIAddCoin);
  16840. fgui.UIObjectFactory.setExtension(ui_Component111_11.URL, ui_Component111_11);
  16841. fgui.UIObjectFactory.setExtension(ui_Component112.URL, ui_Component112);
  16842. fgui.UIObjectFactory.setExtension(ui_Component111.URL, ui_Component111);
  16843. fgui.UIObjectFactory.setExtension(ui_Component144.URL, ui_Component144);
  16844. fgui.UIObjectFactory.setExtension(ui_Sign_com2.URL, ui_Sign_com2);
  16845. fgui.UIObjectFactory.setExtension(ui_Sign_guang.URL, ui_Sign_guang);
  16846. fgui.UIObjectFactory.setExtension(ui_SignMax.URL, ui_SignMax);
  16847. fgui.UIObjectFactory.setExtension(ui_Sign_com2_1.URL, ui_Sign_com2_1);
  16848. fgui.UIObjectFactory.setExtension(ui_Sign_com5.URL, ui_Sign_com5);
  16849. fgui.UIObjectFactory.setExtension(ui_Sign_com8.URL, ui_Sign_com8);
  16850. fgui.UIObjectFactory.setExtension(ui_Sign_com6.URL, ui_Sign_com6);
  16851. fgui.UIObjectFactory.setExtension(ui_Sign_com7.URL, ui_Sign_com7);
  16852. fgui.UIObjectFactory.setExtension(ui_UIDraw.URL, ui_UIDraw);
  16853. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_2.URL, ui_UITurntable_com1_2);
  16854. fgui.UIObjectFactory.setExtension(ui_UITurntable_com2.URL, ui_UITurntable_com2);
  16855. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1_1.URL, ui_UITurntable_com1_1);
  16856. fgui.UIObjectFactory.setExtension(ui_UITurntable_com5.URL, ui_UITurntable_com5);
  16857. fgui.UIObjectFactory.setExtension(ui_UITurntable_com7.URL, ui_UITurntable_com7);
  16858. fgui.UIObjectFactory.setExtension(ui_UITurntable_com9.URL, ui_UITurntable_com9);
  16859. fgui.UIObjectFactory.setExtension(ui_UITurntable_com10.URL, ui_UITurntable_com10);
  16860. fgui.UIObjectFactory.setExtension(ui_UITurntable_com11.URL, ui_UITurntable_com11);
  16861. fgui.UIObjectFactory.setExtension(ui_UITurntable_com12.URL, ui_UITurntable_com12);
  16862. fgui.UIObjectFactory.setExtension(ui_UITurntable_com1.URL, ui_UITurntable_com1);
  16863. fgui.UIObjectFactory.setExtension(ui_UITurntable_com3.URL, ui_UITurntable_com3);
  16864. fgui.UIObjectFactory.setExtension(ui_cancelBtn2.URL, ui_cancelBtn2);
  16865. fgui.UIObjectFactory.setExtension(ui_shareBtn2.URL, ui_shareBtn2);
  16866. fgui.UIObjectFactory.setExtension(ui_UIMoney.URL, ui_UIMoney);
  16867. fgui.UIObjectFactory.setExtension(ui_backBtn.URL, ui_backBtn);
  16868. fgui.UIObjectFactory.setExtension(ui_MoneyBtn.URL, ui_MoneyBtn);
  16869. fgui.UIObjectFactory.setExtension(ui_UIMoneyBtn.URL, ui_UIMoneyBtn);
  16870. fgui.UIObjectFactory.setExtension(ui_Component64.URL, ui_Component64);
  16871. fgui.UIObjectFactory.setExtension(ui_Component41_3.URL, ui_Component41_3);
  16872. fgui.UIObjectFactory.setExtension(ui_dh_zs_4.URL, ui_dh_zs_4);
  16873. fgui.UIObjectFactory.setExtension(ui_UILevelProp.URL, ui_UILevelProp);
  16874. fgui.UIObjectFactory.setExtension(ui_Component71_1.URL, ui_Component71_1);
  16875. fgui.UIObjectFactory.setExtension(ui_Component83.URL, ui_Component83);
  16876. fgui.UIObjectFactory.setExtension(ui_Component84.URL, ui_Component84);
  16877. fgui.UIObjectFactory.setExtension(ui_Component84_1.URL, ui_Component84_1);
  16878. fgui.UIObjectFactory.setExtension(ui_Component85.URL, ui_Component85);
  16879. fgui.UIObjectFactory.setExtension(ui_Component86.URL, ui_Component86);
  16880. fgui.UIObjectFactory.setExtension(ui_Component87.URL, ui_Component87);
  16881. fgui.UIObjectFactory.setExtension(ui_Component88.URL, ui_Component88);
  16882. fgui.UIObjectFactory.setExtension(ui_Component89.URL, ui_Component89);
  16883. fgui.UIObjectFactory.setExtension(ui_Component90.URL, ui_Component90);
  16884. fgui.UIObjectFactory.setExtension(ui_Component127.URL, ui_Component127);
  16885. }
  16886. }
  16887. class ui_btn6 extends fgui.GButton {
  16888. static createInstance() {
  16889. return (fgui.UIPackage.createObject("loading", "btn6"));
  16890. }
  16891. onConstruct() {
  16892. this.n6 = (this.getChild("n6"));
  16893. this.n1 = (this.getChild("n1"));
  16894. }
  16895. }
  16896. ui_btn6.URL = "ui://37nctnhwc6l6v4em";
  16897. class ui_xyItem extends fgui.GComponent {
  16898. static createInstance() {
  16899. return (fgui.UIPackage.createObject("loading", "xyItem"));
  16900. }
  16901. onConstruct() {
  16902. this.xyItem = (this.getChild("xyItem"));
  16903. }
  16904. }
  16905. ui_xyItem.URL = "ui://37nctnhwcpayv4el";
  16906. class ui_loadinfo extends fgui.GProgressBar {
  16907. static createInstance() {
  16908. return (fgui.UIPackage.createObject("loading", "loadinfo"));
  16909. }
  16910. onConstruct() {
  16911. this.bg = (this.getChild("bg"));
  16912. this.bar = (this.getChild("bar"));
  16913. this.title = (this.getChild("title"));
  16914. this.ani = (this.getChild("ani"));
  16915. }
  16916. }
  16917. ui_loadinfo.URL = "ui://37nctnhwis36c";
  16918. class ui_xyNode extends fgui.GComponent {
  16919. static createInstance() {
  16920. return (fgui.UIPackage.createObject("loading", "xyNode"));
  16921. }
  16922. onConstruct() {
  16923. this.n0 = (this.getChild("n0"));
  16924. this.btnYes = (this.getChild("btnYes"));
  16925. this.btnNo = (this.getChild("btnNo"));
  16926. this.btnKnown = (this.getChild("btnKnown"));
  16927. this.btnSure = (this.getChild("btnSure"));
  16928. this.txtWelcom = (this.getChild("txtWelcom"));
  16929. this.txtXy = (this.getChild("txtXy"));
  16930. this.n75 = (this.getChild("n75"));
  16931. this.btnXy1 = (this.getChild("btnXy1"));
  16932. this.btnXy3 = (this.getChild("btnXy3"));
  16933. this.btnXy2 = (this.getChild("btnXy2"));
  16934. this.n74 = (this.getChild("n74"));
  16935. this.xy1 = (this.getChild("xy1"));
  16936. this.txtTitle = (this.getChild("txtTitle"));
  16937. this.btnBack = (this.getChild("btnBack"));
  16938. this.xyList = (this.getChild("xyList"));
  16939. this.xy2 = (this.getChild("xy2"));
  16940. this.xyNode = (this.getChild("xyNode"));
  16941. }
  16942. }
  16943. ui_xyNode.URL = "ui://37nctnhwjvenv4ee";
  16944. class ui_ageNode extends fgui.GComponent {
  16945. static createInstance() {
  16946. return (fgui.UIPackage.createObject("loading", "ageNode"));
  16947. }
  16948. onConstruct() {
  16949. this.n3 = (this.getChild("n3"));
  16950. this.n7 = (this.getChild("n7"));
  16951. this.n4 = (this.getChild("n4"));
  16952. this.btnAge = (this.getChild("btnAge"));
  16953. this.ageNode = (this.getChild("ageNode"));
  16954. }
  16955. }
  16956. ui_ageNode.URL = "ui://37nctnhwjvenv4ef";
  16957. class ui_rnNode extends fgui.GComponent {
  16958. static createInstance() {
  16959. return (fgui.UIPackage.createObject("loading", "rnNode"));
  16960. }
  16961. onConstruct() {
  16962. this.n28 = (this.getChild("n28"));
  16963. this.n30 = (this.getChild("n30"));
  16964. this.n33 = (this.getChild("n33"));
  16965. this.rn1 = (this.getChild("rn1"));
  16966. this.n40 = (this.getChild("n40"));
  16967. this.n41 = (this.getChild("n41"));
  16968. this.rn3 = (this.getChild("rn3"));
  16969. this.n37 = (this.getChild("n37"));
  16970. this.n39 = (this.getChild("n39"));
  16971. this.rn2 = (this.getChild("rn2"));
  16972. this.n47 = (this.getChild("n47"));
  16973. this.n49 = (this.getChild("n49"));
  16974. this.n44 = (this.getChild("n44"));
  16975. this.inputCode = (this.getChild("inputCode"));
  16976. this.inputName = (this.getChild("inputName"));
  16977. this.n48 = (this.getChild("n48"));
  16978. this.n50 = (this.getChild("n50"));
  16979. this.rn4 = (this.getChild("rn4"));
  16980. this.btnCheck = (this.getChild("btnCheck"));
  16981. this.btnExit = (this.getChild("btnExit"));
  16982. this.btnDone = (this.getChild("btnDone"));
  16983. this.rnNode = (this.getChild("rnNode"));
  16984. }
  16985. }
  16986. ui_rnNode.URL = "ui://37nctnhwjvenv4eg";
  16987. class ui_tipNode extends fgui.GComponent {
  16988. static createInstance() {
  16989. return (fgui.UIPackage.createObject("loading", "tipNode"));
  16990. }
  16991. onConstruct() {
  16992. this.bg = (this.getChild("bg"));
  16993. this.n55 = (this.getChild("n55"));
  16994. this.n56 = (this.getChild("n56"));
  16995. this.tipNode = (this.getChild("tipNode"));
  16996. }
  16997. }
  16998. ui_tipNode.URL = "ui://37nctnhwjvenv4eh";
  16999. class ui_fcmNode extends fgui.GComponent {
  17000. static createInstance() {
  17001. return (fgui.UIPackage.createObject("loading", "fcmNode"));
  17002. }
  17003. onConstruct() {
  17004. this.n63 = (this.getChild("n63"));
  17005. this.n62 = (this.getChild("n62"));
  17006. this.btnRn = (this.getChild("btnRn"));
  17007. this.n61 = (this.getChild("n61"));
  17008. this.n58 = (this.getChild("n58"));
  17009. this.fcmNode = (this.getChild("fcmNode"));
  17010. }
  17011. }
  17012. ui_fcmNode.URL = "ui://37nctnhwjvenv4ei";
  17013. class ui_msgNode extends fgui.GComponent {
  17014. static createInstance() {
  17015. return (fgui.UIPackage.createObject("loading", "msgNode"));
  17016. }
  17017. onConstruct() {
  17018. this.n69 = (this.getChild("n69"));
  17019. this.txtMsg = (this.getChild("txtMsg"));
  17020. this.msgNode = (this.getChild("msgNode"));
  17021. }
  17022. }
  17023. ui_msgNode.URL = "ui://37nctnhwjvenv4ek";
  17024. class ui_dh_zy_ganfa$1 extends fgui.GComponent {
  17025. static createInstance() {
  17026. return (fgui.UIPackage.createObject("loading", "dh_zy_ganfa"));
  17027. }
  17028. onConstruct() {
  17029. this.n1 = (this.getChild("n1"));
  17030. this.n13 = (this.getChild("n13"));
  17031. this.n14 = (this.getChild("n14"));
  17032. this.n15 = (this.getChild("n15"));
  17033. this.n3 = (this.getChild("n3"));
  17034. this.n4 = (this.getChild("n4"));
  17035. this.n5 = (this.getChild("n5"));
  17036. this.n6 = (this.getChild("n6"));
  17037. this.n7 = (this.getChild("n7"));
  17038. this.n8 = (this.getChild("n8"));
  17039. this.n9 = (this.getChild("n9"));
  17040. this.n10 = (this.getChild("n10"));
  17041. this.n12 = (this.getChild("n12"));
  17042. this.n11 = (this.getChild("n11"));
  17043. this.n16 = (this.getChild("n16"));
  17044. this.n17 = (this.getChild("n17"));
  17045. this.n18 = (this.getChild("n18"));
  17046. this.n20 = (this.getChild("n20"));
  17047. this.n21 = (this.getChild("n21"));
  17048. this.t0 = this.getTransition("t0");
  17049. }
  17050. }
  17051. ui_dh_zy_ganfa$1.URL = "ui://37nctnhwkys71u";
  17052. class ui_btn5 extends fgui.GButton {
  17053. static createInstance() {
  17054. return (fgui.UIPackage.createObject("loading", "btn5"));
  17055. }
  17056. onConstruct() {
  17057. this.n9 = (this.getChild("n9"));
  17058. this.n1 = (this.getChild("n1"));
  17059. }
  17060. }
  17061. ui_btn5.URL = "ui://37nctnhwm0q7v4ed";
  17062. class ui_UILoading extends fgui.GComponent {
  17063. static createInstance() {
  17064. return (fgui.UIPackage.createObject("loading", "UILoading"));
  17065. }
  17066. onConstruct() {
  17067. this.n12 = (this.getChild("n12"));
  17068. this.loadinfo = (this.getChild("loadinfo"));
  17069. this.n13 = (this.getChild("n13"));
  17070. this.txtLoad = (this.getChild("txtLoad"));
  17071. this.n18 = (this.getChild("n18"));
  17072. }
  17073. }
  17074. ui_UILoading.URL = "ui://37nctnhwphc33";
  17075. class ui_AgeItem extends fgui.GComponent {
  17076. static createInstance() {
  17077. return (fgui.UIPackage.createObject("loading", "AgeItem"));
  17078. }
  17079. onConstruct() {
  17080. this.txtAge = (this.getChild("txtAge"));
  17081. }
  17082. }
  17083. ui_AgeItem.URL = "ui://37nctnhwxe622n";
  17084. class ui_btn1 extends fgui.GButton {
  17085. static createInstance() {
  17086. return (fgui.UIPackage.createObject("loading", "btn1"));
  17087. }
  17088. onConstruct() {
  17089. this.n6 = (this.getChild("n6"));
  17090. this.n1 = (this.getChild("n1"));
  17091. }
  17092. }
  17093. ui_btn1.URL = "ui://37nctnhwxe622p";
  17094. class ui_btn3 extends fgui.GButton {
  17095. static createInstance() {
  17096. return (fgui.UIPackage.createObject("loading", "btn3"));
  17097. }
  17098. onConstruct() {
  17099. this.n9 = (this.getChild("n9"));
  17100. this.n1 = (this.getChild("n1"));
  17101. }
  17102. }
  17103. ui_btn3.URL = "ui://37nctnhwxe622s";
  17104. class ui_btn2 extends fgui.GButton {
  17105. static createInstance() {
  17106. return (fgui.UIPackage.createObject("loading", "btn2"));
  17107. }
  17108. onConstruct() {
  17109. this.n6 = (this.getChild("n6"));
  17110. this.n1 = (this.getChild("n1"));
  17111. }
  17112. }
  17113. ui_btn2.URL = "ui://37nctnhwxe622t";
  17114. class ui_btnBack extends fgui.GButton {
  17115. static createInstance() {
  17116. return (fgui.UIPackage.createObject("loading", "btnBack"));
  17117. }
  17118. onConstruct() {
  17119. this.n6 = (this.getChild("n6"));
  17120. this.n7 = (this.getChild("n7"));
  17121. }
  17122. }
  17123. ui_btnBack.URL = "ui://37nctnhwxe622u";
  17124. class ui_btnXy1 extends fgui.GButton {
  17125. static createInstance() {
  17126. return (fgui.UIPackage.createObject("loading", "btnXy1"));
  17127. }
  17128. onConstruct() {
  17129. this.n1 = (this.getChild("n1"));
  17130. }
  17131. }
  17132. ui_btnXy1.URL = "ui://37nctnhwxe622w";
  17133. class ui_btnXy2 extends fgui.GButton {
  17134. static createInstance() {
  17135. return (fgui.UIPackage.createObject("loading", "btnXy2"));
  17136. }
  17137. onConstruct() {
  17138. this.n1 = (this.getChild("n1"));
  17139. }
  17140. }
  17141. ui_btnXy2.URL = "ui://37nctnhwxe622x";
  17142. class ui_btnXy3 extends fgui.GButton {
  17143. static createInstance() {
  17144. return (fgui.UIPackage.createObject("loading", "btnXy3"));
  17145. }
  17146. onConstruct() {
  17147. this.n1 = (this.getChild("n1"));
  17148. }
  17149. }
  17150. ui_btnXy3.URL = "ui://37nctnhwxe622y";
  17151. class ui_btn4 extends fgui.GButton {
  17152. static createInstance() {
  17153. return (fgui.UIPackage.createObject("loading", "btn4"));
  17154. }
  17155. onConstruct() {
  17156. this.n9 = (this.getChild("n9"));
  17157. this.n1 = (this.getChild("n1"));
  17158. }
  17159. }
  17160. ui_btn4.URL = "ui://37nctnhwxe622z";
  17161. class loadingBinder {
  17162. static bindAll() {
  17163. fgui.UIObjectFactory.setExtension(ui_btn6.URL, ui_btn6);
  17164. fgui.UIObjectFactory.setExtension(ui_xyItem.URL, ui_xyItem);
  17165. fgui.UIObjectFactory.setExtension(ui_loadinfo.URL, ui_loadinfo);
  17166. fgui.UIObjectFactory.setExtension(ui_xyNode.URL, ui_xyNode);
  17167. fgui.UIObjectFactory.setExtension(ui_ageNode.URL, ui_ageNode);
  17168. fgui.UIObjectFactory.setExtension(ui_rnNode.URL, ui_rnNode);
  17169. fgui.UIObjectFactory.setExtension(ui_tipNode.URL, ui_tipNode);
  17170. fgui.UIObjectFactory.setExtension(ui_fcmNode.URL, ui_fcmNode);
  17171. fgui.UIObjectFactory.setExtension(ui_msgNode.URL, ui_msgNode);
  17172. fgui.UIObjectFactory.setExtension(ui_dh_zy_ganfa$1.URL, ui_dh_zy_ganfa$1);
  17173. fgui.UIObjectFactory.setExtension(ui_btn5.URL, ui_btn5);
  17174. fgui.UIObjectFactory.setExtension(ui_UILoading.URL, ui_UILoading);
  17175. fgui.UIObjectFactory.setExtension(ui_AgeItem.URL, ui_AgeItem);
  17176. fgui.UIObjectFactory.setExtension(ui_btn1.URL, ui_btn1);
  17177. fgui.UIObjectFactory.setExtension(ui_btn3.URL, ui_btn3);
  17178. fgui.UIObjectFactory.setExtension(ui_btn2.URL, ui_btn2);
  17179. fgui.UIObjectFactory.setExtension(ui_btnBack.URL, ui_btnBack);
  17180. fgui.UIObjectFactory.setExtension(ui_btnXy1.URL, ui_btnXy1);
  17181. fgui.UIObjectFactory.setExtension(ui_btnXy2.URL, ui_btnXy2);
  17182. fgui.UIObjectFactory.setExtension(ui_btnXy3.URL, ui_btnXy3);
  17183. fgui.UIObjectFactory.setExtension(ui_btn4.URL, ui_btn4);
  17184. fgui.UIObjectFactory.setExtension(ui_UIMoyu.URL, ui_UIMoyu);
  17185. }
  17186. }
  17187. class UIMgr {
  17188. constructor() {
  17189. this._stage = null;
  17190. this._uiList = [];
  17191. this._showList = [];
  17192. this._bindPkgList = [];
  17193. this.uiIndex = 0;
  17194. }
  17195. static get inst() {
  17196. if (UIMgr._inst == null) {
  17197. UIMgr._inst = new UIMgr();
  17198. }
  17199. return UIMgr._inst;
  17200. }
  17201. setStage(s) {
  17202. if (this._stage) {
  17203. console.log("ViewMgr::Stage->舞台不可赋值两次");
  17204. return;
  17205. }
  17206. this._stage = s;
  17207. }
  17208. clearTempData() {
  17209. console.log('zh:clearTempData start');
  17210. Laya.LocalStorage.removeItem('temp_qjff_AD_for_uiGameEnd_level');
  17211. console.log('zh:clearTempData end');
  17212. }
  17213. init() {
  17214. this.setStage(Laya.stage);
  17215. fairygui.UIConfig.defaultFont = "arial";
  17216. fairygui.UIConfig.modalLayerColor = "rgba(29, 22, 22, 0.9)";
  17217. fairygui.UIConfig.packageFileExtension = "obj";
  17218. fairygui.UIConfig.bringWindowToFrontOnClick = false;
  17219. Laya.stage.addChild(fairygui.GRoot.inst.displayObject);
  17220. fairygui.GRoot.inst.width = Laya.stage.width;
  17221. fairygui.GRoot.inst.height = Laya.stage.height;
  17222. Laya.timer.frameLoop(1, this, this.addAllUpdate);
  17223. }
  17224. addAllUpdate() {
  17225. this.uiIndex = 0;
  17226. for (; this.uiIndex < this._uiList.length; this.uiIndex++) {
  17227. if (this._uiList[this.uiIndex] && this._uiList[this.uiIndex].isShowing) {
  17228. this._uiList[this.uiIndex].myUpdate && this._uiList[this.uiIndex].myUpdate(Laya.timer.delta * 0.001);
  17229. }
  17230. }
  17231. }
  17232. bindFUI(pkgname) {
  17233. if (this._bindPkgList.indexOf(pkgname) >= 0) {
  17234. return;
  17235. }
  17236. switch (pkgname) {
  17237. case fguiRes.loading:
  17238. fairygui.UIPackage.addPackage(pkgname);
  17239. loadingBinder.bindAll();
  17240. this._bindPkgList.push(pkgname);
  17241. break;
  17242. case fguiRes.game:
  17243. fairygui.UIPackage.addPackage(pkgname);
  17244. gameBinder.bindAll();
  17245. this._bindPkgList.push(pkgname);
  17246. break;
  17247. default:
  17248. break;
  17249. }
  17250. }
  17251. Show(cls, ...param) {
  17252. let nameStr = cls.uiName;
  17253. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17254. let temp = this._uiList[i];
  17255. let str = temp.className;
  17256. if (str == nameStr) {
  17257. if (temp.isMuti) {
  17258. if (temp.isHide) {
  17259. temp.show(...param);
  17260. this._uiList.splice(i, 1);
  17261. this._uiList.push(temp);
  17262. return temp;
  17263. }
  17264. }
  17265. else {
  17266. temp.show(...param);
  17267. this._uiList.splice(i, 1);
  17268. this._uiList.push(temp);
  17269. return temp;
  17270. }
  17271. }
  17272. }
  17273. let ui = new cls();
  17274. ui.className = nameStr;
  17275. this._showUI(ui, param);
  17276. return ui;
  17277. }
  17278. destroyUI(ui) {
  17279. for (let i = this._uiList.length - 1; i >= 0; i--) {
  17280. let temp = this._uiList[i].className;
  17281. if (temp == ui.className) {
  17282. this._uiList.splice(i, 1);
  17283. break;
  17284. }
  17285. }
  17286. this.checkUIState();
  17287. }
  17288. _showUI(ui, param) {
  17289. this._uiList.push(ui);
  17290. ui.show(...param);
  17291. }
  17292. Hide(uiClass) {
  17293. let ui = this.getUI(uiClass);
  17294. if (ui && !ui.isHide) {
  17295. ui.hide();
  17296. }
  17297. }
  17298. getUI(ui) {
  17299. let nameStr = ui.uiName;
  17300. for (let index = 0; index < this._uiList.length; index++) {
  17301. let temp = this._uiList[index];
  17302. if (temp.className == nameStr) {
  17303. return temp;
  17304. }
  17305. }
  17306. return null;
  17307. }
  17308. isShow(cls) {
  17309. for (var i of this._uiList) {
  17310. if (i instanceof cls) {
  17311. return i.isShowing;
  17312. }
  17313. }
  17314. return false;
  17315. }
  17316. showUINum() {
  17317. let num = 0;
  17318. for (var i of this._uiList) {
  17319. if (i.isShowing) {
  17320. num++;
  17321. }
  17322. }
  17323. return num;
  17324. }
  17325. checkUIState() {
  17326. Laya.timer.clear(this, this._uiCheck);
  17327. Laya.timer.once(400, this, this._uiCheck);
  17328. }
  17329. _uiCheck() {
  17330. let showList = [];
  17331. for (var i of this._uiList) {
  17332. if (!i.isHide) {
  17333. showList.push(i);
  17334. }
  17335. }
  17336. for (let index = 0; index < showList.length; index++) {
  17337. if (index == showList.length - 1) {
  17338. showList[index].checkActive(true);
  17339. }
  17340. else {
  17341. showList[index].checkActive(false);
  17342. }
  17343. }
  17344. }
  17345. showTip(msg, time = 600, size = 30) {
  17346. }
  17347. }
  17348. class UIShowList {
  17349. }
  17350. class SoundMgr {
  17351. constructor() {
  17352. this.soundMax = 4;
  17353. this.isLoad = false;
  17354. this.soundMap = {};
  17355. this.isSound = true;
  17356. this.openShake = true;
  17357. SoundMgr._instance = this;
  17358. }
  17359. static getInstance() {
  17360. if (!this._instance) {
  17361. this._instance = new SoundMgr();
  17362. }
  17363. return this._instance;
  17364. }
  17365. init() {
  17366. console.log('zh:sm init 1');
  17367. Laya.SoundManager.autoReleaseSound = true;
  17368. Laya.SoundManager.autoStopMusic = true;
  17369. Laya.SoundManager.musicVolume = 0.3;
  17370. Laya.SoundManager.soundVolume = 0.5;
  17371. this.musicPlayed = false;
  17372. this.audioUrl = "asset/sound/ogg/";
  17373. console.log('zh:sm init 2');
  17374. console.log('zh:dev type ');
  17375. if (Laya.Browser.onAndroid) {
  17376. console.log('zh:dev type android');
  17377. this.audioUrl = "asset/sound/ogg/";
  17378. this.isLoad = true;
  17379. }
  17380. else {
  17381. console.log('zh:dev type not android');
  17382. this.audioUrl = "asset/sound/mp3/";
  17383. this.isLoad = true;
  17384. }
  17385. }
  17386. onSetting(isS) {
  17387. this.isSound = isS;
  17388. this.mute(!this.isSound);
  17389. }
  17390. clearCount() {
  17391. for (var key in this.soundMap) {
  17392. delete this.soundMap[key];
  17393. }
  17394. }
  17395. playMusic(path, loop = 0) {
  17396. console.log('zh:playMusic 1 PATH=' + path);
  17397. this.musicPath = path;
  17398. if (!this.isLoad) {
  17399. return;
  17400. }
  17401. if (!path || path == "") {
  17402. return;
  17403. }
  17404. if (!this.isSound) {
  17405. return;
  17406. }
  17407. this.musicPlayed = true;
  17408. let url = this.getUrl(path);
  17409. if (!Laya.Browser.onAndroid) {
  17410. Laya.loader.load(url, Laya.Handler.create(this, () => {
  17411. this.play(url, loop);
  17412. }));
  17413. }
  17414. else {
  17415. this.play(url, loop);
  17416. }
  17417. }
  17418. play(url, loop) {
  17419. Laya.SoundManager.playMusic(url, loop);
  17420. }
  17421. getUrl(path) {
  17422. let url = this.audioUrl + path;
  17423. if (Laya.Browser.onAndroid) {
  17424. url += ".ogg";
  17425. }
  17426. else {
  17427. url += ".mp3";
  17428. }
  17429. return url;
  17430. }
  17431. pauseMusic(pause) {
  17432. if (pause) {
  17433. this.mute(true);
  17434. }
  17435. else if (this.isSound)
  17436. this.mute(false);
  17437. }
  17438. stopMusic() {
  17439. Laya.SoundManager.stopMusic();
  17440. if (Moyu.isNeedPlatAudio) {
  17441. Moyu.stopMusic();
  17442. }
  17443. }
  17444. mute(mute) {
  17445. if (Moyu.isNeedPlatAudio) {
  17446. Moyu.pauseMusic(mute);
  17447. }
  17448. else {
  17449. Laya.SoundManager.musicMuted = mute;
  17450. if (!mute && !this.musicPlayed && this.musicPath) {
  17451. this.playMusic(this.musicPath);
  17452. }
  17453. }
  17454. }
  17455. stopSound(path) {
  17456. let url = this.getUrl(path);
  17457. Laya.SoundManager.stopSound(url);
  17458. }
  17459. playSound(path, loop = 1, soundMax = this.soundMax) {
  17460. if (!this.isLoad)
  17461. return;
  17462. if (!this.isSound)
  17463. return;
  17464. if (!path || path == "")
  17465. return;
  17466. let url = this.getUrl(path);
  17467. if (Moyu.isNeedPlatAudio) {
  17468. Moyu.playSound(path, loop == 0);
  17469. }
  17470. else {
  17471. let count = 1;
  17472. if (this.soundMap[path])
  17473. count = this.soundMap[path] + 1;
  17474. if (count > soundMax)
  17475. return;
  17476. this.soundMap[path] = count;
  17477. Laya.SoundManager.playSound(url, loop);
  17478. Laya.timer.once(500 * loop, this, this.removePath, [path], false);
  17479. }
  17480. }
  17481. removePath(path) {
  17482. if (this.soundMap[path]) {
  17483. let count = this.soundMap[path];
  17484. count--;
  17485. if (count < 1)
  17486. delete this.soundMap[path];
  17487. else
  17488. this.soundMap[path] = count;
  17489. }
  17490. }
  17491. playBtnSound() {
  17492. this.playSound("btn");
  17493. }
  17494. playGetSound() {
  17495. }
  17496. playCloseUISound() {
  17497. }
  17498. }
  17499. SoundMgr._instance = null;
  17500. var Handler$1 = Laya.Handler;
  17501. var EResType;
  17502. (function (EResType) {
  17503. EResType[EResType["none"] = 0] = "none";
  17504. EResType[EResType["nromal"] = 1] = "nromal";
  17505. EResType[EResType["td"] = 2] = "td";
  17506. EResType[EResType["sk"] = 3] = "sk";
  17507. })(EResType || (EResType = {}));
  17508. class CResLoader {
  17509. constructor(doneCall, proCall) {
  17510. this.completrCall = doneCall;
  17511. this.progressCall = proCall;
  17512. this.progressHander = new Handler$1(this, this.onProgress);
  17513. this.tdResMap = {};
  17514. }
  17515. load(resList) {
  17516. this.resCount = 0;
  17517. this.loadCount = 0;
  17518. for (let i = 0; i < resList.length; i++) {
  17519. let path = resList[i];
  17520. if (!path)
  17521. continue;
  17522. this.resCount++;
  17523. let type = this.getResType(path);
  17524. if (type == EResType.nromal)
  17525. this.loadNromal(path);
  17526. else if (type == EResType.td)
  17527. this.loadTd(path);
  17528. }
  17529. }
  17530. getRes(path) {
  17531. let type = this.getResType(path);
  17532. if (type == EResType.nromal)
  17533. return Laya.loader.getRes(path);
  17534. else if (type == EResType.td) {
  17535. let res = this.tdResMap[path];
  17536. if (res)
  17537. return res.clone();
  17538. return null;
  17539. }
  17540. }
  17541. destroy() {
  17542. this.progressHander.clear();
  17543. this.progressHander = null;
  17544. }
  17545. clearRes(path) {
  17546. let type = this.getResType(path);
  17547. if (type == EResType.nromal)
  17548. Laya.loader.clearRes(path);
  17549. else if (type == EResType.td) {
  17550. let obj = this.tdResMap[path];
  17551. if (obj)
  17552. obj.destroy();
  17553. delete this.tdResMap[path];
  17554. }
  17555. }
  17556. getResType(path) {
  17557. let exs = this.getExtension(path);
  17558. if (exs == "sk")
  17559. return EResType.sk;
  17560. if (exs == "ls" || exs == "lh" || exs == "lm")
  17561. return EResType.td;
  17562. else
  17563. return EResType.nromal;
  17564. }
  17565. getExtension(res) {
  17566. var index = res.lastIndexOf(".");
  17567. return res.substr(index + 1);
  17568. }
  17569. loadNromal(path) {
  17570. Laya.loader.load(path, Laya.Handler.create(this, (res) => {
  17571. if (res) {
  17572. this.onLoad();
  17573. }
  17574. else
  17575. console.log("load res fail:" + path);
  17576. }), this.progressHander);
  17577. }
  17578. loadSk() {
  17579. }
  17580. loadTd(path) {
  17581. if (this.tdResMap[path]) {
  17582. this.onLoad();
  17583. return;
  17584. }
  17585. Laya.Sprite3D.load(path, Handler$1.create(this, (res) => {
  17586. if (res) {
  17587. this.tdResMap[path] = res;
  17588. this.onLoad();
  17589. }
  17590. else
  17591. console.log("load res fail:" + path);
  17592. }));
  17593. }
  17594. onLoad() {
  17595. this.loadCount++;
  17596. this.onProgress(1);
  17597. if (this.loadCount >= this.resCount) {
  17598. this.completrCall.run();
  17599. }
  17600. }
  17601. onProgress(pro) {
  17602. let progress = (this.loadCount + pro) / this.resCount;
  17603. this.progressCall.runWith(progress);
  17604. }
  17605. }
  17606. var Handler$2 = Laya.Handler;
  17607. class ResInfo {
  17608. constructor() {
  17609. this.index = 0;
  17610. }
  17611. }
  17612. class ResMgr {
  17613. constructor() {
  17614. this.resList = [];
  17615. this.doneList = [];
  17616. this.resMap = {};
  17617. this.currentLoad = null;
  17618. this.completeHandler = new Handler$2(this, this.onComplete);
  17619. this.progressHandler = new Handler$2(this, this.onProgress);
  17620. this.loader = new CResLoader(this.completeHandler, this.progressHandler);
  17621. }
  17622. static getInstance() {
  17623. if (ResMgr._instance == null) {
  17624. ResMgr._instance = new ResMgr();
  17625. }
  17626. return ResMgr._instance;
  17627. }
  17628. loadList(list, completeHandler, progressHandler) {
  17629. if (list.length < 1) {
  17630. completeHandler.run();
  17631. return;
  17632. }
  17633. let info = this.getResInfo();
  17634. info.resList = list;
  17635. info.completeHandler = completeHandler;
  17636. info.progressHandler = progressHandler;
  17637. this.resList.push(info);
  17638. this.startLoad();
  17639. }
  17640. loadFguiRes(list, completeHandler, progressHandler) {
  17641. Laya.loader.load(list, completeHandler, progressHandler);
  17642. }
  17643. loadAny(list, completeHandler, progressHandler) {
  17644. Laya.loader.load(list, completeHandler, progressHandler);
  17645. }
  17646. load(path, completeHandler, progressHandler) {
  17647. let count = this.resMap[path];
  17648. if (count && count > 0) {
  17649. if (completeHandler)
  17650. completeHandler.run();
  17651. }
  17652. else
  17653. this.loadList([path], completeHandler, progressHandler);
  17654. }
  17655. getRes(path) {
  17656. let res = this.resMap[path];
  17657. if (!res)
  17658. this.showLog("资源不存在:" + path);
  17659. else
  17660. return this.loader.getRes(path);
  17661. }
  17662. clearList(list, force = false) {
  17663. if (!list || list.length < 1)
  17664. return;
  17665. let cr = () => {
  17666. for (const k in list) {
  17667. let v = list[k];
  17668. if (!v)
  17669. continue;
  17670. if (force) {
  17671. this.loader.clearRes(v);
  17672. delete this.resMap[v];
  17673. }
  17674. else {
  17675. let count = this.resMap[v];
  17676. if (count && count > 1) {
  17677. count--;
  17678. this.resMap[v] = count;
  17679. }
  17680. else {
  17681. this.loader.clearRes(v);
  17682. delete this.resMap[v];
  17683. }
  17684. }
  17685. }
  17686. if (!window.hasOwnProperty("ks"))
  17687. Laya.Resource.destroyUnusedResources();
  17688. };
  17689. Laya.timer.clearAll(this);
  17690. Laya.timer.once(2000, this, cr);
  17691. }
  17692. clear3D() {
  17693. for (const k in this.loader.tdResMap) {
  17694. this.loader.clearRes(k);
  17695. if (this.resMap[k])
  17696. delete this.resMap[k];
  17697. }
  17698. if (!window.hasOwnProperty("ks"))
  17699. Laya.Resource.destroyUnusedResources();
  17700. }
  17701. clear(path, force = false) {
  17702. this.clearList([path], force);
  17703. }
  17704. getResInfo() {
  17705. if (this.doneList.length > 0)
  17706. return this.doneList.pop();
  17707. else
  17708. return new ResInfo();
  17709. }
  17710. startLoad() {
  17711. if (this.currentLoad)
  17712. return;
  17713. this.currentLoad = this.resList.pop();
  17714. if (this.currentLoad) {
  17715. this.loader.load(this.currentLoad.resList);
  17716. }
  17717. }
  17718. onComplete() {
  17719. if (!this.currentLoad)
  17720. return;
  17721. for (const k in this.currentLoad.resList) {
  17722. let v = this.currentLoad.resList[k];
  17723. let count = this.resMap[v];
  17724. if (count)
  17725. count++;
  17726. else
  17727. count = 1;
  17728. this.resMap[v] = count;
  17729. }
  17730. if (this.currentLoad.completeHandler)
  17731. this.currentLoad.completeHandler.run();
  17732. this.doneList.push(this.currentLoad);
  17733. this.currentLoad = null;
  17734. this.startLoad();
  17735. }
  17736. onProgress(pro) {
  17737. if (!this.currentLoad)
  17738. return;
  17739. if (this.currentLoad.progressHandler)
  17740. this.currentLoad.progressHandler.runWith(pro);
  17741. }
  17742. showLog(str, ...args) {
  17743. console.log("[ResLoader] " + str);
  17744. }
  17745. }
  17746. ResMgr._instance = null;
  17747. class EventMgr extends Laya.EventDispatcher {
  17748. }
  17749. let eventMgr = new EventMgr();
  17750. /*! *****************************************************************************
  17751. Copyright (c) Microsoft Corporation. All rights reserved.
  17752. Licensed under the Apache License, Version 2.0 (the "License"); you may not use
  17753. this file except in compliance with the License. You may obtain a copy of the
  17754. License at http://www.apache.org/licenses/LICENSE-2.0
  17755. THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  17756. KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
  17757. WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
  17758. MERCHANTABLITY OR NON-INFRINGEMENT.
  17759. See the Apache Version 2.0 License for specific language governing permissions
  17760. and limitations under the License.
  17761. ***************************************************************************** */
  17762. /* global Reflect, Promise */
  17763. var extendStatics = function(d, b) {
  17764. extendStatics = Object.setPrototypeOf ||
  17765. ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
  17766. function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
  17767. return extendStatics(d, b);
  17768. };
  17769. function __extends(d, b) {
  17770. extendStatics(d, b);
  17771. function __() { this.constructor = d; }
  17772. d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  17773. }
  17774. var __assign = function() {
  17775. __assign = Object.assign || function __assign(t) {
  17776. for (var s, i = 1, n = arguments.length; i < n; i++) {
  17777. s = arguments[i];
  17778. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
  17779. }
  17780. return t;
  17781. };
  17782. return __assign.apply(this, arguments);
  17783. };
  17784. function __rest(s, e) {
  17785. var t = {};
  17786. for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
  17787. t[p] = s[p];
  17788. if (s != null && typeof Object.getOwnPropertySymbols === "function")
  17789. for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
  17790. t[p[i]] = s[p[i]];
  17791. return t;
  17792. }
  17793. function __decorate(decorators, target, key, desc) {
  17794. var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
  17795. if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
  17796. 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;
  17797. return c > 3 && r && Object.defineProperty(target, key, r), r;
  17798. }
  17799. function __param(paramIndex, decorator) {
  17800. return function (target, key) { decorator(target, key, paramIndex); }
  17801. }
  17802. function __metadata(metadataKey, metadataValue) {
  17803. if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
  17804. }
  17805. function __awaiter(thisArg, _arguments, P, generator) {
  17806. return new (P || (P = Promise))(function (resolve, reject) {
  17807. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  17808. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  17809. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  17810. step((generator = generator.apply(thisArg, _arguments || [])).next());
  17811. });
  17812. }
  17813. function __generator(thisArg, body) {
  17814. var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
  17815. return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
  17816. function verb(n) { return function (v) { return step([n, v]); }; }
  17817. function step(op) {
  17818. if (f) throw new TypeError("Generator is already executing.");
  17819. while (_) try {
  17820. 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;
  17821. if (y = 0, t) op = [op[0] & 2, t.value];
  17822. switch (op[0]) {
  17823. case 0: case 1: t = op; break;
  17824. case 4: _.label++; return { value: op[1], done: false };
  17825. case 5: _.label++; y = op[1]; op = [0]; continue;
  17826. case 7: op = _.ops.pop(); _.trys.pop(); continue;
  17827. default:
  17828. if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
  17829. if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
  17830. if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
  17831. if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
  17832. if (t[2]) _.ops.pop();
  17833. _.trys.pop(); continue;
  17834. }
  17835. op = body.call(thisArg, _);
  17836. } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
  17837. if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
  17838. }
  17839. }
  17840. function __exportStar(m, exports) {
  17841. for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
  17842. }
  17843. function __values(o) {
  17844. var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
  17845. if (m) return m.call(o);
  17846. return {
  17847. next: function () {
  17848. if (o && i >= o.length) o = void 0;
  17849. return { value: o && o[i++], done: !o };
  17850. }
  17851. };
  17852. }
  17853. function __read(o, n) {
  17854. var m = typeof Symbol === "function" && o[Symbol.iterator];
  17855. if (!m) return o;
  17856. var i = m.call(o), r, ar = [], e;
  17857. try {
  17858. while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
  17859. }
  17860. catch (error) { e = { error: error }; }
  17861. finally {
  17862. try {
  17863. if (r && !r.done && (m = i["return"])) m.call(i);
  17864. }
  17865. finally { if (e) throw e.error; }
  17866. }
  17867. return ar;
  17868. }
  17869. function __spread() {
  17870. for (var ar = [], i = 0; i < arguments.length; i++)
  17871. ar = ar.concat(__read(arguments[i]));
  17872. return ar;
  17873. }
  17874. function __await(v) {
  17875. return this instanceof __await ? (this.v = v, this) : new __await(v);
  17876. }
  17877. function __asyncGenerator(thisArg, _arguments, generator) {
  17878. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17879. var g = generator.apply(thisArg, _arguments || []), i, q = [];
  17880. return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
  17881. 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); }); }; }
  17882. function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
  17883. function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
  17884. function fulfill(value) { resume("next", value); }
  17885. function reject(value) { resume("throw", value); }
  17886. function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
  17887. }
  17888. function __asyncDelegator(o) {
  17889. var i, p;
  17890. return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
  17891. 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; }
  17892. }
  17893. function __asyncValues(o) {
  17894. if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
  17895. var m = o[Symbol.asyncIterator], i;
  17896. 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);
  17897. 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); }); }; }
  17898. function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
  17899. }
  17900. function __makeTemplateObject(cooked, raw) {
  17901. if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
  17902. return cooked;
  17903. };
  17904. function __importStar(mod) {
  17905. if (mod && mod.__esModule) return mod;
  17906. var result = {};
  17907. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  17908. result.default = mod;
  17909. return result;
  17910. }
  17911. function __importDefault(mod) {
  17912. return (mod && mod.__esModule) ? mod : { default: mod };
  17913. }
  17914. class CustomAlert {
  17915. static show(title, content, buttons) {
  17916. if (!Laya.Box || !Laya.Label || !Laya.Button) {
  17917. console.error("UI模块未加载!请检查laya.ui.js是否引入");
  17918. return;
  17919. }
  17920. const bg = new Laya.Box();
  17921. bg.alpha = 0;
  17922. bg.graphics.drawRect(0, 0, Laya.stage.width, Laya.stage.height, "#000000AA");
  17923. Laya.stage.addChild(bg);
  17924. Laya.Tween.to(bg, { alpha: 1 }, 200);
  17925. const panel = new Laya.Box();
  17926. panel.graphics.drawRect(0, 0, 400, 250, "#cccccc");
  17927. panel.pos((Laya.stage.width - 400) / 2, (Laya.stage.height - 250) / 2);
  17928. bg.addChild(panel);
  17929. const titleText = new Laya.Text();
  17930. titleText.text = title;
  17931. titleText.fontSize = 32;
  17932. titleText.color = "#333333";
  17933. titleText.bold = true;
  17934. titleText.pos(20, 20);
  17935. titleText.width = 360;
  17936. titleText.align = "center";
  17937. panel.addChild(titleText);
  17938. const contentText = new Laya.Text();
  17939. contentText.text = content;
  17940. contentText.fontSize = 21;
  17941. contentText.color = "#555555";
  17942. contentText.pos(20, 70);
  17943. contentText.width = 360;
  17944. contentText.wordWrap = true;
  17945. contentText.align = "center";
  17946. panel.addChild(contentText);
  17947. const buttonContainer = new Laya.Box();
  17948. buttonContainer.pos(20, 160);
  17949. panel.addChild(buttonContainer);
  17950. const btnWidth = 120;
  17951. const spacing = 30;
  17952. const totalWidth = buttons.length * btnWidth + (buttons.length - 1) * spacing;
  17953. buttons.forEach((btn, index) => {
  17954. const button = new Laya.Button();
  17955. button.label = btn.label;
  17956. button.size(btnWidth, 40);
  17957. button.labelSize = 22;
  17958. button.pos(index * (btnWidth + spacing), 0);
  17959. button.labelColors = "#FFFFFF,#FFFFFF,#FFFFFF";
  17960. button.graphics.drawRect(0, 0, btnWidth, 40, "#4A90E2");
  17961. button.on(Laya.Event.MOUSE_OVER, this, () => {
  17962. button.alpha = 0.9;
  17963. });
  17964. button.on(Laya.Event.MOUSE_OUT, this, () => {
  17965. button.alpha = 1;
  17966. });
  17967. button.on(Laya.Event.CLICK, this, () => {
  17968. btn.handler();
  17969. Laya.Tween.to(bg, { alpha: 0 }, 200, null, Laya.Handler.create(this, () => {
  17970. bg.removeSelf();
  17971. }));
  17972. });
  17973. buttonContainer.addChild(button);
  17974. });
  17975. buttonContainer.x = (panel.width - totalWidth) / 2;
  17976. }
  17977. }
  17978. class ConfigMgr {
  17979. constructor() {
  17980. this.httpReqCount = 4;
  17981. this.httpReqOkCount = 0;
  17982. this.getConfigFromServer = () => __awaiter(this, void 0, void 0, function* () {
  17983. try {
  17984. this.httpReqOkCount = 0;
  17985. let reqData = xGame.httpMgr.getReqData();
  17986. console.log('zh:第1个请求getClassicCfg');
  17987. const classicCfg = yield this.sendPostAsync('game2/getClassicCfg', reqData);
  17988. this.classicCfg = classicCfg;
  17989. this.httpReqOkCount++;
  17990. console.log('zh:第2个请求getLevelCfg');
  17991. const levelCfg = yield this.sendPostAsync('game2/getLevelCfg', reqData);
  17992. this.levelCfg = levelCfg;
  17993. this.httpReqOkCount++;
  17994. console.log('zh:第3个请求 getPlaceBallCfg');
  17995. const placeBallCfg = yield this.sendPostAsync('game2/getPlaceBallCfg', reqData);
  17996. this.placeBallCfg = placeBallCfg;
  17997. this.httpReqOkCount++;
  17998. console.log('zh:第4个请求 npc');
  17999. const npc = yield this.sendPostAsync('game2/getNpc', reqData);
  18000. this.npcJson = npc.Data;
  18001. this.httpReqOkCount++;
  18002. console.log('zh:所有配置加载完成');
  18003. xGame.eventMgr.event("gameConfigReadyMark");
  18004. }
  18005. catch (error) {
  18006. console.error('zh:❌请求失败:', error);
  18007. Laya.timer.once(5000, this, () => {
  18008. let retryCount = 0;
  18009. const maxRetries = 3;
  18010. const tryFetchConfig = () => {
  18011. try {
  18012. xGame.cfgMgr.getConfigFromServer();
  18013. }
  18014. catch (error) {
  18015. if (retryCount < maxRetries) {
  18016. retryCount++;
  18017. console.log(`zh:🔄 第${retryCount}次重试获取配置...`);
  18018. Laya.timer.once(5000, this, tryFetchConfig);
  18019. }
  18020. else {
  18021. console.error("zh:❌ 达到最大重试次数,配置获取失败");
  18022. }
  18023. }
  18024. };
  18025. tryFetchConfig();
  18026. });
  18027. }
  18028. finally {
  18029. if (this.httpReqCount > this.httpReqOkCount) {
  18030. CustomAlert.show("Prompt", "Failed to load resources. Check your network and restart the game.", [{
  18031. label: "Okay", handler: () => {
  18032. JSBridgeUtils.instance.exitAndCloseGame();
  18033. }
  18034. }]);
  18035. }
  18036. }
  18037. });
  18038. this.sendPostAsync = (action, reqData) => {
  18039. return new Promise((resolve, reject) => {
  18040. xGame.httpMgr.sendPost2025(action, reqData, (res) => {
  18041. try {
  18042. let code = res.code;
  18043. if (code == 200) {
  18044. const parsedData = JSON.parse(res.msg);
  18045. resolve(parsedData);
  18046. }
  18047. else {
  18048. console.log(`zh:ERROR res = ${JSON.stringify(res)}`);
  18049. reject(new Error(`Request failed with code: ${code}`));
  18050. }
  18051. }
  18052. catch (error) {
  18053. console.error(`ERROR=${error}`);
  18054. alert("Please check your network connection.");
  18055. reject(error);
  18056. }
  18057. finally {
  18058. console.log(`zh:${action}的请求处理完毕`);
  18059. }
  18060. });
  18061. });
  18062. };
  18063. }
  18064. static getInstance() {
  18065. if (!this._instance) {
  18066. this._instance = new ConfigMgr();
  18067. }
  18068. return this._instance;
  18069. }
  18070. init() {
  18071. this.getConfigFromServer();
  18072. }
  18073. test() {
  18074. let reqData = xGame.httpMgr.getReqData();
  18075. xGame.httpMgr.sendPost2025('game2/getClassicCfg', reqData, (res) => {
  18076. console.log('zh:1s');
  18077. try {
  18078. let code = res.code;
  18079. let data = res.data;
  18080. if (code == 200) {
  18081. const parsedData = JSON.parse(data);
  18082. this.classicCfg = parsedData;
  18083. }
  18084. else {
  18085. console.log('zh:res = ' + JSON.stringify(res));
  18086. }
  18087. }
  18088. catch (error) {
  18089. console.log('error=' + error);
  18090. alert("Please check your network connection.");
  18091. }
  18092. finally {
  18093. console.log('zh:1');
  18094. }
  18095. });
  18096. }
  18097. getUserInfoByIndex(index) {
  18098. return this.npcJson[index];
  18099. }
  18100. getRandomUserInfo() {
  18101. let index = xGame.tools.random(0, this.npcJson.length);
  18102. let rs = this.npcJson[index];
  18103. return rs;
  18104. }
  18105. getMaxBigMoveLength() {
  18106. return Object.keys(this.levelCfg).length;
  18107. }
  18108. getBigMoveLevelByIndex(index) {
  18109. let cfg = this.levelCfg;
  18110. cfg = cfg[index];
  18111. return cfg;
  18112. }
  18113. getRandomClassicLevel() {
  18114. let cfg = this.classicCfg;
  18115. let num = Object.keys(cfg).length;
  18116. let rand = xGame.common.randomNum(1, num);
  18117. return cfg[rand];
  18118. }
  18119. getPlaceBallByLevel(level) {
  18120. return this.placeBallCfg[level];
  18121. }
  18122. getMaxPlaceBall() {
  18123. return Object.keys(this.placeBallCfg).length;
  18124. }
  18125. }
  18126. class PoolD3Mgr {
  18127. constructor() {
  18128. this.pool = {};
  18129. }
  18130. static get ins() {
  18131. return this._ins || (this._ins = new PoolD3Mgr);
  18132. }
  18133. createList(key, prefab, parent) {
  18134. if (!this.pool[key]) {
  18135. this.pool[key] = {};
  18136. this.pool[key].prefab = prefab;
  18137. this.pool[key].list = [];
  18138. this.pool[key].parent = parent;
  18139. }
  18140. }
  18141. getItem(key) {
  18142. if (!this.pool[key]) {
  18143. return;
  18144. }
  18145. let temp;
  18146. if (this.pool[key].list.length > 0) {
  18147. temp = this.pool[key].list.pop();
  18148. }
  18149. else {
  18150. temp = this.pool[key].prefab.clone();
  18151. if (this.pool[key].parent) {
  18152. this.pool[key].parent.addChild(temp);
  18153. }
  18154. }
  18155. temp.active = true;
  18156. return temp;
  18157. }
  18158. putItem(key, obj) {
  18159. if (!this.pool[key]) {
  18160. return;
  18161. }
  18162. obj.active = false;
  18163. this.pool[key].list.push(obj);
  18164. }
  18165. }
  18166. let context$1 = context;
  18167. let uiMgr = UIMgr.inst;
  18168. let soundMgr = SoundMgr.getInstance();
  18169. let resMgr = ResMgr.getInstance();
  18170. let httpMgr = HttpMgr.getInstance();
  18171. let common = Common.getInstance();
  18172. let cfgMgr = ConfigMgr.getInstance();
  18173. let poolD3Mgr = PoolD3Mgr.ins;
  18174. let d3TexUrl = "res/d3Res/";
  18175. let d3ModeUrl = "res/unityRes/";
  18176. function setStageSize(view) {
  18177. if (view.width) {
  18178. view.width = Laya.stage.width;
  18179. view.height = Laya.stage.height;
  18180. }
  18181. }
  18182. function filledBg(view) {
  18183. let wh = Laya.stage.height / Laya.stage.width;
  18184. if (wh > 16 / 9) {
  18185. view.height = Laya.stage.height;
  18186. view.width = Laya.stage.height / 1334 * 750;
  18187. }
  18188. else {
  18189. view.width = Laya.stage.width;
  18190. view.height = Laya.stage.width / 750 * 1334;
  18191. }
  18192. }
  18193. function setNotch(view) {
  18194. if (view.height) {
  18195. view.y += context$1.notchHeight;
  18196. }
  18197. }
  18198. function showTip(str) {
  18199. uiMgr.Show(UIMsg, str);
  18200. }
  18201. function log(...args) {
  18202. console.log(args);
  18203. }
  18204. let xGame = {
  18205. context: context$1,
  18206. eventMgr,
  18207. resMgr,
  18208. uiMgr,
  18209. soundMgr,
  18210. define,
  18211. tools,
  18212. httpMgr,
  18213. d3TexUrl,
  18214. d3ModeUrl,
  18215. common,
  18216. cfgMgr,
  18217. poolD3Mgr,
  18218. setStageSize,
  18219. filledBg,
  18220. setNotch,
  18221. showTip,
  18222. log,
  18223. };
  18224. window["xGame"] = xGame;
  18225. let dataName = 'tBall_';
  18226. class UserData {
  18227. constructor() {
  18228. this.userId = "";
  18229. this.isAgree = false;
  18230. this.coinNum = 0;
  18231. this.gemNum = 0;
  18232. this.sound = true;
  18233. this.vibration = true;
  18234. this.currentDate = 0;
  18235. this.createTime = 0;
  18236. this.awardTime = 0;
  18237. this.roleId = 1;
  18238. this.roleList = [];
  18239. this.roleAds = [];
  18240. this.dressId = 101;
  18241. this.itemId = 201;
  18242. this.bigSkills = [1, 1, 1, 1, 1];
  18243. this.coin = 4000;
  18244. this.diamond = 0;
  18245. this.skillSuccessTimes = 0;
  18246. this.skillGuide = 0;
  18247. this.lianXiGuide = 0;
  18248. this.skillAccTimes = 0;
  18249. this.placeBallData = [];
  18250. this.shareDiamondTimes = 0;
  18251. this.dailyVideoShareTimes = 0;
  18252. this.secretary = [1, 0];
  18253. this.curSecretary = 0;
  18254. this.ballRod = [1, 0, 0, 0, 0, 1];
  18255. this.curBallRod = 5;
  18256. this.signData = 0;
  18257. this.signTime = 0;
  18258. this.drawTimes = 0;
  18259. this.drawAwardTimes = 0;
  18260. this.dailyfreeDrawTimes = 1;
  18261. this.power = 5;
  18262. this.powerTime = 0;
  18263. this.challengeTimes = 0;
  18264. this.extraSign = 0;
  18265. this.classicTimes = 0;
  18266. this.guideHelpLine = 0;
  18267. this.newUser = true;
  18268. this.rootBallFoul = 0;
  18269. this.timeoutFoul = 0;
  18270. this.roleList = [1];
  18271. }
  18272. saveData() {
  18273. let data = {};
  18274. for (let k in this) {
  18275. data[k.toString()] = this[k];
  18276. }
  18277. Laya.LocalStorage.setItem(dataName + "userdata", JSON.stringify(data));
  18278. }
  18279. getData() {
  18280. let ld = Laya.LocalStorage.getItem(dataName + "userdata");
  18281. if (ld) {
  18282. let localData = JSON.parse(ld);
  18283. if (localData) {
  18284. for (let k in this) {
  18285. let key = k.toString();
  18286. let data = localData[key];
  18287. if (data != undefined) {
  18288. this[k] = data;
  18289. }
  18290. }
  18291. }
  18292. }
  18293. }
  18294. }
  18295. class ItemData {
  18296. constructor() {
  18297. this.itemList = {};
  18298. this.itemList[101] = { id: 101, count: 1, adnum: 0, active: true };
  18299. this.itemList[201] = { id: 201, count: 1, adnum: 0, active: true };
  18300. }
  18301. saveData() {
  18302. Laya.LocalStorage.setItem(dataName + "itemdata", JSON.stringify(this.itemList));
  18303. }
  18304. getData() {
  18305. let ld = Laya.LocalStorage.getItem(dataName + "itemdata");
  18306. if (ld) {
  18307. let localData = JSON.parse(ld);
  18308. if (localData) {
  18309. this.itemList = localData;
  18310. }
  18311. }
  18312. }
  18313. }
  18314. class GameData {
  18315. constructor() {
  18316. this.curLevel = 0;
  18317. this.gameType = 1;
  18318. this.signIdx = 0;
  18319. this.signMax = 0;
  18320. this.rotaryTime = 0;
  18321. this.rotaryCount = 0;
  18322. this.rotaryList = [];
  18323. this.diyCount = 3;
  18324. this.awardIdx = 0;
  18325. this.shareNum = 2;
  18326. this.rankWeek = 0;
  18327. this.rankScore = 0;
  18328. this.gameCount = 0;
  18329. this.trySkill = -1;
  18330. this.tryTime = 0;
  18331. }
  18332. saveData() {
  18333. let data = {};
  18334. for (let k in this) {
  18335. data[k.toString()] = this[k];
  18336. }
  18337. Laya.LocalStorage.setItem(dataName + "gamedata", JSON.stringify(data));
  18338. }
  18339. getData() {
  18340. let ld = Laya.LocalStorage.getItem(dataName + "gamedata");
  18341. if (ld) {
  18342. let localData = JSON.parse(ld);
  18343. if (localData) {
  18344. for (let k in this) {
  18345. let key = k.toString();
  18346. let data = localData[key];
  18347. if (data != undefined) {
  18348. this[k] = data;
  18349. }
  18350. }
  18351. }
  18352. }
  18353. }
  18354. }
  18355. class Diy2025GameData {
  18356. constructor() {
  18357. this.challengeMode_overLev = 0;
  18358. this.xszyForClassic = false;
  18359. this.xszyForChallenge = false;
  18360. }
  18361. saveData() {
  18362. let data = {};
  18363. for (let k in this) {
  18364. data[k.toString()] = this[k];
  18365. }
  18366. Laya.LocalStorage.setItem(dataName + "diydata", JSON.stringify(data));
  18367. }
  18368. getData() {
  18369. let ld = Laya.LocalStorage.getItem(dataName + "diydata");
  18370. if (ld) {
  18371. let localData = JSON.parse(ld);
  18372. if (localData) {
  18373. for (let k in this) {
  18374. let key = k.toString();
  18375. let data = localData[key];
  18376. if (data != undefined) {
  18377. this[k] = data;
  18378. }
  18379. }
  18380. }
  18381. }
  18382. }
  18383. }
  18384. class UIFuli1 extends UIBase {
  18385. constructor() {
  18386. super();
  18387. this.jiage = 4.99;
  18388. }
  18389. onConstructor() {
  18390. this.ui = ui_UIFuli1.createInstance();
  18391. this.contentPane = this.ui;
  18392. this.isEject = false;
  18393. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18394. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18395. }
  18396. show() {
  18397. super.show();
  18398. this.x = (Laya.stage.width - this.width) / 2;
  18399. this.y = (Laya.stage.height - this.height) / 2;
  18400. this.ui.n2.txt_price.text = "$" + this.jiage;
  18401. this.ui.n2.n_zzq_fl1.url = 'res/fuli1.png';
  18402. this.setGlobalFont(this.ui);
  18403. }
  18404. closeSelf() {
  18405. DataMgr.loadUserSpOrderForAd();
  18406. this.hide();
  18407. }
  18408. gotoBuy() {
  18409. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18410. if (userInfo != null) {
  18411. let token = userInfo.token;
  18412. let ggSpid = 'com.vadltq.strike.ball.cue.noads.pack';
  18413. JSBridgeUtils.instance.startGgPay(token, ggSpid, 1);
  18414. DataMgr.loadUserSpOrderForAd();
  18415. return;
  18416. }
  18417. else {
  18418. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18419. }
  18420. }
  18421. gotoBuy2() {
  18422. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18423. if (userInfo == null) {
  18424. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18425. return;
  18426. }
  18427. let reqData = xGame.httpMgr.getReqData();
  18428. let pd = JSON.parse(reqData);
  18429. pd.productId = 1;
  18430. reqData = JSON.stringify(pd);
  18431. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18432. try {
  18433. console.log('zh:buySp res = ' + JSON.stringify(res));
  18434. let code = res.code;
  18435. let msg = res.msg;
  18436. if (code == 401) {
  18437. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18438. alert(TIP_MSG_key.loginTimeOut);
  18439. xGame.uiMgr.Show(UIMsg, msg);
  18440. return;
  18441. }
  18442. if (code == 200) {
  18443. xGame.uiMgr.Show(UIMsg, msg);
  18444. DataMgr.loadUserSpOrderForAd();
  18445. DataMgr.getUserZiChanInfo(false);
  18446. this.closeSelf();
  18447. }
  18448. else {
  18449. xGame.uiMgr.Show(UIMsg, msg);
  18450. }
  18451. }
  18452. catch (error) {
  18453. console.log('error=' + error);
  18454. alert(error);
  18455. }
  18456. finally {
  18457. }
  18458. });
  18459. }
  18460. }
  18461. UIFuli1.uiName = "UIFuli1";
  18462. class UIFuli2 extends UIBase {
  18463. constructor() {
  18464. super();
  18465. this.jiage = 14.99;
  18466. }
  18467. onConstructor() {
  18468. this.ui = ui_UIFuli2.createInstance();
  18469. this.contentPane = this.ui;
  18470. this.isEject = false;
  18471. this.addUIClick(this.ui.n2.n_buy, this.gotoBuy);
  18472. this.addUIClick(this.ui.n2.n_no, this.closeSelf);
  18473. }
  18474. show() {
  18475. super.show();
  18476. this.x = (Laya.stage.width - this.width) / 2;
  18477. this.y = (Laya.stage.height - this.height) / 2;
  18478. this.ui.n2.txt_price.text = "$" + this.jiage;
  18479. this.ui.n2.n_zzq_fl2.url = 'res/fuli2.png';
  18480. this.setGlobalFont(this.ui);
  18481. }
  18482. closeSelf() {
  18483. DataMgr.loadUserSpOrderForAd();
  18484. this.hide();
  18485. }
  18486. gotoBuy() {
  18487. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18488. if (userInfo != null) {
  18489. let token = userInfo.token;
  18490. let ggSpid = 'com.vadltq.strike.ball.cue.passcard';
  18491. JSBridgeUtils.instance.startGgPay(token, ggSpid, 7);
  18492. DataMgr.loadUserSpOrderForAd();
  18493. return;
  18494. }
  18495. else {
  18496. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18497. }
  18498. }
  18499. gotoBuy1() {
  18500. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  18501. if (userInfo == null) {
  18502. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  18503. return;
  18504. }
  18505. let reqData = xGame.httpMgr.getReqData();
  18506. let pd = JSON.parse(reqData);
  18507. pd.productId = 2;
  18508. reqData = JSON.stringify(pd);
  18509. xGame.httpMgr.sendPost2025('user/buyFuLi', reqData, (res) => {
  18510. try {
  18511. console.log('zh:buySp res = ' + JSON.stringify(res));
  18512. let code = res.code;
  18513. let msg = res.msg;
  18514. if (code == 401) {
  18515. Laya.LocalStorage.removeItem(keyForLoginInfo);
  18516. alert(TIP_MSG_key.loginTimeOut);
  18517. xGame.uiMgr.Show(UIMsg, msg);
  18518. return;
  18519. }
  18520. if (code == 200) {
  18521. xGame.uiMgr.Show(UIMsg, msg);
  18522. DataMgr.loadUserSpOrderForAd();
  18523. DataMgr.getUserZiChanInfo(false);
  18524. this.closeSelf();
  18525. }
  18526. else {
  18527. xGame.uiMgr.Show(UIMsg, msg);
  18528. }
  18529. }
  18530. catch (error) {
  18531. console.log('error=' + error);
  18532. alert(error);
  18533. }
  18534. finally {
  18535. }
  18536. });
  18537. }
  18538. }
  18539. UIFuli2.uiName = "UIFuli2";
  18540. class DataMgr {
  18541. static Init() {
  18542. this.userData = new UserData();
  18543. this.gameData = new GameData();
  18544. this.itemData = new ItemData();
  18545. this.diyGameData = new Diy2025GameData();
  18546. this.userData.getData();
  18547. this.gameData.getData();
  18548. this.itemData.getData();
  18549. this.diyGameData.getData();
  18550. this.roleId = this.userData.roleId;
  18551. this.resetUse();
  18552. }
  18553. static isNewDay() {
  18554. Moyu.isNewDay(this, (isnew) => {
  18555. xGame.common.isNewDay = isnew;
  18556. if (!isnew)
  18557. return;
  18558. DataMgr.setShareDiamondTimes(0, false);
  18559. DataMgr.setDailyVideoShareTimes(0, false);
  18560. DataMgr.setDailyfreeDrawTimes(1);
  18561. DataMgr.setExtraSign(0);
  18562. });
  18563. }
  18564. static deletData() {
  18565. Laya.LocalStorage.clear();
  18566. }
  18567. static upRankData() {
  18568. let num = xGame.common.getAllStarNum();
  18569. if (num > 0)
  18570. Moyu.upRankData(xGame.common.curRankID, num);
  18571. }
  18572. static addItem(id, count = 1) {
  18573. let v = this.itemData.itemList[id];
  18574. if (!v)
  18575. v = { id: id, count: count, adnum: 0, active: true };
  18576. else {
  18577. if (v.active) {
  18578. v.count += count;
  18579. }
  18580. else {
  18581. v.count = count;
  18582. v.active = true;
  18583. }
  18584. }
  18585. this.itemData.itemList[id] = v;
  18586. xGame.soundMgr.playGetSound();
  18587. this.saveItemData();
  18588. }
  18589. static hasItem(id) {
  18590. let v = this.itemData.itemList[id];
  18591. if (v && v.active)
  18592. return true;
  18593. return false;
  18594. }
  18595. static getItem(id) {
  18596. let v = this.itemData.itemList[id];
  18597. return v;
  18598. }
  18599. static getItemCount(id) {
  18600. let v = this.itemData.itemList[id];
  18601. if (v && v.active)
  18602. return v.count;
  18603. return 0;
  18604. }
  18605. static getItemAd(id) {
  18606. let v = this.itemData.itemList[id];
  18607. if (v) {
  18608. return v.adnum;
  18609. }
  18610. return 0;
  18611. }
  18612. static onItemAd(id, num = 1) {
  18613. let v = this.itemData.itemList[id];
  18614. if (!v)
  18615. v = { id: id, count: 1, adnum: num, active: false };
  18616. else
  18617. v.adnum += num;
  18618. this.itemData.itemList[id] = v;
  18619. this.saveItemData();
  18620. }
  18621. static costItem(id, count) {
  18622. let v = this.itemData.itemList[id];
  18623. if (v && v.active) {
  18624. if (v.count < count)
  18625. return false;
  18626. else {
  18627. v.count -= count;
  18628. this.itemData.itemList[id] = v;
  18629. return true;
  18630. }
  18631. }
  18632. return false;
  18633. }
  18634. static resetUse() {
  18635. this.dressId = this.userData.dressId;
  18636. this.itemId = this.userData.itemId;
  18637. }
  18638. static passLevel() {
  18639. if (this.curLevel == this.gameData.curLevel && this.curLevel <= this.maxLevel)
  18640. this.gameData.curLevel++;
  18641. this.curLevel = this.gameData.curLevel;
  18642. this.saveGameData();
  18643. }
  18644. static useRole(id) {
  18645. this.roleId = id;
  18646. if (this.hasRole(id)) {
  18647. this.userData.roleId = id;
  18648. this.saveUserData();
  18649. }
  18650. }
  18651. static addRole(id) {
  18652. if (this.hasRole(id))
  18653. return;
  18654. this.userData.roleList.push(id);
  18655. this.saveUserData();
  18656. }
  18657. static hasRole(id) {
  18658. return this.userData.roleList.indexOf(id) >= 0;
  18659. }
  18660. static gemEnough(num) {
  18661. return this.userData.gemNum >= num;
  18662. }
  18663. static roleHasAd(id) {
  18664. let count = this.userData.roleAds[id];
  18665. if (count != undefined && count >= 0)
  18666. return true;
  18667. else
  18668. return false;
  18669. }
  18670. static saveUserData(time = 500, event, arg) {
  18671. if (this.userSaving)
  18672. return;
  18673. this.userSaving = true;
  18674. Laya.timer.once(time, this, () => {
  18675. this.userSaving = false;
  18676. this.userData.saveData();
  18677. if (event)
  18678. xGame.eventMgr.event(event, arg);
  18679. });
  18680. }
  18681. static updateUserNickName(loginUserName) {
  18682. let kyeStr = 'moyudata_180';
  18683. console.log('zh:################### kyeStr=' + kyeStr);
  18684. const moyudata = Laya.LocalStorage.getItem(kyeStr);
  18685. if (moyudata) {
  18686. const obj = JSON.parse(moyudata);
  18687. obj.nickName = loginUserName;
  18688. Laya.LocalStorage.setItem(kyeStr, JSON.stringify(obj));
  18689. console.log('zh:################### updateUserNickName');
  18690. }
  18691. }
  18692. static saveGameData() {
  18693. if (this.gameSaving)
  18694. return;
  18695. this.gameSaving = true;
  18696. Laya.timer.once(1000, this, () => {
  18697. this.gameSaving = false;
  18698. this.gameData.saveData();
  18699. });
  18700. }
  18701. static saveItemData() {
  18702. let fun = () => {
  18703. this.itemData.saveData();
  18704. };
  18705. Laya.timer.clear(this, fun);
  18706. Laya.timer.once(500, this, fun);
  18707. }
  18708. static saveData() {
  18709. this.saveUserData();
  18710. this.saveGameData();
  18711. }
  18712. static getBigSkillList() {
  18713. return this.userData.bigSkills;
  18714. }
  18715. static getBigSkillByIndex(index) {
  18716. return this.userData.bigSkills[index];
  18717. }
  18718. static setBigSkill(index, val, addUp = true) {
  18719. if (addUp) {
  18720. this.userData.bigSkills[index] += val;
  18721. }
  18722. else {
  18723. this.userData.bigSkills[index] = val;
  18724. }
  18725. this.saveUserData();
  18726. console.log("zh:大技能更新");
  18727. this.updateUserInfo2Server("bigSkills");
  18728. }
  18729. static setBigSkillFormServer(jsonStr) {
  18730. console.log("zh:大技能 setBigSkillFormServer =" + jsonStr);
  18731. this.userData.bigSkills = JSON.parse(jsonStr);
  18732. this.saveUserData();
  18733. }
  18734. static coinEnough(need) {
  18735. if (typeof need != "number") {
  18736. console.error("金币格式错误");
  18737. return;
  18738. }
  18739. return this.userData.coin >= need;
  18740. }
  18741. static setCoin(val) {
  18742. if (typeof val != "number") {
  18743. return;
  18744. }
  18745. this.userData.coin += val;
  18746. this.saveUserData();
  18747. xGame.eventMgr.event(COIN_CHANGE);
  18748. this.updateUserInfo2Server("jb");
  18749. }
  18750. static setCoin2(val) {
  18751. if (typeof val != "number") {
  18752. return;
  18753. }
  18754. this.userData.coin = val;
  18755. this.saveUserData();
  18756. xGame.eventMgr.event(COIN_CHANGE);
  18757. }
  18758. static setCoinFormServer(val) {
  18759. if (typeof val != "number") {
  18760. return;
  18761. }
  18762. this.userData.coin = val;
  18763. this.saveUserData();
  18764. console.log('zh:通知更新金币变化' + val);
  18765. xGame.eventMgr.event(COIN_CHANGE);
  18766. }
  18767. static getCoin() {
  18768. return this.userData.coin;
  18769. }
  18770. static diamondEnough(need) {
  18771. if (typeof need != "number") {
  18772. console.error("金币格式错误");
  18773. return;
  18774. }
  18775. return this.userData.diamond >= need;
  18776. }
  18777. static setDiamond(val) {
  18778. if (typeof val != "number") {
  18779. return;
  18780. }
  18781. this.userData.diamond += val;
  18782. this.saveUserData();
  18783. xGame.eventMgr.event(DIAMOND_CHANGE);
  18784. this.updateUserInfo2Server("zs");
  18785. }
  18786. static setDiamond2(val) {
  18787. if (typeof val != "number") {
  18788. return;
  18789. }
  18790. this.userData.diamond = val;
  18791. this.saveUserData();
  18792. xGame.eventMgr.event(DIAMOND_CHANGE);
  18793. }
  18794. static setDiamondFormServer(val) {
  18795. if (typeof val != "number") {
  18796. return;
  18797. }
  18798. this.userData.diamond = val;
  18799. this.saveUserData();
  18800. console.log('zh:通知更新钻石变化' + val);
  18801. xGame.eventMgr.event(DIAMOND_CHANGE);
  18802. }
  18803. static getDiamond() {
  18804. return this.userData.diamond;
  18805. }
  18806. static getSkillSuccessTimes() {
  18807. return this.userData.skillSuccessTimes;
  18808. }
  18809. static setSkillSuccessTimes(val, addUp = true) {
  18810. if (addUp)
  18811. this.userData.skillSuccessTimes += val;
  18812. else
  18813. this.userData.skillSuccessTimes = val;
  18814. this.saveUserData();
  18815. }
  18816. static getSkillAccTimes() {
  18817. return this.userData.skillAccTimes;
  18818. }
  18819. static setSkillAccTimes(val) {
  18820. this.userData.skillAccTimes += val;
  18821. this.saveUserData();
  18822. }
  18823. static getSkillGuide() {
  18824. if (!xGame.common.openGuide) {
  18825. return 1;
  18826. }
  18827. return this.userData.skillGuide;
  18828. }
  18829. static setSkillGuide(val) {
  18830. this.userData.skillGuide = val;
  18831. this.saveUserData();
  18832. }
  18833. static setLianXiGuide(val) {
  18834. this.userData.lianXiGuide = val;
  18835. this.saveUserData();
  18836. }
  18837. static getLianXiGuide() {
  18838. return this.userData.lianXiGuide;
  18839. }
  18840. static getPlaceBallLevelList() {
  18841. return this.userData.placeBallData;
  18842. }
  18843. static setPlaceBallLevelList(objStr) {
  18844. if (objStr) {
  18845. let obj = JSON.parse(objStr);
  18846. this.userData.placeBallData = obj;
  18847. let cd = obj.length;
  18848. console.log('zh:setPlaceBallLevelList cd=' + cd);
  18849. xGame.common.placeBallCurLevel = cd;
  18850. DataMgr.setChallengeMode_overLev(cd);
  18851. this.saveUserData();
  18852. }
  18853. else {
  18854. this.userData.placeBallData = [];
  18855. this.saveUserData();
  18856. }
  18857. }
  18858. static getPlaceBallLevel(level) {
  18859. let arr = this.userData.placeBallData;
  18860. let index = level - 1;
  18861. let out;
  18862. if (arr[index]) {
  18863. out = arr[index];
  18864. }
  18865. else {
  18866. let max = arr.length;
  18867. if (max == index) {
  18868. out = {
  18869. star: 0,
  18870. play: true,
  18871. isCur: true,
  18872. getAward: false
  18873. };
  18874. }
  18875. else {
  18876. out = {
  18877. star: 0,
  18878. play: false,
  18879. getAward: false
  18880. };
  18881. }
  18882. }
  18883. return out;
  18884. }
  18885. static setPlaceBallLevel(level, star) {
  18886. let arr = this.userData.placeBallData;
  18887. let index = level - 1;
  18888. if (arr[index]) {
  18889. arr[index].star = Math.max(arr[index].star, star);
  18890. }
  18891. else {
  18892. let max = arr.length;
  18893. if (max == index) {
  18894. arr.push({
  18895. star: star,
  18896. play: true,
  18897. getAward: false
  18898. });
  18899. }
  18900. else {
  18901. console.error("关卡存储出错");
  18902. }
  18903. }
  18904. this.saveUserData();
  18905. }
  18906. static setPlaceBallAward(level) {
  18907. let arr = this.userData.placeBallData;
  18908. let index = level - 1;
  18909. if (arr[index]) {
  18910. arr[index].getAward = true;
  18911. }
  18912. this.saveUserData();
  18913. }
  18914. static getShareDiamondTimes() {
  18915. return this.userData.shareDiamondTimes;
  18916. }
  18917. static setShareDiamondTimes(val, addUp = true) {
  18918. if (addUp) {
  18919. this.userData.shareDiamondTimes += val;
  18920. }
  18921. else {
  18922. this.userData.shareDiamondTimes = val;
  18923. }
  18924. this.saveUserData();
  18925. }
  18926. static getDailyVideoShareTimes() {
  18927. return this.userData.dailyVideoShareTimes;
  18928. }
  18929. static setDailyVideoShareTimes(val, addUp = true) {
  18930. if (addUp) {
  18931. this.userData.dailyVideoShareTimes += val;
  18932. }
  18933. else {
  18934. this.userData.dailyVideoShareTimes = val;
  18935. }
  18936. this.saveUserData();
  18937. }
  18938. static getSecretary(index) {
  18939. return this.userData.secretary[index];
  18940. }
  18941. static setSecretary(index, val) {
  18942. this.userData.secretary[index] = val;
  18943. this.saveUserData();
  18944. }
  18945. static getCurSecretary() {
  18946. return this.userData.curSecretary;
  18947. }
  18948. static setCurSecretary(index) {
  18949. this.userData.curSecretary = index;
  18950. this.saveUserData();
  18951. xGame.eventMgr.event(CHANGE_SECRETARY, index);
  18952. }
  18953. static getBallRod(index) {
  18954. return this.userData.ballRod[index];
  18955. }
  18956. static setBallRod(index, val) {
  18957. this.userData.ballRod[index] = val;
  18958. this.saveUserData();
  18959. }
  18960. static setBallRodFormServer(haveQiuGanJsonStr) {
  18961. if (!haveQiuGanJsonStr) {
  18962. console.log("setBallRodFormServer数据为空或未定义");
  18963. return;
  18964. }
  18965. let haveQiuGanJsonObj = JSON.parse(haveQiuGanJsonStr);
  18966. const keys = Object.keys(haveQiuGanJsonObj);
  18967. keys.forEach(key => {
  18968. let v = haveQiuGanJsonObj[key];
  18969. let k = parseInt(key);
  18970. let idx = k - 1;
  18971. this.userData.ballRod[idx] = v;
  18972. });
  18973. }
  18974. static getCurBallRod() {
  18975. return this.userData.curBallRod;
  18976. }
  18977. static setCurBallRod(index) {
  18978. this.userData.curBallRod = index;
  18979. this.saveUserData();
  18980. }
  18981. static setSignData(val) {
  18982. this.userData.signData = val;
  18983. this.saveUserData();
  18984. }
  18985. static getSignData() {
  18986. return this.userData.signData;
  18987. }
  18988. static setSignTime(val) {
  18989. this.userData.signTime = val;
  18990. this.saveUserData();
  18991. }
  18992. static getSignTime() {
  18993. return this.userData.signTime;
  18994. }
  18995. static getDrawTimes() {
  18996. return this.userData.drawTimes;
  18997. }
  18998. static setDrawTimes(val, addUp = true) {
  18999. if (addUp) {
  19000. this.userData.drawTimes += val;
  19001. }
  19002. else {
  19003. this.userData.drawTimes = val;
  19004. }
  19005. this.saveUserData();
  19006. }
  19007. static getDrawAwardTimes() {
  19008. return this.userData.drawAwardTimes;
  19009. }
  19010. static setDrawAwardTimes(val) {
  19011. this.userData.drawAwardTimes = val;
  19012. this.saveUserData();
  19013. }
  19014. static getDailyfreeDrawTimes() {
  19015. return this.userData.dailyfreeDrawTimes;
  19016. }
  19017. static setDailyfreeDrawTimes(val) {
  19018. this.userData.dailyfreeDrawTimes = val;
  19019. this.saveUserData();
  19020. }
  19021. static setPower(val, addUp = true) {
  19022. if (addUp)
  19023. this.userData.power += val;
  19024. else
  19025. this.userData.power = val;
  19026. if (this.userData.power >= xGame.common.maxPower) {
  19027. this.userData.power = xGame.common.maxPower;
  19028. }
  19029. xGame.eventMgr.event(POWER_CHANGE, val);
  19030. this.saveUserData();
  19031. this.updateUserInfo2Server("power");
  19032. }
  19033. static getPower() {
  19034. return this.userData.power;
  19035. }
  19036. static setPowerTime(val) {
  19037. this.userData.powerTime = val;
  19038. this.saveUserData();
  19039. }
  19040. static getPowerTime() {
  19041. return this.userData.powerTime;
  19042. }
  19043. static powerEnough() {
  19044. return this.getPower() > 0;
  19045. }
  19046. static getChallengeTimes() {
  19047. return this.userData.challengeTimes;
  19048. }
  19049. static setChallengeTimes(val) {
  19050. this.userData.challengeTimes += val;
  19051. this.saveUserData();
  19052. }
  19053. static getExtraSign() {
  19054. return this.userData.extraSign;
  19055. }
  19056. static setExtraSign(val) {
  19057. this.userData.extraSign = val;
  19058. this.saveUserData();
  19059. }
  19060. static getClassicTimes() {
  19061. return this.userData.classicTimes;
  19062. }
  19063. static setClassicTimes() {
  19064. this.userData.classicTimes += 1;
  19065. this.saveUserData();
  19066. }
  19067. static getGuideHelpLine() {
  19068. return this.userData.guideHelpLine;
  19069. }
  19070. static setGuideHelpLine() {
  19071. this.userData.guideHelpLine = 1;
  19072. this.saveUserData();
  19073. }
  19074. static getNewUser() {
  19075. return this.userData.newUser;
  19076. }
  19077. static setNewUser() {
  19078. this.userData.newUser = false;
  19079. this.saveUserData();
  19080. }
  19081. static getRootBallFoul() {
  19082. return this.userData.rootBallFoul;
  19083. }
  19084. static setRootBallFoul() {
  19085. this.userData.rootBallFoul = 1;
  19086. this.saveUserData();
  19087. }
  19088. static getTimeoutFoul() {
  19089. return this.userData.timeoutFoul;
  19090. }
  19091. static setTimeoutFoul() {
  19092. this.userData.timeoutFoul = 1;
  19093. this.saveUserData();
  19094. }
  19095. static saveDiyGameData() {
  19096. if (this.diyGameSaving)
  19097. return;
  19098. this.diyGameSaving = true;
  19099. Laya.timer.once(500, this, () => {
  19100. this.diyGameSaving = false;
  19101. this.diyGameData.saveData();
  19102. });
  19103. }
  19104. static getChallengeMode_overLev() {
  19105. this.challengeMode_overLev = this.diyGameData.challengeMode_overLev;
  19106. return this.challengeMode_overLev;
  19107. }
  19108. static setChallengeMode_overLev(levNum) {
  19109. this.diyGameData.challengeMode_overLev = levNum;
  19110. this.saveDiyGameData();
  19111. }
  19112. static updateUserInfo2Server(type, count = 0) {
  19113. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19114. if (userInfoData == null) {
  19115. return;
  19116. }
  19117. let reqData = xGame.httpMgr.getReqData();
  19118. let rd = JSON.parse(reqData);
  19119. rd.dataType = type;
  19120. let dataValue = 0;
  19121. if (type == "zs") {
  19122. dataValue = this.getDiamond();
  19123. }
  19124. if (type == "jb") {
  19125. dataValue = this.getCoin();
  19126. }
  19127. if (type == "power") {
  19128. dataValue = this.getPower();
  19129. }
  19130. rd.dataValue = dataValue;
  19131. if (type == "bigSkills") {
  19132. let dataValueStr = this.userData.bigSkills;
  19133. let dvsJson = JSON.parse("[" + dataValueStr + "]");
  19134. rd.dataValueStr = JSON.stringify(dvsJson);
  19135. }
  19136. reqData = JSON.stringify(rd);
  19137. xGame.httpMgr.sendPost2025('user/update', reqData, (res) => {
  19138. try {
  19139. let code = res.code;
  19140. let data = res.data;
  19141. if (code == 401) {
  19142. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19143. console.log('zh:保存资产信息失败,请重新登录 ');
  19144. return;
  19145. }
  19146. if (code == 200) {
  19147. console.log('zh:更新账号资产OK' + JSON.stringify(res));
  19148. }
  19149. else {
  19150. console.log('zh:更新账号资产fa' + JSON.stringify(res));
  19151. }
  19152. }
  19153. catch (error) {
  19154. console.log('error=' + error);
  19155. alert("Please check your network connection.");
  19156. }
  19157. finally {
  19158. }
  19159. });
  19160. }
  19161. static getUserZiChanInfo(winTip = false) {
  19162. console.log('zh:getUserZCI');
  19163. const userInfoData = Laya.LocalStorage.getItem(keyForLoginInfo);
  19164. console.log('zh:userInfoData=' + userInfoData);
  19165. if (userInfoData == null || userInfoData == "" || userInfoData === "null") {
  19166. if (winTip) {
  19167. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19168. }
  19169. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19170. return;
  19171. }
  19172. let reqData = xGame.httpMgr.getReqData();
  19173. xGame.httpMgr.sendPost2025('user/getUserGameInfo', reqData, (res) => {
  19174. try {
  19175. console.log('zh:buySp res = ' + JSON.stringify(res));
  19176. let code = res.code;
  19177. let msg = res.msg;
  19178. if (code == 401) {
  19179. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19180. if (winTip) {
  19181. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19182. }
  19183. return;
  19184. }
  19185. if (code == 200) {
  19186. let d = res.data;
  19187. let zuanShi = d.zuanShi;
  19188. let jinBi = d.jinBi;
  19189. let haveQiuGanJson = d.haveQiuGanJson;
  19190. let signData = d.signData;
  19191. let placeBallData = d.placeBallData;
  19192. let bigSkills = d.bigSkills;
  19193. DataMgr.setDiamondFormServer(zuanShi);
  19194. DataMgr.setCoinFormServer(jinBi);
  19195. DataMgr.setBallRodFormServer(haveQiuGanJson);
  19196. DataMgr.setPlaceBallLevelList(placeBallData);
  19197. if (signData && signData > 0) {
  19198. DataMgr.setSignData(signData);
  19199. }
  19200. DataMgr.setBigSkillFormServer(bigSkills);
  19201. }
  19202. else {
  19203. console.log("zh:更新用户资产信息error" + msg);
  19204. if (winTip) {
  19205. xGame.uiMgr.Show(UIMsg, msg);
  19206. }
  19207. }
  19208. }
  19209. catch (error) {
  19210. console.log('error=' + error);
  19211. if (winTip) {
  19212. alert(error);
  19213. }
  19214. }
  19215. finally {
  19216. console.log("zh:更新用户资产信息结束");
  19217. }
  19218. });
  19219. }
  19220. static updateLocalUserDataForSpid17(spid, isBuyOk) {
  19221. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19222. console.log('zh:updateLocalUserData=' + userInfo);
  19223. if (userInfo != null) {
  19224. if (!userInfo.buySpids) {
  19225. userInfo.buySpids = { 1: false, 7: false };
  19226. }
  19227. else {
  19228. console.log('zh:检查 userInfo.buySpidsX[' + spid + '] ' + userInfo.buySpids[spid]);
  19229. }
  19230. userInfo.buySpids[spid] = isBuyOk;
  19231. LocalStorageManager.setItem(keyForLoginInfo, userInfo);
  19232. }
  19233. else {
  19234. }
  19235. }
  19236. static loadUserSpOrderForAd() {
  19237. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19238. if (userInfo == null) {
  19239. return;
  19240. }
  19241. console.log('zh:重新加载更新广告权利');
  19242. let reqData = xGame.httpMgr.getReqData();
  19243. xGame.httpMgr.sendPost2025('order/getOrderListForNoChongFuBuy', reqData, (res) => {
  19244. try {
  19245. console.log('zh:getOrderListForNoChongFuBuy res = ' + JSON.stringify(res));
  19246. let code = res.code;
  19247. let msg = res.msg;
  19248. if (code == 401) {
  19249. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19250. return;
  19251. }
  19252. if (code == 200) {
  19253. let data = res.data;
  19254. let buy_spid1 = false;
  19255. let buy_spid7 = false;
  19256. for (let index = 0; index < data.length; index++) {
  19257. let element = data[index];
  19258. console.log('zh:list element.spid = ' + element.spid);
  19259. if (element.spid == 1) {
  19260. buy_spid1 = true;
  19261. }
  19262. if (element.spid == 7) {
  19263. buy_spid7 = true;
  19264. }
  19265. }
  19266. DataMgr.updateLocalUserDataForSpid17(1, buy_spid1);
  19267. DataMgr.updateLocalUserDataForSpid17(7, buy_spid7);
  19268. }
  19269. else {
  19270. }
  19271. }
  19272. catch (error) {
  19273. console.log('error=' + error);
  19274. alert(error);
  19275. }
  19276. finally {
  19277. }
  19278. });
  19279. }
  19280. static checkForShowFuLi17AndAlert(alert_spid) {
  19281. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  19282. if (userInfo == null) {
  19283. if (alert_spid === 1) {
  19284. xGame.uiMgr.Show(UIFuli1);
  19285. }
  19286. if (alert_spid === 7) {
  19287. xGame.uiMgr.Show(UIFuli2);
  19288. }
  19289. return;
  19290. }
  19291. console.log('zh:是否需要展示福利 ' + alert_spid + ' 的弹窗');
  19292. let reqData = xGame.httpMgr.getReqData();
  19293. let pd = JSON.parse(reqData);
  19294. pd.productId = alert_spid;
  19295. reqData = JSON.stringify(pd);
  19296. xGame.httpMgr.sendPost2025('order/getOrderForBuyFuLiSpid17', reqData, (res) => {
  19297. try {
  19298. let code = res.code;
  19299. let msg = res.msg;
  19300. if (code == 401) {
  19301. Laya.LocalStorage.removeItem(keyForLoginInfo);
  19302. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  19303. return;
  19304. }
  19305. if (code == 200) {
  19306. let data = res.data;
  19307. let buyOkSpid = [];
  19308. for (let i = 0; i < data.length; i++) {
  19309. let item = data[i];
  19310. let temp_spid = item.spid;
  19311. DataMgr.updateLocalUserDataForSpid17(temp_spid, true);
  19312. buyOkSpid.push(temp_spid);
  19313. }
  19314. let isBuyOk7 = buyOkSpid.indexOf(7) >= 0 ? true : false;
  19315. if (isBuyOk7) {
  19316. return;
  19317. }
  19318. let isBuyOk = buyOkSpid.indexOf(alert_spid) >= 0 ? true : false;
  19319. if (isBuyOk && alert_spid === 1) {
  19320. return;
  19321. }
  19322. else {
  19323. if (isBuyOk === false) {
  19324. if (alert_spid === 1) {
  19325. xGame.uiMgr.Show(UIFuli1);
  19326. }
  19327. if (alert_spid === 7) {
  19328. xGame.uiMgr.Show(UIFuli2);
  19329. }
  19330. }
  19331. else {
  19332. console.log('zh:已经购买了SPID=' + alert_spid + ',不需要再提示用户了');
  19333. }
  19334. }
  19335. }
  19336. else {
  19337. xGame.uiMgr.Show(UIMsg, msg);
  19338. }
  19339. }
  19340. catch (error) {
  19341. console.log('error=' + error);
  19342. alert(error);
  19343. }
  19344. finally {
  19345. }
  19346. });
  19347. }
  19348. }
  19349. DataMgr.isNewUser = false;
  19350. DataMgr.fristEnter = true;
  19351. DataMgr.levelType = 0;
  19352. DataMgr.DIY_challengeMode_overLev_jieSuo_mark = true;
  19353. DataMgr.DIY_challengeMode_overLev_jieSuo_Classic = 2;
  19354. DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod = 4;
  19355. DataMgr.challengeMode_overLev = 0;
  19356. DataMgr.xszyForClassic = false;
  19357. DataMgr.xszyForChallenge = false;
  19358. DataMgr.awardId = 0;
  19359. DataMgr.awardCoin = 0;
  19360. DataMgr.sceneId = -1;
  19361. DataMgr.tryId = 0;
  19362. DataMgr.curLevel = 1;
  19363. DataMgr.vipLevel = 0;
  19364. DataMgr.maxLevel = 0;
  19365. DataMgr.awardRatio = 1;
  19366. DataMgr.gameList = [];
  19367. DataMgr.rankList = [];
  19368. DataMgr.recoverTime = 480000;
  19369. DataMgr.minScore = 0;
  19370. DataMgr.rankDis = 0;
  19371. DataMgr.userSaving = false;
  19372. DataMgr.gameSaving = false;
  19373. DataMgr.diyGameSaving = false;
  19374. class D3Tween extends Laya.Script3D {
  19375. constructor() {
  19376. super();
  19377. this.isInited = false;
  19378. }
  19379. ;
  19380. init() {
  19381. if (this.isInited)
  19382. return;
  19383. this.isInited = true;
  19384. this.gameObj = this.owner;
  19385. this.transform = this.gameObj.transform;
  19386. }
  19387. get rotX() {
  19388. return this.transform.localRotationEulerX;
  19389. }
  19390. set rotX(v) {
  19391. this.transform.localRotationEulerX = v;
  19392. }
  19393. get rotY() {
  19394. return this.transform.localRotationEulerY;
  19395. }
  19396. set rotY(v) {
  19397. this.transform.localRotationEulerY = v;
  19398. }
  19399. get rotZ() {
  19400. return this.transform.localRotationEulerZ;
  19401. }
  19402. set rotZ(v) {
  19403. this.transform.localRotationEulerZ = v;
  19404. }
  19405. get posX() {
  19406. return this.transform.localPositionX;
  19407. }
  19408. set posX(v) {
  19409. this.transform.localPositionX = v;
  19410. }
  19411. get posY() {
  19412. return this.transform.localPositionY;
  19413. }
  19414. set posY(v) {
  19415. this.transform.localPositionY = v;
  19416. }
  19417. get posZ() {
  19418. return this.transform.localPositionZ;
  19419. }
  19420. set posZ(v) {
  19421. this.transform.localPositionZ = v;
  19422. }
  19423. get rotation() {
  19424. return this.transform.localRotation;
  19425. }
  19426. set rotation(v) {
  19427. this.transform.localRotation = v;
  19428. }
  19429. }
  19430. class D2Hole extends Laya.Script {
  19431. constructor() { super(); }
  19432. onTriggerEnter(collider) {
  19433. if (xGame.common.d2World.rootBall.forceRun && collider.owner == xGame.common.d2World.rootBall.owner) {
  19434. return;
  19435. }
  19436. if (collider.label == "inner" && xGame.common.d2World.openCheckStill) {
  19437. if (collider.owner["mySrc"].isRunSkillAni) {
  19438. return;
  19439. }
  19440. if (collider.owner["mySrc"].number != 0) {
  19441. xGame.common.d2World.inHolesSpeed.push(collider.owner["mySrc"].rigy.speed);
  19442. }
  19443. xGame.common.ballColliHole(collider);
  19444. xGame.common.recoverCameraView();
  19445. }
  19446. }
  19447. }
  19448. class Table extends Laya.Script3D {
  19449. constructor() {
  19450. super();
  19451. this.isSetBorder = false;
  19452. this.inited = false;
  19453. }
  19454. ;
  19455. onAwake() {
  19456. this.init();
  19457. }
  19458. init() {
  19459. if (this.inited)
  19460. return;
  19461. this.inited = true;
  19462. this.gameObj = this.owner;
  19463. this.border = this.gameObj.getChildByName("border");
  19464. }
  19465. setBorderPos() {
  19466. if (this.isSetBorder)
  19467. return;
  19468. this.isSetBorder = true;
  19469. let ui = xGame.common.gameUI.ui;
  19470. let bar1 = this.border.getChildByName("bar1");
  19471. let bar2 = this.border.getChildByName("bar2");
  19472. let bar3 = this.border.getChildByName("bar3");
  19473. let bar4 = this.border.getChildByName("bar4");
  19474. let bar5 = this.border.getChildByName("bar5");
  19475. let bar6 = this.border.getChildByName("bar6");
  19476. this.setInfo(bar1, ui.border.bar1, "box");
  19477. this.setInfo(bar2, ui.border.bar2, "box");
  19478. this.setInfo(bar3, ui.border.bar3, "box");
  19479. this.setInfo(bar4, ui.border.bar4, "box");
  19480. this.setInfo(bar5, ui.border.bar5, "box");
  19481. this.setInfo(bar6, ui.border.bar6, "box");
  19482. let circle1 = this.border.getChildByName("circle1");
  19483. let circle2 = this.border.getChildByName("circle2");
  19484. let circle3 = this.border.getChildByName("circle3");
  19485. let circle4 = this.border.getChildByName("circle4");
  19486. let circle5 = this.border.getChildByName("circle5");
  19487. let circle6 = this.border.getChildByName("circle6");
  19488. this.setInfo(circle1, ui.border.circle1, "circle");
  19489. this.setInfo(circle2, ui.border.circle2, "circle");
  19490. this.setInfo(circle3, ui.border.circle3, "circle");
  19491. this.setInfo(circle4, ui.border.circle4, "circle");
  19492. this.setInfo(circle5, ui.border.circle5, "circle");
  19493. this.setInfo(circle6, ui.border.circle6, "circle");
  19494. this.initHolePos(ui.border.circle1.x, ui.border.circle1.y);
  19495. this.initHolePos(ui.border.circle2.x, ui.border.circle2.y);
  19496. this.initHolePos(ui.border.circle3.x, ui.border.circle3.y);
  19497. this.initHolePos(ui.border.circle4.x, ui.border.circle4.y);
  19498. this.initHolePos(ui.border.circle5.x, ui.border.circle5.y);
  19499. this.initHolePos(ui.border.circle6.x, ui.border.circle6.y);
  19500. let arr = xGame.common.gameMgr.holePosList;
  19501. xGame.common.gameMgr.posObj = {
  19502. "1": arr[0],
  19503. "3": arr[2],
  19504. "4": arr[3],
  19505. "6": arr[5]
  19506. };
  19507. }
  19508. initHolePos(x, y) {
  19509. if (x < 300)
  19510. x += 25;
  19511. else if (x > 1000)
  19512. x -= 25;
  19513. else if (y > 200)
  19514. y -= 10;
  19515. else
  19516. y += 10;
  19517. if (y < 200)
  19518. y += 30;
  19519. else if (y > 500)
  19520. y -= 30;
  19521. xGame.common.gameMgr.holePosList.push({ x: x, y: y });
  19522. }
  19523. setInfo(d3Obj, d2Obj, type) {
  19524. let ui = xGame.common.gameUI.ui;
  19525. let sprite = new Laya.Sprite();
  19526. ui.border.displayObject.addChild(sprite);
  19527. let colli = xGame.common.getCollider(type);
  19528. sprite.addComponentIntance(colli);
  19529. let rigy = xGame.common.getRigbody();
  19530. rigy.type = "static";
  19531. sprite.addComponentIntance(rigy);
  19532. let d3Pos = d3Obj.transform.position;
  19533. xGame.common.pos3to2Convert(d3Pos);
  19534. let scaleX = d3Obj.transform.localScaleX;
  19535. let scaleZ = d3Obj.transform.localScaleZ;
  19536. let width = xGame.common.scale3to2Convert(scaleZ);
  19537. let height = xGame.common.scale3to2Convert(scaleX);
  19538. sprite.pivotX = width / 2;
  19539. sprite.pivotY = height / 2;
  19540. sprite.x = d3Pos.x;
  19541. sprite.y = d3Pos.y;
  19542. sprite.width = width;
  19543. sprite.height = height;
  19544. d2Obj.x = d3Pos.x;
  19545. d2Obj.y = d3Pos.y;
  19546. d2Obj.width = width;
  19547. d2Obj.height = height;
  19548. if (type == "box") {
  19549. colli.width = width;
  19550. colli.height = height;
  19551. colli.isSensor = false;
  19552. colli.label = "border";
  19553. }
  19554. else {
  19555. colli.radius = width / 2;
  19556. colli.isSensor = true;
  19557. colli.label = "hole";
  19558. sprite.addComponent(D2Hole);
  19559. }
  19560. }
  19561. }
  19562. class D3World extends Laya.Script3D {
  19563. constructor() {
  19564. super();
  19565. this.loadNum = 0;
  19566. this.setLoadNum = 7;
  19567. this.visitRootObj = { posX: 0, posY: 0, posZ: 0, rotX: 0, rotY: 0, rotZ: 0 };
  19568. }
  19569. onAwake() {
  19570. }
  19571. loadScene() {
  19572. this.scene = this.owner;
  19573. let url = `res/unityRes/root.lh`;
  19574. Laya.loader.create(url, Laya.Handler.create(this, (prefab) => {
  19575. this.scene.addChild(prefab);
  19576. this.camera = this.scene.getChildByName("root").getChildByName("cameraRoot").getChildByName("mainCamera");
  19577. this.putCameraInfo();
  19578. this.camera.enableHDR = false;
  19579. this.ballRoot = this.scene.getChildByName("root").getChildByName("ballRoot");
  19580. this.tableRoot = this.scene.getChildByName("root").getChildByName("tableRoot");
  19581. this.roomRoot = this.scene.getChildByName("root").getChildByName("roomRoot");
  19582. this.particialRoot = this.scene.getChildByName("root").getChildByName("particialRoot");
  19583. this.knifeRoot = this.scene.getChildByName("root").getChildByName("knifeRoot");
  19584. this.knife = this.scene.getChildByName("root").getChildByName("knife");
  19585. this.knife.active = false;
  19586. this.loadD3Obj();
  19587. }));
  19588. }
  19589. putCameraInfo() {
  19590. let root = this.scene.getChildByName("root").getChildByName("cameraRoot");
  19591. this.cameraObj = new cameraType();
  19592. this.cameraObj.angle1 = root.getChildByName("angle1").addComponent(D3Tween);
  19593. this.cameraObj.angle3 = root.getChildByName("angle3").addComponent(D3Tween);
  19594. this.cameraObj.angle4 = root.getChildByName("angle4").addComponent(D3Tween);
  19595. this.cameraObj.angle6 = root.getChildByName("angle6").addComponent(D3Tween);
  19596. this.cameraObj.firstAngle = root.getChildByName("firstAngle").addComponent(D3Tween);
  19597. this.cameraObj.visitAngle = root.getChildByName("visitAngle").addComponent(D3Tween);
  19598. this.visitAngleChild = root.getChildByName("visitAngle").getChildByName("visitAngle").addComponent(D3Tween);
  19599. this.visitAngleChild.init();
  19600. this.visitRootObj.posX = this.visitAngleChild.posX;
  19601. this.visitRootObj.posY = this.visitAngleChild.posY;
  19602. this.visitRootObj.posZ = this.visitAngleChild.posZ;
  19603. this.visitRootObj.rotX = this.visitAngleChild.rotX;
  19604. this.visitRootObj.rotY = this.visitAngleChild.rotY;
  19605. this.visitRootObj.rotZ = this.visitAngleChild.rotZ;
  19606. this.cameraObj.mainCamera = root.getChildByName("mainCamera").addComponent(D3Tween);
  19607. xGame.common.showOneCamera("mainCamera");
  19608. }
  19609. loadD3Obj() {
  19610. this.loadTable();
  19611. this.loadRoom();
  19612. this.loadInHoleParticial();
  19613. this.loadIceParticial();
  19614. this.loadHitParticial();
  19615. this.loadFireworksParticial();
  19616. this.loadBall();
  19617. }
  19618. loadInHoleParticial() {
  19619. this.loadD3Res("inHoleEft", "", (prefab) => {
  19620. prefab.addComponent(Partical);
  19621. xGame.poolD3Mgr.createList(poolKey.inHoleEft, prefab, this.particialRoot);
  19622. });
  19623. }
  19624. loadIceParticial() {
  19625. this.loadD3Res("iceEft", "", (prefab) => {
  19626. prefab.addComponent(Partical);
  19627. xGame.poolD3Mgr.createList(poolKey.iceEft, prefab, this.particialRoot);
  19628. });
  19629. }
  19630. loadHitParticial() {
  19631. this.loadD3Res("hitEft", "", (prefab) => {
  19632. prefab.addComponent(Partical);
  19633. xGame.poolD3Mgr.createList(poolKey.hitEft, prefab, this.particialRoot);
  19634. });
  19635. }
  19636. loadFireworksParticial() {
  19637. this.loadD3Res("fireworksEft", "", (prefab) => {
  19638. prefab.addComponent(Partical);
  19639. xGame.poolD3Mgr.createList(poolKey.fireworksEft, prefab, this.particialRoot);
  19640. });
  19641. }
  19642. loadBall(index = 1) {
  19643. this.loadD3Res("ball", index, (prefab) => {
  19644. this.ballPrefab = prefab;
  19645. this.ballPrefab.addComponent(Ball);
  19646. xGame.poolD3Mgr.createList(poolKey.d3ball, this.ballPrefab, this.ballRoot);
  19647. });
  19648. }
  19649. loadTable(index = 1) {
  19650. this.loadD3Res("table", index, (prefab) => {
  19651. this.tableSrc = prefab.addComponent(Table);
  19652. this.d3Hand = prefab.getChildByName("hand").addComponent(D3Tween);
  19653. this.d3Hand.init();
  19654. this.tableRoot.addChild(prefab);
  19655. });
  19656. }
  19657. loadRoom(index = 1) {
  19658. this.loadD3Res("room", index, (prefab) => {
  19659. this.roomRoot.addChild(prefab);
  19660. });
  19661. }
  19662. loadD3Res(type, index, callback) {
  19663. let url = `res/unityRes/${type}${index}.lh`;
  19664. Laya.Sprite3D.load(url, Laya.Handler.create(this, (prefab) => {
  19665. callback && callback(prefab);
  19666. this.checkResLoad();
  19667. }));
  19668. }
  19669. checkResLoad() {
  19670. this.loadNum++;
  19671. if (this.loadNum >= this.setLoadNum) {
  19672. xGame.eventMgr.event(D3RES_LOADED);
  19673. }
  19674. }
  19675. prePlayEft() {
  19676. let eft = xGame.poolD3Mgr.getItem(poolKey.inHoleEft);
  19677. eft.transform.localPositionX = 0;
  19678. eft.transform.localPositionY = -5;
  19679. eft.transform.localPositionZ = 0;
  19680. eft.active = true;
  19681. let ice = xGame.poolD3Mgr.getItem(poolKey.iceEft);
  19682. ice.transform.localPositionX = 0;
  19683. ice.transform.localPositionY = -5;
  19684. ice.transform.localPositionZ = 0;
  19685. ice.active = true;
  19686. let hit = xGame.poolD3Mgr.getItem(poolKey.hitEft);
  19687. hit.transform.localPositionX = 0;
  19688. hit.transform.localPositionY = -5;
  19689. hit.transform.localPositionZ = 0;
  19690. hit.active = true;
  19691. let fireworks = xGame.poolD3Mgr.getItem(poolKey.fireworksEft);
  19692. fireworks.transform.localPositionX = 0;
  19693. fireworks.transform.localPositionY = -5;
  19694. fireworks.transform.localPositionZ = 0;
  19695. fireworks.active = true;
  19696. }
  19697. }
  19698. class cameraType {
  19699. }
  19700. class MoyuMgr$1 {
  19701. static initMoyu() {
  19702. this.moyuView = new MoyuView$1();
  19703. Laya.stage.addChild(this.moyuView.ui.displayObject);
  19704. this.moyuView.ui.x = (Laya.stage.width - 1334) / 2;
  19705. this.moyuView.ui.displayObject.zOrder = 1000;
  19706. this.moyuView.init();
  19707. this.moyuView.showTip(true);
  19708. this.moyuView.showAge(true, 0, Laya.stage.height - 320);
  19709. window['XApk'] = this;
  19710. }
  19711. static showAge(show) {
  19712. if (this.moyuView)
  19713. this.moyuView.showAge(show);
  19714. }
  19715. static onPlatMsg(idx) {
  19716. if (!MoyuMgr$1.moyuView)
  19717. return;
  19718. if (idx == '0') {
  19719. MoyuMgr$1.moyuView.showTip(false);
  19720. }
  19721. }
  19722. static showAgree(call) {
  19723. if (this.moyuView)
  19724. this.moyuView.showAgree(call);
  19725. else
  19726. call && call();
  19727. }
  19728. static showXy(type = 1) {
  19729. if (this.moyuView)
  19730. this.moyuView.showXy(type);
  19731. }
  19732. }
  19733. MoyuMgr$1.isAdvise = false;
  19734. class MoyuView$1 {
  19735. constructor() {
  19736. this.ysxyNum = 1;
  19737. this.ysJson = null;
  19738. this.ui = ui_UIMoyu.createInstance();
  19739. }
  19740. init() {
  19741. this.ui.mainBg.visible = false;
  19742. this.ui.xyNode.visible = false;
  19743. this.ui.ageNode.visible = false;
  19744. this.ui.tipNode.visible = false;
  19745. this.ui.rnNode.visible = false;
  19746. this.ui.fcmNode.visible = false;
  19747. this.ui.ageTip.visible = false;
  19748. this.ui.msgNode.visible = false;
  19749. this.ui.visible = false;
  19750. this.ui.xyNode.xyList.setVirtual();
  19751. this.ui.xyNode.xyList.itemRenderer = Laya.Handler.create(this, this.renderListItem, null, false);
  19752. this.ui.ageNode.btnAge.onClick(this, this.onClick, [this.ui.ageNode.btnAge]);
  19753. this.ui.tipNode.onClick(this, this.onClick, [this.ui.tipNode]);
  19754. this.ui.ageTip.onClick(this, this.onClick, [this.ui.ageTip]);
  19755. this.ui.xyNode.btnKnown.visible = false;
  19756. this.ui.xyNode.xy1.visible = false;
  19757. this.ui.xyNode.xy2.visible = false;
  19758. this.ui.xyNode.btnXy1.visible = this.ui.xyNode.btnXy2.visible = false;
  19759. this.ui.xyNode.btnSure.visible = this.ui.xyNode.btnXy3.visible = false;
  19760. this.ui.xyNode.btnXy1.onClick(this, this.onClick, [this.ui.xyNode.btnXy1]);
  19761. this.ui.xyNode.btnXy2.onClick(this, this.onClick, [this.ui.xyNode.btnXy2]);
  19762. this.ui.xyNode.btnXy3.onClick(this, this.onClick, [this.ui.xyNode.btnXy3]);
  19763. this.ui.xyNode.btnNo.onClick(this, this.onClick, [this.ui.xyNode.btnNo]);
  19764. this.ui.xyNode.btnYes.onClick(this, this.onClick, [this.ui.xyNode.btnYes]);
  19765. this.ui.xyNode.btnSure.onClick(this, this.onClick, [this.ui.xyNode.btnSure]);
  19766. this.ui.xyNode.btnBack.onClick(this, this.onClick, [this.ui.xyNode.btnBack]);
  19767. this.ui.xyNode.btnKnown.onClick(this, this.onClick, [this.ui.xyNode.btnKnown]);
  19768. this.ui.rnNode.btnExit.onClick(this, this.onClick, [this.ui.rnNode.btnExit]);
  19769. this.ui.rnNode.btnCheck.onClick(this, this.onClick, [this.ui.rnNode.btnCheck]);
  19770. this.ui.rnNode.btnDone.onClick(this, this.onClick, [this.ui.rnNode.btnDone]);
  19771. this.ui.fcmNode.btnRn.onClick(this, this.onClick, [this.ui.fcmNode.btnRn]);
  19772. if (Moyu.isVVApk || Moyu.isOPApk || Moyu.isTTApk || Moyu.isOppo || Moyu.isVivo) {
  19773. this.ysxyNum = 2;
  19774. }
  19775. }
  19776. onClick(obj) {
  19777. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  19778. switch (obj) {
  19779. case this.ui.ageTip:
  19780. if (Moyu.isTTApk) {
  19781. this.ui.ageNode.visible = true;
  19782. this.ui.mainBg.visible = true;
  19783. }
  19784. break;
  19785. case this.ui.tipNode:
  19786. this.showTip(false);
  19787. break;
  19788. case this.ui.ageNode.btnAge:
  19789. this.ui.ageNode.visible = false;
  19790. this.ui.mainBg.visible = false;
  19791. if (!this.ui.xyNode.visible && !this.ui.rnNode.visible)
  19792. this.ui.visible = false;
  19793. break;
  19794. case this.ui.xyNode.btnXy3:
  19795. case this.ui.xyNode.btnXy1:
  19796. this.loadXy(1);
  19797. break;
  19798. case this.ui.xyNode.btnXy2:
  19799. this.loadXy(2);
  19800. break;
  19801. case this.ui.xyNode.btnBack:
  19802. this.ui.xyNode.xy1.visible = true;
  19803. this.ui.xyNode.xy2.visible = false;
  19804. break;
  19805. case this.ui.xyNode.btnKnown:
  19806. this.ui.xyNode.visible = false;
  19807. this.ui.mainBg.visible = false;
  19808. this.ui.visible = false;
  19809. break;
  19810. case this.ui.rnNode.btnCheck:
  19811. this.check();
  19812. break;
  19813. case this.ui.rnNode.btnExit:
  19814. case this.ui.xyNode.btnNo:
  19815. this.ysxyNum--;
  19816. if (this.ysxyNum > 0)
  19817. this.showMsg("Refuse to quit the game once again");
  19818. else {
  19819. Moyu.userAgree(false);
  19820. Moyu.exit();
  19821. }
  19822. break;
  19823. case this.ui.xyNode.btnSure:
  19824. case this.ui.xyNode.btnYes:
  19825. DataMgr.userData.isAgree = true;
  19826. DataMgr.saveUserData();
  19827. this.onAgree();
  19828. break;
  19829. case this.ui.rnNode.btnDone:
  19830. this.ui.rnNode.visible = false;
  19831. this.ui.visible = false;
  19832. break;
  19833. case this.ui.fcmNode.btnRn:
  19834. this.showRn();
  19835. break;
  19836. }
  19837. }
  19838. showTip(show) {
  19839. if (!Moyu.isVVApk && !Moyu.isOPApk)
  19840. return;
  19841. if (show) {
  19842. MoyuMgr$1.isAdvise = true;
  19843. this.ui.visible = true;
  19844. this.ui.tipNode.visible = true;
  19845. this.ui.tipNode.alpha = 1;
  19846. Laya.timer.once(1000, this, this.showTip, [false]);
  19847. }
  19848. else {
  19849. this.ui.tipNode.alpha = 1;
  19850. this.ui.tipNode.visible = true;
  19851. Laya.Tween.to(this.ui.tipNode, { alpha: 0 }, 500, null, Laya.Handler.create(this.ui, () => {
  19852. this.ui.tipNode.visible = false;
  19853. MoyuMgr$1.isAdvise = false;
  19854. }), 1000);
  19855. }
  19856. }
  19857. showAge(show, px = 0, py = 0) {
  19858. if (Moyu.platType > 10 && !Moyu.isIos) {
  19859. this.ui.ageTip.x = px;
  19860. this.ui.ageTip.y = py;
  19861. this.ui.ageTip.visible = show;
  19862. if (show)
  19863. this.ui.visible = true;
  19864. }
  19865. }
  19866. showAgree(call) {
  19867. this.agreeCall = call;
  19868. this.onAgree();
  19869. return;
  19870. if (Moyu.hasAgree && !DataMgr.userData.isAgree && !Moyu.isIos) {
  19871. this.showXy(0);
  19872. }
  19873. else
  19874. this.onAgree();
  19875. }
  19876. onAgree() {
  19877. if (!this.ui.ageNode.visible)
  19878. this.ui.visible = false;
  19879. this.ui.xyNode.visible = false;
  19880. Moyu.userAgree(true);
  19881. this.showAge(false);
  19882. this.agreeCall && this.agreeCall();
  19883. this.showRn();
  19884. }
  19885. showMsg(txt) {
  19886. this.ui.msgNode.txtMsg.text = txt;
  19887. this.ui.msgNode.visible = true;
  19888. this.ui.msgNode.alpha = 1;
  19889. this.ui.visible = true;
  19890. Laya.Tween.to(this.ui.msgNode, { alpha: 0 }, 600, null, Laya.Handler.create(this.ui, () => {
  19891. this.ui.msgNode.visible = false;
  19892. }), 2500, true);
  19893. }
  19894. showRn() {
  19895. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19896. if (!Moyu.isRealName || Moyu.gameTime < 999) {
  19897. this.ui.rnNode.rn1.visible = true;
  19898. this.ui.rnNode.rn2.visible = false;
  19899. this.ui.rnNode.rn3.visible = false;
  19900. this.ui.rnNode.rn4.visible = false;
  19901. this.ui.rnNode.visible = true;
  19902. this.ui.mainBg.visible = true;
  19903. this.ui.rnNode.btnDone.visible = false;
  19904. this.ui.rnNode.btnExit.visible = true;
  19905. this.ui.rnNode.btnCheck.visible = true;
  19906. this.ui.fcmNode.visible = false;
  19907. this.ui.visible = true;
  19908. return;
  19909. }
  19910. }
  19911. this.showFcm();
  19912. }
  19913. showFcm() {
  19914. if (Moyu.isTTApk || Moyu.isPlat(MoyuPlat.hhw)) {
  19915. Moyu.initFCM(true);
  19916. if (Moyu.gameTime < 1)
  19917. this.fcmLoop();
  19918. else if (Moyu.gameTime < 999)
  19919. Laya.timer.loop(10000, this.ui, this.fcmLoop);
  19920. }
  19921. }
  19922. fcmLoop() {
  19923. if (Moyu.gameTime < 1) {
  19924. this.ui.rnNode.visible = false;
  19925. this.ui.fcmNode.visible = true;
  19926. this.ui.mainBg.visible = true;
  19927. this.ui.visible = true;
  19928. this.ui.fcmNode.btnRn.visible = !Moyu.isLegal;
  19929. Laya.timer.clear(this.ui, this.fcmLoop);
  19930. }
  19931. }
  19932. check() {
  19933. if (this.ui.rnNode.rn2.visible || this.ui.rnNode.rn1.visible) {
  19934. this.ui.rnNode.rn1.visible = false;
  19935. this.ui.rnNode.rn2.visible = false;
  19936. this.ui.rnNode.rn4.visible = true;
  19937. }
  19938. else if (this.ui.rnNode.rn4.visible) {
  19939. let name = this.ui.rnNode.inputName.text;
  19940. let code = this.ui.rnNode.inputCode.text;
  19941. if (code && code.length == 18) {
  19942. this.ui.rnNode.rn1.visible = false;
  19943. this.ui.rnNode.rn4.visible = false;
  19944. Moyu.authenticate(name, code, (res) => {
  19945. this.ui.rnNode.rn2.visible = !res;
  19946. this.ui.rnNode.rn3.visible = res;
  19947. this.ui.rnNode.btnDone.visible = res;
  19948. this.ui.rnNode.btnExit.visible = !res;
  19949. this.ui.rnNode.btnCheck.visible = !res;
  19950. if (res)
  19951. this.showFcm();
  19952. });
  19953. }
  19954. else
  19955. this.showMsg("信息填写不完整");
  19956. }
  19957. }
  19958. loadXy(type = 0) {
  19959. this.ui.xyNode.xy1.visible = false;
  19960. this.ui.xyNode.xy2.visible = true;
  19961. this.ui.xyNode.xyList.scrollToView(0);
  19962. if (type == 1) {
  19963. Laya.loader.load("app/xy/yiiwan_ys.json", Laya.Handler.create(this, this.createXY));
  19964. }
  19965. else if (type == 2) {
  19966. Laya.loader.load("app/xy/yiiwan_yh.json", Laya.Handler.create(this, this.createXY));
  19967. }
  19968. }
  19969. showXy(type = 0) {
  19970. this.xyBtn();
  19971. if (type == 0) {
  19972. if (Moyu.isPlat(MoyuPlat.f399Apk)) {
  19973. this.ui.xyNode.btnSure.visible = true;
  19974. }
  19975. else {
  19976. this.ui.xyNode.btnYes.visible = true;
  19977. this.ui.xyNode.btnNo.visible = true;
  19978. }
  19979. }
  19980. else {
  19981. this.ui.xyNode.btnKnown.visible = true;
  19982. this.ui.mainBg.visible = true;
  19983. }
  19984. this.ui.xyNode.xy1.visible = true;
  19985. this.ui.xyNode.xy2.visible = false;
  19986. this.ui.xyNode.visible = true;
  19987. this.ui.visible = true;
  19988. }
  19989. xyBtn() {
  19990. this.ui.xyNode.btnSure.visible = false;
  19991. this.ui.xyNode.btnYes.visible = false;
  19992. this.ui.xyNode.btnNo.visible = false;
  19993. this.ui.xyNode.btnKnown.visible = false;
  19994. {
  19995. this.ui.xyNode.btnXy3.visible = false;
  19996. this.ui.xyNode.btnXy2.visible = true;
  19997. this.ui.xyNode.btnXy1.visible = true;
  19998. this.ui.xyNode.xy1.text = "Welcome to《8Ball Fury》";
  19999. }
  20000. }
  20001. createXY(json) {
  20002. this.ysJson = json.content;
  20003. this.ui.xyNode.txtTitle.text = json.title.replace('GAMENAME', "8Ball Fury");
  20004. this.ui.xyNode.xyList.numItems = this.ysJson.length;
  20005. this.ui.xyNode.xy2.visible = true;
  20006. }
  20007. renderListItem(idx, cell) {
  20008. let xy = this.ysJson[idx];
  20009. cell.height = xy.line * 30;
  20010. cell.xyItem.text = xy.text;
  20011. }
  20012. onDestroy() {
  20013. this.agreeCall = null;
  20014. }
  20015. }
  20016. class UILoading extends UIBase {
  20017. constructor() {
  20018. super();
  20019. this.accTime = 0;
  20020. this.curNum = 0;
  20021. this.rate = 1;
  20022. this.loadSubOk = false;
  20023. this.loadResOK = false;
  20024. this.openLoading = true;
  20025. this.beginLoadRes = false;
  20026. this.finishD2 = false;
  20027. this.finishD3 = false;
  20028. }
  20029. onConstructor() {
  20030. this.ui = ui_UILoading.createInstance();
  20031. this.contentPane = this.ui;
  20032. this.isEject = false;
  20033. this._initUI();
  20034. this._addEvent();
  20035. }
  20036. _initUI() {
  20037. MoyuMgr$1.initMoyu();
  20038. }
  20039. _addEvent() {
  20040. xGame.eventMgr.off(D3RES_LOADED, this, this.d3ResFinish);
  20041. xGame.eventMgr.on(D3RES_LOADED, this, this.d3ResFinish);
  20042. }
  20043. show() {
  20044. super.show();
  20045. console.log('zh:加载分包资源');
  20046. loadSubRes(this.subResProgress.bind(this));
  20047. this.ui.txtLoad.text = "Loading...";
  20048. this.setGlobalFont(this.ui);
  20049. }
  20050. subResProgress(pro, finish) {
  20051. this.curNum = pro;
  20052. if (finish) {
  20053. this.curNum = 1;
  20054. this.loadSubOk = true;
  20055. }
  20056. }
  20057. laodD3Res() {
  20058. let scene3D = new Laya.Scene3D();
  20059. xGame.common.d3Scene = scene3D;
  20060. xGame.common.d3World = scene3D.addComponent(D3World);
  20061. xGame.common.d3World.loadScene();
  20062. }
  20063. loadD2Res() {
  20064. Laya.loader.load(getGameResList(), Laya.Handler.create(this, () => {
  20065. this.finishD2 = true;
  20066. this.checkLoadAll();
  20067. this.curNum = 1;
  20068. }), Laya.Handler.create(this, (pro) => {
  20069. this.curNum = pro;
  20070. }, null, false));
  20071. }
  20072. d3ResFinish() {
  20073. this.finishD3 = true;
  20074. this.checkLoadAll();
  20075. }
  20076. checkLoadAll() {
  20077. if (this.finishD2 && this.finishD3) {
  20078. this.loadResOK = true;
  20079. }
  20080. }
  20081. loadRes() {
  20082. this.laodD3Res();
  20083. this.loadD2Res();
  20084. }
  20085. myUpdate(dt) {
  20086. if (!this.openLoading)
  20087. return;
  20088. this.accTime += dt * this.rate;
  20089. if (this.accTime >= this.curNum)
  20090. this.accTime = this.curNum;
  20091. this.ui.loadinfo.value = this.accTime * 100;
  20092. if (this.accTime >= 1 && this.loadSubOk && !MoyuMgr$1.isAdvise) {
  20093. if (!this.beginLoadRes) {
  20094. this.beginLoadRes = true;
  20095. this.ui.txtLoad.text = "Loading...";
  20096. this.curNum = 0;
  20097. this.accTime = 0;
  20098. this.loadRes();
  20099. }
  20100. if (this.loadResOK) {
  20101. this.openLoading = false;
  20102. Laya.timer.once(300, this, () => {
  20103. xGame.common.d3Scene.active = false;
  20104. MoyuMgr$1.showAgree(enterGame);
  20105. });
  20106. }
  20107. }
  20108. }
  20109. release() {
  20110. }
  20111. hide() {
  20112. super.hide();
  20113. this.release();
  20114. }
  20115. onClose() {
  20116. this.hide();
  20117. }
  20118. }
  20119. UILoading.uiName = "UILoading";
  20120. class UIRepentProp$1 extends UIBase {
  20121. constructor() {
  20122. super();
  20123. this.viewType = 0;
  20124. this.regretType = 0;
  20125. }
  20126. onConstructor() {
  20127. this.ui = ui_UIRepentProp.createInstance();
  20128. this.contentPane = this.ui;
  20129. this.isEject = false;
  20130. this.addUIClick(this.ui.regretNode.cancelBtn, this.hideSelf);
  20131. this.addUIClick(this.ui.regretNode.videoBtn, this.videoRegret);
  20132. this.addUIClick(this.ui.helpLineNode.cancelBtn, this.hideSelf);
  20133. this.addUIClick(this.ui.helpLineNode.videoBtn, this.videoAddHelpLine);
  20134. }
  20135. show(viewType, regretType, callback) {
  20136. PlatMgr.showInsert(true);
  20137. this.viewType = viewType;
  20138. this.regretType = regretType;
  20139. this.callback = callback;
  20140. super.show();
  20141. this.ui.t0.play();
  20142. this.ui.c1.selectedIndex = this.viewType;
  20143. this.ui.regretNode.tipsTxt.text = this.regretType == 0 ? "Missed the target ball!" : "The cue ball has been pocketed!";
  20144. if (this.viewType == 0) {
  20145. let guide = DataMgr.getGuideHelpLine();
  20146. this.ui.helpLineNode.c1.selectedIndex = guide == 0 ? 1 : 0;
  20147. this.ui.helpLineNode.videoBtn.c1.selectedIndex = guide == 0 ? 1 : 0;
  20148. }
  20149. xGame.common.gameMgr.gamePause = true;
  20150. this.setGlobalFont(this.ui);
  20151. }
  20152. hideSelf() {
  20153. xGame.common.gameMgr.gamePause = false;
  20154. this.callback && this.callback(false);
  20155. this.hide();
  20156. }
  20157. videoRegret() {
  20158. console.log('zh:qjff_AD_for_UIrepentProp_videoRegret');
  20159. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoRegret')) {
  20160. }
  20161. else {
  20162. console.log('zh:AD 失败,直接发放奖励');
  20163. this.qjff_AD_for_UIrepentProp_videoRegret();
  20164. }
  20165. }
  20166. qjff_AD_for_UIrepentProp_videoRegret() {
  20167. this.callback && this.callback(true);
  20168. this.hideSelf();
  20169. }
  20170. videoAddHelpLine() {
  20171. let guide = DataMgr.getGuideHelpLine();
  20172. if (guide == 0) {
  20173. this.callback && this.callback(true);
  20174. this.hideSelf();
  20175. DataMgr.setGuideHelpLine();
  20176. xGame.common.gameUI.ui.guideNode.visible = false;
  20177. }
  20178. else {
  20179. console.log('zh:qjff_AD_for_UIrepentProp_videoAddHelpLine');
  20180. if (Laya.Browser.onAndroid) {
  20181. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  20182. if (!boo) {
  20183. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  20184. return;
  20185. }
  20186. }
  20187. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIrepentProp_videoAddHelpLine')) {
  20188. }
  20189. else {
  20190. console.log('zh:AD 失败,直接发放奖励');
  20191. this.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  20192. }
  20193. }
  20194. }
  20195. qjff_AD_for_UIrepentProp_videoAddHelpLine() {
  20196. this.callback && this.callback(true);
  20197. this.hideSelf();
  20198. }
  20199. }
  20200. UIRepentProp$1.uiName = "UIRepentProp";
  20201. class UIRodMethod$1 extends UIBase {
  20202. constructor() {
  20203. super();
  20204. this.isPressd = false;
  20205. }
  20206. onConstructor() {
  20207. this.ui = ui_UIRodMethod.createInstance();
  20208. this.contentPane = this.ui;
  20209. this.addUIClick(this.ui.sureBtn, this.closeSelf);
  20210. this.moveDir = new Laya.Vector2();
  20211. this.moveDest = new Laya.Vector2();
  20212. this.centerPos = new Laya.Vector2();
  20213. xGame.common.uiRodMethod = this;
  20214. }
  20215. show() {
  20216. super.show();
  20217. xGame.common.gameMgr.gamePause = true;
  20218. this.openPressDotEvent();
  20219. this.gameRod = xGame.common.gameUI.ui.rodMethodNode;
  20220. this.centerPos.x = this.ui.white.x;
  20221. this.centerPos.y = this.ui.white.y;
  20222. this.moveDest.x = this.centerPos.x - xGame.common.rodOffest.x;
  20223. this.moveDest.y = this.centerPos.y - xGame.common.rodOffest.y;
  20224. this.setDot();
  20225. this.setGlobalFont(this.ui);
  20226. }
  20227. setDot() {
  20228. this.ui.dot.x = this.moveDest.x;
  20229. this.ui.dot.y = this.moveDest.y;
  20230. }
  20231. closeSelf() {
  20232. xGame.common.rodOffest.x = this.centerPos.x - this.moveDest.x;
  20233. xGame.common.rodOffest.y = this.centerPos.y - this.moveDest.y;
  20234. this.gameRod.dot.x = this.gameRod.bg.x - xGame.common.rodOffest.x;
  20235. this.gameRod.dot.y = this.gameRod.bg.y - xGame.common.rodOffest.y;
  20236. xGame.common.gameMgr.gamePause = false;
  20237. this.hide();
  20238. }
  20239. openPressDotEvent() {
  20240. this.closePressDotEvent();
  20241. this.ui.dot.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20242. this.ui.white.on(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20243. this.ui.white.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20244. this.ui.white.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20245. this.ui.on(Laya.Event.MOUSE_UP, this, this.onDown);
  20246. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20247. }
  20248. closePressDotEvent() {
  20249. this.ui.dot.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20250. this.ui.white.off(Laya.Event.MOUSE_DOWN, this, this.onDown);
  20251. this.ui.white.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20252. this.ui.white.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20253. this.ui.off(Laya.Event.MOUSE_UP, this, this.onDown);
  20254. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onDown);
  20255. }
  20256. onDown(e) {
  20257. if (e.type == Laya.Event.MOUSE_DOWN)
  20258. this.isPressd = true;
  20259. else if (e.type == Laya.Event.MOUSE_UP && this.isPressd)
  20260. this.isPressd = false;
  20261. if (!this.isPressd)
  20262. return;
  20263. this.moveDest.x = e.stageX;
  20264. this.moveDest.y = e.stageY;
  20265. let dis = xGame.tools.getV2SqDis(this.moveDest, this.centerPos);
  20266. if (dis > 6724) {
  20267. this.moveDir = xGame.tools.getV2Dir(this.centerPos.x, this.centerPos.y, e.stageX, e.stageY, this.moveDir);
  20268. this.moveDest = xGame.tools.getV2Dest(this.centerPos.x, this.centerPos.y, this.moveDir, 82, this.moveDest);
  20269. }
  20270. this.setDot();
  20271. }
  20272. resetRod() {
  20273. this.ui.dot.x = this.ui.white.x;
  20274. this.ui.dot.y = this.ui.white.y;
  20275. this.gameRod.dot.x = this.gameRod.bg.x;
  20276. this.gameRod.dot.y = this.gameRod.bg.y;
  20277. xGame.common.rodOffest.x = 0;
  20278. xGame.common.rodOffest.y = 0;
  20279. }
  20280. }
  20281. UIRodMethod$1.uiName = "UIRodMethod";
  20282. class UIMsg$1 extends UIBase {
  20283. constructor() {
  20284. super();
  20285. }
  20286. onConstructor() {
  20287. this.ui = ui_UIMsg.createInstance();
  20288. this.contentPane = this.ui;
  20289. this.isEject = false;
  20290. this.isMuti = true;
  20291. }
  20292. show(msg, callback) {
  20293. super.show();
  20294. this.ui.tipsNode.msgTxt.text = msg;
  20295. this.ui.alpha = 1;
  20296. Laya.Tween.to(this.ui, { alpha: 0 }, 500, null, Laya.Handler.create(this, () => {
  20297. this.hide();
  20298. callback && callback();
  20299. }), 1000);
  20300. this.setGlobalFont(this.ui);
  20301. }
  20302. }
  20303. UIMsg$1.uiName = "UIMsg";
  20304. class UITips$1 extends UIBase {
  20305. constructor() {
  20306. super();
  20307. this.type = 0;
  20308. }
  20309. onConstructor() {
  20310. this.ui = ui_UITips.createInstance();
  20311. this.contentPane = this.ui;
  20312. this.isEject = false;
  20313. this.addUIClick(this.ui.myNode.cancelBtn, this.clickLeftBtn);
  20314. this.addUIClick(this.ui.myNode.sureBtn, this.clickRightBtn);
  20315. }
  20316. show(tipsTxt, womanTxt, type) {
  20317. super.show();
  20318. this.ui.t0.play();
  20319. this.ui.myNode.tipsTxt.text = tipsTxt;
  20320. this.ui.myNode.womanTxt.text = womanTxt;
  20321. PlatMgr.showInsert(true);
  20322. this.ui.myNode.c1.selectedIndex = type;
  20323. this.type = type;
  20324. switch (this.type) {
  20325. case TipsType.exitGame:
  20326. xGame.common.gameMgr.gamePause = true;
  20327. break;
  20328. case TipsType.foul:
  20329. Laya.timer.once(200, this, () => {
  20330. if (xGame.common.gameMgr) {
  20331. xGame.common.gameMgr.gamePause = true;
  20332. }
  20333. else {
  20334. console.log("zh:gameMgr is null");
  20335. }
  20336. });
  20337. break;
  20338. default:
  20339. break;
  20340. }
  20341. this.setGlobalFont(this.ui);
  20342. }
  20343. clickLeftBtn() {
  20344. this.hide();
  20345. xGame.common.gameMgr.gamePause = false;
  20346. switch (this.type) {
  20347. case TipsType.exitGame:
  20348. break;
  20349. case TipsType.foul:
  20350. break;
  20351. default:
  20352. break;
  20353. }
  20354. }
  20355. clickRightBtn() {
  20356. this.hide();
  20357. switch (this.type) {
  20358. case TipsType.exitGame:
  20359. xGame.eventMgr.event(RESET_GAME);
  20360. xGame.uiMgr.Show(UIMain$1);
  20361. Moyu.recordEnd(this, null);
  20362. xGame.common.longHelpLine = false;
  20363. break;
  20364. case TipsType.foul:
  20365. if (xGame.common.gameMgr) {
  20366. xGame.common.gameMgr.gamePause = false;
  20367. }
  20368. Laya.timer.clearAll(this);
  20369. break;
  20370. default:
  20371. break;
  20372. }
  20373. }
  20374. }
  20375. UITips$1.uiName = "UITips";
  20376. class UIGame$1 extends UIBase {
  20377. constructor() {
  20378. super();
  20379. this.powerNum = 0;
  20380. this.isD3Inited = false;
  20381. this.isPrePlay = false;
  20382. this.isMoveRod = false;
  20383. this.eventObj = { curX: 0, curY: 0, lastX: 0, lastY: 0, starX: 0, starY: 0 };
  20384. this.rulerDis = 20;
  20385. this.rulerOffset = 0;
  20386. }
  20387. onConstructor() {
  20388. this.ui = ui_UIGame.createInstance();
  20389. this.contentPane = this.ui;
  20390. this.ui.x += xGame.common.sysOffestNum;
  20391. this.ui.border.alpha = xGame.common.showDebug ? 1 : 0;
  20392. this.isEject = false;
  20393. xGame.common.gameUI = this;
  20394. this.initSelf();
  20395. }
  20396. isTurnSelf() {
  20397. if (!xGame.common.d2World.openCheckStill && xGame.common.gameMgr.selfTurn && xGame.common.gameMgr.finishOneShoot) {
  20398. return true;
  20399. }
  20400. }
  20401. initSelf() {
  20402. let topUI = this.ui.topNode;
  20403. topUI.selfBallList.itemRenderer = Laya.Handler.create(this, this.renderSelfDisplayBalls, null, false);
  20404. topUI.aiBallList.itemRenderer = Laya.Handler.create(this, this.renderAIDisplayBalls, null, false);
  20405. this.barInfo = {};
  20406. this.barInfo.curY = 0;
  20407. this.barInfo.height = this.ui.powerNode.height;
  20408. this.barInfo.showStarY = this.ui.powerNode.showImg.y;
  20409. this.barInfo.powerStartY = this.ui.powerNode.y;
  20410. xGame.common.aiPlayer = new AIPlayer();
  20411. xGame.common.gameMgr = new GameMgr();
  20412. xGame.common.skillMgr = new SkillMgr();
  20413. xGame.common.wordsMgr = new WordsMgr();
  20414. xGame.common.talkMgr = new TalkMgr();
  20415. xGame.common.classicEmotionSpine = new SpineMgr("yxz_bqwz", () => {
  20416. });
  20417. xGame.common.awardSpine = new SpineMgr("jinbi", () => {
  20418. });
  20419. xGame.eventMgr.off(RESET_GAME, this, this.resetGame);
  20420. xGame.eventMgr.on(RESET_GAME, this, this.resetGame);
  20421. this.addUIClick(this.ui.rodMethodNode, this.addRodMethodClick);
  20422. this.addUIClick(this.ui.returnBtn, this.returnHome);
  20423. this.addUIClick(this.ui.helpBtn, this.clickHelpLineBtn);
  20424. this.addUIClick(this.ui.placeChallengeNode.helpLineBtn, this.clickHelpLineBtn);
  20425. this.addUIClick(this.ui.placeNormalNode.helpLineBtn, this.clickHelpLineBtn);
  20426. }
  20427. getGanZiImg() {
  20428. let index = DataMgr.getCurBallRod();
  20429. let data = cfgTable.ballrodData[index + 1];
  20430. let gan_url = xGame.common.getGameIconUrl(data.img);
  20431. this.ui.powerNode.showImg.url = gan_url;
  20432. }
  20433. returnHome() {
  20434. let tips = "Are you sure to exit the game?";
  20435. let woman = "Boss, why don't you play for a while longer?";
  20436. xGame.uiMgr.Show(UITips$1, tips, woman, TipsType.exitGame);
  20437. }
  20438. addRodMethodClick() {
  20439. if (this.isTurnSelf()) {
  20440. xGame.uiMgr.Show(UIRodMethod$1);
  20441. }
  20442. }
  20443. clickHelpLineBtn(force = false) {
  20444. if (!this.isTurnSelf())
  20445. return;
  20446. xGame.uiMgr.Show(UIRepentProp$1, 0, 0, (success) => {
  20447. if (success) {
  20448. xGame.common.longHelpLine = true;
  20449. xGame.common.d2World.getHelpLine();
  20450. Moyu.sendDataEvent("guideNum");
  20451. }
  20452. else {
  20453. }
  20454. });
  20455. }
  20456. renderSelfDisplayBalls(index, target) {
  20457. let str = "q" + xGame.common.gameMgr.selfBallArr[index];
  20458. target.myImg.url = xGame.common.getGameIconUrl(str);
  20459. }
  20460. renderAIDisplayBalls(index, target) {
  20461. let str = "q" + xGame.common.gameMgr.aiBallArr[index];
  20462. target.myImg.url = xGame.common.getGameIconUrl(str);
  20463. ;
  20464. }
  20465. updateMode() {
  20466. if (xGame.common.gameMode == GameMode.classic) {
  20467. this.ui.topNode.scoreNode.visible = false;
  20468. }
  20469. else if (xGame.common.gameMode == GameMode.bigMove) {
  20470. this.ui.topNode.scoreNode.visible = true;
  20471. }
  20472. }
  20473. show() {
  20474. super.show();
  20475. this.ui.alpha = 0;
  20476. this.updateSelf();
  20477. xGame.common.gameMgr.gamePause = false;
  20478. xGame.common.gameUI.ui.blackAni.visible = false;
  20479. xGame.common.gameUI.ui.whiteAni.visible = false;
  20480. this.ui.powerEft.visible = false;
  20481. this.ui.colorNode.visible = false;
  20482. this.updateHead();
  20483. let curUse = DataMgr.getCurBallRod();
  20484. this.getGanZiImg();
  20485. this.yinDaoForLianxi();
  20486. this.setGlobalFont(this.ui);
  20487. }
  20488. yinDaoForLianxi() {
  20489. let g = DataMgr.getSkillGuide();
  20490. if (g === 0) {
  20491. console.log('zh:默认的引导还没有完毕');
  20492. return;
  20493. }
  20494. let lianXiGuide = DataMgr.getLianXiGuide();
  20495. console.log('zh:lianXiGuide=', lianXiGuide);
  20496. if (lianXiGuide === 0) {
  20497. this.ui.n_lxms_yd1.visible = true;
  20498. console.log('zh:yinDaoForLianxi 111 set ok');
  20499. }
  20500. else {
  20501. this.ui.n_lxms_yd1.visible = false;
  20502. console.log('zh:无需引导11');
  20503. }
  20504. }
  20505. updateSelf() {
  20506. if (xGame.common.gameMode == GameMode.classic) {
  20507. this.ui.c1.selectedIndex = 0;
  20508. this.ui.topNode.middleNode.c1.selectedIndex = 0;
  20509. this.ui.topNode.middleNode.visible = true;
  20510. this.ui.topNode.middleNode.awardTxt.text = xGame.common.passAwardCoin + "";
  20511. }
  20512. else if (xGame.common.gameMode == GameMode.bigMove) {
  20513. this.ui.c1.selectedIndex = 0;
  20514. this.ui.topNode.middleNode.c1.selectedIndex = 1;
  20515. this.ui.topNode.middleNode.visible = false;
  20516. let max = xGame.cfgMgr.getMaxBigMoveLength();
  20517. let rand = xGame.common.randomNum(1, max);
  20518. let guide = DataMgr.getSkillGuide();
  20519. if (guide == 0)
  20520. rand = 1;
  20521. xGame.common.bigMoveLevelIndex = rand;
  20522. }
  20523. else if (xGame.common.gameMode == GameMode.placeBall) {
  20524. console.log('zh:练习模式...');
  20525. let data = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  20526. this.ui.c1.selectedIndex = 1 + data.type;
  20527. this.ui.alpha = 1;
  20528. this.startGame();
  20529. }
  20530. this.updateMode();
  20531. this.initD3world();
  20532. this.initD2world();
  20533. }
  20534. startGame() {
  20535. this.ui.snowNode.visible = Math.random() <= 0.1;
  20536. this.ui.d2Node.visible = false;
  20537. xGame.common.d3World.d3Hand.gameObj.active = false;
  20538. xGame.common.d3World.tableSrc.init();
  20539. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20540. this.cameraViewChange(() => {
  20541. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0;
  20542. switch (xGame.common.gameMode) {
  20543. case GameMode.classic:
  20544. xGame.common.d3World.d3Hand.gameObj.active = true;
  20545. this.playPutBallD3Ani();
  20546. break;
  20547. case GameMode.bigMove:
  20548. this.enterGame();
  20549. Laya.timer.once(500, this, () => {
  20550. this.ui.topNode.middleNode.visible = true;
  20551. this.ui.topNode.middleNode.t0.play();
  20552. });
  20553. break;
  20554. case GameMode.placeBall:
  20555. this.enterGame();
  20556. break;
  20557. default:
  20558. break;
  20559. }
  20560. });
  20561. PlatMgr.showBanner(false);
  20562. }
  20563. enterGame() {
  20564. this.ui.d2Node.visible = true;
  20565. xGame.common.d3World.d3Hand.gameObj.active = false;
  20566. xGame.common.showOneCamera("mainCamera");
  20567. Moyu.recordGame(30, true);
  20568. if (!this.isPrePlay) {
  20569. this.isPrePlay = true;
  20570. xGame.common.d3World.prePlayEft();
  20571. }
  20572. xGame.common.gameMgr.gameReady();
  20573. this.openAllEvent();
  20574. this.ui.snowNode.visible = false;
  20575. let condition = (xGame.common.gameMode != GameMode.bigMove) && DataMgr.getGuideHelpLine() == 1;
  20576. this.ui.helpBtn.visible = condition;
  20577. }
  20578. showHelpLineGuide() {
  20579. let longGuide = DataMgr.getGuideHelpLine();
  20580. if (xGame.common.gameMode == GameMode.classic && longGuide == 0) {
  20581. this.ui.helpBtn.visible = true;
  20582. this.ui.guideNode.visible = true;
  20583. }
  20584. }
  20585. setTurnAlpha(alpha) {
  20586. this.ui.keduNode.alpha = alpha;
  20587. this.ui.ganNode.alpha = alpha;
  20588. this.ui.rodMethodNode.alpha = alpha;
  20589. this.ui.helpBtn.alpha = alpha ? 1 : 0;
  20590. }
  20591. cameraViewChange(callback) {
  20592. xGame.common.d3World.tableSrc.gameObj.transform.localPositionY = 0.06;
  20593. let cameraSrc = xGame.common.d3World.cameraObj.visitAngle.transform;
  20594. xGame.common.showOneCamera("visitAngle");
  20595. cameraSrc.localRotationEulerY = 180;
  20596. cameraSrc.localRotationEulerZ = 0;
  20597. Laya.Tween.to(cameraSrc, { localRotationEulerY: 0 }, 3000, null, Laya.Handler.create(this, () => {
  20598. Laya.Tween.to(cameraSrc, { localRotationEulerZ: -70 }, 800, null, Laya.Handler.create(this, () => {
  20599. callback && callback();
  20600. }));
  20601. }));
  20602. }
  20603. playPutBallD3Ani() {
  20604. xGame.common.showOneCamera("mainCamera");
  20605. let handSrc = xGame.common.d3World.d3Hand;
  20606. handSrc.gameObj.active = true;
  20607. handSrc.transform.localPositionZ = 3;
  20608. Laya.Tween.to(handSrc, { posZ: 0 }, 500, Laya.Ease.sineIn, Laya.Handler.create(this, () => {
  20609. Laya.Tween.to(handSrc, { posZ: 10 }, 400, null, Laya.Handler.create(this, () => {
  20610. handSrc.gameObj.active = false;
  20611. this.enterGame();
  20612. }), 400);
  20613. }));
  20614. }
  20615. updateHead() {
  20616. let user = Moyu.getUserInfo();
  20617. this.ui.topNode.selfNameTxt.text = user.nickName;
  20618. xGame.common.createHead(this.ui.topNode.selfHeadLoader, user.headIcon, 80);
  20619. let aiData = xGame.cfgMgr.getRandomUserInfo();
  20620. if (DataMgr.getSkillGuide() < 1) {
  20621. this.ui.topNode.aiNameTxt.text = 'billiards';
  20622. this.ui.topNode.aiHeadLoader.url = 'res/icon.png';
  20623. }
  20624. else {
  20625. this.ui.topNode.aiNameTxt.text = aiData.name;
  20626. let randNo = Math.floor(Math.random() * 10) + 1;
  20627. this.ui.topNode.aiHeadLoader.url = 'res/playersImg/' + randNo + '.png';
  20628. }
  20629. }
  20630. initD2world() {
  20631. let node = this.ui.d2Root.displayObject;
  20632. let src = node.getComponent(D2World);
  20633. if (!src) {
  20634. xGame.common.d2World = node.addComponent(D2World);
  20635. }
  20636. xGame.common.d2World.initSelf();
  20637. }
  20638. initD3world() {
  20639. if (this.isD3Inited)
  20640. return;
  20641. this.isD3Inited = true;
  20642. let scene3D = xGame.common.d3Scene;
  20643. this.ui.d3Root.displayObject.addChild(scene3D);
  20644. scene3D.active = true;
  20645. xGame.common.d3World.tableSrc.setBorderPos();
  20646. }
  20647. onRootMove(e) {
  20648. let rootBall = xGame.common.d2World.rootBall;
  20649. this.ui.moveNode.x = e.x;
  20650. this.ui.moveNode.y = e.y;
  20651. rootBall.gameObj.x = e.x;
  20652. rootBall.gameObj.y = e.y;
  20653. rootBall.d3BallSrc.setTransPos(e.x, e.y);
  20654. }
  20655. aiRootMove(move) {
  20656. if (move)
  20657. this.hideBallUI();
  20658. else {
  20659. this.showBallUI();
  20660. xGame.common.d2World.getHelpLine();
  20661. }
  20662. }
  20663. aiForce(type, force = 0) {
  20664. this.pressTarget = PressType.powerNode;
  20665. if (type == 1)
  20666. this.onEventUp({ force: true });
  20667. else if (type == 2)
  20668. this.onEventMove({ stageY: force, force: true });
  20669. }
  20670. onEventPress(e) {
  20671. if (e.stopPropagation)
  20672. e.stopPropagation();
  20673. if (!this.isTurnSelf())
  20674. return;
  20675. let target = e.target;
  20676. switch (target) {
  20677. case this.ui.myPowerNode.displayObject:
  20678. this.pressTarget = PressType.powerNode;
  20679. this.barInfo.curY = e.stageY;
  20680. this.updateBarInfo();
  20681. break;
  20682. case this.ui.moveNode.displayObject:
  20683. this.pressTarget = PressType.moveNode;
  20684. this.hideBallUI();
  20685. this.eventObj.curX = this.ui.moveNode.x;
  20686. this.eventObj.curY = this.ui.moveNode.y;
  20687. this.ui.moveNode.finger.visible = false;
  20688. this.eventObj.lastX = e.stageX;
  20689. this.eventObj.lastY = e.stageY;
  20690. break;
  20691. case this.ui.rulerClickNode.displayObject:
  20692. this.pressTarget = PressType.rulerNode;
  20693. this.eventObj.lastY = e.stageY;
  20694. break;
  20695. case this.ui.d2Root.displayObject:
  20696. this.pressTarget = PressType.d2Root;
  20697. this.eventObj.lastX = e.stageX;
  20698. this.eventObj.lastY = e.stageY;
  20699. this.eventObj.starX = e.stageX;
  20700. this.eventObj.starY = e.stageY;
  20701. this.eventObj.curX = 0;
  20702. this.eventObj.curY = 0;
  20703. xGame.common.d2World.d2Gan.setGanLastInfo();
  20704. this.rulerOffset = 0;
  20705. break;
  20706. default:
  20707. break;
  20708. }
  20709. }
  20710. onEventMove(e) {
  20711. if (e.stopPropagation)
  20712. e.stopPropagation();
  20713. if (e && e.force) {
  20714. }
  20715. else {
  20716. if (!this.isTurnSelf())
  20717. return;
  20718. }
  20719. switch (this.pressTarget) {
  20720. case PressType.powerNode:
  20721. this.barInfo.curY = e.stageY;
  20722. this.updateBarInfo();
  20723. this.isMoveRod = true;
  20724. break;
  20725. case PressType.moveNode:
  20726. let rootBall = xGame.common.d2World.rootBall;
  20727. let radius = rootBall.gameObj.width / 2;
  20728. let curX = this.eventObj.curX + e.stageX - this.eventObj.lastX;
  20729. let curY = this.eventObj.curY + e.stageY - this.eventObj.lastY;
  20730. let border = xGame.common.d2World.borderRect;
  20731. if (curX <= border.x + radius)
  20732. curX = border.x + radius;
  20733. else if (curX >= border.x + border.width - radius)
  20734. curX = border.x + border.width - radius;
  20735. if (curY <= border.y + radius)
  20736. curY = border.y + radius;
  20737. else if (curY >= border.y + border.height - radius)
  20738. curY = border.y + border.height - radius;
  20739. if (xGame.common.gameMgr.isOpenBall) {
  20740. if (curX >= border.x + border.openBallW - radius)
  20741. curX = border.x + border.openBallW - radius;
  20742. }
  20743. this.ui.moveNode.x = curX;
  20744. this.ui.moveNode.y = curY;
  20745. rootBall.gameObj.x = curX;
  20746. rootBall.gameObj.y = curY;
  20747. rootBall.d3BallSrc.setTransPos(curX, curY);
  20748. this.isMoveRod = true;
  20749. break;
  20750. case PressType.rulerNode:
  20751. let yy = e.stageY - this.eventObj.lastY;
  20752. this.eventObj.lastY = e.stageY;
  20753. let ruler1 = this.ui.rulerNode.img1;
  20754. let ruler2 = this.ui.rulerNode.img2;
  20755. ruler1.y += yy;
  20756. ruler2.y += yy;
  20757. this.rulerOffset += yy;
  20758. if (Math.abs(this.rulerOffset) >= this.rulerDis) {
  20759. this.rulerOffset = 0;
  20760. xGame.soundMgr.playSound("inch", 1, 10);
  20761. }
  20762. xGame.common.d2World.d2Gan.rotateSelf(yy, true);
  20763. let h = ruler1.height;
  20764. this.checkGuide();
  20765. this.checkGuideForLxms();
  20766. this.isMoveRod = true;
  20767. if (ruler1.y >= h) {
  20768. ruler1.y = -h;
  20769. ruler2.y = 0;
  20770. return;
  20771. }
  20772. else if (ruler1.y <= -h) {
  20773. ruler1.y = h;
  20774. ruler2.y = 0;
  20775. return;
  20776. }
  20777. if (ruler2.y >= h) {
  20778. ruler2.y = -h;
  20779. ruler1.y = 0;
  20780. return;
  20781. }
  20782. else if (ruler2.y <= -h) {
  20783. ruler2.y = h;
  20784. ruler1.y = 0;
  20785. return;
  20786. }
  20787. break;
  20788. case PressType.d2Root:
  20789. this.eventObj.curX = e.stageX;
  20790. this.eventObj.curY = e.stageY;
  20791. let offset = this.checkRodMoveDir();
  20792. xGame.common.d2World.d2Gan.rotateSelf(offset);
  20793. this.eventObj.lastX = e.stageX;
  20794. this.eventObj.lastY = e.stageY;
  20795. break;
  20796. default:
  20797. break;
  20798. }
  20799. }
  20800. onEventUp(e) {
  20801. if (e.stopPropagation)
  20802. e.stopPropagation();
  20803. if (e && e.force) {
  20804. }
  20805. else {
  20806. if (!this.isTurnSelf())
  20807. return;
  20808. }
  20809. switch (this.pressTarget) {
  20810. case PressType.powerNode:
  20811. this.ui.powerNode.value = 0;
  20812. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20813. this.ui.powerTxt.text = "";
  20814. if (this.powerNum > 0) {
  20815. xGame.eventMgr.event(BALL_SHOOT);
  20816. xGame.common.d2World.shoot(this.powerNum);
  20817. xGame.common.d2World.d2Gan.shoot();
  20818. xGame.common.d2World.d2HelpLine.shoot();
  20819. this.finishGuide();
  20820. this.finishGuideForLxms();
  20821. this.ui.powerEft.visible = false;
  20822. this.ui.colorNode.visible = false;
  20823. let ganStr = "";
  20824. if (this.powerNum <= 30) {
  20825. ganStr = "gan_30";
  20826. }
  20827. else if (this.powerNum <= 60) {
  20828. ganStr = "gan_50";
  20829. }
  20830. else {
  20831. ganStr = "gan_80";
  20832. }
  20833. xGame.soundMgr.playSound(ganStr);
  20834. }
  20835. break;
  20836. case PressType.moveNode:
  20837. let rootBall = xGame.common.d2World.rootBall;
  20838. let lastX = xGame.common.gameMgr.lastRootBallPos.x;
  20839. let lastY = xGame.common.gameMgr.lastRootBallPos.y;
  20840. let isIntersect = this.judgeBallIntersect();
  20841. if (isIntersect) {
  20842. this.ui.moveNode.x = lastX;
  20843. this.ui.moveNode.y = lastY;
  20844. rootBall.gameObj.x = lastX;
  20845. rootBall.gameObj.y = lastY;
  20846. rootBall.d3BallSrc.setTransPos(lastX, lastY);
  20847. xGame.uiMgr.Show(UIMsg$1, "Incorrect placement position");
  20848. }
  20849. else {
  20850. xGame.common.gameMgr.lastRootBallPos.x = rootBall.gameObj.x;
  20851. xGame.common.gameMgr.lastRootBallPos.y = rootBall.gameObj.y;
  20852. }
  20853. this.showBallUI();
  20854. this.ui.moveNode.finger.visible = true;
  20855. xGame.common.d2World.getHelpLine();
  20856. break;
  20857. case PressType.rulerNode:
  20858. break;
  20859. case PressType.d2Root:
  20860. let dis = Math.pow(this.eventObj.starX - e.stageX, 2) + Math.pow(this.eventObj.starY - e.stageY, 2);
  20861. if (dis <= 25) {
  20862. this.moveToClickDot(e);
  20863. }
  20864. break;
  20865. default:
  20866. break;
  20867. }
  20868. this.pressTarget = -1;
  20869. }
  20870. checkGuide() {
  20871. let guide = DataMgr.getSkillGuide();
  20872. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove && xGame.common.guideStep == 1) {
  20873. xGame.common.guideStep++;
  20874. xGame.common.gameUI.ui.guide2.visible = false;
  20875. xGame.common.gameUI.ui.guide3.visible = true;
  20876. }
  20877. }
  20878. checkGuideForLxms() {
  20879. let guide = DataMgr.getLianXiGuide();
  20880. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall && xGame.common.guideStepForLianXi == 2) {
  20881. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  20882. xGame.common.gameUI.ui.n_lxms_yd3.visible = true;
  20883. xGame.common.guideStepForLianXi = 3;
  20884. }
  20885. }
  20886. finishGuide() {
  20887. let guide = DataMgr.getSkillGuide();
  20888. if (guide == 0 && xGame.common.gameMode == GameMode.bigMove) {
  20889. xGame.common.guideStep = 10;
  20890. this.closeAllGuide();
  20891. console.log('zh: 新手引导完毕');
  20892. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20893. }
  20894. }
  20895. finishGuideForLxms() {
  20896. let guide = DataMgr.getLianXiGuide();
  20897. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  20898. xGame.common.guideStepForLianXi = 3;
  20899. DataMgr.setLianXiGuide(1);
  20900. this.closeAllGuideForLxms();
  20901. console.log('zh: lxms新手引导完毕');
  20902. JSBridgeUtils.instance.logEventForAdNoParams("tutorial_complete");
  20903. }
  20904. }
  20905. closeAllGuide() {
  20906. xGame.common.gameUI.ui.guide1.visible = false;
  20907. xGame.common.gameUI.ui.guide2.visible = false;
  20908. xGame.common.gameUI.ui.guide3.visible = false;
  20909. }
  20910. closeAllGuideForLxms() {
  20911. xGame.common.gameUI.ui.n_lxms_yd1.visible = false;
  20912. xGame.common.gameUI.ui.n_lxms_yd2.visible = false;
  20913. xGame.common.gameUI.ui.n_lxms_yd3.visible = false;
  20914. }
  20915. updateBarInfo() {
  20916. let star = this.ui.powerNode.y;
  20917. let rate = (this.barInfo.curY - star) / this.barInfo.height;
  20918. if (rate >= 1)
  20919. rate = 1;
  20920. if (rate <= 0)
  20921. rate = 0;
  20922. this.powerNum = Math.ceil(rate * 100);
  20923. this.ui.powerNode.value = this.powerNum;
  20924. this.ui.powerNode.showImg.y = this.barInfo.showStarY + (this.powerNum / 100) * this.barInfo.height;
  20925. this.ui.colorNode.value = this.powerNum;
  20926. this.ui.powerEft.y = this.barInfo.powerStartY + (this.powerNum / 100) * this.barInfo.height;
  20927. this.ui.powerEft.visible = this.powerNum != 0;
  20928. this.ui.colorNode.visible = this.powerNum != 0;
  20929. this.ui.powerTxt.text = this.powerNum + "";
  20930. xGame.common.d2World.d2Gan.storagePower(this.powerNum);
  20931. }
  20932. forceCancel() {
  20933. this.ui.powerNode.value = 0;
  20934. this.ui.powerNode.showImg.y = this.barInfo.showStarY;
  20935. this.ui.powerTxt.text = "";
  20936. }
  20937. checkRodMoveDir() {
  20938. let tempX = this.eventObj.lastX - xGame.common.sysOffestNum - xGame.common.d2World.rootBall.gameObj.x;
  20939. let tempY = this.eventObj.lastY - xGame.common.d2World.rootBall.gameObj.y;
  20940. if (tempX >= 0 && tempY <= 0) {
  20941. return this.checkDir();
  20942. }
  20943. else if (tempX < 0 && tempY < 0) {
  20944. return this.checkDir(1, -1);
  20945. }
  20946. else if (tempX < 0 && tempY > 0) {
  20947. return this.checkDir(-1, -1);
  20948. }
  20949. else {
  20950. return this.checkDir(-1, 1);
  20951. }
  20952. }
  20953. checkDir(flagX = 1, flagY = 1) {
  20954. let offsetX = this.eventObj.curX - this.eventObj.lastX;
  20955. let offsetY = this.eventObj.curY - this.eventObj.lastY;
  20956. if (offsetY == 0) {
  20957. return offsetX * flagX;
  20958. }
  20959. if (offsetX == 0) {
  20960. return offsetY * flagY;
  20961. }
  20962. let angle = offsetY / offsetX;
  20963. if (Math.abs(angle) >= 1) {
  20964. return offsetY * flagY;
  20965. }
  20966. else {
  20967. return offsetX * flagX;
  20968. }
  20969. }
  20970. judgeBallIntersect() {
  20971. let rootBall = xGame.common.d2World.rootBall;
  20972. let ballArr = xGame.common.d2World.ballArr;
  20973. let radius = rootBall.gameObj.width / 2;
  20974. let temp;
  20975. let isIntersect = false;
  20976. for (let index = 0; index < ballArr.length; index++) {
  20977. temp = ballArr[index];
  20978. if (temp.number == rootBall.number)
  20979. continue;
  20980. isIntersect = Math.pow(rootBall.gameObj.x - temp.gameObj.x, 2) + Math.pow(rootBall.gameObj.y - temp.gameObj.y, 2) <= 4 * radius * radius;
  20981. if (isIntersect) {
  20982. break;
  20983. }
  20984. }
  20985. return isIntersect;
  20986. }
  20987. hideBallUI() {
  20988. let d2Gan = xGame.common.d2World.d2Gan;
  20989. if (!d2Gan.ui.isDisposed)
  20990. d2Gan.ui.visible = false;
  20991. let d2Help = xGame.common.d2World.d2HelpLine;
  20992. if (!d2Help.ui.isDisposed)
  20993. d2Help.ui.visible = false;
  20994. let rootBall = xGame.common.d2World.rootBall;
  20995. if (!rootBall.destroyed) {
  20996. rootBall.gameObj.active = false;
  20997. }
  20998. }
  20999. showBallUI() {
  21000. let d2Gan = xGame.common.d2World.d2Gan;
  21001. if (!d2Gan.ui.isDisposed)
  21002. d2Gan.ui.visible = true;
  21003. let d2Help = xGame.common.d2World.d2HelpLine;
  21004. if (!d2Help.ui.isDisposed)
  21005. d2Help.ui.visible = true;
  21006. let rootBall = xGame.common.d2World.rootBall;
  21007. if (!rootBall.destroyed) {
  21008. rootBall.gameObj.active = true;
  21009. }
  21010. }
  21011. moveToClickDot(e) {
  21012. if (!this.isMoveRod && !xGame.common.clickedBall) {
  21013. let root = xGame.common.d2World.rootBall.gameObj;
  21014. let xx = e.stageX - xGame.common.sysOffestNum;
  21015. let yy = e.stageY;
  21016. let x = xx - root.x;
  21017. let y = yy - root.y;
  21018. let angle = xGame.common.getfguiRotation(x, y);
  21019. xGame.common.d2World.d2Gan.ui.rotation = angle;
  21020. xGame.common.d2World.getHelpLine();
  21021. }
  21022. this.isMoveRod = false;
  21023. xGame.common.clickedBall = false;
  21024. }
  21025. openAllEvent() {
  21026. this.closeAllEvent();
  21027. this.ui.myPowerNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21028. this.ui.moveNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21029. this.ui.rulerClickNode.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21030. this.ui.on(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21031. this.ui.on(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  21032. this.ui.on(Laya.Event.MOUSE_UP, this, this.onEventUp);
  21033. this.ui.on(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  21034. }
  21035. closeAllEvent() {
  21036. this.ui.myPowerNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21037. this.ui.moveNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21038. this.ui.rulerClickNode.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21039. this.ui.off(Laya.Event.MOUSE_DOWN, this, this.onEventPress);
  21040. this.ui.off(Laya.Event.MOUSE_MOVE, this, this.onEventMove);
  21041. this.ui.off(Laya.Event.MOUSE_UP, this, this.onEventUp);
  21042. this.ui.off(Laya.Event.MOUSE_OUT, this, this.onEventUp);
  21043. }
  21044. resetGame() {
  21045. this.closeAllEvent();
  21046. this.hideBallUI();
  21047. xGame.common.gameMgr.gamePause = true;
  21048. }
  21049. }
  21050. UIGame$1.uiName = "UIGame";
  21051. class UIAddCoin$1 extends UIBase {
  21052. constructor() {
  21053. super();
  21054. this.coinNum = 2000;
  21055. }
  21056. onConstructor() {
  21057. this.ui = ui_UIAddCoin.createInstance();
  21058. this.contentPane = this.ui;
  21059. this.isEject = false;
  21060. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  21061. this.addUIClick(this.ui.myNode.videoBtn, this.videoAddCoin);
  21062. }
  21063. show() {
  21064. super.show();
  21065. this.ui.t0.play();
  21066. this.setGlobalFont(this.ui);
  21067. }
  21068. videoAddCoin() {
  21069. console.log('zh:qjff_AD_for_UIAddCoin');
  21070. if (Laya.Browser.onAndroid) {
  21071. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21072. if (!boo) {
  21073. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21074. return;
  21075. }
  21076. }
  21077. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIAddCoin')) {
  21078. }
  21079. else {
  21080. console.log('zh:AD 失败,直接发放奖励');
  21081. this.qjff_AD_for_UIAddCoin();
  21082. }
  21083. }
  21084. qjff_AD_for_UIAddCoin() {
  21085. xGame.common.playObjFlyAnim(this.coinNum, Prop.coin);
  21086. this.hide();
  21087. }
  21088. }
  21089. UIAddCoin$1.uiName = "UIAddCoin";
  21090. class UIInvitation$1 extends UIBase {
  21091. constructor() {
  21092. super();
  21093. }
  21094. onConstructor() {
  21095. this.ui = ui_UIInvitation.createInstance();
  21096. this.contentPane = this.ui;
  21097. this.isEject = false;
  21098. this.addUIClick(this.ui.myNode.enterBtn, this.enterGame);
  21099. }
  21100. show() {
  21101. super.show();
  21102. this.setGlobalFont(this.ui);
  21103. }
  21104. enterGame() {
  21105. xGame.common.gameMode = GameMode.classic;
  21106. DataMgr.setChallengeTimes(1);
  21107. xGame.common.passAwardCoin = 2000;
  21108. let need = xGame.common.classicNiceNeddCoin;
  21109. if (DataMgr.coinEnough(need)) {
  21110. DataMgr.setCoin(-need);
  21111. xGame.eventMgr.event(RESTART_GAME, true);
  21112. Moyu.sendDataEvent("enterChallenge", { mode: xGame.common.gameMode });
  21113. }
  21114. else {
  21115. xGame.eventMgr.event(RESTART_GAME, true);
  21116. }
  21117. this.hide();
  21118. }
  21119. hide() {
  21120. super.hide();
  21121. }
  21122. }
  21123. UIInvitation$1.uiName = "UIInvitation";
  21124. class UIPower$1 extends UIBase {
  21125. constructor() {
  21126. super();
  21127. }
  21128. onConstructor() {
  21129. this.ui = ui_UIPower.createInstance();
  21130. this.contentPane = this.ui;
  21131. this.isEject = false;
  21132. this.addUIClick(this.ui.myNode.cancelBtn, this.hide);
  21133. this.addUIClick(this.ui.myNode.videoBtn, this.videoGetPower);
  21134. }
  21135. show() {
  21136. super.show();
  21137. this.ui.t0.play();
  21138. this.setGlobalFont(this.ui);
  21139. }
  21140. videoGetPower() {
  21141. console.log('zh:qjff_AD_for_uipower');
  21142. if (Laya.Browser.onAndroid) {
  21143. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21144. if (!boo) {
  21145. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21146. return;
  21147. }
  21148. }
  21149. if (Laya.Browser.onAndroid) {
  21150. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uipower')) {
  21151. }
  21152. else {
  21153. console.log('zh:AD 失败,直接发放奖励');
  21154. this.qjff_AD_for_uipower();
  21155. }
  21156. }
  21157. else {
  21158. this.qjff_AD_for_uipower();
  21159. }
  21160. }
  21161. qjff_AD_for_uipower() {
  21162. DataMgr.setPower(xGame.common.videoPower, true);
  21163. xGame.eventMgr.event(POWER_TIME);
  21164. this.hide();
  21165. }
  21166. }
  21167. UIPower$1.uiName = "UIPower";
  21168. class UIGameEnd$1 extends UIBase {
  21169. constructor() {
  21170. super();
  21171. this.success = false;
  21172. this.awardCoinNum = 1000;
  21173. this.awardDiamondNum = 10;
  21174. }
  21175. onConstructor() {
  21176. this.ui = ui_UIGameEnd.createInstance();
  21177. this.contentPane = this.ui;
  21178. this.addUIClick(this.ui.leftBtn, this.clickLeftBtn);
  21179. this.addUIClick(this.ui.closeNode.closeBtn, this.returnHome);
  21180. this.addUIClick(this.ui.rightBtn, this.clickRightBtn);
  21181. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21182. this.ui.talkNode.visible = false;
  21183. if (Moyu.isKs)
  21184. this.ui.closeNode.closeBtn.x += 100;
  21185. }
  21186. updateType() {
  21187. switch (xGame.common.gameMode) {
  21188. case GameMode.classic:
  21189. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21190. this.ui.coinNode.visible = this.success;
  21191. if (!this.success) {
  21192. Laya.timer.once(500, this, () => {
  21193. xGame.uiMgr.Show(UIAddCoin$1);
  21194. });
  21195. }
  21196. else {
  21197. this.logEventForClassic_win();
  21198. }
  21199. this.logEventForClassic_complete();
  21200. this.ui.isGetAward.visible = false;
  21201. this.ui.leftBtn.c1.selectedIndex = 3;
  21202. this.ui.rightBtn.c1.selectedIndex = 0;
  21203. this.moneyNode.ui.c1.selectedIndex = 1;
  21204. break;
  21205. case GameMode.bigMove:
  21206. console.log('zh:招法模式 aaaaaa bigMove');
  21207. this.ui.c1.selectedIndex = this.success ? 0 : 1;
  21208. this.ui.coinNode.visible = this.success;
  21209. if (xGame.common.gameMode == GameMode.bigMove) {
  21210. if (this.success) {
  21211. DataMgr.setSkillSuccessTimes(1, true);
  21212. DataMgr.setSkillAccTimes(1);
  21213. }
  21214. else {
  21215. DataMgr.setSkillSuccessTimes(0, false);
  21216. }
  21217. }
  21218. this.logEventForRod_complete_N();
  21219. if (!this.success) {
  21220. Laya.timer.once(500, this, () => {
  21221. xGame.uiMgr.Show(UIAddCoin$1);
  21222. });
  21223. }
  21224. else {
  21225. this.logEventForRod_win();
  21226. }
  21227. this.ui.isGetAward.visible = false;
  21228. this.ui.leftBtn.c1.selectedIndex = 3;
  21229. this.ui.rightBtn.c1.selectedIndex = 0;
  21230. this.moneyNode.ui.c1.selectedIndex = 1;
  21231. break;
  21232. case GameMode.placeBall:
  21233. this.ui.coinNode.visible = false;
  21234. if (this.success) {
  21235. if (xGame.common.placeBallStarNum == 3) {
  21236. this.ui.c1.selectedIndex = 2;
  21237. }
  21238. else {
  21239. this.ui.c1.selectedIndex = 3;
  21240. }
  21241. let level = xGame.common.placeBallCurLevel;
  21242. if (level > 59) {
  21243. this.logEventForChallenge_level_complete(level);
  21244. }
  21245. else {
  21246. this.logEventForChallenge_level_N(level);
  21247. }
  21248. }
  21249. else {
  21250. this.ui.c1.selectedIndex = 4;
  21251. }
  21252. let cfg = cfgTable.placeballData[xGame.common.placeBallCurLevel];
  21253. if (cfg.type == PlaceBallType.challenge) {
  21254. this.ui.c1.selectedIndex = 2;
  21255. }
  21256. this.ui.conditionNode.conditionTxt.text = cfg.type == 0 ? `Clear the table` : `Pocket ${cfg.ball} balls `;
  21257. this.updatePlaceBallBtn();
  21258. this.updatePlaceBallStarNum();
  21259. this.updatePlaceBallAwardState();
  21260. this.moneyNode.ui.c1.selectedIndex = 2;
  21261. this.moneyNode.checkPowerTime();
  21262. this.moneyNode.powerChange();
  21263. DataMgr.upRankData();
  21264. break;
  21265. default:
  21266. break;
  21267. }
  21268. }
  21269. logEventForRod_complete_N() {
  21270. let gfmsIdx = xGame.common.curPlayerSkillType;
  21271. console.log('zh:logEventForRod_complete_N 选择的技能=' + gfmsIdx);
  21272. let gfmc = 'Skyfall Shot';
  21273. if (gfmsIdx == 0) {
  21274. gfmc = 'Skyfall Shot';
  21275. }
  21276. if (gfmsIdx == 1) {
  21277. gfmc = 'Surging break';
  21278. }
  21279. if (gfmsIdx == 2) {
  21280. gfmc = 'Frost Lock';
  21281. }
  21282. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21283. console.log('zh:logEventForRod_complete_N level = ' + level);
  21284. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  21285. let jsonStr = {
  21286. "count": 0,
  21287. "name": gfmc
  21288. };
  21289. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21290. const d = LocalStorageManager.getItem(keyStr);
  21291. jsonStr.count = d.count + 1;
  21292. LocalStorageManager.setItem(keyStr, jsonStr);
  21293. }
  21294. else {
  21295. LocalStorageManager.setItem(keyStr, jsonStr);
  21296. }
  21297. const d2 = LocalStorageManager.getItem(keyStr);
  21298. let count = d2.count;
  21299. console.log('zh:logEventForRod_complete_N count = ' + count);
  21300. if (count % 5 == 0) {
  21301. const reqStr = JSON.stringify(jsonStr);
  21302. JSBridgeUtils.instance.logEventForAdHaveParams('rod_complete_' + d2, reqStr);
  21303. JSBridgeUtils.instance.logEventForFirebase('rod_complete_' + d2, reqStr);
  21304. }
  21305. }
  21306. logEventForRod_win() {
  21307. console.log('zh:logEventForRod_win,胜利');
  21308. let gfmsIdx = xGame.common.curPlayerSkillType;
  21309. console.log('zh:logEventForRod_win 选择的技能=' + gfmsIdx);
  21310. let gfmc = 'Skyfall Shot';
  21311. if (gfmsIdx == 0) {
  21312. gfmc = 'Skyfall Shot';
  21313. }
  21314. if (gfmsIdx == 1) {
  21315. gfmc = 'Surging break';
  21316. }
  21317. if (gfmsIdx == 2) {
  21318. gfmc = 'Frost Lock';
  21319. }
  21320. let level = DataMgr.getBigSkillByIndex(gfmsIdx);
  21321. console.log('zh:logEventForRod_win level = ' + level);
  21322. let keyStr = 'sjmd_rod_win_' + gfmsIdx;
  21323. let jsonStr = {
  21324. "count": 1,
  21325. "name": gfmc + ' Lev' + level
  21326. };
  21327. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21328. const d = LocalStorageManager.getItem(keyStr);
  21329. jsonStr.count = d.count + 1;
  21330. LocalStorageManager.setItem(keyStr, jsonStr);
  21331. }
  21332. else {
  21333. LocalStorageManager.setItem(keyStr, jsonStr);
  21334. }
  21335. const reqStr = JSON.stringify(jsonStr);
  21336. JSBridgeUtils.instance.logEventForAdHaveParams('rod_win', reqStr);
  21337. }
  21338. logEventForClassic_win() {
  21339. console.log('zh:logEventForClassic_win,胜利');
  21340. let rtype = xGame.common.classicRoomType;
  21341. let msmc = '';
  21342. if (rtype == 1) {
  21343. msmc = 'beginner';
  21344. }
  21345. if (rtype == 2) {
  21346. msmc = 'expert';
  21347. }
  21348. if (rtype == 3) {
  21349. msmc = 'master';
  21350. }
  21351. let keyStr = 'sjmd_classic_win_' + rtype;
  21352. let jsonStr = {
  21353. "difficulty": msmc,
  21354. "classic_count": 1,
  21355. "difficulty_count": 1
  21356. };
  21357. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21358. const d = LocalStorageManager.getItem(keyStr);
  21359. jsonStr.classic_count = d.classic_count + 1;
  21360. jsonStr.difficulty_count = d.difficulty_count + 1;
  21361. LocalStorageManager.setItem(keyStr, jsonStr);
  21362. }
  21363. else {
  21364. LocalStorageManager.setItem(keyStr, jsonStr);
  21365. }
  21366. const reqStr = JSON.stringify(jsonStr);
  21367. JSBridgeUtils.instance.logEventForAdHaveParams('classic_win', reqStr);
  21368. }
  21369. logEventForClassic_complete() {
  21370. console.log('zh:logEventForClassic_complete,胜利');
  21371. let rtype = xGame.common.classicRoomType;
  21372. let msmc = '';
  21373. if (rtype == 1) {
  21374. msmc = 'beginner';
  21375. }
  21376. if (rtype == 2) {
  21377. msmc = 'expert';
  21378. }
  21379. if (rtype == 3) {
  21380. msmc = 'master';
  21381. }
  21382. let keyStr = 'sjmd_classic_complete_' + rtype;
  21383. let jsonStr = {
  21384. "msmc": msmc,
  21385. "count": 0
  21386. };
  21387. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21388. const d = LocalStorageManager.getItem(keyStr);
  21389. jsonStr.count = d.count + 1;
  21390. LocalStorageManager.setItem(keyStr, jsonStr);
  21391. }
  21392. else {
  21393. LocalStorageManager.setItem(keyStr, jsonStr);
  21394. }
  21395. if (jsonStr.count % 5 == 0) {
  21396. const reqStr = JSON.stringify(jsonStr);
  21397. JSBridgeUtils.instance.logEventForAdNoParams('classic_complete');
  21398. JSBridgeUtils.instance.logEventForFirebase('classic_complete', null);
  21399. }
  21400. }
  21401. updatePlaceBallBtn() {
  21402. this.ui.leftBtn.c1.selectedIndex = 5;
  21403. if (this.success) {
  21404. this.ui.rightBtn.c1.selectedIndex = 14;
  21405. }
  21406. else {
  21407. if (xGame.common.placeBallStarNum == 3) {
  21408. this.ui.rightBtn.c1.selectedIndex = 14;
  21409. }
  21410. else {
  21411. this.ui.rightBtn.c1.selectedIndex = 1;
  21412. }
  21413. }
  21414. }
  21415. updatePlaceBallStarNum() {
  21416. let starNum = xGame.common.placeBallStarNum;
  21417. if (starNum == 0)
  21418. this.ui.starNumNode.c1.selectedIndex = 3;
  21419. else {
  21420. this.ui.starNumNode.c1.selectedIndex = starNum - 1;
  21421. }
  21422. }
  21423. updatePlaceBallAwardState() {
  21424. let level = xGame.common.placeBallCurLevel;
  21425. let starNum = xGame.common.placeBallStarNum;
  21426. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21427. let data = cfgTable.placeballData[level].award;
  21428. let cfg = cfgTable.placeballData[level];
  21429. this.awardDiamondNum = data[1];
  21430. this.awardCoinNum = data[0];
  21431. if (cfg.type == PlaceBallType.challenge) {
  21432. this.awardDiamondNum = 0;
  21433. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21434. }
  21435. this.ui.awardNode.diamondNode.visible = this.awardDiamondNum > 0;
  21436. this.ui.awardNode.coinNode.visible = this.awardCoinNum > 0;
  21437. if (cfg.type == PlaceBallType.challenge) {
  21438. this.ui.awardNode.coinNode.visible = true;
  21439. }
  21440. if (this.awardCoinNum > 0 && this.awardDiamondNum > 0) {
  21441. this.ui.awardNode.diamondNode.x = 265;
  21442. this.ui.awardNode.coinNode.x = 354;
  21443. }
  21444. else {
  21445. this.ui.awardNode.diamondNode.x = 291;
  21446. this.ui.awardNode.coinNode.x = 291;
  21447. }
  21448. this.ui.awardNode.diamondNode.numTxt.text = this.awardDiamondNum + "";
  21449. this.ui.awardNode.coinNode.numTxt.text = this.awardCoinNum + "";
  21450. if (this.awardCoinNum == 0) {
  21451. this.ui.awardNode.coinNode.numTxt.text = "";
  21452. }
  21453. if (getAward) {
  21454. this.ui.isGetAward.visible = true;
  21455. this.ui.awardNode.diamondNode.c1.selectedIndex = 2;
  21456. this.ui.awardNode.coinNode.c1.selectedIndex = 2;
  21457. }
  21458. else {
  21459. this.ui.isGetAward.visible = false;
  21460. if (starNum == 3 && cfg.type == PlaceBallType.challenge) {
  21461. this.ui.awardNode.diamondNode.c1.selectedIndex = 0;
  21462. this.ui.awardNode.coinNode.c1.selectedIndex = 0;
  21463. }
  21464. else {
  21465. this.ui.awardNode.diamondNode.c1.selectedIndex = 1;
  21466. this.ui.awardNode.coinNode.c1.selectedIndex = 1;
  21467. }
  21468. }
  21469. }
  21470. show(success) {
  21471. super.show();
  21472. xGame.eventMgr.event(RESET_GAME);
  21473. this.success = success;
  21474. Laya.timer.clearAll(this);
  21475. this.playSecretaryAni();
  21476. Moyu.sendDataEvent("GameEnd", { id: xGame.common.gameMode, res: this.success ? 1 : 2 });
  21477. let offsetTime = new Date().getTime() - xGame.common.gameStartTime;
  21478. offsetTime = Math.floor(offsetTime / 1000);
  21479. Moyu.sendDataEvent("gameOver", { isWin: this.success ? 1 : 0, timeConsuming: offsetTime, gameType: xGame.common.gameMode });
  21480. this.updateType();
  21481. Laya.timer.once(200, this, () => {
  21482. this.addAward(() => {
  21483. this.updateType();
  21484. Laya.timer.once(500, this, () => {
  21485. this.showChallengeLevel();
  21486. });
  21487. });
  21488. });
  21489. if (this.success) {
  21490. JSBridgeUtils.instance.showInternAd('gameend_success');
  21491. console.log('zh:game end 成功');
  21492. xGame.soundMgr.playSound('slots_roll01');
  21493. xGame.soundMgr.playSound("s_win");
  21494. xGame.common.showGirlTalkPop(8, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21495. this.diyGameDataUtilForGameWin();
  21496. this.updateGamePlaceBallData2Server();
  21497. }
  21498. else {
  21499. JSBridgeUtils.instance.showInternAd('gameend_faill');
  21500. console.log('zh:game end失败');
  21501. xGame.soundMgr.playSound('matchwin01');
  21502. xGame.soundMgr.playSound("s_lose");
  21503. xGame.common.showGirlTalkPop(9, this.ui.talkNode, this.ui.talkNode.womanTxt);
  21504. }
  21505. console.log('zh:开始弹出福利框2个');
  21506. Laya.timer.once(1000, this, () => {
  21507. console.log('zh: 1秒后 showFuLiSp1');
  21508. DataMgr.checkForShowFuLi17AndAlert(1);
  21509. });
  21510. let challengeNum = DataMgr.getChallengeTimes();
  21511. if (xGame.common.gameMode == GameMode.classic && challengeNum >= 1 && challengeNum <= 3) {
  21512. DataMgr.setChallengeTimes(1);
  21513. }
  21514. if (this.success && xGame.common.gameMode == GameMode.classic) {
  21515. DataMgr.setClassicTimes();
  21516. }
  21517. this.setGlobalFont(this.ui);
  21518. }
  21519. diyGameDataUtilForGameWin() {
  21520. console.log('zh: DiyGameDataUtilForGameWin diy ');
  21521. switch (xGame.common.gameMode) {
  21522. case GameMode.classic:
  21523. console.log('zh:DiyGameDataUtilForGameWin 111');
  21524. case GameMode.bigMove:
  21525. console.log('zh:DiyGameDataUtilForGameWin 222');
  21526. this.restartGame();
  21527. break;
  21528. case GameMode.placeBall:
  21529. console.log('zh:DiyGameDataUtilForGameWin 333');
  21530. var level = xGame.common.placeBallCurLevel;
  21531. console.log('zh:练习模式 联系了多少LEV=' + level);
  21532. let db_over_lev = DataMgr.getChallengeMode_overLev();
  21533. if (level > db_over_lev) {
  21534. DataMgr.setChallengeMode_overLev(level);
  21535. }
  21536. break;
  21537. default:
  21538. console.log('zh:DiyGameDataUtilForGameWin 444');
  21539. break;
  21540. }
  21541. }
  21542. updateGamePlaceBallData2Server() {
  21543. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  21544. if (userInfo == null) {
  21545. return;
  21546. }
  21547. let pbdObj = DataMgr.getPlaceBallLevelList();
  21548. let reqData = xGame.httpMgr.getReqData();
  21549. let pd = JSON.parse(reqData);
  21550. pd.placeBallData = JSON.stringify(pbdObj);
  21551. reqData = JSON.stringify(pd);
  21552. xGame.httpMgr.sendPost2025('user/updateGamePlaceBallData', reqData, (res) => {
  21553. try {
  21554. console.log('zh:updateGamePlaceBallData res = ' + JSON.stringify(res));
  21555. let code = res.code;
  21556. let msg = res.msg;
  21557. if (code == 401) {
  21558. Laya.LocalStorage.removeItem(keyForLoginInfo);
  21559. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  21560. return;
  21561. }
  21562. if (code == 200) {
  21563. let data = res.data;
  21564. console.log('zh:updateGamePlaceBallData data rs= ' + JSON.stringify(data));
  21565. }
  21566. else {
  21567. xGame.uiMgr.Show(UIMsg$1, msg);
  21568. }
  21569. }
  21570. catch (error) {
  21571. console.log('error=' + error);
  21572. alert(error);
  21573. }
  21574. finally {
  21575. }
  21576. });
  21577. }
  21578. showChallengeLevel() {
  21579. if (DataMgr.getChallengeTimes() != 0)
  21580. return;
  21581. let skill = DataMgr.getSkillAccTimes();
  21582. let put = DataMgr.getPlaceBallLevelList().length;
  21583. if (skill >= 3 || put >= 5) {
  21584. xGame.uiMgr.Show(UIInvitation$1);
  21585. this.hide();
  21586. }
  21587. }
  21588. addAward(callback) {
  21589. if (!this.success) {
  21590. callback && callback();
  21591. return;
  21592. }
  21593. switch (xGame.common.gameMode) {
  21594. case GameMode.classic:
  21595. this.awardCoinNum = xGame.common.passAwardCoin;
  21596. this.awardDiamondNum = 0;
  21597. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21598. break;
  21599. case GameMode.bigMove:
  21600. this.awardCoinNum = xGame.common.passAwardCoin;
  21601. this.awardDiamondNum = 0;
  21602. xGame.common.playObjFlyAnim(this.awardCoinNum, Prop.coin);
  21603. callback && callback();
  21604. break;
  21605. case GameMode.placeBall:
  21606. let level = xGame.common.placeBallCurLevel;
  21607. Moyu.sendDataEvent("PlaceBall", { id: level, res: this.success ? 1 : 2 });
  21608. if (xGame.common.placeBallStarNum != 3) {
  21609. callback && callback();
  21610. return;
  21611. }
  21612. else {
  21613. let getAward = DataMgr.getPlaceBallLevel(level).getAward;
  21614. if (getAward) {
  21615. callback && callback();
  21616. return;
  21617. }
  21618. }
  21619. let cfg = cfgTable.placeballData[level];
  21620. let data = cfgTable.placeballData[level].award;
  21621. this.awardCoinNum = data[0];
  21622. this.awardDiamondNum = data[1];
  21623. if (cfg.type == PlaceBallType.challenge) {
  21624. this.awardDiamondNum = 0;
  21625. this.awardCoinNum = xGame.common.gameMgr.finishBalls * 100;
  21626. }
  21627. let coinAward = new AwardType(Prop.coin, this.awardCoinNum);
  21628. let diamondAward;
  21629. if (this.awardDiamondNum > 0) {
  21630. diamondAward = new AwardType(Prop.diamond, this.awardDiamondNum);
  21631. xGame.common.getAward([diamondAward, coinAward], callback);
  21632. }
  21633. else {
  21634. xGame.common.getAward([coinAward], callback);
  21635. }
  21636. if (cfg.type == PlaceBallType.normal) {
  21637. DataMgr.setPlaceBallAward(level);
  21638. }
  21639. break;
  21640. default:
  21641. break;
  21642. }
  21643. }
  21644. playSecretaryAni_old() {
  21645. let parent = this.ui.secretary.displayObject;
  21646. parent.destroyChildren();
  21647. let xx = this.ui.secretary.width / 2;
  21648. let yy = this.ui.secretary.height;
  21649. let scale = xGame.common.getSecretaryScale();
  21650. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21651. if (this.success) {
  21652. let rand = Math.random() <= 0.5 ? 2 : 3;
  21653. xGame.common.secretary.play(data, rand, false, parent, () => {
  21654. xGame.common.secretary.play(data, 1, true, parent);
  21655. });
  21656. }
  21657. else {
  21658. xGame.common.secretary.play(data, 0, true, parent);
  21659. }
  21660. }
  21661. playSecretaryAni() {
  21662. let parent = this.ui.secretary.displayObject;
  21663. parent.destroyChildren();
  21664. let xx = this.ui.secretary.width / 2;
  21665. let yy = this.ui.secretary.height;
  21666. let scale = xGame.common.getSecretaryScale();
  21667. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  21668. if (this.success) {
  21669. let rand = 0;
  21670. xGame.common.secretary.play(data, 0, true, parent);
  21671. }
  21672. else {
  21673. xGame.common.secretary.play(data, 0, true, parent);
  21674. }
  21675. }
  21676. restartGame() {
  21677. switch (xGame.common.gameMode) {
  21678. case GameMode.classic:
  21679. xGame.eventMgr.event(RESTART_GAME);
  21680. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21681. break;
  21682. case GameMode.bigMove:
  21683. this.hide();
  21684. xGame.eventMgr.event(RESTART_GAME);
  21685. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21686. break;
  21687. default:
  21688. break;
  21689. }
  21690. }
  21691. hide() {
  21692. super.hide();
  21693. xGame.common.stopGirlPop(this.ui.talkNode);
  21694. PlatMgr.showBanner(false);
  21695. }
  21696. returnHome() {
  21697. this.hide();
  21698. let showFailWords = !this.success;
  21699. xGame.uiMgr.Show(UIMain$1, showFailWords);
  21700. }
  21701. clickLeftBtn() {
  21702. switch (xGame.common.gameMode) {
  21703. case GameMode.classic:
  21704. case GameMode.bigMove:
  21705. this.returnHome();
  21706. break;
  21707. case GameMode.placeBall:
  21708. let level = xGame.common.placeBallCurLevel;
  21709. this.powerStartPlaceBallLevel(level, this.ui.leftBtn);
  21710. Moyu.sendDataEvent("GameAgain", { mode: xGame.common.gameMode });
  21711. break;
  21712. default:
  21713. break;
  21714. }
  21715. }
  21716. powerStartPlaceBallLevel(level, btn) {
  21717. if (DataMgr.powerEnough()) {
  21718. btn.touchable = false;
  21719. btn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21720. btn.touchable = true;
  21721. DataMgr.setPower(-1);
  21722. xGame.eventMgr.event(POWER_TIME);
  21723. this.startPlaceBallLevel(level);
  21724. this.logEventForChallenge_level_start(level);
  21725. }));
  21726. }
  21727. else {
  21728. xGame.uiMgr.Show(UIPower$1, 0);
  21729. }
  21730. }
  21731. clickRightBtn() {
  21732. switch (xGame.common.gameMode) {
  21733. case GameMode.classic:
  21734. console.log('zh:clickRightBtn 111');
  21735. case GameMode.bigMove:
  21736. console.log('zh:clickRightBtn 222');
  21737. this.restartGame();
  21738. break;
  21739. case GameMode.placeBall:
  21740. console.log('zh:clickRightBtn 333');
  21741. let level = xGame.common.placeBallCurLevel;
  21742. let data = DataMgr.getPlaceBallLevel(level);
  21743. let curPss = data.play && !data.isCur;
  21744. if (curPss) {
  21745. console.log('zh:clickRightBtn 333-111');
  21746. console.log('zh:当前LV=' + level);
  21747. if (level == 60) {
  21748. xGame.uiMgr.Show(UIMsg$1, "Congratulations on passing all levels.");
  21749. Laya.timer.once(3000, this, () => {
  21750. this.returnHome();
  21751. });
  21752. }
  21753. else {
  21754. let lev = level + 1;
  21755. this.powerStartPlaceBallLevel(lev, this.ui.rightBtn);
  21756. }
  21757. }
  21758. else {
  21759. console.log('zh:clickRightBtn 333-000');
  21760. Moyu.sendDataEvent("placeBallNextLevel");
  21761. console.log('zh:qjff_AD_for_uiGameEnd');
  21762. if (Laya.Browser.onAndroid) {
  21763. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  21764. if (!boo) {
  21765. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  21766. return;
  21767. }
  21768. }
  21769. Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level + '');
  21770. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiGameEnd')) {
  21771. }
  21772. else {
  21773. console.log('zh:AD 失败,直接发放奖励');
  21774. this.qjff_AD_for_uiGameEnd(level);
  21775. }
  21776. }
  21777. break;
  21778. default:
  21779. console.log('zh:clickRightBtn 444');
  21780. break;
  21781. }
  21782. }
  21783. logEventForChallenge_level_start(level) {
  21784. let keyStr = 'sjmd_challenge_level_start';
  21785. let jsonStr = {
  21786. "count": 0,
  21787. "gold_balance ": DataMgr.getCoin(),
  21788. "level": level,
  21789. "diamond_balance ": DataMgr.getDiamond()
  21790. };
  21791. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21792. const d = LocalStorageManager.getItem(keyStr);
  21793. if (level > d.level) {
  21794. jsonStr.count = d.count + 1;
  21795. LocalStorageManager.setItem(keyStr, jsonStr);
  21796. }
  21797. else {
  21798. }
  21799. }
  21800. else {
  21801. LocalStorageManager.setItem(keyStr, jsonStr);
  21802. }
  21803. const reqStr = JSON.stringify(jsonStr);
  21804. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  21805. }
  21806. qjff_AD_for_uiGameEnd(level) {
  21807. DataMgr.setPlaceBallLevel(level, 1);
  21808. this.startPlaceBallLevel(level + 1);
  21809. }
  21810. startPlaceBallLevel(level) {
  21811. xGame.common.gameMode = GameMode.placeBall;
  21812. xGame.common.placeBallCurLevel = level;
  21813. xGame.uiMgr.Show(UIGame$1);
  21814. this.hide();
  21815. }
  21816. logEventForChallenge_level_complete(level) {
  21817. let keyStr = 'sjmd_challenge_level_complete';
  21818. let jsonStr = {
  21819. "count": 1,
  21820. "gold_balance ": DataMgr.getCoin(),
  21821. "level": level,
  21822. "diamond_balance ": DataMgr.getDiamond()
  21823. };
  21824. if (LocalStorageManager.hasJosnKey(keyStr)) {
  21825. const d = LocalStorageManager.getItem(keyStr);
  21826. jsonStr.count = d.count + 1;
  21827. LocalStorageManager.setItem(keyStr, jsonStr);
  21828. }
  21829. else {
  21830. LocalStorageManager.setItem(keyStr, jsonStr);
  21831. }
  21832. const reqStr = JSON.stringify(jsonStr);
  21833. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_complete', reqStr);
  21834. }
  21835. logEventForChallenge_level_N(level) {
  21836. console.log('zh:logEventForChallenge_level_N ' + level);
  21837. let keyStr = 'sjmd_challenge_level_N';
  21838. if (LocalStorageManager.hasKey(keyStr)) {
  21839. let lev = LocalStorageManager.getItem(keyStr);
  21840. if (level > lev) {
  21841. LocalStorageManager.setItem(keyStr, level);
  21842. }
  21843. if ((level) % 5 == 0) {
  21844. console.log('zh:每5关上报1次');
  21845. let sjmc = 'challenge_level_' + level;
  21846. JSBridgeUtils.instance.logEventForAdNoParams(sjmc);
  21847. let sjmcForFirebase = 'challenge_level_' + level;
  21848. JSBridgeUtils.instance.logEventForFirebase(sjmcForFirebase, null);
  21849. }
  21850. else {
  21851. console.log('zh:5 no 上报');
  21852. }
  21853. }
  21854. else {
  21855. LocalStorageManager.setItem(keyStr, level);
  21856. }
  21857. }
  21858. }
  21859. UIGameEnd$1.uiName = "UIGameEnd";
  21860. class ShowItem$1 {
  21861. constructor() {
  21862. this.ui = ui_ShowItem.createInstance();
  21863. }
  21864. destroySelf() {
  21865. if (!this.ui.isDisposed) {
  21866. this.ui.removeFromParent();
  21867. this.ui.dispose();
  21868. }
  21869. }
  21870. setParent(parent) {
  21871. parent.addChild(this.ui);
  21872. }
  21873. setPos(x, y) {
  21874. this.ui.x = x;
  21875. this.ui.y = y;
  21876. }
  21877. setUrl(index) {
  21878. this.ui.myImg.url = xGame.common.getGameIconUrl("q" + index);
  21879. }
  21880. }
  21881. class UILevelProp$1 extends UIBase {
  21882. constructor() {
  21883. super();
  21884. this.firstPos = 385;
  21885. this.secondPos = 467;
  21886. this.showItemArr = [];
  21887. }
  21888. onConstructor() {
  21889. this.ui = ui_UILevelProp.createInstance();
  21890. this.contentPane = this.ui;
  21891. this.isEject = false;
  21892. this.addUIClick(this.ui.closeBtn, this.hideWin);
  21893. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  21894. this.addUIClick(this.ui.myNode.startBtn, this.startGame);
  21895. this.addUIClick(this.ui.myNode.n_yd_zzq_btn3, this.startGame);
  21896. }
  21897. show(level) {
  21898. console.log('zh:show.');
  21899. super.show();
  21900. this.ui.t1.play();
  21901. this.level = level;
  21902. this.data = cfgTable.placeballData[this.level];
  21903. this.updateSelf();
  21904. this.showPreView();
  21905. this.moneyNode.ui.c1.selectedIndex = 2;
  21906. this.moneyNode.checkPowerTime();
  21907. this.moneyNode.powerChange();
  21908. this.yinDaoForLianxi();
  21909. this.setGlobalFont(this.ui);
  21910. }
  21911. yinDaoForLianxi() {
  21912. let lianXiGuide = DataMgr.getLianXiGuide();
  21913. console.log('zh:lianXiGuide=', lianXiGuide);
  21914. if (lianXiGuide === 0) {
  21915. this.ui.myNode.n_yd_3.visible = true;
  21916. console.log('zh:yinDaoForLianxi 333 set ok');
  21917. }
  21918. else {
  21919. this.ui.myNode.n_yd_3.visible = false;
  21920. console.log('zh:无需引导33');
  21921. }
  21922. }
  21923. showPreView() {
  21924. let item;
  21925. let data;
  21926. for (let index = 0; index < this.showItemArr.length; index++) {
  21927. item = this.showItemArr[index];
  21928. item.destroySelf();
  21929. }
  21930. this.showItemArr = [];
  21931. let cfgData = xGame.cfgMgr.getPlaceBallByLevel(this.level);
  21932. for (const key in cfgData) {
  21933. data = cfgData[key];
  21934. item = new ShowItem$1();
  21935. item.setParent(this.ui.myNode.displayRoot);
  21936. item.setPos(data.x, data.y);
  21937. item.setUrl(data.value);
  21938. this.showItemArr.push(item);
  21939. }
  21940. }
  21941. updateSelf() {
  21942. this.ui.myNode.levelTxt.text = `Level ${this.level}`;
  21943. this.ui.myNode.modeNode.c1.selectedIndex = this.data.type;
  21944. if (this.data.ball == -1) {
  21945. this.ui.myNode.conditionTxt.text = "Pocket all the balls on the table";
  21946. }
  21947. else {
  21948. this.ui.myNode.conditionTxt.text = `Successfully pocketed ${this.data.ball} balls in total`;
  21949. }
  21950. let localData = DataMgr.getPlaceBallLevel(this.level);
  21951. let getAward = localData.getAward;
  21952. let cfg = cfgTable.placeballData[this.level];
  21953. let coin = this.data.award[0];
  21954. let diamond = this.data.award[1];
  21955. if (cfg.type == PlaceBallType.challenge) {
  21956. diamond = 0;
  21957. coin = 100;
  21958. }
  21959. this.ui.myNode.coinNode.visible = coin == 0 ? false : true;
  21960. this.ui.myNode.diamondNode.visible = diamond == 0 ? false : true;
  21961. this.ui.myNode.coinNode.numTxt.text = coin + "";
  21962. if (cfg.type == PlaceBallType.challenge) {
  21963. this.ui.myNode.coinNode.numTxt.text = "";
  21964. }
  21965. this.ui.myNode.diamondNode.numTxt.text = diamond + "";
  21966. if (coin > 0 && diamond > 0) {
  21967. this.ui.myNode.diamondNode.x = 385;
  21968. this.ui.myNode.coinNode.x = 467;
  21969. }
  21970. else {
  21971. this.ui.myNode.diamondNode.x = 385;
  21972. this.ui.myNode.coinNode.x = 385;
  21973. }
  21974. if (!getAward) {
  21975. this.ui.myNode.coinNode.c1.selectedIndex = 0;
  21976. this.ui.myNode.diamondNode.c1.selectedIndex = 0;
  21977. }
  21978. else {
  21979. this.ui.myNode.diamondNode.c1.selectedIndex = 1;
  21980. this.ui.myNode.coinNode.c1.selectedIndex = 1;
  21981. }
  21982. }
  21983. startGame() {
  21984. console.log("zh:startGame");
  21985. if (DataMgr.powerEnough()) {
  21986. console.log('zh:powerEnough =' + DataMgr.powerEnough());
  21987. this.ui.myNode.startBtn.touchable = false;
  21988. this.ui.myNode.startBtn.powerEft.t0.play(Laya.Handler.create(this, () => {
  21989. console.log('zh:startGame dh ');
  21990. this.ui.myNode.startBtn.touchable = true;
  21991. DataMgr.setPower(-1);
  21992. xGame.eventMgr.event(POWER_TIME);
  21993. xGame.common.gameMode = GameMode.placeBall;
  21994. xGame.common.placeBallCurLevel = this.level;
  21995. xGame.uiMgr.Show(UIGame$1);
  21996. xGame.uiMgr.Hide(UILevelDisplay$1);
  21997. xGame.uiMgr.Hide(UIMain$1);
  21998. this.logEventForChallenge_level_start(this.level);
  21999. this.hideWin();
  22000. }));
  22001. console.log('zh:eeeee');
  22002. }
  22003. else {
  22004. let guide = DataMgr.getLianXiGuide();
  22005. if (guide == 0 && xGame.common.gameMode == GameMode.placeBall) {
  22006. console.log('zh:自动添加2点体力,以便于完成练习引导模式');
  22007. DataMgr.setPower(2);
  22008. }
  22009. console.log('zh:guide = ' + guide);
  22010. console.log('zh:xGame.common.gameMode = ' + xGame.common.gameMode);
  22011. console.log('zh:powerEnough不足=' + DataMgr.powerEnough());
  22012. xGame.uiMgr.Show(UIPower$1);
  22013. }
  22014. }
  22015. logEventForChallenge_level_start(level) {
  22016. let keyStr = 'sjmd_challenge_level_start';
  22017. let jsonStr = {
  22018. "count": 1,
  22019. "gold_balance ": DataMgr.getCoin(),
  22020. "level": level,
  22021. "diamond_balance ": DataMgr.getDiamond()
  22022. };
  22023. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22024. const d = LocalStorageManager.getItem(keyStr);
  22025. if (level > d.level) {
  22026. jsonStr.count = d.count + 1;
  22027. LocalStorageManager.setItem(keyStr, jsonStr);
  22028. }
  22029. else {
  22030. }
  22031. }
  22032. else {
  22033. LocalStorageManager.setItem(keyStr, jsonStr);
  22034. }
  22035. const reqStr = JSON.stringify(jsonStr);
  22036. JSBridgeUtils.instance.logEventForAdHaveParams('challenge_level_start', reqStr);
  22037. }
  22038. hideWin() {
  22039. super.hide();
  22040. if (this.ui.myNode.startBtn) {
  22041. this.ui.myNode.startBtn.touchable = true;
  22042. if (this.ui.myNode.startBtn.powerEft.t0) {
  22043. this.ui.myNode.startBtn.powerEft.t0.stop();
  22044. }
  22045. }
  22046. }
  22047. }
  22048. UILevelProp$1.uiName = "UILevelProp";
  22049. class PutBallLevelDisplay$1 {
  22050. constructor(ui, index) {
  22051. this.index = 0;
  22052. this.ui = ui;
  22053. this.index = index;
  22054. this.ui.onClick(this, this.clickSelf);
  22055. this.updateSelf();
  22056. this.ui.levelTxt.text = (this.index + 1) + "";
  22057. this.ui.challenge.levelTxt.text = (this.index + 1) + "";
  22058. this.ui.special.levelTxt.text = (this.index + 1) + "";
  22059. }
  22060. updateSelf() {
  22061. let level = this.index + 1;
  22062. this.data = DataMgr.getPlaceBallLevel(level);
  22063. this.ui.starNode.c1.selectedIndex = this.data.star;
  22064. let isChallenge = cfgTable.placeballData[level].type;
  22065. if (this.data.isCur) {
  22066. if (isChallenge) {
  22067. this.ui.c1.selectedIndex = 5;
  22068. }
  22069. else {
  22070. this.ui.c1.selectedIndex = 2;
  22071. }
  22072. }
  22073. else {
  22074. if (this.data.play) {
  22075. if (this.data.star == 3) {
  22076. this.ui.c1.selectedIndex = 0;
  22077. }
  22078. else {
  22079. this.ui.c1.selectedIndex = 1;
  22080. }
  22081. }
  22082. else {
  22083. if (isChallenge) {
  22084. this.ui.c1.selectedIndex = 4;
  22085. }
  22086. else {
  22087. this.ui.c1.selectedIndex = 3;
  22088. }
  22089. }
  22090. }
  22091. }
  22092. clickSelf() {
  22093. console.log("zh:lev clickSelf");
  22094. if (!this.data.play)
  22095. return;
  22096. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22097. xGame.uiMgr.Show(UILevelProp$1, this.index + 1);
  22098. }
  22099. }
  22100. class UILevelDisplay$1 extends UIBase {
  22101. constructor() {
  22102. super();
  22103. }
  22104. onConstructor() {
  22105. this.ui = ui_UILevelDisplay.createInstance();
  22106. this.contentPane = this.ui;
  22107. this.isEject = false;
  22108. this.myList = this.ui.myNode.myList;
  22109. this.addUIClick(this.ui.closeNode.closeBtn, this.hide);
  22110. this.addUIClick(this.ui.myNode.yd_zzq_btn, this.showLevelTipWindows);
  22111. this.levelItemArr = [];
  22112. let levelNum = xGame.cfgMgr.getMaxPlaceBall();
  22113. this.myList.itemRenderer = Laya.Handler.create(this, this.levelItemRender, null, false);
  22114. this.myList.numItems = levelNum;
  22115. }
  22116. levelItemRender(index, target) {
  22117. let item = new PutBallLevelDisplay$1(target, index);
  22118. this.levelItemArr.push(item);
  22119. }
  22120. show() {
  22121. super.show();
  22122. this.updateLevel();
  22123. this.scrollToPlace();
  22124. this.yinDaoForLianxi();
  22125. this.setGlobalFont(this.ui);
  22126. }
  22127. yinDaoForLianxi() {
  22128. let lianXiGuide = DataMgr.getLianXiGuide();
  22129. console.log('zh:lianXiGuide=', lianXiGuide);
  22130. if (lianXiGuide === 0) {
  22131. this.ui.myNode.n_yd.visible = true;
  22132. console.log('zh:yinDaoForLianxi 222 set ok');
  22133. }
  22134. else {
  22135. this.ui.myNode.n_yd.visible = false;
  22136. console.log('zh:无需引导');
  22137. }
  22138. }
  22139. showLevelTipWindows() {
  22140. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22141. xGame.uiMgr.Show(UILevelProp$1, 1);
  22142. }
  22143. updateLevel() {
  22144. let temp;
  22145. for (let index = 0; index < this.levelItemArr.length; index++) {
  22146. temp = this.levelItemArr[index];
  22147. temp.updateSelf();
  22148. }
  22149. }
  22150. scrollToPlace() {
  22151. let maxNum = xGame.cfgMgr.getMaxPlaceBall();
  22152. let passArr = DataMgr.getPlaceBallLevelList();
  22153. let offest = passArr.length;
  22154. if (offest >= maxNum - 1)
  22155. offest = maxNum - 1;
  22156. this.myList.scrollToView(offest, true, true);
  22157. }
  22158. hide() {
  22159. super.hide();
  22160. }
  22161. }
  22162. UILevelDisplay$1.uiName = "UILevelDisplay";
  22163. class UIMatching$1 extends UIBase {
  22164. constructor() {
  22165. super();
  22166. }
  22167. onConstructor() {
  22168. this.ui = ui_UIMatching.createInstance();
  22169. this.contentPane = this.ui;
  22170. this.isEject = false;
  22171. }
  22172. show(callback) {
  22173. super.show();
  22174. PlatMgr.showBanner(true);
  22175. this.callback = callback;
  22176. let user = Moyu.getUserInfo();
  22177. if (!this.selfPot) {
  22178. this.selfPot = new Laya.Point(this.ui.selfHead.x, this.ui.selfHead.y);
  22179. }
  22180. if (!this.aiPot) {
  22181. this.aiPot = new Laya.Point(this.ui.aiHead.x, this.ui.aiHead.y);
  22182. }
  22183. this.ui.awardTxt.text = xGame.common.passAwardCoin + "";
  22184. this.ui.selfHead.nameTxt.text = user.nickName;
  22185. xGame.common.createHead(this.ui.selfHead.headImg, user.headIcon);
  22186. this.ui.aiHead.nameTxt.text = "???";
  22187. this.ui.aiHead.headImg.url = xGame.common.getGameIconUrl("cstx");
  22188. this.ui.selfHead.c1.selectedIndex = 0;
  22189. this.ui.aiHead.c1.selectedIndex = 0;
  22190. this.ui.selfHead.x = this.selfPot.x;
  22191. this.ui.selfHead.y = this.selfPot.y;
  22192. this.ui.aiHead.x = this.aiPot.x;
  22193. this.ui.aiHead.y = this.aiPot.y;
  22194. switch (xGame.common.gameMode) {
  22195. case GameMode.classic:
  22196. break;
  22197. case GameMode.bigMove:
  22198. this.initSkillData();
  22199. break;
  22200. default:
  22201. break;
  22202. }
  22203. this.ui.t1.play(Laya.Handler.create(this, () => {
  22204. this.ui.t2.play(Laya.Handler.create(this, () => {
  22205. switch (xGame.common.gameMode) {
  22206. case GameMode.classic:
  22207. this.waitingPeople();
  22208. break;
  22209. case GameMode.bigMove:
  22210. this.skillSelectFinish(xGame.common.curPlayerSkillType);
  22211. break;
  22212. default:
  22213. break;
  22214. }
  22215. }));
  22216. }));
  22217. this.setGlobalFont(this.ui);
  22218. }
  22219. initSkillData() {
  22220. this.skillSelectData = [];
  22221. let skillUrl = xGame.common.skillIconList;
  22222. let skillName = xGame.common.skillNameList;
  22223. let skillLevel = DataMgr.getBigSkillList();
  22224. let skillType = [SkillType.highSpace, SkillType.breakArmy, SkillType.ice, SkillType.GuanYu];
  22225. for (let index = 0; index < 5; index++) {
  22226. let obj = {};
  22227. obj.skillImg = skillUrl[index];
  22228. obj.skillName = skillName[index];
  22229. obj.skillType = skillType[index];
  22230. obj.skillLevel = skillLevel[index];
  22231. this.skillSelectData.push(obj);
  22232. }
  22233. }
  22234. getAISkillLevel(myLevel) {
  22235. let video = xGame.common.upSkillLevel;
  22236. let aiLevel;
  22237. let temp;
  22238. if (video) {
  22239. temp = xGame.common.randomNum(-2, -1);
  22240. }
  22241. else {
  22242. if (myLevel <= 5) {
  22243. temp = xGame.common.randomNum(1, 3);
  22244. }
  22245. else if (myLevel <= 9) {
  22246. temp = xGame.common.randomNum(-2, 1);
  22247. }
  22248. else {
  22249. temp = xGame.common.randomNum(-4, 0);
  22250. }
  22251. }
  22252. aiLevel = temp + myLevel;
  22253. if (aiLevel <= 1)
  22254. aiLevel = 1;
  22255. if (aiLevel >= 10)
  22256. aiLevel = 10;
  22257. return aiLevel;
  22258. }
  22259. getAISkillType() {
  22260. return xGame.common.randomNum(1, 4);
  22261. let successTimes = DataMgr.getSkillSuccessTimes();
  22262. let info = cfgTable.aiskillData[successTimes];
  22263. if (!info) {
  22264. let max = Object.keys(cfgTable.aiskillData).length - 1;
  22265. info = cfgTable.aiskillData[max];
  22266. }
  22267. let dataArr = info.skillselect;
  22268. let myCfg = {};
  22269. for (let index = 0; index < dataArr.length; index++) {
  22270. let temp = dataArr[index].split('-');
  22271. myCfg[temp[0]] = {};
  22272. myCfg[temp[0]].id = parseInt(temp[0]);
  22273. myCfg[temp[0]].weight = parseInt(temp[1]);
  22274. }
  22275. let aiCfg = xGame.common.initWeight(myCfg);
  22276. let curData = xGame.common.getRandomWeightData(aiCfg);
  22277. return parseInt(curData.id);
  22278. }
  22279. getAISkillData(index) {
  22280. let myLevel = this.skillSelectData[index].skillLevel;
  22281. let aiLevel = this.getAISkillLevel(myLevel);
  22282. let aiType = this.getAISkillType() - 1;
  22283. return { aiLevel, aiType } = { aiLevel, aiType };
  22284. }
  22285. skillSelectFinish(index) {
  22286. let aiInfo = this.getAISkillData(index);
  22287. xGame.common.gameMgr.selfCurSkill = index;
  22288. xGame.common.gameMgr.aiCurSkill = aiInfo.aiType;
  22289. xGame.common.gameMgr.aiSkillLevelNum = aiInfo.aiLevel;
  22290. this.ui.selfHead.c1.selectedIndex = 1;
  22291. this.ui.aiHead.c1.selectedIndex = 1;
  22292. let myData = this.skillSelectData[index];
  22293. this.ui.selfHead.skillImg.url = xGame.common.getGameIconUrl(myData.skillImg);
  22294. let guide = DataMgr.getSkillGuide();
  22295. if (guide == 0) {
  22296. this.ui.selfHead.skillTxt.text = myData.skillName + " Max Level";
  22297. }
  22298. else {
  22299. this.ui.selfHead.skillTxt.text = myData.skillName + "Lv." + myData.skillLevel;
  22300. }
  22301. let aiData = this.skillSelectData[aiInfo.aiType];
  22302. this.ui.aiHead.skillImg.url = xGame.common.getGameIconUrl(aiData.skillImg);
  22303. this.ui.aiHead.skillTxt.text = aiData.skillName + "Lv." + aiInfo.aiLevel;
  22304. this.waitingPeople();
  22305. }
  22306. waitingPeople() {
  22307. let time = xGame.common.randomNum(1000, 3000);
  22308. time += 1000;
  22309. Laya.timer.once(time, this, () => {
  22310. this.matchingSuccess();
  22311. });
  22312. }
  22313. matchingSuccess() {
  22314. let gameUI = xGame.common.gameUI;
  22315. let name = gameUI.ui.topNode.aiNameTxt.text;
  22316. let url = gameUI.ui.topNode.aiHeadLoader.url;
  22317. this.ui.aiHead.nameTxt.text = name;
  22318. this.ui.aiHead.headImg.url = url;
  22319. name = gameUI.ui.topNode.selfNameTxt.text;
  22320. url = gameUI.ui.topNode.selfHeadLoader.url;
  22321. this.ui.selfHead.nameTxt.text = name;
  22322. this.ui.selfHead.headImg.url = url;
  22323. this.ui.t3.play(Laya.Handler.create(this, () => {
  22324. this.callback && this.callback();
  22325. this.ui.t4.play(Laya.Handler.create(this, () => {
  22326. this.destroySelf();
  22327. }));
  22328. }));
  22329. }
  22330. destroySelf() {
  22331. this.callback = null;
  22332. this.skillSelectData = null;
  22333. this.selfPot = null;
  22334. this.aiPot = null;
  22335. if (!this.ui.isDisposed) {
  22336. this.ui.removeFromParent();
  22337. this.ui.dispose();
  22338. }
  22339. xGame.uiMgr.destroyUI(this);
  22340. }
  22341. }
  22342. UIMatching$1.uiName = "UIMatching";
  22343. class SkillDisplay$1 {
  22344. constructor(ui, data, uiIndex) {
  22345. this.starX = 0;
  22346. this.starY = 0;
  22347. this.index = 0;
  22348. this.ui = ui;
  22349. this.data = data;
  22350. this.index = uiIndex;
  22351. this.initSelf();
  22352. console.log('zh:SkillDisplay constructor this.skillData=', data);
  22353. }
  22354. initSelf() {
  22355. this.ui.normalBtn.onClick(this, this.clickAddLevel);
  22356. this.ui.nameTxt.text = this.data.name;
  22357. this.ui.describeTxt.text = this.data.describe;
  22358. this.ui.skillImg.url = xGame.common.getGameIconUrl(this.data.icon);
  22359. this.ui.startBtn.onClick(this, this.startGame);
  22360. this.updateSelf();
  22361. }
  22362. updateSelf() {
  22363. this.checkTry();
  22364. let level = DataMgr.getBigSkillByIndex(this.index);
  22365. this.ui.c1.selectedIndex = level >= xGame.common.maxSkillLevel ? 1 : 0;
  22366. }
  22367. checkTry() {
  22368. let index = this.index;
  22369. let level = DataMgr.getBigSkillByIndex(index);
  22370. if (level == null) {
  22371. DataMgr.setBigSkill(index, 1, false);
  22372. level = 1;
  22373. }
  22374. this.ui.levelTxt.text = "LV." + level;
  22375. if (this.index == DataMgr.gameData.trySkill && Laya.timer.currTimer < DataMgr.gameData.tryTime)
  22376. this.ui.tryNode.visible = true;
  22377. else
  22378. this.ui.tryNode.visible = false;
  22379. }
  22380. clickAddLevel() {
  22381. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22382. Moyu.sendDataEvent("UpSkill", { id: this.data.index });
  22383. console.log('zh:qjff_AD_for_skilldisplay_clickAddLevel');
  22384. if (Laya.Browser.onAndroid) {
  22385. if (JSBridgeUtils.instance.showInternAd('qjff_AD_for_skilldisplay_clickAddLevel')) {
  22386. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22387. }
  22388. else {
  22389. console.log('zh:AD 失败,直接发放奖励');
  22390. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22391. }
  22392. }
  22393. else {
  22394. this.qjff_AD_for_skilldisplay_clickAddLevel();
  22395. }
  22396. }
  22397. qjff_AD_for_skilldisplay_clickAddLevel() {
  22398. DataMgr.setBigSkill(this.data.index, 1);
  22399. this.updateSelf();
  22400. xGame.common.upSkillLevel = true;
  22401. }
  22402. startGame() {
  22403. console.log('zh:rod skill startgame');
  22404. if (this.data.index == 3) {
  22405. alert('Coming soon!');
  22406. return;
  22407. }
  22408. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22409. let needCoin = xGame.common.bigMoveNeedCoin;
  22410. xGame.common.passAwardCoin = 2000;
  22411. let guide = DataMgr.getSkillGuide();
  22412. console.log('zh:startGame guide=' + guide);
  22413. xGame.common.temSelfLevel = 0;
  22414. if (guide == 0) {
  22415. needCoin = 0;
  22416. xGame.common.temSelfLevel = 100;
  22417. }
  22418. if (DataMgr.coinEnough(needCoin)) {
  22419. DataMgr.setCoin(-needCoin);
  22420. xGame.common.curPlayerSkillType = this.index;
  22421. if (guide == 0)
  22422. xGame.common.curPlayerSkillType = 0;
  22423. console.log('zh: skilldisplay 1');
  22424. xGame.uiMgr.Show(UIGame$1);
  22425. xGame.uiMgr.Hide(UIMain$1);
  22426. xGame.uiMgr.Show(UIMatching$1, () => {
  22427. xGame.common.gameUI.ui.alpha = 1;
  22428. xGame.common.gameUI.startGame();
  22429. xGame.uiMgr.Hide(UISkill$1);
  22430. });
  22431. this.logEventForRod_start();
  22432. }
  22433. else {
  22434. console.log('zh: skilldisplay 2');
  22435. xGame.uiMgr.Show(UIAddProp$1, 0);
  22436. Moyu.sendDataEvent("AddCoinVideo");
  22437. }
  22438. }
  22439. logEventForRod_start() {
  22440. let gfmsIdx = xGame.common.curPlayerSkillType;
  22441. console.log('zh:选择的技能=' + gfmsIdx);
  22442. let gfmc = 'Skyfall Shot';
  22443. if (gfmsIdx == 0) {
  22444. gfmc = 'Skyfall Shot';
  22445. }
  22446. if (gfmsIdx == 1) {
  22447. gfmc = 'Surging break';
  22448. }
  22449. if (gfmsIdx == 2) {
  22450. gfmc = 'Frost Lock';
  22451. }
  22452. let keyStr = 'sjmd_rod_start_' + gfmsIdx;
  22453. let jsonStr = {
  22454. "count": 0,
  22455. "name": gfmc
  22456. };
  22457. if (LocalStorageManager.hasJosnKey(keyStr)) {
  22458. const d = LocalStorageManager.getItem(keyStr);
  22459. jsonStr.count = d.count + 1;
  22460. LocalStorageManager.setItem(keyStr, jsonStr);
  22461. }
  22462. else {
  22463. LocalStorageManager.setItem(keyStr, jsonStr);
  22464. }
  22465. const reqStr = JSON.stringify(jsonStr);
  22466. JSBridgeUtils.instance.logEventForAdHaveParams('rod_start', reqStr);
  22467. }
  22468. }
  22469. class UISkill$1 extends UIBase {
  22470. constructor() {
  22471. super();
  22472. this.skillData = [];
  22473. }
  22474. onConstructor() {
  22475. this.ui = ui_UISkill.createInstance();
  22476. this.contentPane = this.ui;
  22477. this.isEject = false;
  22478. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22479. this.initSkillData();
  22480. console.log('zh:aaaaaa1111111111');
  22481. this.addUIClick(this.ui.closeNode.closeBtn, this.returnUIMain);
  22482. this.ui.skillNode.skillList.itemRenderer = Laya.Handler.create(this, this.updateSkillItem, null, false);
  22483. console.log('zh:aaaaaa22222222');
  22484. this.displayList = [];
  22485. this.ui.skillNode.skillList.numItems = 3;
  22486. this.addUIClick(this.ui, this.interuptSecretary);
  22487. this.addUIClick(this.ui.guideNode.guideBtn, this.enterGuideLevel);
  22488. this.ui.talkNode.visible = false;
  22489. if (Moyu.isKs)
  22490. this.ui.closeNode.closeBtn.x += 100;
  22491. }
  22492. show() {
  22493. super.show();
  22494. this.playSecretaryIdle();
  22495. this.moneyNode.ui.c1.selectedIndex = 1;
  22496. Laya.timer.clearAll(this);
  22497. xGame.soundMgr.playSound("s_start");
  22498. xGame.common.showGirlTalkPop(13, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22499. let guide = DataMgr.getSkillGuide();
  22500. this.ui.guideNode.visible = guide == 0;
  22501. let item = this.getSkillItemByUIIndex(0);
  22502. if (guide == 0) {
  22503. item.ui.c1.selectedIndex = 1;
  22504. }
  22505. else {
  22506. item.ui.c1.selectedIndex = 0;
  22507. }
  22508. this.ui.guideNode.guideBtn.visible = guide == 0;
  22509. for (let index = 0; index < this.displayList.length; index++) {
  22510. this.displayList[index].checkTry();
  22511. }
  22512. this.setGlobalFont(this.ui);
  22513. }
  22514. getSkillItemByUIIndex(cur) {
  22515. for (let index = 0; index < this.displayList.length; index++) {
  22516. if (this.displayList[index].index == cur) {
  22517. return this.displayList[index];
  22518. }
  22519. }
  22520. }
  22521. enterGuideLevel() {
  22522. let item = this.getSkillItemByUIIndex(0);
  22523. item.startGame();
  22524. if (DataMgr.getNewUser())
  22525. Moyu.sendDataEvent("gameStart1");
  22526. }
  22527. initSkillData() {
  22528. this.skillData = [];
  22529. let nameList = xGame.common.skillNameList;
  22530. let iconList = xGame.common.skillIconList;
  22531. let describeList = [
  22532. "A strike from the sky, like a meteor tearing through the heavens—delivering a thunderous blow! ",
  22533. "A break shot surging like a raging tide—powerful, explosive, and straight into the pocket!",
  22534. "The power of frost descends—freezing the flow and taking full control of the game!"
  22535. ];
  22536. console.log('zh:initSkillData 111111111');
  22537. let data;
  22538. for (let index = 0; index < nameList.length; index++) {
  22539. data = {};
  22540. data.name = nameList[index];
  22541. data.icon = iconList[index];
  22542. data.describe = describeList[index];
  22543. data.index = index;
  22544. this.skillData.push(data);
  22545. }
  22546. }
  22547. updateSkillItem(index, target) {
  22548. if (this.displayList[index] == null) {
  22549. let uiIndex;
  22550. switch (index) {
  22551. case 0:
  22552. uiIndex = 1;
  22553. break;
  22554. case 1:
  22555. uiIndex = 0;
  22556. break;
  22557. case 2:
  22558. uiIndex = 2;
  22559. break;
  22560. case 3:
  22561. uiIndex = 3;
  22562. break;
  22563. default:
  22564. break;
  22565. }
  22566. let temp = new SkillDisplay$1(target, this.skillData[uiIndex], uiIndex);
  22567. this.displayList.push(temp);
  22568. }
  22569. }
  22570. playSecretaryIdle() {
  22571. let parent = this.ui.secretary.displayObject;
  22572. parent.destroyChildren();
  22573. let xx = this.ui.secretary.width / 2;
  22574. let yy = this.ui.secretary.height;
  22575. let scale = xGame.common.getSecretaryScale();
  22576. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  22577. xGame.common.secretary.play(data, 0, true, parent);
  22578. }
  22579. returnUIMain() {
  22580. this.hide();
  22581. xGame.common.stopGirlPop(this.ui.talkNode);
  22582. xGame.uiMgr.Show(UIMain$1);
  22583. }
  22584. interuptSecretary() {
  22585. Laya.timer.clearAll(this);
  22586. this.playSecretaryRandomSound();
  22587. }
  22588. playSecretaryRandomSound() {
  22589. if (this.isHide)
  22590. return;
  22591. let time = xGame.common.randomNum(45000, 60000);
  22592. Laya.timer.once(time, this, () => {
  22593. if (this.isHide)
  22594. return;
  22595. let index = xGame.common.randomNum(4, 7);
  22596. xGame.soundMgr.playSound("s_main0" + index);
  22597. let words = 1;
  22598. switch (index) {
  22599. case 4:
  22600. words = 5;
  22601. break;
  22602. case 5:
  22603. words = 3;
  22604. break;
  22605. case 6:
  22606. words = 6;
  22607. break;
  22608. case 7:
  22609. words = 7;
  22610. break;
  22611. default:
  22612. break;
  22613. }
  22614. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  22615. this.playSecretaryRandomSound();
  22616. });
  22617. }
  22618. }
  22619. UISkill$1.uiName = "UISkill";
  22620. class UIAddProp$1 extends UIBase {
  22621. constructor() {
  22622. super();
  22623. this.curType = "";
  22624. }
  22625. onConstructor() {
  22626. this.ui = ui_UIAddProp.createInstance();
  22627. this.contentPane = this.ui;
  22628. this.isEject = false;
  22629. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  22630. this.addUIClick(this.ui.myNode.coinBtn, this.switchBtn, ["coin"]);
  22631. this.addUIClick(this.ui.myNode.diamondBtn, this.switchBtn, ["diamond"]);
  22632. this.updateUI();
  22633. this.addUIClick(this.ui.myNode.node1, this.shareGetDiamond);
  22634. this.addUIClick(this.ui.myNode.node2, this.videoGetDiamond);
  22635. this.addUIClick(this.ui.myNode.node6, this.openPutBallView);
  22636. this.addUIClick(this.ui.myNode.node3, this.videoGetCoin);
  22637. this.addUIClick(this.ui.myNode.node4, this.convertCoin, [4]);
  22638. this.addUIClick(this.ui.myNode.node5, this.convertCoin, [5]);
  22639. }
  22640. show(type) {
  22641. super.show();
  22642. this.curType = type == 0 ? "coin" : "diamond";
  22643. this.switchBtn("");
  22644. this.ui.t0.play();
  22645. this.ui.myNode.node1.c1.selectedIndex = Moyu.isTT ? 0 : 1;
  22646. PlatMgr.showInsert(true);
  22647. this.setGlobalFont(this.ui);
  22648. }
  22649. closeSelf() {
  22650. this.hide();
  22651. }
  22652. updateUI() {
  22653. let data = cfgTable.moneyData;
  22654. let temp;
  22655. let obj;
  22656. for (const key in data) {
  22657. temp = data[key];
  22658. obj = this.ui.myNode["node" + key];
  22659. if (parseInt(key) <= 2) {
  22660. obj.diamondTxt.text = "+" + temp.num;
  22661. }
  22662. else {
  22663. obj.coinTxt.text = temp.num;
  22664. obj.diamondTxt.text = temp.get.split('_')[1];
  22665. }
  22666. }
  22667. this.updateDiamondShare();
  22668. }
  22669. updateDiamondShare() {
  22670. let data = DataMgr.getShareDiamondTimes();
  22671. if (data >= xGame.common.maxShareDiamondTimes) {
  22672. this.ui.myNode.node1.shareTxt.text = "Available Tomorrow";
  22673. this.ui.myNode.node1.touchable = false;
  22674. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22675. }
  22676. else {
  22677. this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`;
  22678. this.ui.myNode.node1.touchable = true;
  22679. }
  22680. }
  22681. switchBtn(type) {
  22682. if (type == "")
  22683. type = this.curType;
  22684. else {
  22685. if (this.curType == type) {
  22686. return;
  22687. }
  22688. else {
  22689. this.curType = type;
  22690. }
  22691. }
  22692. if (type == "coin") {
  22693. this.ui.myNode.coinBtn.c1.selectedIndex = 0;
  22694. this.ui.myNode.diamondBtn.c1.selectedIndex = 1;
  22695. this.ui.myNode.coinBtn.displayObject.zOrder = 10;
  22696. this.ui.myNode.diamondBtn.displayObject.zOrder = 9;
  22697. this.ui.myNode.c1.selectedIndex = 0;
  22698. }
  22699. else {
  22700. this.ui.myNode.coinBtn.c1.selectedIndex = 1;
  22701. this.ui.myNode.diamondBtn.c1.selectedIndex = 0;
  22702. this.ui.myNode.coinBtn.displayObject.zOrder = 9;
  22703. this.ui.myNode.diamondBtn.displayObject.zOrder = 10;
  22704. this.ui.myNode.c1.selectedIndex = 1;
  22705. }
  22706. }
  22707. convertCoin(index) {
  22708. let data = cfgTable.moneyData[index];
  22709. let coinNum = data.num;
  22710. let str = data.get.split('_')[1];
  22711. let needDiamond = parseInt(str);
  22712. if (DataMgr.diamondEnough(needDiamond)) {
  22713. DataMgr.setDiamond(-needDiamond);
  22714. xGame.common.playObjFlyAnim(coinNum, Prop.coin);
  22715. xGame.uiMgr.Show(UIMsg$1, "Exchange successful!");
  22716. }
  22717. else {
  22718. xGame.uiMgr.Show(UIMsg$1, "Diamond shortage");
  22719. this.switchBtn("diamond");
  22720. }
  22721. }
  22722. videoGetDiamond() {
  22723. console.log('zh:qjff_AD_for_uiAddProp_videoGetDiamond');
  22724. if (Laya.Browser.onAndroid) {
  22725. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22726. if (!boo) {
  22727. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22728. return;
  22729. }
  22730. }
  22731. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetDiamond')) {
  22732. }
  22733. else {
  22734. console.log('zh:AD 失败,直接发放奖励');
  22735. this.qjff_AD_for_uiAddProp_videoGetDiamond();
  22736. }
  22737. }
  22738. qjff_AD_for_uiAddProp_videoGetDiamond() {
  22739. let num = cfgTable.moneyData[2].num;
  22740. xGame.common.playObjFlyAnim(num, Prop.diamond);
  22741. this.closeSelf();
  22742. }
  22743. videoGetCoin() {
  22744. console.log('zh:qjff_AD_for_uiAddProp_videoGetCoin');
  22745. if (Laya.Browser.onAndroid) {
  22746. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22747. if (!boo) {
  22748. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22749. return;
  22750. }
  22751. }
  22752. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_videoGetCoin')) {
  22753. }
  22754. else {
  22755. console.log('zh:AD 失败,直接发放奖励');
  22756. this.qjff_AD_for_uiAddProp_videoGetCoin();
  22757. }
  22758. }
  22759. qjff_AD_for_uiAddProp_videoGetCoin() {
  22760. xGame.common.playObjFlyAnim(2000, Prop.coin);
  22761. this.closeSelf();
  22762. }
  22763. shareGetDiamond() {
  22764. let times = DataMgr.getShareDiamondTimes();
  22765. if (times >= xGame.common.maxShareDiamondTimes) {
  22766. console.log('zh: 233333333333 maxShareDiamondTimes');
  22767. xGame.uiMgr.Show(UIMsg$1, "Come back tomorrow");
  22768. }
  22769. else {
  22770. console.log('zh:33333333333333ad');
  22771. console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond');
  22772. if (Laya.Browser.onAndroid) {
  22773. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  22774. if (!boo) {
  22775. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  22776. return;
  22777. }
  22778. }
  22779. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
  22780. }
  22781. else {
  22782. console.log('zh:AD 失败,直接发放奖励');
  22783. this.qjff_AD_for_uiAddProp_shareGetDiamond();
  22784. }
  22785. }
  22786. }
  22787. qjff_AD_for_uiAddProp_shareGetDiamond() {
  22788. let diamond = xGame.common.randomNum(50, 100);
  22789. xGame.common.playObjFlyAnim(diamond, Prop.diamond);
  22790. DataMgr.setShareDiamondTimes(1);
  22791. this.updateDiamondShare();
  22792. }
  22793. openPutBallView() {
  22794. let end = xGame.uiMgr.getUI(UIGameEnd$1);
  22795. let skill = xGame.uiMgr.getUI(UISkill$1);
  22796. let level = xGame.uiMgr.getUI(UILevelDisplay$1);
  22797. let uigame = xGame.uiMgr.getUI(UIGame$1);
  22798. if (end && !end.isHide) {
  22799. xGame.uiMgr.Hide(UIGameEnd$1);
  22800. xGame.uiMgr.Show(UIMain$1);
  22801. }
  22802. if (skill && !skill.isHide)
  22803. xGame.uiMgr.Hide(UISkill$1);
  22804. if (uigame && !uigame.isHide)
  22805. xGame.uiMgr.Hide(UIGame$1);
  22806. if (level && !level.isHide) {
  22807. }
  22808. else {
  22809. xGame.uiMgr.Show(UILevelDisplay$1);
  22810. }
  22811. this.closeSelf();
  22812. }
  22813. }
  22814. UIAddProp$1.uiName = "UIAddProp";
  22815. class MoneyNode$1 {
  22816. constructor(ui) {
  22817. this.leftTime = 0;
  22818. this.ui = ui;
  22819. this.ui.addCoinBtn.onClick(this, this.addCoin);
  22820. this.ui.addDiamondBtn.onClick(this, this.addDiamond);
  22821. this.ui.addPowerBtn.onClick(this, this.addPower);
  22822. this.ui.c1.selectedIndex = 1;
  22823. xGame.eventMgr.on(COIN_CHANGE, this, this.coinChange);
  22824. xGame.eventMgr.on(DIAMOND_CHANGE, this, this.diamondChange);
  22825. xGame.eventMgr.on(POWER_CHANGE, this, this.powerChange);
  22826. xGame.eventMgr.on(POWER_TIME, this, this.checkPowerTime);
  22827. this.coinChange();
  22828. this.diamondChange();
  22829. this.powerChange();
  22830. }
  22831. addPower() {
  22832. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22833. xGame.uiMgr.Show(UIPower$1);
  22834. }
  22835. powerChange() {
  22836. let powerNum = DataMgr.getPower();
  22837. this.ui.powerTxt.text = powerNum + "";
  22838. }
  22839. checkPowerTime() {
  22840. let cur = new Date().getTime();
  22841. let last = DataMgr.getPowerTime();
  22842. if (last == 0) {
  22843. last = cur;
  22844. DataMgr.setPowerTime(cur);
  22845. }
  22846. let power = DataMgr.getPower();
  22847. let offset = Math.floor((cur - last) / (xGame.common.powerRecoverNum * 1000));
  22848. Laya.timer.clearAll(this);
  22849. if (power >= xGame.common.natureMaxPower) {
  22850. this.ui.powerTimeTxt.text = "";
  22851. DataMgr.setPowerTime(cur);
  22852. return;
  22853. }
  22854. if (power + offset >= xGame.common.natureMaxPower) {
  22855. DataMgr.setPower(xGame.common.natureMaxPower, false);
  22856. this.ui.powerTimeTxt.text = "";
  22857. DataMgr.setPowerTime(cur);
  22858. }
  22859. else {
  22860. if (offset > 0) {
  22861. DataMgr.setPower(offset);
  22862. DataMgr.setPowerTime(cur);
  22863. }
  22864. let time = Math.floor((cur - last - offset * xGame.common.powerRecoverNum * 1000) / 1000);
  22865. this.leftTime = xGame.common.powerRecoverNum - time;
  22866. if (this.leftTime <= 0)
  22867. this.leftTime = 0;
  22868. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22869. Laya.timer.loop(1000, this, this.updatePowerTime);
  22870. }
  22871. }
  22872. updatePowerTime() {
  22873. this.leftTime -= 1;
  22874. this.ui.powerTimeTxt.text = xGame.common.getMSTime(this.leftTime);
  22875. if (this.leftTime <= 0) {
  22876. this.checkPowerTime();
  22877. }
  22878. }
  22879. coinChange() {
  22880. this.ui.coinTxt.text = DataMgr.getCoin() + "";
  22881. }
  22882. diamondChange() {
  22883. this.ui.diamondTxt.text = DataMgr.getDiamond() + "";
  22884. }
  22885. addCoin() {
  22886. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22887. Moyu.sendDataEvent("AddCoinBtn");
  22888. xGame.uiMgr.Show(UIAddProp$1, 0);
  22889. }
  22890. addDiamond() {
  22891. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22892. Moyu.sendDataEvent("AddDiamondBtn");
  22893. xGame.uiMgr.Show(UIAddProp$1, 1);
  22894. }
  22895. }
  22896. class SettingNode$1 {
  22897. constructor(ui) {
  22898. this.showSetting = false;
  22899. this.openSound = true;
  22900. this.openShake = true;
  22901. this.ui = ui;
  22902. this.ui.soundBtn.onClick(this, this.switchSound);
  22903. this.ui.shakeBtn.onClick(this, this.switchShake);
  22904. this.ui.xyBtn.onClick(this, this.onXy);
  22905. this.ui.clickNode.onClick(this, this.changeSetting);
  22906. this.ui.xyBtn.visible = Moyu.isVivo || Moyu.isOppo || Moyu.isOPApk || Moyu.isVVApk;
  22907. this.ui.xyBtn.visible = false;
  22908. this.ui.shakeBtn.visible = false;
  22909. }
  22910. changeSetting() {
  22911. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22912. this.showSetting = !this.showSetting;
  22913. this.ui.c1.selectedIndex = this.showSetting ? 1 : 0;
  22914. }
  22915. switchSound() {
  22916. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22917. this.openSound = !this.openSound;
  22918. Moyu.onSetting(this.openSound, this.openShake);
  22919. xGame.soundMgr.onSetting(this.openSound);
  22920. this.ui.soundBtn.c1.selectedIndex = this.openSound ? 0 : 1;
  22921. }
  22922. switchShake() {
  22923. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22924. this.openShake = !this.openShake;
  22925. Moyu.onSetting(this.openSound, this.openShake);
  22926. this.ui.shakeBtn.c1.selectedIndex = this.openShake ? 0 : 1;
  22927. }
  22928. onXy() {
  22929. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  22930. MoyuMgr$1.showXy(1);
  22931. }
  22932. }
  22933. class UIDraw$1 extends UIBase {
  22934. constructor() {
  22935. super();
  22936. this.curKey = 0;
  22937. }
  22938. onConstructor() {
  22939. this.ui = ui_UIDraw.createInstance();
  22940. this.contentPane = this.ui;
  22941. this.isEject = false;
  22942. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  22943. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  22944. this.addUIClick(this.ui.drawBtn, this.startDraw);
  22945. this.initDraw();
  22946. this.initUI();
  22947. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  22948. }
  22949. show() {
  22950. super.show();
  22951. this.ui.t0.play();
  22952. this.playSecretaryIdle();
  22953. this.updateDraw();
  22954. this.checkFree();
  22955. if (PlatMgr.bannerDelay > 0) {
  22956. this.ui.closeNode.closeBtn.visible = false;
  22957. Laya.timer.once(PlatMgr.bannerDelay, this, () => {
  22958. this.ui.closeNode.closeBtn.visible = true;
  22959. });
  22960. }
  22961. PlatMgr.showRateBanner();
  22962. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  22963. this.setGlobalFont(this.ui);
  22964. }
  22965. hide() {
  22966. Laya.timer.clearAll(this);
  22967. super.hide();
  22968. }
  22969. checkFree() {
  22970. let isFree = DataMgr.getDailyfreeDrawTimes();
  22971. this.ui.drawBtn.c1.selectedIndex = isFree > 0 ? 0 : 1;
  22972. }
  22973. initDraw() {
  22974. this.drawObj = [];
  22975. let data = cfgTable.drawData;
  22976. let temp;
  22977. let weight = 0;
  22978. for (const key in data) {
  22979. temp = data[key];
  22980. weight += temp.weight;
  22981. this.drawObj.push(weight);
  22982. }
  22983. this.allWeight = weight;
  22984. }
  22985. initUI() {
  22986. let data = cfgTable.drawData;
  22987. let temp;
  22988. let img;
  22989. let txt;
  22990. for (const key in data) {
  22991. temp = data[key];
  22992. img = this.ui.myNode.rotNode["img" + key];
  22993. txt = this.ui.myNode.rotNode["txt" + key];
  22994. img.url = xGame.common.getGameIconUrl(temp.icon);
  22995. txt.visible = true;
  22996. if (temp.award > 2) {
  22997. img.rotation = 0;
  22998. txt.text = cfgTable.ballrodData[temp.award - 1].name;
  22999. }
  23000. else {
  23001. img.rotation = temp.rotation;
  23002. txt.text = temp.num;
  23003. }
  23004. }
  23005. }
  23006. getCurkey() {
  23007. let rand = Math.random() * this.allWeight;
  23008. let temp;
  23009. for (let index = 0; index < this.drawObj.length - 1; index++) {
  23010. temp = this.drawObj[index];
  23011. if (index == 0) {
  23012. if (rand < temp) {
  23013. return index + 1;
  23014. }
  23015. }
  23016. else {
  23017. if (rand >= temp && rand < this.drawObj[index + 1]) {
  23018. return index + 1;
  23019. }
  23020. }
  23021. }
  23022. return 2;
  23023. }
  23024. startDraw() {
  23025. console.log('zh:开始抽奖');
  23026. let freeTimes = DataMgr.getDailyfreeDrawTimes();
  23027. if (freeTimes > 0) {
  23028. console.log('zh:freeTimes=' + freeTimes);
  23029. this.beginDraw();
  23030. DataMgr.setDailyfreeDrawTimes(0);
  23031. this.checkFree();
  23032. }
  23033. else {
  23034. if (Laya.Browser.onAndroid) {
  23035. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  23036. if (!boo) {
  23037. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  23038. return;
  23039. }
  23040. if (JSBridgeUtils.instance.showRewardAd('qjff_chouJiang')) {
  23041. }
  23042. else {
  23043. console.log('zh:AD 失败,直接发放奖励');
  23044. this.qjff_chouJiang();
  23045. }
  23046. }
  23047. else {
  23048. this.qjff_chouJiang();
  23049. }
  23050. }
  23051. }
  23052. qjff_chouJiang() {
  23053. this.beginDraw();
  23054. }
  23055. beginDraw() {
  23056. this.ui.myNode.flashNode.c1.selectedIndex = 0;
  23057. this.ui.drawBtn.touchable = false;
  23058. this.curKey = this.getCurkey();
  23059. console.log("zh:当前key", this.curKey);
  23060. let cell = 60;
  23061. let lap = 3;
  23062. let angle = cell * (this.curKey - 1) + lap * 360;
  23063. let target = this.ui.myNode.rotNode;
  23064. target.rotation = 0;
  23065. Laya.Tween.to(target, { rotation: angle }, 1500, Laya.Ease.cubicOut, Laya.Handler.create(this, () => {
  23066. console.log("zh:旋转完成");
  23067. this.ui.drawBtn.touchable = true;
  23068. this.getAward();
  23069. }));
  23070. }
  23071. getAward() {
  23072. let data = cfgTable.drawData[this.curKey];
  23073. let temp = new AwardType();
  23074. temp.type = data.award;
  23075. temp.num = data.num;
  23076. xGame.common.getAward([temp], () => {
  23077. DataMgr.setDrawTimes(1);
  23078. this.updateDraw();
  23079. this.ui.myNode.flashNode.c1.selectedIndex = 1;
  23080. });
  23081. }
  23082. updateDraw() {
  23083. let drawTimes = DataMgr.getDrawTimes();
  23084. let awardTimes = DataMgr.getDrawAwardTimes();
  23085. if (Math.floor(drawTimes / 3) > awardTimes) {
  23086. this.ui.extraNode.boxBtn.t0.play(null, -1);
  23087. this.ui.extraNode.boxBtn.touchable = true;
  23088. this.ui.extraNode.tipsTxt.text = "3/3";
  23089. this.ui.extraNode.barNode.width = 265;
  23090. this.getExtraAward();
  23091. }
  23092. else {
  23093. this.ui.extraNode.boxBtn.t0.stop();
  23094. this.ui.extraNode.boxBtn.touchable = false;
  23095. this.ui.extraNode.tipsTxt.text = `${drawTimes % 3}/3`;
  23096. this.ui.extraNode.barNode.width = 265 * (drawTimes % 3) / 3;
  23097. }
  23098. let data = cfgTable.drawData[1];
  23099. if (awardTimes == 0) {
  23100. this.ui.myNode.rotNode.img1.url = xGame.common.getComponentUrl("s" + data.icon);
  23101. this.ui.myNode.rotNode.txt1.text = cfgTable.ballrodData[data.award - 1].name;
  23102. this.ui.myNode.rotNode.img1.rotation = 0;
  23103. }
  23104. else {
  23105. let award = data.nextid;
  23106. this.ui.myNode.rotNode.img1.url = xGame.common.getGameIconUrl(award[2]);
  23107. this.ui.myNode.rotNode.txt1.text = award[1];
  23108. this.ui.myNode.rotNode.img1.rotation = 0;
  23109. }
  23110. }
  23111. getExtraAward() {
  23112. let drawTimes = DataMgr.getDrawTimes();
  23113. let awardTimes = DataMgr.getDrawAwardTimes();
  23114. let data = cfgTable.drawData[1];
  23115. let award = new AwardType();
  23116. if (awardTimes == 0) {
  23117. award.num = data.num;
  23118. award.type = data.award;
  23119. xGame.common.getAward([award], () => {
  23120. let all = Math.floor(drawTimes / 3);
  23121. DataMgr.setDrawAwardTimes(all);
  23122. this.updateDraw();
  23123. });
  23124. }
  23125. else {
  23126. award.num = parseInt(data.nextid[1]);
  23127. award.type = parseInt(data.nextid[0]);
  23128. xGame.common.getAward([award], () => {
  23129. let all = Math.floor(drawTimes / 3);
  23130. DataMgr.setDrawAwardTimes(all);
  23131. this.updateDraw();
  23132. });
  23133. }
  23134. }
  23135. closeSelf() {
  23136. this.hide();
  23137. }
  23138. playSecretaryIdle() {
  23139. let parent = this.ui.secretary.displayObject;
  23140. parent.destroyChildren();
  23141. let xx = this.ui.secretary.width / 2;
  23142. let yy = this.ui.secretary.height;
  23143. let scale = xGame.common.getSecretaryScale();
  23144. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23145. xGame.common.secretary.play(data, 0, true, parent);
  23146. }
  23147. }
  23148. UIDraw$1.uiName = "UIDraw";
  23149. class UIRanking$1 extends UIBase {
  23150. constructor() {
  23151. super();
  23152. this.showSelf = true;
  23153. this.rankType = 1;
  23154. this.rankList = [];
  23155. this.topX = 10;
  23156. this.myIndex = this.topX + 1;
  23157. this.myStar = 0;
  23158. }
  23159. onConstructor() {
  23160. this.ui = ui_UIRanking.createInstance();
  23161. this.contentPane = this.ui;
  23162. this.isEject = false;
  23163. this.addUIClick(this.ui.myNode.closeBtn, this.hide);
  23164. this.addUIClick(this.ui.myNode.changeBtn, this.changeSelfNode);
  23165. this.addUIClick(this.ui.myNode.starBtn, this.changeList, [1]);
  23166. this.addUIClick(this.ui.myNode.levelBtn, this.changeList, [2]);
  23167. this.ui.myNode.myList.setVirtual();
  23168. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.updateItemUI, null, false);
  23169. }
  23170. show() {
  23171. super.show();
  23172. this.getPaiHangBangDataFormJosnFile();
  23173. this.updateSelf();
  23174. let self = Moyu.getUserInfo();
  23175. if (!self.isAuth) {
  23176. Moyu.initUser(this, () => {
  23177. DataMgr.upRankData();
  23178. });
  23179. }
  23180. this.setGlobalFont(this.ui);
  23181. }
  23182. getPaiHangBangDataFormJosnFile() {
  23183. const rankingList = cfgTable.paiHangBangData.list;
  23184. this.updateItemData(rankingList);
  23185. }
  23186. updateSelfItem() {
  23187. console.log('zh:Moyu.platType =' + Moyu.platType);
  23188. let self = Moyu.getUserInfo();
  23189. this.ui.myNode.selfNode.c1.selectedIndex = this.myIndex < 4 ? this.myIndex - 1 : 3;
  23190. this.ui.myNode.selfNode.rankTxt.text = this.myIndex > this.topX ? "No Rank" : this.myIndex.toString();
  23191. if (this.myIndex > this.topX) {
  23192. this.ui.myNode.selfNode.rankTxt.fontSize = 36;
  23193. }
  23194. else {
  23195. this.ui.myNode.selfNode.rankTxt.fontSize = 30;
  23196. }
  23197. this.ui.myNode.selfNode.valueTxt.text = this.myStar + "";
  23198. this.ui.myNode.selfNode.nameTxt.text = 'myself';
  23199. xGame.common.createHead(this.ui.myNode.selfNode.headNode.head.myIcon, self.headIcon);
  23200. }
  23201. updateItemData(data) {
  23202. this.myStar = xGame.common.getAllStarNum();
  23203. if (this.rankList.length < 2) {
  23204. this.rankList = data;
  23205. let self = Moyu.getUserInfo();
  23206. console.log('zh:myself iuserinfo = ' + JSON.stringify(self));
  23207. self.headIcon = self.headIcon;
  23208. for (let i = 0; i < data.length; i++) {
  23209. let data = this.rankList[i];
  23210. if (data.userId == self.userId) {
  23211. this.rankList.splice(i, 1);
  23212. break;
  23213. }
  23214. }
  23215. for (let i = 0; i < data.length; i++) {
  23216. let data = this.rankList[i];
  23217. if (data.rankScore < this.myStar && this.myIndex > this.topX) {
  23218. this.myIndex = i + 1;
  23219. let user = { headIcon: self.headIcon, nickName: "myself" };
  23220. let ud = { user: user, data: {} };
  23221. let md = { rankScore: this.myStar.toString(), userId: self.userId, userData: JSON.stringify(ud) };
  23222. console.log('zh:Moyu.platType = ' + Moyu.platType);
  23223. if (Moyu.platType < 11) {
  23224. user.headIcon = self.headIcon;
  23225. user.nickName = self.nickName;
  23226. }
  23227. this.rankList.splice(i, 0, md);
  23228. break;
  23229. }
  23230. }
  23231. }
  23232. this.updateSelfItem();
  23233. this.ui.myNode.myList.numItems = this.rankList.length;
  23234. }
  23235. updateItemUI(index, obj) {
  23236. let data = this.rankList[index];
  23237. let userData = JSON.parse(data.userData).user;
  23238. obj.nameTxt.text = userData.nickName.toString();
  23239. obj.valueTxt.text = data.rankScore;
  23240. xGame.common.createHead(obj.headNode.head.myIcon, userData.headIcon, 80);
  23241. obj.rankTxt.text = index + 1;
  23242. switch (index) {
  23243. case 0:
  23244. this.setImg(obj, 1, 0, 0);
  23245. obj.rankTxt.color = "#FFC047";
  23246. break;
  23247. case 1:
  23248. this.setImg(obj, 0, 1, 0);
  23249. obj.rankTxt.color = "#ACACAC";
  23250. break;
  23251. case 2:
  23252. this.setImg(obj, 0, 0, 1);
  23253. obj.rankTxt.color = "#D09672";
  23254. break;
  23255. default:
  23256. this.setImg(obj, 0, 0, 0);
  23257. obj.rankTxt.color = "#496FAB";
  23258. break;
  23259. }
  23260. }
  23261. setImg(obj, a, b, c) {
  23262. obj.img1.visible = a ? true : false;
  23263. obj.img2.visible = b ? true : false;
  23264. obj.img3.visible = c ? true : false;
  23265. }
  23266. changeList(type) {
  23267. this.rankType = type;
  23268. this.updateSelf();
  23269. }
  23270. changeSelfNode() {
  23271. this.showSelf = !this.showSelf;
  23272. this.updateSelf();
  23273. }
  23274. updateSelf() {
  23275. this.ui.myNode.changeBtn.c1.selectedIndex = this.showSelf ? 0 : 1;
  23276. this.ui.myNode.c2.selectedIndex = this.showSelf ? 0 : 1;
  23277. this.ui.myNode.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23278. this.ui.myNode.levelBtn.c1.selectedIndex = this.rankType == 1 ? 1 : 0;
  23279. this.ui.myNode.starBtn.c1.selectedIndex = this.rankType == 1 ? 0 : 1;
  23280. }
  23281. }
  23282. UIRanking$1.uiName = "UIRanking";
  23283. class UISecretary$1 extends UIBase {
  23284. constructor() {
  23285. super();
  23286. this.curIndex = 1;
  23287. }
  23288. onConstructor() {
  23289. this.ui = ui_UISecretary.createInstance();
  23290. this.contentPane = this.ui;
  23291. this.isEject = false;
  23292. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  23293. this.nodeObj = { left: null, right: null, cur: null };
  23294. this.nodeObj.cur = this.ui.myNode.gameNode3;
  23295. }
  23296. show() {
  23297. super.show();
  23298. this.ui.t0.play();
  23299. this.updateData();
  23300. this.setGlobalFont(this.ui);
  23301. }
  23302. addSecretarySpine(node, spineName) {
  23303. if (spineName == "mishu") {
  23304. if (this.secretarySpine1) {
  23305. node.displayObject.destroyChildren();
  23306. this.playWoman(this.secretarySpine1, node.displayObject);
  23307. }
  23308. else {
  23309. let spine1 = new SpineMgr("mishu", () => {
  23310. this.secretarySpine1 = spine1;
  23311. this.playWoman(this.secretarySpine1, node.displayObject);
  23312. });
  23313. }
  23314. }
  23315. else {
  23316. if (this.secretarySpine2) {
  23317. node.displayObject.destroyChildren();
  23318. this.playWoman(this.secretarySpine2, node.displayObject);
  23319. }
  23320. else {
  23321. let spine2 = new SpineMgr("xiaomishu2", () => {
  23322. this.secretarySpine2 = spine2;
  23323. this.playWoman(this.secretarySpine2, node.displayObject);
  23324. });
  23325. }
  23326. }
  23327. }
  23328. playWoman(node, parent) {
  23329. let xx = this.ui.myNode.gameNode3.secretary.width / 2;
  23330. let yy = this.ui.myNode.gameNode3.secretary.height;
  23331. let scale = 1.5;
  23332. if (node == this.secretarySpine2) {
  23333. scale = 1.2;
  23334. }
  23335. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23336. node.play(data, 0, true, parent);
  23337. }
  23338. turnLeft() {
  23339. this.curIndex--;
  23340. if (this.curIndex < 1) {
  23341. this.curIndex = 2;
  23342. }
  23343. let left = this.nodeObj.left;
  23344. let right = this.nodeObj.right;
  23345. let cur = this.nodeObj.cur;
  23346. Laya.Tween.to(left, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23347. Laya.Tween.to(right, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23348. Laya.Tween.to(cur, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23349. this.updateData();
  23350. }));
  23351. this.ui.myNode.setChildIndex(right, 2);
  23352. this.nodeObj.left = cur;
  23353. this.nodeObj.right = left;
  23354. this.nodeObj.cur = right;
  23355. }
  23356. turnRight() {
  23357. this.curIndex++;
  23358. if (this.curIndex > 2) {
  23359. this.curIndex = 1;
  23360. }
  23361. let left = this.nodeObj.left;
  23362. let right = this.nodeObj.right;
  23363. let cur = this.nodeObj.cur;
  23364. Laya.Tween.to(cur, { x: 180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500);
  23365. Laya.Tween.to(left, { x: 0, scaleX: 1, scaleY: 1, alpha: 1 }, 500);
  23366. Laya.Tween.to(right, { x: -180, scaleX: 0.8, scaleY: 0.8, alpha: 0.3 }, 500, null, Laya.Handler.create(this, () => {
  23367. this.updateData();
  23368. }));
  23369. this.ui.myNode.setChildIndex(left, 2);
  23370. this.nodeObj.left = right;
  23371. this.nodeObj.right = cur;
  23372. this.nodeObj.cur = left;
  23373. }
  23374. updateData() {
  23375. console.log('zh: updateData FFFFFFFFFF');
  23376. let data = cfgTable.secretaryshopData;
  23377. let children = this.ui.myNode._children;
  23378. let temp;
  23379. let curData;
  23380. for (let index = 0; index < children.length; index++) {
  23381. temp = children[index];
  23382. curData = data[1];
  23383. temp.heightTxt.text = curData.height;
  23384. temp.foodTxt.text = curData.food;
  23385. temp.historyTxt.text = curData.history;
  23386. temp.nameImg.url = xGame.common.getGameIconUrl(curData.nameImg);
  23387. this.addSecretarySpine(temp.secretary, curData.spine);
  23388. let womanIndex = curData.id - 1;
  23389. let getWoman = DataMgr.getSecretary(womanIndex);
  23390. let curUse = DataMgr.getCurSecretary();
  23391. if (getWoman) {
  23392. if (curUse == womanIndex) {
  23393. temp.purchaseBtn.c1.selectedIndex = 1;
  23394. }
  23395. else {
  23396. temp.purchaseBtn.c1.selectedIndex = 2;
  23397. }
  23398. }
  23399. else {
  23400. temp.purchaseBtn.c1.selectedIndex = 0;
  23401. temp.purchaseBtn.diamondTxt.text = curData.price + "";
  23402. }
  23403. temp.purchaseBtn.visible = false;
  23404. }
  23405. }
  23406. clickSecretary(getWoman, curUse, womanIndex, needDiamond) {
  23407. console.log('zh: 点击了clickSecretary ');
  23408. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23409. if (getWoman) {
  23410. if (curUse != womanIndex) {
  23411. console.log();
  23412. DataMgr.setCurSecretary(womanIndex);
  23413. this.updateData();
  23414. }
  23415. }
  23416. else {
  23417. console.log('zh:点击购买了');
  23418. let need = needDiamond;
  23419. if (DataMgr.diamondEnough(need)) {
  23420. DataMgr.setDiamond(-need);
  23421. DataMgr.setSecretary(womanIndex, 1);
  23422. DataMgr.setCurSecretary(womanIndex);
  23423. this.updateData();
  23424. }
  23425. else {
  23426. xGame.uiMgr.Show(UIAddProp$1, 1);
  23427. }
  23428. }
  23429. }
  23430. closeSelf() {
  23431. this.hide();
  23432. }
  23433. }
  23434. UISecretary$1.uiName = "UISecretary";
  23435. class BallRodDisplay$1 {
  23436. constructor(ui, index) {
  23437. this.index = 0;
  23438. this.uiIndex = 0;
  23439. this.ui = ui;
  23440. this.index = index;
  23441. this.initData();
  23442. }
  23443. initData() {
  23444. this.ui.purchaseBtn.onClick(this, this.buyBallRod);
  23445. let data = cfgTable.ballrodData[this.index + 1];
  23446. this.ui.nameTxt.text = data.name;
  23447. this.ui.rodImg.url = xGame.common.getGameIconUrl(data.img);
  23448. this.ui.levelNode.c1.selectedIndex = data.quality;
  23449. this.ui.purchaseBtn.diamondTxt.text = data.price + "";
  23450. if (data.spine) {
  23451. this.mySpine = new SpineMgr(data.spine, () => {
  23452. let xx = 150;
  23453. let yy = 70;
  23454. let data = { x: xx, y: yy, scaleX: 1, scaleY: 1 };
  23455. this.mySpine.play(data, 0, true, this.ui.eftRod.displayObject);
  23456. });
  23457. }
  23458. }
  23459. updateSelf() {
  23460. let get = DataMgr.getBallRod(this.index);
  23461. if (get == null)
  23462. get = 1;
  23463. let curUse = DataMgr.getCurBallRod();
  23464. if (get) {
  23465. if (curUse == this.index) {
  23466. this.ui.purchaseBtn.c1.selectedIndex = 0;
  23467. }
  23468. else {
  23469. this.ui.purchaseBtn.c1.selectedIndex = 1;
  23470. }
  23471. }
  23472. else {
  23473. this.ui.purchaseBtn.c1.selectedIndex = 2;
  23474. }
  23475. }
  23476. buyBallRod() {
  23477. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23478. let selectedIndex = this.ui.purchaseBtn.c1.selectedIndex;
  23479. switch (selectedIndex) {
  23480. case 0:
  23481. break;
  23482. case 1:
  23483. console.log('zh:点击了 USE THIS');
  23484. DataMgr.setCurBallRod(this.index);
  23485. let curUse = DataMgr.getCurBallRod();
  23486. console.log('zh:updateSelf 选择的球杆 = ' + curUse);
  23487. let ui = xGame.uiMgr.getUI(UIShop$1);
  23488. ui.updateBallRod();
  23489. break;
  23490. case 2:
  23491. let data = cfgTable.ballrodData[this.index + 1];
  23492. let need = data.price;
  23493. if (DataMgr.diamondEnough(need)) {
  23494. this.buyQiuGan(data);
  23495. DataMgr.setDiamond(-need);
  23496. DataMgr.setBallRod(this.index, 1);
  23497. DataMgr.setCurBallRod(this.index);
  23498. let ui = xGame.uiMgr.getUI(UIShop$1);
  23499. ui.updateBallRod();
  23500. this.logEventForGouMaiGan(selectedIndex + '-' + data.name);
  23501. }
  23502. else {
  23503. xGame.uiMgr.Show(UIAddProp$1, 1);
  23504. }
  23505. break;
  23506. default:
  23507. break;
  23508. }
  23509. }
  23510. buyQiuGan(qgItem) {
  23511. console.log('zh:buyQiuGan=' + JSON.stringify(qgItem));
  23512. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23513. if (userInfo == null) {
  23514. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23515. return;
  23516. }
  23517. let reqData = xGame.httpMgr.getReqData();
  23518. let pd = JSON.parse(reqData);
  23519. pd.qiuGanData = qgItem;
  23520. reqData = JSON.stringify(pd);
  23521. xGame.httpMgr.sendPost2025('user/buyQiuGan', reqData, (res) => {
  23522. try {
  23523. console.log('zh:buySp res = ' + JSON.stringify(res));
  23524. let code = res.code;
  23525. let msg = res.msg;
  23526. if (code == 401) {
  23527. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23528. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.loginTimeOut);
  23529. return;
  23530. }
  23531. if (code == 200) {
  23532. xGame.uiMgr.Show(UIMsg$1, msg);
  23533. DataMgr.getUserZiChanInfo(false);
  23534. }
  23535. else {
  23536. xGame.uiMgr.Show(UIMsg$1, msg);
  23537. }
  23538. }
  23539. catch (error) {
  23540. console.log('error=' + error);
  23541. alert(error);
  23542. }
  23543. finally {
  23544. }
  23545. });
  23546. }
  23547. logEventForGouMaiGan(qiuGanName) {
  23548. const ev = {
  23549. value: qiuGanName
  23550. };
  23551. const jsonStr = JSON.stringify(ev);
  23552. console.log('zh:ts logEventForGouMaiGan req jsonStr=' + jsonStr);
  23553. JSBridgeUtils.instance.logEventForAdHaveParams('iap_start', jsonStr);
  23554. }
  23555. }
  23556. class DaoJuDisplay$1 {
  23557. constructor(ui, index) {
  23558. this.index = 0;
  23559. this.uiIndex = 0;
  23560. this.ggSpid = "";
  23561. this.spid = 0;
  23562. this.ui = ui;
  23563. this.index = index;
  23564. this.initData();
  23565. }
  23566. initData() {
  23567. this.ui.btn_buy.onClick(this, this.gotoBuy);
  23568. let data = cfgTable.daoJuData[this.index + 1];
  23569. this.ui.nameTxt.text = data.spbt;
  23570. this.ui.n_jiaGe.text = "$" + data.spjg + "";
  23571. this.ui.n_zuanShi.text = "X" + data.zssl + "";
  23572. this.ggSpid = data.ggSpid;
  23573. this.spid = data.spid;
  23574. let baseUrl = "asset/sound/ogg/";
  23575. this.ui.zsImg.url = xGame.common.getGameIconUrl(data.img);
  23576. }
  23577. gotoBuy() {
  23578. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23579. if (userInfo != null) {
  23580. let token = userInfo.token;
  23581. let ggSpid = this.ggSpid;
  23582. let spid = this.spid;
  23583. console.log('zh:gotoBuy1 ggSpid =' + ggSpid);
  23584. console.log('zh:gotoBuy1 spid =' + spid);
  23585. JSBridgeUtils.instance.startGgPay(token, ggSpid, spid);
  23586. return;
  23587. }
  23588. else {
  23589. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23590. }
  23591. }
  23592. gotoBuy1() {
  23593. xGame.soundMgr.playSound(xGame.common.btnClickStr);
  23594. let djItem = cfgTable.daoJuData[this.index + 1];
  23595. console.log('zh:点击购买 djItem =' + JSON.stringify(djItem));
  23596. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  23597. if (userInfo == null) {
  23598. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23599. return;
  23600. }
  23601. let reqData = xGame.httpMgr.getReqData();
  23602. let pd = JSON.parse(reqData);
  23603. pd.spItem = djItem;
  23604. reqData = JSON.stringify(pd);
  23605. xGame.httpMgr.sendPost2025('user/buyZuanShi', reqData, (res) => {
  23606. try {
  23607. console.log('zh:buySp res = ' + JSON.stringify(res));
  23608. let code = res.code;
  23609. let msg = res.msg;
  23610. if (code == 401) {
  23611. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23612. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  23613. return;
  23614. }
  23615. if (code == 200) {
  23616. xGame.uiMgr.Show(UIMsg$1, msg);
  23617. DataMgr.getUserZiChanInfo(false);
  23618. }
  23619. else {
  23620. xGame.uiMgr.Show(UIMsg$1, msg);
  23621. }
  23622. }
  23623. catch (error) {
  23624. console.log('error=' + error);
  23625. alert(error);
  23626. }
  23627. finally {
  23628. }
  23629. });
  23630. }
  23631. }
  23632. class UIShop$1 extends UIBase {
  23633. constructor() {
  23634. super();
  23635. this.itemNums = 0;
  23636. this.itemNumsForDj = 0;
  23637. this.curType = "";
  23638. }
  23639. onConstructor() {
  23640. this.ui = ui_UIShop.createInstance();
  23641. this.contentPane = this.ui;
  23642. this.isEject = false;
  23643. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23644. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23645. this.addUIClick(this.ui.myNode.n_qiuGan, () => this.switchBtn("qiugan"));
  23646. this.addUIClick(this.ui.myNode.n_daoju, () => this.switchBtn("daoju"));
  23647. this.addUIClick(this.ui, this.interuptSecretary);
  23648. this.ui.myNode.myList.itemRenderer = Laya.Handler.create(this, this.renderBallRod, null, false);
  23649. this.ballRodArr = [];
  23650. this.itemNums = Object.keys(cfgTable.ballrodData).length;
  23651. this.ui.myNode.myList.numItems = this.itemNums;
  23652. this.loadDjdata_old();
  23653. }
  23654. loadDjdata_old() {
  23655. let fff = cfgTable.daoJuData;
  23656. this.ui.myNode.djList.itemRenderer = Laya.Handler.create(this, this.renderDaoJu, null, false);
  23657. this.daoJuArr = [];
  23658. this.itemNumsForDj = Object.keys(cfgTable.daoJuData).length;
  23659. this.ui.myNode.djList.numItems = this.itemNumsForDj;
  23660. }
  23661. getProductList() {
  23662. let reqData = xGame.httpMgr.getReqData();
  23663. let pd = JSON.parse(reqData);
  23664. pd.splx = "Consumable";
  23665. reqData = JSON.stringify(pd);
  23666. xGame.httpMgr.sendPost2025('game2/getProductList', reqData, (res) => {
  23667. try {
  23668. let code = res.code;
  23669. let msg = res.msg;
  23670. if (code == 401) {
  23671. Laya.LocalStorage.removeItem(keyForLoginInfo);
  23672. xGame.uiMgr.Show(UIMsg, TIP_MSG_key.pleaseLoginIn);
  23673. return;
  23674. }
  23675. if (code == 200) {
  23676. let data = res.data;
  23677. for (let index = 0; index < data.length; index++) {
  23678. let element = data[index];
  23679. cfgTable.daoJuData[element.spid] = element;
  23680. }
  23681. console.log("fffddd=" + JSON.stringify(cfgTable.daoJuData));
  23682. }
  23683. else {
  23684. xGame.uiMgr.Show(UIMsg, msg);
  23685. }
  23686. }
  23687. catch (error) {
  23688. console.log('error=' + error);
  23689. alert(error);
  23690. }
  23691. finally {
  23692. }
  23693. });
  23694. }
  23695. show(type) {
  23696. super.show();
  23697. this.curType = type == 0 ? "qiugan" : "daoju";
  23698. this.switchBtn("");
  23699. this.playSecretaryIdle();
  23700. this.updateBallRod();
  23701. this.setGlobalFont(this.ui);
  23702. }
  23703. test123() {
  23704. console.log('zh:test123 ');
  23705. }
  23706. switchBtn(type) {
  23707. console.log('zh:1111切換 sel type=' + type);
  23708. if (type == "") {
  23709. type = this.curType;
  23710. }
  23711. else {
  23712. if (this.curType == type) {
  23713. return;
  23714. }
  23715. else {
  23716. this.curType = type;
  23717. }
  23718. }
  23719. if (type == "qiugan") {
  23720. this.ui.myNode.n_qiuGan.c1.selectedIndex = 0;
  23721. this.ui.myNode.n_daoju.c1.selectedIndex = 1;
  23722. this.ui.myNode.c1.selectedIndex = 0;
  23723. this.ui.myNode.myList.visible = true;
  23724. this.ui.myNode.djList.visible = false;
  23725. }
  23726. else {
  23727. this.ui.myNode.n_qiuGan.c1.selectedIndex = 1;
  23728. this.ui.myNode.n_daoju.c1.selectedIndex = 0;
  23729. this.ui.myNode.c1.selectedIndex = 1;
  23730. this.ui.myNode.myList.visible = false;
  23731. this.ui.myNode.djList.visible = true;
  23732. }
  23733. }
  23734. updateBallRod() {
  23735. for (let index = 0; index < this.ballRodArr.length; index++) {
  23736. this.ballRodArr[index].updateSelf();
  23737. }
  23738. }
  23739. renderBallRod(sort, obj) {
  23740. let index = this.getIndexBySort(sort + 1) - 1;
  23741. let ballRod = new BallRodDisplay$1(obj, index);
  23742. this.ballRodArr.push(ballRod);
  23743. }
  23744. renderDaoJu(idx, obj) {
  23745. let index = this.getIndexBySortForDj(idx + 1) - 1;
  23746. let b = new DaoJuDisplay$1(obj, index);
  23747. this.daoJuArr.push(b);
  23748. }
  23749. getIndexBySort(sort) {
  23750. let object = cfgTable.ballrodData;
  23751. for (const key in object) {
  23752. if (object[key].sort == sort) {
  23753. return parseInt(key);
  23754. }
  23755. }
  23756. }
  23757. getIndexBySortForDj(idx) {
  23758. let object = cfgTable.daoJuData;
  23759. for (const key in object) {
  23760. if (object[key].idx == idx) {
  23761. return parseInt(key);
  23762. }
  23763. }
  23764. }
  23765. playSecretaryIdle() {
  23766. let parent = this.ui.secretary.displayObject;
  23767. parent.destroyChildren();
  23768. let xx = this.ui.secretary.width / 2;
  23769. let yy = this.ui.secretary.height;
  23770. let scale = xGame.common.getSecretaryScale();
  23771. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23772. xGame.common.secretary.play(data, 0, true, parent);
  23773. }
  23774. interuptSecretary() {
  23775. Laya.timer.clearAll(this);
  23776. this.playSecretaryRandomSound();
  23777. }
  23778. playSecretaryRandomSound() {
  23779. if (this.isHide)
  23780. return;
  23781. let time = xGame.common.randomNum(45000, 60000);
  23782. Laya.timer.once(time, this, () => {
  23783. if (this.isHide)
  23784. return;
  23785. let index = xGame.common.randomNum(4, 7);
  23786. xGame.soundMgr.playSound("s_main0" + index);
  23787. let words = 1;
  23788. switch (index) {
  23789. case 4:
  23790. words = 5;
  23791. break;
  23792. case 5:
  23793. words = 3;
  23794. break;
  23795. case 6:
  23796. words = 6;
  23797. break;
  23798. case 7:
  23799. words = 7;
  23800. break;
  23801. default:
  23802. break;
  23803. }
  23804. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  23805. this.playSecretaryRandomSound();
  23806. });
  23807. }
  23808. closeSelf() {
  23809. this.hide();
  23810. }
  23811. }
  23812. UIShop$1.uiName = "UIShop";
  23813. class SignMax$1 {
  23814. constructor(ui) {
  23815. this.ui = ui;
  23816. }
  23817. updateSelf(index, sameDay, curDayIndex) {
  23818. let data = cfgTable.signData[index + 1];
  23819. this.ui.titleTxt.text = data.title;
  23820. let arr1 = data.award[0].split('-');
  23821. let arr2 = data.award[1].split('-');
  23822. let num1 = parseInt(arr1[1]);
  23823. let num2 = parseInt(arr2[1]);
  23824. this.ui.numTxt1.text = num1 + "";
  23825. this.ui.numTxt2.text = num2 + "";
  23826. this.ui.myIcon1.url = xGame.common.getGameIconUrl(data.icon[0]);
  23827. this.ui.myIcon2.url = xGame.common.getGameIconUrl(data.icon[1]);
  23828. if (xGame.common.signAwardContainsRod([data.award[0]])) {
  23829. this.ui.numTxt1.visible = false;
  23830. }
  23831. else {
  23832. this.ui.numTxt1.visible = true;
  23833. }
  23834. if (xGame.common.signAwardContainsRod([data.award[1]])) {
  23835. this.ui.numTxt2.visible = false;
  23836. }
  23837. else {
  23838. this.ui.numTxt2.visible = true;
  23839. }
  23840. if (index < curDayIndex) {
  23841. this.ui.c1.selectedIndex = 1;
  23842. }
  23843. else if (index == curDayIndex) {
  23844. if (sameDay) {
  23845. this.ui.c1.selectedIndex = 2;
  23846. }
  23847. else {
  23848. this.ui.c1.selectedIndex = 2;
  23849. }
  23850. }
  23851. else {
  23852. this.ui.c1.selectedIndex = 0;
  23853. }
  23854. }
  23855. }
  23856. class SignNormal$1 {
  23857. constructor(ui) {
  23858. this.ui = ui;
  23859. }
  23860. updateSelf(index, sameDay, curDayIndex) {
  23861. let data = cfgTable.signData[index + 1];
  23862. this.ui.titleTxt.text = data.title;
  23863. let arr = data.award[0].split('-');
  23864. let type = parseInt(arr[0]);
  23865. let num = parseInt(arr[1]);
  23866. this.ui.numTxt.text = num + "";
  23867. if (type > 2) {
  23868. this.ui.myIcon.url = xGame.common.getComponentUrl("s" + data.icon[0]);
  23869. this.ui.myIcon.rotation = 0;
  23870. }
  23871. else {
  23872. this.ui.myIcon.url = xGame.common.getGameIconUrl(data.icon[0]);
  23873. this.ui.myIcon.rotation = 0;
  23874. }
  23875. if (xGame.common.signAwardContainsRod(data.award)) {
  23876. this.ui.numTxt.visible = false;
  23877. }
  23878. else {
  23879. this.ui.numTxt.visible = true;
  23880. }
  23881. if (index < curDayIndex) {
  23882. this.ui.c1.selectedIndex = 1;
  23883. }
  23884. else if (index == curDayIndex) {
  23885. if (sameDay) {
  23886. this.ui.c1.selectedIndex = 2;
  23887. }
  23888. else {
  23889. this.ui.c1.selectedIndex = 2;
  23890. }
  23891. }
  23892. else {
  23893. this.ui.c1.selectedIndex = 0;
  23894. }
  23895. }
  23896. }
  23897. class UISign$1 extends UIBase {
  23898. constructor() {
  23899. super();
  23900. this.curDayIndex = 0;
  23901. this.starX = 0;
  23902. }
  23903. onConstructor() {
  23904. this.ui = ui_UISign.createInstance();
  23905. this.contentPane = this.ui;
  23906. this.isEject = false;
  23907. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  23908. this.addUIClick(this.ui.closeNode.closeBtn, this.closeSelf);
  23909. this.initSignItem();
  23910. this.addUIClick(this.ui.normalBtn, this.normalGetAward);
  23911. this.addUIClick(this.ui.againBtn, this.againGetAward);
  23912. }
  23913. show() {
  23914. super.show();
  23915. this.ui.t0.play();
  23916. this.playSecretaryIdle();
  23917. this.updateSign();
  23918. this.ui.n_zzq_bj.url = 'res/qd_bg.jpg';
  23919. this.setGlobalFont(this.ui);
  23920. }
  23921. initSignItem() {
  23922. this.signArr = [];
  23923. for (let index = 0; index < 6; index++) {
  23924. let temp = new SignNormal$1(this.ui.myNode["day" + (index + 1)]);
  23925. this.signArr.push(temp);
  23926. }
  23927. this.signMax = new SignMax$1(this.ui.myNode.day7);
  23928. if (Moyu.isKs)
  23929. this.ui.closeNode.closeBtn.x += 100;
  23930. }
  23931. updateSign() {
  23932. let sameDay = xGame.common.judgeSameDay();
  23933. let max = 7;
  23934. this.curDayIndex = DataMgr.getSignData();
  23935. if (!this.curDayIndex || (this.curDayIndex >= max && !sameDay))
  23936. this.curDayIndex = 0;
  23937. if (!sameDay) {
  23938. this.ui.normalBtn.visible = true;
  23939. this.ui.tipsNode.visible = false;
  23940. this.ui.againBtn.visible = false;
  23941. }
  23942. else {
  23943. this.ui.normalBtn.visible = false;
  23944. let again = DataMgr.getExtraSign();
  23945. let isCurrency = false;
  23946. let index = this.curDayIndex;
  23947. if (index == 0)
  23948. index = 7;
  23949. let award = cfgTable.signData[index].award;
  23950. let num = award[0].split("-")[0];
  23951. if (num == "1" || num == "2")
  23952. isCurrency = true;
  23953. let showAgain = again == 0 && isCurrency;
  23954. this.ui.againBtn.visible = showAgain;
  23955. this.ui.tipsNode.visible = !showAgain;
  23956. }
  23957. for (let index = 0; index < this.signArr.length; index++) {
  23958. this.signArr[index].updateSelf(index, sameDay, this.curDayIndex);
  23959. }
  23960. this.signMax.updateSelf(max - 1, sameDay, this.curDayIndex);
  23961. }
  23962. playSecretaryIdle() {
  23963. let parent = this.ui.secretary.displayObject;
  23964. parent.destroyChildren();
  23965. let xx = this.ui.secretary.width / 2;
  23966. let yy = this.ui.secretary.height;
  23967. let scale = xGame.common.getSecretaryScale();
  23968. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  23969. xGame.common.secretary.play(data, 0, true, parent);
  23970. }
  23971. closeSelf() {
  23972. this.hide();
  23973. }
  23974. normalGetAward() {
  23975. let sameDay = xGame.common.judgeSameDay();
  23976. if (!sameDay) {
  23977. let award = cfgTable.signData[this.curDayIndex + 1].award;
  23978. let temp;
  23979. let type;
  23980. let num;
  23981. let arr = [];
  23982. for (let index = 0; index < award.length; index++) {
  23983. temp = award[index].split("-");
  23984. type = parseInt(temp[0]);
  23985. num = parseInt(temp[1]);
  23986. let awardType = new AwardType();
  23987. awardType.num = num;
  23988. awardType.type = type;
  23989. arr.push(awardType);
  23990. }
  23991. xGame.common.getAward(arr, (watchVideo) => {
  23992. this.curDayIndex++;
  23993. if (this.curDayIndex > 7)
  23994. this.curDayIndex = 0;
  23995. DataMgr.setSignData(this.curDayIndex);
  23996. this.updateSignData2Server(this.curDayIndex);
  23997. DataMgr.setSignTime(new Date().getTime());
  23998. if (watchVideo) {
  23999. DataMgr.setExtraSign(1);
  24000. Moyu.sendDataEvent("signIn1");
  24001. }
  24002. this.updateSign();
  24003. });
  24004. }
  24005. }
  24006. againGetAward() {
  24007. Moyu.sendDataEvent("signIn2");
  24008. console.log('zh:qjff_AD_for_uisign');
  24009. if (Laya.Browser.onAndroid) {
  24010. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24011. if (!boo) {
  24012. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24013. return;
  24014. }
  24015. }
  24016. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uisign')) {
  24017. }
  24018. else {
  24019. console.log('zh:AD 失败,直接发放奖励');
  24020. this.qjff_AD_for_uisign();
  24021. }
  24022. }
  24023. qjff_AD_for_uisign() {
  24024. let index = this.curDayIndex;
  24025. if (index == 0)
  24026. index = 7;
  24027. let award = cfgTable.signData[index].award;
  24028. let temp;
  24029. let type;
  24030. let num;
  24031. for (let index = 0; index < award.length; index++) {
  24032. temp = award[index].split("-");
  24033. type = parseInt(temp[0]);
  24034. num = parseInt(temp[1]) * 3;
  24035. xGame.common.playObjFlyAnim(num, type);
  24036. }
  24037. DataMgr.setExtraSign(1);
  24038. this.updateSign();
  24039. }
  24040. updateSignData2Server(day) {
  24041. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24042. if (userInfo == null) {
  24043. return;
  24044. }
  24045. let reqData = xGame.httpMgr.getReqData();
  24046. let pd = JSON.parse(reqData);
  24047. pd.signData = day;
  24048. reqData = JSON.stringify(pd);
  24049. xGame.httpMgr.sendPost2025('user/updateSignData', reqData, (res) => {
  24050. try {
  24051. console.log('zh:updateSignData2Server res = ' + JSON.stringify(res));
  24052. let code = res.code;
  24053. let msg = res.msg;
  24054. if (code == 401) {
  24055. Laya.LocalStorage.removeItem(keyForLoginInfo);
  24056. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  24057. return;
  24058. }
  24059. if (code == 200) {
  24060. let data = res.data;
  24061. console.log('zh:updateSignData2Server data rs= ' + JSON.stringify(data));
  24062. }
  24063. else {
  24064. xGame.uiMgr.Show(UIMsg$1, msg);
  24065. }
  24066. }
  24067. catch (error) {
  24068. console.log('error=' + error);
  24069. alert(error);
  24070. }
  24071. finally {
  24072. }
  24073. });
  24074. }
  24075. }
  24076. UISign$1.uiName = "UISign";
  24077. class UIModeSelection$1 extends UIBase {
  24078. constructor() {
  24079. super();
  24080. }
  24081. onConstructor() {
  24082. this.ui = ui_UIModeSelection.createInstance();
  24083. this.contentPane = this.ui;
  24084. this.isEject = false;
  24085. this.addUIClick(this.ui.myNode.type1, this.enterGame, [1]);
  24086. this.addUIClick(this.ui.myNode.type2, this.enterGame, [2]);
  24087. this.addUIClick(this.ui.myNode.type3, this.enterGame, [3]);
  24088. this.addUIClick(this.ui.closeBtn, this.hide);
  24089. this.peopleArr = [65, 990, 580];
  24090. this.peopleOffest = [5, 10, 10];
  24091. }
  24092. show(callback) {
  24093. this.updateSelf();
  24094. super.show();
  24095. this.ui.t0.play();
  24096. this.callback = callback;
  24097. this.setGlobalFont(this.ui);
  24098. }
  24099. updateSelf() {
  24100. let cfg = cfgTable.modeselectData;
  24101. for (let index = 1; index <= 3; index++) {
  24102. let node = this.ui.myNode["type" + index];
  24103. node.need.text = cfg[index].need;
  24104. node.tipsTxt.text = `Min ${cfg[index].need} Eligible`;
  24105. node.peopleTxt.text = this.getRandPeople(index - 1);
  24106. }
  24107. }
  24108. enterGame(type) {
  24109. console.log('zh: 进入经典模式 type: ' + type);
  24110. xGame.common.classicRoomType = type;
  24111. let cfg = cfgTable.modeselectData[type];
  24112. let need = cfg.need;
  24113. xGame.common.passAwardCoin = cfg.award;
  24114. if (DataMgr.coinEnough(need)) {
  24115. DataMgr.setCoin(-need);
  24116. this.ui.myNode["type" + type].t0.play();
  24117. Laya.timer.once(200, this, () => {
  24118. this.callback && this.callback();
  24119. });
  24120. this.logEventForClassic_start();
  24121. }
  24122. else {
  24123. Moyu.sendDataEvent("AddCoinVideo");
  24124. xGame.uiMgr.Show(UIAddProp$1, 0);
  24125. }
  24126. }
  24127. getRandPeople(index) {
  24128. let rand = this.peopleOffest[index];
  24129. return this.peopleArr[index] + xGame.common.randomNum(-rand, rand);
  24130. }
  24131. logEventForClassic_start() {
  24132. let rtype = xGame.common.classicRoomType;
  24133. let msmc = '';
  24134. if (rtype == 1) {
  24135. msmc = 'beginner';
  24136. }
  24137. if (rtype == 2) {
  24138. msmc = 'expert';
  24139. }
  24140. if (rtype == 3) {
  24141. msmc = 'master';
  24142. }
  24143. let keyStr = 'sjmd_classic_start_' + rtype;
  24144. let jsonStr = {
  24145. "difficulty": msmc,
  24146. "classic_count": 1,
  24147. "difficulty_count": 1
  24148. };
  24149. if (LocalStorageManager.hasJosnKey(keyStr)) {
  24150. const d = LocalStorageManager.getItem(keyStr);
  24151. jsonStr.classic_count = d.classic_count + 1;
  24152. jsonStr.difficulty_count = d.difficulty_count + 1;
  24153. LocalStorageManager.setItem(keyStr, jsonStr);
  24154. }
  24155. else {
  24156. LocalStorageManager.setItem(keyStr, jsonStr);
  24157. }
  24158. const reqStr = JSON.stringify(jsonStr);
  24159. JSBridgeUtils.instance.logEventForAdHaveParams('classic_start', reqStr);
  24160. }
  24161. }
  24162. UIModeSelection$1.uiName = "UIModeSelection";
  24163. class UILogin$1 extends UIBase {
  24164. constructor() {
  24165. super();
  24166. this.fontStr = 'big-john-woff2-2';
  24167. try {
  24168. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24169. console.log("zh: constructor加载arial字体成功");
  24170. }
  24171. catch (error) {
  24172. console.log("zh: constructor加载arial字体失败");
  24173. }
  24174. }
  24175. onFontLoaded() {
  24176. try {
  24177. Laya.Text.defaultFont = this.fontStr;
  24178. this.ui.txt_ua.font = this.fontStr;
  24179. this.ui.txt_up.font = this.fontStr;
  24180. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24181. }
  24182. catch (error) {
  24183. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24184. }
  24185. }
  24186. onConstructor() {
  24187. this.ui = ui_UILogin.createInstance();
  24188. this.contentPane = this.ui;
  24189. this.isEject = false;
  24190. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24191. this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
  24192. this.addUIClick(this.ui.btn_login, this.userLogin);
  24193. }
  24194. show() {
  24195. super.show();
  24196. this.x = (Laya.stage.width - this.width) / 2;
  24197. this.y = (Laya.stage.height - this.height) / 2;
  24198. this.onFontLoaded();
  24199. }
  24200. closeSelf() {
  24201. this.hide();
  24202. }
  24203. userLogin() {
  24204. let ua = this.ui.txt_ua.text;
  24205. let up = this.ui.txt_up.text;
  24206. console.log('zh:ua font' + this.ui.txt_ua.font);
  24207. if (ua && up) {
  24208. let reqData = JSON.stringify({
  24209. username: ua.trim(),
  24210. password: up.trim(),
  24211. fromMark: 'app_game'
  24212. });
  24213. xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
  24214. try {
  24215. console.log('zh:res = ' + JSON.stringify(res));
  24216. let code = res.code;
  24217. let msg = res.msg;
  24218. if (code == 200) {
  24219. let keyStr = keyForLoginInfo;
  24220. let jsonStr = {
  24221. "username": res.username,
  24222. "token": res.token,
  24223. "buySpids": { 1: false, 7: false }
  24224. };
  24225. LocalStorageManager.setItem(keyStr, jsonStr);
  24226. let myu = Moyu.getUserInfo();
  24227. console.log('zh:myu = ' + JSON.stringify(myu));
  24228. DataMgr.updateUserNickName(res.username);
  24229. Moyu.updateUserInfo(res.username);
  24230. xGame.uiMgr.Show(UIMsg$1, msg);
  24231. DataMgr.loadUserSpOrderForAd();
  24232. DataMgr.getUserZiChanInfo(false);
  24233. xGame.eventMgr.event(LOGIN_IN);
  24234. this.closeSelf();
  24235. }
  24236. else {
  24237. xGame.uiMgr.Show(UIMsg$1, msg);
  24238. }
  24239. }
  24240. catch (error) {
  24241. console.log('error=' + error);
  24242. alert(error);
  24243. }
  24244. finally {
  24245. }
  24246. });
  24247. }
  24248. else {
  24249. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24250. }
  24251. }
  24252. gotoRegPage() {
  24253. this.closeSelf();
  24254. xGame.uiMgr.Show(UIReg$1);
  24255. }
  24256. }
  24257. UILogin$1.uiName = "UILogin";
  24258. class UIReg$1 extends UIBase {
  24259. constructor() {
  24260. super();
  24261. this.fontStr = 'big-john-woff2-2';
  24262. try {
  24263. Laya.loader.load("res/font/big-john-woff2-2.ttf", Laya.Handler.create(this, this.onFontLoaded));
  24264. console.log("zh: constructor加载arial字体成功");
  24265. }
  24266. catch (error) {
  24267. console.log("zh: constructor加载arial字体失败");
  24268. }
  24269. }
  24270. onFontLoaded() {
  24271. try {
  24272. Laya.Text.defaultFont = this.fontStr;
  24273. this.ui.txt_ua.font = this.fontStr;
  24274. this.ui.txt_up1.font = this.fontStr;
  24275. this.ui.txt_up2.font = this.fontStr;
  24276. console.log("zh: onFontLoaded 设置" + this.fontStr + "字体成功");
  24277. }
  24278. catch (error) {
  24279. console.log("zh: constructor onFontLoaded加载" + this.fontStr + "字体失败");
  24280. }
  24281. }
  24282. onConstructor() {
  24283. this.ui = ui_UIReg.createInstance();
  24284. this.contentPane = this.ui;
  24285. this.isEject = false;
  24286. this.addUIClick(this.ui.closeBtn, this.closeSelf);
  24287. this.addUIClick(this.ui.btn_reg, this.regUser);
  24288. this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
  24289. }
  24290. show() {
  24291. super.show();
  24292. this.x = (Laya.stage.width - this.width) / 2;
  24293. this.y = (Laya.stage.height - this.height) / 2;
  24294. this.onFontLoaded();
  24295. }
  24296. closeSelf() {
  24297. this.hide();
  24298. }
  24299. regUser() {
  24300. this.ui.lab_tip.visible = false;
  24301. let ua = this.ui.txt_ua.text;
  24302. let up1 = this.ui.txt_up1.text;
  24303. let up2 = this.ui.txt_up2.text;
  24304. if (ua && up1 && up2 && up1 == up2) {
  24305. let reqData = JSON.stringify({
  24306. username: ua.trim(),
  24307. password: up1.trim(),
  24308. fromMark: 'app_game'
  24309. });
  24310. xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
  24311. try {
  24312. console.log('zh:res = ' + JSON.stringify(res));
  24313. let code = res.code;
  24314. let msg = res.msg;
  24315. xGame.uiMgr.Show(UIMsg$1, msg);
  24316. if (code == 200) {
  24317. this.ui.lab_tip.color = "#FFFFFF";
  24318. xGame.uiMgr.Show(UIMsg$1, msg);
  24319. this.closeSelf();
  24320. }
  24321. else {
  24322. this.ui.lab_tip.color = "#FF0000";
  24323. xGame.uiMgr.Show(UIMsg$1, msg);
  24324. }
  24325. }
  24326. catch (error) {
  24327. console.log('error=' + error);
  24328. alert(error);
  24329. }
  24330. finally {
  24331. }
  24332. });
  24333. }
  24334. else {
  24335. if (up1 != up2) {
  24336. xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
  24337. }
  24338. else {
  24339. xGame.uiMgr.Show(UIMsg$1, "Missing information!");
  24340. }
  24341. }
  24342. }
  24343. gotoLogin() {
  24344. this.closeSelf();
  24345. xGame.uiMgr.Show(UILogin$1);
  24346. }
  24347. }
  24348. UIReg$1.uiName = "UIReg";
  24349. class UITry$1 extends UIBase {
  24350. constructor() {
  24351. super();
  24352. this.closeTime = 0;
  24353. this.closeNum = 0;
  24354. this.skillUrl = xGame.common.skillIconList;
  24355. }
  24356. onConstructor() {
  24357. this.ui = ui_UITry.createInstance();
  24358. this.contentPane = this.ui;
  24359. this.addUIClick(this.ui.myNode.cancelBtn, this.onCancel);
  24360. this.addUIClick(this.ui.myNode.videoBtn, this.onTry);
  24361. }
  24362. show() {
  24363. super.show();
  24364. this.closeNum = 0;
  24365. this.closeTime = 15;
  24366. this.ui.t0.play();
  24367. PlatMgr.showRateBanner();
  24368. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24369. Laya.timer.loop(1000, this, this.updateTime);
  24370. let iconStr = this.skillUrl[xGame.common.curPlayerSkillType];
  24371. this.ui.myNode.n29.skillicon.url = xGame.common.getGameIconUrl(iconStr);
  24372. xGame.common.gameMgr.gamePause = true;
  24373. this.setGlobalFont(this.ui);
  24374. }
  24375. updateTime() {
  24376. if (this.closeTime > 1) {
  24377. this.closeTime--;
  24378. this.ui.myNode.txtTime.text = this.closeTime.toString();
  24379. }
  24380. else
  24381. this.hide();
  24382. }
  24383. hide() {
  24384. Laya.timer.clearAll(this);
  24385. Moyu.showBannerAd(false);
  24386. super.hide();
  24387. xGame.common.gameMgr.gamePause = false;
  24388. }
  24389. onTry() {
  24390. console.log('zh:qjff_AD_for_uitry');
  24391. if (Laya.Browser.onAndroid) {
  24392. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24393. if (!boo) {
  24394. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24395. return;
  24396. }
  24397. }
  24398. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uitry')) {
  24399. }
  24400. else {
  24401. console.log('zh:AD 失败,直接发放奖励');
  24402. this.qjff_AD_for_uitry();
  24403. }
  24404. }
  24405. qjff_AD_for_uitry() {
  24406. let select = xGame.common.curPlayerSkillType;
  24407. DataMgr.gameData.trySkill = select;
  24408. DataMgr.gameData.tryTime = Laya.timer.currTimer + 300000;
  24409. DataMgr.saveGameData();
  24410. DataMgr.setBigSkill(select, 1);
  24411. xGame.showTip("Trial Successful");
  24412. this.hide();
  24413. }
  24414. onCancel() {
  24415. if (this.closeNum > 0) {
  24416. this.closeNum--;
  24417. if (this.closeNum < 2)
  24418. this.hide();
  24419. return;
  24420. }
  24421. else if (PlatMgr.getRand() < PlatMgr.tryVideoRate) {
  24422. this.onTry();
  24423. }
  24424. else if (PlatMgr.getRand() < PlatMgr.tryClose3Rate) {
  24425. this.closeNum = 3;
  24426. }
  24427. else
  24428. this.hide();
  24429. }
  24430. }
  24431. UITry$1.uiName = "UITry";
  24432. class UIGetAward$1 extends UIBase {
  24433. constructor() {
  24434. super();
  24435. this.showTriple = true;
  24436. }
  24437. onConstructor() {
  24438. this.ui = ui_UIGetAward.createInstance();
  24439. this.contentPane = this.ui;
  24440. this.isEject = false;
  24441. this.addUIClick(this.ui.btnNode.tripleBtn, this.tripleGetAward);
  24442. this.addUIClick(this.ui.btnNode.normalBtn, this.normalGetAward);
  24443. this.ui.myList.itemRenderer = Laya.Handler.create(this, this.renderItem, null, false);
  24444. }
  24445. show(arr, showTriple, callback) {
  24446. super.show();
  24447. this.ui.t0.play();
  24448. this.ui.eftNode.visible = true;
  24449. this.ui.eftNode.t0.play(Laya.Handler.create(this, () => {
  24450. this.ui.eftNode.visible = false;
  24451. }), 1, 0, 0, 0.9);
  24452. this.awardArr = arr;
  24453. this.showTriple = showTriple;
  24454. this.callback = callback;
  24455. this.ui.btnNode.c1.selectedIndex = this.showTriple ? 0 : 1;
  24456. this.ui.myList.numItems = arr.length;
  24457. xGame.soundMgr.playSound("getaward");
  24458. this.setGlobalFont(this.ui);
  24459. }
  24460. updateSelf(index, obj) {
  24461. let temp = this.awardArr[index];
  24462. let icon = this.getIcon(temp.type);
  24463. let str = icon;
  24464. if (temp.type > 2) {
  24465. str = "s" + icon;
  24466. }
  24467. obj.myIcon.url = xGame.common.getGameIconUrl(str);
  24468. obj.myIcon.rotation = 0;
  24469. obj.numTxt.text = temp.num + "";
  24470. obj.numTxt.visible = temp.type > 2 ? false : true;
  24471. obj.nameTxt.text = this.getNameStr(temp.type);
  24472. }
  24473. renderItem(index, obj) {
  24474. this.updateSelf(index, obj);
  24475. }
  24476. tripleGetAward() {
  24477. console.log('zh:qjff_AD_for_uigetAward');
  24478. if (Laya.Browser.onAndroid) {
  24479. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24480. if (!boo) {
  24481. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24482. return;
  24483. }
  24484. }
  24485. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uigetAward')) {
  24486. }
  24487. else {
  24488. console.log('zh:AD 失败,直接发放奖励');
  24489. this.qjff_AD_for_uigetAward();
  24490. }
  24491. }
  24492. qjff_AD_for_uigetAward() {
  24493. this.getAward(3);
  24494. }
  24495. normalGetAward() {
  24496. if (PlatMgr.isMisVideo())
  24497. this.tripleGetAward();
  24498. else
  24499. this.getAward();
  24500. }
  24501. getAward(times = 1) {
  24502. this.hide();
  24503. for (let index = 0; index < this.awardArr.length; index++) {
  24504. this.awardArr[index].num *= times;
  24505. }
  24506. this.callback && this.callback(times != 1);
  24507. }
  24508. getIcon(type) {
  24509. switch (type) {
  24510. case Prop.diamond:
  24511. return "ty_zs";
  24512. case Prop.coin:
  24513. return "ty_jb";
  24514. case Prop.gan1:
  24515. return "qg1";
  24516. case Prop.gan2:
  24517. return "qg2";
  24518. case Prop.gan3:
  24519. return "qg3";
  24520. case Prop.gan4:
  24521. return "qg4";
  24522. default:
  24523. break;
  24524. }
  24525. }
  24526. getNameStr(type) {
  24527. switch (type) {
  24528. case Prop.diamond:
  24529. return "Diamond";
  24530. case Prop.coin:
  24531. return "Coins";
  24532. case Prop.gan1:
  24533. case Prop.gan2:
  24534. case Prop.gan3:
  24535. case Prop.gan4:
  24536. return cfgTable.ballrodData[type - 1].name;
  24537. default:
  24538. break;
  24539. }
  24540. }
  24541. }
  24542. UIGetAward$1.uiName = "UIGetAward";
  24543. class UIBox$1 extends UIBase {
  24544. constructor() {
  24545. super();
  24546. this.boxNum = 0;
  24547. this.boxMax = 10;
  24548. this.inAd = false;
  24549. this.isClose = false;
  24550. }
  24551. onConstructor() {
  24552. this.ui = ui_UIBox.createInstance();
  24553. this.contentPane = this.ui;
  24554. this.isEject = false;
  24555. this.addUIClick(this.ui.closeBtn, this.onCloseBox);
  24556. this.addUIClick(this.ui.openBtn, this.onOpenBox);
  24557. Laya.timer.loop(1000, this, this.update);
  24558. }
  24559. update() {
  24560. if (this.boxNum > 0 && this.boxNum < this.boxMax) {
  24561. this.boxNum -= 1;
  24562. this.upBar();
  24563. }
  24564. }
  24565. upBar() {
  24566. if (this.boxNum > this.boxMax)
  24567. this.boxNum = this.boxMax;
  24568. this.ui.bar.value = this.boxNum * 10;
  24569. }
  24570. show() {
  24571. super.show();
  24572. this.isClose = false;
  24573. this.boxNum = 0;
  24574. this.inAd = false;
  24575. this.upBar();
  24576. this.ui.t0.play();
  24577. this.ui.closeBtn.visible = false;
  24578. Laya.timer.once(3000, this, () => {
  24579. this.ui.closeBtn.visible = true;
  24580. this.ui.bar.alpha = 1;
  24581. });
  24582. Laya.timer.once(500, this, () => {
  24583. this.ui.t1.play();
  24584. });
  24585. this.setGlobalFont(this.ui);
  24586. }
  24587. hide() {
  24588. Laya.timer.clearAll(this);
  24589. Moyu.showBannerAd(false);
  24590. super.hide();
  24591. }
  24592. onOpenBox() {
  24593. this.boxNum++;
  24594. if (this.boxNum < this.boxMax) {
  24595. if (PlatMgr.getRand() < PlatMgr.boxInsertRate) {
  24596. JSBridgeUtils.instance.showInternAd('uivideoshare_show');
  24597. }
  24598. }
  24599. else if (this.boxNum == this.boxMax) {
  24600. if (PlatMgr.getRand() < PlatMgr.boxVideoRate) {
  24601. this.ui.openBtn.c1.selectedIndex = 13;
  24602. this.inAd = true;
  24603. }
  24604. else
  24605. this.getAward();
  24606. }
  24607. else if (this.inAd) {
  24608. console.log('zh:qjff_AD_for_UIBOX_onOpenBox');
  24609. if (Laya.Browser.onAndroid) {
  24610. let boo = JSBridgeUtils.instance.getNetworkAvailable();
  24611. if (!boo) {
  24612. JSBridgeUtils.instance.showToast2("Network error, reward unavailable");
  24613. return;
  24614. }
  24615. }
  24616. if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_UIBOX_onOpenBox')) {
  24617. }
  24618. else {
  24619. console.log('zh:AD 失败,直接发放奖励');
  24620. this.qjff_AD_for_UIBOX_onOpenBox();
  24621. }
  24622. }
  24623. this.upBar();
  24624. }
  24625. qjff_AD_for_UIBOX_onOpenBox() {
  24626. this.getAward();
  24627. }
  24628. onCloseBox() {
  24629. if (this.isClose)
  24630. this.hide();
  24631. else if (PlatMgr.getRand() < PlatMgr.boxBannerRate) {
  24632. this.isClose = true;
  24633. PlatMgr.showBanner(true, 0, 3000);
  24634. }
  24635. else
  24636. this.hide();
  24637. }
  24638. getAward() {
  24639. let str = "";
  24640. if (Math.random() < 0.5) {
  24641. let max = Moyu.isLegal ? 500 : 2500;
  24642. let num = xGame.tools.random(max, 500 + max);
  24643. DataMgr.setCoin(num);
  24644. str = "金币x" + num;
  24645. }
  24646. else {
  24647. let max = Moyu.isLegal ? 10 : 30;
  24648. let num = xGame.tools.random(max, 30 + max);
  24649. DataMgr.setDiamond(num);
  24650. str = "钻石x" + num;
  24651. }
  24652. xGame.showTip("恭喜获得-" + str);
  24653. this.hide();
  24654. }
  24655. }
  24656. UIBox$1.uiName = "UIBox";
  24657. class UIMain$1 extends UIBase {
  24658. constructor() {
  24659. super();
  24660. this.firstEnter = true;
  24661. this.moni_click_count = 0;
  24662. }
  24663. nativeCallJs(msg) {
  24664. let t = msg;
  24665. console.log("zh: nativeCallJs 奖励开始发放:", t);
  24666. switch (t) {
  24667. case 'qjff_chouJiang':
  24668. let dui = xGame.uiMgr.getUI(UIDraw$1);
  24669. dui.qjff_chouJiang();
  24670. break;
  24671. case 'qjff_AD_for_uisign':
  24672. let dui2 = xGame.uiMgr.getUI(UISign$1);
  24673. dui2.qjff_AD_for_uisign();
  24674. break;
  24675. case 'qjff_AD_for_uitry':
  24676. let dui3 = xGame.uiMgr.getUI(UITry$1);
  24677. dui3.qjff_AD_for_uitry();
  24678. break;
  24679. case 'qjff_AD_for_uipower':
  24680. let dui4 = xGame.uiMgr.getUI(UIPower$1);
  24681. dui4.qjff_AD_for_uipower();
  24682. break;
  24683. case 'qjff_AD_for_uigetAward':
  24684. let dui5 = xGame.uiMgr.getUI(UIGetAward$1);
  24685. dui5.qjff_AD_for_uigetAward();
  24686. break;
  24687. case 'qjff_AD_for_uiGameEnd':
  24688. let temp_level = Laya.LocalStorage.getItem('temp_qjff_AD_for_uiGameEnd_level');
  24689. let dui6 = xGame.uiMgr.getUI(UIGameEnd$1);
  24690. dui6.qjff_AD_for_uiGameEnd(parseInt(temp_level));
  24691. break;
  24692. case 'qjff_AD_for_uiAddProp_videoGetDiamond':
  24693. let dui7 = xGame.uiMgr.getUI(UIAddProp$1);
  24694. dui7.qjff_AD_for_uiAddProp_videoGetDiamond();
  24695. break;
  24696. case 'qjff_AD_for_uiAddProp_videoGetCoin':
  24697. let dui8 = xGame.uiMgr.getUI(UIAddProp$1);
  24698. dui8.qjff_AD_for_uiAddProp_videoGetCoin();
  24699. break;
  24700. case 'qjff_AD_for_UIrepentProp_videoRegret':
  24701. let dui9 = xGame.uiMgr.getUI(UIRepentProp$1);
  24702. dui9.qjff_AD_for_UIrepentProp_videoRegret();
  24703. break;
  24704. case 'qjff_AD_for_UIrepentProp_videoAddHelpLine':
  24705. let dui10 = xGame.uiMgr.getUI(UIRepentProp$1);
  24706. dui10.qjff_AD_for_UIrepentProp_videoAddHelpLine();
  24707. break;
  24708. case 'qjff_AD_for_UIBOX_onOpenBox':
  24709. let dui11 = xGame.uiMgr.getUI(UIBox$1);
  24710. dui11.qjff_AD_for_UIBOX_onOpenBox();
  24711. break;
  24712. case 'qjff_AD_for_UIAddCoin':
  24713. let dui12 = xGame.uiMgr.getUI(UIAddCoin$1);
  24714. dui12.qjff_AD_for_UIAddCoin();
  24715. break;
  24716. case 'app_sign_for_buyProduct_onSuccess':
  24717. console.log('zh:收到APP通知,需要更新用户游戏资产信息app_sign_for_buyProduct_onSuccess ');
  24718. DataMgr.getUserZiChanInfo(false);
  24719. break;
  24720. case '222axxxxxx':
  24721. let dui15 = xGame.uiMgr.getUI(UISign$1);
  24722. dui15.qjff_AD_for_uisign();
  24723. break;
  24724. case '333axsxxxxxx':
  24725. let dui16 = xGame.uiMgr.getUI(UISign$1);
  24726. dui16.qjff_AD_for_uisign();
  24727. break;
  24728. default:
  24729. console.log('zh:未知的方法名字' + t);
  24730. break;
  24731. }
  24732. }
  24733. onConstructor() {
  24734. console.log('zh: UIMain onConstructor');
  24735. this.ui = ui_UIMain.createInstance();
  24736. this.contentPane = this.ui;
  24737. this.isEject = false;
  24738. this.addEvent();
  24739. this.addClickSpine();
  24740. this.settingNode = new SettingNode$1(this.ui.settingNode);
  24741. this.moneyNode = new MoneyNode$1(this.ui.moneyNode);
  24742. xGame.eventMgr.on(RESTART_GAME, this, this.beginGame);
  24743. xGame.eventMgr.on(GET_USER_INFO, this, this.onGetUserInfo);
  24744. xGame.eventMgr.on(CHANGE_SECRETARY, this, this.changeSecretary);
  24745. xGame.eventMgr.on(LOGIN_OUT, this, this.setUserDefaultNickname);
  24746. xGame.eventMgr.on(LOGIN_IN, this, this.event_login_in);
  24747. xGame.eventMgr.on("gameConfigReadyMark", this, this.event_gameConfigReadyMark);
  24748. let curUse = DataMgr.getCurSecretary();
  24749. this.changeSecretary(curUse);
  24750. this.ui.talkNode.visible = false;
  24751. let guide = DataMgr.getSkillGuide();
  24752. if (xGame.common.isNewDay && guide == 1) {
  24753. xGame.common.isNewDay = false;
  24754. xGame.soundMgr.playSound("s_main01");
  24755. xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24756. console.log("zh:播放小秘书每天语音");
  24757. }
  24758. this.onGetUserInfo();
  24759. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24760. DataMgr.getUserZiChanInfo(false);
  24761. }
  24762. this.ui.n83.visible = false;
  24763. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24764. const d = LocalStorageManager.getItem(keyForLoginInfo);
  24765. let ua = d.username;
  24766. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  24767. }
  24768. this.c_btn_for_user();
  24769. window['nativeCallJs'] = this.nativeCallJs.bind(this);
  24770. }
  24771. Logout() {
  24772. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24773. LocalStorageManager.removeItem(keyForLoginInfo);
  24774. this.freshUser();
  24775. }
  24776. JSBridgeUtils.instance.loginOutForApp();
  24777. this.setUserDefaultNickname();
  24778. DataMgr.setCoin2(4000);
  24779. DataMgr.setDiamond2(0);
  24780. this.setDefaultQiuGanInfo();
  24781. DataMgr.setPlaceBallLevelList("");
  24782. DataMgr.setChallengeMode_overLev(1);
  24783. this.setDefaultSignData();
  24784. DataMgr.setBigSkillFormServer('[1, 1, 1, 1, 1]');
  24785. }
  24786. setDefaultSignData() {
  24787. DataMgr.setSignData(1);
  24788. DataMgr.setSignTime(new Date().getTime());
  24789. }
  24790. setDefaultQiuGanInfo() {
  24791. DataMgr.setBallRod(0, 1);
  24792. DataMgr.setBallRod(1, 0);
  24793. DataMgr.setBallRod(2, 0);
  24794. DataMgr.setBallRod(3, 0);
  24795. DataMgr.setBallRod(4, 0);
  24796. DataMgr.setBallRod(5, 1);
  24797. }
  24798. setUserDefaultNickname() {
  24799. let defUsername = "player";
  24800. this.ui.headNode.nameTxt.text = defUsername;
  24801. DataMgr.updateUserNickName(defUsername);
  24802. Moyu.updateUserInfo(defUsername);
  24803. }
  24804. gotoLogin() {
  24805. if (this.ui.n_dengLu.c1.selectedIndex == 0) {
  24806. xGame.uiMgr.Show(UILogin$1);
  24807. }
  24808. if (this.ui.n_dengLu.c1.selectedIndex == 1) {
  24809. this.Logout();
  24810. }
  24811. }
  24812. gotoRegUser() {
  24813. xGame.uiMgr.Show(UIReg$1);
  24814. }
  24815. showFuLiSp1() {
  24816. console.log('zh:福利1');
  24817. DataMgr.checkForShowFuLi17AndAlert(1);
  24818. }
  24819. showFuLiSp7() {
  24820. console.log('zh:福利7');
  24821. DataMgr.checkForShowFuLi17AndAlert(7);
  24822. }
  24823. c_btn_for_user() {
  24824. this.ui.n_dengLu.c1.selectedIndex = 0;
  24825. if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
  24826. this.ui.n_dengLu.c1.selectedIndex = 1;
  24827. }
  24828. else {
  24829. this.ui.n_dengLu.c1.selectedIndex = 0;
  24830. }
  24831. }
  24832. changeSecretary(curUse) {
  24833. let name = cfgTable.secretaryshopData[curUse + 1].spine;
  24834. xGame.common.secretary && xGame.common.secretary.dispose();
  24835. this.addSecretarySpine(name);
  24836. }
  24837. addSecretarySpine(name) {
  24838. let spine = new SpineMgr(name, () => {
  24839. this.playSecretaryIdle();
  24840. });
  24841. xGame.common.secretary = spine;
  24842. }
  24843. addClickSpine() {
  24844. let clickSpine = new SpineMgr("dianji", () => {
  24845. Laya.stage.on(Laya.Event.CLICK, this, (e) => {
  24846. let parent = Laya.stage;
  24847. let data = { x: e.stageX, y: e.stageY, scaleX: 0.8, scaleY: 0.8 };
  24848. clickSpine.play(data, 0, false, parent, (spine) => {
  24849. spine.destroy(true);
  24850. });
  24851. });
  24852. });
  24853. }
  24854. addEvent() {
  24855. this.addUIClick(this.ui.classicBtn, this.startGame, [GameMode.classic]);
  24856. this.addUIClick(this.ui.bigMoveBtn, this.startGame, [GameMode.bigMove]);
  24857. this.addUIClick(this.ui.ganFaMoShiBtn, this.openShopView0);
  24858. this.addUIClick(this.ui.globalBtn, this.startGlobal);
  24859. this.addUIClick(this.ui.placeBallBtn, this.startPlaceBall);
  24860. this.addUIClick(this.ui.headNode, this.onGetUserInfo, [true]);
  24861. this.addUIClick(this.ui, this.interuptSecretary);
  24862. this.addUIClick(this.ui.rightBtn, this.ensureSecretary);
  24863. this.addUIClick(this.ui.guideBtn, this.startGame, [GameMode.bigMove]);
  24864. this.addUIClick(this.ui.secretaryBtn, this.openSecretaryView);
  24865. this.addUIClick(this.ui.shopBtn, this.openShopView);
  24866. this.addUIClick(this.ui.signBtn, this.openSignView);
  24867. this.addUIClick(this.ui.drawBtn, this.openDrawView);
  24868. this.addUIClick(this.ui.rankBtn, this.openRanking);
  24869. this.addUIClick(this.ui.n73, this.startGame, [GameMode.bigMove]);
  24870. this.addUIClick(this.ui.n_yd_challenge_1_btn, this.startPlaceBall);
  24871. this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
  24872. this.addUIClick(this.ui.n_moni_pay_ok, this.start_debug_for_moni_payOk);
  24873. }
  24874. show(showFailWords) {
  24875. super.show();
  24876. DataMgr.loadUserSpOrderForAd();
  24877. this.moneyNode.ui.c1.selectedIndex = 1;
  24878. this.playSecretaryIdle();
  24879. xGame.soundMgr.playMusic("caromhall01", 0);
  24880. Laya.timer.clearAll(this);
  24881. this.playSecretaryRandomSound();
  24882. console.log('zh:uimain.ts show show FailWords=', showFailWords);
  24883. if (showFailWords) {
  24884. console.log('zh:uimain.ts ');
  24885. setTimeout(() => {
  24886. let str = Math.random() <= 0.5 ? "s_main02" : "s_main03";
  24887. let words = -1;
  24888. if (str == "s_main02") {
  24889. words = 2;
  24890. }
  24891. else {
  24892. words = 3;
  24893. }
  24894. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24895. xGame.soundMgr.playSound(str);
  24896. }, 300);
  24897. }
  24898. this.ui.guideBtn.x = this.ui.liucheng2.myMask.x;
  24899. this.ui.guideBtn.y = this.ui.liucheng2.myMask.y;
  24900. let guide = DataMgr.getSkillGuide();
  24901. if (guide == 1) {
  24902. let randTime = xGame.common.randomNum(300, 800);
  24903. if (this.firstEnter) {
  24904. console.log("zh: firstEnter");
  24905. this.firstEnter = false;
  24906. randTime += 900;
  24907. }
  24908. else {
  24909. console.log("zh: no firstEnter");
  24910. }
  24911. Laya.timer.once(randTime, this, () => {
  24912. });
  24913. Laya.timer.once(1000, this, () => {
  24914. console.log('zh: 1秒后 showFuLiSp7');
  24915. this.showFuLiSp7();
  24916. });
  24917. this.showTipForGuest();
  24918. }
  24919. this.setGlobalFont(this.ui);
  24920. }
  24921. event_gameConfigReadyMark() {
  24922. console.log('zh:事件触发,配置加载OK');
  24923. this.showGuideForLianxi();
  24924. }
  24925. showGuideForLianxi() {
  24926. let lianXiGuide = DataMgr.getLianXiGuide();
  24927. console.log('zh: AAAAA练习模式引导判断:lianXiGuide=' + lianXiGuide);
  24928. if (lianXiGuide == 0) {
  24929. let x = this.ui.placeBallBtn.x;
  24930. let y = this.ui.placeBallBtn.y;
  24931. this.ui.n_yd_lxms_1.visible = true;
  24932. this.ui.n_yd_challenge_1_hand.x = x + 150;
  24933. this.ui.n_yd_challenge_1_hand.y = y;
  24934. this.ui.n_yd_challenge_1_btn.x = x;
  24935. this.ui.n_yd_challenge_1_btn.y = y;
  24936. console.log('zh:yinDaoForLianxi set ok');
  24937. }
  24938. else {
  24939. this.ui.n_yd_lxms_1.visible = false;
  24940. }
  24941. }
  24942. showTipForGuest() {
  24943. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  24944. if (userInfo == null) {
  24945. console.log('zh: 游客模式下数据可能丢失,建议登录账号');
  24946. let tips = "Data may be lost in guest mode. Logging in is recommended.";
  24947. let woman = "this is an important notice.";
  24948. xGame.uiMgr.Show(UITips, tips, woman, TipsType.foul);
  24949. return;
  24950. }
  24951. }
  24952. checkActive(show) {
  24953. }
  24954. showGuide() {
  24955. let guide = DataMgr.getSkillGuide();
  24956. this.ui.guideBtn.visible = guide == 0;
  24957. this.ui.enterGuide.visible = false;
  24958. this.ui.secretaryGuide.visible = guide == 0;
  24959. if (guide == 0) {
  24960. console.log("zh:显示引导");
  24961. xGame.soundMgr.playSound("s_guide");
  24962. xGame.common.showGirlTalkPop(16, this.ui.talkNode, this.ui.talkNode.womanTxt);
  24963. }
  24964. else {
  24965. console.log("zh:不需要显示引导");
  24966. }
  24967. }
  24968. ensureSecretary() {
  24969. console.log('zh: ensureSecretary ');
  24970. this.ui.secretaryGuide.visible = false;
  24971. this.ui.enterGuide.visible = true;
  24972. this.ui.wordsNode.t0.play();
  24973. if (DataMgr.getNewUser())
  24974. Moyu.sendDataEvent("gameReady");
  24975. }
  24976. playSecretaryIdle() {
  24977. let parent = this.ui.secretary.displayObject;
  24978. parent.destroyChildren();
  24979. let xx = this.ui.secretary.width / 2;
  24980. let yy = this.ui.secretary.height;
  24981. let scale = xGame.common.getSecretaryScale();
  24982. let data = { x: xx, y: yy, scaleX: scale, scaleY: scale };
  24983. xGame.common.secretary.play(data, 0, true, parent);
  24984. }
  24985. startGame(type) {
  24986. if (!this.isReadyForLoadNetSource()) {
  24987. return;
  24988. }
  24989. xGame.common.gameMode = type;
  24990. Moyu.sendDataEvent("PlayGame", { type: type });
  24991. let gm = xGame.common.gameMode;
  24992. console.log('zh:进入游戏gameMode =' + gm);
  24993. switch (gm) {
  24994. case GameMode.classic:
  24995. console.log('zh:进入经典模式111111111');
  24996. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark) {
  24997. let db_over_lev = DataMgr.getChallengeMode_overLev();
  24998. console.log('zh:classic 经典模式 db_over_lev=', db_over_lev);
  24999. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_Classic) {
  25000. console.log('zh:判断是否可以玩该模式classic =NO');
  25001. let tipStr = 'You must complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_Classic + ' levels in Challenge Mode to unlock Classic Mode.';
  25002. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25003. return;
  25004. }
  25005. else {
  25006. console.log('zh:可以玩该模式classic');
  25007. this.beginGame();
  25008. }
  25009. }
  25010. else {
  25011. console.log('zh:不需要判断是否可以玩该classic');
  25012. let challengeTimes = DataMgr.getChallengeTimes();
  25013. if (challengeTimes == 0) {
  25014. xGame.uiMgr.Show(UIInvitation$1);
  25015. }
  25016. else {
  25017. this.beginGame();
  25018. }
  25019. }
  25020. break;
  25021. case GameMode.bigMove:
  25022. console.info('zh:bigMove check 大招');
  25023. let guide = DataMgr.getSkillGuide();
  25024. if (DataMgr.DIY_challengeMode_overLev_jieSuo_mark && guide == 1) {
  25025. let db_over_lev = DataMgr.getChallengeMode_overLev();
  25026. console.log('zh:bigMove db_over_lev=', db_over_lev);
  25027. if (db_over_lev < DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod) {
  25028. console.log('zh:提示不可以玩');
  25029. let tipStr = 'Complete ' + DataMgr.DIY_challengeMode_overLev_jieSuo_rodMethod + ' levels in Challenge Mode to unlock the Rod Method Mode';
  25030. xGame.uiMgr.Show(UIMsg$1, tipStr);
  25031. return;
  25032. }
  25033. else {
  25034. console.log('zh:可以玩该模式 bigMove');
  25035. this.beginGame();
  25036. if (DataMgr.getNewUser())
  25037. Moyu.sendDataEvent("gameStart0");
  25038. }
  25039. }
  25040. else {
  25041. this.beginGame();
  25042. if (DataMgr.getNewUser())
  25043. Moyu.sendDataEvent("gameStart0");
  25044. }
  25045. break;
  25046. default:
  25047. console.error('zh:未知错误!!!!');
  25048. break;
  25049. }
  25050. }
  25051. beginGame(isNice = false) {
  25052. console.log('zh:beginGame ');
  25053. let guide = DataMgr.getSkillGuide();
  25054. if (guide == 1) {
  25055. console.log('zh:非新手引导,showInternAd ');
  25056. JSBridgeUtils.instance.showInternAd('beginGame');
  25057. }
  25058. else {
  25059. console.log('zh:新手引导,不显示AD ');
  25060. }
  25061. console.log('zh:beginGame gameMode=' + xGame.common.gameMode);
  25062. console.log('zh:beginGame 1');
  25063. if (xGame.common.gameMode == GameMode.classic) {
  25064. console.log('zh:beginGame 2');
  25065. if (isNice) {
  25066. console.log('zh:进入巅峰赛');
  25067. this.enterClassic();
  25068. }
  25069. else {
  25070. console.log('zh:beginGame 3-1');
  25071. xGame.uiMgr.Show(UIModeSelection$1, () => {
  25072. console.log('zh:beginGame 3-2');
  25073. this.enterClassic();
  25074. });
  25075. }
  25076. }
  25077. else if (xGame.common.gameMode == GameMode.bigMove) {
  25078. console.log('zh:beginGame 5');
  25079. this.ui.enterGuide.visible = false;
  25080. xGame.uiMgr.Show(UISkill$1);
  25081. }
  25082. }
  25083. enterClassic() {
  25084. console.log('zh:beginGame 7');
  25085. xGame.uiMgr.Show(UIGame$1);
  25086. xGame.uiMgr.Show(UIMatching$1, () => {
  25087. if (!this.isHide)
  25088. this.hide();
  25089. xGame.common.gameUI.ui.alpha = 1;
  25090. console.log('zh:beginGame 8');
  25091. xGame.common.gameUI.startGame();
  25092. xGame.uiMgr.Hide(UIGameEnd$1);
  25093. });
  25094. }
  25095. start_debug_for_moni_payOk() {
  25096. let ccc = this.moni_click_count + 1;
  25097. this.moni_click_count = ccc;
  25098. if (ccc % 5 == 0) {
  25099. console.log('zh:start_debug_for_moni_payOk');
  25100. let userInfo = LocalStorageManager.getItem(keyForLoginInfo);
  25101. if (userInfo != null) {
  25102. let token = userInfo.token;
  25103. let ggSpid = 'com.vadltq.strike.ball.cue.gem50';
  25104. JSBridgeUtils.instance.testPay1ForMoNiPayOver(token, ggSpid, 1);
  25105. alert('模拟支付OK');
  25106. return;
  25107. }
  25108. else {
  25109. xGame.uiMgr.Show(UIMsg$1, TIP_MSG_key.pleaseLoginIn);
  25110. }
  25111. }
  25112. }
  25113. startGlobal() {
  25114. xGame.uiMgr.Show(UIMsg$1, "Coming Soon.");
  25115. }
  25116. startWeekly() {
  25117. xGame.uiMgr.Show(UIMsg$1, "Coming Soon");
  25118. }
  25119. zhouSaiMonth() {
  25120. console.log('zh: zhouSaiMonth 被调用');
  25121. }
  25122. isReadyForLoadNetSource() {
  25123. let reqCount = xGame.cfgMgr.httpReqCount;
  25124. let ok = xGame.cfgMgr.httpReqOkCount;
  25125. if (reqCount > ok) {
  25126. xGame.uiMgr.Show(UIMsg$1, "Network not ready. Try again later.");
  25127. console.log('zh:✅❌ 5秒后重新尝试加载网络资源');
  25128. Laya.timer.once(5000, this, () => {
  25129. let retryCount = 0;
  25130. const maxRetries = 3;
  25131. const tryFetchConfig = () => {
  25132. try {
  25133. xGame.cfgMgr.getConfigFromServer();
  25134. }
  25135. catch (error) {
  25136. if (retryCount < maxRetries) {
  25137. retryCount++;
  25138. console.log(`🔄 第${retryCount}次重试获取配置...`);
  25139. Laya.timer.once(5000, this, tryFetchConfig);
  25140. }
  25141. else {
  25142. console.error("❌ 达到最大重试次数,配置获取失败");
  25143. }
  25144. }
  25145. };
  25146. tryFetchConfig();
  25147. });
  25148. return false;
  25149. }
  25150. return true;
  25151. }
  25152. startPlaceBall() {
  25153. if (!this.isReadyForLoadNetSource()) {
  25154. return;
  25155. }
  25156. xGame.uiMgr.Show(UILevelDisplay$1);
  25157. }
  25158. hide() {
  25159. console.log('zh:uimain hide ...');
  25160. super.hide();
  25161. xGame.common.stopGirlPop(this.ui.talkNode);
  25162. }
  25163. onGetUserInfo(force = false) {
  25164. if (Moyu.isWx) {
  25165. let info = Moyu.getSystemInfo();
  25166. if (info)
  25167. Moyu.createWXUserBtn(0, 0, info.width, info.height, 'res/wxuser.png', this.freshUser);
  25168. }
  25169. else {
  25170. Moyu.initUser(this, this.freshUser, force);
  25171. }
  25172. this.freshUser();
  25173. console.log('zh:5秒后更新用户信息');
  25174. setTimeout(() => {
  25175. DataMgr.getUserZiChanInfo(true);
  25176. }, 5000);
  25177. }
  25178. event_login_in() {
  25179. console.log("zh:event_login_in被触发");
  25180. this.freshUser();
  25181. }
  25182. freshUser() {
  25183. let user = Moyu.getUserInfo();
  25184. if (!user.isAuth) {
  25185. user.headIcon = 'res/ty_touxiang.png';
  25186. }
  25187. else {
  25188. DataMgr.upRankData();
  25189. }
  25190. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
  25191. xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
  25192. let keyStr = keyForLoginInfo;
  25193. if (LocalStorageManager.hasJosnKey(keyStr)) {
  25194. const d = LocalStorageManager.getItem(keyStr);
  25195. let ua = d.username;
  25196. this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
  25197. }
  25198. else {
  25199. }
  25200. this.c_btn_for_user();
  25201. }
  25202. interuptSecretary() {
  25203. Laya.timer.clearAll(this);
  25204. this.playSecretaryRandomSound();
  25205. }
  25206. playSecretaryRandomSound() {
  25207. if (this.isHide)
  25208. return;
  25209. let time = xGame.common.randomNum(45000, 60000);
  25210. Laya.timer.once(time, this, () => {
  25211. if (this.isHide)
  25212. return;
  25213. let index = xGame.common.randomNum(4, 7);
  25214. xGame.soundMgr.playSound("s_main0" + index);
  25215. let words = 1;
  25216. switch (index) {
  25217. case 4:
  25218. words = 5;
  25219. break;
  25220. case 5:
  25221. words = 3;
  25222. break;
  25223. case 6:
  25224. words = 6;
  25225. break;
  25226. case 7:
  25227. words = 7;
  25228. break;
  25229. default:
  25230. break;
  25231. }
  25232. xGame.common.showGirlTalkPop(words, this.ui.talkNode, this.ui.talkNode.womanTxt);
  25233. this.playSecretaryRandomSound();
  25234. });
  25235. }
  25236. openSecretaryView() {
  25237. xGame.uiMgr.Show(UISecretary$1);
  25238. Moyu.sendDataEvent("secretary");
  25239. }
  25240. openShopView() {
  25241. xGame.uiMgr.Show(UIShop$1, 1);
  25242. }
  25243. openShopView0() {
  25244. xGame.uiMgr.Show(UIShop$1, 0);
  25245. }
  25246. openSignView() {
  25247. xGame.uiMgr.Show(UISign$1);
  25248. }
  25249. openDrawView() {
  25250. xGame.uiMgr.Show(UIDraw$1);
  25251. }
  25252. openRanking() {
  25253. console.log('zh:phb openRanking');
  25254. xGame.uiMgr.Show(UIRanking$1);
  25255. Moyu.sendDataEvent("rankingList");
  25256. }
  25257. }
  25258. UIMain$1.uiName = "UIMain";
  25259. function InitShader() {
  25260. }
  25261. function appInit() {
  25262. xGame.context.init(getLoadingResList(), initCallback);
  25263. }
  25264. function getLoadingResList() {
  25265. return [
  25266. { url: "fgui/loading_atlas0.png", type: Laya.Loader.IMAGE },
  25267. { url: "fgui/loading.obj", type: Laya.Loader.BUFFER }
  25268. ];
  25269. }
  25270. function getGameResList() {
  25271. return [
  25272. { url: "asset/fgui/game.obj", type: Laya.Loader.BUFFER },
  25273. { url: "asset/fgui/game_atlas0.png", type: Laya.Loader.IMAGE },
  25274. { url: "asset/fgui/game_atlas0_1.png", type: Laya.Loader.IMAGE },
  25275. { url: "asset/fgui/game_atlas0_2.png", type: Laya.Loader.IMAGE },
  25276. { url: "asset/fgui/game_atlas0_3.png", type: Laya.Loader.IMAGE },
  25277. { url: "asset/fgui/game_atlas10.png", type: Laya.Loader.IMAGE },
  25278. { url: "asset/fgui/game_atlas_n43d3v3.png", type: Laya.Loader.IMAGE },
  25279. { url: "asset/fgui/game_atlas_n43d3v4.png", type: Laya.Loader.IMAGE },
  25280. { url: "asset/fgui/game_atlas_p4tr427.png", type: Laya.Loader.IMAGE },
  25281. { url: "asset/fgui/game_atlas_p4tr42b.png", type: Laya.Loader.IMAGE },
  25282. { url: "asset/fgui/game_atlas_p4tr42c.png", type: Laya.Loader.IMAGE },
  25283. { url: "asset/fgui/game_atlas_p4tr42e.png", type: Laya.Loader.IMAGE },
  25284. { url: "asset/fgui/game_atlas_rz5r457.jpg", type: Laya.Loader.IMAGE },
  25285. { url: "asset/fgui/game_atlas_s8sz44t.png", type: Laya.Loader.IMAGE },
  25286. { url: "asset/fgui/game_atlas_s8sz44v.png", type: Laya.Loader.IMAGE },
  25287. { url: "asset/fgui/game_atlas_wehi3uc.jpg", type: Laya.Loader.IMAGE },
  25288. { url: "res/font/arial.ttf", type: Laya.Loader.FONT },
  25289. ];
  25290. }
  25291. function initCallback() {
  25292. window["DataMgr"] = DataMgr;
  25293. DataMgr.Init();
  25294. Moyu.init(getPlat(), this, () => {
  25295. DataMgr.isNewDay();
  25296. PlatMgr.initConfig();
  25297. xGame.common.curRankID = Moyu.isWx ? xGame.common.rankID.wxStar : xGame.common.rankID.normalStar;
  25298. }, true);
  25299. console.log('zh:开始sm init1 start');
  25300. xGame.soundMgr.init();
  25301. console.log('zh:开始sm init1 end');
  25302. xGame.uiMgr.init();
  25303. xGame.uiMgr.clearTempData();
  25304. xGame.uiMgr.bindFUI(fguiRes.loading);
  25305. xGame.uiMgr.Show(UILoading);
  25306. }
  25307. function onFontLoaded() {
  25308. try {
  25309. Laya.Text.defaultFont = "arial";
  25310. console.log("zh: onFontLoaded 设置arial字体成功");
  25311. }
  25312. catch (error) {
  25313. console.log("zh: constructor onFontLoaded加载arial字体失败");
  25314. }
  25315. }
  25316. function loadSubRes(callback) {
  25317. var tab = ["asset", "res", "spine"];
  25318. let subDone = 0;
  25319. for (var i = 0; i < tab.length; i++) {
  25320. let sub = tab[i];
  25321. Moyu.loadSubRes(sub, (pro) => {
  25322. callback && callback(pro, false);
  25323. }).then(() => {
  25324. subDone++;
  25325. if (subDone >= tab.length)
  25326. callback && callback(1, true);
  25327. });
  25328. }
  25329. }
  25330. function enterGame() {
  25331. xGame.cfgMgr.init();
  25332. xGame.soundMgr.onSetting(DataMgr.userData.sound);
  25333. Moyu.onSetting(DataMgr.userData.sound, DataMgr.userData.vibration);
  25334. xGame.uiMgr.Hide(UILoading);
  25335. fgui.UIPackage.removePackage(fguiRes.loading);
  25336. xGame.uiMgr.bindFUI(fguiRes.game);
  25337. xGame.uiMgr.Show(UIMain$1);
  25338. if (DataMgr.getNewUser())
  25339. Moyu.sendDataEvent("logOn", { newPlayerTime: new Date() });
  25340. }
  25341. function getPlat() {
  25342. let cfg = new MoyuCfg();
  25343. cfg.plat = MoyuPlat.web;
  25344. cfg.myId = 180;
  25345. cfg.myKey = '8848a885774230a4';
  25346. cfg.version = 0;
  25347. if (window.hasOwnProperty("gamebox")) {
  25348. cfg.plat = MoyuPlat.f399;
  25349. cfg.version = 0;
  25350. }
  25351. else if (window.hasOwnProperty("ks")) {
  25352. cfg.plat = MoyuPlat.ks;
  25353. cfg.version = 0;
  25354. cfg.ads.ksVideoId = '2300002254_01';
  25355. cfg.ads.ksInsertId = '2300002254_02';
  25356. }
  25357. else if (Laya.Browser.onTTMiniGame) {
  25358. cfg.plat = MoyuPlat.tt;
  25359. cfg.version = 0;
  25360. cfg.ads.ttVideoId = '55lg4hiq6cl1i98a01';
  25361. cfg.ads.ttInsertId = '163l1f09abb0fm5l05';
  25362. cfg.ads.ttBannerId = "349ld7libg2l5h9a3l";
  25363. }
  25364. else if (Laya.Browser.onMiniGame) {
  25365. cfg.plat = MoyuPlat.wx;
  25366. cfg.ads.wxBannerId = 'adunit-fb4acc9e4c4d8c7c';
  25367. cfg.ads.wxInsertId = 'adunit-1c0437c20853677c';
  25368. cfg.ads.wxVideoId = 'adunit-51758e3d8d649e01';
  25369. }
  25370. else if (Laya.Browser.onQQMiniGame) {
  25371. cfg.plat = MoyuPlat.qq;
  25372. }
  25373. else if (Laya.Browser.onQGMiniGame) {
  25374. cfg.plat = MoyuPlat.op;
  25375. cfg.ads.opVideoId = '455502';
  25376. cfg.ads.opBannerId = '455507';
  25377. }
  25378. else if (Laya.Browser.onVVMiniGame) {
  25379. cfg.plat = MoyuPlat.vv;
  25380. cfg.version = 0;
  25381. cfg.ads.vvVideoId = '405d0513a3964187bfb37aca09da5f45';
  25382. cfg.ads.vvInsertId = '72b18a69075c410986ff16e43fb2b0f0';
  25383. cfg.ads.vvBannerId = 'fe2d2b92dbc144e086df5150b7d3d3d1';
  25384. }
  25385. else if (Laya.Browser.onHWMiniGame) {
  25386. cfg.plat = MoyuPlat.hw;
  25387. }
  25388. else if (window["mz"]) {
  25389. cfg.plat = MoyuPlat.mz;
  25390. }
  25391. else {
  25392. let cfg = window['conchConfig'];
  25393. if (cfg) {
  25394. var os = cfg.getOS();
  25395. if (os == "Conch-ios") {
  25396. cfg.plat = MoyuPlat.ios;
  25397. }
  25398. else if (os == "Conch-android") {
  25399. }
  25400. }
  25401. }
  25402. return cfg;
  25403. }
  25404. class Main {
  25405. constructor() {
  25406. if (window["Laya3D"])
  25407. Laya3D.init(GameConfig.width, GameConfig.height, null, Laya.Handler.create(this, this.initMain));
  25408. else {
  25409. Laya.init(GameConfig.width, GameConfig.height, Laya["WebGL"]);
  25410. this.initMain();
  25411. }
  25412. }
  25413. initMain() {
  25414. Laya["Physics"] && Laya["Physics"].enable();
  25415. Laya["DebugPanel"] && Laya["DebugPanel"].enable();
  25416. Laya.stage.scaleMode = GameConfig.scaleMode;
  25417. Laya.stage.screenMode = GameConfig.screenMode;
  25418. Laya.stage.alignV = GameConfig.alignV;
  25419. Laya.stage.alignH = GameConfig.alignH;
  25420. Laya.URL.exportSceneToJson = GameConfig.exportSceneToJson;
  25421. if (GameConfig.debug || Laya.Utils.getQueryString("debug") == "true")
  25422. Laya.enableDebugPanel();
  25423. if (GameConfig.physicsDebug && Laya["PhysicsDebugDraw"])
  25424. Laya["PhysicsDebugDraw"].enable();
  25425. if (GameConfig.stat)
  25426. Laya.Stat.show();
  25427. Laya.alertGlobalError(true);
  25428. this.loadFont();
  25429. Laya.ResourceVersion.enable("version.json", Laya.Handler.create(this, this.onVersionLoaded), Laya.ResourceVersion.FILENAME_VERSION);
  25430. }
  25431. loadFont() {
  25432. try {
  25433. Laya.loader.load("res/font/arial.ttf", Laya.Handler.create(this, this.onFontLoaded));
  25434. console.log("zh: constructor加载arial字体成功1");
  25435. }
  25436. catch (error) {
  25437. console.log("zh: constructor加载arial字体失败1");
  25438. }
  25439. }
  25440. onFontLoaded() {
  25441. try {
  25442. Laya.Text.defaultFont = "Arial";
  25443. console.log("zh: onFontLoaded 设置arial字体成功1");
  25444. }
  25445. catch (error) {
  25446. console.log("zh: constructor onFontLoaded加载arial字体失败1");
  25447. }
  25448. }
  25449. onVersionLoaded() {
  25450. appInit();
  25451. }
  25452. }
  25453. new Main();
  25454. }());
  25455. //# sourceMappingURL=bundle.js.map